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) */
42 # if defined (ACE_HAS_XTI)
43 # if defined (ACE_HAS_FORE_ATM_XTI)
44 # include /**/ <fore_xti/xti_user_types.h>
45 # include /**/ <fore_xti/xti.h>
46 # include /**/ <fore_xti/xti_atm.h>
47 # include /**/ <fore_xti/netatm/atm.h>
48 # include /**/ <fore_xti/ans.h>
50 # include /**/ <xti.h>
51 # endif /* ACE_HAS_SYS_XTI_H */
53 // The XTI API for obtaining local/peer addresses is t_getprotaddr().
54 // The ACE API was developed in TLI days and so uses t_getname().
55 // t_getname() has a type argument that specifies which address is
56 // desired, local or peer, while t_getprotaddr() gets both at once.
57 // t_getname() has values defined for the type, so these aren't defined
58 // for XTI systems. So, define them here for ACE API users to use.
59 # if !defined (LOCALNAME)
62 # if !defined (REMOTENAME)
66 # else /* !ACE_HAS_XTI, so this is a TLI system */
67 # if !defined (ACE_HAS_TLI_PROTOTYPES)
69 // Define ACE_TLI headers for systems that don't prototype them....
72 int t_accept(int fildes
, int resfd
, struct t_call
*call
);
73 char *t_alloc(int fildes
, int struct_type
, int fields
);
74 int t_bind(int fildes
, struct t_bind
*req
, struct t_bind
*ret
);
75 int t_close(int fildes
);
76 int t_connect(int fildes
, struct t_call
*sndcall
,
77 struct t_call
*rcvcall
);
78 void t_error(const char *errmsg
);
79 int t_free(char *ptr
, int struct_type
);
80 int t_getinfo(int fildes
, struct t_info
*info
);
81 int t_getname (int fildes
, struct netbuf
*namep
, int type
);
82 int t_getstate(int fildes
);
83 int t_listen(int fildes
, struct t_call
*call
);
84 int t_look(int fildes
);
85 int t_open(char *path
, int oflag
, struct t_info
*info
);
86 int t_optmgmt(int fildes
, struct t_optmgmt
*req
,
87 struct t_optmgmt
*ret
);
88 int t_rcv(int fildes
, char *buf
, unsigned int nbytes
, int *flags
);
89 int t_rcvconnect(int fildes
, struct t_call
*call
);
90 int t_rcvdis(int fildes
, struct t_discon
*discon
);
91 int t_rcvrel(int fildes
);
92 int t_rcvudata(int fildes
, struct t_unitdata
*unitdata
, int *flags
);
93 int t_rcvuderr(int fildes
, struct t_uderr
*uderr
);
94 int t_snd(int fildes
, const char *buf
, unsigned int nbytes
, int flags
);
95 int t_snddis(int fildes
, struct t_call
*call
);
96 int t_sndrel(int fildes
);
97 int t_sndudata(int fildes
, struct t_unitdata
*unitdata
);
98 int t_sync(int fildes
);
99 int t_unbind(int fildes
);
101 # endif /* !ACE_HAS_TLI_PROTOTYPES */
103 # endif /* !ACE_HAS_XTI */
105 # endif /* ACE_HAS_XTI || ACE_HAS_TLI */
107 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
109 typedef struct t_optmgmt ACE_TOPTMGMT
;
110 typedef struct t_bind ACE_TBIND
;
115 * @brief This class is a wrapper for the XTI/TLI operations
119 // = A set of wrappers for XTI/TLI.
120 ACE_NAMESPACE_INLINE_FUNCTION
121 int t_accept (ACE_HANDLE fildes
,
126 ACE_NAMESPACE_INLINE_FUNCTION
127 char *t_alloc (ACE_HANDLE fildes
,
132 ACE_NAMESPACE_INLINE_FUNCTION
133 int t_bind (ACE_HANDLE fildes
,
137 ACE_NAMESPACE_INLINE_FUNCTION
138 int t_close (ACE_HANDLE fildes
);
140 ACE_NAMESPACE_INLINE_FUNCTION
141 int t_connect (ACE_HANDLE fildes
,
142 struct t_call
*sndcall
,
143 struct t_call
*rcvcall
);
145 ACE_NAMESPACE_INLINE_FUNCTION
146 void t_error (const char *errmsg
);
148 ACE_NAMESPACE_INLINE_FUNCTION
149 int t_free (char *ptr
,
152 ACE_NAMESPACE_INLINE_FUNCTION
153 int t_getinfo (ACE_HANDLE fildes
,
154 struct t_info
*info
);
156 ACE_NAMESPACE_INLINE_FUNCTION
157 int t_getname (ACE_HANDLE fildes
,
158 struct netbuf
*namep
,
161 ACE_NAMESPACE_INLINE_FUNCTION
162 int t_getstate (ACE_HANDLE fildes
);
164 ACE_NAMESPACE_INLINE_FUNCTION
165 int t_listen (ACE_HANDLE fildes
,
166 struct t_call
*call
);
168 ACE_NAMESPACE_INLINE_FUNCTION
169 int t_look (ACE_HANDLE fildes
);
171 ACE_NAMESPACE_INLINE_FUNCTION
172 ACE_HANDLE
t_open (char *path
,
174 struct t_info
*info
);
176 ACE_NAMESPACE_INLINE_FUNCTION
177 int t_optmgmt (ACE_HANDLE handle
,
181 ACE_NAMESPACE_INLINE_FUNCTION
182 int t_rcv (ACE_HANDLE fildes
,
187 ACE_NAMESPACE_INLINE_FUNCTION
188 int t_rcvdis (ACE_HANDLE fildes
,
189 struct t_discon
*discon
);
191 ACE_NAMESPACE_INLINE_FUNCTION
192 int t_rcvrel (ACE_HANDLE fildes
);
194 ACE_NAMESPACE_INLINE_FUNCTION
195 int t_rcvudata (ACE_HANDLE fildes
,
196 struct t_unitdata
*unitdata
,
199 ACE_NAMESPACE_INLINE_FUNCTION
200 int t_rcvuderr (ACE_HANDLE fildes
,
201 struct t_uderr
*uderr
);
203 ACE_NAMESPACE_INLINE_FUNCTION
204 int t_snd (ACE_HANDLE fildes
,
209 ACE_NAMESPACE_INLINE_FUNCTION
210 int t_snddis (ACE_HANDLE fildes
,
211 struct t_call
*call
);
213 ACE_NAMESPACE_INLINE_FUNCTION
214 int t_sndrel (ACE_HANDLE fildes
);
216 ACE_NAMESPACE_INLINE_FUNCTION
217 int t_sync (ACE_HANDLE fildes
);
219 ACE_NAMESPACE_INLINE_FUNCTION
220 int t_unbind (ACE_HANDLE fildes
);
221 } /* namespace ACE_OS */
223 ACE_END_VERSIONED_NAMESPACE_DECL
225 # if defined (ACE_HAS_INLINED_OSCALLS)
226 # if defined (ACE_INLINE)
228 # endif /* ACE_INLINE */
229 # define ACE_INLINE inline
230 # include "ace/OS_TLI.inl"
231 # endif /* ACE_HAS_INLINED_OSCALLS */
233 #include /**/ "ace/post.h"
234 #endif /* ACE_OS_TLI_H */