You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
4.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /* source: xio-socket.h */
  2. /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
  3. /* Published under the GNU General Public License V.2, see file COPYING */
  4. #ifndef __xio_socket_h_included
  5. #define __xio_socket_h_included 1
  6. /* SO_PROTOTYPE is OS defined on Solaris, HP-UX; we lend this for a more
  7. general purpose */
  8. #ifndef SO_PROTOTYPE
  9. #define SO_PROTOTYPE 0x9999
  10. #endif
  11. extern const struct addrdesc xioaddr_socket_connect;
  12. extern const struct addrdesc xioaddr_socket_listen;
  13. extern const struct addrdesc xioaddr_socket_sendto;
  14. extern const struct addrdesc xioaddr_socket_datagram;
  15. extern const struct addrdesc xioaddr_socket_recvfrom;
  16. extern const struct addrdesc xioaddr_socket_recv;
  17. extern const struct optdesc opt_connect_timeout;
  18. extern const struct optdesc opt_so_debug;
  19. extern const struct optdesc opt_so_acceptconn;
  20. extern const struct optdesc opt_so_broadcast;
  21. extern const struct optdesc opt_so_reuseaddr;
  22. extern const struct optdesc opt_so_keepalive;
  23. extern const struct optdesc opt_so_linger;
  24. extern const struct optdesc opt_so_linger;
  25. extern const struct optdesc opt_so_oobinline;
  26. extern const struct optdesc opt_so_sndbuf;
  27. extern const struct optdesc opt_so_sndbuf_late;
  28. extern const struct optdesc opt_so_rcvbuf;
  29. extern const struct optdesc opt_so_rcvbuf_late;
  30. extern const struct optdesc opt_so_error;
  31. extern const struct optdesc opt_so_type;
  32. extern const struct optdesc opt_so_dontroute;
  33. extern const struct optdesc opt_so_rcvlowat;
  34. extern const struct optdesc opt_so_sndlowat;
  35. extern const struct optdesc opt_so_audit;
  36. extern const struct optdesc opt_so_attach_filter;
  37. extern const struct optdesc opt_so_detach_filter;
  38. extern const struct optdesc opt_so_bindtodevice;
  39. extern const struct optdesc opt_so_bsdcompat;
  40. extern const struct optdesc opt_so_cksumrecv;
  41. extern const struct optdesc opt_so_timestamp;
  42. extern const struct optdesc opt_so_kernaccept;
  43. extern const struct optdesc opt_so_no_check;
  44. extern const struct optdesc opt_so_noreuseaddr;
  45. extern const struct optdesc opt_so_passcred;
  46. extern const struct optdesc opt_so_peercred;
  47. extern const struct optdesc opt_so_priority;
  48. extern const struct optdesc opt_so_reuseport;
  49. extern const struct optdesc opt_so_security_authentication;
  50. extern const struct optdesc opt_so_security_encryption_network;
  51. extern const struct optdesc opt_so_security_encryption_transport;
  52. extern const struct optdesc opt_so_use_ifbufs;
  53. extern const struct optdesc opt_so_useloopback;
  54. extern const struct optdesc opt_so_dgram_errind;
  55. extern const struct optdesc opt_so_dontlinger;
  56. extern const struct optdesc opt_so_prototype;
  57. extern const struct optdesc opt_fiosetown;
  58. extern const struct optdesc opt_siocspgrp;
  59. extern const struct optdesc opt_bind;
  60. extern const struct optdesc opt_protocol_family;
  61. extern const struct optdesc opt_setsockopt_int;
  62. extern const struct optdesc opt_setsockopt_bin;
  63. extern const struct optdesc opt_setsockopt_string;
  64. extern const struct optdesc opt_null_eof;
  65. extern
  66. char *xiogetifname(int ind, char *val, int ins);
  67. extern int retropt_socket_pf(struct opt *opts, int *pf);
  68. extern int xioopen_connect(struct single *fd,
  69. struct sockaddr *us, size_t uslen,
  70. struct sockaddr *them, size_t themlen,
  71. struct opt *opts,
  72. int pf, int socktype, int protocol,
  73. bool alt);
  74. extern int _xioopen_connect(struct single *fd,
  75. struct sockaddr *us, size_t uslen,
  76. struct sockaddr *them, size_t themlen,
  77. struct opt *opts,
  78. int pf, int socktype, int protocol,
  79. bool alt, int level);
  80. /* common to xioopen_udp_sendto, ..unix_sendto, ..rawip */
  81. extern
  82. int _xioopen_dgram_sendto(/* them is already in xfd->peersa */
  83. union sockaddr_union *us, socklen_t uslen,
  84. struct opt *opts,
  85. int xioflags, xiosingle_t *xfd, unsigned groups,
  86. int pf, int socktype, int ipproto);
  87. extern
  88. int _xioopen_dgram_recvfrom(struct single *xfd, int xioflags,
  89. struct sockaddr *us, socklen_t uslen,
  90. struct opt *opts,
  91. int pf, int socktype, int proto, int level);
  92. extern
  93. int _xioopen_dgram_recv(struct single *xfd, int xioflags,
  94. struct sockaddr *us, socklen_t uslen,
  95. struct opt *opts, int pf, int socktype, int proto,
  96. int level);
  97. extern
  98. int xiodopacketinfo(struct msghdr *msgh, bool withlog, bool withenv);
  99. extern
  100. int xiogetpacketsrc(int fd, struct msghdr *msgh);
  101. extern
  102. int xiocheckpeer(xiosingle_t *xfd,
  103. union sockaddr_union *pa, union sockaddr_union *la);
  104. extern
  105. int xiosetsockaddrenv(const char *lr, union sockaddr_union *sau, socklen_t salen, int proto);
  106. extern
  107. int xioparsenetwork(const char *rangename, int pf,
  108. struct xiorange *range);
  109. extern
  110. int xioparserange(const char *rangename, int pf, struct xiorange *range);
  111. extern int
  112. xiosocket(struct opt *opts, int pf, int socktype, int proto, int level);
  113. extern int
  114. xiosocketpair(struct opt *opts, int pf, int socktype, int proto, int sv[2]);
  115. #endif /* !defined(__xio_socket_h_included) */