inet_common.h 1.8 KB

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