xref: /onnv-gate/usr/src/lib/libnsl/nsl/tx.h (revision 132:e3f7eaf7dde4)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
22*132Srobinson 
230Sstevel@tonic-gate /*
24*132Srobinson  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
250Sstevel@tonic-gate  * Use is subject to license terms.
260Sstevel@tonic-gate  */
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #ifndef	_TX_H
290Sstevel@tonic-gate #define	_TX_H
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <sys/uio.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef	__cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /*
400Sstevel@tonic-gate  * This file contains declarations local to the TLI/XTI implmentation
410Sstevel@tonic-gate  */
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /*
440Sstevel@tonic-gate  * Look buffer list
450Sstevel@tonic-gate  * Could be multiple buffers for MT case
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate struct _ti_lookbufs {
480Sstevel@tonic-gate 	struct _ti_lookbufs *tl_next; /* next in list   */
490Sstevel@tonic-gate 	int	tl_lookclen;	/* "look" ctl part length */
500Sstevel@tonic-gate 	char	*tl_lookcbuf;	/* pointer to "look" ctl	*/
510Sstevel@tonic-gate 	int	tl_lookdlen;	/* "look" data length	*/
520Sstevel@tonic-gate 	char	*tl_lookdbuf;	/* pointer to "look" data */
530Sstevel@tonic-gate };
540Sstevel@tonic-gate 
550Sstevel@tonic-gate /* TI interface user level structure - one per open file */
560Sstevel@tonic-gate 
570Sstevel@tonic-gate struct _ti_user {
580Sstevel@tonic-gate 	struct _ti_user	*ti_next; 	/* next one		*/
590Sstevel@tonic-gate 	struct _ti_user	*ti_prev; 	/* previous one	*/
600Sstevel@tonic-gate 	int	ti_fd;			/* file descriptor	*/
610Sstevel@tonic-gate 	struct  _ti_lookbufs ti_lookbufs; /* head of list of look buffers */
620Sstevel@tonic-gate 	int	ti_lookcnt;		/* buffered look flag	*/
630Sstevel@tonic-gate 	ushort_t ti_flags;		/* flags		*/
640Sstevel@tonic-gate 	int	ti_rcvsize;	/* connect or disconnect data buf size */
650Sstevel@tonic-gate 	char	*ti_rcvbuf;		/* connect or disconnect data buffer */
660Sstevel@tonic-gate 	int	ti_ctlsize;		/* ctl buffer size	*/
670Sstevel@tonic-gate 	char	*ti_ctlbuf;		/* ctl buffer		*/
680Sstevel@tonic-gate 	int	ti_state;		/* user level state	*/
690Sstevel@tonic-gate 	int	ti_ocnt;		/* # outstanding connect indications */
700Sstevel@tonic-gate 	t_scalar_t	ti_maxpsz;	/* TIDU size		*/
710Sstevel@tonic-gate 	t_scalar_t	ti_tsdusize;	/* TSDU size		*/
720Sstevel@tonic-gate 	t_scalar_t	ti_etsdusize;	/* ETSDU size		*/
730Sstevel@tonic-gate 	t_scalar_t	ti_cdatasize;	/* CDATA_size		*/
740Sstevel@tonic-gate 	t_scalar_t	ti_ddatasize;	/* DDATA_size		*/
750Sstevel@tonic-gate 	t_scalar_t	ti_servtype;	/* service type		*/
760Sstevel@tonic-gate 	t_scalar_t	ti_prov_flag;	/* TPI PROVIDER_flag	*/
770Sstevel@tonic-gate 	uint_t	ti_qlen;	/* listener backlog limit */
780Sstevel@tonic-gate 	t_uscalar_t	acceptor_id;	/* Saved acceptor_id value */
790Sstevel@tonic-gate 	dev_t	ti_rdev;		/* for fd validation */
800Sstevel@tonic-gate 	ino_t	ti_ino;			/* for fd validation */
810Sstevel@tonic-gate 	mutex_t ti_lock;	/* lock to protect this data structure */
820Sstevel@tonic-gate };
830Sstevel@tonic-gate 
840Sstevel@tonic-gate /*
850Sstevel@tonic-gate  * Local flags used with ti_flags field in instance structure of
860Sstevel@tonic-gate  * type 'struct _ti_user' declared above. Historical note:
870Sstevel@tonic-gate  * This namespace constants were previously declared in a
880Sstevel@tonic-gate  * a very messed up namespace in timod.h
890Sstevel@tonic-gate  */
900Sstevel@tonic-gate #define	USED		0x0001	/* data structure in use		*/
910Sstevel@tonic-gate #define	MORE		0x0008	/* more data				*/
920Sstevel@tonic-gate #define	EXPEDITED	0x0010	/* processing expedited TSDU		*/
930Sstevel@tonic-gate #define	V_ACCEPTOR_ID	0x0020	/* acceptor_id field is has valid value	*/
940Sstevel@tonic-gate #define	TX_TQFULL_NOTIFIED 0x0040  /* TQFULL error has been returned once  */
950Sstevel@tonic-gate 
960Sstevel@tonic-gate 
970Sstevel@tonic-gate /*
980Sstevel@tonic-gate  * Valid flags that can be passed by user in t_sndv() or t_snd()
990Sstevel@tonic-gate  */
1000Sstevel@tonic-gate 
1010Sstevel@tonic-gate #define	TX_ALL_VALID_FLAGS (T_MORE|T_EXPEDITED|T_PUSH)
1020Sstevel@tonic-gate 
1030Sstevel@tonic-gate #define	_T_MAX(x, y) 		((x) > (y) ? (x) : (y))
1040Sstevel@tonic-gate 
1050Sstevel@tonic-gate /*
1060Sstevel@tonic-gate  * Following are used to indicate which API entry point is calling common
1070Sstevel@tonic-gate  * routines
1080Sstevel@tonic-gate  */
1090Sstevel@tonic-gate #define		TX_TLI_API	1	/* The API semantics is TLI */
1100Sstevel@tonic-gate #define		TX_XTI_XNS4_API	2	/* The API semantics is XTI Unix95 */
1110Sstevel@tonic-gate #define		TX_XTI_XNS5_API	3	/* The API semantics is XTI Unix98 */
1120Sstevel@tonic-gate #define		TX_XTI_API	TX_XTI_XNS4_API
1130Sstevel@tonic-gate 					/* The base XTI semantics is Unix95 */
1140Sstevel@tonic-gate 
1150Sstevel@tonic-gate /* _T_IS_XTI(x) - Is 'x' an XTI inspired api_semantics */
1160Sstevel@tonic-gate #define		_T_IS_XTI(x)	((x) != TX_TLI_API)
1170Sstevel@tonic-gate #define		_T_IS_TLI(x)	((x) == TX_TLI_API)
1180Sstevel@tonic-gate 
1190Sstevel@tonic-gate /* _T_API_VER_LT(x, y) - Is API version 'x' older than API version 'y' */
1200Sstevel@tonic-gate #define		_T_API_VER_LT(x, y)	((x) < (y))
1210Sstevel@tonic-gate 
1220Sstevel@tonic-gate /*
1230Sstevel@tonic-gate  * Note: T_BADSTATE also defined in <sys/tiuser.h>
1240Sstevel@tonic-gate  */
1250Sstevel@tonic-gate #define	T_BADSTATE 8
1260Sstevel@tonic-gate 
1270Sstevel@tonic-gate #ifdef DEBUG
1280Sstevel@tonic-gate #include <syslog.h>
1290Sstevel@tonic-gate #define	_T_TX_SYSLOG2(tiptr, X, Y) if ((tiptr)->ti_state == T_BADSTATE)\
1300Sstevel@tonic-gate 	syslog(X, Y)
1310Sstevel@tonic-gate #else
1320Sstevel@tonic-gate #define	_T_TX_SYSLOG2(tiptr, X, Y)
1330Sstevel@tonic-gate #endif	/* DEBUG */
1340Sstevel@tonic-gate 
1350Sstevel@tonic-gate /*
1360Sstevel@tonic-gate  * Macro to change state and log invalid state error
1370Sstevel@tonic-gate  */
1380Sstevel@tonic-gate 
1390Sstevel@tonic-gate #define	_T_TX_NEXTSTATE(event, tiptr, errstr)	\
1400Sstevel@tonic-gate 	{	tiptr->ti_state = tiusr_statetbl[event][(tiptr)->ti_state]; \
1410Sstevel@tonic-gate 		_T_TX_SYSLOG2((tiptr), LOG_ERR, errstr); \
1420Sstevel@tonic-gate 	}
1430Sstevel@tonic-gate 
1440Sstevel@tonic-gate /*
1450Sstevel@tonic-gate  * External declarations
1460Sstevel@tonic-gate  */
1470Sstevel@tonic-gate extern mutex_t _ti_userlock;
1480Sstevel@tonic-gate 
1490Sstevel@tonic-gate /*
1500Sstevel@tonic-gate  * Useful shared local constants
1510Sstevel@tonic-gate  */
1520Sstevel@tonic-gate 
1530Sstevel@tonic-gate /*
1540Sstevel@tonic-gate  * TX_XTI_LEVEL_MAX_OPTBUF:
1550Sstevel@tonic-gate  * 	Max option buffer requirement reserved for any XTI level options
1560Sstevel@tonic-gate  *	passed in an option buffer. This is intended as an upper bound.
1570Sstevel@tonic-gate  *	Regardless of what the providers states in OPT_size of T_info_ack,
1580Sstevel@tonic-gate  *	XTI level options can also be added to the option buffer and XTI
1590Sstevel@tonic-gate  *	test suite in particular stuffs XTI level options whether we support
1600Sstevel@tonic-gate  *	them or not.
1610Sstevel@tonic-gate  *
1620Sstevel@tonic-gate  * Here is the heuristic used to arrive at a value:
1630Sstevel@tonic-gate  *	2* [		// factor of 2 for "repeat options" type testing
1640Sstevel@tonic-gate  *		(sizeof(struct t_opthdr)+10*sizeof(t_scalar_t))	// XTI_DEBUG
1650Sstevel@tonic-gate  *	       +(sizeof(struct t_opthdr)+ 2*sizeof(t_scalar_t))	// XTI_LINGER
1660Sstevel@tonic-gate  *	       +(sizeof(struct t_opthdr)+ sizeof(t_scalar_t))	// XTI_RCVBUF
1670Sstevel@tonic-gate  *	       +(sizeof(struct t_opthdr)+ sizeof(t_scalar_t))	// XTI_RCVLOWAT
1680Sstevel@tonic-gate  *	       +(sizeof(struct t_opthdr)+ sizeof(t_scalar_t))	// XTI_SNDBUF
1690Sstevel@tonic-gate  *	       +(sizeof(struct t_opthdr)+ sizeof(t_scalar_t))	// XTI_SNDLOWAT
1700Sstevel@tonic-gate  *	   ]
1710Sstevel@tonic-gate  * => 2* [ 56+24+20+20+20+20 ]
1720Sstevel@tonic-gate  * =>
1730Sstevel@tonic-gate  */
1740Sstevel@tonic-gate #define	TX_XTI_LEVEL_MAX_OPTBUF	320
1750Sstevel@tonic-gate 
1760Sstevel@tonic-gate 
1770Sstevel@tonic-gate /*
1780Sstevel@tonic-gate  * Historic information note:
1790Sstevel@tonic-gate  * The libnsl/nsl code implements TLI and XTI interfaces using common
1800Sstevel@tonic-gate  * code. Most data structures are similar in the exposed interfaces for
1810Sstevel@tonic-gate  * the two interfaces (<tiuser.h> and <xti.h>).
1820Sstevel@tonic-gate  * The common implementation C files include only <xti.h> which is the
1830Sstevel@tonic-gate  * superset in terms of the exposed interfaces. However the file <tiuser.h>
1840Sstevel@tonic-gate  * exposes (via <sys/tiuser.h>), in the past contained certain declarations
1850Sstevel@tonic-gate  * that are strictly internal to the implementation but were exposed through
1860Sstevel@tonic-gate  * their presence in the public header (<tiuser.h>).
1870Sstevel@tonic-gate  * Since the implmentation still needs these declarations, they follow
1880Sstevel@tonic-gate  * in this file and are removed from exposure through the TLI public header
1890Sstevel@tonic-gate  * (<tiuser.h>) which exposed them in the past.
1900Sstevel@tonic-gate  */
1910Sstevel@tonic-gate 
1920Sstevel@tonic-gate /*
1930Sstevel@tonic-gate  * The following are TLI/XTI user level events which cause
1940Sstevel@tonic-gate  * state changes.
1950Sstevel@tonic-gate  * NOTE: Historical namespace pollution warning.
1960Sstevel@tonic-gate  * Some of the event names share the namespace with structure tags
1970Sstevel@tonic-gate  * so there are defined inside comments here and exposed through
1980Sstevel@tonic-gate  * TLI and XTI headers (<tiuser.h> and <xti.h>
1990Sstevel@tonic-gate  */
2000Sstevel@tonic-gate 
2010Sstevel@tonic-gate #define	T_OPEN 		0
2020Sstevel@tonic-gate /* #define	T_BIND		1 */
2030Sstevel@tonic-gate /* #define	T_OPTMGMT	2 */
2040Sstevel@tonic-gate #define	T_UNBIND	3
2050Sstevel@tonic-gate #define	T_CLOSE		4
2060Sstevel@tonic-gate #define	T_SNDUDATA	5
2070Sstevel@tonic-gate #define	T_RCVUDATA	6
2080Sstevel@tonic-gate #define	T_RCVUDERR	7
2090Sstevel@tonic-gate #define	T_CONNECT1	8
2100Sstevel@tonic-gate #define	T_CONNECT2	9
2110Sstevel@tonic-gate #define	T_RCVCONNECT	10
2120Sstevel@tonic-gate #define	T_LISTN		11
2130Sstevel@tonic-gate #define	T_ACCEPT1	12
2140Sstevel@tonic-gate #define	T_ACCEPT2	13
2150Sstevel@tonic-gate #define	T_ACCEPT3	14
2160Sstevel@tonic-gate #define	T_SND		15
2170Sstevel@tonic-gate #define	T_RCV		16
2180Sstevel@tonic-gate #define	T_SNDDIS1	17
2190Sstevel@tonic-gate #define	T_SNDDIS2	18
2200Sstevel@tonic-gate #define	T_RCVDIS1	19
2210Sstevel@tonic-gate #define	T_RCVDIS2	20
2220Sstevel@tonic-gate #define	T_RCVDIS3	21
2230Sstevel@tonic-gate #define	T_SNDREL	22
2240Sstevel@tonic-gate #define	T_RCVREL	23
2250Sstevel@tonic-gate #define	T_PASSCON	24
2260Sstevel@tonic-gate 
2270Sstevel@tonic-gate #define	T_NOEVENTS	25
2280Sstevel@tonic-gate 
2290Sstevel@tonic-gate #define	T_NOSTATES 	9	/* number of legal states */
2300Sstevel@tonic-gate 
2310Sstevel@tonic-gate extern char tiusr_statetbl[T_NOEVENTS][T_NOSTATES];
2320Sstevel@tonic-gate 
2330Sstevel@tonic-gate /*
2340Sstevel@tonic-gate  * Band definitions for data flow.
2350Sstevel@tonic-gate  */
2360Sstevel@tonic-gate #define	TI_NORMAL	0
2370Sstevel@tonic-gate #define	TI_EXPEDITED	1
2380Sstevel@tonic-gate 
2390Sstevel@tonic-gate /*
2400Sstevel@tonic-gate  * Bogus states from tiuser.h
2410Sstevel@tonic-gate  */
2420Sstevel@tonic-gate #define	T_FAKE		8	/* fake state used when state	*/
2430Sstevel@tonic-gate 				/* cannot be determined		*/
2440Sstevel@tonic-gate 
2450Sstevel@tonic-gate /*
2460Sstevel@tonic-gate  * Flags for t_getname() from tiuser.h
2470Sstevel@tonic-gate  * Note: This routine's counterpart in XTI is substatnially modified
2480Sstevel@tonic-gate  * (i.e. t_getprotaddr() and does not use these flags)
2490Sstevel@tonic-gate  */
2500Sstevel@tonic-gate #define	LOCALNAME	0
2510Sstevel@tonic-gate #define	REMOTENAME	1
2520Sstevel@tonic-gate 
2530Sstevel@tonic-gate /*
2540Sstevel@tonic-gate  * Obsolete error event for t_look() in TLI, still needed for compatibility
2550Sstevel@tonic-gate  * to broken apps that are affected (e.g nfsd,lockd) if real error returned.
2560Sstevel@tonic-gate  */
2570Sstevel@tonic-gate #define	T_ERROR 0x0020
2580Sstevel@tonic-gate 
2590Sstevel@tonic-gate /*
2600Sstevel@tonic-gate  * GENERAL UTILITY MACROS
2610Sstevel@tonic-gate  */
2620Sstevel@tonic-gate #define	A_CNT(arr)	(sizeof (arr)/sizeof (arr[0]))
2630Sstevel@tonic-gate #define	A_END(arr)	(&arr[A_CNT(arr)])
2640Sstevel@tonic-gate #define	A_LAST(arr)	(&arr[A_CNT(arr)-1])
2650Sstevel@tonic-gate 
2660Sstevel@tonic-gate /*
2670Sstevel@tonic-gate  * Following macro compares a signed size obtained from TPI primitive
2680Sstevel@tonic-gate  * to unsigned size of buffer where it needs to go into passed using
2690Sstevel@tonic-gate  * the "struct netbuf" type.
2700Sstevel@tonic-gate  * Since many programs are buggy and forget to initialize "netbuf" or
2710Sstevel@tonic-gate  * (while unlikely!) allocated buffer can legally even be larger than
2720Sstevel@tonic-gate  * max signed integer, we use the following macro to do unsigned comparison
2730Sstevel@tonic-gate  * after verifying that signed quantity is positive.
2740Sstevel@tonic-gate  */
2750Sstevel@tonic-gate #define	TLEN_GT_NLEN(tpilen, netbuflen) \
2760Sstevel@tonic-gate 	(((tpilen) > 0) && ((unsigned int)(tpilen) > (netbuflen)))
2770Sstevel@tonic-gate 
2780Sstevel@tonic-gate 
2790Sstevel@tonic-gate /*
2800Sstevel@tonic-gate  *	N.B.:  this interface is deprecated.  Use t_strerror() instead.
2810Sstevel@tonic-gate  */
2820Sstevel@tonic-gate extern char *t_errlist[];
2830Sstevel@tonic-gate extern int t_nerr;
2840Sstevel@tonic-gate 
2850Sstevel@tonic-gate /*
2860Sstevel@tonic-gate  * UTILITY ROUTINES FUNCTION PROTOTYPES
2870Sstevel@tonic-gate  */
2880Sstevel@tonic-gate 
289*132Srobinson extern void _t_adjust_iov(int, struct iovec *, int *);
290*132Srobinson extern struct _ti_user *_t_checkfd(int, int, int);
291*132Srobinson extern int _t_delete_tilink(int);
292*132Srobinson extern int _t_rcv_conn_con(struct _ti_user *, struct t_call *, struct strbuf *,
293*132Srobinson 							int);
294*132Srobinson extern int _t_snd_conn_req(struct _ti_user *, const struct t_call *,
295*132Srobinson 							struct strbuf *);
296*132Srobinson extern int _t_aligned_copy(struct strbuf *, int, int, char *, t_scalar_t *);
297*132Srobinson extern struct _ti_user *_t_create(int, struct t_info *, int, int *);
298*132Srobinson extern int _t_do_ioctl(int, char *, int, int, int *);
299*132Srobinson extern int _t_is_event(int, struct _ti_user *);
300*132Srobinson extern int _t_is_ok(int, struct _ti_user *, t_scalar_t);
301*132Srobinson extern int _t_look_locked(int, struct _ti_user *, int, int);
302*132Srobinson extern int _t_register_lookevent(struct _ti_user *, caddr_t, int, caddr_t, int);
303*132Srobinson extern void _t_free_looklist_head(struct _ti_user *);
304*132Srobinson extern void _t_flush_lookevents(struct _ti_user *);
305*132Srobinson extern int _t_acquire_ctlbuf(struct _ti_user *, struct strbuf *, int *);
306*132Srobinson extern int _t_acquire_databuf(struct _ti_user *, struct strbuf *, int *);
3070Sstevel@tonic-gate 
3080Sstevel@tonic-gate /*
3090Sstevel@tonic-gate  * Core function TLI/XTI routines function prototypes
3100Sstevel@tonic-gate  */
3110Sstevel@tonic-gate extern int _tx_accept(int, int, const struct t_call *, int);
3120Sstevel@tonic-gate extern char *_tx_alloc(int, int, int, int);
3130Sstevel@tonic-gate extern int _tx_bind(int, const struct t_bind *, struct t_bind *, int);
3140Sstevel@tonic-gate extern int _tx_close(int, int);
3150Sstevel@tonic-gate extern int _tx_connect(int, const struct t_call *, struct t_call *, int);
3160Sstevel@tonic-gate extern int _tx_error(const char *, int);
3170Sstevel@tonic-gate extern int _tx_free(char *, int, int);
3180Sstevel@tonic-gate extern int _tx_getinfo(int, struct t_info *, int);
3190Sstevel@tonic-gate extern int _tx_getname(int, struct netbuf *, int, int);
3200Sstevel@tonic-gate extern int _tx_getstate(int, int);
3210Sstevel@tonic-gate extern int _tx_getprotaddr(int, struct t_bind *, struct t_bind *, int);
3220Sstevel@tonic-gate extern int _tx_listen(int, struct t_call *, int);
3230Sstevel@tonic-gate extern int _tx_look(int, int);
3240Sstevel@tonic-gate extern int _tx_open(const char *, int, struct t_info *, int);
3250Sstevel@tonic-gate extern int _tx_optmgmt(int, const struct t_optmgmt *, struct t_optmgmt *, int);
3260Sstevel@tonic-gate extern int _tx_rcv(int, char *, unsigned, int *, int);
3270Sstevel@tonic-gate extern int _tx_rcvconnect(int, struct t_call *, int);
3280Sstevel@tonic-gate extern int _tx_rcvdis(int, struct t_discon *, int);
3290Sstevel@tonic-gate extern int _tx_rcvrel(int, int);
3300Sstevel@tonic-gate extern int _tx_rcvudata(int, struct t_unitdata *, int *, int);
3310Sstevel@tonic-gate extern int _tx_rcvuderr(int, struct t_uderr *, int);
3320Sstevel@tonic-gate extern int _tx_snd(int, char *, unsigned, int, int);
3330Sstevel@tonic-gate extern int _tx_snddis(int, const struct t_call *, int);
3340Sstevel@tonic-gate extern int _tx_sndrel(int, int);
3350Sstevel@tonic-gate extern int _tx_sndudata(int, const struct t_unitdata *, int);
3360Sstevel@tonic-gate extern char *_tx_strerror(int, int);
3370Sstevel@tonic-gate extern int _tx_sync(int, int);
3380Sstevel@tonic-gate extern int _tx_unbind(int, int);
3390Sstevel@tonic-gate extern int _tx_unbind_locked(int, struct _ti_user *, struct strbuf *);
3400Sstevel@tonic-gate extern int _t_expinline_queued(int, int *);
3410Sstevel@tonic-gate extern int _t_do_postconn_sync(int, struct _ti_user *);
3420Sstevel@tonic-gate 
3430Sstevel@tonic-gate /*
3440Sstevel@tonic-gate  * The following helper functions are used by scatter/gather functions,
3450Sstevel@tonic-gate  * which are defined only for XTI and not available in TLI. Moreover
3460Sstevel@tonic-gate  * the definition of struct t_iovec which is used below is not visible to
3470Sstevel@tonic-gate  * TLI. Hence tli_wrappers.c should not see the prototypes below.
3480Sstevel@tonic-gate  */
3490Sstevel@tonic-gate #ifndef TLI_WRAPPERS
3500Sstevel@tonic-gate unsigned int _t_bytecount_upto_intmax(const struct t_iovec *, unsigned int);
3510Sstevel@tonic-gate void _t_scatter(struct strbuf *, struct t_iovec *, int);
3520Sstevel@tonic-gate void _t_gather(char *, const struct t_iovec *, unsigned int);
3530Sstevel@tonic-gate void _t_copy_tiov_to_iov(const struct t_iovec *, int, struct iovec *, int *);
3540Sstevel@tonic-gate 
3550Sstevel@tonic-gate /*
3560Sstevel@tonic-gate  * The following scatter/gather and other misc. functions are defined only
3570Sstevel@tonic-gate  * for XTI and not available in TLI. Moreover the definition of struct t_iovec
3580Sstevel@tonic-gate  * which is used below is not visible to TLI. Hence tli_wrappers.c should not
3590Sstevel@tonic-gate  * see the prototypes below.
3600Sstevel@tonic-gate  */
3610Sstevel@tonic-gate extern int _tx_rcvv(int, struct t_iovec *, unsigned int,  int *, int);
3620Sstevel@tonic-gate extern int _tx_rcvreldata(int, struct t_discon *, int);
3630Sstevel@tonic-gate extern int _tx_rcvvudata(int, struct t_unitdata *, struct t_iovec *,
3640Sstevel@tonic-gate     unsigned int, int *, int);
3650Sstevel@tonic-gate extern int _tx_sndv(int, const struct t_iovec *, unsigned int, int, int);
3660Sstevel@tonic-gate extern int _tx_sndreldata(int, struct t_discon *, int);
3670Sstevel@tonic-gate extern int _tx_sndvudata(int, const struct t_unitdata *, struct t_iovec *,
3680Sstevel@tonic-gate     unsigned int, int);
3690Sstevel@tonic-gate extern int _tx_sysconf(int, int);
3700Sstevel@tonic-gate #endif /* TLI_WRAPPERS */
3710Sstevel@tonic-gate 
3720Sstevel@tonic-gate #ifdef	__cplusplus
3730Sstevel@tonic-gate }
3740Sstevel@tonic-gate #endif
3750Sstevel@tonic-gate 
3760Sstevel@tonic-gate #endif	/* _TX_H */
377