DLPI Programmer’s Guide Edition 4 B2355-90139 HP 9000 Networking E0497 Printed in: United States © Copyright 1997 Hewlett-Packard Company.
Legal Notices The information in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this manual, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Hewlett-Packard shall not be held liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material. Warranty.
©copyright 1980, 1984, 1986 Novell, Inc. ©copyright 1986-1992 Sun Microsystems, Inc. ©copyright 1985-86, 1988 Massachusetts Institute of Technology. ©copyright 1989-93 The Open Software Foundation, Inc. ©copyright 1986 Digital Equipment Corporation. ©copyright 1990 Motorola, Inc.
Contents 1. Introduction to DLPI HP DLPI Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 Device File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 The Data Link Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 The Service Interface . . . . . . . . . . . . . . . . . . .
Contents DL_SUBS_BIND_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DL_SUBS_BIND_ACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DL_SUBS_UNBIND_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DL_ENABMULTI_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DL_DISABMULTI_REQ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DL_PROMISCON_REQ . . . . . . . . . . . . . . . . . . .
Contents DL_HP_SET_REJ_TO_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 DL_HP_SET_BUSY_TO_REQ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 DL_HP_SET_SEND_ACK_TO_REQ. . . . . . . . . . . . . . . . . . . . . . . . . .102 DL_HP_SET_MAX_RETRIES_REQ . . . . . . . . . . . . . . . . . . . . . . . . . .103 DL_HP_SET_ACK_THRESH_REQ . . . . . . . . . . . . . . . . . . . . . . . . . .104 DL_HP_SET_LOCAL_WIN_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents DL_XID_RES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 DL_XID_CON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 DLPI States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 A. Sample Programs Connection Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Connectionless Mode . . . . . . . . . . . . . . . . . . . . . . . .
Printing History The manual printing date and part number indicate its current edition. The printing date will change when a new edition is printed. Minor changes may be made at reprint without changing the printing date. the manual part number will change when extensive changes are made. Manual updates may be issued between editions to correct errors or document product changes. To ensure that you receive the updated or new editions, you should subscribe to the appropriate product support service.
Preface This guide provides STREAMS kernel-level programming information that is specified by the ISO Data Link Service Definition DIS 8886 and Logical Link Control DIS 8802/2 (LLC). Where the two standards do not conform, DIS 8886 prevails. This guide assumes familiarity with the OSI Reference Model terminology, OSI Data Link Services, and STREAMS.
1 Introduction to DLPI 13
Introduction to DLPI The Data Link Provider Interface (DLPI) is an industry standard definition for message communications to STREAMS-based network interface drivers. A service provider interface is a specified set of messages and the rules that allow passage of these messages across layer boundaries.
Introduction to DLPI HP DLPI Features HP DLPI Features Hewlett-Packard’s implementation of the Data Link Provider Interface, HP DLPI, conforms to the DLPI Version 2.0 Specification as a Style 2 provider. HP DLPI offers data link service users: • Clone (maximum 900) and non-clone (maximum 100) access. • Support for Ethernet/IEEE802.3, FDDI, Fibre Channel, 100VG and Token Ring. • Support for connectionless and connection-mode services (connection-mode services are supported only over IEEE802.
Introduction to DLPI HP DLPI Features • Connection Management STREAMS; DL_SUBS_BIND_REQ and DL_SUBS_UNBIND_REQ over connection-oriented STREAMS. • Acknowledged connectionless-mode services. Device File Format The following is a description of the device file formats required for accessing the STREAMS DLPI LAN driver. Name NOTE Type Major # Minor # Access /dev/dlpi c 72 0x77 Clone access /dev/dlpiX c 119 0xX Non-clone access HP DLPI supports up to 100 non-clone device files.
Introduction to DLPI The Data Link Layer The Data Link Layer The data link layer (layer 2 in the OSI Reference Model) is responsible for the transmission and error-free delivery of bits of information over a physical communications medium. The model defines networking functionality at several layers and service providers between the layers. A model of the data link layer is presented here to describe concepts that are used throughout this guide.
Introduction to DLPI The Data Link Layer Figure 1-1 Abstract View of DLPI Data Link User Request/Response Primitives DLPI Indication/Confirmation Primitives Data Link Provider The data link interface is the boundary between the network and the data link layers of the OSI Reference Model. The network layer entity is the user of the services of the data link interface (DLS user), and the data link layer entity is the provider of those services (DLS provider).
Introduction to DLPI The Data Link Layer endpoint between a DLS user and the DLS provider. After the stream is created, the DLS user and DLS provider communicate via messages discussed later. DLPI is intended to free data link users from specific knowledge of the characteristics of the data link provider. Specifically, the definition of DLPI hopes to achieve the goal of allowing a DLS user to be implemented independent of a specific communications medium.
Introduction to DLPI The Data Link Layer Local Management. This phase enables a DLS user to initialize a stream for use in communication and establish an identity with the DLS provider. Connection Establishment. This phase enables two DLS users to establish a data link connection between them to exchange data. One user (the calling DLS user) initiates the connection establishment procedures, while another user (the called DLS user) waits for incoming connect requests.
Introduction to DLPI The Data Link Layer Connectionless-mode Service The connectionless mode service does not use the connection establishment and release phases of the connection mode service. The local management phase is still required to initialize a stream. Once initialized, however, the connectionless data transfer phase is immediately entered.
Introduction to DLPI The Data Link Layer A PPA is identified by a unique PPA identifier. For media that support physical layer multiplexing of multiple channels over a single physical medium (such as the B and D channels of ISDN), the PPA identifier must identify the specific channel over which communication will occur. Two styles of DLS provider are defined by DLPI, distinguished by the way they enable a DLS user to choose a particular PPA.
Introduction to DLPI The Data Link Layer Data Link User Identification A data link user’s identity is established by associating it with a data link service access point (DLSAP), which is the point through which the user will communicate with the data link provider. A DLSAP is identified by a DLSAP address. The DLSAP address identifies a particular data link service access point that is associated with a stream (communication endpoint).
Introduction to DLPI The Data Link Layer • SNAP SAP format | DA/SA | 0xAA | SNAP | [RIF, up to 18bytes] | HP’s DLSAP Address Format for Fibre Channel The four possible formats for Fibre Channel are: • 802.2 SAP format | N_Port_Id | Process Associator | FC_Type |DSAP/SSAP| • 802.
Introduction to DLPI The Data Link Layer DLPI supports the ability to associate several streams with a single DLSAP, where each stream may be a unique data link connection endpoint. However, not all DLS providers can support such configurations because some DLS providers may have no mechanism beyond the DLSAP address for distinguishing multiple connections. In such cases, the provider will restrict the DLS user to one stream per DLSAP.
Introduction to DLPI Promiscuous Mode Clarifications Promiscuous Mode Clarifications The following definitions are being defined for the various levels of promiscuous mode. DL_PROMISC_PHYS—Before the STREAM has been bound (with the DL_BIND_REQ primitive), the DLPI user receives all traffic on the wire regardless of SAP or address.
Introduction to DLPI DLPI Services DLPI Services The various features of the DLPI interface are defined in terms of the services provided by the DLS provider and the individual primitives that may flow between the DLS user and DLS provider. HP DLPI supports two of the three modes of service: connection and connectionless. HP DLPI does not support acknowledged connectionless service.
Introduction to DLPI DLPI Services Table 1-1 Cross-Reference of DLS Services and Primitives Phase of Communication Local Management 28 Service Primitives Information Reporting DL_INFO_REQ DL_INFO_ACK DL_ERROR_ACK DL_HP_PPA_REQ DL_HP_PPA_ACK Attach DL_ATTACH_REQ DL_DETACH_REQ DL_OK_ACK DL_ERROR_ACK Bind DL_BIND_REQ DL_BIND_ACK DL_SUBS_BIND_REQ DL_SUBS_BIND_ACK DL_UNBIND_REQ DL_SUBS_UNBIND_REQ DL_OK_ACK DL_ERROR_ACK Other DL_ENABMULTI_REQ DL_DISABMULTI_REQ DL_PROMISCON_REQ DL_PROMISCOFF_REQ DL_OK
Introduction to DLPI DLPI Services Phase of Communication Service Primitives Connection Establishment Connection Establishment DL_CONNECT_REQ DL_CONNECT_IND DL_CONNECT_RES DL_CONNECT_CON DL_DISCONNECT_REQ DL_DISCONNECT_IND DL_TOKEN_REQ DL_TOKEN_ACK DL_OK_ACK DL_ERROR_ACK Connection-mode Data Transfer Data Transfer DL_DATA_REQ DL_DATA_IND Reset DL_RESET_REQ DL_RESET_IND DL_RESET_RES DL_RESET_CON DL_OK_ACK DL_ERROR_ACK Connection Release Connection Release DL_DISCONNECT_REQ DL_DISCONNECT_IND DL_
Introduction to DLPI DLPI Services Phase of Communication Service Raw Mode Data Transfer XID and TEST Primitives DL_HP_RAWDATA_REQ DL_HP_RAWDATA_IND XID DL_XID_REQ DL_XID_IND DL_XID_RES DL_XID_CON TEST DL_TEST_REQ DL_TEST_IND DL_TEST_RES DL_TEST_CON Local Management Services The local management services apply to the connection and connectionless modes of communication.
Introduction to DLPI DLPI Services Attach Service The attach service assigns a physical point of attachment (PPA) to a stream. This service is required for style 2 DLS providers to specify the physical medium over which communications will occur. The DLS provider indicates success with a DL_OK_ACK message and failure with a DL_ERROR_ACK message. The normal message sequence is illustrated in Figure 1-4.
Introduction to DLPI DLPI Services Binding The following protocol values are currently supported by the DLPI driver: • IEEE802.2 SAPS • ethernet types • SNAP Valid IEEE802.2 SAPS include even numbers from 0-255, excluding reserved SAPS (see the section “Reserved IEEESAPS/Ethertypes”). Valid ethernet types range from 0x600 to 0xFFFF, excluding reserved ethertypes (see the section “Reserved IEEESAPS/Ethertypes”).
Introduction to DLPI DLPI Services Figure 1-6 Message Flow: Binding a Stream to a DLSAP DL_BIND request DL_BIND acknowledge DL_SUBS_BIND request DL_SUBS_BIND acknowledge DL_UNBIND_REQ requests the DLS provider to unbind all DLSAPs from a stream. The DL_UNBIND_REQ also unbinds all the subsequently bound DLSAPs that have not been unbound. The DLS provider indicates success with a DL_OK_ACK message and failure with a DL_ERROR_ACK message.
Introduction to DLPI DLPI Services Figure 1-8 Message Flow: Enabling a Specific Multicast Address on a Stream DL_ENABMULTI request DL_OK acknowledge DL_DISABMULTI_REQ requests the DLS provider to disable specific multicast addresses on a per stream basis. The provider indicates success with a DL_OK_ACK message and failure with a DL_ERROR_ACK message. The normal message sequence is illustrated in Figure 1-9.
Introduction to DLPI DLPI Services DL_PROMISCOFF_REQ requests the DLS provider to disable promiscuous mode on a per stream basis, either at the physical level of at the SAP level. The provider indicates success with a DL_OK_ACK message and failure with a DL_ERROR_ACK message. The normal message sequence is illustrated in Figure 1-11.
Introduction to DLPI DLPI Services Figure 1-12 Message Flow: Successful Connection Establishment DL_CONNECT request DL_CONNECT indication DL_CONNECT confirm DL_CONNECT response DL_OK acknowledge Once the connection is established, the DLS users may exchange user data using DL_DATA_REQ and DL_DATA_IND. The DLS user may accept an incoming connect request on either the stream where the connect indication arrived or at an alternate, responding stream.
Introduction to DLPI DLPI Services Figure 1-13 Message Flow: Token Retrieval DL_TOKEN request DL_TOKEN acknowledge In the typical connection establishment scenario, the called DLS user processes one connect indication at a time, accepting the connection on another stream. Once the user responds to the current connect indication, the next connect indication (if any) can be processed. DLPI also enables the called DLS user to multi-thread incoming connect indications.
Introduction to DLPI DLPI Services Figure 1-15 Message Flow: DLS Provider Rejection of a Connection Establishment Attempt DL_CONNECT request DL_DISCONNECT indication Figure 1-16 through Figure 1-18 illustrate the situation where the calling DLS user chooses to abort a previous connection attempt. The DLS user issues DL_DISCONNECT_REQ at some point following a DL_CONNECT_REQ.
Introduction to DLPI DLPI Services Figure 1-18 Message Flow: DL_DISCONNECT Indication Arrives after DL_CONNECT Response is Sent DL_CONNECT request DL_CONNECT indication DL_CONNECT response DL_OK acknowledge DL_DISCONNECT request DL_DISCONNECT indication DL_OK acknowledge Data Transfer Service The connection-mode data transfer service provides for the exchange of user data in either direction or in both directions simultaneously between DLS users.
Introduction to DLPI DLPI Services Connection Release Service The connection release service provides for the DLS users or the DLS provider to initiate the connection release. Connection release is an abortive operation and any data in transit (has not been delivered to the DLS user) may be discarded. DL_DISCONNECT_REQ requests that a connection be released. DL_DISCONNECT_IND informs the DLS user that a connection has been released.
Introduction to DLPI DLPI Services Figure 1-22 Message Flow: Simultaneous DLS User & DLS Provider Invoked Connection Release DL_DISCONNECT request DL_OK acknowledge DL_DISCONNECT indication Reset Service The reset service may be used by the DLS user to resynchronize the use of a data link connection, or by the DLS provider to report detected loss of data unrecoverable within the data link service.
Introduction to DLPI DLPI Services • The DLS provider will discard all DLSDUs submitted before the issuing of the DL_RESET_REQ that have not been delivered to the peer DLS user when the DLS provider issues the DL_RESET_IND. • The DLS provider will discard all DLSDUs submitted before the issuing of the DL_RESET_RES that have not been delivered to the initiator of the DL_RESET_REQ when the DLS provider issues the DL_RESET_CON.
Introduction to DLPI DLPI Services Figure 1-25 Message Flow: DLS Provider-Invoked Connection Reset DL_RESET indication DL_RESET response DL_OK acknowledge DL_RESET indication DL_RESET response DL_OK acknowledge Figure 1-26 illustrates the message flow for a reset invoked simultaneously by one DLS user and the DLS provider.
Introduction to DLPI DLPI Services transfer is neither acknowledged nor confirmed, and there is no end-to-end flow control provided. As such, the connectionless data transfer service cannot guarantee reliable delivery of data. However a specific DLS provider can provide assurance that messages will not be lost, duplicated, or reordered. DL_UNITDATA_REQ conveys one DLSDU to the DLS provider. DL_UNITDATA_IND conveys one DLSDU to the DLS user. The normal flow of messages is illustrated in Figure 1-27.
Introduction to DLPI DLPI Services Raw-mode Data Transfer The raw-mode data transfer service provides the same service as the connectionless data transfer service. The only difference is that the rawmode DLS user builds the complete MAC and LLC headers prior to data transfer, whereas the connectionless-mode DLS user merely specifies the peer DLS user and the DLS provider then builds the complete MAC and LLC headers before transferring the packet. The DL_HP_RAWDATA_REQ conveys one DLSDU to the DLS provider.
Introduction to DLPI DLPI Services DLS provider sends up an XID or TEST indication respectively to the DLS user. The DLS user must respond with an XID or TEST response primitive. If the DLS user requested automatic handling of the XID or TEST response, at bind time, the DLS provider will send up an error acknowledgment on receiving an XID or TEST request. Also, no indications will be generated to the DLS user on receiving XID or TEST frames from the remote side.
Introduction to DLPI DLPI Services Figure 1-32 Message Flow: Test Service DL_TEST request DL_TEST indication DL_TEST response DL_TEST confirm An Example To summarize, Figure 1-33 is an example that illustrates the primitives that flow during a complete, connection-mode sequence between stream open and stream close.
Introduction to DLPI DLPI Services Figure 1-33 Message Flow: A Connection-Mode Example DL_ATTACH request DL_ATTACH request DL_OK acknowledge DL_OK acknowledge DL_BIND request DL_BIND acknowledge DL_CONNECT request DL_CONNECT confirm DL_DATA request DL_DATA indication DL_BIND request DL_BIND acknowledge DL_CONNECT indication DL_CONNECT response DL_OK acknowledge DL_DATA indication DL_DATA request DL_DISCONNECT request DL_OK acknowledge DL_UNBIND request DL_DISCONNECT indication DL_UNBIND request D
2 DLPI Primitives 49
DLPI Primitives The kernel-level interface to the data link layer defines a STREAMS-based message interface between the provider of the data link service (DLS provider) and the consumer of the data link service (DLS user). STREAMS provides the mechanism in which DLPI primitives may be passed between the DLS user and DLS provider. Before DLPI primitives can be passed between the DLS user and the DLS provider, the DLS user must establish a stream to the DLS provider using open(2).
DLPI Primitives Local Management Primitives Local Management Primitives This section describes the local management service primitives. These primitives support the information reporting, Attach and Bind. Once a stream has been opened by a DLS user, these primitives initialize the stream, preparing it for use. PPA Initialization/De-initialization The PPA associated with each stream must be initialized before the DLS provider can transfer data over the medium.
DLPI Primitives Local Management Primitives A DLS provider may handle PPA de-initialization using the following methods: • automatic de-initialization upon receipt of the final DL_DETACH_REQ (for style 2 providers) or DL_UNBIND_REQ (for style 1 providers), or upon closing of the last stream associated with the PPA; • automatic de-initialization after expiration of a timer following the last DL_DETACH_REQ, DL_UNBIND_REQ, or close as appropriate; or • no automatic de-initialization; administrative interventio
DLPI Primitives Local Management Primitives The message is valid in any State in which a local acknowledgment is not pending, as described in Appendix B, Allowable Sequence of DLPI Primitives, of the DLPI 2.0 specification. New State The resulting state is unchanged. Response The DLPI driver responds to this request with a DL_HP_PPA_ACK. DL_HP_PPA_ACK This primitive is sent in response to a DL_HP_PPA_REQ; it conveys information on each valid PPA currently installed in the system.
DLPI Primitives Local Management Primitives /* info area in DL_HP_PPA_ACK */ typedef struct { u_long dl_next_offset; u_long dl_ppa; u_char dl_hw_path[100]; u_long dl_mac_type; u_char dl_phys_addr[20]; u_long dl_addr_length; u_long dl_mjr_num; u_char dl_name[64] u_long dl_instance_num u_long dl_mtu; u_long dl_hdw_state; u_char dl_module_id_1[64]; u_char dl_module_id_2[64]; u_char dl_arpmod_name[64]; u_char dl_nmid; u_long dl_reserved1; u_long dl_reserved2; } dl_hp_ppa_info_t; dl_next_offset offset of next p
DLPI Primitives Local Management Primitives dl_mtu MTU dl_hdw_state hardware state dl_module_id_1 default module ID name for the stream. The default name is “lan.” This value is used as the interface name when executing the ifconfig command. dl_module_id_2 optional module ID name for streams that support multiple encapsulation types. If the user is attached to a stream that supports ETHER and IEEE8023, then this name is set to “snap.” Otherwise, the field is set to NULL.
DLPI Primitives Local Management Primitives The message consists of one M_PCPROTO message block, which contains the following structure. Format typedef struct { ulong } dl_info_req_t; dl_primitive; Parameters dl_primitive DL_INFO_REQ State The message is valid in any state in which a local acknowledgment is not pending, as described in Appendix B, Allowable Sequence of DLPI Primitives, of the DLPI 2.0 specification. New State The resulting state is unchanged.
DLPI Primitives Local Management Primitives ulong ullong } dl_info_ack_t; dl_brdcst_addr_offset; dl_growth; Parameters dl_primitive DL_INFO_ACK dl_max_sdu maximum number of bytes that may be transmitted in a data link service data unit (DLSDU). This value must be a positive integer that is greater than or equal to the value of dl_min_sdu. dl_min_sdu minimum number of bytes that may be transmitted in a DLSDU. The value is never less than one.
DLPI Primitives Local Management Primitives DL_CHAR character synchronous communication line. DL_CTCA channel-to-channel adapter. DL_FDDI Fiber Distributed Data Interface. DL_OTHER any other medium not listed above. NOTE dl_mac_type is not valid until after a dl_attach_req has been issued. dl_reserved reserved field whose value must be set to zero. dl_current_state state of the DLPI interface for the stream when the DLS provider issued this acknowledgment.
DLPI Primitives Local Management Primitives connection-less data link service. DL_HP_RAWDLS raw-mode service. DL_ACLDLS acknowledged connectionless data link service. Since ATM is a connection-oriented link, the value of this field will always be DL_CODLS. dl_qos_length length, in bytes, of the negotiated/selected values of the quality of service (QOS) parameters. The returned values are those agreed during the negotiation.
DLPI Primitives Local Management Primitives style of DLS provider associated with the DLPI stream. The following provider classes are defined. DL_STYLE1 PPA is implicitly attached to the DLPI stream by opening the appropriate major/minor device number. DL_STYLE2 DLS user must explicitly attach a PPA to the DLPI stream using DL_ATTACH_REQ. ATM DLPI only supports DL_STYLE2. dl_addr_offset offset of the address that is bound to the associated stream.
DLPI Primitives Local Management Primitives DL_ATTACH_REQ Requests the DLS provider to associate a physical point of attachment (PPA) with a stream. The message consists of one M_PROTO message block, which contains the following structure. Format typedef struct { ulong dl_primitive; ulong dl_ppa; } dl_attach_req_t; Parameters dl_primitive DL_ATTACH_REQ dl_ppa identifier of the physical point of attachment to be associated with the stream. State The message is valid in state DL_UNATTACHED.
DLPI Primitives Local Management Primitives DL_OUTSTATE The primitive was issued from an invalid state. DL_SYSERR A system error has occurred and the UNIX system error is indicated in the DL_ERROR_ACK. DL_DETACH_REQ Requests the DLS provider to disassociate a physical point of attachment (PPA) with a stream. The message consists of one M_PROTO message block, which contains the following structure.
DLPI Primitives Local Management Primitives A system error has occurred and the UNIX system error is indicated in the DL_ERROR_ACK. DL_BIND_REQ Requests the DLS provider to bind a DLSAP to the stream. The DLS user must identify the address of the DLSAP to be bound to the stream. The DLS user also indicates whether it will accept incoming connection requests on the stream. Finally, the request directs the DLS provider to activate the stream associated with the DLSAP.
DLPI Primitives Local Management Primitives connection-mode DL_CLDLS connectionless-mode DL_HP_RAWDLS raw-mode dl_conn_mgmt indicates that the stream is the “connection management” stream for the PPA to which the stream is attached. This field should be set to zero. dl_xidtest_flg indicates to the DLS provider that XID and/or TEST responses for this stream are to be automatically generated by the DLS Provider. State The message is valid in state DL_UNBOUND. New State The resulting state is DL_BIND_PENDING.
DLPI Primitives Local Management Primitives The DLS user did not have proper permission to use the requested DLSAP address. DL_BOUND The DLS user attempted to bind a second stream to a DLSAP with dl_max_conind greater than zero, or the DLS user attempted to bind a second “connection management” stream to a PPA. DL_OUTSTATE The primitive was issued from an invalid state. DL_NOADDR The DLS provider could not allocate a DLSAP address for this stream.
DLPI Primitives Local Management Primitives typedef struct { ulong ulong ulong ulong ulong ulong } dl_bind_ack_t; dl_primitive; dl_sap; dl_addr_length; dl_addr_offset; dl_max_conind; dl_xidtest_flg; Parameters dl_primitive DL_BIND_ACK dl_sap DLSAP address information associated with the bound DLSAP. It corresponds to the dl_sap field of the associated DL_BIND_REQ, which contains part of the DLSAP address. dl_addr_length length of the complete DLSAP address that was bound to the DLPI stream.
DLPI Primitives Local Management Primitives The message consists of one M_PROTO message block, which contains the following structure. Format typedef struct { ulong } dl_unbind_req_t; dl_primitive; Parameters dl_primitive DL_UNBIND_REQ State The message is valid in state DL_IDLE. New State The resulting state is DL_UNBIND_PENDING. Response If the unbind request is successful, DL_OK_ACK is sent to the DLS user resulting in state DL_UNBOUND.
DLPI Primitives Local Management Primitives typedef struct { ulong dl_primitive; ulong dl_subs_sap_offset; ulong dl_subs_sap_length; ulong dl_subs_bind_class; } dl_subs_bind_req_t; Parameters dl_primitive DL_SUBS_BIND_REQ dl_subs_sap_offset offset of the DLSAP from the beginning of the M_PROTO block. dl_subs_sap_length length of the specified DLSAP. dl_subs_bind_class specifies either peer or hierarchical addressing. DL_PEER_BIND specifies peer addressing.
DLPI Primitives Local Management Primitives DL_ACCESS The DLSAP user did not have proper permission to use the requested DLSAP address. DL_OUTSTATE Primitive was issued from an invalid state. DL_SYSERR A system error has occurred and the UNIX system error is indicated in the DL_ERROR_ACK. DL_UNSUPPORTED Requested addressing class not supported. DL_TOOMANY Limit exceeded on the maximum number of DLSAPs per stream.
DLPI Primitives Local Management Primitives State The message is valid in state DL_SUBS_BIND_PND. New State The resulting state is DL_IDLE. DL_SUBS_UNBIND_REQ Requests the DLS provider to unbind the DLSAP that had been bound by a previous DL_SUBS_BIND_REQ from this stream. Format The message consists of one M_PROTO message block, which contains the following structure.
DLPI Primitives Local Management Primitives Reasons for Failure DL_OUTSTATE Primitive was issued from an invalid state. DL_SYSERR A system error has occurred and the UNIX system error is indicated in the DL_ERROR_ACK. DL_BADADDR The DLSAP address information was invalid or was in an incorrect format. DL_ENABMULTI_REQ Requests the DLS Provider to enable specific multicast addresses on a per Stream basis.
DLPI Primitives Local Management Primitives This message is valid in any state in which a local acknowledgment is not pending with the exception of DL_UNATTACH. New State The resulting state is unchanged. Response If the enable request is successful, a DL_OK_ACK is sent to the DLS user. If the request fails, DL_ERROR_ACK is returned and the resulting state is unchanged. Reasons for Failure DL_BADADDR Address information was invalid or was in an incorrect format.
DLPI Primitives Local Management Primitives dl_addr_length length of the physical address. dl_addr_offset offset form the beginning of the M_PROTO message block where the multicast address begins. State This message is valid in any state in which a local acknowledgment is not pending with the exception of DL_UNATTACH. New State The resulting state is unchanged. Response If the disable request is successful, a DL_OK_ACK is sent to the DLS user.
DLPI Primitives Local Management Primitives Format The message consists of one M_PROTO message block, which contains the following structure. typedef struct { ulong dl_primitive; ulong dl_level; } dl_promiscon_req_t; Parameters dl_primitive DL_PROMISCON_REQ dl_level indicates promiscuous mode at the physical or SAP level. DL_PROMISC_PHYS Before or after the STREAM has been bound, the DLPI user receives all traffic on the wire regardless of protocol or physical address.
DLPI Primitives Local Management Primitives Reasons for Failure DL_OUTSTATE Primitive was issued from an invalid state. DL_SYSERR A system error has occurred and the UNIX system error is indicated in the DL_ERROR_ACK. DL_NOTSUPPORTED Primitive is known but not supported by the DLS Provider. DL_UNSUPPORTED Requested service is not supplied by the provider.
DLPI Primitives Local Management Primitives Before or after the STREAM has been bound, the DLPI user receives all traffic destined for this interface (physical addresses, broadcast addresses or bound multicast addresses) that matches any protocol enabled on that interface. DL_PROMISC_MULTI Before or after the STREAM has been bound, the DLPI user receives all multicast packets on the wire regardless of the protocol it is destined for.
DLPI Primitives Local Management Primitives Format The message consists of one M_PCPROTO message block, which contains the following structure. typedef struct { ulong ulong } dl_ok_ack_t; dl_primitive; dl_correct_primitve; Parameters dl_primitive DL_OK_ACK dl_correct_primitive identifies the successfully received primitive that is being acknowledged.
DLPI Primitives Local Management Primitives ulong ulong } dl_error_ack_t;_ dl_errno; dl_unix_errno; Parameters dl_primitive DL_ERROR_ACK dl_error_primitive primitive that is in error. dl_errno DLPI error code associated with the failure. dl_unix_errno UNIX system error code associated with the failure. This value should be non-zero only when dl_errno is set to DL_SYSERR. It is used to report UNIX system failures that prevent the processing of a given request or response.
DLPI Primitives Local Management Primitives The message consists one M_PROTO message block containing the structure shown below. typedef struct { ulong dl_primitive; ulong dl_addr_type; } dl_phys_addr_req_t; Parameters dl_primitive DL_PHYS_ADDR_REQ dl_addr_type type of address requested - factory physical address or current physical address DL_FACT_PHYS_ADDR DL_CURR_PHYS_ADDR State The message is valid in any attached state in which a local acknowledgement is not pending.
DLPI Primitives Local Management Primitives DL_PHYS_ADDR_ACK This primitive returns the value for the physical address to the link user in response to a DL_PHYS_ADDR_REQ. Format The message consists one M_PROTO message block containing the structure shown below. typedef struct { ulong dl_primitive; ulong dl_addr_length; ulong dl_addr_offset; } dl_phys_addr_ack_t; Parameters dl_primitive DL_PHYS_ADDR_ACK dl_addr_length length of the requested hardware address.
DLPI Primitives Local Management Primitives typedef struct { ulong dl_primitive; ulong dl_addr_length; ulong dl_addr_offset; } dl_set_phys_addr_req_t; Parameters dl_primitive DL_SET_PHYS_ADDR_REQ dl_addr_length length of the requested hardware address. dl_addr_offset offset from beginning of the M_PROTO message block. State The message is valid in any attached state in which a local acknowledgement is not pending. For a style 2 provider, this would be after a PPA is attached using the DL_ATTACH_REQ.
DLPI Primitives Local Management Primitives DL_BUSY One or more streams for that particular PPA are in the DL_BOUND state. DL_GET_STATISTICS_REQ Directs the DLS provider to return statistics. Format The message consists one M_PROTO message block containing the structure shown below. typedef struct { ulong dl_primitive; } dl_get_statistics_req_t; Parameters dl_primitive DL_GET_STATISTICS_REQ State The message is valid in any attached state in which a local acknowledgement is not pending.
DLPI Primitives Local Management Primitives The message consists one M_PROTO message block containing the structure shown below. typedef struct { ulong dl_primitive; ulong dl_stat_length; ulong dl_stat_offset; } dl_get_statistics_ack_t; Parameters dl_primitive DL_GET_STATISTICS_ACK dl_stat_length length of the statistics structure. dl_stat_offset offset from the beginning of the M_PCPROTO message block where the statistics information resides.
DLPI Primitives Local Management Primitives Parameters dl_primitive DL_HP_MULTICAST_LIST_REQ State The message is valid in any state in which there is not a local acknowledgment pending with the exception of DL_UNATTACH. New State The resulting state is unchanged. Response If the multicast request is successful, a DL_HP_MULTICAST_LIST_ACK is sent to the DLS user. If the requests fails, DL_ERROR_ACK is returned and the resulting state is unchanged.
DLPI Primitives Local Management Primitives dl_primitive DL_HP_MULTICAST_LIST_ACK dl_offset offset to the data in the multicast acknowledgment. dl_length length of data area, in bytes. dl_count total number of 6 byte multicast addresses in the data area of the multicast acknowledgment. State The message is valid in any state in response to a DL_HP_MULTICAST_LIST_REQ. New State The resulting state is unchanged.
DLPI Primitives Connectionless-mode Service Primitives Connectionless-mode Service Primitives This section describes the connectionless-mode service primitives. DL_UNITDATA_REQ Conveys one DLSDU from the DLS user to the DLS provider for transmission to a peer DLS user. Because connectionless data transfer is an unacknowledged service, the DLS provider makes no guarantees of delivery of connectionless DLSDUs.
DLPI Primitives Connectionless-mode Service Primitives dl_dest_addr_length length of the DLSAP address of the destination DLS user. If the destination user is implemented using DLPI, this address is the full DLSAP address returned on the DL_BIND_ACK. dl_dest_addr_offset offset from the beginning of the M_PROTO message block where the destination DLSAP address begins. dl_priority priority value within the supported range for this particular DLSDU. State The message is valid in state DL_IDLE.
DLPI Primitives Connectionless-mode Service Primitives DL_OUTSTATE Primitive was issued from an invalid state. DL_UNSUPPORTED Requested priority not supplied by provider. DL_UNITDATA_IND Conveys one DLSDU from the DLS provider to the DLS user. Format The message consists of one M_PROTO message block containing the structure shown below, followed by one or more M_DATA blocks containing at least one byte of data. The amount of user data that may be transferred in a single DLSDU is limited.
DLPI Primitives Connectionless-mode Service Primitives offset from the beginning of the M_PROTO message block where the source DLSAP address begins. dl_group_address is set by the DLS provider upon receiving and passing upstream a data message when the destination address of the data message is a multicast or broadcast address. State The message is valid in any attached state. New State The resulting state is unchanged.
DLPI Primitives Connectionless-mode Service Primitives dl_unix_errno UNIX system error code associated with the failure. This value should be non-zero only when dl_errno is set to DL_SYSERR. It is used to report UNIX system failures that prevent the processing of a given request. dl_errno DLPI error code associated with the failure. See Reasons for Failure in the description of DL_UNITDATA_REQ for the error codes that apply to an erroneous DL_UNITDATA_REQ.
DLPI Primitives Raw Mode Service Primitives Raw Mode Service Primitives This section describes the raw mode service primitives. DL_HP_RAWDATA_REQ Requests the DLS provider to send one completely formatted DLSDU to a peer DLS user. The DLSDU is assumed to have a complete Link and MAC Level header included. As with connectionless data transfer, raw mode is an unacknowledged service, and the DLS provider makes no guarantees of delivery of connectionless DLSDUs.
DLPI Primitives Raw Mode Service Primitives If the DLS provider accepts the data for transmission, there is no response. This does not, however, guarantee that the data will be delivered to the destination DLS user, since the connectionless data transfer is not a confirmed service. If the request is erroneous, a DL_ERROR_ACK is returned, and the resulting state is unchanged. Reasons for Failure DL_BADPRIM Request was issued from a state in which the DL_HP_RAWDATA_REQ was not recognized.
DLPI Primitives Raw Mode Service Primitives The resulting state is unchanged.
DLPI Primitives Connection-mode Service Primitives Connection-mode Service Primitives This section describes the service primitives that support the connection-mode service of the data link layer. These primitives support the establishment of connections, connection-mode data transfer, and connection release services. In the connection establishment model, the calling DLS user initiates a request for a connection, and the called DLS user receives each request and either accepts or rejects it.
DLPI Primitives Connection-mode Service Primitives Format typedef struct { u_long dl_primitive; } dl_hp_info_req_t; Parameters dl_primitive DL_HP_INFO_REQ State The message is valid in the states DL_IDLE, DL_DATAXFER, DL_OUTCON_PENDING, DL_INCON_PENDING, DL_USER_RESET_PENDING, and DL_PROV_RESET_PENDING. New State The resulting state is unchanged. Response If the primitive is issued from a valid state, the DLS provider responds with a DL_HP_INFO_ACK. Otherwise a DL_ERROR_ACK is returned.
DLPI Primitives Connection-mode Service Primitives u_long dl_remote_win; u_long dl_i_pkts_in; u_long dl_i_pkts_in_oos; u_long dl_i_pkts_in_drop; u_long dl_i_pkts_out; u_long dl_i_pkts_retrans; u_long dl_s_pkts_in; u_long dl_s_pkts_out; u_long dl_u_pkts_in; u_long dl_u_pkts_out; u_long dl_bad_pkts; u_long dl_retry_cnt; u_long dl_max_retry_cnt; u_long dl_max_retries; u_long dl_ack_thresh; u_long dl_remote_busy_cnt; u_long dl_hw_req_fails; } dl_hp_info_ack_t; Parameters dl_primitive DL_HP_INFO_ACK dl_mem_fail
DLPI Primitives Connection-mode Service Primitives dl_busy_to length of the BUSY timeout in tenths of a second. The BUSY timeout determines the length of time that LLC Type 2 will wait for an indication that a remote busy condition has been cleared before attempting to force a response. dl_send_ack_timeout length of the SEND_ACK timeout in tenths of a second.
DLPI Primitives Connection-mode Service Primitives dl_i_pkts_out number of I PDUs acknowledged by the remote system. dl_i_pkts_retrans number of I PDUs re-transmitted. dl_s_pkts_in number of S PDUs received. dl_s_pkts_out number of S PDUs transmitted. dl_u_pkts_in number of U PDUs received. dl_u_pkts_out number of U PDUs transmitted. dl_bad_pkts number of PDUs with bad control fields received.
DLPI Primitives Connection-mode Service Primitives number of times that the remote system has reported that it was busy. dl_hw_req_fails number of times that LLC Type 2 has been unable to transmit due to congestion in the interface device driver or interface card. State The message is valid in any state in response to a DL_HP_INFO_REQ. New State The resulting state is unchanged. DL_HP_SET_ACK_TO_REQ Requests the DLS provider to set the ACK timeout to the specified value.
DLPI Primitives Connection-mode Service Primitives If the primitive is issued from a valid state, the DLS provider responds with a DL_OK_ACK. Otherwise a DL_ERROR_ACK is returned. Reasons for Failure DL_OUTSTATE Primitive was issued from an invalid state. DL_HP_SET_P_TO_REQ Requests the DLS provider to set the P timeout to the specified value.
DLPI Primitives Connection-mode Service Primitives DL_HP_SET_REJ_TO_REQ Requests the DLS provider to set the REJ timeout to the specified value. Format typedef struct { u_long dl_primitive; u_long dl_rej_to; } dl_hp_set_rej_to_req_t; Parameters dl_primitive DL_HP_SET_REJ_TO_REQ dl_rej_to new value of the REJ timeout in tenths of a second. The REJ timeout determines the length of time that LLC Type 2 will wait for a response to a REJ PDU before attempting to force a response.
DLPI Primitives Connection-mode Service Primitives typedef struct { u_long dl_primitive; u_long dl_busy_to; } dl_hp_set_busy_to_req_t; Parameters dl_primitive DL_HP_SET_BUSY_TO_REQ dl_busy_to new value of the BUSY timeout in tenths of a second. The BUSY timeout determines the length of time that LLC Type 2 will wait for an indication that a remote busy condition has been cleared before attempting to force a response.
DLPI Primitives Connection-mode Service Primitives dl_primitive DL_HP_SET_SEND_ACK_TO_REQ dl_send_ack_to new value of the SEND_ACK timeout in tenths of a second. The SEND_ACK timeout determines the maximum length of time that LLC Type 2 will delay acknowledgment of I PDUs if it has not received dl_send_ack_threshold I PDUs. State The message is valid in the states DL_IDLE, DL_DATAXFER, DL_OUTCON_PENDING, DL_INCON_PENDING, DL_USER_RESET_PENDING, and DL_PROV_RESET_PENDING.
DLPI Primitives Connection-mode Service Primitives maximum allowed number of retries before re-setting the connection. This is sometimes known as the N2 variable. The message is valid in the states DL_IDLE, DL_DATAXFER, DL_OUTCON_PENDING, DL_INCON_PENDING, DL_USER_RESET_PENDING, and DL_PROV_RESET_PENDING. New State The resulting state is unchanged. Response If the primitive is issued from a valid state, the DLS provider responds with a DL_OK_ACK. Otherwise a DL_ERROR_ACK is returned.
DLPI Primitives Connection-mode Service Primitives The message is valid in the states DL_IDLE, DL_DATAXFER, DL_OUTCON_PENDING, DL_INCON_PENDING, DL_USER_RESET_PENDING, and DL_PROV_RESET_PENDING. New State The resulting state is unchanged. Response If the specified dl_ack_thresh is valid and the primitive was issued from a valid state, the DLS provider responds with a DL_OK_ACK. Otherwise a DL_ERROR_ACK is returned. Reasons for Failure DL_OUTSTATE Primitive was issued from an invalid state.
DLPI Primitives Connection-mode Service Primitives size of the local receive window. This value must be greater than 0 and less than 128. State The message is valid in the states DL_IDLE, DL_DATAXFER, DL_OUTCON_PENDING, DL_INCON_PENDING, DL_USER_RESET_PENDING, and DL_PROV_RESET_PENDING. New State The resulting state is unchanged. Response If the specified dl_local_win is valid and the primitive was issued from a valid state, the DLS provider responds with a DL_OK_ACK. Otherwise a DL_ERROR_ACK is returned.
DLPI Primitives Connection-mode Service Primitives DL_HP_SET_REMOTE_WIN_REQ dl_remote_win size of the remote receive window. This value must be greater than 0 and less than 128. State The message is valid in the states DL_IDLE, DL_DATAXFER, DL_OUTCON_PENDING, DL_INCON_PENDING, DL_USER_RESET_PENDING, and DL_PROV_RESET_PENDING. New State The resulting state is unchanged.
DLPI Primitives Connection-mode Service Primitives Parameters dl_primitive DL_HP_CLEAR_STATS_REQ State The message is valid in the states DL_IDLE, DL_DATAXFER, DL_OUTCON_PENDING, DL_INCON_PENDING, DL_USER_RESET_PENDING, and DL_PROV_RESET_PENDING. New State The resulting state is unchanged. Response If the primitive is issued from a valid state, the DLS provider responds with a DL_OK_ACK. Otherwise a DL_ERROR_ACK is returned. Reasons for Failure DL_OUTSTATE Primitive was issued from an invalid state.
DLPI Primitives Connection-mode Service Primitives If the primitive is issued from a valid state, the DLS provider responds with a DL_OK_ACK. Otherwise a DL_ERROR_ACK is returned. Reasons for Failure DL_OUTSTATE Primitive was issued from an invalid state. DL_HP_CLEAR_LOCAL_BUSY_REQ Requests that the DLS provider inform the remote system that the local system is no longer busy and is again able to accept new data packets.
DLPI Primitives Connection-mode Service Primitives DL_CONNECT_REQ Requests the DLS provider to establish a data link connection with a remote DLS user. Format The message consists of one M_PROTO message block containing the structure shown below.
DLPI Primitives Connection-mode Service Primitives New State The resulting state is DL_OUTCON_PENDING. Response There is no immediate response to the connect request. However, if the connect request is accepted by the called DLS user, DL_CONNECT_CON is sent to the calling DLS user, resulting in state DL_DATAXFER. If the request is erroneous, DL_ERROR_ACK is returned and the resulting state is unchanged.
DLPI Primitives Connection-mode Service Primitives typedef struct { ulong dl_primitive; ulong dl_correlation; ulong dl_called_addr_length; ulong dl_called_addr_offset; ulong dl_calling_addr_length; ulong dl_calling_addr_offset; ulong dl_qos_length; ulong dl_qos_offset; ulong dl_growth; } dl_connect_ind_t; Parameters dl_primitive DL_CONNECT_IND dl_correlation correlation number to be used by the DLS user to associate this message with the DL_CONNECT_RES, DL_DISCONNECT_REQ, or DL_DISCONNECT_IND that is to fo
DLPI Primitives Connection-mode Service Primitives dl_growth growth field for future enhancements to this primitive. Its value will be set to zero. State The message is valid in state DL_IDLE, or state DL_INCON_PENDING when the maximum number of outstanding DL_CONNECT_IND primitives has not been reached on this stream. New State The resulting state is DL_INCON_PENDING, regardless of the current state.
DLPI Primitives Connection-mode Service Primitives dl_correlation correlation number that was received with the DL_CONNECT_IND associated with the connection request. The DLS provider will use the correlation number to identify the connect indication to which the DLS user is responding. dl_resp_token if non-zero, the token associated with the responding stream on which the DLS provider is to establish the connection; this stream must be attached to a PPA and bound to a DLSAP.
DLPI Primitives Connection-mode Service Primitives If the request fails, DL_ERROR_ACK is returned on the stream where the DL_CONNECT_RES primitive was received, and the resulting state of that stream and the responding stream is unchanged. Reasons for Failure DL_BADTOKEN The token for the responding stream was not associated with a currently open stream. DL_BADQOSPARAM The quality of service parameters contained invalid values.
DLPI Primitives Connection-mode Service Primitives Format The message consists of one M_PROTO message block containing the structure shown below. typedef struct { ulong dl_primitive; ulong dl_resp_addr_length ulong dl_resp_addr_offset ulong dl_qos_lenth; ulong dl_qos_offset; ulong dl_growth; } dl_connect_con_t; Parameters dl_primitive DL_CONNECT_CON dl_resp_addr_length length of the address of the responding DLSAP associated with the newly established data link connection.
DLPI Primitives Connection-mode Service Primitives DL_TOKEN_REQ Requests that a connection response token be assigned to the stream and returned to the DLS user. This token can be supplied in the DL_CONNECT_RES primitive to indicate the stream on which a connection will be established. Format The message consists of one M_PROTO message block containing the structure shown below.
DLPI Primitives Connection-mode Service Primitives Parameters dl_primitive DL_TOKEN_ACK dl_token connection response token associated with the stream. This value must be a non-zero value. The DLS provider will generate a token value for each stream upon receipt of the first DL_TOKEN_REQ primitive issued on that stream. The same token value will be returned in response to all subsequent DL_TOKEN_REQ primitives issued on a stream. State The message is valid in any state in response to a DL_TOKEN_REQ.
DLPI Primitives Connection-mode Service Primitives • The primitive was issued from an invalid state. If the request is issued in state DL_IDLE or DL_PROV_RESET_PENDING, however, it is silently discarded with no fatal error generated. • The amount of data in the current DLSDU is not within the DLS provider’s acceptable bounds as specified by dl_min_sdu and dl_max_sdu in the DL_INFO_ACK. DL_DATA_IND Conveys a DLSDU from the DLS provider to the DLS user.
DLPI Primitives Connection-mode Service Primitives dl_reason reason for the disconnection. DL_DISC_NORMAL_CONDITION: normal release of a data link connection. DL_DISC_ABNORMAL_CONDITION: abnormal release of a data link connection. DL_CONREJ_PERMANENT_COND: a permanent condition caused the rejection of a connect request. DL_CONREJ_TRANSIENT_COND: a transient condition caused the rejection of a connect request.
DLPI Primitives Connection-mode Service Primitives DL_BADCORR The correlation number specified in this primitive did not correspond to a pending connect indication. DL_OUTSTATE The primitive was issued from an invalid state. DL_SYSERR A system error has occurred and the UNIX system error is indicated in the DL_ERROR_ACK.
DLPI Primitives Connection-mode Service Primitives DL_DISC_TRANSIENT_CONDITION: connection released due to transient connection. DL_CONREJ_DEST_UNKOWN: unknown destination for connect request. DL_CONREJ_DEST_UNREACH_PERMANENT: could not reach destination for connect request - permanent condition. DL_CONREJ_DEST_UNREACH_TRANSIENT: could not reach destination for connect request - transient condition.
DLPI Primitives Connection-mode Service Primitives Format The message consists of one M_PROTO message block containing the structure shown below. typedef struct { ulong dl_primitive; } dl_reset_req_t; Parameters dl_primitive DL_RESET_REQ State The message is valid in state DL_DATAXFER. New State The resulting state is DL_USER_RESET_PENDING. Response If the disconnect is successful, DL_OK_ACK is sent to the DLS user resulting in state DL_IDLE.
DLPI Primitives Connection-mode Service Primitives The message consists of one M_PROTO message block containing the structure shown below. typedef struct { ulong dl_primitive; ulong dl_originator; ulong dl_reason; } dl_reset_ind_t; Parameters dl_primitive DL_RESET_REQ dl_originator whether the reset was originated by the DLS user or DLS provider (DL_USER or DL_ PROVIDER, respectively).
DLPI Primitives Connection-mode Service Primitives The message consists of one M_PROTO message block containing the structure shown below. typedef struct { ulong dl_primitive; } dl_reset_res_t; Parameters dl_primitive DL_RESET_RES State The primitive is valid in state DL_PROV_RESET_PENDING. New State The resulting state is DL_RESET_RES_PENDING. Response If the reset response is successful, DL_OK_ACK is sent to the DLS user resulting in state DL_DATAXFER.
DLPI Primitives Connection-mode Service Primitives Parameters dl_primitive DL_RESET_CON State The message is valid in state DL_USER_RESET_PENDING. New State The resulting state is DL_DATAXFER.
DLPI Primitives Primitives to Handle XID and TEST Operations Primitives to Handle XID and TEST Operations This section describes the primitives used for XID and TEST operations. DL_TEST_REQ Conveys the TEST command DLSDU from the DLS user to the DLS provider for transmission to a peer DLS provider. Format The message consists of one M_PROTO message block, followed by zero or more M_DATA blocks containing zero or more bytes of data.
DLPI Primitives Primitives to Handle XID and TEST Operations The message is valid in states DL_IDLE and DL_DATAXFER. New State The resulting state is unchanged. Response On an invalid TEST command request, a DL_ERROR_ACK is issued to the user. If the DLS provider receives a response from the remote side, a DL_TEST_CON is issued to the DLS user. It is recommended that the DLS user use a timeout procedure to recover from a situation when there is no response from the peer DLS user.
DLPI Primitives Primitives to Handle XID and TEST Operations The message consists of one M_PROTO message block, followed by zero or more M_DATA blocks containing zero or more bytes of data.
DLPI Primitives Primitives to Handle XID and TEST Operations The resulting state is unchanged. Response The DLS user must respond with a DL_TEST_RES. DL_TEST_RES Conveys the TEST response DLSDU from the DLS user to the DLS provider in response to a DL_TEST_IND. Format The message consists of one M_PROTO message block, followed by zero or more M_DATA blocks containing zero or more bytes of data.
DLPI Primitives Primitives to Handle XID and TEST Operations The resulting state is unchanged. DL_TEST_CON Conveys the TEST response DLSDU from the DLS provider to the DLS user in response to a DL_TEST_REQ. Format The message consists of one M_PROTO message block, followed by zero or more M_DATA blocks containing zero or more bytes of data.
DLPI Primitives Primitives to Handle XID and TEST Operations offset from the beginning of the M_PROTO message block where the source DLSAP address begins. State The message is valid in states DL_IDLE and DL_DATAXFER. New State The resulting state is unchanged. DL_XID_REQ Conveys one XID DLSDU from the DLS user to the DLS provider for transmission to a peer DLS user. Format The message consists of one M_PROTO message block, followed by zero or more M_DATA blocks containing zero or more bytes of data.
DLPI Primitives Primitives to Handle XID and TEST Operations State The message is valid in states DL_IDLE and DL_DATAXFER. New State The resulting state is unchanged. Response On an invalid XID request, a DL_ERROR_ACK is issued to the user. If the remote side responds to the XID request, a DL_XID_CON will be sent to the user. It is recommended that the DLS user use a timeout procedure on an XID_REQ. The timeout may be used if the remote side does not respond to the XID request.
DLPI Primitives Primitives to Handle XID and TEST Operations The message consists of one M_PROTO message block, followed by zero or more M_DATA blocks containing zero or more bytes of data.
DLPI Primitives Primitives to Handle XID and TEST Operations The resulting state is unchanged. Response The DLS user must respond with a DL_XID_RES. DL_XID_RES Conveys an XID DLSDU from the DLS user to the DLS provider in response to a DL_XID_IND. Format The message consists of one M_PROTO message block, followed by zero or more M_DATA blocks containing zero or more bytes of data.
DLPI Primitives Primitives to Handle XID and TEST Operations The resulting state is unchanged. DL_XID_CON Conveys an XID DLSDU from the DLS provider to the DLS user in response to a DL_XID_REQ. Format The message consists of one M_PROTO message block, followed by zero or more M_DATA blocks containing zero or more bytes of data.
DLPI Primitives Primitives to Handle XID and TEST Operations offset from the beginning of the M_PROTO message block where the source DLSAP address begins. State The message is valid in states DL_IDLE and DL_DATAXFER. New State The resulting state is unchanged.
DLPI Primitives DLPI States DLPI States Table 2-1 describes the states associated with DLPI. It presents the state name used in the state transition table, the corresponding DLPI state name used throughout this specification, a brief description of the state, and an indication of whether the state is valid for connection-oriented data link service (DL_CODLS), connectionless data link service (DL_CLDLS), acknowledged connectionless data link service (ACLDLS) or all.
DLPI Primitives DLPI States State DLPI State Description Service Type 7) UDQOS PEND DL_UDQOS_ PENDING The DLS user is waiting for an acknowledgment of a DL_UDQOS_REQ DL_CLDLS 8) OUTCON PEND DL_OUTCON_ PENDING An outgoing connection is pending - the DLS user is waiting for a DL_CONNECT_CON DL_CODLS 9) INCON PEND DL_INCON_ PENDING An incoming connection is pending - the DLS provider is waiting for a DL_CONNECT_RES DL_CODLS 10) CONN_RES PEND DL_CONN_RES_ PENDING The DLS user is waiting for a
DLPI Primitives DLPI States State DLPI State Service Type Description 16) DISCON 9 PEND DL_DISCON9_ PENDING The DLS user is waiting for an acknowledgement of a DL_DISCONNECT_REQ Issued from the DL_INCON_PENDING state.
DLPI Primitives DLPI States • The DLS provider may never generate a primitive that places the interface out of state. • If the DLS provider generates a STREAMS M_ERROR message upstream, it should free any further primitives processed by its write side put or service procedure. • The close of a stream is considered an abortive action by the DLS user, and may be executed from any state. The DLS provider must issue appropriate indications to the remote DLS user when a close occurs.
DLPI Primitives DLPI States • A DL_DATA_REQ primitive received by the DLS provider in the state DL_PROV_RESET_PENDING (i.e. after a DL_RESET_IND has been passed to the DLS user) or the state DL_IDLE (i.e. after a data link connection has been released) should be discarded by the DLS provider. • A DL_DATA_IND primitive received by the DLS user after the user has issued a DL_RESET_REQ should be discarded.
A Sample Programs This appendix contains sample programs for connection, connectionless, and raw modes.
Sample Programs Connection Mode Connection Mode /************************************************************************** (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1992. ALL RIGHTS RESERVED.
Sample Programs Connection Mode #define GOT_CTRL #define GOT_DATA #define GOT_BOTH 1 2 3 /* message has only a control part */ /* message has only a data part */ /* message has both control and data parts */ int get_msg(fd) int fd; /* file descriptor */ { int flags = 0; /* 0 ---> get any available message */ int result = 0; /* return value */ /* zero first byte of control area so the caller can call check_ctrl without checking the get_msg return value; if there was only data in the message and the user w
Sample Programs Connection Mode err_ack->dl_unix_errno); exit(1); } else { /* didn't get an ERROR_ACK either; print whatever primitive we did get */ printf(”error: expected primitive 0x%02x, ”, ex_prim); printf(”got primitive 0x%02x\n”, err_ack->dl_primitive); exit(1); } } else { /* no control; did we get data? */ if(data_buf.
Sample Programs Connection Mode /************************************************************************** put a message consisting of only a control part on a stream **************************************************************************/ void put_ctrl(fd, length, pri) int fd; /* file descriptor */ int length; /* length of control message */ int pri; /* priority of message: either 0 or RS_HIPRI */ { /* set the len field in the strbuf structure */ ctrl_buf.
Sample Programs Connection Mode int dlsap_len; int i; /* length of dlsap */ { printf(”%s0x”, string); for(i = 0; i < dlsap_len; i++) { printf(”%02x”, dlsap[i]); } printf(”\n”); } /************************************************************************** open the DLPI cloneable device file, get a list of available PPAs, and attach to the first PPA; returns a file descriptor for the stream **************************************************************************/ int attach() { int fd; /* file descript
Sample Programs Connection Mode case DL_FDDI: mac_name = ”FDDI”; break; default: printf(”error: unknown MAC type in ppa_info\n”); exit(1); } printf(”attaching to %s media on PPA %d\n”, mac_name, ppa); /* fill in ATTACH_REQ with the PPA we found, send the ATTACH_REQ, and wait for the OK_ACK */ attach_req->dl_primitive = DL_ATTACH_REQ; attach_req->dl_ppa = ppa; put_ctrl(fd, sizeof(dl_attach_req_t), 0); get_msg(fd); check_ctrl(DL_OK_ACK); /* return the file descriptor for the stream to the caller */ return(fd)
Sample Programs Connection Mode /* send the BIND_REQ and wait for the OK_ACK */ put_ctrl(fd, sizeof(dl_bind_req_t), 0); get_msg(fd); check_ctrl(DL_BIND_ACK); /* return the DLSAP to the caller */ *dlsap_len = bind_ack->dl_addr_length; dlsap_addr = (u_char *)ctrl_area + bind_ack->dl_addr_offset; memcpy(dlsap, dlsap_addr, *dlsap_len); } /************************************************************************** unbind, detach, and close **************************************************************************
Sample Programs Connection Mode con_req->dl_growth = 0; /* copy in the dlsap */ tdlsap = (u_char *)ctrl_area + con_req->dl_dest_addr_offset; memcpy(tdlsap, dlsap, dlsap_len); /* send the connect request */ print_dlsap(”sending CONNECT_REQ to DLSAP ”, dlsap, dlsap_len); put_ctrl(fd, sizeof(dl_connect_req_t) + dlsap_len, 0); } /************************************************************************* get a connection response token for a stream; returns the token **********************************************
Sample Programs Connection Mode /* return the correlation number */ return(con_ind->dl_correlation); } /************************************************************************** send a connect response with a specified correlation and token; wait for the OK_ACK **************************************************************************/ void connect_res(fd, correlation, token) int fd; /* file descriptor */ u_long correlation; /* correlation number of CONNECT_IND */ /* being responded to */ u_long token; /*
Sample Programs Connection Mode */ disc_req->dl_correlation = 0; /* send the disconnect request */ put_ctrl(fd, sizeof(dl_disconnect_req_t), 0); /* wait for the OK_ACK */ get_msg(fd); check_ctrl(DL_OK_ACK); } /************************************************************************** main **************************************************************************/ main() { int send_fd; /* file descriptor for sending stream */ int recv_c_fd; /* fd for recv ctrl stream */ int recv_d_fd; /* fd for recv data str
Sample Programs Connection Mode connect_req(send_fd, rcdlsap, rcdlsap_len); /* The receiver control stream gets a CONNECT_IND. We need the correlation number to relate the CONNECT_IND to the CONNECT_RES we will send down later. */ correlation = connect_ind(recv_c_fd); /* We want to handle the actual data transfer over a dedicated receiver stream. Here, we attach and bind a second stream on the receivers sap with max_conind = 0.
Sample Programs Connection Mode /* Receive the 5 packets. */ for(i = 0; i < 5; i++) { if(get_msg(recv_d_fd) != GOT_DATA) { printf(”error: didn't get data\n”); check_ctrl(0); exit(1); } printf(”received %d bytes of data\n”, data_buf.len); } /* We're finished. Now we tear down the connection. a DISCONNECT_REQ on the receiver side. */ disconnect_req(recv_d_fd); We'll send /* and receive the DISCONNECT_IND on the sender side.
Sample Programs Connectionless Mode Connectionless Mode /************************************************************************** (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1992. ALL RIGHTS RESERVED.
Sample Programs Connectionless Mode AREA_SIZE, 0, data_area /* maxlen = AREA_SIZE */ /* len gets filled in for each message */ /* buf = data area */ }; /************************************************************************** get the next message from a stream; get_msg() returns one of the following defines **************************************************************************/ #define GOT_CTRL 1 /* message has only a control part */ #define GOT_DATA 2 /* message has only a data part */ #define GOT_
Sample Programs Connectionless Mode if(err_ack->dl_primitive == DL_ERROR_ACK) { /* yup; format the ERROR_ACK info */ printf(”error: expected primitive 0x%02x, ”, ex_prim); printf(”got DL_ERROR_ACK\n”); printf(” dl_error_primitive = 0x%02x\n”, err_ack->dl_error_primitive); printf(” dl_errno = 0x%02x\n”, err_ack->dl_errno); printf(” dl_unix_errno = %d\n”, err_ack->dl_unix_errno); exit(1); } else { /* didn't get an ERROR_ACK either; print whatever primitive we did get */ printf(”error: expected primitive 0x%02
Sample Programs Connectionless Mode { /* set the len field in the strbuf structure */ data_buf.
Sample Programs Connectionless Mode attach() { int fd; /* file descriptor */ int ppa; /* PPA to attach to */ dl_hp_ppa_req_t *ppa_req = (dl_attach_req_t *)ctrl_area; dl_hp_ppa_ack_t *ppa_ack = (dl_hp_ppa_ack_t *)ctrl_area; dl_hp_ppa_info_t *ppa_info; dl_attach_req_t *attach_req = (dl_attach_req_t *)ctrl_area; char *mac_name; /* open the device file */ if((fd = open(”/dev/dlpi”, O_RDWR)) == -1) { printf(”error: open failed, errno = %d\n”, errno); exit(1); } /* find a PPA to attach to; we assume that the firs
Sample Programs Connectionless Mode */ attach_req->dl_primitive = DL_ATTACH_REQ; attach_req->dl_ppa = ppa; put_ctrl(fd, sizeof(dl_attach_req_t), 0); get_msg(fd); check_ctrl(DL_OK_ACK); /* return the file descriptor for the stream to the caller */ return(fd); } /************************************************************************** bind to a sap with a specified service mode and max_conind; returns the local DLSAP and its length **************************************************************************/
Sample Programs Connectionless Mode int { *dlsap_len; dl_subs_bind_req_t dl_subs_bind_ack_t u_char *subs_bind_req = (dl_subs_bind_req_t*)ctrl_area; *subs_bind_ack = (dl_subs_bind_ack_t*)ctrl_area; *dlsap_addr; /* Fill in Subsequent bind req */ subs_bind_req->dl_primitive = DL_SUBS_BIND_REQ; subs_bind_req->dl_subs_sap_offset = DL_SUBS_BIND_REQ_SIZE; subs_bind_req->dl_subs_sap_length = snapsap_len; subs_bind_req->dl_subs_bind_class = subs_bind_class; memcpy((caddr_t)&subs_bind_req[1], snapsap, snapsap_len)
Sample Programs Connectionless Mode { dl_unitdata_ind_t char *rdlsap; int msg_res; *data_ind = (dl_unitdata_ind_t *)ctrl_area; msg_res = get_msg(fd); check_ctrl(DL_UNITDATA_IND); if(msg_res != GOT_BOTH) { printf(”error: did not receive data part of message\n”); exit(1); } return(data_buf.
Sample Programs Connectionless Mode /************************************************************************** main **************************************************************************/ main() { int send_fd, recv_fd; /* file descriptors */ u_char sdlsap[20]; /* sending DLSAP */ u_char rdlsap[20]; /* receiving DLSAP */ int sdlsap_len, rdlsap_len; /* DLSAP lengths */ int i, j, recv_len; /* PART 1 of program. LLC SAP header.
Sample Programs Connectionless Mode /* We're finished with PART 1. Now call cleanup to unbind, then detach, then close the device file. */ cleanup(send_fd); cleanup(recv_fd); /* PART 2 of program. Demonstrate connectionless data transfer with LLC SNAP SAP header. */ /* As demonstrated in the first part of this program we must first open the DLPI device file, /dev/dlpi, and attach to a PPA.
Sample Programs Connectionless Mode print_dlsap(”sending data to ”,rdlsap, rdlsap_len); send_data(send_fd, rdlsap, rdlsap_len, (i + 1) * 10); /* receive the data packet */ recv_len = recv_data(recv_fd); printf(”received %d bytes, first word = %d\n”, recv_len, data_area[0]); } /* We're finished. Now call cleanup to unbind, then detach, then close the device file.
Sample Programs Raw Mode Raw Mode /* * (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1993. ALL RIGHTS * RESERVED. NO PART OF THIS PROGRAM MAY BE PHOTOCOPIED, * REPRODUCED, OR TRANSLATED TO ANOTHER PROGRAM LANGUAGE WITHOUT * THE PRIOR WRITTEN CONSENT OF HEWLETT PACKARD COMPANY */ /**************************************************************** The program demonstrates RAW mode data transfer over an 802.3 interface.
Sample Programs Raw Mode #define GOT_DATA #define GOT_BOTH #define GOT_INTR 2 3 4 /*-=-* get a message from a stream; return type of message *-=-*/ int get_msg(fd) int fd; { int flags = 0; int res, ret; ctl_area[0] = 0; dat_area[0] = 0; ret = 0; res = getmsg(fd, &ctl, &dat, &flags); if(res < 0) { if(errno == EINTR) { return(GOT_INTR); } else { printf(”%s,get_msg: exit(1); } } if(ctl.len > 0) { ret |= GOT_CTRL; } if(dat.
Sample Programs Raw Mode printf(” dl_errno = 0x%02x\n”, err_ack->dl_errno); printf(” dl_unix_errno = %d\n”, err_ack->dl_unix_errno); exit(1); } else { printf(”%s,check_ctrl: expected primitive 0x%02x”, tag, prim); printf(”, got primitive 0x%02x\n”, err_ack->dl_primitive); exit(1); } } } /*-=-* put a control message on a stream *-=-*/ void put_ctrl(fd, len, pri) int fd, len, pri; { ctl.
Sample Programs Raw Mode return(fd); } /*-=-* send DL_BIND_REQ *-=-*/ void dl_bind(fd, sap, addr) int fd, sap; u_char *addr; { dl_bind_req_t *bind_req = (dl_bind_req_t *)ctl_area; dl_bind_ack_t *bind_ack = (dl_bind_ack_t *)ctl_area; bind_req->dl_primitive = DL_BIND_REQ; bind_req->dl_sap = sap; bind_req->dl_max_conind = 1; bind_req->dl_service_mode = DL_HP_RAWDLS; bind_req->dl_conn_mgmt = 0; bind_req->dl_xidtest_flg = 0; put_ctrl(fd, sizeof(dl_bind_req_t), 0); get_msg(fd); check_ctrl(DL_BIND_ACK); bcopy((u_
Sample Programs Raw Mode dl_bind(outfd, OUTSAP, addr); pinfo.fd = outfd; pinfo.events = POLLIN | POLLPRI; pinfo.revents = 0; for(i = 0; i < OUTER_LOOPS; i++) { for(j = 0; j < INNER_LOOPS; j++) { bcopy(addr, mac_hdr->destaddr, 6); /* card will stuff in source addr * The ieee header length does not include the * ethernet MAC header.
Sample Programs Raw Mode 172 Appendix A
Glossary Called DLS user The DLS user in connection mode that processes requests for connections from other DLS users. Calling DLS user The DLS user in connection mode that initiates the establishment of a data link connection. Communication endpoint The local communication channel between a DLS user and DLS provider. Connection establishment The phase in connection mode that enables two DLS users to create a data link connections between them.
Glossary Provider Interface. DLS user The user-level application or user-level or kernel-level protocol that accessess the services of the data link layer. Local management The phase in connection and connectionless modes in which a DLS user initiates a stream and binds a DLSAP to the stream. Primitives in this phase generate local operations only. PPA The point at which a system attaches itself to a physical communications medium.
Index D DL_ATTACH_REQ, 61 DL_BIND_ACK, 65 DL_BIND_REQ, 63 DL_CONNECT_CON, 116 DL_CONNECT_IND, 111 DL_CONNECT_REQ, 110 DL_CONNECT_RES, 113 DL_DATA_IND, 119 DL_DATA_REQ, 118 DL_DETACH_REQ, 62 DL_DISABMULTI_REQ, 72 DL_DISCONNECT_IND, 121 DL_DISCONNECT_REQ, 119 DL_ENABMULTI_REQ, 71 DL_ERROR_ACK, 77 DL_GET_STATISTICS_ACK, 82 DL_GET_STATISTICS_REQ, 82 DL_HP_CLEAR_LOCAL_BUSY _REQ, 109 DL_HP_CLEAR_STATS_REQ, 107 DL_HP_INFO_ACK, 95 DL_HP_INFO_REQ, 95 DL_HP_MULTICAST_LIST_AC K, 84 DL_HP_MULTICAST_LIST_RE Q, 83 DL_HP