blob: 5d683428fced65af56d83ab584bbbee1c089e8f0 [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
Tom Herbertb8921ca2016-05-18 09:06:23 -070042struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb);
43int inet_gro_complete(struct sk_buff *skb, int nhoff);
44struct sk_buff *inet_gso_segment(struct sk_buff *skb,
45 netdev_features_t features);
46
Denis V. Lunev56772422008-04-03 14:28:30 -070047static inline void inet_ctl_sock_destroy(struct sock *sk)
48{
Eric Dumazet8fa677d2015-11-02 07:50:07 -080049 if (sk)
50 sock_release(sk->sk_socket);
Denis V. Lunev56772422008-04-03 14:28:30 -070051}
Denis V. Lunev3d58b5f2008-04-03 14:22:32 -070052
Linus Torvalds1da177e2005-04-16 15:20:36 -070053#endif