blob: f39ae697347f6590459ee4178de84160b43841e2 [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,
Willy Tarreau3979ad72017-01-25 14:42:46 +010020 int addr_len, int flags, int is_sendmsg);
Joe Perches1fd51152013-09-21 10:22:41 -070021int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr,
22 int addr_len, int flags);
David Howellscdfbabf2017-03-09 08:09:05 +000023int inet_accept(struct socket *sock, struct socket *newsock, int flags,
24 bool kern);
Ying Xue1b784142015-03-02 15:37:48 +080025int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size);
Joe Perches1fd51152013-09-21 10:22:41 -070026ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
27 size_t size, int flags);
Ying Xue1b784142015-03-02 15:37:48 +080028int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
29 int flags);
Joe Perches1fd51152013-09-21 10:22:41 -070030int inet_shutdown(struct socket *sock, int how);
31int inet_listen(struct socket *sock, int backlog);
32void inet_sock_destruct(struct sock *sk);
33int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
34int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len,
35 int peer);
36int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
37int inet_ctl_sock_create(struct sock **sk, unsigned short family,
38 unsigned short type, unsigned char protocol,
39 struct net *net);
Willem de Bruijnf4713a32014-11-26 14:53:02 -050040int inet_recv_error(struct sock *sk, struct msghdr *msg, int len,
41 int *addr_len);
Denis V. Lunev56772422008-04-03 14:28:30 -070042
Tom Herbertb8921ca2016-05-18 09:06:23 -070043struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb);
44int inet_gro_complete(struct sk_buff *skb, int nhoff);
45struct sk_buff *inet_gso_segment(struct sk_buff *skb,
46 netdev_features_t features);
47
Denis V. Lunev56772422008-04-03 14:28:30 -070048static inline void inet_ctl_sock_destroy(struct sock *sk)
49{
Eric Dumazet8fa677d2015-11-02 07:50:07 -080050 if (sk)
51 sock_release(sk->sk_socket);
Denis V. Lunev56772422008-04-03 14:28:30 -070052}
Denis V. Lunev3d58b5f2008-04-03 14:22:32 -070053
Linus Torvalds1da177e2005-04-16 15:20:36 -070054#endif