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 | |
Changli Gao | 53d3176 | 2010-07-10 20:41:06 +0000 | [diff] [blame] | 16 | extern int inet_release(struct socket *sock); |
Yuchung Cheng | cf60af0 | 2012-07-19 06:43:09 +0000 | [diff] [blame] | 17 | extern int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, |
Changli Gao | 53d3176 | 2010-07-10 20:41:06 +0000 | [diff] [blame] | 18 | int addr_len, int flags); |
Yuchung Cheng | cf60af0 | 2012-07-19 06:43:09 +0000 | [diff] [blame] | 19 | extern int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, |
| 20 | int addr_len, int flags); |
| 21 | extern int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, |
Changli Gao | 53d3176 | 2010-07-10 20:41:06 +0000 | [diff] [blame] | 22 | int addr_len, int flags); |
| 23 | extern int inet_accept(struct socket *sock, struct socket *newsock, int flags); |
| 24 | extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock, |
| 25 | struct msghdr *msg, size_t size); |
Changli Gao | 7ba4291 | 2010-07-10 20:41:55 +0000 | [diff] [blame] | 26 | extern ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, |
| 27 | size_t size, int flags); |
| 28 | extern int inet_recvmsg(struct kiocb *iocb, struct socket *sock, |
| 29 | struct msghdr *msg, size_t size, int flags); |
Changli Gao | 53d3176 | 2010-07-10 20:41:06 +0000 | [diff] [blame] | 30 | extern int inet_shutdown(struct socket *sock, int how); |
| 31 | extern int inet_listen(struct socket *sock, int backlog); |
| 32 | extern void inet_sock_destruct(struct sock *sk); |
| 33 | extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); |
| 34 | extern int inet_getname(struct socket *sock, struct sockaddr *uaddr, |
| 35 | int *uaddr_len, int peer); |
| 36 | extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 37 | extern int inet_ctl_sock_create(struct sock **sk, unsigned short family, |
| 38 | unsigned short type, unsigned char protocol, |
| 39 | struct net *net); |
Denis V. Lunev | 5677242 | 2008-04-03 14:28:30 -0700 | [diff] [blame] | 40 | |
| 41 | static inline void inet_ctl_sock_destroy(struct sock *sk) |
| 42 | { |
| 43 | sk_release_kernel(sk); |
| 44 | } |
Denis V. Lunev | 3d58b5f | 2008-04-03 14:22:32 -0700 | [diff] [blame] | 45 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | #endif |