📄 dlpi.h
字号:
#define DL_UNITDATA_IND_SIZE sizeof(dl_unitdata_ind_t)#define DL_UDERROR_IND_SIZE sizeof(dl_uderror_ind_t)#define DL_UDQOS_REQ_SIZE sizeof(dl_udqos_req_t)#define DL_TEST_REQ_SIZE sizeof(dl_test_req_t)#define DL_TEST_IND_SIZE sizeof(dl_test_ind_t)#define DL_TEST_RES_SIZE sizeof(dl_test_res_t)#define DL_TEST_CON_SIZE sizeof(dl_test_con_t)#define DL_XID_REQ_SIZE sizeof(dl_xid_req_t)#define DL_XID_IND_SIZE sizeof(dl_xid_ind_t)#define DL_XID_RES_SIZE sizeof(dl_xid_res_t)#define DL_XID_CON_SIZE sizeof(dl_xid_con_t)#define DL_DATA_ACK_REQ_SIZE sizeof(dl_data_ack_req_t)#define DL_DATA_ACK_IND_SIZE sizeof(dl_data_ack_ind_t)#define DL_DATA_ACK_STATUS_IND_SIZE sizeof(dl_data_ack_status_ind_t)#define DL_REPLY_REQ_SIZE sizeof(dl_reply_req_t)#define DL_REPLY_IND_SIZE sizeof(dl_reply_ind_t)#define DL_REPLY_STATUS_IND_SIZE sizeof(dl_reply_status_ind_t)#define DL_REPLY_UPDATE_REQ_SIZE sizeof(dl_reply_update_req_t)#define DL_REPLY_UPDATE_STATUS_IND_SIZE sizeof(dl_reply_update_status_ind_t)#define DL_PHYS_ADDR_REQ_SIZE sizeof(dl_phys_addr_req_t)#define DL_PHYS_ADDR_ACK_SIZE sizeof(dl_phys_addr_ack_t)#define DL_SET_PHYS_ADDR_REQ_SIZE sizeof(dl_set_phys_addr_req_t)#define DL_GET_STATISTICS_REQ_SIZE sizeof(dl_get_statistics_req_t)#define DL_GET_STATISTICS_ACK_SIZE sizeof(dl_get_statistics_ack_t)/************************************************************************* Field Values *************************************************************************** ** The following #defines specifiy the values used in the fields of ** the structures declared above. ** ** These values are taken from the listing of dlpi.h given in the ** DLPI version 2 specification. The listing in that specification ** contains no copyright, so the following has been entered pretty ** much literally from the listing. ** *************************************************************************//* * DLPI revision definition history */#define DL_CURRENT_VERSION 0x02 /* current version of DLPI */#define DL_VERSION_2 0x02 /* DLPI March 12, 1991 *//************************************************************************* Primitive Types *************************************************************************//* * Primitives for Local Managemet Services */#define DL_INFO_REQ 0x00#define DL_INFO_ACK 0x03#define DL_ATTACH_REQ 0x0b#define DL_DETACH_REQ 0x0c#define DL_BIND_REQ 0x01#define DL_BIND_ACK 0x04#define DL_UNBIND_REQ 0x02#define DL_SUBS_BIND_REQ 0x1b#define DL_SUBS_BIND_ACK 0x1c#define DL_SUBS_UNBIND_REQ 0x15#define DL_ENABMULTI_REQ 0x1d#define DL_DISABMULTI_REQ 0x1e#define DL_PROMISCON_REQ 0x1f#define DL_PROMISCOFF_REQ 0x20#define DL_OK_ACK 0x06#define DL_ERROR_ACK 0x05/* * Primitives used for Connection-Oriented Service */#define DL_CONNECT_REQ 0x0d#define DL_CONNECT_IND 0x0e#define DL_CONNECT_RES 0x0f#define DL_CONNECT_CON 0x10#define DL_TOKEN_REQ 0x11#define DL_TOKEN_ACK 0x12#define DL_DISCONNECT_REQ 0x13#define DL_DISCONNECT_IND 0x14#define DL_RESET_REQ 0x17#define DL_RESET_IND 0x18#define DL_RESET_RES 0x19#define DL_RESET_CON 0x1a/* * Primitives used for Connectionless Service */#define DL_UNITDATA_REQ 0x07#define DL_UNITDATA_IND 0x08#define DL_UDERROR_IND 0x09#define DL_UDQOS_REQ 0x0a/* * Primitives for TEST and XID */#define DL_TEST_REQ 0x2d#define DL_TEST_IND 0x2e#define DL_TEST_RES 0x2f#define DL_TEST_CON 0x30#define DL_XID_REQ 0x29#define DL_XID_IND 0x2a#define DL_XID_RES 0x2b#define DL_XID_CON 0x2c/* * Primitives used for Acknowledged Connectionless Service */#define DL_DATA_ACK_REQ 0x21#define DL_DATA_ACK_IND 0x22#define DL_DATA_ACK_STATUS_IND 0x23#define DL_REPLY_REQ 0x24#define DL_REPLY_IND 0x25#define DL_REPLY_STATUS_IND 0x26#define DL_REPLY_UPDATE_REQ 0x27#define DL_REPLY_UPDATE_STATUS_IND 0x28/* * Primitives to get and set the physical address */#define DL_PHYS_ADDR_REQ 0x31#define DL_PHYS_ADDR_ACK 0x32#define DL_SET_PHYS_ADDR_REQ 0x33/* * Primitives to get statistics */#define DL_GET_STATISTICS_REQ 0x34#define DL_GET_STATISTICS_ACK 0x35/************************************************************************* DLPI Interface States *************************************************************************** ** Refer to DLPI spec for the meaning of these states. ** *************************************************************************/#define DL_UNATTACHED 0x04#define DL_ATTACH_PENDING 0x05#define DL_DETACH_PENDING 0x06#define DL_UNBOUND 0x00#define DL_BIND_PENDING 0x01#define DL_UNBIND_PENDING 0x02#define DL_IDLE 0x03#define DL_UDQOS_PENDING 0x07#define DL_OUTCON_PENDING 0x08#define DL_INCON_PENDING 0x09#define DL_CONN_RES_PENDING 0x0a#define DL_DATAXFER 0x0b#define DL_USER_RESET_PENDING 0x0c#define DL_PROV_RESET_PENDING 0x0d#define DL_RESET_RES_PENDING 0x0e#define DL_DISCON8_PENDING 0x0f#define DL_DISCON9_PENDING 0x10#define DL_DISCON11_PENDING 0x11#define DL_DISCON12_PENDING 0x12#define DL_DISCON13_PENDING 0x13#define DL_SUBS_BIND_PND 0x14#define DL_SUBS_UNBIND_PND 0x15/************************************************************************* DL_ERROR_ACK Error Values *************************************************************************** ** These are the values of the dl_errno field. ** *************************************************************************/#define DL_ACCESS 0x02 /* Improper permissions */#define DL_BADADDR 0x01 /* DLSAP addr in improper format or invalid */#define DL_BADCORR 0x05 /* Seq nr not from outstanding DL_CONN_IND */#define DL_BADDATA 0x06 /* User data exceeded provider limit */#define DL_BADPPA 0x08 /* PPA was invalid */#define DL_BADPRIM 0x09 /* Primitive received is not know by DLS prov */#define DL_BADQOSPARAM 0x0a /* QOS params contained invalid values */#define DL_BADQOSTYPE 0x0b /* QOS structure type unknown or unsupported */#define DL_BADSAP 0x00 /* Bad LSAP selector, LLI compatibility */#define DL_BADTOKEN 0x0c /* Token not associated with active stream */#define DL_BOUND 0x0d /* Attempted second bind with dl_max_conind or * dl_conn_mgmt > 0 on same DLSAP or PPA */#define DL_INITFAILED 0x0e /* Physical link initialization failed */#define DL_NOADDR 0x0f /* Provider couldn't allocate alternate addr */#define DL_NOTINIT 0x10 /* Physical link not initialized */#define DL_OUTSTATE 0x03 /* Primitive issued in improper state */#define DL_SYSERR 0x04 /* UNIX system error occurred */#define DL_UNSUPPORTED 0x07 /* Requested service not supplied by provider */#define DL_UNDELIVERABLE 0x11 /* Previous data unit could not be delivered */#define DL_NOTSUPPORTED 0x12 /* Primitive is known but not supported */#define DL_TOOMANY 0x13 /* Limit exceeded */#define DL_NOTENAB 0x14 /* Promiscuous mode not enabled */#define DL_BUSY 0x15 /* Other streams for a particular PPA in * the post-attached state. */#define DL_NOAUTO 0x16 /* Automatic handling of XID and TEST response * not supported. */#define DL_NOXIDAUTO 0x17 /* Automatic handling of XID not supported */#define DL_NOTESTAUTO 0x18 /* Automatic handling of TEST not supported */#define DL_XIDAUTO 0x19 /* Automatic handling of XID response */#define DL_TESTAUTO 0x1a /* Automatic handling of TEST response */#define DL_PENDING 0x1b /* pending outstanding connect indications *//* * NOTE: The range of error codes from 0x80 - 0xff is reserved for * implementation specific error codes. This reserved range * of error codes will be defined by the DLS Provider. *//************************************************************************* Types of Services *************************************************************************//* * Media types supported */#define DL_CSMACD 0x00 /* IEEE 802.3 CSMA/CD network */#define DL_TPB 0x01 /* IEEE 802.4 Token Passing Bus */#define DL_TPR 0x02 /* IEEE 802.5 Token Passing Ring */#define DL_METRO 0x03 /* IEEE 802.6 Metro Net */#define DL_ETHER 0x04 /* Ethernet Bus */#define DL_HDLC 0x05 /* ISO HDLC protocol support, bit synchronous */#define DL_CHAR 0x06 /* Character Synchronous (Bisync) */#define DL_CTCA 0x07 /* IBM Channel-to-Channel Adapter */#define DL_FDDI 0x08 /* Fiber Distributed Data Interface */#define DL_OTHER 0x09 /* Any other medium not lested above */#define DL_FC 0x10 /* Fibre Channel */#define DL_ATM 0x11 /* ATM */#define DL_IPATM 0x12 /* ATM Classical IP */#define DL_X25 0x13 /* X.25 LAPB interface */#define DL_ISDN 0x14 /* ISDN */#define DL_HIPPI 0x15 /* HIPPI */#define DL_100VG 0x16 /* 100 Base VG Ethernet */#define DL_100VGTPR 0x17 /* 100 Base VG Token Ring */#define DL_ETH_CSMA 0x18 /* ISO 8802/3 and Ethernet */#define DL_100BT 0x19 /* 100 Base TX */#define DL_FRAME 0x0a /* Frame Relay LAPF */#define DL_MPFRAME 0x0b /* Multiprotocol on Frame Relay */#define DL_ASYNC 0x0c /* Character Asynchronous */#define DL_IPX25 0x0d /* X.25 Classical IP interface */#define DL_LOOP 0x0e /* software loopback *//* * DLPI provider services supported * * These are bit-wise ORed for dl_service_mode in DL_INFO_ACK */#define DL_CODLS 0x01 /* connection oriented service supported */#define DL_CLDLS 0x02 /* connectionless service supported */#define DL_ACLDLS 0x04 /* acknowledged connectionless service *//* * DLPI provider style * * The DLPI provider style which determines whether a provider * requires a DL_ATTACH_REQ to inform the provider which PPA * user messages should be set/receive on. */#define DL_STYLE1 0x0500 /* PPA is implicitly bound by open */#define DL_STYLE2 0x0501 /* PPA must be attached by DL_ATTACH_REQ *//************************************************************************* Disconnect and Reset Reasons *************************************************************************//* * DLPI Originator for Disconnect and Resets */#define DL_PROVIDER 0x0700#define DL_USER 0x0701/* * DLPI Disconnect Reasons */#define DL_CONREJ_DEST_UNKNOWN 0x0800#define DL_CONREJ_DEST_UNREACH_PERMANENT 0x0801#define DL_CONREJ_DEST_UNREACH_TRANSIENT 0x0802#define DL_CONREJ_QOS_UNAVAIL_PERMANENT 0x0803#define DL_CONREJ_QOS_UNAVAIL_TRANSIENT 0x0804#define DL_CONREJ_PERMANENT_COND 0x0805#define DL_CONREJ_TRANSIENT_COND 0x0806#define DL_DISC_ABNORMAL_CONDITION 0x0807#define DL_DISC_NORMAL_CONDITION 0x0808#define DL_DISC_PERMANENT_CONDITION 0x0809#define DL_DISC_TRANSIENT_CONDITION 0x080a#define DL_DISC_UNSPECIFIED 0x080b/* * DLPI Reset Reasons */#define DL_RESET_FLOW_CONTROL 0x0900#define DL_RESET_LINK_ERROR 0x0901#define DL_RESET_RESYNCH 0x0902/************************************************************************* Acknowledged Connectionless Service *************************************************************************//* * DLPI status values for acknowledged connectionless data transfer */#define DL_CMD_MASK 0x0f#define DL_CMD_OK 0x00 /* Command accepted */#define DL_CMD_RS 0x01 /* Unimplemented or inactivated service */#define DL_CMD_UE 0x05 /* Data Link User interface error */#define DL_CMD_PE 0x06 /* protocol error */#define DL_CMD_IP 0x07 /* Permanent implementation dependent error */#define DL_CMD_UN 0x09 /* Resources temporarily unavailable */#define DL_CMD_IT 0x0f /* Temporary implementation dependent error */#define DL_RSP_MASK 0xf0#define DL_RSP_OK 0x00 /* Response DLSDU present */#define DL_RSP_RS 0x10 /* Unimplemented or inactivated service */#define DL_RSP_NE 0x30 /* Response DLSDU never submitted */#define DL_RSP_NR 0x40 /* Response DLSDU not requested */#define DL_RSP_UE 0x50 /* Data Link User interface error */#define DL_RSP_IP 0x70 /* Permanent implementation dependent error */#define DL_RSP_UN 0x90 /* Resources temporarily unavailable */#define DL_RSP_IT 0xf0 /* Temporary implementation dependent error *//* * Service class values for acknowledged connectionless data transfer */#define DL_RQST_RSP 0x01 /* Use acknowldege capability in MAC sublayer */#define DL_RQST_NORSP 0x02 /* No acknowldegement services requested *//************************************************************************* Quality of Service *************************************************************************//* * QOS Protection specification */#define DL_NONE 0x0b01 /* no protection supplied */#define DL_MONITOR 0x0b02 /* protection against passive * monitoring */#define DL_MAXIMUM 0x0b03 /* protection against modification, * replay, addition or deletion. *//* * QOS parameter values */#define DL_UNKNOWN -1#define DL_QOS_DONT_CARE -2/* * QOS type definitions */#define DL_QOS_CO_RANGE1 0x0101 /* connection oriented service */#define DL_QOS_CO_SEL1 0x0102 /* connection oriented service */#define DL_QOS_CL_RANGE1 0x0103 /* connectionless service */#define DL_QOS_CL_SEL1 0x0104 /* connectionless service *//************************************************************************* Miscellaneous *************************************************************************//* * DLPI address type definition */#define DL_FACT_PHYS_ADDR 0x01 /* factory physical address */#define DL_CURR_PHYS_ADDR 0x02 /* current physical address *//* * DLPI flag definitions */#define DL_POLL_FINAL 0x01 /* poll/final bit for TEST/XID *//* * XID and TEST responses supported by the provider */#define DL_AUTO_XID 0x01 /* provider will respond to XID */#define DL_AUTO_TEST 0x02 /* provider will respond to TEST *//* * Subsequent bind types */#define DL_PEER_BIND 0x01 /* subsequent bind on a peer addr */#define DL_HIERARCHICAL_BIND 0x02 /* subs-bind on a hierarchical addr *//* * DLPI promiscuous mode definitions */#define DL_PROMISC_PHYS 0x01 /* promiscuous mode at physical level */#define DL_PROMISC_SAP 0x02 /* promiscuous mode at SAP level */#define DL_PROMISC_MULTI 0x03 /* promiscuous mode for multicast */#endif /*!_DLPI_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -