xref: /titanic_41/usr/src/lib/libnsl/nsl/xti_wrappers.c (revision e4f5a11d4a234623168c1558fcdf4341e11769e1)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1996-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 
30 #include "mt.h"
31 #include <xti.h>
32 #include <unistd.h>
33 #include <stropts.h>
34 #include <sys/stream.h>
35 #include "tx.h"
36 
37 /*
38  * Prefix: _xti_
39  *
40  * The _xti_ prefix is the default prefix for these functions. A function
41  * having the _xti_ prefix means one of the following.
42  *	a. This interface remains unchanged in all versions of XTI, starting
43  *	   with the version of XTI in which it was first introduced.
44  *	   Consequently there is no other entry point, with a different
45  *	   prefix for this interface.
46  *	b. This interface has changed subsequent to when it was first. This
47  *	   function is meant for compatibility and provides the semantics of
48  *	   the XTI version when it was first introduced.
49  *
50  * The _xti_xns5_ prefix is used for functions that provide XNS Issue 5
51  * (UNIX98) semantics. It means the following.
52  *	   The UNIX98 version of this interface has different semantics
53  *	   as compared to UNIX95, and this function provides UNIX98 semantics
54  *
55  */
56 
57 int
58 _xti_accept(int fd, int resfd, const struct t_call *call)
59 {
60 	return (_tx_accept(fd, resfd, call, TX_XTI_API));
61 }
62 
63 int
64 _xti_xns5_accept(int fd, int resfd, const struct t_call *call)
65 {
66 	return (_tx_accept(fd, resfd, call, TX_XTI_XNS5_API));
67 }
68 
69 void *
70 _xti_alloc(int fd, int struct_type, int fields)
71 {
72 	return (_tx_alloc(fd, struct_type, fields, TX_XTI_API));
73 }
74 
75 int
76 _xti_bind(int fd, const struct t_bind *req, struct t_bind *ret)
77 {
78 	return (_tx_bind(fd, req, ret, TX_XTI_API));
79 }
80 
81 int
82 _xti_close(int fd)
83 {
84 	return (_tx_close(fd, TX_XTI_API));
85 }
86 
87 int
88 _xti_connect(int fd, const struct t_call *sndcall, struct t_call *rcvcall)
89 {
90 	return (_tx_connect(fd, sndcall, rcvcall, TX_XTI_API));
91 }
92 
93 /*
94  * Note: The TLI version of t_error has return type void. XTI has "int".
95  * The spec probably needs to change to void *
96  */
97 int
98 _xti_error(const char *errmsg)
99 {
100 	return (_tx_error(errmsg, TX_XTI_API));
101 }
102 
103 int
104 _xti_free(void *ptr, int struct_type)
105 {
106 	return (_tx_free(ptr, struct_type, TX_XTI_API));
107 }
108 
109 int
110 _xti_getinfo(int fd, struct t_info *info)
111 {
112 	return (_tx_getinfo(fd, info, TX_XTI_API));
113 }
114 
115 int
116 _xti_getprotaddr(int fd, struct t_bind *boundaddr, struct t_bind *peeraddr)
117 {
118 	return (_tx_getprotaddr(fd, boundaddr, peeraddr, TX_XTI_API));
119 }
120 
121 int
122 _xti_getstate(int fd)
123 {
124 	return (_tx_getstate(fd, TX_XTI_API));
125 }
126 
127 int
128 _xti_listen(int fd, struct t_call *call)
129 {
130 	return (_tx_listen(fd, call, TX_XTI_API));
131 }
132 
133 int
134 _xti_look(int fd)
135 {
136 	return (_tx_look(fd, TX_XTI_API));
137 }
138 
139 int
140 _xti_open(const char *path, int flags, struct t_info *info)
141 {
142 	return (_tx_open(path, flags, info, TX_XTI_API));
143 }
144 
145 int
146 _xti_optmgmt(int fd, const struct t_optmgmt *req, struct t_optmgmt *ret)
147 {
148 	return (_tx_optmgmt(fd, req, ret, TX_XTI_API));
149 }
150 
151 int
152 _xti_rcv(int fd, void *buf, unsigned int nbytes, int *flags)
153 {
154 	return (_tx_rcv(fd, buf, nbytes, flags, TX_XTI_API));
155 }
156 
157 int
158 _xti_rcvconnect(int fd, struct t_call *call)
159 {
160 	return (_tx_rcvconnect(fd, call, TX_XTI_API));
161 }
162 
163 int
164 _xti_rcvdis(int fd, struct t_discon *discon)
165 {
166 	return (_tx_rcvdis(fd, discon, TX_XTI_API));
167 }
168 
169 int
170 _xti_rcvrel(int fd)
171 {
172 	return (_tx_rcvrel(fd, TX_XTI_API));
173 }
174 
175 int
176 _xti_rcvreldata(int fd, struct t_discon *discon)
177 {
178 	return (_tx_rcvreldata(fd, discon, TX_XTI_XNS5_API));
179 }
180 
181 int
182 _xti_rcvudata(int fd, struct t_unitdata *unitdata, int *flags)
183 {
184 	return (_tx_rcvudata(fd, unitdata, flags, TX_XTI_API));
185 }
186 
187 int
188 _xti_rcvuderr(int fd, struct t_uderr *uderr)
189 {
190 	return (_tx_rcvuderr(fd, uderr, TX_XTI_API));
191 }
192 
193 int
194 _xti_rcvv(int fd, struct t_iovec *tiov, unsigned int tiovcount, int *flags)
195 {
196 	return (_tx_rcvv(fd, tiov, tiovcount, flags, TX_XTI_XNS5_API));
197 }
198 
199 int
200 _xti_rcvvudata(int fd, struct t_unitdata *unitdata, struct t_iovec *tiov,
201     unsigned int tiovcount, int *flags)
202 {
203 	return (_tx_rcvvudata(fd, unitdata, tiov, tiovcount, flags,
204 	    TX_XTI_XNS5_API));
205 }
206 
207 int
208 _xti_snd(int fd, void *buf, unsigned int nbytes, int flags)
209 {
210 	return (_tx_snd(fd, buf, nbytes, flags, TX_XTI_API));
211 }
212 
213 int
214 _xti_xns5_snd(int fd, void *buf, unsigned int nbytes, int flags)
215 {
216 	return (_tx_snd(fd, buf, nbytes, flags, TX_XTI_XNS5_API));
217 }
218 
219 int
220 _xti_snddis(int fd, const struct t_call *call)
221 {
222 	return (_tx_snddis(fd, call, TX_XTI_API));
223 
224 }
225 
226 int
227 _xti_sndrel(int fd)
228 {
229 	return (_tx_sndrel(fd, TX_XTI_API));
230 }
231 
232 int
233 _xti_sndreldata(int fd, struct t_discon *discon)
234 {
235 	return (_tx_sndreldata(fd, discon, TX_XTI_XNS5_API));
236 }
237 
238 int
239 _xti_sndudata(int fd, const struct t_unitdata *unitdata)
240 {
241 	return (_tx_sndudata(fd, unitdata, TX_XTI_API));
242 }
243 
244 int
245 _xti_sndv(int fd, const struct t_iovec *tiov, unsigned int tiovcount, int flags)
246 {
247 	return (_tx_sndv(fd, tiov, tiovcount, flags, TX_XTI_XNS5_API));
248 }
249 
250 int
251 _xti_sndvudata(int fd, struct t_unitdata *unitdata, struct t_iovec *tiov,
252     unsigned int tiovcount)
253 {
254 	return (_tx_sndvudata(fd, unitdata, tiov, tiovcount, TX_XTI_XNS5_API));
255 }
256 
257 const char *
258 _xti_strerror(int errnum)
259 {
260 	return (_tx_strerror(errnum, TX_XTI_API));
261 }
262 
263 int
264 _xti_sync(int fd)
265 {
266 	return (_tx_sync(fd, TX_XTI_API));
267 }
268 
269 int
270 _xti_sysconf(int name)
271 {
272 	return (_tx_sysconf(name, TX_XTI_XNS5_API));
273 }
274 
275 int
276 _xti_unbind(int fd)
277 {
278 	return (_tx_unbind(fd, TX_XTI_API));
279 }
280