17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7257d1b4Sraf  * Common Development and Distribution License (the "License").
6*7257d1b4Sraf  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
216c740c0aSraf 
227c478bd9Sstevel@tonic-gate /*
23*7257d1b4Sraf  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include "mt.h"
307c478bd9Sstevel@tonic-gate #include <tiuser.h>
317c478bd9Sstevel@tonic-gate #include <unistd.h>
327c478bd9Sstevel@tonic-gate #include <stropts.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate /*
357c478bd9Sstevel@tonic-gate  * TLI_WRAPPERS is defined below, before inclusion of "tx.h". This is
367c478bd9Sstevel@tonic-gate  * done so that the function prototypes and associated data structure
377c478bd9Sstevel@tonic-gate  * definitions of new interfaces introduced in XNS 5 are not seen
387c478bd9Sstevel@tonic-gate  * in this file.
397c478bd9Sstevel@tonic-gate  */
407c478bd9Sstevel@tonic-gate #define	TLI_WRAPPERS
417c478bd9Sstevel@tonic-gate #include "tx.h"
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate int
t_accept(int fd,int resfd,struct t_call * call)447c478bd9Sstevel@tonic-gate t_accept(int fd, int resfd, struct t_call *call)
457c478bd9Sstevel@tonic-gate {
467c478bd9Sstevel@tonic-gate 	return (_tx_accept(fd, resfd, call, TX_TLI_API));
477c478bd9Sstevel@tonic-gate }
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate char *
t_alloc(int fd,int struct_type,int fields)507c478bd9Sstevel@tonic-gate t_alloc(int fd, int struct_type, int fields)
517c478bd9Sstevel@tonic-gate {
527c478bd9Sstevel@tonic-gate 	return (_tx_alloc(fd, struct_type, fields, TX_TLI_API));
537c478bd9Sstevel@tonic-gate }
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate int
t_bind(int fd,struct t_bind * req,struct t_bind * ret)567c478bd9Sstevel@tonic-gate t_bind(int fd, struct t_bind *req, struct t_bind *ret)
577c478bd9Sstevel@tonic-gate {
587c478bd9Sstevel@tonic-gate 	return (_tx_bind(fd, req, ret, TX_TLI_API));
597c478bd9Sstevel@tonic-gate }
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate int
t_close(int fd)627c478bd9Sstevel@tonic-gate t_close(int fd)
637c478bd9Sstevel@tonic-gate {
647c478bd9Sstevel@tonic-gate 	return (_tx_close(fd, TX_TLI_API));
657c478bd9Sstevel@tonic-gate }
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate int
t_connect(int fd,struct t_call * sndcall,struct t_call * rcvcall)687c478bd9Sstevel@tonic-gate t_connect(int fd, struct t_call *sndcall, struct t_call *rcvcall)
697c478bd9Sstevel@tonic-gate {
707c478bd9Sstevel@tonic-gate 	return (_tx_connect(fd, sndcall, rcvcall, TX_TLI_API));
717c478bd9Sstevel@tonic-gate }
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate /*
747c478bd9Sstevel@tonic-gate  * Note t_error() return type changed by XTI to be char *. The spec should
757c478bd9Sstevel@tonic-gate  * probably be fixed to make it void *
767c478bd9Sstevel@tonic-gate  */
777c478bd9Sstevel@tonic-gate void
t_error(const char * s)787c478bd9Sstevel@tonic-gate t_error(const char *s)
797c478bd9Sstevel@tonic-gate {
807c478bd9Sstevel@tonic-gate 	(void) _tx_error(s, TX_TLI_API);
817c478bd9Sstevel@tonic-gate }
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate int
t_free(char * ptr,int struct_type)847c478bd9Sstevel@tonic-gate t_free(char *ptr, int struct_type)
857c478bd9Sstevel@tonic-gate {
867c478bd9Sstevel@tonic-gate 	return (_tx_free(ptr, struct_type, TX_TLI_API));
877c478bd9Sstevel@tonic-gate }
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate /*
907c478bd9Sstevel@tonic-gate  * Note: The "struct t_info" parameter here refers to XTI one which
917c478bd9Sstevel@tonic-gate  * added a field. The implmentation should not reference it. The applications
927c478bd9Sstevel@tonic-gate  * will pass the shorter TLI one.
937c478bd9Sstevel@tonic-gate  */
947c478bd9Sstevel@tonic-gate int
t_getinfo(int fd,struct t_info * info)957c478bd9Sstevel@tonic-gate t_getinfo(int fd, struct t_info *info)
967c478bd9Sstevel@tonic-gate {
977c478bd9Sstevel@tonic-gate 	return (_tx_getinfo(fd, info, TX_TLI_API));
987c478bd9Sstevel@tonic-gate }
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate int
t_getstate(int fd)1017c478bd9Sstevel@tonic-gate t_getstate(int fd)
1027c478bd9Sstevel@tonic-gate {
1037c478bd9Sstevel@tonic-gate 	return (_tx_getstate(fd, TX_TLI_API));
1047c478bd9Sstevel@tonic-gate }
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate int
t_listen(int fd,struct t_call * call)1077c478bd9Sstevel@tonic-gate t_listen(int fd, struct t_call *call)
1087c478bd9Sstevel@tonic-gate {
1097c478bd9Sstevel@tonic-gate 	return (_tx_listen(fd, call, TX_TLI_API));
1107c478bd9Sstevel@tonic-gate }
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate int
t_look(int fd)1137c478bd9Sstevel@tonic-gate t_look(int fd)
1147c478bd9Sstevel@tonic-gate {
1157c478bd9Sstevel@tonic-gate 	return (_tx_look(fd, TX_TLI_API));
1167c478bd9Sstevel@tonic-gate }
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate /*
1197c478bd9Sstevel@tonic-gate  * Note: The "struct t_info" parameter here refers to XTI one which
1207c478bd9Sstevel@tonic-gate  * added a field. The implmentation should not reference it. The applications
1217c478bd9Sstevel@tonic-gate  * will pass the shorter TLI one.
1227c478bd9Sstevel@tonic-gate  */
1237c478bd9Sstevel@tonic-gate int
t_open(const char * path,int flags,struct t_info * info)1247c478bd9Sstevel@tonic-gate t_open(const char *path, int flags, struct t_info *info)
1257c478bd9Sstevel@tonic-gate {
1267c478bd9Sstevel@tonic-gate 	return (_tx_open(path, flags, info, TX_TLI_API));
1277c478bd9Sstevel@tonic-gate }
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate int
t_optmgmt(int fd,struct t_optmgmt * req,struct t_optmgmt * ret)1307c478bd9Sstevel@tonic-gate t_optmgmt(int fd, struct t_optmgmt *req, struct t_optmgmt *ret)
1317c478bd9Sstevel@tonic-gate {
1327c478bd9Sstevel@tonic-gate 	return (_tx_optmgmt(fd, req, ret, TX_TLI_API));
1337c478bd9Sstevel@tonic-gate }
1347c478bd9Sstevel@tonic-gate 
1357c478bd9Sstevel@tonic-gate int
t_rcv(int fd,char * buf,unsigned int nbytes,int * flags)1367c478bd9Sstevel@tonic-gate t_rcv(int fd, char *buf, unsigned int nbytes, int *flags)
1377c478bd9Sstevel@tonic-gate {
1387c478bd9Sstevel@tonic-gate 	return (_tx_rcv(fd, buf, nbytes, flags, TX_TLI_API));
1397c478bd9Sstevel@tonic-gate }
1407c478bd9Sstevel@tonic-gate 
1417c478bd9Sstevel@tonic-gate int
t_rcvconnect(int fd,struct t_call * call)1427c478bd9Sstevel@tonic-gate t_rcvconnect(int fd, struct t_call *call)
1437c478bd9Sstevel@tonic-gate {
1447c478bd9Sstevel@tonic-gate 	return (_tx_rcvconnect(fd, call, TX_TLI_API));
1457c478bd9Sstevel@tonic-gate }
1467c478bd9Sstevel@tonic-gate 
1477c478bd9Sstevel@tonic-gate int
t_rcvdis(int fd,struct t_discon * discon)1487c478bd9Sstevel@tonic-gate t_rcvdis(int fd, struct t_discon *discon)
1497c478bd9Sstevel@tonic-gate {
1507c478bd9Sstevel@tonic-gate 	return (_tx_rcvdis(fd, discon, TX_TLI_API));
1517c478bd9Sstevel@tonic-gate }
1527c478bd9Sstevel@tonic-gate 
1537c478bd9Sstevel@tonic-gate int
t_rcvrel(int fd)1547c478bd9Sstevel@tonic-gate t_rcvrel(int fd)
1557c478bd9Sstevel@tonic-gate {
1567c478bd9Sstevel@tonic-gate 	return (_tx_rcvrel(fd, TX_TLI_API));
1577c478bd9Sstevel@tonic-gate }
1587c478bd9Sstevel@tonic-gate 
1597c478bd9Sstevel@tonic-gate int
t_rcvudata(int fd,struct t_unitdata * unitdata,int * flags)1607c478bd9Sstevel@tonic-gate t_rcvudata(int fd, struct t_unitdata *unitdata, int *flags)
1617c478bd9Sstevel@tonic-gate {
1627c478bd9Sstevel@tonic-gate 	return (_tx_rcvudata(fd, unitdata, flags, TX_TLI_API));
1637c478bd9Sstevel@tonic-gate }
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate int
t_rcvuderr(int fd,struct t_uderr * uderr)1667c478bd9Sstevel@tonic-gate t_rcvuderr(int fd, struct t_uderr *uderr)
1677c478bd9Sstevel@tonic-gate {
1687c478bd9Sstevel@tonic-gate 	return (_tx_rcvuderr(fd, uderr, TX_TLI_API));
1697c478bd9Sstevel@tonic-gate }
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate int
t_snd(int fd,char * buf,unsigned int nbytes,int flags)1727c478bd9Sstevel@tonic-gate t_snd(int fd, char *buf, unsigned int nbytes, int flags)
1737c478bd9Sstevel@tonic-gate {
1747c478bd9Sstevel@tonic-gate 	return (_tx_snd(fd, buf, nbytes, flags, TX_TLI_API));
1757c478bd9Sstevel@tonic-gate }
1767c478bd9Sstevel@tonic-gate 
1777c478bd9Sstevel@tonic-gate int
t_snddis(int fd,struct t_call * call)1787c478bd9Sstevel@tonic-gate t_snddis(int fd, struct t_call *call)
1797c478bd9Sstevel@tonic-gate {
1807c478bd9Sstevel@tonic-gate 	return (_tx_snddis(fd, call, TX_TLI_API));
1817c478bd9Sstevel@tonic-gate }
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate int
t_sndrel(int fd)1847c478bd9Sstevel@tonic-gate t_sndrel(int fd)
1857c478bd9Sstevel@tonic-gate {
1867c478bd9Sstevel@tonic-gate 	return (_tx_sndrel(fd, TX_TLI_API));
1877c478bd9Sstevel@tonic-gate }
1887c478bd9Sstevel@tonic-gate 
1897c478bd9Sstevel@tonic-gate int
t_sndudata(int fd,struct t_unitdata * unitdata)1907c478bd9Sstevel@tonic-gate t_sndudata(int fd, struct t_unitdata *unitdata)
1917c478bd9Sstevel@tonic-gate {
1927c478bd9Sstevel@tonic-gate 	return (_tx_sndudata(fd, unitdata, TX_TLI_API));
1937c478bd9Sstevel@tonic-gate }
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate char *
t_strerror(int errnum)196*7257d1b4Sraf t_strerror(int errnum)
1977c478bd9Sstevel@tonic-gate {
1987c478bd9Sstevel@tonic-gate 	return (_tx_strerror(errnum, TX_TLI_API));
1997c478bd9Sstevel@tonic-gate }
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate int
t_sync(int fd)2027c478bd9Sstevel@tonic-gate t_sync(int fd)
2037c478bd9Sstevel@tonic-gate {
2047c478bd9Sstevel@tonic-gate 	return (_tx_sync(fd, TX_TLI_API));
2057c478bd9Sstevel@tonic-gate }
2067c478bd9Sstevel@tonic-gate 
2077c478bd9Sstevel@tonic-gate int
t_unbind(int fd)2087c478bd9Sstevel@tonic-gate t_unbind(int fd)
2097c478bd9Sstevel@tonic-gate {
2107c478bd9Sstevel@tonic-gate 	return (_tx_unbind(fd, TX_TLI_API));
2117c478bd9Sstevel@tonic-gate }
2127c478bd9Sstevel@tonic-gate 
2137c478bd9Sstevel@tonic-gate int
t_getname(int fd,struct netbuf * name,int type)2147c478bd9Sstevel@tonic-gate t_getname(int fd, struct netbuf *name, int type)
2157c478bd9Sstevel@tonic-gate {
2167c478bd9Sstevel@tonic-gate 	return (_tx_getname(fd, name, type, TX_TLI_API));
2177c478bd9Sstevel@tonic-gate }
218