blob: 22fac9892b160c06cecb83d8b98c9fcef155ebd8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _INET_COMMON_H
2#define _INET_COMMON_H
3
Changli Gao53d31762010-07-10 20:41:06 +00004extern const struct proto_ops inet_stream_ops;
5extern const struct proto_ops inet_dgram_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
7/*
8 * INET4 prototypes used by INET6
9 */
10
Arnaldo Carvalho de Melo77d8bf92005-08-09 20:00:51 -070011struct msghdr;
12struct sock;
13struct sockaddr;
14struct socket;
15
Changli Gao53d31762010-07-10 20:41:06 +000016extern int inet_release(struct socket *sock);
17extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr,
18 int addr_len, int flags);
19extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr,
20 int addr_len, int flags);
21extern int inet_accept(struct socket *sock, struct socket *newsock, int flags);
22extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock,
23 struct msghdr *msg, size_t size);
Changli Gao7ba42912010-07-10 20:41:55 +000024extern ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
25 size_t size, int flags);
26extern int inet_recvmsg(struct kiocb *iocb, struct socket *sock,
27 struct msghdr *msg, size_t size, int flags);
Changli Gao53d31762010-07-10 20:41:06 +000028extern int inet_shutdown(struct socket *sock, int how);
29extern int inet_listen(struct socket *sock, int backlog);
30extern void inet_sock_destruct(struct sock *sk);
31extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
32extern int inet_getname(struct socket *sock, struct sockaddr *uaddr,
33 int *uaddr_len, int peer);
34extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
35extern int inet_ctl_sock_create(struct sock **sk, unsigned short family,
36 unsigned short type, unsigned char protocol,
37 struct net *net);
Denis V. Lunev56772422008-04-03 14:28:30 -070038
39static inline void inet_ctl_sock_destroy(struct sock *sk)
40{
41 sk_release_kernel(sk);
42}
Denis V. Lunev3d58b5f2008-04-03 14:22:32 -070043
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#endif