3 //=============================================================================
7 * @author Doug Schmidt <d.schmidt@vanderbilt.edu>
9 //=============================================================================
14 # include /**/ "ace/pre.h"
16 # include "ace/config-all.h"
18 # if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # endif /* ACE_LACKS_PRAGMA_ONCE */
22 # include "ace/OS_Errno.h"
23 # include "ace/ACE_export.h"
25 # if defined (ACE_EXPORT_MACRO)
26 # undef ACE_EXPORT_MACRO
28 # define ACE_EXPORT_MACRO ACE_Export
30 # if !(defined(ACE_HAS_TLI) || defined(ACE_HAS_XTI))
31 // Dummies to help compilation.
37 struct t_unitdata
{ };
41 # else /* !(ACE_HAS_TLI || ACE_HAS_XTI) */
43 # if defined (ACE_HAS_CONFLICTING_XTI_MACROS)
44 // Make sure tcp.h gets included before sys/xti.h.
45 # include "ace/os_include/netinet/os_tcp.h"
48 # endif /* ACE_HAS_CONFLICTING_XTI_MACROS */
50 # if defined (ACE_HAS_XTI)
51 # if defined (ACE_HAS_SYS_XTI_H) /* Nonstandard header placement */
52 # define class ace_xti_class
53 # include /**/ <sys/xti.h>
55 # elif defined (ACE_HAS_FORE_ATM_XTI)
56 # include /**/ <fore_xti/xti_user_types.h>
57 # include /**/ <fore_xti/xti.h>
58 # include /**/ <fore_xti/xti_atm.h>
59 # include /**/ <fore_xti/netatm/atm.h>
60 # include /**/ <fore_xti/ans.h>
62 # include /**/ <xti.h>
63 # endif /* ACE_HAS_SYS_XTI_H */
65 // The XTI API for obtaining local/peer addresses is t_getprotaddr().
66 // The ACE API was developed in TLI days and so uses t_getname().
67 // t_getname() has a type argument that specifies which address is
68 // desired, local or peer, while t_getprotaddr() gets both at once.
69 // t_getname() has values defined for the type, so these aren't defined
70 // for XTI systems. So, define them here for ACE API users to use.
71 // These values were taken from sys/tiuser.h on Solaris.
72 # if !defined (LOCALNAME)
75 # if !defined (REMOTENAME)
79 # else /* !ACE_HAS_XTI, so this is a TLI system */
80 # if !defined (ACE_HAS_TLI_PROTOTYPES)
82 // Define ACE_TLI headers for systems that don't prototype them....
85 int t_accept(int fildes
, int resfd
, struct t_call
*call
);
86 char *t_alloc(int fildes
, int struct_type
, int fields
);
87 int t_bind(int fildes
, struct t_bind
*req
, struct t_bind
*ret
);
88 int t_close(int fildes
);
89 int t_connect(int fildes
, struct t_call
*sndcall
,
90 struct t_call
*rcvcall
);
91 void t_error(const char *errmsg
);
92 int t_free(char *ptr
, int struct_type
);
93 int t_getinfo(int fildes
, struct t_info
*info
);
94 int t_getname (int fildes
, struct netbuf
*namep
, int type
);
95 int t_getstate(int fildes
);
96 int t_listen(int fildes
, struct t_call
*call
);
97 int t_look(int fildes
);
98 int t_open(char *path
, int oflag
, struct t_info
*info
);
99 int t_optmgmt(int fildes
, struct t_optmgmt
*req
,
100 struct t_optmgmt
*ret
);
101 int t_rcv(int fildes
, char *buf
, unsigned int nbytes
, int *flags
);
102 int t_rcvconnect(int fildes
, struct t_call
*call
);
103 int t_rcvdis(int fildes
, struct t_discon
*discon
);
104 int t_rcvrel(int fildes
);
105 int t_rcvudata(int fildes
, struct t_unitdata
*unitdata
, int *flags
);
106 int t_rcvuderr(int fildes
, struct t_uderr
*uderr
);
107 int t_snd(int fildes
, const char *buf
, unsigned int nbytes
, int flags
);
108 int t_snddis(int fildes
, struct t_call
*call
);
109 int t_sndrel(int fildes
);
110 int t_sndudata(int fildes
, struct t_unitdata
*unitdata
);
111 int t_sync(int fildes
);
112 int t_unbind(int fildes
);
114 # endif /* !ACE_HAS_TLI_PROTOTYPES */
116 # if defined (ACE_HAS_TIUSER_H)
117 # include /**/ <tiuser.h>
119 /* What to do here??? Is there a tli.h? */
120 # endif /* ACE_HAS_TIUSER_H */
122 # if defined (ACE_HAS_SVR4_TLI)
123 // t_getname is a TLI extension added by some platforms before XTI
124 // was widely available. However, it's not often in the system's
125 // header files. Sun OS, for example, is like this.
126 extern "C" int t_getname (int, struct netbuf
*, int);
127 # endif /* ACE_HAS_SVR4_TLI */
128 # endif /* !ACE_HAS_XTI */
130 # endif /* ACE_HAS_XTI || ACE_HAS_TLI */
132 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
134 // This hack is needed to get around an odd and hard-to-reproduce problem
135 // with HP aC++. If struct sigaction is defined extern "C" and the sigaction
136 // function in namespace ACE_OS, the compiler sometimes gets confused.
137 // If we help it with this typedef, it's fine. User code should not use
138 // the ACE typedef - it will be removed without warning as soon as we can
139 // either drop support for the broken compilers or figure out how to reproduce
140 // it so it can be reported to HP and fixed.
141 // There's a similar hack in OS_TLI.h for struct t_optmgmt.
142 // Also see ChangeLog entries:
143 // Mon Jan 23 16:35:40 UTC 2006 Steve Huston <shuston@riverace.com>
144 // Mon Jan 23 22:08:56 UTC 2006 Steve Huston <shuston@riverace.com>
145 #if defined (__HP_aCC) && (__HP_aCC <= 37300)
146 typedef extern "C" struct t_optmgmt ACE_TOPTMGMT
;
147 typedef extern "C" struct t_bind ACE_TBIND
;
149 typedef struct t_optmgmt ACE_TOPTMGMT
;
150 typedef struct t_bind ACE_TBIND
;
156 * @brief This class is a wrapper for the XTI/TLI operations
160 // = A set of wrappers for XTI/TLI.
161 ACE_NAMESPACE_INLINE_FUNCTION
162 int t_accept (ACE_HANDLE fildes
,
167 ACE_NAMESPACE_INLINE_FUNCTION
168 char *t_alloc (ACE_HANDLE fildes
,
173 ACE_NAMESPACE_INLINE_FUNCTION
174 int t_bind (ACE_HANDLE fildes
,
178 ACE_NAMESPACE_INLINE_FUNCTION
179 int t_close (ACE_HANDLE fildes
);
181 ACE_NAMESPACE_INLINE_FUNCTION
182 int t_connect (ACE_HANDLE fildes
,
183 struct t_call
*sndcall
,
184 struct t_call
*rcvcall
);
186 ACE_NAMESPACE_INLINE_FUNCTION
187 void t_error (const char *errmsg
);
189 ACE_NAMESPACE_INLINE_FUNCTION
190 int t_free (char *ptr
,
193 ACE_NAMESPACE_INLINE_FUNCTION
194 int t_getinfo (ACE_HANDLE fildes
,
195 struct t_info
*info
);
197 ACE_NAMESPACE_INLINE_FUNCTION
198 int t_getname (ACE_HANDLE fildes
,
199 struct netbuf
*namep
,
202 ACE_NAMESPACE_INLINE_FUNCTION
203 int t_getstate (ACE_HANDLE fildes
);
205 ACE_NAMESPACE_INLINE_FUNCTION
206 int t_listen (ACE_HANDLE fildes
,
207 struct t_call
*call
);
209 ACE_NAMESPACE_INLINE_FUNCTION
210 int t_look (ACE_HANDLE fildes
);
212 ACE_NAMESPACE_INLINE_FUNCTION
213 ACE_HANDLE
t_open (char *path
,
215 struct t_info
*info
);
217 ACE_NAMESPACE_INLINE_FUNCTION
218 int t_optmgmt (ACE_HANDLE handle
,
222 ACE_NAMESPACE_INLINE_FUNCTION
223 int t_rcv (ACE_HANDLE fildes
,
228 ACE_NAMESPACE_INLINE_FUNCTION
229 int t_rcvdis (ACE_HANDLE fildes
,
230 struct t_discon
*discon
);
232 ACE_NAMESPACE_INLINE_FUNCTION
233 int t_rcvrel (ACE_HANDLE fildes
);
235 ACE_NAMESPACE_INLINE_FUNCTION
236 int t_rcvudata (ACE_HANDLE fildes
,
237 struct t_unitdata
*unitdata
,
240 ACE_NAMESPACE_INLINE_FUNCTION
241 int t_rcvuderr (ACE_HANDLE fildes
,
242 struct t_uderr
*uderr
);
244 ACE_NAMESPACE_INLINE_FUNCTION
245 int t_snd (ACE_HANDLE fildes
,
250 ACE_NAMESPACE_INLINE_FUNCTION
251 int t_snddis (ACE_HANDLE fildes
,
252 struct t_call
*call
);
254 ACE_NAMESPACE_INLINE_FUNCTION
255 int t_sndrel (ACE_HANDLE fildes
);
257 ACE_NAMESPACE_INLINE_FUNCTION
258 int t_sync (ACE_HANDLE fildes
);
260 ACE_NAMESPACE_INLINE_FUNCTION
261 int t_unbind (ACE_HANDLE fildes
);
263 } /* namespace ACE_OS */
265 ACE_END_VERSIONED_NAMESPACE_DECL
267 # if defined (ACE_HAS_INLINED_OSCALLS)
268 # if defined (ACE_INLINE)
270 # endif /* ACE_INLINE */
271 # define ACE_INLINE inline
272 # include "ace/OS_TLI.inl"
273 # endif /* ACE_HAS_INLINED_OSCALLS */
275 #include /**/ "ace/post.h"
276 #endif /* ACE_OS_TLI_H */