xref: /openbmc/linux/include/net/inet_common.h (revision 4da722ca)
1 #ifndef _INET_COMMON_H
2 #define _INET_COMMON_H
3 
4 extern const struct proto_ops inet_stream_ops;
5 extern const struct proto_ops inet_dgram_ops;
6 
7 /*
8  *	INET4 prototypes used by INET6
9  */
10 
11 struct msghdr;
12 struct sock;
13 struct sockaddr;
14 struct socket;
15 
16 int inet_release(struct socket *sock);
17 int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
18 			int addr_len, int flags);
19 int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr,
20 			  int addr_len, int flags, int is_sendmsg);
21 int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr,
22 		       int addr_len, int flags);
23 int inet_accept(struct socket *sock, struct socket *newsock, int flags,
24 		bool kern);
25 int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size);
26 ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
27 		      size_t size, int flags);
28 int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
29 		 int flags);
30 int inet_shutdown(struct socket *sock, int how);
31 int inet_listen(struct socket *sock, int backlog);
32 void inet_sock_destruct(struct sock *sk);
33 int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
34 int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len,
35 		 int peer);
36 int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
37 int inet_ctl_sock_create(struct sock **sk, unsigned short family,
38 			 unsigned short type, unsigned char protocol,
39 			 struct net *net);
40 int inet_recv_error(struct sock *sk, struct msghdr *msg, int len,
41 		    int *addr_len);
42 
43 struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb);
44 int inet_gro_complete(struct sk_buff *skb, int nhoff);
45 struct sk_buff *inet_gso_segment(struct sk_buff *skb,
46 				 netdev_features_t features);
47 
48 static inline void inet_ctl_sock_destroy(struct sock *sk)
49 {
50 	if (sk)
51 		sock_release(sk->sk_socket);
52 }
53 
54 #endif
55