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 #include "mt.h"
287c478bd9Sstevel@tonic-gate #include <tiuser.h>
297c478bd9Sstevel@tonic-gate #include <unistd.h>
307c478bd9Sstevel@tonic-gate #include <stropts.h>
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate /*
337c478bd9Sstevel@tonic-gate  * TLI_WRAPPERS is defined below, before inclusion of "tx.h". This is
347c478bd9Sstevel@tonic-gate  * done so that the function prototypes and associated data structure
357c478bd9Sstevel@tonic-gate  * definitions of new interfaces introduced in XNS 5 are not seen
367c478bd9Sstevel@tonic-gate  * in this file.
377c478bd9Sstevel@tonic-gate  */
387c478bd9Sstevel@tonic-gate #define	TLI_WRAPPERS
397c478bd9Sstevel@tonic-gate #include "tx.h"
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate int
t_accept(int fd,int resfd,struct t_call * call)427c478bd9Sstevel@tonic-gate t_accept(int fd, int resfd, struct t_call *call)
437c478bd9Sstevel@tonic-gate {
447c478bd9Sstevel@tonic-gate 	return (_tx_accept(fd, resfd, call, TX_TLI_API));
457c478bd9Sstevel@tonic-gate }
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate char *
t_alloc(int fd,int struct_type,int fields)487c478bd9Sstevel@tonic-gate t_alloc(int fd, int struct_type, int fields)
497c478bd9Sstevel@tonic-gate {
507c478bd9Sstevel@tonic-gate 	return (_tx_alloc(fd, struct_type, fields, TX_TLI_API));
517c478bd9Sstevel@tonic-gate }
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate int
t_bind(int fd,struct t_bind * req,struct t_bind * ret)547c478bd9Sstevel@tonic-gate t_bind(int fd, struct t_bind *req, struct t_bind *ret)
557c478bd9Sstevel@tonic-gate {
567c478bd9Sstevel@tonic-gate 	return (_tx_bind(fd, req, ret, TX_TLI_API));
577c478bd9Sstevel@tonic-gate }
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate int
t_close(int fd)607c478bd9Sstevel@tonic-gate t_close(int fd)
617c478bd9Sstevel@tonic-gate {
627c478bd9Sstevel@tonic-gate 	return (_tx_close(fd, TX_TLI_API));
637c478bd9Sstevel@tonic-gate }
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate int
t_connect(int fd,struct t_call * sndcall,struct t_call * rcvcall)667c478bd9Sstevel@tonic-gate t_connect(int fd, struct t_call *sndcall, struct t_call *rcvcall)
677c478bd9Sstevel@tonic-gate {
687c478bd9Sstevel@tonic-gate 	return (_tx_connect(fd, sndcall, rcvcall, TX_TLI_API));
697c478bd9Sstevel@tonic-gate }
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate /*
727c478bd9Sstevel@tonic-gate  * Note t_error() return type changed by XTI to be char *. The spec should
737c478bd9Sstevel@tonic-gate  * probably be fixed to make it void *
747c478bd9Sstevel@tonic-gate  */
757c478bd9Sstevel@tonic-gate void
t_error(const char * s)767c478bd9Sstevel@tonic-gate t_error(const char *s)
777c478bd9Sstevel@tonic-gate {
787c478bd9Sstevel@tonic-gate 	(void) _tx_error(s, TX_TLI_API);
797c478bd9Sstevel@tonic-gate }
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate int
t_free(char * ptr,int struct_type)827c478bd9Sstevel@tonic-gate t_free(char *ptr, int struct_type)
837c478bd9Sstevel@tonic-gate {
847c478bd9Sstevel@tonic-gate 	return (_tx_free(ptr, struct_type, TX_TLI_API));
857c478bd9Sstevel@tonic-gate }
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate /*
887c478bd9Sstevel@tonic-gate  * Note: The "struct t_info" parameter here refers to XTI one which
897c478bd9Sstevel@tonic-gate  * added a field. The implmentation should not reference it. The applications
907c478bd9Sstevel@tonic-gate  * will pass the shorter TLI one.
917c478bd9Sstevel@tonic-gate  */
927c478bd9Sstevel@tonic-gate int
t_getinfo(int fd,struct t_info * info)937c478bd9Sstevel@tonic-gate t_getinfo(int fd, struct t_info *info)
947c478bd9Sstevel@tonic-gate {
957c478bd9Sstevel@tonic-gate 	return (_tx_getinfo(fd, info, TX_TLI_API));
967c478bd9Sstevel@tonic-gate }
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate int
t_getstate(int fd)997c478bd9Sstevel@tonic-gate t_getstate(int fd)
1007c478bd9Sstevel@tonic-gate {
1017c478bd9Sstevel@tonic-gate 	return (_tx_getstate(fd, TX_TLI_API));
1027c478bd9Sstevel@tonic-gate }
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate int
t_listen(int fd,struct t_call * call)1057c478bd9Sstevel@tonic-gate t_listen(int fd, struct t_call *call)
1067c478bd9Sstevel@tonic-gate {
1077c478bd9Sstevel@tonic-gate 	return (_tx_listen(fd, call, TX_TLI_API));
1087c478bd9Sstevel@tonic-gate }
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate int
t_look(int fd)1117c478bd9Sstevel@tonic-gate t_look(int fd)
1127c478bd9Sstevel@tonic-gate {
1137c478bd9Sstevel@tonic-gate 	return (_tx_look(fd, TX_TLI_API));
1147c478bd9Sstevel@tonic-gate }
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate /*
1177c478bd9Sstevel@tonic-gate  * Note: The "struct t_info" parameter here refers to XTI one which
1187c478bd9Sstevel@tonic-gate  * added a field. The implmentation should not reference it. The applications
1197c478bd9Sstevel@tonic-gate  * will pass the shorter TLI one.
1207c478bd9Sstevel@tonic-gate  */
1217c478bd9Sstevel@tonic-gate int
t_open(const char * path,int flags,struct t_info * info)1227c478bd9Sstevel@tonic-gate t_open(const char *path, int flags, struct t_info *info)
1237c478bd9Sstevel@tonic-gate {
1247c478bd9Sstevel@tonic-gate 	return (_tx_open(path, flags, info, TX_TLI_API));
1257c478bd9Sstevel@tonic-gate }
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate int
t_optmgmt(int fd,struct t_optmgmt * req,struct t_optmgmt * ret)1287c478bd9Sstevel@tonic-gate t_optmgmt(int fd, struct t_optmgmt *req, struct t_optmgmt *ret)
1297c478bd9Sstevel@tonic-gate {
1307c478bd9Sstevel@tonic-gate 	return (_tx_optmgmt(fd, req, ret, TX_TLI_API));
1317c478bd9Sstevel@tonic-gate }
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate int
t_rcv(int fd,char * buf,unsigned int nbytes,int * flags)1347c478bd9Sstevel@tonic-gate t_rcv(int fd, char *buf, unsigned int nbytes, int *flags)
1357c478bd9Sstevel@tonic-gate {
1367c478bd9Sstevel@tonic-gate 	return (_tx_rcv(fd, buf, nbytes, flags, TX_TLI_API));
1377c478bd9Sstevel@tonic-gate }
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate int
t_rcvconnect(int fd,struct t_call * call)1407c478bd9Sstevel@tonic-gate t_rcvconnect(int fd, struct t_call *call)
1417c478bd9Sstevel@tonic-gate {
1427c478bd9Sstevel@tonic-gate 	return (_tx_rcvconnect(fd, call, TX_TLI_API));
1437c478bd9Sstevel@tonic-gate }
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate int
t_rcvdis(int fd,struct t_discon * discon)1467c478bd9Sstevel@tonic-gate t_rcvdis(int fd, struct t_discon *discon)
1477c478bd9Sstevel@tonic-gate {
1487c478bd9Sstevel@tonic-gate 	return (_tx_rcvdis(fd, discon, TX_TLI_API));
1497c478bd9Sstevel@tonic-gate }
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate int
t_rcvrel(int fd)1527c478bd9Sstevel@tonic-gate t_rcvrel(int fd)
1537c478bd9Sstevel@tonic-gate {
1547c478bd9Sstevel@tonic-gate 	return (_tx_rcvrel(fd, TX_TLI_API));
1557c478bd9Sstevel@tonic-gate }
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate int
t_rcvudata(int fd,struct t_unitdata * unitdata,int * flags)1587c478bd9Sstevel@tonic-gate t_rcvudata(int fd, struct t_unitdata *unitdata, int *flags)
1597c478bd9Sstevel@tonic-gate {
1607c478bd9Sstevel@tonic-gate 	return (_tx_rcvudata(fd, unitdata, flags, TX_TLI_API));
1617c478bd9Sstevel@tonic-gate }
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate int
t_rcvuderr(int fd,struct t_uderr * uderr)1647c478bd9Sstevel@tonic-gate t_rcvuderr(int fd, struct t_uderr *uderr)
1657c478bd9Sstevel@tonic-gate {
1667c478bd9Sstevel@tonic-gate 	return (_tx_rcvuderr(fd, uderr, TX_TLI_API));
1677c478bd9Sstevel@tonic-gate }
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate int
t_snd(int fd,char * buf,unsigned int nbytes,int flags)1707c478bd9Sstevel@tonic-gate t_snd(int fd, char *buf, unsigned int nbytes, int flags)
1717c478bd9Sstevel@tonic-gate {
1727c478bd9Sstevel@tonic-gate 	return (_tx_snd(fd, buf, nbytes, flags, TX_TLI_API));
1737c478bd9Sstevel@tonic-gate }
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate int
t_snddis(int fd,struct t_call * call)1767c478bd9Sstevel@tonic-gate t_snddis(int fd, struct t_call *call)
1777c478bd9Sstevel@tonic-gate {
1787c478bd9Sstevel@tonic-gate 	return (_tx_snddis(fd, call, TX_TLI_API));
1797c478bd9Sstevel@tonic-gate }
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate int
t_sndrel(int fd)1827c478bd9Sstevel@tonic-gate t_sndrel(int fd)
1837c478bd9Sstevel@tonic-gate {
1847c478bd9Sstevel@tonic-gate 	return (_tx_sndrel(fd, TX_TLI_API));
1857c478bd9Sstevel@tonic-gate }
1867c478bd9Sstevel@tonic-gate 
1877c478bd9Sstevel@tonic-gate int
t_sndudata(int fd,struct t_unitdata * unitdata)1887c478bd9Sstevel@tonic-gate t_sndudata(int fd, struct t_unitdata *unitdata)
1897c478bd9Sstevel@tonic-gate {
1907c478bd9Sstevel@tonic-gate 	return (_tx_sndudata(fd, unitdata, TX_TLI_API));
1917c478bd9Sstevel@tonic-gate }
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate char *
t_strerror(int errnum)194*7257d1b4Sraf t_strerror(int errnum)
1957c478bd9Sstevel@tonic-gate {
1967c478bd9Sstevel@tonic-gate 	return (_tx_strerror(errnum, TX_TLI_API));
1977c478bd9Sstevel@tonic-gate }
1987c478bd9Sstevel@tonic-gate 
1997c478bd9Sstevel@tonic-gate int
t_sync(int fd)2007c478bd9Sstevel@tonic-gate t_sync(int fd)
2017c478bd9Sstevel@tonic-gate {
2027c478bd9Sstevel@tonic-gate 	return (_tx_sync(fd, TX_TLI_API));
2037c478bd9Sstevel@tonic-gate }
2047c478bd9Sstevel@tonic-gate 
2057c478bd9Sstevel@tonic-gate int
t_unbind(int fd)2067c478bd9Sstevel@tonic-gate t_unbind(int fd)
2077c478bd9Sstevel@tonic-gate {
2087c478bd9Sstevel@tonic-gate 	return (_tx_unbind(fd, TX_TLI_API));
2097c478bd9Sstevel@tonic-gate }
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate int
t_getname(int fd,struct netbuf * name,int type)2127c478bd9Sstevel@tonic-gate t_getname(int fd, struct netbuf *name, int type)
2137c478bd9Sstevel@tonic-gate {
2147c478bd9Sstevel@tonic-gate 	return (_tx_getname(fd, name, type, TX_TLI_API));
2157c478bd9Sstevel@tonic-gate }
216