socket.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. struct msghdr {
  2. void *msg_name;
  3. socklen_t msg_namelen;
  4. struct iovec *msg_iov;
  5. int msg_iovlen;
  6. void *msg_control;
  7. socklen_t msg_controllen;
  8. int msg_flags;
  9. };
  10. struct cmsghdr {
  11. socklen_t cmsg_len;
  12. int cmsg_level;
  13. int cmsg_type;
  14. };
  15. #define SOCK_STREAM 2
  16. #define SOCK_DGRAM 1
  17. #define SOL_SOCKET 65535
  18. #define SO_DEBUG 1
  19. #define SO_REUSEADDR 0x0004
  20. #define SO_KEEPALIVE 0x0008
  21. #define SO_DONTROUTE 0x0010
  22. #define SO_BROADCAST 0x0020
  23. #define SO_LINGER 0x0080
  24. #define SO_OOBINLINE 0x0100
  25. #define SO_REUSEPORT 0x0200
  26. #define SO_SNDBUF 0x1001
  27. #define SO_RCVBUF 0x1002
  28. #define SO_SNDLOWAT 0x1003
  29. #define SO_RCVLOWAT 0x1004
  30. #define SO_RCVTIMEO 0x1006
  31. #define SO_SNDTIMEO 0x1005
  32. #define SO_ERROR 0x1007
  33. #define SO_TYPE 0x1008
  34. #define SO_ACCEPTCONN 0x1009
  35. #define SO_PROTOCOL 0x1028
  36. #define SO_DOMAIN 0x1029
  37. #define SO_NO_CHECK 11
  38. #define SO_PRIORITY 12
  39. #define SO_BSDCOMPAT 14
  40. #define SO_PASSCRED 17
  41. #define SO_PEERCRED 18
  42. #define SO_SNDBUFFORCE 31
  43. #define SO_RCVBUFFORCE 33
  44. #define SOCK_NONBLOCK 0200
  45. #define SOCK_CLOEXEC 02000000