📄 tihdr.h
字号:
struct T_ok_ack { t_scalar_t PRIM_type; /* always T_OK_ACK */ t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_ADDR_ACK */ t_scalar_t LOCADDR_length; /* length of local address - see not in sec. 1.4 */ t_scalar_t LOCADDR_offset; /* offset of local address */ t_scalar_t REMADDR_length; /* length of remote address - see not in sec. 1.4 */ t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_CONN_REQ */ t_scalar_t DEST_length; /* dest addr length */ t_scalar_t DEST_offset; /* dest addr offset */ t_scalar_t OPT_length; /* options length */ t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_CONN_RES */ t_scalar_t ACCEPTOR_id; /* reponse queue ptr */ t_scalar_t OPT_length; /* options length */ t_scalar_t OPT_offset; /* options offset */ t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_DISCON_REQ */ t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_DATA_REQ */ t_scalar_t 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 { t_scalar_t PRIM_type; /* T_EXDATA_REQ */ t_scalar_t 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 { t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_CONN_IND */ t_scalar_t SRC_length; /* source addr length = see note in sec. 1.4 */ t_scalar_t SRC_offset; /* source addr offset */ t_scalar_t OPT_length; /* options length = see note in sec. 1.4 */ t_scalar_t OPT_offset; /* options offset */ t_scalar_t 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 { t_scalar_t PRIM_type; /* T_CONN_CON */ t_scalar_t RES_length; /* responding addr length - see note in sec. 1.4 */ t_scalar_t RES_offset; /* responding addr offset */ t_scalar_t OPT_length; /* options length - see note in sec. 1.4 */ t_scalar_t 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 { t_scalar_t PRIM_type; /* T_DISCON_IND */ t_scalar_t DISCON_reason; /* disconnect reason - see note in sec. 1.4 */ t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_DATA_IND */ t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_EXDATA_IND */ t_scalar_t 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 { t_scalar_t 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 { t_scalar_t PRIM_type; /* always T_UNITDATA_REQ */ t_scalar_t DEST_length; /* dest addr length */ t_scalar_t DEST_offset; /* dest addr offset */ t_scalar_t OPT_length; /* options length */ t_scalar_t 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 { t_scalar_t PRIM_type; /* T_UNITDATA_IND */ t_scalar_t SRC_length; /* source addr length - see note in sec. 1.4 */ t_scalar_t SRC_offset; /* source addr offset */ t_scalar_t OPT_length; /* options length - see note in sec. 1.4 */ t_scalar_t 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 { t_scalar_t PRIM_type; /* T_UDERROR_IND */ t_scalar_t DEST_length; /* dest addr length - see note in sec. 1.4 */ t_scalar_t DEST_offset; /* dest addr offset */ t_scalar_t OPT_length; /* options length - see note in sec. 1.4 */ t_scalar_t OPT_offset; /* options offset */ t_scalar_t ERROR_type; /* error type */};struct T_optdata_req { t_scalar_t PRIM_type; /* T_OPTDATA_REQ */ t_scalar_t DATA_flag; /* flag bits associated with data */ t_scalar_t OPT_length; /* options length */ t_scalar_t OPT_offset; /* options offset */};struct T_optdata_ind { t_scalar_t PRIM_type; /* T_OPTDATA_REQ */ t_scalar_t DATA_flag; /* flag bits associated with data */ t_scalar_t OPT_length; /* options length */ t_scalar_t OPT_offset; /* options offset */};struct T_capability_req { t_scalar_t PRIM_type; /* T_CAPABILITY_REQ */ t_uscalar_t CAP_bits1; /* capability bits 1 */};struct T_capability_ack { t_scalar_t PRIM_type; /* T_CAPABILITY_ACK */ t_uscalar_t CAP_bits1; /* capability bits #1 */ struct T_info_ack INFO_ack; /* info acknowledgement */ t_uscalar_t ACCEPTOR_id; /* accepting endpoint id */};#define TC1_INFO (1<<0)#define TC1_ACCEPTOR_ID (1<<1)#define TCI_CAP_BITS2 (1<<31)union T_primitives { t_scalar_t 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; struct T_capability_req capability_req; struct T_capability_ack capability_ack;};#ifndef T_OPT_FIRSTHDR/* 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 *)(((t_uscalar_t)(p) - (o) + _T_ALIGN_SIZE - 1) \ & ~(_T_ALIGN_SIZE - 1)) + (o))#define _T_ALIGN_OFFSET(p) \ ((t_uscalar_t)(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)#endif/* * General purpose constants */#ifndef T_YES#define T_YES 1 /* Yes/on/true */#define T_NO 0 /* No/off/false */#endif#ifndef T_INFINITE#define T_INFINITE -1 /* No limit */#define T_INVALID -2 /* No sense */#endif#ifndef T_SNDZERO#define T_SNDZERO 1 /* Must match <sys/stropts.h>: SNDZERO */#endif#ifdef __END_DECLS/* *INDENT-OFF* */__END_DECLS/* *INDENT-ON* */#endif#endif /* _SYS_TIHDR_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -