inet_common.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. extern int inet_release(struct socket *sock);
  13. extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr,
  14. int addr_len, int flags);
  15. extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr,
  16. int addr_len, int flags);
  17. extern int inet_accept(struct socket *sock, struct socket *newsock, int flags);
  18. extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock,
  19. struct msghdr *msg, size_t size);
  20. extern ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
  21. size_t size, int flags);
  22. extern int inet_recvmsg(struct kiocb *iocb, struct socket *sock,
  23. struct msghdr *msg, size_t size, int flags);
  24. extern int inet_shutdown(struct socket *sock, int how);
  25. extern int inet_listen(struct socket *sock, int backlog);
  26. extern void inet_sock_destruct(struct sock *sk);
  27. extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
  28. extern int inet_getname(struct socket *sock, struct sockaddr *uaddr,
  29. int *uaddr_len, int peer);
  30. extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
  31. extern int inet_ctl_sock_create(struct sock **sk, unsigned short family,
  32. unsigned short type, unsigned char protocol,
  33. struct net *net);
  34. static inline void inet_ctl_sock_destroy(struct sock *sk)
  35. {
  36. sk_release_kernel(sk);
  37. }
  38. #endif