inet_common.h 2.0 KB

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