unpxti.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /* include unpxtih1 */
  2. #ifndef __unp_xti_h
  3. #define __unp_xti_h
  4. #include "unp.h"
  5. #include <xti.h>
  6. #ifdef HAVE_XTI_INET_H
  7. # include <xti_inet.h>
  8. #endif
  9. #ifdef HAVE_NETCONFIG_H
  10. # include <netconfig.h>
  11. #endif
  12. #ifdef HAVE_NETDIR_H
  13. # include <netdir.h>
  14. #endif
  15. #ifdef INFTIM_UNPH
  16. #undef INFTIM /* was not in <poll.h>, undef for <stropts.h> */
  17. #endif
  18. #include <stropts.h>
  19. /* Provide compatibility with the new names prepended with T_
  20. in XNS Issue 5, which are not in Posix.1g. */
  21. #ifndef T_INET_TCP
  22. #define T_INET_TCP INET_TCP
  23. /* $$.Ic T_INET_TCP$$ */
  24. #endif
  25. /* end unpxtih1 */
  26. #ifndef T_INET_UDP
  27. #define T_INET_UDP INET_UDP
  28. #endif
  29. #ifndef T_INET_IP
  30. #define T_INET_IP INET_IP
  31. #endif
  32. #ifndef T_TCP_NODELAY
  33. #define T_TCP_NODELAY TCP_NODELAY
  34. #endif
  35. #ifndef T_TCP_MAXSEG
  36. #define T_TCP_MAXSEG TCP_MAXSEG
  37. #endif
  38. #ifndef T_TCP_KEEPALIVE
  39. #define T_TCP_KEEPALIVE TCP_KEEPALIVE
  40. #endif
  41. #ifndef T_UDP_CHECKSUM
  42. #define T_UDP_CHECKSUM UDP_CHECKSUM
  43. #endif
  44. #ifndef T_IP_OPTIONS
  45. #define T_IP_OPTIONS IP_OPTIONS
  46. #endif
  47. #ifndef T_IP_TOS
  48. #define T_IP_TOS IP_TOS
  49. #endif
  50. #ifndef T_IP_TTL
  51. #define T_IP_TTL IP_TTL
  52. #endif
  53. #ifndef T_IP_REUSEADDR
  54. #define T_IP_REUSEADDR IP_REUSEADDR
  55. #endif
  56. #ifndef T_IP_DONTROUTE
  57. #define T_IP_DONTROUTE IP_DONTROUTE
  58. #endif
  59. /* include unpxtih2 */
  60. #ifndef T_IP_BROADCAST
  61. #define T_IP_BROADCAST IP_BROADCAST
  62. /* $$.Ic T_IP_BROADCAST$$ */
  63. #endif
  64. /* Define the appropriate devices for t_open(). */
  65. #ifdef HAVE_DEV_TCP
  66. # define XTI_TCP "/dev/tcp"
  67. # define XTI_UDP "/dev/udp"
  68. #endif
  69. #ifdef HAVE_DEV_XTI_TCP
  70. # define XTI_TCP "/dev/xti/tcp"
  71. # define XTI_UDP "/dev/xti/udp"
  72. #endif
  73. #ifdef HAVE_DEV_STREAMS_XTISO_TCP
  74. # define XTI_TCP "/dev/streams/xtiso/tcp+" /* + for XPG4 */
  75. # define XTI_UDP "/dev/streams/xtiso/udp+" /* + for XPG4 */
  76. #endif
  77. /* 4device to t_open() for t_accept(); set by tcp_listen() */
  78. /* $$.Id xti_serv_dev$$ */
  79. extern char xti_serv_dev[];
  80. /* end unpxtih2 */
  81. void err_xti(const char *fmt, ...);
  82. void err_xti_ret(const char *fmt, ...);
  83. int Getmsg(int, struct strbuf *, struct strbuf *, int *);
  84. void Putmsg(int, const struct strbuf *, const struct strbuf *, int);
  85. #ifdef HAVE_NETCONFIG_H
  86. void *Setnetconfig(void);
  87. void *Setnetpath(void);
  88. #endif
  89. void *T_alloc(int, int, int);
  90. int T_accept(int, int, struct t_call *);
  91. void T_bind(int, const struct t_bind *, struct t_bind *);
  92. void T_close(int);
  93. void T_connect(int, const struct t_call *, struct t_call *);
  94. void T_free(void *, int);
  95. void T_getprotaddr(int, struct t_bind *, struct t_bind *);
  96. int T_getstate(int);
  97. void T_listen(int, struct t_call *);
  98. int T_look(int);
  99. int T_open(const char *, int, struct t_info *);
  100. void T_optmgmt(int, const struct t_optmgmt *, struct t_optmgmt *);
  101. int T_rcv(int, void *, unsigned int, int *);
  102. void T_rcvdis(int, struct t_discon *);
  103. void T_rcvrel(int);
  104. void T_rcvudata(int, struct t_unitdata *, int *);
  105. void T_rcvuderr(int, struct t_uderr *);
  106. void T_snd(int, void *, unsigned int, int);
  107. void T_sndrel(int);
  108. void T_sndudata(int, struct t_unitdata *);
  109. int xti_accept(int, struct netbuf *, int);
  110. int xti_getopt(int, int, int, void *, socklen_t *);
  111. char *xti_flags_str(int);
  112. char *xti_tlook_str(int);
  113. char *xti_ntop(const struct netbuf *);
  114. char *xti_ntop_host(const struct netbuf *);
  115. int xti_rdwr(int);
  116. int xti_setopt(int, int, int, void *, socklen_t);
  117. int Xti_accept(int, struct netbuf *, int);
  118. void Xti_getopt(int, int, int, void *, socklen_t *);
  119. char *Xti_flags_str(int);
  120. char *Xti_tlook_str(int);
  121. char *Xti_ntop(const struct netbuf *);
  122. char *Xti_ntop_host(const struct netbuf *);
  123. void Xti_rdwr(int);
  124. void Xti_setopt(int, int, int, void *, socklen_t);
  125. char *xti_str_lend(struct t_opthdr *);
  126. char *xti_str_uscalard(struct t_opthdr *);
  127. char *xti_str_uchard(struct t_opthdr *);
  128. char *xti_str_ucharx(struct t_opthdr *);
  129. char *xti_str_yn(t_uscalar_t);
  130. char *xti_str_syng(t_scalar_t);
  131. char *xti_str_uiyn(struct t_opthdr *);
  132. char *xti_str_usyn(struct t_opthdr *);
  133. char *xti_str_linger(struct t_opthdr *);
  134. char *xti_str_kpalive(struct t_opthdr *);
  135. char *xti_str_flags(t_scalar_t);
  136. #endif /* __unp_xti_h */