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