blob: 109e3ee9108c0e0219f6cb64a21dc68f1f519ff6 [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
Joe Perches1fd51152013-09-21 10:22:41 -070016int inet_release(struct socket *sock);
17int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
18 int addr_len, int flags);
19int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
20 int addr_len, int flags);
21int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr,
22 int addr_len, int flags);
23int inet_accept(struct socket *sock, struct socket *newsock, int flags);
Ying Xue1b784142015-03-02 15:37:48 +080024int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size);
Joe Perches1fd51152013-09-21 10:22:41 -070025ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
26 size_t size, int flags);
Ying Xue1b784142015-03-02 15:37:48 +080027int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
28 int flags);
Joe Perches1fd51152013-09-21 10:22:41 -070029int inet_shutdown(struct socket *sock, int how);
30int inet_listen(struct socket *sock, int backlog);
31void inet_sock_destruct(struct sock *sk);
32int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
33int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len,
34 int peer);
35int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
36int inet_ctl_sock_create(struct sock **sk, unsigned short family,
37 unsigned short type, unsigned char protocol,
38 struct net *net);
Willem de Bruijnf4713a32014-11-26 14:53:02 -050039int inet_recv_error(struct sock *sk, struct msghdr *msg, int len,
40 int *addr_len);
Denis V. Lunev56772422008-04-03 14:28:30 -070041
42static inline void inet_ctl_sock_destroy(struct sock *sk)
43{
Eric Dumazet8fa677d2015-11-02 07:50:07 -080044 if (sk)
45 sock_release(sk->sk_socket);
Denis V. Lunev56772422008-04-03 14:28:30 -070046}
Denis V. Lunev3d58b5f2008-04-03 14:22:32 -070047
Linus Torvalds1da177e2005-04-16 15:20:36 -070048#endif