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