📄 tpi.h
字号:
long PRIM_type; /* always T_OK_ACK */ long CORRECT_prim; /* primitive */};/* * T_ADDR_ACK, M_PCPROTO * * This primitive indicates to the transport user the addresses fo the local * and remote transport entities. The local address is the protocol address * that has been bound to the stream. If a connection has been established, * the remote address is the protocol address of the remote transport entity. */struct T_addr_ack { long PRIM_type; /* always T_ADDR_ACK */ long LOCADDR_length; /* length of local address - see not in sec. 1.4 */ long LOCADDR_offset; /* offset of local address */ long REMADDR_length; /* length of remote address - see not in sec. 1.4 */ long REMADDR_offset; /* offset of remote address */};/* * Connection Oriented Transport Primitives *//* * T_CONN_REQ, M_PROTO * * This primitive requests that the transport provider make a connection to * the specified destination. */struct T_conn_req { long PRIM_type; /* always T_CONN_REQ */ long DEST_length; /* dest addr length */ long DEST_offset; /* dest addr offset */ long OPT_length; /* options length */ long OPT_offset; /* options offset */};/* * T_CONN_RES, M_PROTO (followed by 0 or more M_DATA) * * This primitive requests that the transport provider accept a previous * connect request on the specified response queue. */struct T_conn_res { long PRIM_type; /* always T_CONN_RES */ long ACCEPTOR_id; /* reponse queue ptr */ long OPT_length; /* options length */ long OPT_offset; /* options offset */ long SEQ_number; /* sequence number */};/* * T_DSICON_REQ, M_PROTO (followed by 0 or more M_DATA) * * This primitive request that the transport provider deny a request for * connection, or disconnect an existing connection. */struct T_discon_req { long PRIM_type; /* always T_DISCON_REQ */ long SEQ_number; /* sequence number */};/* * T_DATA_REQ, (opt M_PROTO) (followed by 0 or more M_DATA) * * This primitive indicates to the transport provider that this message * contains a transport interface data unit. One or more transport interface * data units form a transport service data unit (TSDU)[11]. This primitive * has a mechanism which indicates the beginning and end of a transport * service data unit. However, not all transport providers support the * concept of a transport service data unit, as noted in section 2.1.2.1. */struct T_data_req { long PRIM_type; /* always T_DATA_REQ */ long MORE_flag; /* indicates more data in TSDU */};/* * T_EXDATA_REQ, M_PROTO (followed by 1 or more M_DATA) * * This primitive indicates to the transport provider that this message * contains an expedited transport interface data unit. One or more * expedited transport interface data units form an expedited transport * service data unit[12]. This primitive has a mechanism which indicates the * beginning and end of an expedited tansport service data unit. However, * not all transport providers support the concept of an expedited transport * service data unit, as noted in section 2.1.2.1. */struct T_exdata_req { long PRIM_type; /* T_EXDATA_REQ */ long MORE_flag;};/* * T_ORDREL_REQ, M_PROTO * * This primitive indicates to the transport provider that the user is * finished sending data. This primitive is only supported by the transport * provider if it is of type T_COTS_ORD. */struct T_ordrel_req { long PRIM_type; /* always T_ORDREL_REQ */};/* * T_CONN_IND, M_PROTO * * This primnitive indicates to the transport user that a connect request to * the user has been made by the user at the specified source address. The */struct T_conn_ind { long PRIM_type; /* always T_CONN_IND */ long SRC_length; /* source addr length = see note in sec. 1.4 */ long SRC_offset; /* source addr offset */ long OPT_length; /* options length = see note in sec. 1.4 */ long OPT_offset; /* options offset */ long SEQ_number; /* sequence number - see not in sec. 1.4 */};/* * T_CONN_CON, M_PROTO, (followed by 0 or more M_DATA) * * This primitive indicates to the user that a connect request has been * confirmed on the specified responding address. */struct T_conn_con { long PRIM_type; /* T_CONN_CON */ long RES_length; /* responding addr length - see note in sec. 1.4 */ long RES_offset; /* responding addr offset */ long OPT_length; /* options length - see note in sec. 1.4 */ long OPT_offset; /* options offset */};/* * T_DISCON_IND, M_PROTO (followed by 0 or more M_DATA) * * This primitive indicates to the user that either a request for connection * has been denied or and existing connection has been disconnected. */struct T_discon_ind { long PRIM_type; /* T_DISCON_IND */ long DISCON_reason; /* disconnect reason - see note in sec. 1.4 */ long SEQ_number; /* sequence number - see note in sec. 1.4 */};/* * T_DATA_IND, (opt M_PROTO) (followed by 0 or more M_DATA) * * This primitive indicates to the transport user that this message contains * a transport interface data unit. One or more transport interface data * units form a transport servie data unit. This primitive has a mechanism * which indicates the beginning and end of a transport service data unit. * However, not all transport provider support the concept of a transport * service data unit, as noted in section 2.1.2.1. */struct T_data_ind { long PRIM_type; /* always T_DATA_IND */ long MORE_flag; /* indicates more data in TSDU */};/* * T_EXDATA_IND, M_PROTO * * This primitive indicates to the transport user that this message contains * an expedited transport interface data unit. One or more expedited * transport interface data units form an expedited transport service data * unit. This primitive has a mechanism which indicates the beginning and * end of an expedited transport service data unit. However, not all * transport providers support the concept of an expedited transport service * data unit, as noted in section 2.1.2.1. */struct T_exdata_ind { long PRIM_type; /* always T_EXDATA_IND */ long MORE_flag; /* indicates more data in ETSDU */};/* * T_ORDREL_IND, M_PROTO * * This primitive indicates to the transport user that the other side of the * connection is finished sending data. This primitive is only supported by * the transport provider if it is of type T_COTS_ORD. */struct T_ordrel_ind { long PRIM_type; /* always T_ORDREL_IND */};/* * Connectionless-Mode Transport Primitives *//* * T_UNITDATA_REQ, M_PROTO * * This primitive request that the transport provider send the specified * datagram to the specified destination. */struct T_unitdata_req { long PRIM_type; /* always T_UNITDATA_REQ */ long DEST_length; /* dest addr length */ long DEST_offset; /* dest addr offset */ long OPT_length; /* options length */ long OPT_offset; /* options offset */};/* * T_UNITDATA_IND, M_PROTO * * This primitive indicates to the transport user that a datagram has been * received from the specified source address. */struct T_unitdata_ind { long PRIM_type; /* T_UNITDATA_IND */ long SRC_length; /* source addr length - see note in sec. 1.4 */ long SRC_offset; /* source addr offset */ long OPT_length; /* options length - see note in sec. 1.4 */ long OPT_offset; /* options offset */};/* * T_UDERROR_IND, M_PROTO * * This primitive indicates to the transport user that a datagram with the * specified destination address and options produced an error. */struct T_uderror_ind { long PRIM_type; /* T_UDERROR_IND */ long DEST_length; /* dest addr length - see note in sec. 1.4 */ long DEST_offset; /* dest addr offset */ long OPT_length; /* options length - see note in sec. 1.4 */ long OPT_offset; /* options offset */ long ERROR_type; /* error type */};struct T_optdata_req { long PRIM_type; /* T_OPTDATA_REQ */ long DATA_flag; /* flag bits associated with data */ long OPT_length; /* options length */ long OPT_offset; /* options offset */};struct T_optdata_ind { long PRIM_type; /* T_OPTDATA_REQ */ long DATA_flag; /* flag bits associated with data */ long OPT_length; /* options length */ long OPT_offset; /* options offset */};union T_primitives { long type; struct T_addr_ack addr_ack; struct T_addr_req addr_req; struct T_bind_ack bind_ack; struct T_bind_req bind_req; struct T_conn_con conn_con; struct T_conn_ind conn_ind; struct T_conn_req conn_req; struct T_conn_res conn_res; struct T_data_ind data_ind; struct T_data_req data_req; struct T_discon_ind discon_ind; struct T_discon_req discon_req; struct T_error_ack error_ack; struct T_exdata_ind exdata_ind; struct T_exdata_req exdata_req; struct T_info_ack info_ack; struct T_info_req info_req; struct T_ok_ack ok_ack; struct T_optmgmt_ack optmgmt_ack; struct T_optmgmt_req optmgmt_req; struct T_ordrel_ind ordrel_ind; struct T_ordrel_req ordrel_req; struct T_uderror_ind uderror_ind; struct T_unbind_req unbind_req; struct T_unitdata_ind unitdata_ind; struct T_unitdata_req unitdata_req; struct T_optdata_req optdata_req; struct T_optdata_ind optdata_ind;};/* The t_opthdr structure defines the layout of options in a T_OPTMGMT_* * data buffer. This is specified in the X/Open specs but does not * appear to exist in SCO 3.2.x, SCO OS5, Interactive SVR4 or UnixWare 1.x. * There are programs that make options request however. * The older TLI uses struct opthdr which is different and incompatible * (see below). */struct t_opthdr { t_uscalar_t len; /* Option length, incl. header */ t_uscalar_t level; /* Option level */ t_uscalar_t name; /* Option name */ t_uscalar_t status; /* Negotiation result */ char value[0]; /* and onwards... */};struct opthdr { t_scalar_t level; /* Option level */ t_scalar_t name; /* Option name */ t_scalar_t len; /* Length of option value */ char value[0]; /* and onwards... */};#define _T_ALIGN_SIZE sizeof(t_uscalar_t)#define _T_ALIGN_OFS(p, o) \ ((char *)(((unsigned long)(p) - (o) + _T_ALIGN_SIZE - 1) \ & ~(_T_ALIGN_SIZE - 1)) + (o))#define _T_ALIGN_OFFSET(p) \ ((unsigned long)(p) & (_T_ALIGN_SIZE - 1))#define _T_ALIGN_OFS_OFS(p, l, o) _T_ALIGN_OFS((char *)(p) + l, (o))#define _T_OPT_FIRSTHDR_OFS(b, l, o) \ ((struct t_opthdr *)( \ (_T_ALIGN_OFS((b), (o)) + sizeof(struct t_opthdr) \ <= (char *)(b) + (l)) ? \ _T_ALIGN_OFS((b), (o)) : NULL))#define _T_OPT_NEXTHDR_OFS(b, l, p, o) \ ((struct t_opthdr *)( \ (_T_ALIGN_OFS_OFS((p), (p)->len + sizeof(struct t_opthdr), (o)) \ <= ((char *)(b) + (l))) ? \ _T_ALIGN_OFS_OFS((p), (p)->len, (o)) : NULL \ ))#define _T_OPT_DATA_OFS(p, o) \ ((unsigned char *)(_T_ALIGN_OFS((struct t_opthdr *)(p)+1, (o))))#define T_OPT_FIRSTHDR(b) _T_OPT_FIRSTHDR_OFS((b)->buf, (b)->len, 0)#define T_OPT_NEXTHDR(b, p) _T_OPT_NEXTHDR_OFS((b)->buf, (b)->len, p, 0)#define T_OPT_DATA(p) _T_OPT_DATA_OFS((p), 0)/* * General purpose constants */#define T_YES 1 /* Yes/on/true */#define T_NO 0 /* No/off/false */#define T_INFINITE -1 /* No limit */#define T_INVALID -2 /* No sense */#define T_SNDZERO 1 /* Must match <sys/stropts.h>: SNDZERO */#endif _SYS_TPI_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -