Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _INET_COMMON_H |
| 2 | #define _INET_COMMON_H |
| 3 | |
Changli Gao | 53d3176 | 2010-07-10 20:41:06 +0000 | [diff] [blame] | 4 | extern const struct proto_ops inet_stream_ops; |
| 5 | extern const struct proto_ops inet_dgram_ops; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
| 7 | /* |
| 8 | * INET4 prototypes used by INET6 |
| 9 | */ |
| 10 | |
Arnaldo Carvalho de Melo | 77d8bf9 | 2005-08-09 20:00:51 -0700 | [diff] [blame] | 11 | struct msghdr; |
| 12 | struct sock; |
| 13 | struct sockaddr; |
| 14 | struct socket; |
| 15 | |
Joe Perches | 1fd5115 | 2013-09-21 10:22:41 -0700 | [diff] [blame] | 16 | int inet_release(struct socket *sock); |
| 17 | int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, |
| 18 | int addr_len, int flags); |
| 19 | int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, |
Willy Tarreau | 3979ad7 | 2017-01-25 14:42:46 +0100 | [diff] [blame] | 20 | int addr_len, int flags, int is_sendmsg); |
Joe Perches | 1fd5115 | 2013-09-21 10:22:41 -0700 | [diff] [blame] | 21 | int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, |
| 22 | int addr_len, int flags); |
| 23 | int inet_accept(struct socket *sock, struct socket *newsock, int flags); |
Ying Xue | 1b78414 | 2015-03-02 15:37:48 +0800 | [diff] [blame] | 24 | int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size); |
Joe Perches | 1fd5115 | 2013-09-21 10:22:41 -0700 | [diff] [blame] | 25 | ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, |
| 26 | size_t size, int flags); |
Ying Xue | 1b78414 | 2015-03-02 15:37:48 +0800 | [diff] [blame] | 27 | int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, |
| 28 | int flags); |
Joe Perches | 1fd5115 | 2013-09-21 10:22:41 -0700 | [diff] [blame] | 29 | int inet_shutdown(struct socket *sock, int how); |
| 30 | int inet_listen(struct socket *sock, int backlog); |
| 31 | void inet_sock_destruct(struct sock *sk); |
| 32 | int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); |
| 33 | int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, |
| 34 | int peer); |
| 35 | int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 36 | int inet_ctl_sock_create(struct sock **sk, unsigned short family, |
| 37 | unsigned short type, unsigned char protocol, |
| 38 | struct net *net); |
Willem de Bruijn | f4713a3 | 2014-11-26 14:53:02 -0500 | [diff] [blame] | 39 | int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, |
| 40 | int *addr_len); |
Denis V. Lunev | 5677242 | 2008-04-03 14:28:30 -0700 | [diff] [blame] | 41 | |
Tom Herbert | b8921ca | 2016-05-18 09:06:23 -0700 | [diff] [blame] | 42 | struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb); |
| 43 | int inet_gro_complete(struct sk_buff *skb, int nhoff); |
| 44 | struct sk_buff *inet_gso_segment(struct sk_buff *skb, |
| 45 | netdev_features_t features); |
| 46 | |
Denis V. Lunev | 5677242 | 2008-04-03 14:28:30 -0700 | [diff] [blame] | 47 | static inline void inet_ctl_sock_destroy(struct sock *sk) |
| 48 | { |
Eric Dumazet | 8fa677d | 2015-11-02 07:50:07 -0800 | [diff] [blame] | 49 | if (sk) |
| 50 | sock_release(sk->sk_socket); |
Denis V. Lunev | 5677242 | 2008-04-03 14:28:30 -0700 | [diff] [blame] | 51 | } |
Denis V. Lunev | 3d58b5f | 2008-04-03 14:22:32 -0700 | [diff] [blame] | 52 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | #endif |