📄 tihdr.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: tihdr.h
*
* Identification: @(#) 1.5 tihdr.h
*
* Date: 1/6/94 16:30:47
*
****************************************************************************
*/
/*
RCS header identifier - $Id: tihdr.h,v 1.5 1993/10/05 18:09:21 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 __TIHDR_H
#define __TIHDR_H
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
* Transport Provider Primitives
*/
#define T_CONN_REQ 1
#define T_CONN_IND 2
#define T_CONN_RES 3
#define T_CONN_CON 4
#define T_DATA_REQ 5
#define T_DATA_IND 6
#define T_EXDATA_REQ 7
#define T_EXDATA_IND 8
#define T_DISCON_REQ 9
#define T_DISCON_IND 10
#define T_UNITDATA_REQ 11
#define T_UNITDATA_IND 12
#define T_ORDREL_REQ 13
#define T_ORDREL_IND 14
#define T_BIND_REQ 15
#define T_BIND_ACK 16
#define T_UNBIND_REQ 17
#define T_OK_ACK 18
#define T_ERROR_ACK 19
#define T_INFO_REQ 20
#define T_INFO_ACK 21
#define T_UDERROR_IND 22
#define T_OPTMGMT_REQ 23
#define T_OPTMGMT_ACK 24
/*******************************************************************************
*
* STPI - "A STREAMS-based Transport Provider Interface"
*/
struct T_info_req { /* STPI 1.1.1.1 */
long PRIM_type; /* primitive type (always T_INFO_REQ) */
};
struct T_bind_req { /* STPI 1.1.1.2 */
long PRIM_type; /* primitive type (always T_BIND_REQ) */
long ADDR_length; /* length of address */
long ADDR_offset; /* offset of address */
unsigned long CONIND_number; /* reequested number of connect */
/* indications to be queued */
};
struct T_unbind_req { /* STPI 1.1.1.3 */
long PRIM_type; /* primitive type (always T_UNBIND_REQ) */
};
struct T_optmgmt_req { /* STPI 1.1.1.4 */
long PRIM_type; /* primitive type (always T_OPTMGMT_REQ) */
long OPT_length; /* options length */
long OPT_offset; /* options offset */
long MGMT_flags; /* flags */
};
struct T_info_ack { /* STPI 1.1.2.1 */
long PRIM_type; /* primitive type (always T_INFO_ACK) */
long TSDU_size; /* max TSDU size */
long ETSDU_size; /* max ETSDU size */
long CDATA_size; /* Connect data size */
long DDATA_size; /* Discon data size */
long ADDR_size; /* TSAP size */
long OPT_size; /* options size */
long TIDU_size; /* TIDU size */
long SERV_type; /* service type */
long CURRENT_state; /* current state */
long PROVIDER_flag; /* provider flags */
};
struct T_bind_ack { /* STPI 1.1.2.2 */
long PRIM_type; /* primitive type (always T_BIND_ACK) */
long ADDR_length; /* length of address */
long ADDR_offset; /* offset of address */
unsigned long CONIND_number; /* connect indications to be queued */
};
struct T_optmgmt_ack { /* STPI 1.1.2.3 */
long PRIM_type; /* primitive type (always T_OPTMGMT_ACK) */
long OPT_length; /* options length */
long OPT_offset; /* options offset */
long MGMT_flags; /* flags */
};
struct T_error_ack { /* STPI 1.1.2.4 */
long PRIM_type; /* primitive type (always T_ERROR_ACK) */
long ERROR_prim; /* primitive in error */
long TLI_error; /* TLI error code */
long UNIX_error; /* UNIX error code */
};
struct T_ok_ack { /* STPI 1.1.2.5 */
long PRIM_type; /* primitive type (always T_OK_ACK) */
long CORRECT_prim; /* primitive */
};
struct T_conn_req { /* STPI 1.2.1.1 */
long PRIM_type; /* primitive 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 */
};
struct T_conn_res { /* STPI 1.2.1.2 */
long PRIM_type; /* primitive type (always T_CONN_RES) */
queue_t *QUEUE_ptr; /* response queue ptr */
long OPT_length; /* options length */
long OPT_offset; /* options offset */
long SEQ_number; /* sequence number */
};
struct T_discon_req { /* STPI 1.2.1.3 */
long PRIM_type; /* primitive type (always T_DISCON_REQ) */
long SEQ_number; /* sequence number */
};
struct T_data_req { /* STPI 1.2.1.4 */
long PRIM_type; /* primitive type (always T_DATA_REQ) */
long MORE_flag; /* indicates more data in TSDU */
};
struct T_exdata_req { /* STPI 1.2.1.5 */
long PRIM_type; /* primitive type (always T_EXDATA_REQ) */
long MORE_flag; /* indicates more data in ETSDU */
};
struct T_ordrel_req { /* STPI 1.2.1.6 */
long PRIM_type; /* primitive type (always T_ORDREL_REQ) */
};
struct T_conn_ind { /* STPI 1.2.2.1 */
long PRIM_type; /* primitive type (always T_CONN_IND) */
long SRC_length; /* source addr length */
long SRC_offset; /* source addr offset */
long OPT_length; /* options length */
long OPT_offset; /* options offset */
long SEQ_number; /* sequence number */
};
struct T_conn_con { /* STPI 1.2.2.2 */
long PRIM_type; /* primitive type (always T_CONN_CON) */
long RES_length; /* responding addr length */
long RES_offset; /* responding addr offset */
long OPT_length; /* options length */
long OPT_offset; /* options offset */
};
struct T_discon_ind { /* STPI 1.2.2.3 */
long PRIM_type; /* primitive type (always T_DISCON_IND) */
long DISCON_reason; /* disconnect reason */
long SEQ_number; /* sequence number */
};
struct T_data_ind { /* STPI 1.2.2.4 */
long PRIM_type; /* primitive type (always T_DATA_IND) */
long MORE_flag; /* indicates more data in TSDU */
};
struct T_exdata_ind { /* STPI 1.2.2.5 */
long PRIM_type; /* primitive type (always T_EXDATA_IND) */
long MORE_flag; /* indicates more data in ETSDU */
};
struct T_ordrel_ind { /* STPI 1.2.2.6 */
long PRIM_type; /* primitive type (always T_ORDREL_IND) */
};
struct T_unitdata_req { /* STPI 1.3.1.1 */
long PRIM_type; /* primitive 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 */
};
struct T_unitdata_ind { /* STPI 1.3.2.1 */
long PRIM_type; /* primitive type (always T_UNITDATA_IND) */
long SRC_length; /* source addr length */
long SRC_offset; /* source addr offset */
long OPT_length; /* options length */
long OPT_offset; /* options offset */
};
struct T_uderror_ind { /* STPI 1.3.2.2 */
long PRIM_type; /* primitive type (always T_UDERROR_IND) */
long DEST_length; /* dest addr length */
long DEST_offset; /* dest addr offset */
long OPT_length; /* options length */
long OPT_offset; /* options offset */
long ERROR_type; /* error type */
};
union T_primitives {
long type; /* primitive type */
struct T_info_req info_req;
struct T_bind_req bind_req;
struct T_unbind_req unbind_req;
struct T_optmgmt_req optmgmt_req;
struct T_info_ack info_ack;
struct T_bind_ack bind_ack;
struct T_optmgmt_ack optmgmt_ack;
struct T_error_ack error_ack;
struct T_ok_ack ok_ack;
struct T_conn_req conn_req;
struct T_conn_res conn_res;
struct T_discon_req discon_req;
struct T_data_req data_req;
struct T_exdata_req exdata_req;
struct T_ordrel_req ordrel_req;
struct T_conn_ind conn_ind;
struct T_conn_con conn_con;
struct T_discon_ind discon_ind;
struct T_data_ind data_ind;
struct T_exdata_ind exdata_ind;
struct T_ordrel_ind ordrel_ind;
struct T_unitdata_req unitdata_req;
struct T_unitdata_ind unitdata_ind;
struct T_uderror_ind uderror_ind;
};
/*******************************************************************************
*
*/
typedef struct {
int t_fd;
int t_resfd;
char *t_mbox; /* used to control access */
int t_lockerr; /* used to control access */
int t_ocnt;
int t_state;
int t_status;
struct T_info_ack t_info;
union T_primitives *t_ctlp; /* control message addr */
char *t_data; /* data message addr */
int t_datasz;
} tliendpt_t;
#define EP_TLOOK 0x01
#define EP_MOREDATA 0x02
#define EP_MORECTL 0x04
#define EP_RCVMORE 0x08
#define EP_RCVEXPID 0x10
#define EP_NODELAY 0x20
extern int swk_nfile;
#define MAX_FD swk_nfile
#define TLI_LOCK(p) (sc_pend(&((p)->t_mbox), 0L, &((p)->t_lockerr)))
#define TLI_UNLOCK(p) (sc_post(&((p)->t_mbox), (char *)1, &((p)->t_lockerr)))
extern tliendpt_t * *t_endpts;
tliendpt_t *t_fdendpt (int fd);
#ifdef __cplusplus
}
#endif
#endif /* __TIHDR_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -