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