⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tiuser.h

📁 VRTX 商用嵌入式实时操作系统
💻 H
字号:
/***************************************************************************
*
*               Copyright (c) 1993 READY SYSTEMS CORPORATION.
*
*       All rights reserved. READY SYSTEMS' source code is an unpublished
*       work and the use of a copyright notice does not imply otherwise.
*       This source code contains confidential, trade secret material of
*       READY SYSTEMS. Any attempt or participation in deciphering, decoding,
*       reverse engineering or in any way altering the source code is
*       strictly prohibited, unless the prior written consent of
*       READY SYSTEMS is obtained.
*
*
*       Module Name:            tiuser.h
*
*       Identification:         @(#) 1.6 tiuser.h
*
*       Date:                   2/4/94  09:33:14
*
****************************************************************************
*/

/*
 RCS header identifier - $Id: tiuser.h,v 1.6 1993/11/19 01:03:02 robert Exp $
*/
/*
 * Copyrighted as an unpublished work.
 * (c) Copyright 1992-1993 Lachman Technology, Incorporated
 * All rights reserved.
 * 
 * RESTRICTED RIGHTS
 * 
 * These programs are supplied under a license.  They may be used,
 * disclosed, and/or copied only as permitted under such license
 * agreement.  Any copy must contain the above copyright notice and
 * this restricted rights notice.  Use, copying, and/or disclosure
 * of the programs is strictly prohibited unless otherwise provided
 * in the license agreement.
 */

#ifndef __TIUSER_H
#define __TIUSER_H

#ifdef __cplusplus
extern "C" {
#endif

/*******************************************************************************
 *
 */
struct netbuf {				/* (NPG 2-22) */
	unsigned int	maxlen;		/* maximum bytes the buffer can hold */
	unsigned int	len;		/* byte of data in the buffer */
	char		*buf;	/* buffer containing the data */
};


struct t_bind {				/* (NPG 2-21) */
	struct netbuf	addr;		/* address to be bound */
	unsigned	qlen;		/* max outstanding connect */
					/*  indications that may arrive at */
					/*  this endpoint */
};


struct t_call {				/* (NPG 2-25) */
	struct netbuf	addr;		/* address of the server */
	struct netbuf	opt;		/* protocol-specific options */
	struct netbuf	udata;		/* user data sent with the connect */
					/*  request to the server */
	long		sequence;	/* */
};


struct t_unitdata {			/* (NPG 2-44) */
	struct netbuf	addr;		/* source/dest address of datagrams */
	struct netbuf	opt;		/* protocol-specific options */
	struct netbuf	udata;		/* the data itself */
};


struct t_uderr {			/* (NPG 2-46) */
	struct netbuf	addr;		/* dest address of bad datagram */
	struct netbuf	opt;		/* protocol-specific options */
	long		error;		/* protocal-specific error code */
};


struct t_discon {			/* (NPG 2-58) */
	struct netbuf	udata;		/* user data sent with the disconnect */
	int		reason;		/* protocal-specific discon reason */ 
	long		sequence;	/* matching connect indication */
};


struct t_optmgmt {			/* (NPG A t_optmgmt(3N)) */
	struct netbuf	opt;		/* protocol-specific options */
	long		flags;		/* actions to take with optins */
};

/*
 * DEFAULT_OPT_SIZE is used by t_alloc() to allocate a buffer for
 * t_optmgmt structures.  It is assumed to be larger than the largest
 * possible size of information returned by a T_OPTMGMT_ACK.  This define
 * may need to be increased if the TCP stack is modified, or if other
 * protocol stacks are introduced that support TLI.
 */
#define DEFAULT_OPT_SIZE	512	/* if options == -1 */

struct t_info {				/* (NPG A t_getinfo(3N)) */
	long addr;	/* max size of the transport protocal address */
	long options;	/* max number of bytes of protocal-specific options */
	long tsdu;	/* max size of a Transport Service Data Unit */
	long etsdu;	/* Expedited TSDU */
	long connect;	/* max data allowed on connection establ. funcs. */
	long discon;	/* max data allowed on t_snddis and t_rcvdis funcs */
	long servtype;	/* service type supported by the transport provider */
};



/*******************************************************************************
 * TLI Events
 */
#define T_LISTEN	1
#define T_CONNECT	2
#define T_DATA		3
#define T_EXDATA	4
#define T_DISCONNECT	5
#define T_ORDREL	6
#define T_UDERR		7


/*******************************************************************************
 * values for t_errno
 */
#define TBADF		1
#define TOUTSTATE	2
#define TACCES		3
#define TBADOPT		4
#define TBADDATA	5
#define TBADSEQ		6
#define TLOOK		7
#define TNOTSUPPORT	8
#define TSYSERR		9
#define TNOADDR		10
#define TBUFOVFLW	11
#define TNODATA		12
#define TBADADDR	13
#define TBADFLAG	14
#define TNODIS		15
#define TNOREL		16
#define TNOUDERR	17
#define TFLOW		18
#define TSTATECHNG	19
#define TADDRBUSY	20


/*******************************************************************************
 * Transort Provider States
 */
#define T_UNINIT	0
#define T_UNBND		1
#define T_IDLE		2
#define T_OUTCON	3
#define T_INCON		4
#define T_DATAXFER	5
#define T_OUTREL	6
#define T_INREL		7


/*******************************************************************************
 * t_alloc() structure allocation flags
 */
#define T_BIND		1
#define T_CALL		2
#define T_OPTMGMT	3
#define T_DIS		4
#define T_UNITDATA	5
#define T_UDERROR	6
#define T_INFO		7


/*******************************************************************************
 * t_alloc() netbuf allocation flags
 */
#define T_ADDR		0x01
#define T_OPT		0x02
#define T_UDATA		0x04
#define T_ALL		(T_ADDR|T_OPT|T_UDATA)


/*******************************************************************************
 * t_snd() / t_rcv() flag values
 */
#define T_MORE		0x01
#define T_EXPEDITED	0x02

/*******************************************************************************
 * Transport Provider service types
 */
#define SENDZERO        0x01
#define T_COTS		1
#define T_COTS_ORD	2
#define T_CLTS		3


/*******************************************************************************
 * t_optmgmt flags
 */
#define T_SUCCESS	0x01
#define T_NEGOTIATE	0x02
#define T_CHECK		0x04
#define T_DEFAULT	0x08
#define T_FAILURE	0x10


extern char * t_errlist[];
extern int t_nerr;

/*
 * TLI Library prototypes
 */
int t_accept (int fd, int resfd, struct t_call *call);
char *t_alloc (int fd, int struct_type, int fields);
int t_bind (int fd, struct t_bind *req, struct t_bind *ret);
int t_close (int fd);
int t_connect (int fd, struct t_call *sndcall, struct t_call *rcvcall);
void t_error (char *errmsg);
int t_free (void *p, int struct_type);
int t_getinfo (int fd, struct t_info *info);
int t_getstate (int fd);
int t_listen (int fd, struct t_call *call);
int t_look (int fd);
int t_open (char *path, int oflag, struct t_info *info);
int t_optmgmt (int fd, struct t_optmgmt *req, struct t_optmgmt *ret);
int t_rcv (int fd, char *buf, unsigned nbytes, int *flags);
int t_rcvconnect (int fd, struct t_call *call);
int t_rcvdis (int fd, struct t_discon *discon);
int t_rcvrel (int fd);
int t_rcvudata (int fd, struct t_unitdata *unitdata, int *flags);
int t_rcvuderr (int fd, struct t_uderr *uderr);
int t_snd (int fd, char *buf, unsigned nbytes, int flags);
int t_snddis (int fd, struct t_call *call);
int t_sndrel (int fd);
int t_sndudata (int fd, struct t_unitdata *unitdata);
int t_sync (int fd);
int t_unbind (int fd);

#ifdef __cplusplus
}
#endif

#endif	/* __TIUSER_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -