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

📄 dlpi.h

📁 VRTX 商用嵌入式实时操作系统
💻 H
📖 第 1 页 / 共 3 页
字号:
/***************************************************************************
*
*               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:            %M%
*
*       Identification:         %Z% %I% %M%
*
*       Date:                   %G%  %U%
*
****************************************************************************
*/

/*
 RCS header identifier - $Id: dlpi.h,v 1.3 1993/10/05 18:09:06 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 _SYS_DLPI_H
#define _SYS_DLPI_H

#ifdef __cplusplus
extern "C" {
#endif

/*
 * dlpi.h header for Data Link Provider Interface
 */

/*
 * This header file has encoded the values so an existing driver 
 * or user which was written with the Logical Link Interface(LLI)
 * can migrate to the DLPI interface in a binary compatible manner.
 * Any fields which require a specific format or value are flagged
 * with a comment containing the message LLI compatibility.
 */

/*
 * 	DLPI revision definition history
 */
#define	DL_CURRENT_VERSION	0x02	/* current version of dlpi */
#define DL_VERSION_2		0x02	/* version of dlpi March 12,1991 */

/*
 * Primitives for Local Management Services
 */
#define DL_INFO_REQ		0x00	/* Information Req, LLI compatibility */
#define DL_INFO_ACK		0x03	/* Information Ack, LLI compatibility */
#define DL_ATTACH_REQ		0x0b	/* Attach a PPA */
#define DL_DETACH_REQ		0x0c	/* Detach a PPA */
#define DL_BIND_REQ		0x01	/* Bind dlsap address, LLI compatibility */
#define DL_BIND_ACK		0x04	/* Dlsap address bound, LLI compatibility */
#define DL_UNBIND_REQ		0x02	/* Unbind dlsap address, LLI compatibility */
#define DL_OK_ACK		0x06	/* Success acknowledgment, LLI compatibility */
#define DL_ERROR_ACK		0x05	/* Error acknowledgment, LLI compatibility */
#define DL_SUBS_BIND_REQ	0x1b	/* Bind Subsequent DLSAP address */
#define DL_SUBS_BIND_ACK	0x1c	/* Subsequent DLSAP address bound */
#define DL_SUBS_UNBIND_REQ	0x15	/* Subsequent unbind */
#define	DL_ENABMULTI_REQ	0x1d	/* Enable multicast addresses */
#define	DL_DISABMULTI_REQ	0x1e	/* Disable multicast addresses */
#define	DL_PROMISCON_REQ	0x1f	/* Turn on promiscuous mode */
#define	DL_PROMISCOFF_REQ	0x20	/* Turn off promiscuous mode */

/*
 * Primitives used for Connectionless Service
 */
#define DL_UNITDATA_REQ		0x07	/* datagram send request, LLI compatibility */
#define DL_UNITDATA_IND		0x08	/* datagram receive indication, LLI compatibility */
#define DL_UDERROR_IND		0x09	/* datagram error indication, LLI compatibility */
#define DL_UDQOS_REQ		0x0a	/* set QOS for subsequent datagram transmissions */

/*
 * Primitives used for Connection-Oriented Service
 */
#define DL_CONNECT_REQ		0x0d	/* Connect request */
#define DL_CONNECT_IND		0x0e	/* Incoming connect indication */
#define DL_CONNECT_RES		0x0f	/* Accept previous connect indication */
#define DL_CONNECT_CON		0x10	/* Connection established */

#define DL_TOKEN_REQ		0x11	/* Passoff token request */
#define DL_TOKEN_ACK		0x12	/* Passoff token ack */

#define DL_DISCONNECT_REQ	0x13	/* Disconnect request */
#define DL_DISCONNECT_IND	0x14	/* Disconnect indication */

#define DL_RESET_REQ		0x17	/* Reset service request */
#define DL_RESET_IND		0x18	/* Incoming reset indication */
#define DL_RESET_RES		0x19	/* Complete reset processing */
#define DL_RESET_CON		0x1a	/* Reset processing complete */

/*
 *  Primitives used for Acknowledged Connectionless Service
 */

#define	DL_DATA_ACK_REQ		0x21	/* data unit transmission request */
#define	DL_DATA_ACK_IND		0x22	/* Arrival of a command PDU */
#define	DL_DATA_ACK_STATUS_IND	0x23	/* Status indication of DATA_ACK_REQ*/
#define	DL_REPLY_REQ		0x24	/* Request a DLSDU from the remote */
#define	DL_REPLY_IND		0x25	/* Arrival of a command PDU */
#define	DL_REPLY_STATUS_IND	0x26	/* Status indication of REPLY_REQ */
#define	DL_REPLY_UPDATE_REQ	0x27	/* Hold a DLSDU for transmission */
#define	DL_REPLY_UPDATE_STATUS_IND	0x28 /* Status of REPLY_UPDATE req */

/*
 * Primitives used for XID and TEST operations 
 */

#define	DL_XID_REQ	0x29		/* Request to send an XID PDU */
#define	DL_XID_IND	0x2a		/* Arrival of an XID PDU */
#define	DL_XID_RES	0x2b		/* request to send a response XID PDU*/
#define	DL_XID_CON	0x2c		/* Arrival of a response XID PDU */
#define	DL_TEST_REQ	0x2d		/* TEST command request */
#define	DL_TEST_IND	0x2e		/* TEST response indication */
#define	DL_TEST_RES	0x2f		/* TEST response */
#define	DL_TEST_CON	0x30		/* TEST Confirmation */

/*
 * Primitives to get and set the physical address, and to get
 * Statistics
 */

#define	DL_PHYS_ADDR_REQ	0x31	/* Request to get physical addr */
#define	DL_PHYS_ADDR_ACK	0x32	/* Return physical addr */
#define	DL_SET_PHYS_ADDR_REQ	0x33	/* set physical addr */
#define	DL_GET_STATISTICS_REQ	0x34	/* Request to get statistics */
#define	DL_GET_STATISTICS_ACK	0x35	/* Return statistics */

/*
 * DLPI interface states
 */
#define	DL_UNATTACHED		0x04	/* PPA not attached */
#define DL_ATTACH_PENDING	0x05	/* Waiting ack of DL_ATTACH_REQ */
#define DL_DETACH_PENDING	0x06	/* Waiting ack of DL_DETACH_REQ */
#define	DL_UNBOUND		0x00	/* PPA attached, LLI compatibility */
#define	DL_BIND_PENDING		0x01	/* Waiting ack of DL_BIND_REQ, LLI compatibility */
#define	DL_UNBIND_PENDING	0x02	/* Waiting ack of DL_UNBIND_REQ, LLI compatibility */
#define	DL_IDLE			0x03	/* dlsap bound, awaiting use, LLI compatibility */
#define DL_UDQOS_PENDING	0x07	/* Waiting ack of DL_UDQOS_REQ */
#define	DL_OUTCON_PENDING	0x08	/* outgoing connection, awaiting DL_CONN_CON */
#define	DL_INCON_PENDING	0x09	/* incoming connection, awaiting DL_CONN_RES */
#define DL_CONN_RES_PENDING	0x0a	/* Waiting ack of DL_CONNECT_RES */
#define	DL_DATAXFER		0x0b	/* connection-oriented data transfer */
#define	DL_USER_RESET_PENDING	0x0c	/* user initiated reset, awaiting DL_RESET_CON */
#define	DL_PROV_RESET_PENDING	0x0d	/* provider initiated reset, awaiting DL_RESET_RES */
#define DL_RESET_RES_PENDING	0x0e	/* Waiting ack of DL_RESET_RES */
#define DL_DISCON8_PENDING	0x0f	/* Waiting ack of DL_DISC_REQ when in DL_OUTCON_PENDING */
#define DL_DISCON9_PENDING	0x10	/* Waiting ack of DL_DISC_REQ when in DL_INCON_PENDING */
#define DL_DISCON11_PENDING	0x11	/* Waiting ack of DL_DISC_REQ when in DL_DATAXFER */
#define DL_DISCON12_PENDING	0x12	/* Waiting ack of DL_DISC_REQ when in DL_USER_RESET_PENDING */
#define DL_DISCON13_PENDING	0x13	/* Waiting ack of DL_DISC_REQ when in DL_DL_PROV_RESET_PENDING */
#define DL_SUBS_BIND_PND	0x14	/* Waiting ack of DL_SUBS_BIND_REQ */
#define DL_SUBS_UNBIND_PND	0x15	/* Waiting ack of DL_SUBS_UNBIND_REQ */


/*
 * DL_ERROR_ACK error return values
 */
#define	DL_ACCESS	0x02	/* Improper permissions for request, LLI compatibility */
#define	DL_BADADDR	0x01	/* DLSAP address in improper format or invalid */
#define	DL_BADCORR	0x05	/* Sequence number not from outstanding DL_CONN_IND */
#define	DL_BADDATA	0x06	/* User data exceeded provider limit */
#define	DL_BADPPA	0x08	/* Specified PPA was invalid */
#define DL_BADPRIM	0x09	/* Primitive received is not known by DLS provider */
#define DL_BADQOSPARAM	0x0a	/* QOS parameters contained invalid values */
#define DL_BADQOSTYPE	0x0b	/* QOS structure type is unknown or unsupported */
#define	DL_BADSAP	0x00	/* Bad LSAP selector, LLI compatibility */
#define DL_BADTOKEN	0x0c	/* Token used not associated with an 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 address */
#define	DL_NOTINIT	0x10	/* Physical Link not initialized */
#define	DL_OUTSTATE	0x03	/* Primitive issued in improper state, LLI compatibility */
#define	DL_SYSERR	0x04	/* UNIX system error occurred, LLI compatibility */
#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 by DLS provider */
#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 & TEST responses
				   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 */

/*
 * DLPI media types supported
 */
#define	DL_CSMACD	0x0	/* IEEE 802.3 CSMA/CD network, LLI Compatibility */
#define	DL_TPB		0x1	/* IEEE 802.4 Token Passing Bus, LLI Compatibility */
#define	DL_TPR		0x2	/* IEEE 802.5 Token Passing Ring, LLI Compatibility */
#define	DL_METRO	0x3	/* IEEE 802.6 Metro Net, LLI Compatibility */
#define	DL_ETHER	0x4	/* Ethernet Bus, LLI Compatibility */
#define	DL_HDLC		0x05	/* ISO HDLC protocol support, bit synchronous */
#define DL_CHAR		0x06	/* Character Synchronous protocol support, eg 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 listed above */


/*
 * DLPI provider service supported.
 * These must be allowed to be bitwise-OR for dl_service_mode in
 * DL_INFO_ACK.
 */
#define DL_CODLS	0x01	/* support connection-oriented service */
#define DL_CLDLS	0x02	/* support connectionless data link service */
#define	DL_ACLDLS	0x04	/* support 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 sent/received on.
 */
#define	DL_STYLE1	0x0500	/* PPA is implicitly bound by open(2) */
#define	DL_STYLE2	0x0501	/* PPA must be explicitly bound via DL_ATTACH_REQ */


/*
 * DLPI Originator for Disconnect and Resets
 */
#define	DL_PROVIDER	0x0700
#define	DL_USER		0x0701

/*
 * DLPI Disconnect Reasons
 */
#define	DL_CONREJ_DEST_UNKNOWN			0x0800
#ifdef USE_REAL_DLPI
#define	DL_CONREJ_DEST_UNREACH_PERMANENT	0x0801
#define	DL_CONREJ_DEST_UNREACH_TRANSIENT	0x0802
#else
#define	DL_CONREJ_DEST_UNREACH_PERMANEN		0x0801
#define	DL_CONREJ_DEST_UNREACH_TRANSIEN		0x0802
#endif
#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

/*
 * DLPI status values for acknowledged connectionless data transfer
 */
#define DL_CMD_MASK	0x0f	/* mask for command portion of status */
#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	/* mask for response portion of status */
#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 acknowledge capability in MAC sublayer*/
#define DL_RQST_NORSP	0x02	/* No acknowledgement service requested */

/*
 * 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		/* if set,indicates poll/final bit set*/

/*
 *	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 type
 */
#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 phys level */
#define	DL_PROMISC_SAP		0x02	/* promiscous mode at sap level */
#define	DL_PROMISC_MULTI	0x03	/* promiscuous mode for multicast */

/*
 * DLPI Quality Of Service definition for use in QOS structure definitions.
 * The QOS structures are used in connection establishment, DL_INFO_ACK,
 * and setting connectionless QOS values.
 */

/*
 * Throughput
 *
 * This parameter is specified for both directions.
 */
typedef struct {
		long	dl_target_value;	/* desired bits/second desired */
		long	dl_accept_value;	/* min. acceptable bits/second */
} dl_through_t;

/*
 * transit delay specification 
 *
 * This parameter is specified for both directions.
 * expressed in milliseconds assuming a DLSDU size of 128 octets.
 * The scaling of the value to the current DLSDU size is provider dependent.
 */
typedef struct {
		long	dl_target_value;	/* desired value of service */
		long	dl_accept_value;	/* min. acceptable value of service */
} dl_transdelay_t;

/*
 * priority specification
 * priority range is 0-100, with 0 being highest value.
 */
typedef struct {
		long	dl_min;
		long	dl_max;
} dl_priority_t;


/*
 * 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 */

typedef struct {
		long	dl_min;
		long	dl_max;
} dl_protect_t;


/*
 * Resilience specification
 * probabilities are scaled by a factor of 10,000 with a time interval
 * of 10,000 seconds.
 */
typedef struct {

⌨️ 快捷键说明

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