xref: /illumos-gate/usr/src/lib/libnsl/nsl/tli_wrappers.c (revision a07094369b21309434206d9b3601d162693466fc)
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 /*
24  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
25  * Use is subject to license terms.
26  */
27 
28 #pragma ident	"%Z%%M%	%I%	%E% SMI"
29 
30 /*
31  * Note: This weak symbol is probably not needed
32  * but it exists because it historically has.
33  */
34 #pragma weak t_strerror = _t_strerror
35 
36 #include "mt.h"
37 #include <tiuser.h>
38 #include <unistd.h>
39 #include <stropts.h>
40 
41 /*
42  * TLI_WRAPPERS is defined below, before inclusion of "tx.h". This is
43  * done so that the function prototypes and associated data structure
44  * definitions of new interfaces introduced in XNS 5 are not seen
45  * in this file.
46  */
47 #define	TLI_WRAPPERS
48 #include "tx.h"
49 
50 int
51 t_accept(int fd, int resfd, struct t_call *call)
52 {
53 	return (_tx_accept(fd, resfd, call, TX_TLI_API));
54 }
55 
56 char *
57 t_alloc(int fd, int struct_type, int fields)
58 {
59 	return (_tx_alloc(fd, struct_type, fields, TX_TLI_API));
60 }
61 
62 int
63 t_bind(int fd, struct t_bind *req, struct t_bind *ret)
64 {
65 	return (_tx_bind(fd, req, ret, TX_TLI_API));
66 }
67 
68 int
69 t_close(int fd)
70 {
71 	return (_tx_close(fd, TX_TLI_API));
72 }
73 
74 int
75 t_connect(int fd, struct t_call *sndcall, struct t_call *rcvcall)
76 {
77 	return (_tx_connect(fd, sndcall, rcvcall, TX_TLI_API));
78 }
79 
80 /*
81  * Note t_error() return type changed by XTI to be char *. The spec should
82  * probably be fixed to make it void *
83  */
84 void
85 t_error(const char *s)
86 {
87 	(void) _tx_error(s, TX_TLI_API);
88 }
89 
90 int
91 t_free(char *ptr, int struct_type)
92 {
93 	return (_tx_free(ptr, struct_type, TX_TLI_API));
94 }
95 
96 /*
97  * Note: The "struct t_info" parameter here refers to XTI one which
98  * added a field. The implmentation should not reference it. The applications
99  * will pass the shorter TLI one.
100  */
101 int
102 t_getinfo(int fd, struct t_info *info)
103 {
104 	return (_tx_getinfo(fd, info, TX_TLI_API));
105 }
106 
107 int
108 t_getstate(int fd)
109 {
110 	return (_tx_getstate(fd, TX_TLI_API));
111 }
112 
113 int
114 t_listen(int fd, struct t_call *call)
115 {
116 	return (_tx_listen(fd, call, TX_TLI_API));
117 }
118 
119 int
120 t_look(int fd)
121 {
122 	return (_tx_look(fd, TX_TLI_API));
123 }
124 
125 /*
126  * Note: The "struct t_info" parameter here refers to XTI one which
127  * added a field. The implmentation should not reference it. The applications
128  * will pass the shorter TLI one.
129  */
130 int
131 t_open(const char *path, int flags, struct t_info *info)
132 {
133 	return (_tx_open(path, flags, info, TX_TLI_API));
134 }
135 
136 int
137 t_optmgmt(int fd, struct t_optmgmt *req, struct t_optmgmt *ret)
138 {
139 	return (_tx_optmgmt(fd, req, ret, TX_TLI_API));
140 }
141 
142 int
143 t_rcv(int fd, char *buf, unsigned int nbytes, int *flags)
144 {
145 	return (_tx_rcv(fd, buf, nbytes, flags, TX_TLI_API));
146 }
147 
148 int
149 t_rcvconnect(int fd, struct t_call *call)
150 {
151 	return (_tx_rcvconnect(fd, call, TX_TLI_API));
152 }
153 
154 int
155 t_rcvdis(int fd, struct t_discon *discon)
156 {
157 	return (_tx_rcvdis(fd, discon, TX_TLI_API));
158 }
159 
160 int
161 t_rcvrel(int fd)
162 {
163 	return (_tx_rcvrel(fd, TX_TLI_API));
164 }
165 
166 int
167 t_rcvudata(int fd, struct t_unitdata *unitdata, int *flags)
168 {
169 	return (_tx_rcvudata(fd, unitdata, flags, TX_TLI_API));
170 }
171 
172 int
173 t_rcvuderr(int fd, struct t_uderr *uderr)
174 {
175 	return (_tx_rcvuderr(fd, uderr, TX_TLI_API));
176 }
177 
178 int
179 t_snd(int fd, char *buf, unsigned int nbytes, int flags)
180 {
181 	return (_tx_snd(fd, buf, nbytes, flags, TX_TLI_API));
182 }
183 
184 int
185 t_snddis(int fd, struct t_call *call)
186 {
187 	return (_tx_snddis(fd, call, TX_TLI_API));
188 }
189 
190 int
191 t_sndrel(int fd)
192 {
193 	return (_tx_sndrel(fd, TX_TLI_API));
194 }
195 
196 int
197 t_sndudata(int fd, struct t_unitdata *unitdata)
198 {
199 	return (_tx_sndudata(fd, unitdata, TX_TLI_API));
200 }
201 
202 char *
203 _t_strerror(int errnum)
204 {
205 	return (_tx_strerror(errnum, TX_TLI_API));
206 }
207 
208 int
209 t_sync(int fd)
210 {
211 	return (_tx_sync(fd, TX_TLI_API));
212 }
213 
214 int
215 t_unbind(int fd)
216 {
217 	return (_tx_unbind(fd, TX_TLI_API));
218 }
219 
220 int
221 t_getname(int fd, struct netbuf *name, int type)
222 {
223 	return (_tx_getname(fd, name, type, TX_TLI_API));
224 }
225