Home

DLPI User Manual

image

Contents

1. DL_DISCONNECT_IND 7 10 DLLCONNECT_REQ DL_DISCONNECT_IND 6 2 DL_RESET_REQ DL_CONNECT_CON Kernel Level DLPI DLPI Provider Provider 5 Poll 4 HDLC SDLC j4 HDLC SDLC Protocol SNRM 12 gt Protocol UA 13 la Primary Secondary dlpi_reset_req can also substitute for events 1 and 15 Figure 50 DLS User Invoked Connection Reset for HDLC SDLC Secondary 106 DLPI API GuIDE APRIL 2003 imultaneous ser Invoked Connection Reset SECTION Figure 51 illustrat users simultaneou essage flow for a reset invoked by both DLS Application Application User Level dlpi_send_reset_req dlpi_rcv or dlpi_complete_req O dlpi_send_reset_req dlpi_rcv or dlpi_complete_req DLPI API DLPI API Library Library 2 DL_RESET_REQ 2 DL_RESET_REQ DL_RESET_CON 7 DL_RESET_CON 6 Kernel Level DLPI DLPI Provider Provider 3 G SNRME 4 HDLC SDLC UA 5 gt HDLC SDLC Protocol lt Protocol Primary Secondary dlpi_reset_req can also substitute for events 1 7 and 1 8 Here the SNRM E arrives at the secondary before the DL_RESET_REQ event 3 Figure 51 Simultaneous DLS User Invoked Connection Reset for HDLC SDLC DLPI API Gume 107 APRIL 2003 8
2. DLPI API DLPI API Library Library DL_CONNECT_IND 6 9 DL_CONNECT_RES D DL_CONNECT_REQ DL_CONNECT_CON 13 DL_OK_ACK 10 Kernel Level DLPI DLPI Provider Provider 12 5 10 SABM 4 LAPB D amp LLC II UA 11 P LAPB D amp LLC I Protocol lt Protocol dlpi_connect performing open attach and bind can substitute for events 1 and 14 dlpi_connect_req can also substitute for events 1 and 14 f dlpi_listen performing open attach and bind can substitute for events 7 8 and 11 Figure 16 Successful connection establishment for LAPB LAPD and LLC II 66 DLPI API GUIDE APRIL 2003 GcoM INC NORMAL DATA TRANSFER FOR LAPB LAPD AND LLC II Normal Data Transfer for LAPB LAPD and LLC II The connection oriented data transfer service provides for the exchange of user data in either direction or in both directions simultaneously full duplex between DLS users Data are transmitted in logical groups called Data Link Service Data Units DLSDUs The DLS provider preserves both the sequence and boundaries of DLSDUs as they are transmitted Each call to dlpi_write_data in Figure 17 below conveys a DLSDU from the local DLS user to the DLS provider Similarly each call to dlpi_read_data conveys a DLSDU from the DLS provider to the remote DLS user Application Application i dlpi_write_data User Level dlpi_rc
3. DLPI Application Program Interface Guide April 2003 Protocols LAPB MLP QLLC X 25 HDLC SDLC LAPD and Frame Relay Copyright 2003 GcoM Inc All rights reserved 1995 2003 GCOM Inc All rights reserved Non proprietary Provided that this notice of copyright is included this document may be copied in its entirety without alteration Permission to publish excerpts should be obtained from GCOM Inc GCOM reserves the right to revise this publication and to make changes in content without obligation on the part of GCOM to provide notification of such revision or change The information in this document is believed to be accurate and complete on the date printed on the title page No responsibility is assumed for errors that may exists in this document Rsystem and SyncSockets is a registered trademark of GCOM Inc UNIX is a registered trademark of UNIX Systems Laboratories Inc in the U S and other countries SCO is a trademark of the Santa Cruz Operation Inc All other brand product names mentioned herein are the trademarks or registered trademarks of their respective owners Any provision of this product and its manual to the U S Government is with Restricted Rights Use duplication or disclosure by the U S Government is subject to restrictions as set forth in subparagraph c 1 i of the Rights in Technical Data and Computer Software clause at 252 227 7013 of the DOD FAR Supplement This manual was
4. REQUESTS RESPONSES Figure 5 INDICATIONS ACKNOWLEDGEMENTS CONFIRMATIONS REQUESTS RESPONSES Reference model DLPI ADDRESSING SERVICE USER B INDICATIONS ACKNOWLEDGEMENTS CONFIRMATIONS DLPI API GUIDE 36 GcoM INC REFERENCE MODEL TERMINOLOGY Reference Model Terminology A SERVICE is a set of capabilities provided by a SERVICE PROVIDER A SERVICE USER uses the SERVICES of a SERVICE PROVIDER Example The network layer APRIL 2003 A useful set of abstractions for discussing communications systems is embodied in a reference model such as the ones established by ISO the CCITT and other standards bodies A similar model referred to hereafter simply as the Reference Model is used in this manual but its terms do not conform precisely to those of the standards documents of the above mentioned organizations In the Reference Model a service is defined as a set of capabilities such as circuit establishment error detection and or data transfer A service provider is an abstract entity that conceptually includes all the software hardware transmission media and so on required to provide a particular service A service user is an entity that uses the capabilities of a service provider An entity can be a service user with respect to a particular service provider while at the same time itself being part of a service provider for other entities Layer three network layer in the 7 layer ISO prot
5. Application dlpi_send_connect_req Application 8 dllpi_send_connect_res User Level dlpi_rcv or pi_rcv dlpi_complete_req dlpi_rev DLPI API DLPI API Library Library DL_CONNECT_IND 6 2 DL_CONNECT_REQ Kernel Leve DLPI DLPI Provider Provider DL_CONNECT_CON 13 DL_OK_ACK 10 G A SNRM E 4 5 HDLC SDLC UA 11 HDLC SDLC Protocol lt Protocol Primary Secondary dlpi_connect performing open attach and bind can substitute for events 1 and 14 dlpi_connect_req can also substitute for events 1 and 14 dlpi_listen performing open attach and bind can substitute for events 7 8 and 11 Figure 32 Successful connection establishment for HDLC SDLC 86 DLPI API GUIDE APRIL 2003 GcoM INC NORMAL CONNECTION ESTABLISHMENT FOR HDLC SDLC APRIL 2003 DLPI API GUIDE 87 7 HDLC SDLC CONNECTION ORIENTED SERVICES GcoM INC Normal Data Transfer for HDLC SDLC 88 DLPI API GUIDE The connection oriented data transfer service provides for the exchange of user data in either direction or in both directions simultaneously full duplex between DLS users Data are transmitted in logical groups called Data Link Service Data Units DLSDUs The DLS provider preserves both the sequence and boundaries of DLSDUs as they are transmitted Each call to dlpi_write_data in F
6. DLPIAPI_UNSUPPORTED_MSG A DLPI API Library routine received an inappropriate message from the data stream For example dlpi_read_data does not process reset messages DLPIAPI_NO_NOTHING This is a hang up notification The UNIX getmsg system call succeeded but did not return control or normal data DLPIAPI_STYLE_UNKNOWN Provider style unknown This error should not occur DLPIAPI_PARAM_ERROR Invalid parameter error The buffer pointer and output pointer must be non NULL and the buffer length must be a positive integer DLPIAPI_NOT_INIT dlpi_init has not been called DLPIAPI_OPEN_ERROR Data stream open error DLPIAPI_REJECT Either dlpi_complete_regq was rejected with a DL_ERROR_ACK or dlpi_connect_req was rejected with a DL_DISCONNECT_IND DLPIAPI UNUSABLE A UNIX streams getmsg or putmsg system call failed One possible error recovery action is to close the stream and start over DLPIAPI_EINTR A UNIX system call interrupted retry not provided DLPIAPI_LEAGAIN Non blocking I O is set on the stream and no DLPI messages are available to process 118 DLPI API GUIDE APRIL 2003 GcoM INC DLPI API LIBRARY ROUTINE ERROR RETURN DEFINES DLPI API Logging Options The DLPI API logging options control the kinds of messages that are written into the DLPI API log file These options represent individual bits of a mask They are ordered together to form the set of options passed to dlpi_init DLPILOG_FILE Write m
7. Received data are read into your application s buffer with the length of the received data specified in the global integer dlpi_data_cnt Any received control information is read into the dlpi_ctl_buf global with its length specified in global integer dlpi_ctl_cnt Receiving U Frames U frames XIDs TESTs and unnumbered information U frames can be exchanged once the stream has been attached and bound or when a connection has been established Five return codes are used to signal the delivery of U frames DLPIAPI_XID_IND DLPIAPI_XID_CON DLPIAPI_TEST_IND DLPIAPI_TEST_CON and DLPIAPI_UIC_IND These are described later To receive U frames the corresponding input flags bit must be set ReturnXID ReturnTEST or ReturnUIC If the corresponding flags bit is not set an attempt is made to deliver the U frame using a U frame handler Your application may set up a U frame handler using DLPI API GuipE 159 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC First fragment in U Frame Middle U Frame Fragments Last Fragment in U Frame 160 DLPI API GUIDE dlpi_set_unnum_frame_handler If a U frame handler has not been specified the U frame is silently discarded Your application buffer might not be large enough to hold the U frame If so the U frame is delivered in fragments one per call on dlpi_rcv to your application In the first U frame fragment DLPIAPIMOREDATA is set in out_code The return value corresponds to the
8. 178 DLPI API GUIDE APRIL 2003 GcoM INC dlpi_send_disconnect_req Prototype Include File s Description Parameters Return APRIL 2003 DLPI_SEND_DISCONNECT_REQ int dlpi_send_disconnect_req int dlpi_data int reason lt gcom dlpiapi h gt lt gcom npi h gt lt gcom npi_ext h gt This routine formats and sends a disconnect request primitive DL_DISCONNECT_REQ to DLPI Any XIDs TESTs unnumbered information U frames and data messages are discarded while disconnecting Your application is responsible for reading the response dlpi_data reason lt 0 gt 0 stream file ID over which to send the DL_DISCONNECT_REQ This is the file descriptor returned by an open call on the dev dlpi_clone file Typically your application previously used DLPI API procedures to attach a PPA bind a DLSAP and listen for or initiate a connection However these steps are not required The code to go into the dl_reason field of the DL_DISCONNECT_REQ Valid codes include the following DL_DISC_NORMAL_ CONDITION Normal release of a data link connection DL_DISC_ABNORMAL CONDITION Abnormal release of a data link connection DL_DISC_PERMANENT_CONDITION A permanent condition caused the rejection of a connect request DL_DISC_TRANSIENT_CONDITION A transient momentary condition caused the rejection of a connect request DL_DISC_UNSPECIFIED Reason unspecified See DLPI API Library Routine Error Ret
9. Connection indication value Zero implies connect and one implies listen The service mode which can be DL_CODLS indicating connection oriented service or DL_CLDLS indicating connectionless service This parameter is unsupported at this time and should be set to zero A non zero value would indicate connection management This parameter is ignored See for a complete list of the possible error return values Success This is set to the size of the successful bind request DLPI API GUIDE 175 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_send_connect_req Prototype Include File s Description Parameters Return 176 DLPI API GUIDE int dlpi_send_connect_regq int dlpi_data unsigned long peer_sap lt gcom dIpiapi h gt This routine formats and sends a DLPI connect request in a connection oriented environment dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file peer_sap Address of the peer to which you wish to be connected lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Success APRIL 2003 GcoM INC DLPI_SEND_CONNECT_RES dlpi_send_connect_res Prototype int dlpi_send_connect_res int dlpi_data ulong correlation ulong dlpi_token Include File s lt gceom dlpiapi h gt Description This routine formats and sends a con
10. P REFACE About This Guide Purpose of This Guide This guide is written for C programmers who intend to transfer data between local and remote peers in a UNIX STREAMS environment using a data link layer protocol The data and other messages are passed to the streams based Data Link Provider Interface DLPI by making calls to routines contained in the GCOM s DLPI Application Program Interface API Library Knowledge Requirements APRIL 2003 You should be familiar with the OSI Reference Model terminology OSI Data Link Services and the implementation of UNIX STREAMS that your application is using You must also be proficient with the C programming language and have specific knowledge of the data link layer protocol that your application is using to transfer data GCOM implements a subset of the DLPI standard that is fully described in Univel s STREAMS Modules and Drivers Manual universal part number 10000203 Contact Univel a division of Novell at Univel 2180 Fortune Drive San Jose CA 95131 U S A 408 473 8788 The C programming language is described in Kernighan and Ritchie s The C Programming Language For an understanding of the data link layer protocols GCOM recommends reading Uyless Black s book entitled Data Link Protocols 1993 by PTR Prentice Hall Inc ISBN 0 13 204918 X DLPI API GUIDE 17 PREFACE Organization of This Guide GcoM INC Table 1 shows the organization of this manua
11. data are transferred and the connection is torn down A connection offers the advantage of reliable data delivery across the network in its original sequence with no missing or duplicate frames packets and no bit errors It is also flow controlled That is the connection itself has a flow control mechanism at the protocol level normally implemented using sequence numbers acknowledgements and windows within the definition of a frame level connection For successful connection oriented data transfer to occur over DLPI your application must achieve the following three phases e Setup the connection e Exchange data e End the session DLPI API GUIDE 85 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCOM INC Normal Connection Establishment for HDLC SDLC The connection establishment service establishes a data link connection between a local DLS user and a remote DLS user Only one data link connection is allowed on each stream In the connection establishment model the calling DLS user initiates connection establishment while the called DLS user waits for incoming requests DL_CONNECT_REQ requests that the DLS provider establish a connection DL_CONNECT_IND informs the called DLS user of the request which may be accepted using DL_CONNECT_RES or using DL_DISCONNECT_REQ DL_CONNECT_CON informs the calling DLS user that a requested connection has been established Figure 32 below illustrates the normal sequence of connection messages
12. detach service 51 dlpi_send_disconnect_req described 179 DLS provider user release for HDLC SDLC secondary 103 DLS provider user simultaneous conn release 78 DLS user aborts conn req after HDLC SDLC SNRMCE sent 96 DLS user aborts conn req after LAPB D amp LLC II SABM E sent 74 DLS user connection rejection 71 DLS user connection retraction 73 DLS user retracts connection request 95 DLS user simultaneous release for HDLC SDLC 99 DLS user provider release for HDLC SDLC primary 102 DLS user invoked connection release 75 DLS user invoked release for HDLC SDLC primary 97 DLS user invoked release for HDLC SDLC secondary 98 DLS user invoked simultaneous conn release 76 dlpi_send_info_reqQ described 180 local info reporting svc 47 dlpi_send_reset_req described 172 181 DLS user connect reset for HDLC SDLC primary 105 APRIL 2003 DLS user simultaneous connect reset for HDLC SDLC 107 DLS user invoked conn reset 80 simultaneous DLS user connection reset 81 dlpi_send_reset_res described 177 182 DLS provider invoked conn reset 82 DLS user connect reset for HDLC SDLC primary 105 DLS user invoked conn reset 80 dlpi_send_stats_reqQ described 183 dlpi_send_test_req described 184 TEST connection mode service 69 TEST service 60 TEST transfer for HDLC SDLC 90 dlpi_send_test_res described 185 dlpi_send_uic described 186 U frame data exchange 58 U frame xfer connection service
13. nm DISC 4 HDLC SDLC DM G T HDLC SDLC Protocol lt Protocol Primary Secondary dlpi_disconnect_req can also substitute for events 1 and 8 Wait for Poll DISC Figure 47 Simultaneous DLS User and DLS provider invoked connection release for HDLC SDLC primary 102 DLPI API GUDE APRIL 2003 GcoM INC CONNECTION RELEASE SERVICES FOR HDLC SDLC Simultaneous DLS User and DLS Provider Invoked Connection Release for HDLC SDLC Secondary Figure 48 below shows that when the remote DLS provider and the local DLS user simultaneously invoke the connection release service the remote DLS user receives a DL_DISCONNECT_IND primitive Application dlpi_rcv DLPI API Library Application dlpi User Level dlpi_rcv or i dlpi_complete_req end_disconnect_req DLPI API Library 2 DL_DISCONNECT_REQ DL_DISCONNECT_IND O DL_OK_ACK Kernel De cDISCONNECT REQ E ernel Leve DLPI DLPI Provider Provider G DISC 2 gt HDLC SDLC DM 4 t HDLC SDLC Protocol Protocol Primary Secondary dlpi_disconnect_req can also substitute for events 1 and 7 Wait for poll disconnect received Events are uncoupled after this point Figure 48 Simultaneous DLS user and DLS provider APRIL 2003 invoked connection release for HDLC SDLC seco
14. transfer and connection release This phase enables a DLS user to initialize a stream for use in communication and establish an identity with the DLS provider This phase enables two peer DLS users to establish a data link connection between them to exchange data Typically one user the calling DLS user initiates the connection establishment procedures while another user the called DLS user waits for the incoming connect request The called DLS user is identified by an address associated with its stream as will be discussed in DLPI Addressing on page 33 Note GCOM s implementation of DLPI allows both peers to initiate the connection A called DLS user can either accept or deny a request for a data link connection If the request is accepted a connection is established between the DLS users and they enter the data transfer phase For both the calling and called DLS users only one connection can be established per stream Thus the stream is the communication endpoint for a data link connection In this phase the DLS users are considered peers and may exchange data simultaneously in both directions full duplex over an established data link connection Either DLS user can send data to its peer DLS user at any time Data sent by a DLS user is guaranteed to be delivered to the to the remote user in the order in which it was sent This phase enables either the DLS user or the DLS provider to break an established connectio
15. 12 3 5 10 SABM E 4 gt LAPB D amp LLC II UA 11 LAPB D amp LLC II Protocol lt Protocol dipi_reset_req can also substitute for events 1 and 14 f dipi_reset_res can also substitute for events 8 and 11 Figure 29 DLS user invoked connection reset for LAPB LAPD and LLC II 80 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION RESET SERVICES FOR LAPB LAPD AND LLC II Simultaneous DLS User Invoked Connection Reset Figure 30 below illustrates the message flow for a reset invoked by both DLS users simultaneously Application Application O dlpi_send_reset_req User Level dlpi_send_reset_req dlpi_rcv or dlpi_rcv or dlpi_complete_req dlpi_complete_req DLPI API DLPI API Library Library DL_RESET_REQ 2 DL_RESET_REQ 2 DL_RESET_CON 6 DL_RESET_CON Kernel Level DLPI Provider SABM E 4 a gt LAPB D amp LLC II SABM E 4 LAPB D amp LLC II Protocol lt Protocol dlpi_reset_req can also substitute for events 1 and 7 Figure 30 Simultaneous DLS user invoked connection reset for LAPB LAPD and LLC II APRIL 2003 DLPI API GUE 81 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GCOM INC DLS Provider Invoked Connection Reset Figure 31 below illustrates the message flow for a reset invoked by the DLS provider pplication E
16. 2003 handler Specify NULL to disable dlpi_set_unnum_frame_handler Otherwise handler specifies an application routine The specified handler applies to all DLPI streams that the process is using However there is not a table that associates FIDs to handlers lt 0 Failure gt 0 The TEST request was successfully sent DLPI API GUIDE 193 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_test_req Prototype Include File s Description Parameters Return 194 DLPI API GUDE int dlpi_test_req int dlipi_data unsigned long pfb char datap int length lt gcom dIpiapi h gt This routine sends a DL_TEST_REQ dlpi_data s file ID This is the file descriptor returned by a call to dlpi_open pfb If non zero poll final bit will be set in the request datap Pointer to a user supplied buffer of data to send with the request length Length of the buffer at datap lt 0 Request failed See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Sent APRIL 2003 GcoM INC dlpi_test_res Prototype Include File s Description Parameters Return APRIL 2003 DLPI_SET_UNNUM_FRAME_HANDLER int dlpi_test_res int dlpi_data unsigned long pib char datap int length lt gcom dlpiapi h gt This routine sends a DL_TEST_RES the response toa DL_TEST_IND dlpi_data streams file ID This is the fi
17. 22 DLS provider connection rejection for LAPB LAPD and LLC II 72 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION RETRACTION SERVICES FOR LAPB LAPD AND LLC II Connection Retraction Services for LAPB LAPD and LLC II APRIL 2003 The next two figures show scenarios where the calling DLS user chooses to abort a previous connection attempt That is the DLS user issues a disconnect request after a connect request The resulting sequence of events depends on the relative timing of the DLPI primitives involved User Retracts Connection Request Figure 23 below shows a scenario where the retraction occurs before the local DLS provider can send a SABM E to the remote DLS provider Application dpi dlpi_send_connect_req Ipi_rcv or dlpi_complete_req 4 dlpi_send_disconnect_req DLPI API Library A 2 DL_CONNECT_REQ DL_OK_ACK 5 DL_DISCONNECT_REQ to DL_DISCONNECT_REQ DLPI Provider LAPB D amp LLC I Protocol Figure 23 User retracts connection request for LAPB LAPD and LLC II DLPI API GUDE 73 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GCcoM INC DL_DISCONNECT _IND Arrives After DL_CONNECT_RES is Sent Figure 24 below shows a scenario where the calling DLS user chooses to abort a previous connection attempt That is the DLS user issues a disconnect request after a connect request The resulting sequence of events de
18. 52 Figure 11 53 Figure 12 58 Figure 13 59 Figure 14 60 Figure 15 66 Figure 16 67 Figure 17 68 Figure 18 69 Figure 19 70 Figure 20 71 Figure 21 12 Figure 22 73 Figure 23 74 Figure 24 DLPI provider DLPI architecture DLPI architecture repeated Data Link addressing components Reference model Reference model repeated Information reporting for all frame level protocols Open services for all frame level protocols Attaching a stream to a physical line for all frame level protocols Detaching a stream from a physical line for all frame level protocols Binding a stream to a DLSAP all frame level protocols Unbinding a stream from a DLSAP for all frame level protocols Connectionless data transfer for frame relay LAPB LAPD LLC II and HDLC SDLC XID service for connectionless mode LAPB LAPD LLC II and HDLC SDLC TEST service for connectionless mode LAPB LAPD LLC II and HDLC SDLC Successful connection establishment for LAPB LAPD and LLC II Normal data transfer for LAPB LAPD and LLC II XID service for connection oriented LAPB LAPD and LLC II TEST service for connection oriented LAPB LAPD and LLC II Unnumbered Information U Frame Data Transfer Service for LAPB LAPD and LLC II Called DLS user connection rejection for LAPB LAPD and LLC II DLS provider connection rejection for LAPB LAPD and LLC II User retracts connection request for LAPB LAPD and LLC II DL_DISCONNECT_IND arrives after DLPI API
19. 71 used by dlpi_connect 134 dlpi_connect_wait called upon XID TEXT or UI U frame 193 dlpi_ctl_buf size of DLPI_CTL_BUF_SIZE 117 dlpi_ctl_buf global variable 121 DLPLCTL_BUF_SIZE constant 117 DLPI_CTL_BUF_SIZE passed in dlpi_ctl_buf 121 dlpi_ctl_cnt global variable 122 dlpi_data parameter defined 127 dlpi_data_buf size of DLPI_ DATA_BUF_SIZE 117 dlpi_data_buf global variable 122 DLPLDATA_BUF_SIZE constant 117 DLPI_DATA_BUF_SIZE in dlpi_data_buf 122 dlpi_data_cnt global variable 122 dlpi_decode_ctl described 138 dlpi_decode_disconnect_reason described 139 DLPILDEFAULT_PPA constant 117 dlpi_detach_ppaQ detach service 51 dlpi_discon_req described 141 dlpi_disconnect_req described 142 DLS provider user release for HDLC SDLC secondary 103 DLS user simultaneous release for HDLC SDLC 99 DLS user provider release for HDLC SDLC primary 102 DLS user invoked connection release 75 DLS user invoked release for HDLC SDLC primary 97 APRIL 2003 INDEX DLS user invoked release for HDLC SDLC secondary 98 DLS user invoked simultaneous conn release 76 dlpi_get_a_msg described 143 dlpi_get_info_strmQ described 145 info reporting service 46 dlpi_get_style_strm described 146 dlpi_initQ described 147 receives DLPI_ logging options 119 use before opening connectionless session 58 dipi_init_FILEQ described 148 dlpi_listenO connection establishment 66 connection establishment for HD
20. Connection Retraction for HDLC SDLC APRIL 2003 The next subsections show scenarios where the calling DLS user chooses to abort a previous connection attempt That is the DLS user issues a disconnect request after a connect request The resulting sequence of events depends on the relative timing of the DLPI primitives involved User Retracts Connection Request Figure 40 below shows a situation where the retraction takes place before a SNRM E can be sent to the remote DLS provider Application dlpi_send_connect_req dlpi_rcv or dlpi_complete_req S dlpi_send_disconnect_req DLPI API Library 2 DL_CONNECT_REQ DL_OK_ACK G DL DISCONNECT REQ to DL_DISCONNECT_REQ DLPI Provider HDLC SDLC Protocol Primary Secondary Figure 40 User retracts connection request for HDLC SDLC DLPI API GUDE 95 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCOM INC DL_DISCONNECT _IND Arrives After DL_CONNECT_RES is Sent Figure 41 shows a scenario where the calling DLS user chooses to abort a previous connection attempt That is the DLS user issues a disconnect request after a connect request The resulting sequence of events depends on the relative timing of the DLPI primitives involved Figure 41 shows a situation where both primitives are destroyed by the provider Figure 41 DL_DISCONNECT_IND Arrives After DL_CONNECT_RES is Sent for HDLC SDLC The follow
21. Description Parameters Return 174 DLPI API GUIDE int dlpi_send_attach_req int dlpi_data unsigned long ppa lt gcom dlpiapi h gt This routine sends an attach request to the DLPI provider Your application is responsible for reading the response For example you might want to use dlpi_complete_regq to read the response This request is legal only in the DL_UNATTACHED state dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file ppa If this is negative itis an LPA Otherwise it is a streams multiplexor ID lt 0 See for a complete list of the possible error return values gt 0 Successfully sent APRIL 2003 GcoM INC dlpi_send_bind_req Prototype Include File s Description Parameters Return APRIL 2003 DLPI_SEND_BIND_REQ int dlpi_send_bind_req int dlpi_data unsigned long dlsap int conind_nr int service_mode int conn_mgmt int auto_flags lt gcom dlpiapi h gt lt gcom dlpi h gt lt gcom dlpi_ext h gt This routine sends a DL_BIND_REQ primitive to the DLPI provider Your application is responsible for reading the response This request is legal only in the DL_LUNBOUND state dlpi_data dlsap conind_nr service_mode conn_mgnt auto_flags lt 0 gt 0 stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file DLSAP address to be bound to the stream
22. Handling Prototype 121 Global Variables Accessible By Your Application 121 dlpi_bind_ack 121 dlpi_conn_con 121 dlpi_conn_ind 121 dlpi_ctl_buf 122 dlpi_ctl_cnt 122 dlpi_data_buf 122 dlpi_data_cnt 123 DLPI API Fork Options 114 DLPI API GUDE APRIL 2003 GcoM INC APRIL 2003 DLPI API Gume 115 9 UNDERSTANDING THE DLPI API HEADER FILE GCOM INC The dlpiapi h file contains defines global variables and prototypes that can be used by the application program to communicate with the GCOM DLPI streams driver Including the dlpiapi h Header File in Your Application Prototypes for the API procedures and callbacks as well as various useful macros and definitions of symbolic constants are contained in the dipiapi h header file This header files should be included in application source files containing code that interacts with the API Linking DLPI Header Files To link the header files with a program issue the UNIX cc command using the following format cc o program_name program_name c usr lib gcom dIpiapi a Example The following command links header files for the foo program gt cc o foo foo c usr lib gcom dlpiapi a 116 DLPI API GUIDE APRIL 2003 GcoM INC LINKING DLPI HEADER FILES DLPI API Constants The following constants parameterize the internal behavior of the DLPI API library These constants were used when the library was compiled Changing these in your application will not have the desired eff
23. Level dlpi_rcv or dlpi_complete_req DLPI API Library DLPI API Library DL_CONNECT_IND 9 DL_DISCONNECT_REQ 2 DL_CONNECT_REQ DL_DISCONNECT_IND 73 Kernel Level DL_OK_ACK 10 DLPI Provider DLPI Provider D G p T SNRM E 4 HDLC SDLC DM 11 HDLC SDLC Protocol Protocol Primary Secondary dlpi_connect performing open attach and bind can substitute for events 1 and 14 dlpi_connect_req can also substituted for events 1 and 14 Figure 38 Called DLS user connection rejection for HDLC SDLC DLPI API GUDE 93 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCcoM INC 94 DLPI API GUIDE DLS Provider Connection Rejection In Figure 39 below the DLS provider rejects a connect request for lack of resources or other reasons The DLS provider sends DL_DISCONNECT_IND in response to the connect request Application dlpi_rcv or dipi_complete_req 4 dlpisend_connect_req ae DLPI API Library DL_DISCONNECT_IND DL_CONNECT_REQ DLPI Provider HDLC SDLC Protocol Primary Secondary dlpi_connect performing open attach and bind can substitute for event 1 dlpi_connect_req can also substitute for event 1 Figure 39 DLS provider connection rejection for HDLC SDLC APRIL 2003 GcoM INC CONNECTION RETRACTION FOR HDLC SDLC
24. application previously used DLPI API procedures to attach a PPA bind a DLSAP and listen for or initiate a connection However these steps are not required The code to go into the dl_reason field of the DL_DISCONNECT_REQ Valid codes include the following DL_DISC_NORMAL_ CONDITION Normal release of a data link connection DL_DISC_ABNORMAL_ CONDITION Abnormal release of a data link connection DL_DISC_PERMANENT_CONDITION A permanent condition caused the rejection of a connect request DL_DISC_TRANSIENT_CONDITION A transient momentary condition caused the rejection of a connect request DL_DISC_UNSPECIFIED Reason unspecified A failure to read write on the stream occurred See for a complete list of the possible error return values Disconnect successful APRIL 2003 GcoM INC dlpi_get_a_msg Prototype Include File s Description Parameters Return APRIL 2003 DLPI_GET_A_MSG int dlpi_get_a_msg int dlpi_data char buf int GNE lt gcom dlpiapi h gt lt gcom dlpi h gt lt gcom dlpi_ext h gt This routine issues a getmsg system call on the indicated stream The M_PROTO portion of the received message is read into the global array dlpi_ctl_buf and dlpi_ctl_cnt gives its length negative if no M_PROTO portion received The data portion is read into your buffer The number of data bytes read is contained in the global dlpi_data_cnt upon return from the routine negative if no data po
25. as LAPB LAPD HDLVC and Frame Relay The GCoM CDI API library interfaces to GCOM s synchronous protocol drivers directly for raw frame access Goom API Libraries LUO API LU62 API NPI API DLPI API CDI API Gcom Remote API RAPD Client Server Model Application System Geom Protocol Appliance RAPI Client RAPI Server RPC Server The Remote API is intended for use in a client server environment The user s application program linked with the GCOM RAPI library runs on the client system The server system is typically a GCOM Protocol Appliance It contains the communication hardware protocol software and the Remote API server DLPI API GUIDE 24 GcoM INC APRIL 2003 ie IMPORTANT RELATED FILES Running the RAPI Server The GCOM Remote API server is named Gcom_rapisvr It is usually unnecessary to run this program with any arguments By default the program runs in the background It can be run from the command line or from a shell script It is common to run Gcom_rapisvr under root from an rc script However if permissions are set appropriately on the files that are to be accessed remotely it is perfectly possible to run Gcom_rapisvr from a non root user id Note Additional information on GCOM RAPI arguments authentication and other API routines can be found by accessing the GCOM RAPI white paper on the www gcom com web site Using the RAPI Library In order to utilize the GCOM RAP
26. char addr_ptr int addr_len lt gcom dlpiapi h gt This routine sends a TEST request If addr_ptr is not NULL and addr_len is greater than zero the address in addr_ptr is sent as the destination address Otherwise the TEST s destination address is set to NULL dlpi_data pfb datap length addr_ptr addr_len lt 0 gt 0 stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file Poll Final bit Pointer to the data for the TEST primitive Length of data pointed to by datap Pointer to an address Length of the address pointed to by addr_ptr Failure See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values The TEST request was successfully sent APRIL 2003 GcoM INC dlpi_send_test_res Prototype Include File s APRIL 2003 Description Parameters Return DLPI_SEND_TEST_REQ int dlpi_send_test_res int dlpi_data ulong pfb char datap int length unsigned char addr_ptr int addr_len lt gcom dIpiapi h gt This routine sends a TEST response If addr_ptr is not NULL and addr_len is greater than zero the address in addr_ptr is sent as the destination address Otherwise the TEST s destination address is set to NULL dlpi_data pfb datap length addr_ptr addr_len lt 0 gt 0 stream file ID This is the file descriptor returned by an open call on th
27. dlpi_attach_ppa can be substituted for events 1 and 4 Figure9 Attaching a stream to a physical line for all frame level protocols DLPI API GUDE 50 GcoM INC ATTACH DETACH LOCAL SERVICES Detach A Physical Point of Attachment PPA can be disassociated with a stream using the dlpi_send_detach_req routine A detach request is only valid when the stream is attached to the PPA but not bound DL_UNBOUND a Note GCOM suggests unbinding and detaching using the dlpi_close command The normal sequence of events is illustrated in Figure 10 Application dlpi_rcv or dipi_complete_req dlpi_send_detach_req DLPI API Library DL_OK_ACK 3 2 DL_DETACH_REQ DLPI Provider Any Frame Level Protocol dlpi_detach_ppa can be substituted for events 1 and 4 Figure 10 Detaching a stream from a physical line for all frame level protocols APRIL 2003 DLPI API GUIDE 51 GcoM INC BIND UNBIND SERVICES Bind Unbind Services The bind service associates a Data Link Service Access Point DLSAP with a stream Bind The dlpi_bind_dlsap or dlpi_send_bind_req routine requests that the DLS provider bind a DLSAP to a stream It also notifies the DLS provider to make the stream active with respect to the DLSAP for processing connectionless data transfer and connection establishment requests The DLS provider indicates success with a DL_BIND_ACK and failu
28. information U frames described later may also be received in fragments when your application buffer is too small For the U frames the first fragment in the frame is returned with the corresponding event code while the remaining fragments are returned with the DLPIAPI_DATA event code DLPIAPL DATA ACK Reserved for Future Use DLPI API GUIDE 165 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC Return Values continued Positive protocol message DLPIAPI_LATTACHED event codes DI_PIAPI DETACHED DLPIAPI_BOUND DLPIAPI_UNBOUND These four event codes are received by your application only when it is explicitly attaching binding or detaching unbinding The DLPI API primitives used for these functions wait for the response from the DLPI Provider For further information refer to dlpi_attach_ppa dpi_send_attach_req dlpi_send_unbind_req dlpi_bind_dlsap dlpi_send_bind_req and dlpi_send_detach_req DLPIAPI_DISC_IND If the AutoConnect flags bit is set when a DL_DISCONNECT_IND protocol message is received a connect request is returned to the DLPI provider and dlpi_rcv reads again waiting for a response to the connect request E Note The API sleeps for one second after sending the connect request to prevent extended buzz loops If the AutoListen flags bit is set instead when a DL_DISCONNECT_IND protocol message is received dlpi_rcv reads again waiting for a connect indication or U frames If AutoConnec
29. read while the global variable dlpi_ctl_cnt contains the number of control bytes strm The stream from which to get data and control bytes ctrl_ptr Points to the dlpi_ctl_buf char pointer data_ptr Points to the dlpi_data_buf char pointer lt 0 An error occurred message optionally written to log file See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt Success gt 0 MOREDATA and or MORECTL bit set as described previously APRIL 2003 Gcom INC dlpi_get_info_strm Prototype int dlpi_get_info_strm int dlpi_data char ptr Include File s lt gcom dlpiapi h gt Description This routine requests default information from the DLPI provider and waits for the response The information is obtained pertaining to the stream represented by the file descriptor that is passed in as a parameter Upon successful return the user s buffer contains a dl_info_ack_t structure containing the information Parameters dlpi_data Open stream file descriptor to the DLPI Provider ptr Application s buffer Return lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Information returned This is the size of the message pointed to by ptr APRIL 2003 DLPI API GUIDE 145 GcoM INC dlpi_get_style_strm Prototype int dlpi_get_style_strm int dlpi_data Incl
30. type of U frame received XID TEST or unnumbered information U frame In fragments that occur after the first and before the last fragment DLPIAPI_MOREDATA is set in out_code and the return value is set to DLPIAPI_DATA In the last fragment in a segmented U frame DLPIAPIMOREDATA is not set in out_code and the return value is set to DLPIAPL DATA Non Blocking I O Non blocking I O is partially supported That is non blocking I O is supported in the sense that if getmsg returns 1 and if errno equals EAGAIN DLPIAPI_EAGAIN is returned Non blocking I O is enabled by setting the O_NDELAY flag which called the O_NONBLOCK flag for POSIX compatibility see the fcntl UNIX system call Your application must recover from any write calls to the putmsg command that defer because non blocking I O is set on the stream If the AutoConnect AutoReset or AcceptConnect flags bit is set the API generates DLPI protocol messages in response to specific DLPI protocol messages If your application has specified non blocking I O on the data stream then an API attempt to send such a message may fail The API does not have access to a retry mechanism That is if your applications using non blocking I O these flags should not be used Your application may use d pi_send_reset_res dlpi_send_connect_res and dlpi_send_connect_req in response to connection oriented events APRIL 2003 GcoM INC APRIL 2003 Parameters dlpi_data data_
31. your application has not requested this service the U frame is silently discarded DLPIAPIL UIC_ERROR_IND Reserved for Future Use APRIL 2003 GcoM INC dlpi_rcv_msg Prototype Include File s APRIL 2003 Description Parameters DLPIL_RCV int dlpi_rcv_msg int dlipi_data char data_ptr int data_cnt int flags 4 lt gcom dIpiapi h gt This routine dlpi_data stream from which to read data data_ptr Buffer to which to read the data bfr_len Maximum number of bytes to read flags Flags controlling the behavior of dlpi_rcv_msg A bitwise OR of the following options AutoReset If a reset indication is received this procedure will complete the reset sequence then will return a DL_OK_ACK for a DL_RESET_CON when completed Failure to complete the reset sequence will be indicated with a DL_LERROR_ACK for a DL_RESET_REQ RetryOnSignal If the getmsg system call is interrupted with a signal and this flag is set the getmsg will be tried again DISC_CONNECT If specified respond to a DL_DISCONNECT_IND by initiating a connect request The peer_sap specified in the most recent dlpi_send_connect_req or dlpi_connect_req is used Note that only one peer_sap is saved per process A peer_sap 1s NOT saved for each connected stream Failure will be indicated with a DL_ERROR_ACK of a connect primitive DISC_LISTEN If specified respond to a DL_DISCONNECT_IND by listening for an incoming connect indica
32. 08 14 33 Hello world fmt Format string compatible with UNIX printf function Additional arguments to print optional APRIL 2003 GcoM INC DLPI_PRINTF dlpi_put_both Prototype int dlpi_put_proto int dlpi_data char hdr_ptr int hdr_lgth char data_ptr int data_lgth Include File s lt gceom dlpiapi h gt Description This routine sends a message with both control and data parts Generally this routine will only be used internally but it is presented here in the event that an application may need this functionality Parameters dlpi_data stream to which to write protocol message hdr_ptr Pointer to the control part of the message May be null if hdr_Igth is lt 0 hdr_Igth Length of the data pointed to by hdr_ptr data_ptr Pointer to the data part of the message May be null if data_lgth is lt 0 data_lgth Length of the data pointed to by data_ptr Return lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Return value from the UNIX putmsg call APRIL 2003 DLPI API GuIDE 157 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_put_proto Prototype int dlpi_put_proto int dlpi_data int lgth Include File s lt gceom dlpiapi h gt Description This routine writes a prototype message to the DLPI driver on the given stream The prototype message is assumed to have been built in the global array dlpi_ctl_
33. 4 SECTION Connectionless Services 57 Understanding Connectionless Data Transfer 58 Beginning a Session Open Attach and Bind 58 Exchanging Data in Connectionless Mode 59 Transferring TEST and XID U Frames 59 XID Service 60 TEST Service 61 Closing a Connectionless Session APRIL 2003 DLPI API GUIDE 55 5 CONNECTIONLESS SERVICES GCOM INC 56 DLPI API GUIDE APRIL 2003 GcoM INC UNDERSTANDING CONNECTIONLESS DATA TRANSFER Understanding Connectionless Data Transfer Once a stream has been initialized using the local management services it can be used to send and receive connectionless data units What Connectionless data transfer implies that there is no connection Data are simply shipped through the circuit without the guaranteed expectation that it will arrive correctly on the other end There is nothing that guarantees the safe delivery of data by all parts of the transport mechanism such as the wire or the network or that the data will be delivered in its original sequence without duplicated frames It is up to the client to detect and correct lost data However checksums will detect most bit errors over synchronous lines Furthermore connectionless data transfer has no DLS Provider to DLS Provider flow control That is there is internal flow control that prevents the system from being flooded with data but there is no peer to peer flow control Why GCOM supports connectionless data transfer to e C
34. 70 UI U frame transfer for HDLC SDLC primary 91 UI U frame transfer for HDLC SDLC secondary 92 dlpi_send_unbind_reqQ described 187 unbind service 53 dlpi_send_xid_reqQ described 188 189 XID connection mode service 68 XID service 59 XID transfer for HDLC SDLC 89 dlpi_send_xid_res XID connection mode service 68 XID service 59 XID transfer for HDLC SDLC 89 dlpi_service_mode global variable 122 dlpi_set_log_sizeQ DLPI API GUIDE 209 INDEX described 190 dlpi_set_signal_handling described 191 dlpi_set_unnum_frame_handler described 193 dipi_sig_func_t structure definition 191 dipi_sig_func_t signal handling prototype 120 dlpi_test_reqQ described 194 dlpi_test_res described 195 dipi_token parameter defined 177 dlpi_uic_reqQ described 196 dlpi_unbind_dlsapQ described 197 unbind service 53 dlpi_write_dataQ connection mode data xfer 67 data xfer for HDLC SDLC 88 described 200 dlpi_xid_reqQ described 198 dlpi_xid_res described 199 dlpiapi a described 23 linking 116 dlpiapi h contains defines globals and prototypes 116 described 23 including 110 including it in your application 116 DLPIAPL_ errors defined 118 DLPIAPI_ return codes partial list w definitions 161 DLPIAPI_ATTACHED return code for dlpi_rcvO 166 DLPIAPI_BOUND return code for dlpi_rcv 166 DLPIAPI_CONNECT_COMPLETE return code for dlpi_rev 167 210 DLPI API GUDE GcoM INC DLPIAPI_CONNECT_
35. 9 80 81 82 83 85 86 88 89 89 90 91 92 93 93 94 95 95 96 97 97 98 99 100 101 102 103 104 105 106 Simultaneous DLS User Invoked Connection Release DLS Provider Invoked Connection Release Simultaneous DLS User and DLS Provider Invoked Connection Release Connection Reset Services for LAPB LAPD and LLC II DLS User Invoked Connection Reset Simultaneous DLS User Invoked Connection Reset DLS Provider Invoked Connection Reset HDLC SDLC Connection Oriented Services Understanding Connection Oriented Data Transfer Normal Connection Establishment for HDLC SDLC Normal Data Transfer for HDLC SDLC U Frame Service for HDLC SDLC XID Service TEST Service Connection Oriented Unnumbered Information U Frame Service for HDLC SDLC Primary Connection Oriented Unnumbered Information U Frame Service for HDLC SDLC Secondary Connection Establishment Rejections for HDLC SDLC Called DLS User Connection Rejection DLS Provider Connection Rejection Connection Retraction for HDLC SDLC User Retracts Connection Request DL_DISCONNECT_IND Arrives After DL_CONNECT_RES is Sent Connection Release Services for HDLC SDLC DLS User Invoked Connection Release for HDLC SDLC Primary DLS User Invoked Connection Release for HDLC SDLC Secondary Simultaneous DLS User Invoked Connection Release DLS Provider Invoked Connection Release for HDLC SDLC Primary DLS Provider Invoked Connection Release for HDLC SDLC Sec
36. Attachment Identification 34 Data Link User Identification APRIL 2003 DLPI API GUIDE 26 GcoM INC IMPORTANT RELATED FILES DLS User A Request Response Routines DLPI Indication Confirmation Routines y Data Link Interface DLS Provider Services Figure2 DLPI architecture APRIL 2003 DLPI API GUIDE 27 GcoM INC MODEL OF THE SERVICE INTERFACE The data link layer layer two in the OSI Reference Model is responsible for the transmission and error free delivery of bits of information over a physical communication medium The data link layer can be used in both a connection oriented and connectionless environment The model of the data link layer is presented here to describe concepts that are used throughout this document The model is described in terms of an interface architecture addressing concepts required to identify different components of that architecture The description of the data link layer model assumes familiarity with the OSI Reference Model Model of the Service Interface APRIL 2003 Each layer of the OSI Reference Model has two standards One that defines the services provided by the layer One that defines the protocol through which layer services are provided Figure 2 shows an abstract view of the DLPI architecture The data link interface is the boundary between the network and data link layers of the OSI Reference Model The network layer entity is the us
37. CON 7 Kernel Level DLPI Provider O TEST Command 4 z LAPB D amp LLC II TEST Response G LAPB D amp LLC II Protocol lt Protocol dlpi_read_data can also substitute for events 7 and 14 if you are using the unnumbered frame handler routine Figure 15 TEST service for connectionless mode LAPB LAPD LLC I and HDLC SDLC 60 DLPI API GUIDE APRIL 2003 GcoM INC CLOSING A CONNECTIONLESS SESSION Closing a Connectionless Session To unbind detach and close use the dlpi_close command which is documented in your UNIX system administrator s manual Your application would seldom need to explicitly detach and unbind a session However the DLPI API Library supplies such routines if you want to use them APRIL 2003 DLPI API GUIDE 61 5 CONNECTIONLESS SERVICES GCOM INC 62 DLPI API GUIDE APRIL 2003 APRIL 2003 SECTION LAPB LAPD and LLC II Connection Oriented Services 65 66 67 68 68 69 70 71 71 72 73 73 74 75 75 76 77 78 79 80 81 82 Understanding Connection Oriented Data Transfer Normal Connection Establishment for LAPB LAPD and LLC II Normal Data Transfer for LAPB LAPD and LLC II U Frame Services for LAPB LAPD and LLC II XID Service TEST Service Connection Oriented Unnumbered Information U Frame Data Transfer Service Connection Establishment Rejections for LAPB LAPD and LLC II Called DLS User Connection Rejection DLS Provider Connect
38. D Response 11 gt HDLC SDLC Protocol lt Protocol Primary Secondary dlpi_read_data can also substitute for events 7 and 14 if you are using the unnumbered frame handler routine Figure 34 XID service for connection oriented HDLC SDLC APRIL 2003 DLPI API GUDE 89 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCOM INC TEST Service The local DLS user requests that TEST command response be sent to the remote DLS user According to the DLPI specification the optional feature that allows the DLS user to request automatic handling of the TEST response at bind time is handled by the DLPI Provider GCOM s implementation makes this a required feature that is handled by the HDLC SDLC protocols in Figure 35 below Applicati pplication User Level Q alpi_send_test_req dlpi_rcv DLPI API Library 2 DL_TEST_REQ DL_TEST_CON 7 Kernel Level DLPI Provider TEST Command 4 gt HDLC SDLC TEST Response 5 HDLC SDLC Protocol lt Protocol Primary Secondary dlpi_read_data can also substitute for events 7 and 14 if you are using the unnumbered frame handler routine Figure 35 TEST service for connection oriented HDLC SDLC 90 DLPI API GUIDE APRIL 2003 GcoM INC U FRAME SERVICE FOR HDLC SDLC Connection Oriented Unnumbered Information U Frame Service for HDLC SDLC Primary Data are transmitted in logical groups called Data Link Serv
39. DE 205 INDEX secondary 106 DLS user connection reject for HDLC SDLC 93 DLS user connection rejection 71 DLS user connection retraction 73 DLS user retracts connection request 95 DLS user simultaneous connect reset for HDLC SDLC 107 DLS user simultaneous release for HDLC SDLC 99 DLS user provider release for HDLC SDLC primary 102 DLS user invoked conn reset 80 DLS user invoked connection release 75 DLS user invoked release for HDLC SDLC primary 97 DLS user invoked release for HDLC SDLC secondary 98 DLS user invoked simultaneous conn release 76 info reporting service 46 simultaneous DLS user connection reset 81 dlpi_configure_dlsaps defined 133 dipi_conn_con global variable 121 dipi_conn_ind global variable 121 dlpi_connect connection establishment 66 connection establishment for HDLC SDLC 87 connection rejection 71 described 134 DLS provider connection reject for HDLC SDLC 94 DLS provider connection rejection 72 DLS user connection reject for HDLC SDLC 93 DLS user connection rejection 71 dipi_connect_host 134 dlpi_connect_req called upon XID TEXT or UI U frame 193 connection establishment 66 connection establishment for HDLC SDLC 87 connection rejection 71 206 DLPI API GUIDE GcoM INC described 136 140 DLS provider connection reject for HDLC SDLC 94 DLS provider connection rejection 72 DLS user connection reject for HDLC SDLC 93 DLS user connection rejection
40. GUDE 11 CONTENTS 12 DLPI API GUIDE 75 76 77 78 80 81 82 86 88 89 90 91 92 93 94 95 96 97 98 99 Figure 25 Figure 26 Figure 27 Figure 28 Figure 29 Figure 30 Figure 31 Figure 32 Figure 33 Figure 34 Figure 35 Figure 36 Figure 37 Figure 38 Figure 39 Figure 40 Figure 41 Figure 42 Figure 43 Figure 44 GCOM INC DL_CONNECT_RES is sent for LAPB LAPD and LLC II DLS user invoked connection release for LAPB LAPD and LLC II Simultaneous DLS user invoked connection release for LAPB LAPD and LLC II DLS provider invoked connection release for LAPB LAPD and LLC II Simultaneous DLS user and DLS provider invoked connection release for LAPB LAPD and LLC II DLS user invoked connection reset for LAPB LAPD and LLC II Simultaneous DLS user invoked connection reset for LAPB LAPD and LLC I DLS provider invoked connection reset for LAPB LAPD and LLC II Successful connection establishment for HDLC SDLC Normal data transfer for HDLC SDLC XID service for connection oriented HDLC SDLC TEST service for connection oriented HDLC SDLC Unnumbered information u frame service for connection oriented HDLC SDLC primary Unnumbered information u frame service for connection oriented HDLC SDLC secondary Called DLS user connection rejection for HDLC SDLC DLS provider connection rejection for HDLC SDLC User retracts connection request for HDLC SDLC DL_DISC
41. G_NAME 13 a 14 fil dlpi_listen 0L 0x01L 0x00L 0x00L DLPI_LISTEN_NO_FORK eS if fil lt 0 exit 1 16 while n dlpi_read_data fil buf sizeof buf gt 0 17 18 frmst 19 if dlpi_write_data fil buf n lt 0 exit l 20 21 dlpi_printf End of test frames received d n frms 22 exit 0 23 1 APRIL 2003 DLPI API Gume 111 8 UNDERSTANDING THE SAMPLE APPLICATION GCoM INC Line 16 The program calls the dlpi_read_data function to read a single data message from the stream The function will return a negative number if a protocol message arrives or if the stream encounters an error amp Note The parameters for dipi_read_data are the same as for the standard C library read routine Line 19 The program writes back any received data to the stream in loopback fashion a Note The parameters for dlpi_write_data are the same as for the standard C library write routine Line 21 The program uses the dlpi_printf routine to write a message into the log file This routine has the same calling sequence as the C library printf routine 112 DLPI API GUDE APRIL 2003 9 UNDERSTANDING THE DLPI API HEADER FILE GCOM INC Understanding the DLPI API Header File 116 Including the dlpiapi h Header File in Your Application 116 Linking DLPI Header Files 117 DLPI API Constants 118 DLPI API Library Routine Error Return Defines 119 DLPI API Logging Options 120 Signal
42. I library it is necessary to link it into your program ahead of the libgcom library in order to link to the routines that perform the remote functions A sample command line link for this is as follows cc o foo foo o usr lib gcom dlpiapi a usr lib gcom rapi a usr lib gcom libgcom a Note Jf RAPI library is omitted then all file operations will be executed on the same machine on which the application program is running In the application program be sure to use the correct API routine to open data streams on a remote system The open routing of each of these routines is passed a parameter which is a pointer to a string which names the remote host Passing a NULL pointer or a pointer to an empty string indicates that the file is to be opened on the local machine When opening or closing DLPI protocol data streams use the functions Open routine dl pi_open Close routine dlpi_close Apart from using the specially provided open and close functions there are no other programming interface considerations for making an application utilize remote protocol services DLPI API GUDE 25 GcoM INC IMPORTANT RELATED FILES Architecture of the Data Link Layer 28 Model of the Service Interface 31 Modes of Communication 31 Connection Oriented Service 31 Local Management Phase 31 Connection Establishment Phase 31 Data Transfer Phase 31 Connection Release Phase 32 Connectionless Service 33 DLPI Addressing 33 Physical
43. IBRARY ROUTINES REFERENCE GCOM INC dlpi_bind_dlsap Prototype Include File s Description Parameters Return 128 DLPI API GuIDE int dlpi_bind_dlsap int dlpi_data unsigned long dlsap int conind_nr lt gcom dIpiapi h gt This routine issues a DL_BIND_REQ to DLPI and waits for a DL_BIND_ACK response The bind acknowledgment is copied to the global array dlpi_bind_ack so that it can be viewed directly by the application program dlpi_data stream over which to send the DL_BIND_REQ dlsap DLSAP address to be bound to the stream conind_nr Number of connection indications that can be queued for this stream If this number is non zero then the stream becomes a listener stream That is it becomes eligible as a target of in incoming connection If this number is zero then this stream cannot be the target for an incoming connection but is to be used for an outgoing connection lt 0 An error occurred gt 0 Size of DL_BIND_ACK if success APRIL 2003 GcoM INC DLPL_BIND_DLSAP dlpi_clear_zombies Prototype void dipi_clear_zombies void Include File s lt gceom dlpiapi h gt Description This routine can be used by a parent process to clean up after its children Under most Unix like operating systems when a parent process forks a child and the child exits the operating system retains status information for the child Until the parent process retrieves this status information the child pro
44. IND return code for dlpi_rev 167 DLPIAPI_DATA return code for dlpi_rev 165 DLPIAPI_DETACHED return code for dlpi_rcvQ 166 DLPIAPI_DISC_COMPLETED return code for dipi_rev 166 DLPIAPI_DISC_IND return code for dlpi_rcevO 166 DLPIAPI_ERROR_ACK return code for dipi_rev 167 DLPIAPI_INFO_ACK return code for dlpi_rcvQ 167 DLPIAPI_OK_ACK return code for dlpi_rcvO 167 DLPIAPI_OTHER return code for dlpi_rev 168 DLPIAPI_RESET_COMPLETE return code for dipi_rev 167 DLPIAPI_RESET_INDICATION return code for dipi_rev 166 DLPIAPI_TEST_CON return code for dlpi_rcvQ 168 DLPIAPI_TEST_IND return code for dlpi_rev 168 DLPIAPI_UIC_IND return code for dlpi_rcvO 168 DLPIAPI_LUNBOUND return code for dlpi_rcvQ 166 DLPIAPI_UNUSABLE return value described 146 DLPIAPI_XID_CON return code for dlpi_rcvQ 168 DLPIAPI_XID_IND return code for dlpi_revQ 168 DLS provider described 28 user defined 28 DLS provider connection reject for HDLC SDLC 94 connection rejection 72 DLS user release for HDLC SDLC primary 102 DLS user release for HDLC SDLC secondary 103 DLS user invoked conn release 78 APRIL 2003 GcoM INC invoked connection release 77 invoked connection reset 82 invoked release for HDLC SDLC primary 100 invoked release for HDLC SDLC secondary 101 style 1 and style 2 33 DLS user abort conn req after LAPB D amp LLC II SABMC E sent 74 connect reset for HDLC SDLC secondary 106
45. LC SDLC 87 described 149 DLS user aborts conn req after HDLC SDLC SNRMCE sent 96 DLS user aborts conn req after LAPB D amp LLC II SABM E sent 74 sample code 110 dipi_listen_host 149 dipi_listen_host 149 DLPILOG_NAME constant 117 DLPI_N_CONINDS constant 117 dipi_open 25 130 152 dipi_open 130 dlpi_open_data described 152 open local service 48 dlpi_open_log described 153 dlpi_perror described 154 dlpi_print_msg described 155 dlpi_printfQ 207 DLPI API GuIDE GcoM INC described 156 sample code 112 dlpi_put_bothQ described 157 dlpi_put_proto described 158 dlpi_rcvQ attach service 50 bind service 52 called upon XID TEXT or UI U frame 193 connection establishment 66 connection establishment for HDLC SDLC 87 connection mode data xfer 67 data xfer for HDLC SDLC 88 described in reference appendix 159 detach service 51 DLS provider connection reject for HDLC SDLC 94 DLS provider connection rejection 72 DLS provider user release for HDLC SDLC secondary 103 DLS provider user simultaneous conn release 78 DLS provider invoked conn release 77 DLS provider invoked conn reset 82 DLS provider invoked release for HDLC SDLC primary 100 DLS provider invoked release for HDLC SDLC secondary 101 DLS user aborts conn req after HDLC SDLC SNRM E sent 96 DLS user aborts conn req after LAPB D amp LLC II SABM E sent 74 DLS user connect reset for HDLC SDLC primary 105 DLS user con
46. Library User Level dlpi_rcv or dlpi_complete_req 2 DL_DISCONNECT_REQ a DL_OK_ACK 6 DLPI Provider LAPB D amp LLC II Protocol Kernel Level Application dlpi fan 7 send_disconnect_req DLPI API Library DL_OK_ACK 6 DL_DISCONNECT_REQ DLPI Provider DISC 4 gt DISC 4 lt a UA 5 7 gt UA 5 2 LAPB D amp LLC II Protocol dlpi_disconnect_req can also substitute for events 1 and 7 f Rendezvous Uncoupled after this point Figure 26 Simultaneous DLS user invoked connection release for DLPI API GUIDE LAPB LAPD and LLC II APRIL 2003 GcoM INC CONNECTION RELEASE SERVICES FOR LAPB D AND LLC II DLS Provider Invoked Connection Release Figure 27 below illustrates that when a DLS provider initiates the connection release service each DLS user receives a DL_DISCONNECT_IND primitive Application Application User Level dlpi_rcv dlpi_rcv DLPI API DLPI API Library Library DL_DISCONNECT_IND 1 DL_DISCONNECT_IND 4 Kernel Level DLPI DLPI Provider Provider OE LAPB D amp LLC II 3 LAPB D amp LLC II Protocol lt f Protocol Events are uncoupled after this point Figure 27 DLS provider invoked connection rele
47. NC CONNECTION RELEASE SERVICES FOR HDLC SDLC DLS Provider Invoked Connection Release for HDLC SDLC Secondary Figure 46 below illustrates that when the DLS provider initiates the connection release service each DLS user receives a DL_DISCONNECT_IND primitive Application Application dlpi_rcv dipi_rcv DLPI API DLPI API Library Library DL_DISCONNECT_IND 5 DL_DISCONNECT_IND 4 z Kernel Level DLPI DLPI Provider Provider Poll HDLC SDLC DM 3 HDLC SDLC Protocol lt Protocol Primary Secondary f Wait for poll Events are uncoupled after this point Figure 46 DLS provider invoked connection release for HDLC SDLC secondary APRIL 2003 DLPI API Gume 101 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCOM INC Simultaneous DLS User and DLS Provider Invoked Connection Release for HDLC SDLC Primary Figure 47 below shows that when the remote DLS provider and the local DLS user simultaneously invoke the connection release service the remote DLS user receives a DL_DISCONNECT_IND primitive Application Application dlpi_send_disconnect_req User Level dlpi_rcv or A dlpi_complete_req dlpi_rcv DLPI API DLPI API Library Library 2 DL_DISCONNECT_REQ DL_OK_ACK 7 DL_DISCONNECT_IND 6 Kernel Level DLPI DLPI 44 Provider Provider
48. ONNECT_IND Arrives After DL_CONNECT_RES is Sent for HDLC SDLC DLS user invoked connection release for HDLC SDLC primary DLS user invoked connection release for HDLC SDLC secondary Simultaneous DLS user invoked connection release for HDLC SDLC APRIL 2003 GcoM INC APRIL 2003 100 101 102 103 105 106 107 109 111 Figure 45 Figure 46 Figure 47 Figure 48 Figure 49 Figure 50 Figure 51 Figure 51 Figure 51 DLS provider invoked connection release for HDLC SDLC primary DLS provider invoked connection release for HDLC SDLC secondary Simultaneous DLS User and DLS provider invoked connection release for HDLC SDLC primary Simultaneous DLS user and DLS provider invoked connection release for HDLC SDLC secondary DLS User Invoked Connection Reset for HDLC SDLC Primary DLS User Invoked Connection Reset for HDLC SDLC Secondary Simultaneous DLS User Invoked Connection Reset for HDLC SDLC Sample DLPI API Program Sample DLPI API Program repeated DLPI API GuIDE 13 CONTENTS GCOM INC 14 DLPI API GUIDE APRIL 2003 GcoM INC APRIL 2003 Tables 18 20 40 42 Table 1 Table 2 Table 1 Table 2 Location of Important Information Naming Conventions for DLPI Routines Standard DLS services and DLPI API library routines GCOM extensions to DLPI as implemented in the DLPI API library DLPI API GUDE 15 CONTENTS GCOM INC 16 DLPI API GUIDE APRIL 2003
49. PI API library The first parameter to the d pi_init function specifies logging options to be used by the library The set of options on line 11 make the logging verbose and unsuitable for production code The second parameter to d pi_init is the name of the log file that the library is to use The default name is usr spool gcom dlpi log Line 14 The program calls the d pi_listen function to wait for incoming calls The dlpi_listen function returns the file descriptor of a stream which has an open connection associated with it The first parameter is zero which indicates that the stream is to be attached to the default physical line The second parameter is the bind DLSAP that is to be used for the stream The third and fourth parameters are the local and remote addresses to configure for the stream A zero value equals the default setting The fifth parameter is an option that specifies that the dlpi_listen function should not fork a new copy of itself to process the incoming connection Thus when dlpi_listen returns it will be on the same process as the original caller of dlpi_listen 110 DLPI API GUDE APRIL 2003 GcoM INC Figure 51 Sample DLPI API Program repeated 1 include lt stdio h gt 2 include dlpiapi h 3 char buf 1000 4 int filos 5 int n 6 int frms 7 8 main 9 4 10 dlpi_init DLPI_LOG_DEFAULT 11 DLPI_LOG_RX_PROTOS DLPI_LOG_TX_PROTOS 12 DLPT_LO
50. PI_DISC_IND Reason code DLPIAPI_OTHER Unsupported DLPI primitive See dlpi h for DLPI primitive definitions and disconnect and reset indication reason codes DLPI API GUIDE 161 A DLPI API LIBRARY ROUTINES REFERENCE Input Flags in Detail a 162 DLPI API GUIDE GCOM INC flags Input flags used to control the operation of dlpi_rev by indicating how it should react to various DLPI protocol messages The flags specify how received U frames are to be handled or discarded and how dlpi_rcv should react to connect disconnect and reset messages Each valid flags value is explained in more detail as follows AutoReset Requests dlpi_rcv to respond to a DLPI reset indication with a reset response The d pi_rcv routine then returns DLPIAPI_RESET_INDICATION Your application and its peer cannot yet exchange data After your application has completed its response to the reset it should call dlpi_rcv back and wait for the reset sequence to complete The reset complete is indicated when DLPIAPI_RESET_COMPLETE is returned If the AutoReset flags bit is not set DLPIAPL RESET INDICATION is returned without further action taken Note Jf your application has specified non blocking I O on the data stream see the UNIX fcntl system call this flag should not be used AutoConnect Requests dlpi_rcv to respond to a DLPI disconnect indication with a connect request The d pi_rcv routine has n
51. PRIL 2003 MODEL OF THE SERVICE INTERFACE Referring to Figure 3 the DLS provider is configured as a streams driver and the DLS user accesses the provider using open 2 to establish a stream to the DLS provider The stream acts as a communication mechanism between a DLS user and the DLS provider After the stream is created the DLS user and DLS provider communicate by using the routines presented in Appendix A on page 125 DLPI is intended to free data link users from specific knowledge of the services provided by the data link provider Specifically the definition of DLPI hopes to allow a DLS user to be implemented independent of a specific communication medium Any data link provider supporting any communications medium that conforms to the DLPI specification can be substituted beneath the DLS user to provide the data link services Support of anew DLS provider should not require any changes to the implementation of the DLS user DLPI API GUIDE 30 GcoM INC MODES OF COMMUNICATION Modes of Communication Local Management Phase Connection Establishment Phase Data Transfer Phase Connection Release Phase APRIL 2003 The GCOM implementation of the data link provider interface supports two modes of communication connection oriented and connectionless Connection Oriented Service The connection oriented service is characterized by four phases of communication local management connection establishment data
52. ROUTINES REFERENCE GCOM INC dlpi_decode_ctl Prototype void dipi_decode_ctl char p Include File s lt gcom dlpiapi h gt Description This routine decodes the DLPI protocol message located in the global dlpi_ctl_buf and writes it to the log file The log message starts with prefix which is typically the name of the procedure making the call This routine is used mostly internally to log errors and message traffic Parameters prefix A character string to be prepended to the log messages 138 DLPI API GUIDE APRIL 2003 GcoM INC DLPI_CONNECT_REQ dlpi_decode_disconnect_reason Prototype Include File s APRIL 2003 Description Parameters char dlpi_decode_disconnect_reason int dlipi_data dl_uns32 pf char datap int length lt gcom dIpiapi h gt This routine returns a pointer to a string describing the reason code reason reason The disconnect reason code to decode DLPI API GUIDE 139 A DLPI API LIBRARY ROUTINES REFERENCE GCcoM INC dlpi_detach_ppa Prototype Include File s Description Parameters Return 140 DLPI API GUIDE int dlpi_detach_ppa lt gcom dIpiapi h gt This routine sends a DL_DETACH_REQ primitive to the DLPI provider and waits for a DL_OK_ACK response dlpi_data This is the file descriptor returned by an open call on the dev dipi_clone file Typically your application previously used DLPI API procedures to attach a PPA bind a DLSAP and listen for or
53. S is Sent 97 Connection Release Services for HDLC SDLC 97 DLS User Invoked Connection Release for HDLC SDLC Primary 98 DLS User Invoked Connection Release for HDLC SDLC Secondary 99 Simultaneous DLS User Invoked Connection Release 100 DLS Provider Invoked Connection Release for HDLC SDLC Primary 101 DLS Provider Invoked Connection Release for HDLC SDLC Secondary 102 Simultaneous DLS User and DLS Provider Invoked Connection Release for HDLC SDLC Primary 103 Simultaneous DLS User and DLS Provider Invoked Connection Release for HDLC SDLC Secondary DLPI API GUIDE 83 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCOM INC 104 Connection Reset Service for HDLC SDLC 105 DLS User Invoked Connection Reset for HDLC SDLC Primary 106 DLS User Invoked Connection Reset for HDLC SDLC Secondary 107 Simultaneous DLS User Invoked Connection Reset 84 DLPI API GUIDE APRIL 2003 GcoM INC iD UNDERSTANDING CONNECTION ORIENTED DATA TRANSFER The connection mode services enable a Data Link Service DLS user to establish a data link connection transfer data over that connection reset the link and release the connection when the conversation has terminated Note For information about LAPB LAPD and LLC II connection oriented services refer to Section 3 page 63 Understanding Connection Oriented Data Transfer APRIL 2003 Why How Connection oriented data transfer normally implies three phases the connection is set up
54. SIBLE BY YOUR APPLICATION DLPI API Fork Options At this writing the fork options for the DLPI API are reserved for future use DLPI_LLISTED_NO_FORK is the only valid option This option returns without forking after accepting an incoming connection APRIL 2003 DLPI API GUIDE 123 9 UNDERSTANDING THE DLPI API HEADER FILE GCOM INC 124 DLPI API GUIDE APRIL 2003 APPENDIX DLPI API Library Routines Reference 127 dlpi_attach_ppa 128 dlpi_bind_dlsapQ 129 dlpi_clear_zombies 130 dlpi_close 131 dlpi_complete_req 133 dlpi_configure_dlsaps 134 dlpi_connect 136 dlpi_connect_req 137 dlpi_connect_wait 138 dlpi_decode_ctlQ 139 dlpi_decode_disconnect_reason 140 dlpi_detach_ppa 141 dlpi_discon_req 142 dlpi_disconnect_req 143 dlpi_get_a_msg 145 dlpi_get_info 146 dlpi_get_style 147 dlpi_init 148 dlpi_init_FILEQ 149 dlpi_listen 152 dlpi_open 153 dlpi_open_log 154 dlpi_perror 155 dlpi_print_msg 156 dlpi_printfQ 157 dlpi_put_both Q APRIL 2003 DLPI API GUIDE 125 A DLPI API LIBRARY ROUTINES REFERENCE 158 159 159 160 169 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 193 194 195 196 197 198 199 200 201 GCOM INC dlpi_put_proto dlpi_rev Receiving U Frames Non Blocking I O dlpi_rcv_msg dlpi_read_data dlpi_reset_req dlpi_reset_res dlpi_send_attach_req dlpi_send_bind_req dlpi_send_conne
55. UNDERSTANDING THE SAMPLE APPLICATION GCOM INC Understanding the Sample Application 108 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION RESET SERVICE FOR HDLC SDLC Figure 51 Sample DLPI API Program 1 include lt stdio h gt 2 include dlpiapi h 3 char buf 1000 4 int filos 5 int n 6 int frms 7 8 main 9 4 10 dlpi_init DLPI_LOG_DEFAULT 11 DLPI_LOG_RX_PROTOS DLPI_LOG_TX_PROTOS 12 DLPT_LOG_NAME 13 a 14 fil dlpi_listen 0L 0x01L 0x00L 0x00L DLPI_LISTEN_NO_FORK eS if fil lt 0 exit 1 16 while n dlpi_read_data fil buf sizeof buf gt 0 17 18 frmst 19 if dlpi_write_data fil buf n lt 0 exit l 20 21 dlpi_printf End of test frames received d n frms 22 exit 0 23 1 APRIL 2003 DLPI API GUIDE 109 8 UNDERSTANDING THE SAMPLE APPLICATION GCOM INC The test program in Figure 51 illustrates the use of the DLPI API library The program called Gcom_Istn is a simple passive loopback program It listens for any incoming connections forks off a copy of itself to handle the incoming connection and loops any received data back to the sender Refer to Appendix A starting on page 125 for a list of programs you can call from the DLPI API Library The sample program on the opposite page contains the following features Line 2 The program includes the dlpiapi h file Lines 10 13 The program initializes the DL
56. YLE 1 33 APRIL 2003 attach STREAM to 127 default DLPI_DEFAULT_PPA 117 defined 33 detach service 51 ppa parameter defined 127 prefix parameter defined 138 PRIM_type field 121 primitive_mask argument 192 primitive_mask parameter described 192 printfQ functionality w dlpi_printf 156 protocol message decode DLPI via dlpi_decode_ctl 138 protocol messages log 119 prototype declarations contained in dlpiapi h 23 prototype message write via dlpi_put_proto 158 putmsg failed 118 putmsg to access DLS provider 28 r reason code parameter defined 142 recommended reading 17 reference model presented 37 reject connection establishment for LAPB D amp LLC Il 71 connection for HDLC SDLC 93 rejection connection called DLS user 71 connection DLS provider 72 release connection HDLC SDLC 97 103 LAPB LAPD and LLC II 75 78 Remote API 24 remote_dlsap parameter defined 133 request defined 39 DLPI API GUIDE 213 INDEX rejected via DLPIAPIERROR_ACK 167 request parameter defined 131 requirements knowledge 17 reset indication received via DLPIAPI_RESET_INDICATION 166 indication respond via AutoReset input flag 162 indications logged 119 request connection HDLC SDLC 104 107 request connection LAPB D amp LLC II 79 82 request sent via dlpi_reset_req 172 request sent via dlpi send_reset_req 181 response sent via dlpi_reset_res 173 response sent via dlpi_send_reset_res 182 seque
57. _set_signal_handling Miscellaneous Miscellaneous dlpi_get_style dlpi_send_test_res APRIL 2003 DLPI API GUDE 42 GcoM INC DLPI SPECIFICATION SERVICES OVERVIEW GCOM Extensions to the DLPI Services Beyond the standard DLPI provider services GCOM has implemented a number of extensions that you might find useful while writing your application as listed in Table 3 The DLPI API Library routines are described in detail in Appendix A page 125 APRIL 2003 DLPI API GUIDE 43 GcoM INC DLPI SPECIFICATION SERVICES OVERVIEW APRIL 2003 DLPI API GUDE 44 GcoM INC APRIL 2003 DLPI SPECIFICATION SERVICES OVERVIEW Local Management Services 47 48 48 49 50 50 51 52 52 53 Information Reporting Local Service Open Close Local Services Open Service Close Service Attach Detach Local Services Attach Detach Bind Unbind Services Bind Unbind DLPI API GUIDE 45 GcoM INC DLPI SPECIFICATION SERVICES OVERVIEW Application dlpi_rcv or dlpi_complete_req G dlpi_send_info_req DLPI API Library DLPI Provider Any Frame Level Protocol dipi_get_info can be substituted for events 1 and 4 Figure 7 Information reporting for all frame level protocols APRIL 2003 DLPI API GUIDE 46 GcoM INC INFORMATION REPORTING LOCAL SERVICE This section describes the local management services provided by the link layer DLPI API Library for all connectionless a
58. a stream over which to send the DL_BIND_REQ request One of the following DLPI primitives e DL_ATTACH_REQ e DL_DETACH_REQ e DL_BIND_REQ e DL_UNBIND_REQ DL_CONNECT_REQ e DL_CONNECT_RES e DL_RESET_REQ e DL_RESET_RES e DL_INFO_REQ e DL_DISCONNECT_REQ caller Used in generating error messages discard_un_iframes If this flag is set U frames received while waiting for the request to complete are discarded Otherwise if your application set up a U frame handler routine the frame is delivered to your application using that routine DLPI API GuipeE 131 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC Return lt 0 The dlpi_complete_req routine returns interrupt system calls EINTR See fora complete list of the possible error return values The request completed but the stream is disconnected This happens for example when a DL_CONNECT_REQ is rejected with a DL_DISCONNECT_IND gt 0 DLPI primitive accepted by the DLPI provider 132 DLPI API GUIDE APRIL 2003 GcoM INC DLPI_CONFIGURE_DLSAPS dlpi_configure_dlsaps Prototype Include File s APRIL 2003 Description Parameters Return int dlpi_configure_dlsaps int dlipi_data unsigned long local_dlsap unsigned long remote_dlsap lt gcom dlpiapi h gt This routine configures the stream for the DLSAPs passed in as parameters When a DLPI data stream is in the DL_IDLE state bound but not connected the protocol s local and rem
59. all 162 file descriptor returned 48 flags parameter defined 162 fmt parameter defined 156 fork options N A 123 fork_options parameter defined 150 frame delivery without duplication 57 frame relay possible frame duplication in a WAN 57 func parameter described 192 Gcom Protocol Appliance 24 Gcom Remote API architecture 24 client server model 24 DLPI API Guipe 211 INDEX running the RAPI server 25 using the RAPI library 25 Gcom_Istn program described 110 112 getmsg call issued via dlpi_get_a_msg 143 getmsg failed 118 getmsg to access DLS provider 28 global variables defined 121 h handler parameter described 193 hang up notification 118 HDLC connection oriented data transfer 85 107 l I frame connection mode data xfer 67 data xfer for HDLC SDLC 88 indication defined 39 information acknowledge response via ReturnInfo input flag 163 request response via DLPIAPI_INFO_ACK 167 request sent via dlpi_send_info_req 180 information retrieved via dlpi_get_info 145 initialize application amp DLPI API Library 147 DLPI API library 110 error 118 software w passed log file 148 italic text conventions 19 k kernel level interfaces 28 212 DLPI API GUDE GcoM INC l LAPB LAPD connection oriented data transfer 65 82 length parameter defined 184 lgth parameter defined 158 link header files 116 listen for an incoming connection 149 LLC II connection oriented data t
60. ase for LAPB LAPD and LLC I APRIL 2003 DLPI API GUIDE 77 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GCcoM INC Simultaneous DLS User and DLS Provider Invoked Connection Release Figure 28 below shows that when the remote DLS provider and the local DLS user simultaneously invoke the connection release service the remote DLS user receives a DL_DISCONNECT_IND primitive Application Application O dlpi_send_disconnect_req dlpi_rcv User Level dlpi_rcv or dlpi_complete_req DLPI API DLPI API Library Library 2 DL_DISCONNECT_REQ DL_OK_ACK 7 DL_DISCONNECT_IND 7 Kernel Level be DLPI DLPI Provider Provider Pa la PEN 6 rj 3 5 pisc 2 UA 3 LAPB D amp LLC II lt LAPB D amp LLC II DISC 4 Protocol Protocol UA ie dlpi_disconnect_req can also substitute for events 1 and 7 Figure 28 Simultaneous DLS user and DLS provider invoked connection release for LAPB LAPD and LLC II 78 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION RESET SERVICES FOR LAPB LAPD AND LLC II Connection Reset Services for LAPB LAPD and LLC II Interaction between DLS user and DLS provider Primitives involved in the connection reset service Resynchronizing properties of APRIL 2003 the reset service The reset service can be used by the DLS user to r
61. buf The system call to write the protocol message is retried in the event that the call was interrupted by a UNIX signal Parameters dlpi_data stream to which to write protocol message leth Number of bytes to write Return lt 0 See for a complete list of the possible error return values gt 0 Return value from the UNIX putmsg call 158 DLPI API GUIDE APRIL 2003 GcoM INC dlpi_rcv Prototype Include File s APRIL 2003 Description DLPI_RCV int dlpi_rev int dlpi_data char data_ptr int bfr_len int flags long out_code lt gcom dlpiapi h gt lt gcom dlpi h gt lt gcom dlpi_ext h gt This routine receives data generated from connectionless or connection oriented environments and processes DLPI control messages from the stream It is designed to support applications that need to do more than simply set up a connection and exchange data with a peer until the connection is terminated Your application can control the behavior of dlpi_rcv by setting input flags The dlpi_rcv routine supports the following features e Responses to management requests from your application are processed such as DL_LATTACH_REQ DL_BIND_REQ and DL_INFO_REQ e Transparent connection maintenance after the connection is established e Application buffers smaller that incoming frames by interpreting the getmsg MOREDATA bit e Connectionless and connection oriented data transfer e U frame exchanges while connected
62. cess is maintained in an expired state called a zombie state This routine provides a convenient way to clean up zombie processes when the status information will not be checked APRIL 2003 DLPI API GUIDE 129 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_close Prototype int dlpi_close int fd Include Files lt gcom dlpiapi h gt Description Closes the file that was opened by d pi_open This routine should be used to close the file rather than calling the system close routine directly The dipi_close routine takes into account the possibility that the file may be opened to a remote server via the Remote API Return 0 Success 1 Failure Upon failure errno is set to indicate the reason for failure 130 DLPI API GUIDE APRIL 2003 GcoM INC DLPL_BIND_DLSAP dlpi_complete_req Prototype Include File s Description Parameters APRIL 2003 int dlpi_complete_regq int dlpi_data int request char caller int discard_un_iframes lt gcom dlpiapi h gt lt gcom dlpi h gt lt gcom dlpi_ext h gt This routine is used to wait for an acknowledge to the specified DLPI primitive and report whether or not it was accepted by the driver This procedure processes all incoming messages while waiting for the request to complete The dlpi h and dlpi_ext h files are required so that the request defines will be properly translated into the numerical request designation dlpi_dat
63. ches itself to a physical communications medium All communication on that physical medium funnels through the PPA On systems where a DLS provider supports more than one physical medium the DLS user must identify which medium it will communicate through 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 occurs Two styles of DLS provider are defined by DLPI distinguished by the way they enable a DLS user to choose a particular PPA style 1 and style 2 The DL_STYLE1 provider assigns a PPA based on the major minor device that the DLS user opened One possible implementation of a style 1 driver would reserve a major device for each PPA that the data link DLPI API GUDE 33 GcoM INC Defined DL_STYLE2 APRIL 2003 DLPI ADDRESSING driver would support This would allow the streams clone open feature to be used for each PPA configured This style of provider is appropriate when few PPAs will be supported If the number of PPAs that a DLS provider will support is large a style 2 provider implementation is more suitable The DL_STYLE2 provider requires a DLS user to explicitly identify the desired PPA using the dlpi_attach_ppa routine For a style 2 driver the dlpi_open creates a stream between the DLS user and DLS pr
64. connection rejection 71 connection rejection for HDLC SDLC 93 connection reset 80 connection reset for HDLC SDLC primary 105 DLS provider release for HDLC SDLC primary 102 DLS provider release for HDLC SDLC secondary 103 DLS provider invoked conn release 78 invoked connection release 75 invoked release for HDLC SDLC primary 97 invoked release for HDLC SDLC secondary 98 retracts connection request 73 95 simultaneous connect reset for HDLC SDLC 107 simultaneous connection reset 81 simultaneous invoked connection release 76 simultaneous release for HDLC SDLC 99 TEST transfer for HDLC SDLC 90 TEXT transfer for LAPB D amp LLC II 69 XID U frame transfer for HDLC SDLC 89 XID U frame transfer for LAPB D amp LLC II 68 DLSAP dis associate w a STREAM 52 address to be bound to the STREAM 128 configure for the STREAM 133 disap parameter defined 128 DLSAP defined 34 DM APRIL 2003 DLS provider user release for HDLC SDLC secondary 103 DLS provider invoked release for HDLC SDLC primary 100 DLS provider invoked release for HDLC SDLC secondary 101 DLS user connect reset for HDLC SDLC secondary 106 DLS user connection reject for HDLC SDLC 93 DLS user connection rejection 71 DLS user provider release for HDLC SDLC primary 102 DLS user invoked release for HDLC SDLC secondary 98 duplication of frame relay frames 57 e enter vs type 19 error return defines 118 f fentl UNIX system c
65. ct_req dlpi_send_connect_res dlpi_send_detach_req dlpi_send_disconnect_req dlpi_send_info_req dlpi_send_reset_req dlpi_send_reset_res dlpi_send_stats_req dlpi_send_test_req dlpi_send_test_res dlpi_send_uic dlpi_send_unbind_req dlpi_send_xid_req dlpi_send_xid_res dlpi_set_log_size dlpi_set_signal_handling dlpi_set_unnum_frame_handler dlpi_test_req dlpi_test_res dlpi_uic_req dlpi_unbind_dlsap dlpi_xid_req dlpi_xid_res dlpi_write_data dlpi_xray_req This section of the manual documents the routines that are provided in the dlpiapi a library Refer to Architecture of the Data Link Layer page 26 for the sample DLPI API application 126 DLPI API GUIDE APRIL 2003 GcoM INC dlpi_attach_ppa Prototype int dlpi_attach_ppa int dlpi_data unsigned long ppa Include File s lt gceom dlpiapi h gt Description This routine attaches the stream to a Physical Point of Attachment PPA A PPA can be expressed as a UNIX multiplexor ID or a driver Lower Point of Attachment LPA This routine can be used for both connectionless and connection oriented data transfer mode Parameters dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file ppa If this is negative it is an LPA Otherwise it is a streams multiplexor ID Return lt 0 The attach failed gt 0 The attach succeeded APRIL 2003 DLPI API GUIDE 127 A DLPI API L
66. d by the user but is provided to allow you to perform low level functions with the DLPI driver The dlpi_open_data void routine is equivalent to dlpi_open NULL lt 0 An error occurred indicating that the system was not initialized or not opened See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 File descriptor handle identifier for the open file hostname A pointer to an ASCII string name of the machine on which the operation is to be performed If the pointer is NULL or points to an empty string the operation is performed on the machine on which the call to the API library is made 1 e the local host APRIL 2003 GcoM INC DLPI_LISTEN dlpi_open_log Prototype void dipi_open_log void Include File s lt gceom dlpiapi h gt Description This routine is used internally by the API to open the log files The application ordinarily should not need to invoke it directly APRIL 2003 DLPI API GUIDE 153 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_perror Prototype Include File s Description Parameters 154 DLPI API GUIDE void dlpi_perror char prefix lt gcom dIpiapi h gt This routine mimics the standard C library s perror routine The dlpi_perror routine differs in that d pi_perror prints to the DLPI logfile instead of standard error prefix The string pointed to by this argument will be pri
67. d message is a data type message then this count will be negative A call to dlpi_read_data may fail because of a received prototype message In such a case the count in dlpi_ctl_cnt will be positive and the protocol message will reside in the array d pi_ctl_buf dlpi_data_buf unsigned char dlpi_data_buf DLPI_DATA_BUF_SIZE This array may be used by the application program as a place to build data messages to send on a connection or as a place into which to receive data messages It is an array that is made available for use to the application program dlpi_data_cnt int dlipi_data_cnt This variable contains the count of the number of bytes contained in the most recently sent or received data message from the DLPI driver dlpi_service_mode int dlpi_service_mode This variable can be set to the logical or of any of the following values from lt sys dlpi h gt DL_CODLS connection oriented service DL_CLDLS connection less service DL_ACLDLS acknowledged connection less service The default value is DL_CODLS DL_CODLS is appropriate for reliable link layer protocols such as HDLC LAPB LLC AND LAPD DL_CLDLS is appropriate for non reliable protocols such as frame relay The value DL_ACLDLS is not supported by the GCOM DLPI provider The value of the dlpi_service_mode variable is used by the API routine dlpi_bind_dlsap in sending a DL_BIND_REQ to the DLPI provider APRIL 2003 GcoM INC GLOBAL VARIABLES ACCES
68. d their intended uses are defined in the following subsections dlpi_bind_ack unsigned char dlpi_bind_ack This array contains a copy of the DL_BIND_ACK received by the DLPI API routines You may examine it for whatever information you may find useful dlpi_conn_con unsigned char dlpi_conn_con This array contains a copy of the DL_CONNECT_CON connect confirm received by the DLPI API library in response to a DL_CONNECT_REQ sent by the library active connection dlpi_conn_ind unsigned char dlpi_conn_ind This array contains a copy of the DL_CONNECT_IND received by the DLPI API routines When forking child processes each child will have its own copy of this protocol message dlpi_ctl_buf wu unsigned char dlpi_ctl_buf DLPI_CTL_BUF_SIZE This array is used by the DLPI API driver to receive the M_PROTO portion of messages from the DLPI driver It will contain the most recent M_PROTO received by the DLPI API library A call to dlpi_read_data will overwrite this area with an invalid value upon return if the PRIM_type field does not contain all ones then an M_PROTO was received while reading data DLPI API Gume 121 9 UNDERSTANDING THE DLPI API HEADER FILE GCOM INC Prototype Prototype Prototype Prototype 122 DLPI API GUIDE dlpi_ctl_cnt in drpi cetl cnt This variable contains the length of the M_PROTO portion of the last message received from the DLPI driver If the last receive
69. dlsap u u u unsigned fork_options This routine listens for an incoming connection and returns the file descriptor of a data stream which is open for reading and writing data to DLPI The routine dlpi_listen is equivalent to dlpi_listen_host The ppa parameter specifies either the multiplexor ID or the Lower Point of Attachment LPA over which the connection is to be issued If the number is negative then the absolute value is assumed to be the LPA otherwise it is assumed to be the multiplexor ID of the lower stream If the value OL is passed the default of 1L line 1 is substituted The routine issues a DL_ATTACH_REQ to the indicated PPA to attach a DLPI data stream to a line The routine issues a DL_BIND_REQ using the routine dlpi_bind_dlsap Once bound it configures the addresses as specified by the local and remote DLSAPs It then waits for an incoming DL_CONNECT_IND message from DLPI It accepts the connection and returns the file descriptor for the new stream to the caller The bind_dlsap is used to bind the stream to an SDLC station Once bound the Jocal_dlsap and remote_dlsap values are used to configure the addresses of the station If the local and remote DLSAPs are zero then the configured defaults for the station will be used For an NRM primary or secondary only one of the local or remote DLSAPs need be non zero since these modes of operation require only one address For ABM both addresses must b
70. dress in addr_ptr is sent as the destination address Otherwise the XID s destination address is set to NULL dlpi_data pfb datap length addr_ptr addr_len lt 0 gt 0 stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file Poll final bit Pointer to the data for the TEST primitive Length of data pointed to by datap Pointer to an address Length of the address pointed to by addr_ptr Failure See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values The XID request was successfully sent APRIL 2003 GcoM INC dlpi_send_xid_res Prototype Include File s APRIL 2003 Description Parameters Return DLPL_SEND_XID_REQ int dlpi_send_xid_res int dlpi_data ulong PTD char datap int length unsigned char addr_ptr int addr_len lt gcom dIpiapi h gt This routine sends an XID response If addr_ptr is not NULL and addr_len is greater than zero the address in addr_ptr is sent as the destination address Otherwise the XID s destination address is set to NULL dlpi_data pfb datap length addr_ptr addr_len lt 0 gt 0 stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file Poll Final bit Pointer to the data for the TEST primitive Data length Pointer to an address Length of the address pointed to by add
71. e dev dlpi_clone file Poll final bit Pointer to the data for the TEST primitive Data length Pointer to an address Length of the address pointed to by addr_ptr Failure See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values Message successfully sent DLPI API GuipE 185 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_send_uic Prototype Include File s Description Parameters Return 186 DLPI API GUIDE int dlpi_send_uic int dlpi_data char datap int data_len unsigned char addr_ptr int addr_len lt gcom dlpiapi h gt This routine sends the specified data in a unnumbered information U frame information request DL_UNITDATA_REQ It assumes there is a specific address associated with the data This might occur if your address provided a Media Access MAC address such as in a token ring environment If addr_ptr is not NULL and addr_len is greater than zero the address in addr_ptr is sent as the destination address Otherwise the unnumbered information U frame s destination address is set to NULL dlpi_data stream file ID that is attached and bound This is the file descriptor returned by an open call on the dev dlpi_clone file datap Pointer to the data data_len Length of the data pointed to by datap addr_ptr Pointer to an address addr_len Length of the address pointed to by addr_ptr lt 0 Request
72. e DLS provider Similarly each call to dlpi_read_data conveys a DLSDU from the DLS provider to the remote DLS user Application dlpi_rcv or dlpi_read_data Applicati User Level dlpi_send_uic DLPI API DLPI API Library Library DL_UNITDATA_REQ DL_UNITDATA_IND 7 Kernel Level DLPI DLPI Provider Provider 6 lt Poll 4 HDLC SDLC Unnumbered info U frame G gt HDLC SDLC Protocol lt Protocol Primary Secondary Figure 37 Unnumbered information u frame service for connection oriented HDLC SDLC secondary 92 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION ESTABLISHMENT REJECTIONS FOR HDLC SDLC Connection Establishment Rejections for HDLC SDLC In certain situations the connection establishment request cannot be completed The following subsections describe instances where a DL_DISCONNECT_IND DLPI Provider primitive is flowing during the connection establishment phase That is a local DLS user issued a dlpi_send_connect_req dlpi_connect or dlpi_connect_regq but the peer rejected the connection request Called DLS User Connection Rejection In Figure 38 below the DLS user chooses to reject the connect request by issuing a DL_DISCONNECT_REQ primitive instead of a DL_CONNECT_RES Application dlpi_send_connect_req dlpi_rcv or dlpi_complete_req Application dlpi send_disconnect_req User
73. e supplied or neither for using defaults DLPI API GUIDE 149 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC Parameters 150 DLPI API GUIDE ppa The multiplexor ID or LPA to which to attach the DLPI stream bind_dlsap DLSAP to use in the DL_BIND_REQ local_dlsap The DLSAP to use as the local address remote_dlsap The DLSAP of the remote system fork_options Reserved for future use Must be set to 0 APRIL 2003 GcoM INC DLPI_LISTEN Return lt 0 Any kind of error that occurred in the binding or connection process See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Successful return The return value is the UNIX file descriptor for the stream that has the open connection assigned to it This descriptor is suitable for passing to any of the DLPI API routines that have a stream parameter or the UNIX read write getmsg putmsg family of routines APRIL 2003 DLPI API Guipe 151 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_open 152 Prototype Include File s Description Return Parameters DLPI API GUIDE New int dlpi_open char hostname Old int dlpi_open_data void lt gcom dlpiapi h gt This routine opens a stream to the DLPI driver It uses the clone open facility to do so This routine is used internally by the DLPI API library to open files to the DLPI driver It is ordinarily not calle
74. ect on the GCOM DLPI API Library DLPI_CTL_BUF_SIZE The size of the character array dlpi_ctl_buf compiled into the DLPI API library This array is available for use by the application see below Its size is larger than the largest possible streams message buffer At this writing it is set to 5 000 DLPI_DATA_BUF_SIZEThe size of the character array dlpi_data_buf compiled into the DLPI API library This array is available for use by the application see below Its size is larger than the largest possible streams message buffer At this writing it is set to 5 000 DLPI_DEFAULT_PPA This is the default PPA used for the attach phase At this writing this is an unsigned long type with a value of 0 DLPILLOG_NAME The default name of the log file into which the DLPI API library writes messages At this writing this is set to usr spool gcom dlpi log DLPIN CONINDS Number of incoming connection indications that can be queued on a listener stream This constant is passed to DLPI in a DL_BIND_REQ for a listener stream Since the DLPI driver does not support connection manager streams the maximum useful value is 1 The default value is set to 1 APRIL 2003 DLPI API Gumpe 117 9 UNDERSTANDING THE DLPI API HEADER FILE GCOM INC DLPI API Library Routine Error Return Defines When a DLPI API routine is called a negative return value indicates an error Many of those routines use the following return values when an error occurs
75. ect_req dlpi_rcv or dlpi_complete_req dlpi_rcv or dlpi_complete_req D DLPI API DLPI API Library Library 2 DL_DISCONNECT_REQ D DL_DISCONNECT_REQ DL_OK_ACK 7 DL_OK_ACK 6 Kernel Level DLPI DLPI Provider Provider ee O G G DISC 4 gt HDLC SDLC UA 5 HDLC SDLC Protocol lt I Protocol Primary Secondary dlpi_disconnect_req can also substitute for events 1 7 and 1 8 Rendezvous Uncoupled after this point Figure 44 Simultaneous DLS user invoked connection release for HDLC SDLC APRIL 2003 DLPI API GUDE 99 7 HDLC SDLC CONNECTION ORIENTED SERVICES DLS Provider Invoked Connection Release for HDLC SDLC Primary Figure 45 below illustrates that when the DLS provider initiates the connection release service each DLS user receives a DL_DISCONNECT_IND primitive Applicati pplication User Level Application dlpi_rcv 2 dlpi_rcv DLPI API DLPI API Library Library DL_DISCONNECT_IND 1 DL_DISCONNECT_IND 4 Kernel Level DLPI DLPI Provider Provider 4 3 DISC 2 gt HDLC SDLC DM 3 HDLC SDLC Protocol lt t Protocol Primary Secondary Events are uncoupled after this point Figure 45 DLS provider invoked connection release for HDLC SDLC primary 100 DLPI API GUDE GcoM I
76. ented data transfer defined 85 oriented service defined 31 rejection for HDLC SDLC 93 94 rejection in LAPB LAPD and LLC II 71 72 release for HDLC SDLC 97 103 release for LAPB LAPD amp LLC II 75 78 release phase defined 31 request via DLPIAPI_CONNECT_IND 167 reset HDLC SDLC 104 107 reset LAPB LAPD amp LLC II 79 82 service defined 65 setup sequence completed return code 167 Connectionless data transfer defined 57 service 41 connectionless service defined 32 control messages processed via dlpi_rev 159 conventions names for routines 20 notes cautions and warnings 18 text 19 correlation parameter defined 177 d data connectionless transfer of 58 connection oriented transfer 67 message read via dlpi_read_data 171 messages build 122 received via dlpi_rev 159 return code DLPIAPI_DATA 165 transfer for HDLC SDLC 88 204 DLPI API GUIDE GcoM INC transfer phase defined 31 data link protocol book recommendation 17 data link addressing components 33 Data Link Connection Identifier See DLCI data link interface defined 28 data link layer described 28 Data Link Provider Interface See DLPI Data Link Service Access Point See DLSAP Data Link Service See DLS data_ptr parameter defined 161 datap parameter defined 184 defines contained in dlpiapi h 23 detach local service 51 request sent via dlpi_send_detach_req 178 request via dlpi_detach_ppa 140 return values 166 DISC DLS provider user release fo
77. er The feature that allows the DLS user to request automatic handling of the XID response at bind time is not supported at this time Application Application User Level dipi_send_xid_req 8 dlpi_send_xid_res dlpi_rcv dlpi_rcv T DLPI API DLPI API Library Library D DL_XID_REQ DL_XID_RES DL_XID_CON 13 DL_XID_IND 6 Kernel Level DLPI DLPI Provider Provider 12 G 5 10 XID Command 4 LAPB D amp LLC II XID Response 11 gt LAPB D amp LLC II Protocol lt Protocol dlpi_read_data can also substitute for events 7 and 14 if you are using the unnumbered frame handler routine Figure 14 XID service for connectionless mode LAPB LAPD LLC I and HDLC SDLC APRIL 2003 DLPI API GUIDE 59 5 CONNECTIONLESS SERVICES GcoM INC TEST Service The local DLS user requests that TEST command response be sent to the remote DLS user According to the DLPI specification the optional feature that allows the DLS user to request automatic handling of the TEST response at bind time is handled by the DLPI Provider GCOM s implementation makes this a required feature that is handled by the LAPB LAPD LLC II and HDLC SDLC protocols as shown in Figure 15 Application User Level dlpi_send_test_req dlpi_rcv 8 DLPI API Library 2 DL_TEST_REQ DL_TEST_
78. er of the services of the data link interface called the Data Link Service DLS user The data link layer entity is the provider of those services called the DLS provider This interface consists of a set of routines that provide access to the data link layer services plus the rules for accessing the interface A data link interface service routine might request a particular service or indicate a pending event To provide uniformity among the various UNIX system networking products an effort is underway to develop service interfaces that map to the OSI Reference Model A set of kernel level interfaces based on the streams development environment constitute a major portion of this effort The DLPI API Library service routines that make up these interfaces use streams message primitives that are transferred between the user and provider of the service DLPI is one such kernel level interface so it is targeted for streams protocol modules that either use or provide data link services In addition your application program can access a streams based data link provider directly by using the putmsg 2 and getmsg 2 UNIX system calls DLPI API GUDE 28 GcoM INC MODEL OF THE SERVICE INTERFACE DLS User A Request Response Routines DLPI Indication Confirmation Routines y Data Link Interface DLS Provider Services Figure 3 DLPI architecture repeated APRIL 2003 DLPI API GUDE 29 GcoM INC A
79. es APRIL 2003 DLPI API GUIDE 5 CONTENTS 6 DLPI API GUIDE 45 47 48 48 49 50 50 51 52 52 53 55 57 58 58 59 59 60 61 63 65 66 67 68 68 69 70 71 71 72 73 13 74 75 75 GcoM INC Local Management Services Information Reporting Local Service Open Close Local Services Open Service Close Service Attach Detach Local Services Attach Detach Bind Unbind Services Bind Unbind Connectionless Services Understanding Connectionless Data Transfer Beginning a Session Open Attach and Bind Exchanging Data in Connectionless Mode Transferring TEST and XID U Frames XID Service TEST Service Closing a Connectionless Session LAPB LAPD and LLC II Connection Oriented Services Understanding Connection Oriented Data Transfer Normal Connection Establishment for LAPB LAPD and LLC II Normal Data Transfer for LAPB LAPD and LLC II U Frame Services for LAPB LAPD and LLC II XID Service TEST Service Connection Oriented Unnumbered Information U Frame Data Transfer Service Connection Establishment Rejections for LAPB LAPD and LLC II Called DLS User Connection Rejection DLS Provider Connection Rejection Connection Retraction Services for LAPB LAPD and LLC II User Retracts Connection Request DL_DISCONNECT_IND Arrives After DL_CONNECT_RES is Sent Connection Release Services for LAPB LAPD and LLC II DLS User Invoked Connection Release APRIL 2003 GCOM INC APRIL 2003 76 77 78 7
80. eset_res Prototype Include File s Description Parameters Return 182 DLPI API GuIDE int dlpi_send_reset_res int dlpi_data lt gcom dIpiapi h gt This routine formats and sends a DLPI reset response on the specified connection oriented data stream Your application is responsible for reading the response dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Message sent APRIL 2003 GcoM INC DLPI_SEND_RESET_REQ dlpi_send_stats_req Prototype Include File s Description Parameters Return APRIL 2003 int dlpi_send_stats_req int dlpi_data lt gcom dIpiapi h gt This routine formats and sends a DLPI Get Statistics Request The caller is responsible for interpreting the response dlpi_data stream file ID This is the file descriptor returned by dlpi_open lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Message sent DLPI API GUIDE 183 A DLPI API LIBRARY ROUTINES REFERENCE dlpi_send_test_req Prototype Include File s Description Parameters Return 184 DLPI API GUIDE GcoM INC int dlpi_send_test_req int dlipi_data ulong pfb char datap int length unsigned
81. esponse routines APRIL 2003 GcoM INC Product Overview 23 Product Description 23 Using the DLPI API Library 24 GcoM Remote API APRIL 2003 DLPI API GUIDE 21 GcoM INC Application Application Application DLPI Provider eae Interface frame relay virtual circuits polling controller mux null frame relay module s MiX I I BE T T aa LAPB NPI DLPI Figure 1 DLPI provider APRIL 2003 DLPI API GUDE 22 GcoM INC IMPORTANT RELATED FILES Product Description The Data Link Provider Interface DLPI enables a Data Link Service DLS user to access and use any of a variety of conforming DLS providers without special knowledge of the provider s protocol The GCOM DLPI Application Program Interface API translates DLPI protocol messages to your application by way of subroutine calls to the GCoM DLPI API Library The GCOM DLPI API Library is intended to support the data link layer protocols shown in Figure 1 e LAPB e HDLC SDLC e ISDN LAPD e QLLC e the MLP multiplexor e frame relay e LLC II not pictured These protocols connect to your application by using the UNIX STREAMS implementation of DLPI API Using the DLPI API Library In order to utilize the GCOM DLPI API library it is necessary to link it into your program ahead of the libgcom library in order to link to the routines that perform the remote functions A sample command line link for t
82. essages to the log file DLPI_LLOG_STDERR Write messages to stderr DLPI_LOG_RX_PROTOS Log all received protocol messages M_PROTOS in ASCII decoded form DLPI_LOG_TX_PROTOS Log all transmitted protocol messages M_PROTOS in ASCII decoded form DLPI_LOG_ERRORS Log all UNIX error messages in a manner similar to perror DLPI_LOG_SIGNALS Log signal handling DLPI_LOG_DISCONNECTS Log disconnect indications DLPILOG_RESETS Log reset indications DLPI_LOG_DEFAULT The default settings of logging options consisting of DLPI_LOG_FILE DLPI_LOG_STDERR DLPI_LOG_ERRORS DLPI_LOG_DISCONNECTS and DLPI_LOG_RESETS APRIL 2003 DLPI API Gume 119 9 UNDERSTANDING THE DLPI API HEADER FILE GCOM INC Signal Handling Prototype This is the typedef for the user supplied function passed to dlpi_set_signal_handling ifdef PROTOTYPE typedef int dlpi_sig_func_t int fid char ct Lb ptr int ctl_length char data_ptr int data_length else typedef int dlpi_sig_func_t endif When called the value returned from the user supplied function is currently ignored by the API Returning zero is recommended 120 DLPI API GUDE APRIL 2003 GcoM INC GLOBAL VARIABLES ACCESSIBLE BY YOUR APPLICATION Global Variables Accessible By Your Application Prototype Prototype Prototype Prototype APRIL 2003 The DLPI API package makes a certain set of its global variables available to the user The variables an
83. esynchronize the use of a data link connection or by the DLS provider to report detected loss of data that is unrecoverable within the data link service The invocation of the reset service unblocks the flow of Data Link Service Data Units DLSDUs if the data link connection is congested DLSDUs can be discarded by the DLS provider The DLS users that did not invoke the reset will be notified that a reset has occurred A reset may require a recovery procedure to be performed by the DLS users The interaction between each DLS user and the DLS provider will be one of the following e A reset request is invoked by the DLS user followed by a reset confirmation from the DLS provider e A reset indication from the DLS provider followed by a reset response from the DLS user and an DL_OK_ACK returned to the DLS user The DL_RESET_REQ acts as a synchronization mark in the streams of DLSDUs that are transmitted by the issuing DLS user The DL_RESET_IND acts as a synchronization mark in the stream of DLSDUs that are received by the peer DLS user Similarly the DL_RESET_RES acts as a synchronization mark in the stream of DLSDUs that are transmitted by the responding DLS user The DL_RESET_CON acts as a synchronization mark in the stream of DLSDUs that are received by the DLS user that originally issued the reset These are the resynchronizing properties of the reset service e No DLSDU transmitted by the DLS user before the synchronization mark
84. failed See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 The data was successfully sent APRIL 2003 GcoM INC DLPI_SEND_UIC dlpi_send_unbind_req Prototype int dlpi_send_unbind_req int dlpi_data Include File s lt gceom dlpiapi h gt Description This optional routine sends an unbind request to DLPI It could be used in both connectionless and connection oriented environments However dlpi_send_unbind_req is usually not called because a simple d pi_ close command is sufficient in place of the more formal unbind detach close process Refer to your UNIX system administration manual for details about the close command Parameters _ dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file Return lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Message sent APRIL 2003 DLPI API GUIDE 187 A DLPI API LIBRARY ROUTINES REFERENCE dlpi_send_xid_req Prototype Include File s Description Parameters Return 188 DLPI API GUIDE GcoM INC int dlpi_send_xid_req int dlpi_data ulong PTD char datap int length unsigned char addr_ptr int addr_len lt gcom dlpiapi h gt This routine sends an XID request If addr_ptr is not NULL and addr_len is greater than zero the ad
85. fied and if the DLPI_LOG_FILE options was specified the log file default is as defined in DLPI API Logging Options on page 119 For unsuccessful initialization For successful initialization DLPI API GUIDE 147 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_init_FILE Prototype int dlpi_init_FILE unsigned log_optns FILE log_FILE t Include File s lt gcom dlpiapi h gt lt stdio h gt Description This routine functions the same as the dlpi_init routine except that it causes the DLPI API library to used the passed FILE for its log file rather than opening one of its own Parameters log_optns Options for controlling messages that the DLPI API library writes to its log file This parameter consists of a number of single bit values that are ORed together to form the parameter value See Section 3 3 Logging Option page 8 for the options log_FILE Pointer to a FILE data structure Return lt 0 For unsuccessful initialization gt 0 For successful initialization 148 DLPI API GUIDE APRIL 2003 GcoM INC dlpi_listen Prototype Description APRIL 2003 DLPI_LISTEN Old int dlpi_listen unsigned long ppa unsigned long bind_dlsap unsigned long local_dlsap unsigned long remote_dlsap unsigned fork_options New int dlpi_listen_host char hostname unsigned long ppa nsigned long bind_dlsap nsigned long local_dlsap nsigned long remote_
86. g file File descriptor of an DLPI stream which can be used to send data DLPI API GUIDE 135 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_connect_req Prototype int dlpi_connect_req int dlpi_data unsigned long peer_sap Include File s lt gceom dlpiapi h gt Description This routine issues a DL_CONNECT_REQ to DLPI and waits for a DL_CONNECT_CON response Your application must have previously attached and bound the stream The connect confirm response is copied to the global array dlpi_conn_con so that it can be viewed directly by the application program Parameters dlpi_data stream over which to send the DL_CONDL_REQ peer_sap Address of the peer to which you wish to be connected Return lt 0 An error occurred message written to log file gt 0 Size of DL_CONNECT_CON if success 136 DLPI API GuIDE APRIL 2003 GcoM INC DLPIL_CONNECT_REQ dlpi_connect_wait Prototype Include File s Description Parameters Return Values APRIL 2003 int dlpi_connect_wait int data lt gcom dIpiapi h gt The dlpi_connect_wait routine provides a direct way to listen for incoming connections on a data stream which has already been opened attached and bound data The file descriptor for the data stream on which connections should be received gt 0 File descriptor of the connected stream lt 0 An error occurred message written to log file DLPI API GUIDE 137 A DLPI API LIBRARY
87. ght by a DLPI API signal handling procedure This procedure reads messages from dlpi_data and for each message calls the user s function The user s function is defined by the typedef dlpi_sig_func_t as follows ifdef PROTOTYPE typedef int dlpi_sig_func_t int fid char ctil per int ctl_length char data_ptr int data_length else typedef int dlpi_sig_func_t endif The user specified function whose address is passed in the func parameter should return zero indicating that the API signal handler should take no action There are no other valid return values specified at this time It is assumed that your application does not want any more signals if any one of the following statements are true e func is set to NULL e sig_num 0 e primitive_mask 0 If sig_num SIGPOLL this routine requests that the stream head generate a SIGPOLL signal when an M_SIG or M_PCSIG containing a SIGPOLL reaches the stream head DLPI generates M_PCSIGs so that the signal will be generated immediately even when other messages are queued DLPI API Guipe 191 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC The primitive can consist of any of the following ORed together in the primitive_mask parameter e lt lt DL_DISCONNECT_IND e lt lt DL_RESET_IND e lt lt DL_CONNECT_IND e lt lt DL_RESET_CON e 1 lt lt DL_CONNECT_CON Parameters dipi data stream file ID This is the file desc
88. he UPA will also be presented to this data stream When data is presented to the X ray stream a descriptive header is prepended to the data providing some insight into the nature of the data which follows This header conforms to the format typedef struct dl_uns8 xr_type 1 send 2 receive dl_uns8 xr_rsvdl reserved a dl_uns16 xr_seq sequence number dl_uns32 xr_timestamp Rsys time millisecs dl_uns16 xr_modid Rsys process number dl_uns16 xr_upa DLPI UPA number X dl_x_ray_hdr_t The Rsys time is the number of elapsed milliseconds since the Rsystem was initialized The process number is an internal module ID number Sequence numbers can be useful in keeping track of flow control Flow control for X ray streams works a little differently than flow control for other streams A normal stream will queue data until the high water mark is reached then exert backpressure to stop data flow on that stream until the low water mark is reached An X ray stream begins discarding data when the high water mark is reached then begins re queuing it when the low water mark is reached Monitoring sequence numbers will allow the user to determine when data was dropped The data which follow this header are the raw CDI message formatted according to the protocol rules with all the headers included An application with some knowledge of the underlying protocols can decipher pieces of these me
89. his is as follows cc o foo foo o usr lib gcom dlpiapi a usr lib gcom libgcom a Two important files that pertain to the API library are described as follows usr lib gcom dlpiapi a This file is the library of DLPI SDLC interface routines that is linked in with your application program usr include gcom dlpiapi h This header file should be included in your application program It contains defines and prototype declarations useful to you application program This header file is compatible with both old style C language and ANSI C To use the ANSI style function prototype declarations you should define the compile time symbol PROTOTYPE prior to including the gcom dlpiapi h file APRIL 2003 DLPI API GUIDE 23 GcoM INC IMPORTANT RELATED FILES GCOM Remote API APRIL 2003 Gcom s Remote API RAPI is a library of functions that allows the standard GCOM APIs to operate on protocol stacks that are configured and running on a remote machine It is especially useful in situations in which the application code resides on a server system and the protocol processing is performed on a GCOM Protocol appliance attached to the server via a LAN connection Architecture The illustration below shows how the GCOM RAPI relates to all GCOM APIs In the suite of GCOM API libraries the NPI API interfaces to GCOM s NPI driver for X 25 SNA and Bisync protocols The GCOM DLPI interfaces to GCOM s DLPI driver for link layer protocols such
90. ice Data Units DLSDUs The DLS provider preserves both the sequence and boundaries of DLSDUs as they are transmitted The amount of user data that can be transferred in a single DLSDU is limited Each call to dlpi_send_uic in Figure 36 below conveys a DLSDU from the local DLS user to the DLS provider Similarly each call to dlpi_read_data conveys a DLSDU from the DLS provider to the remote DLS user Application D dipi_rcv or a dlpi_read_data J Applicati pplication User Level dlpi_send_uic DLPI API DLPI API Library Library DL_UNITDATA_IND 6 2 DL_UNITDATA_REQ Kernel Level DLPI DLPI Provider Provider Unnumbered info U frame 4 HDLC SDLC gt HDLC SDLC Protocol lt Protocol Primary Secondary Figure 36 Unnumbered information u frame service for connection oriented HDLC SDLC primary APRIL 2003 DLPI API Gume 91 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCcoM INC Connection Oriented Unnumbered Information U Frame Service for HDLC SDLC Secondary Data are transmitted in logical groups called Data Link Service Data Units DLSDUs The DLS provider preserves both the sequence and boundaries of DLSDUs as they are transmitted The amount of user data that can be transferred in a single DLSDU is limited Each call to dlpi_send_uic in Figure 37 below conveys a DLSDU from the local DLS user to th
91. igure 33 conveys a DLSDU from the local DLS user to the DLS provider Similarly each call to dlpi_read_data conveys a DLSDU from the DLS provider to the remote DLS user Application Applicati pplication User Level lpi_write_data dlpi_rcv or dlpi_read_data DLPI API DLPI API Library Library M_DATA 2 IM_DATA Kernel Level DLPI DLPI Provider Provider 5 J Frame 4 gt HDLC SDLC RR 5 HDLC SDLC Protocol lt Protocol Primary Secondary Secondary Primary Figure 33 Normal data transfer for HDLC SDLC APRIL 2003 GcoM INC U FRAME SERVICE FOR HDLC SDLC U Frame Service for HDLC SDLC The GCOM DLPI API Library routines support U frame service for XID and TEST commands and responses XID Service The local DLS user requests that an XID command response be sent to the remote DLS user The feature that allows the DLS user to request automatic handling of the XID response at bind time is not supported Application 8 dlpi_send_xid_res Applicati PP ication User Level dlpi_send_xid_req dipi_rev 4 dlpi_rcv T DLPI API DLPI API Library Library DL_XID_RES 2 DL_XID_REQ 2 DL_XID_CON 13 DL_XID_IND 6 Kernel Level DLPI DLPI Provider Provider XID Command 4 HDLC SDLC XI
92. imited Each call to dlpi_send_uic in Figure 20 below conveys a DLSDU from the local DLS user to the DLS provider Similarly each call to dlpi_read_data conveys a DLSDU from the DLS provider to the remote DLS user Application dlpi_send_uic dlpi_rcv or dlpi_read_data DLPI API DLPI API Library Library DL_UNITDATA_IND 6 2 DL_UNITDATA_REQ Kernel Level DLPI DLPI Provider Provider Unnumbered info U frame 4 LAPB D amp LLC II gt LAPB D amp LLC II Protocol lt Protocol Figure 20 Unnumbered Information U Frame Data Transfer Service for LAPB LAPD and LLC II 70 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION ESTABLISHMENT REJECTIONS FOR LAPB LAPD AND LLC II Connection Establishment Rejections for LAPB LAPD and LLC II In certain situations the connection establishment request cannot be completed The following subsections describe instances where a DL_DISCONNECT_IND DLPI Provider primitive is flowing during the connection establishment phase That is a local DLS user issued a dlpi_send_connect_req dlpi_connect or dlpi_connect_regq but the peer rejected the connection request Called DLS User Connection Rejection In Figure 21 below the DLS user chooses to reject the connect request by issuing a DL_DISCONNECT_REQ primitive instead of a DL_CONNECT_RES Application Application dlpi _send_di
93. in that transmitted stream will be delivered to the other DLS user after the synchronization mark in that received stream e 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 e The DLS provider discards 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 e No DLSDU transmitted by the DLS user after the synchronization mark in that transmitted stream will be delivered to the other DLS user before the synchronization mark in that received stream The complete message flow depends upon the origin of the reset which may be the DLS provider or either DLS user DLPI API GUDE 79 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GCOM INC DLS User Invoked Connection Reset Figure 29 below illustrates the message flow for a reset invoked by one DLS user Application dlpi_send_reset_req Application dlpi_send_reset_res User Level dlpi_rcv or pen dlpi_complete_req N dlpi_rcv or dlpi_complete_req DLPI API DLPI API Library Library DL_RESET_IND 6 DL_RESET_CON 13 2 DL_RESET_REQ DL_OK_ACK 0 9 DL_RESET_RES Kernel Level lt DLPI DLPI Provider Provider
94. ing network events in Figure 41 are defined as follows event 12 Connect sequence ends here event 13 Disconnect starts here 96 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION RELEASE SERVICES FOR HDLC SDLC Connection Release Services for HDLC SDLC 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 that has not been delivered to the DLS user will be discarded A DL_DISCONNECT_REQ primitive requests that a connection be released and DL_DISCONNECT_IND informs the DLS user that a connection has been released DLS User Invoked Connection Release for HDLC SDLC Primary Normally one DLS user requests disconnection and the DLS provider issues an indication of the ensuing release to the other DLS user as shown in Figure 42 below Application C dlpi_send_disconnect_req Application User Level dlpi_rcv or dlpi_complete_req dlpi_rcv or dlpi_complete_req DLPI API Library Library D DL_DISCONNECT_REQ DL_OK_ACK 7 DL_DISCONNECT_IND 6 to DL_DISCONNECT_REQ Keriel Level DLPI DLPI Provider Provider bax G OL gt HDLC SDLC HDLC SDLC Protocol Protocol Primary Secondary dlpi_disconnect_req can also substitute for events 1 and 8 f The time sequence runs unco
95. initiate a connection However these steps are not required lt 0 See for a complete list of the possible error return values gt 0 The stream is now detached APRIL 2003 GcoM INC DLPI_DETACH_PPA dlpi_discon_req Prototype int dlpi_discon_req int dlpi_data int reason Include File s lt gceom dlpiapi h gt lt gcom dlpi h gt lt gcom dlpi_ext h gt Description This routine is a deprecated form of dlpi_disconnect_req See dlpi_disconnect_req on page 142 for additional details Parameters dlpi_data The streams file identifier This is the file descriptor returned by a call to dlpi_open reason The disconnect reason code Return lt 0 See for a complete list of the possible error return values gt 0 The stream is now detached APRIL 2003 DLPI API Guipe 141 A DLPI API LIBRARY ROUTINES REFERENCE dlpi_disconnect_req Prototype Include File s Description Parameters Return 142 DLPI API GUIDE GcoM INC int dlpi_disconnect_req int dlpi_data int reason lt gcom dlpiapi h gt lt gcom dIpi h gt lt gcom dlpi_ext h gt This routine sends a disconnect request primitive DL_DISCONNECT_REQ to DLPI and waits for a DL_LOK_ACK response Any XIDs TESTs unnumbered information U frames and data messages are discarded while disconnecting dlpi_data reason lt 0 gt 0 This is the file descriptor returned by an open call on the dev dlpi_clone file Typically your
96. ion Rejection Connection Retraction Services for LAPB LAPD and LLC II User Retracts Connection Request DL_DISCONNECT_IND Arrives After DL_CONNECT_RES is Sent Connection Release Services for LAPB LAPD and LLC II DLS User Invoked Connection Release Simultaneous DLS User Invoked Connection Release DLS Provider Invoked Connection Release Simultaneous DLS User and DLS Provider Invoked Connection Release Connection Reset Services for LAPB LAPD and LLC II DLS User Invoked Connection Reset Simultaneous DLS User Invoked Connection Reset DLS Provider Invoked Connection Reset DLPI API GUIDE 63 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GCOM INC 64 DLPI API GuIDE APRIL 2003 GcoM INC iD UNDERSTANDING CONNECTION ORIENTED DATA TRANSFER The connection mode services enable a Data Link Service DLS user to establish a data link connection transfer data over that connection reset the link and release the connection when the conversation has terminated Note For information about HDLC SDLC connection oriented services refer to Section 4 page 83 Understanding Connection Oriented Data Transfer APRIL 2003 Why How Connection oriented data transfer normally implies three phases the connection is set up data are transferred and the connection is torn down A connection offers the advantage of reliable data delivery across the network in its original sequence with no missing or duplicate frames
97. irectories and file names An example is the hstpar h include file Boldface names within angle brackets refer to the global copy of the file For instance lt intsx25 h gt refers to rsys include intsx25 h The following terms appear in italics variables parameters fields structures glossary terms routines functions programs utilities and applications flags commands and scripts Examples include the count variable Command Type field rteparam structure target term rsys_read routine avail flag Add Route command and gcomunld script Enter vs Type When the word enter is used in this guide it means type something and then press the Return key Do not press Return when an instruction simply says type Screen Display This typeface is used to represent displays that appear on a terminal screen Commands entered at the prompt use the same typeface only in boldface For example C gt ed gcom cd gcom cd gcom Each of these instructs you to enter cd gcom at the system prompt APRIL 2003 DLPI API GUIDE 19 PREFACE 20 DLPI API GUIDE GcoM INC Naming Conventions for DLPI Routines The general purpose of most routines can be inferred from the prefix and suffix naming conventions in Table 2 Table 2 Naming Conventions for DLPI Routines Prefix or String Description Suffix Prefix dlpi_ DLPI API Library C routine Suffix _req Request routines Suffix _res R
98. isconnect_req dlpi_get_a_msg dlpi_get_both dlpi_get_info_strm dlpi_get_style_strm dlpi_init APRIL 2003 GCOM INC APRIL 2003 148 149 152 153 154 155 156 157 158 159 159 160 169 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 193 194 195 196 dlpi_init_FILE dlpi_listen dlpi_open dlpi_open_log dlpi_perror dlpi_print_msg dlpi_printf dlpi_put_both dlpi_put_proto dlpi_rcv Receiving U Frames Non Blocking I O dlpi_rcv_msg dlpi_read_data dlpi_reset_req dlpi_reset_res dlpi_send_attach_req dlpi_send_bind_req dlpi_send_connect_req dlpi_send_connect_res dlpi_send_detach_req dlpi_send_disconnect_req dlpi_send_info_req dlpi_send_reset_req dlpi_send_reset_res dlpi_send_stats_req dlpi_send_test_req dlpi_send_test_res dlpi_send_uic dlpi_send_unbind_req dlpi_send_xid_req dlpi_send_xid_res dlpi_set_log_size dlpi_set_signal_handling dlpi_set_unnum_frame_handler dlpi_test_req dlpi_test_res dlpi_uic_req DLPI API GUIDE 9 CONTENTS GcoM INC 197 dlpi_unbind_dlsap 198 dlpi_xid_req 199 dlpi_xid_res 200 dlpi_write_data 201 dlpi_xray_req 203 Index 10 DLPI API GUIDE APRIL 2003 GcoM INC APRIL 2003 Figures 22 Figure 1 27 Figure 2 29 Figure 3 33 Figure 4 36 Figure 5 38 Figure 6 46 Figure 7 48 Figure 8 50 Figure 9 51 Figure 10
99. l For your application to receive a U frame event code XID TEST or unnumbered information U frame the corresponding flags bit must be set APRIL 2003 GcoM INC Return Values Negative error codes Zero data code APRIL 2003 DLPI_RCV The return value is an event code corresponding to the message type read from the stream The set of return codes that your application may encounter depends on the flags bits that are set and how your application sets up a DLPI connection if any For example if dlpi_connect is used to set up a connection the DLPI connection primitive are not processed here In addition U frames are silently discarded if the unnumbered input flags are reset In general the return code values are grouped into three categories e negative values indicate an error e zero indicates data normal data or U frame fragment e positive values indicate a DLPI protocol message See for a complete list of the possible error return values DLPIAPI DATA Data has been returned The dlpi_data_cnt global contains the length of the data read into your application s buffer If your application buffer is not large enough to hold the received frame DLPIAPI_MOREDATA is returned through out_code That is the frame is returned in fragments to your application Your application can detect the last fragment of the frame when DLPIAPI_MOREDATA is reset to zero Note The U frames TESTs XIDs and unnumbered
100. l and tells you where to find specific information Table 1 Location of Important Information For information about Look at Product description and related files Section 1 Architecture of the Data Link Layer Section 2 Understanding the service reference model Section 3 Local Management Services Section 4 Connectionless Services Section 5 LAPB LAPD and LLC II Connection Oriented Services Section 6 HDLC SDLC Connection Oriented Services Section 7 Understanding a sample DLPI API test program and linking header Section 8 files Understanding the DLPI API header file dlpiapi h Section 9 DLPI API Library routine reference Appendix A Conventions Used In This Guide 18 DLPI API GUIDE This section discusses conventions used throughout this guide Special Notices A special format indicates notes cautions and warnings The purpose of these notices is defined as follows Note Notes call attention to important features or instructions Caution Cautions contain directions that you must follow to avoid immediate system damage or loss of data Warning Warnings contain directions that you must follow for your personal safety Follow these instructions carefully APRIL 2003 GcoM INC CONVENTIONS USED IN THIS GUIDE Text Conventions The use of italics boldface and other text conventions are explained as follows Terminology The following terms appear in boldface d
101. le descriptor returned by a call to dlpi_open pfb If non zero poll final bit will be set in the request datap Pointer to a user supplied buffer of data to send with the request length Length of the buffer at datap lt 0 Request failed See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Sent DLPI API GuipE 195 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_uic_req Prototype Include File s Description Parameters Return 196 DLPI API GUIDE int dlpi_uic_req int dlpi_data char datap int length lt gcom dIpiapi h gt This routine sends the user supplied data via an unnumbered info request dlpi_data streams file ID This is the file descriptor returned by a call to dlpi_open datap Pointer to a user supplied buffer of data to send with the request length Length of the buffer at datap lt 0 Request failed See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Sent APRIL 2003 GcoM INC DLPI_SET_UNNUM_FRAME_HANDLER dlpi_unbind_dlsap Prototype Include File s Description Parameters Return APRIL 2003 int dlpi_unbind_dlsap int dlpi_data lt gcom dIpiapi h gt This routine sends a DL_UNBIND_REQ primitive to the DLPI provider and waits for the expected DL_OK_ACK response dl
102. lease 76 U frame connection mode service 68 70 input flags to receive 164 receiving via dlpi_rev 159 transfer for HDLC SDLC 89 92 U frames connectionless transfer of 58 return codes signaling 168 UI U frame sent via dlpi_send_uic 186 U frame transfer for HDLC SDLC primary 91 U frame transfer for HDLC SDLC secondary 92 U frame application to call when read 193 unbind request sent via dlpi_send_unbind_req 187 request send via dlpi_unbind_dlsap 197 return values 166 service 53 Univel documentation 17 UNIX cc command 116 error messages logged 119 fentl system call 162 unnum_frame_t U frame handler structure 193 Unnumbered information U frame transfer 70 Uyless Black s book recommendation 17 Vv verbose logging example 110 DLPI API GUIDE 215 INDEX GCOM INC Ww warnings purpose of 18 write data message via dlpi_write_data 200 prototype message to DLPI driver via dipi_put_proto 158 Xx XID application to call when read 193 connection mode service 68 request sent via dlpi_send_xid_req 188 response send via dlpi_send_xid_res 189 U frame service command response 59 U frame transfer for HDLC SDLC 89 216 DLPI API GUIDE APRIL 2003
103. ledged and there is no end to end flow control provided As such the connectionless data transfer service cannot guarantee reliable delivery of data Figure 13 below shows how data are transferred in a connectionless mode environment Data are transferred in the form of bits for frame relay and unnumbered information U frames for all other supported protocols TESTs and XIDs can also be transferred in a connectionless mode as explained starting on page 59 Applicati C Application User Level O Application gt dlpi_send_uic dlpi_rcv DLPI API DLPI API Library Library 2 DL_UNITDATA_IND DL_UNITDATA_IND 6 Kernel Level DLPI DLPI Provider Provider w u EY Unnumberd info U frames _ or frame relay data bits 4 gt Frame Relay Frame Relay Protocol Protocol Figure 13 Connectionless data transfer for frame relay LAPB LAPD LLC I and HDLC SDLC 58 DLPI API GUIDE APRIL 2003 GcoM INC TRANSFERRING TEST AND XID U FRAMES Transferring TEST and XID U Frames TESTs and XIDs are U frame types defined by the HDLC SDLC LAPB LAPD and LLC II protocols As such these U frames can be transferred once a stream has been attached bound or while a connection exists f Note Frame relay does not support TESTs and XIDs XID Service The local DLS user requests that an XID command response be sent to the remote DLS us
104. lpi_complete_req dlpi_send_connect_req dlpi_send_connect_res dlpi_connect dlpi_connect_req dlpi_listen Normal Data Transfer dlpi_read_data dlpi_write_data dlpi_rcv U Frames dlpi_rcv dlpi_send_xid_req dlpi_send_xid_res dlpi_read_data dlpi_send_test_req dlpi_send_uic Transferring TEST and dlpi_rcv dlpi_send_xid_req XID U frames dlpi_send_xid_res dlpi_read_data dlpi_send_test_req Connection Rejections dlpi_rcv dlpi_complete_req dlpi_send_connect_req dlpi_send_disconnect_req dlpi_connect dlpi_connect_req dlpi_listen dlpi_send_connect_res Connection Release dlpi_rcv dlpi_complete_req dlpi_send_disconnect_req dlpi_disconnect_req Connection Reset dlpi_rcv dlpi_complete_req dlpi_send_reset_req dlpi_send_reset_res dlpi_reset_req dlpi_reset_res dlpi_send_conn_req APRIL 2003 DLPI API GUE 40 GcoM INC DLPI SPECIFICATION SERVICES OVERVIEW DLPI Specification Services Overview APRIL 2003 The various features of the Data Link Provider Interface DLPI interface are defined in terms of the services provided by the Data Link Service DLS provider and the individual primitives that can flow between the DLS user and the DLS provider The data link provider interface supports two modes of service e Connection oriented e Connectionless Connection oriented mode requires co
105. lpi_connect 134 request issued via dlpi_bind_dlsap 128 request service 52 return values 166 bind_dlsap parameter defined 134 bind_sap used to open bind a STREAM 134 Black Uyless book recommendation 17 APRIL 2003 boldface text conventions 19 buf parameter defined 143 C C programming language knowledge requirements 17 C programming language requirements 17 caller parameter defined 131 cautions purpose of 18 cc command UNIX 116 clone open used for dlpi_open_data 152 clone open associated w DL_STYLE1 34 close session via UNIX close 49 cnt parameter defined 143 complete request 131 configure the STREAM for the DLSAPs 133 confirmation defined 39 conind_nr parameter defined 128 conn_mgnt parameter defined 175 connect confirm in dlpi_conn_con 121 indication in dlpi_conn_ind 121 indication response via AcceptConnect input flag 163 request for HDLC SDLC 95 96 request for LAPB D amp LLC II 73 74 request issued by dlpi_connect 134 request sent via dlpi_send_connect_req 176 request issued by dlpi_connect_req 136 response sent via dlpi_send_connect_res 177 Connection oriented data transfer defined 65 oriented service defined 41 DLPI API GUIDE 203 INDEX connection establishment for HDLC SDLC 86 establishment phase defined 31 establishment service 66 indication value conind_nr parameter 175 indications that can be queued 128 indications incoming number of 117 ori
106. m the successful completion or failure of an operation that involved a response from a peer Service user Issued by a Service provider to a service user to acknowledge the local successful completion or failure of an operation started as a result of an earlier request The specific types of primitives within each of these categories depends upon the particular service provider For example a service provider can support several requests to manage a connection such as a LAPD open request attach request and bind request as well as a data request to initiate the transmission of data A category can also be empty For example no confirmations are supported for the LAPD API DLPI API GUIDE 39 GcoM INC Table 1 REFERENCE MODEL PRIMITIVES Standard DLS services and DLPI API library routines Modes Service DLPI API Library Routine s Local Management for both connectionless and connection oriented Information Reporting dlpi_rcv dlpi_complete_req dlpi_send_info_req dlpi_get_info Attach Detach dlpi_rcv dlpi_complete_req dlpi_send_attach_req dlpi_attach_ppa dlpi_send_detach_req dlpi_detach_ppa Bind Unbind dlpi_rcv dlpi_complete_req dlpi_send_bind_req dlpi_bind_dlsap dlpi_send_unbind_req dlpi_unbind_dlsap Connectionless Data Transfer dlpi_send_uic dlpi_rcv dlpi_read_data Connection Oriented Connection Establishment dlpi_rcv d
107. n The release procedure is considered abortive so any data that has not reached the destination user when the connection is released may be discarded by the DLS provider DLPI API Gume 31 GcoM INC MODES OF COMMUNICATION Connectionless Service The connectionless mode service does not use the connection establishment and release phases of the connection oriented service The local management phase 1s still required to initialize a stream Once initialized however the connectionless data transfer phase is immediately entered APRIL 2003 DLPI API GUIDE 32 GcoM INC DLPI Addressing Defined DL_STYLE1 APRIL 2003 DLPI ADDRESSING Each DLPI user must establish an identity to communicate with other data link users Setting up this path involves two steps First the DLS user must identify the physical medium over which it will communicate This is particularly evident on systems that are attached to multiple physical media Second the DLS user must register itself with the DLS provider so that the provider can deliver protocol data units destined for that user Figure 4 illustrates the components of this identification approach which are explained in the text that follows it DLS Users i OSAT DLS Provider PPA 7 D Physical Media Figure4 Data Link addressing components Physical Attachment Identification The Physical Point of Attachment PPA in Figure 4 is the point at which a system atta
108. nce completed via DLPIAPI_RESET_COMPLETE 167 reset connection LAPB LAPD amp LLC II 79 82 reset service defined 79 response defined 39 retraction connection establishment 73 74 RetryOnSignal input flag for dlpi_rcvQ defined 164 ReturnInfo input flag for dlpi_rev defined 163 ReturnTEST input flag for dlpi_rcv defined 164 ReturnUIC input flag for dlpi_rcv defined 164 ReturnXID input flag for dlpi_rev defined 164 routine DLPI SDLC dlpiapi a file 23 naming conventions 20 RR connection mode data xfer 67 data xfer for HDLC SDLC 88 S SABM E connection establishment 66 214 DLPI API GUDE GCOM INC DLS provider invoked conn reset 82 DLS user aborts conn req after LAPB D amp LLC II SABM E sent 74 DLS user connection rejection 71 DLS user invoked conn reset 80 simultaneous DLS user connection reset 81 SAP defined 34 screen display 19 SDLC connection oriented data transfer 85 107 service extensions to DLPI 43 local 47 53 local defined 47 supported DLPI 41 service provider defined 37 service user defined 37 service defined 37 service _mode parameter defined 175 session close a connectionless 61 close via UNIX close 49 via dlpi_open_data 48 sig num 191 sig_num parameter described 192 signal handling via dlpi_set_signal_handling 191 signal for system call via RetryOnSignal input flag 164 signal handling logged 119 prototype 120 SIGPOLL 191 SNRM DLS user connect re
109. nd connection oriented frame level protocols These services which fall outside the scope of standards specifications define the method for initializing a stream that is connected to a Data Link Service DLS provider DLS provider information reporting services are also supported by the local management facilities These services are provided by the link layer DLPI API Library Information Reporting Local Service APRIL 2003 This service provides information about the DLPI stream to the DLS user The dl pi_send_info_req routine requests the DLS provider to return operating information about the stream The DLS provider returns the requested information to one of several DLPI API Library routines in a DL_INFO_ACK message DLPI API GUIDE 47 GcoM INC OPEN CLOSE LOCAL SERVICES Open Close Local Services The DLPI specification does not define an open or close local management service However both are necessary to start and finish a data transfer session in both connectionless and connection oriented environments amp Note You must call dipi_init before opening a session Open Service It is necessary to open a session before attaching the PPA binding the DLSAP and in connection oriented mode connecting to a circuit Therefore GCOM supplies the dlpi_open routine shown in Figure 8 which simply asks DLPI to open a session After the open system call is accepted by the DLPI Provider a file descriptor is ret
110. ndary DLPI API Gumpe 103 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCoM INC Connection Reset Service for HDLC SDLC Interaction between DLS user and DLS provider Primitives involved in the connection reset service Resynchronizing properties of the reset service 104 DLPI API GUDE The reset service can 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 that is unrecoverable within the data link service The invocation of the reset service unblocks the flow of Data Link Service Data Units DLSDUs if the data link connection is congested DLSDUs can be discarded by the DLS provider The DLS users that did not invoke the reset will be notified that a reset has occurred A reset may require a recovery procedure to be performed by the DLS users The interaction between each DLS user and the DLS provider will be one of the following e A reset request is invoked by the DLS user followed by a reset confirmation from the DLS provider e A reset indication from the DLS provider followed by a reset response from the DLS user and an DL_OK_ACK returned to the DLS user The DL_RESET_REQ acts as a synchronization mark in the streams of DLSDUs that are transmitted by the issuing DLS user The DL_RESET_IND acts as a synchronization mark in the stream of DLSDUs that are received by the peer DLS user Similarly the DL_RESET_RES acts as a synchronization mark in
111. nect reset for HDLC SDLC secondary 106 DLS user connection reject for HDLC SDLC 93 DLS user connection rejection 71 DLS user connection retraction 73 DLS user retracts connection request 95 DLS user simultaneous connect reset for APRIL 2003 INDEX HDLC SDLC 107 DLS user simultaneous release for HDLC SDLC 99 DLS user provider release for HDLC SDLC primary 102 DLS user invoked conn reset 80 DLS user invoked connection release 75 DLS user invoked release for HDLC SDLC primary 97 DLS user invoked release for HDLC SDLC secondary 98 DLS user invoked simultaneous conn release 76 info reporting service 46 simultaneous DLS user connection reset 81 TEST connection mode service 69 TEST service 60 TEST transfer for HDLC SDLC 90 U frame data exchange 58 U frame xfer connection service 70 UI U frame transfer for HDLC SDLC primary 91 UI U frame transfer for HDLC SDLC secondary 92 XID connection mode service 68 XID service 59 XID transfer for HDLC SDLC 89 dlpi_rcv_msg described 169 dlpi_read_data called upon XID TEXT or UI U frame 193 connection mode data xfer 67 data xfer for HDLC SDLC 88 described 171 overwrites dlpi_ctl_buf 121 sample code 112 TEST connection mode service 69 TEST service 60 TEST transfer for HDLC SDLC 90 U frame data exchange 58 U frame xfer connection service 70 UI U frame transfer for HDLC SDLC primary 208 DLPI API GuIDE GcoM INC 91 UI U frame tran
112. nect response in a connection oriented environment It does not wait for a response DLPI must be initialized for this to work Parameters _dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file correlation Typically this is the correlation value contained in a dl_connect_ind_t structure dlpi_token This parameter must be set to zero Return lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values Perhaps DLPI was not initialized gt 0 Success APRIL 2003 DLPI API GuIDE 177 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_send_detach_req Prototype int dlpi_send_detach_req int dlpi_data Include File s lt gceom dlpiapi h gt Description This optional routine sends a detach request to DLPI It can be used in both connectionless and connection oriented environments However dlpi_send_detach_req is usually not called because a simple dlpi_ close command is sufficient in place of the more formal unbind detach close process Refer to your UNIX system administration manual for details about the close command Parameters _dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file Return lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Success
113. nnection setup release and guarantees reliable flow controlled data delivery with all frames in their original sequence and with no missing or duplicate frames or bit errors within the frames Connectionless mode does not require connection setups but cannot guarantee delivery of data or external flow control Standard DLPI Services Table 2 relates the various phases of connectionless and connection oriented services to the DLS services and associated GCOM supplied DLPI API Library routines The routines are described in detail in Appendix A page 125 Both connection oriented and connectionless service modes require the local management functions shown in Table 1 They both also support U frames XIDs TESTs and unnumbered information U frames DLPI API GUE 41 GcoM INC DLPI SPECIFICATION SERVICES OVERVIEW Table 2 GCOM extensions to DLPI as implemented in the DLPI API library Modes Service DLPI API Library Routine s Local Management applies to both Initialization dlpi_init dlpi_init_FILE connectionless and connection oriented Open Close dlpi_open dlpi_open close Configuration DLPI Configuration dlpi_configure_dlsaps Connectionless Data Transfer dlpi_get_a_msg dlpi_put_data dlpi_set_unnum_frame_handler Connection oriented Data Transfer dlpi_get_a_msg dlpi_set_unnum_frame_handler Troubleshooting Troubleshooting dlpi_printf dlpi_decode_ctl dlpi
114. nted then a colon and a space then a message describing the most recent error then a newline APRIL 2003 GcoM INC dlpi_print_msg Prototype Include File s Description Parameters APRIL 2003 DLPI_LISTEN void dlpi_print_msg unsigned char msg unsigned length int indent lt gcom dIpiapi h gt This routine translates a binary message into an ASCII hex dump This can be useful when an application wishes to log message content msg Pointer to the message to be printed length The number of bytes to print from the message indent The number of spaces to indent the printout DLPI API GUIDE 155 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_printf Prototype Include File s Description Parameters 156 DLPI API GUIDE void Alpi printf char fMt 7 sac 7 lt gcom dIpiapi h gt This routine performs the same function as the UNIX printf routine The logging options specified in the d pi_init call determine whether the output is written to the log file stderr both or neither This is the routine that the DLPI API library uses internally to write messages to the log The format of the output produced by dlpi_printf consists of the process ID of the process that called the function a time stamp and the message formatted according to the arguments passed to dlpi_printf For example dlpi_printf Hello world n would produce output similar to the following 609
115. o way to determine the destination DLSAP used when the connection was originally setup Therefore a DLSAP of OL is used When the connection completes DLPIAPL CONNECT_COMPLETE is returned to your application Note Jf your application has specified non blocking I O on the data stream see the UNIX fentl system call this flag should not be used APRIL 2003 GcoM INC Input Flags in Detail APRIL 2003 continued a AutoListen AcceptConnect DLPI_RCV Requests dl pi_rcv to respond to a DLPI disconnect indication by waiting for an incoming connect indication When the connect indication arrives a connect response is sent to the peer and DLPIAPI_CONNECT_IND is returned to your application After your application has completed its response to the DLPIAPI_CONNECT_IND event your application should call d pi_rcv to wait for the connection setup to be completed This is reported to your application by returning DLPIAPI_CONNECT_COMPLETE If AutoListen and AcceptConnect are reset when a DLPI disconnect indication is received DLPIAPI_DISC_IND is returned to your application without further action The semantics of this flag are similar to those of the AutoListen flag This flag is useful to listen for an incoming connection If dlpi_rcv receives a DLPI connect indication and AcceptConnect or AutoListen is set a connect response is returned to the peer and DLPIAPI_CONNECT_IND is returned
116. ocol stack is an excellent example It is a Service user with respect to layer two data link layer and a Service provider to layer four transport layer Figure 5 shows two Service users called A and B connected to a single service provider The service provided consists of whatever capabilities are required to achieve data transfer between the two service users DLPI API GUIDE 37 GcoM INC APRIL 2003 REFERENCE MODEL TERMINOLOGY SERVICE USER A REQUESTS INDICATIONS RESPONSES ACKNOWLEDGEMENTS CONFIRMATIONS SERVICE USER B REQUESTS RESPONSES INDICATIONS ACKNOWLEDGEMENTS CONFIRMATIONS Figure 6 Reference model repeated DLPI API GUIDE 38 GcoM INC Reference Model Primitives APRIL 2003 LAPD examples REFERENCE MODEL PRIMITIVES The arrows in Figure 2 indicate the sending and receiving entities of the following primitives which are used to categorize communications between service providers and service users request indication response confirmation acknowledgement Issued by a Service user to a Service provider to initiate an operation Issued by a Service provider to a service user to initiate an operation or to indicate that an operation has been invoked by a peer Service user Issued by a Service user to a Service provider to respond positively or negatively to a previous indication Issued by a Service provider to a service user to confir
117. ommunicate directly with a driver That is obtain direct access to a synchronous line or port e Communicate over a frame relay circuit e Use the U frame mechanism of LAPB LAPD LLC II and HDLC SDLC assuming you never ask for a connection Ea Note Conversely connection oriented data transfer is associated with LAPB LAPD LLC II and HDLC SDLC running in connection oriented mode How For successful connectionless data transfer to occur over DLPI your application must achieve the following three phases e Begin the session by issuing an open attach and bind e Exchange data across the line e End the session by issuing an unbind detach and close 1 Although frame relay guarantees frame delivery without duplication complex WAN routing might cause a frame to be duplicated anyway Therefore you should consider coding your application to check for such duplication APRIL 2003 DLPI API GUIDE 57 5 CONNECTIONLESS SERVICES GCOM INC Beginning a Session Open Attach and Bind In connectionless data transfer mode your application first calls dlpi_init and then proceeds to open a session attach a PPA and bind the DLSAP Exchanging Data in Connectionless Mode As mentioned previously the connectionless data transfer service provides for the exchange of user data DLSDUs in either direction or in both directions simultaneously full duplex without ever establishing a data link connection Data transfer is not acknow
118. on oriented LAPB LAPD and LLC II 68 DLPI API GUIDE APRIL 2003 GcoM INC U FRAME SERVICES FOR LAPB LAPD AND LLC II TEST Service The local DLS user requests that TEST command response be sent to the remote DLS user According to the DLPI specification the optional feature that allows the DLS user to request automatic handling of the TEST response at bind time is handled by the DLPI Provider GCOM s implementation makes this a required feature that is handled by the LAPB LAPD and LLC II protocols in Figure 19 Application dlpi_send_test_req User Level dlpi_rcv DLPI API Library 2 DL_TEST_REQ DL_TEST_CON 7 Kernel Level DLPI Provider TEST Command 4 LAPB D amp LLC II TEST Response 5 LAPB D amp LLC II Protocol a Protocol dlpi_read_data can also substitute for events 7 and 14 if you are using the unnumbered frame handler routine Figure 19 TEST service for connection oriented LAPB LAPD and LLC II APRIL 2003 DLPI API GUIDE 69 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GCcoM INC Connection Oriented Unnumbered Information U Frame Data Transfer Service Data are transmitted in logical groups called Data Link Service Data Units DLSDUs The DLS provider preserves both the sequence and boundaries of DLSDUs as they are transmitted The amount of user data that can be transferred in a single DLSDU 1s l
119. ondary Simultaneous DLS User and DLS Provider Invoked Connection Release for HDLC SDLC Primary Simultaneous DLS User and DLS Provider Invoked Connection Release for HDLC SDLC Secondary Connection Reset Service for HDLC SDLC DLS User Invoked Connection Reset for HDLC SDLC Primary DLS User Invoked Connection Reset for HDLC SDLC Secondary DLPI API GUIDE 7 CONTENTS 8 DLPI API GUIDE 107 108 114 116 116 117 118 119 120 121 121 121 121 121 122 122 122 122 123 125 127 128 129 130 131 133 134 136 137 138 139 140 141 142 143 144 145 146 147 GcoM INC Simultaneous DLS User Invoked Connection Reset Understanding the Sample Application Understanding the DLPI API Header File Including the dlpiapi h Header File in Your Application Linking DLPI Header Files DLPI API Constants DLPI API Library Routine Error Return Defines DLPI API Logging Options Signal Handling Prototype Global Variables Accessible By Your Application dlpi_bind_ack dlpi_conn_con dlpi_conn_ind dlpi_ctl_buf dlpi_ctl_cnt dlpi_data_buf dlpi_data_cnt dlpi_service_mode DLPI API Fork Options DLPI API Library Routines Reference dlpi_attach_ppa dlpi_bind_dlsap dlpi_clear_zombies dlpi_close dlpi_complete_req dlpi_configure_dlsaps dlpi_connect dlpi_connect_req dlpi_connect_wait dlpi_decode_ctl dlpi_decode_disconnect_reason dlpi_detach_ppa dlpi_discon_req dlpi_d
120. open pfb If non zero poll final bit will be set in the request datap Pointer to a user supplied buffer of data to send with the request length Length of the buffer at datap lt 0 Request failed See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Sent DLPI API GuipE 199 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_write_data Prototype int dlpi_write_data int dlpi_data char buf int ent Include File s lt gceom dlpiapi h gt Description This routine writes a data message to the DLPI driver on the indicated stream The data are located in the buffer area pointed to by buf and consist of cnt bytes Parameters dlpi data The stream to which to write data buf The buffer from which to write the data cnt The number of bytes to write Return lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Data successfully sent 200 DLPI API GUIDE APRIL 2003 GcoM INC dlpi_xray_req Prototype Include File s APRIL 2003 Description DLPL_WRITE_DATA int dlpi_xray_req int fid int upa IE on_off int hi_wat int lo_wat lt gcom dIpiapi h gt This routine is used with a newly opened data stream When processed the request sent by this routine links the stream to a DLPI UPA Any data traffic passing through t
121. ote addresses can be set An address of OL for both local_dlsap and remote_dlsap implies that no action is to be taken Once bound the ocal_dlsap and remote_dlsap values are used to configure the addresses of the station If the local and remote DLSAPs are zero then the configured defaults for the station will be used For an NRM primary or secondary only one of the local or remote DLSAPs need be non zero since these modes of operation require only one address For ABM both addresses must be supplied or neither if using defaults dlpi_data stream to be configured local_dlsap The DLSAP of the local system secondary address remote_dlsap The DLSAP of the remote system primary address lt 0 Failure gt 0 Configuration succeeded DLPI API GUIDE 133 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_connect Prototype Include File s Description Parameters 134 DLPI API GUDE Old int dlpi_connect unsigned long ppa unsigned long bind_dlsap unsigned long local_dlsap unsigned long remote_dlsap New int dlpi_connect_host char hostname unsigned long ppa unsigned long bind_dlsap unsigned long local_dlsap unsigned long remote_dlsap lt gcom dIpiapi h gt This routine opens a DLPI stream binds it using the bind_sap and then uses dlpi_connect_req to issue a DL_CONNECT_REQ to DLPI and wait fora DL_CONNECT_CON response The connect confirm response is copied to the global ar
122. ovider and the dlpi_attach_ppa routine then associates a particular PPA with that stream The DLS user utilizes the supported GCOM DLPI API Library routines dlpi_attach_ppa and dlpi_bind_dlsap to define a set of enabled physical and service access point SAP address components on a per stream basis It is invalid for a DLS provider to ever send an upstream data message for which the DLS user on that stream has not requested The burden is on the provider to enforce by any means that it chooses the isolation of SAP and physical address space effects on a per stream basis 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 The dlpi_bind_dlsap routine enables a DLS user to either choose a specific DLSAP by specifying its DLSAP address DLPI API GUIDE 34 GcoM INC APRIL 2003 DLPI ADDRESSING The Service Reference Model 37 39 4 41 43 Reference Model Terminology Reference Model Primitives DLPI Specification Services Overview Standard DLPI Services GCOM Extensions to the DLPI Services DLPI API GUIDE 35 GcoM INC APRIL 2003 SERVICE USER A
123. packets and no bit errors It is also flow controlled That is the connection itself has a flow control mechanism at the protocol level normally implemented using sequence numbers acknowledgements and windows within the definition of a frame level connection For successful connection oriented data transfer to occur over DLPI your application must achieve the following three phases e Setup the connection e Exchange data e End the session DLPI API GUIDE 65 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GcoM INC Normal Connection Establishment for LAPB LAPD and LLC II The connection establishment service establishes a data link connection between a local DLS user and a remote DLS user Only one data link connection is allowed on each stream In the connection establishment model the calling DLS user initiates connection establishment while the called DLS user waits for incoming requests DL_CONNECT_REQ requests that the DLS provider establish a connection DL_CONNECT_IND informs the called DLS user of the request which may be accepted using DL_CONNECT_RES or using DL_DISCONNECT_REQ DL_CONNECT_CON informs the calling DLS user that a requested connection has been established Figure 16 below illustrates the normal sequence of connection messages Application dlpi_send_connect_req Application 8 dlpi_send_connect_res User Level dlpi_rcv or dlpi_complete_req a dlpi_rcv
124. pends on the relative timing of the DLPI primitives involved Application Application dlpi_send_connect_req A 13 dlpi_send_disconnect_req 8 dlpi_send_connect_res nd dipi_rev or dlpi_complete_regQt 149 ee DLPI API DLPI API Library Library User Level dlpi_rcv or dlpi_complete_req pes DL_CONNECT_CON 2 DL_CONNECT_REQ DL_CONNECT_IND 14 DL_DISCONNECT_REQ HO i KernePLeRISCONNECT_IND 18 DLPI DLPI 9 DL_CONNECT_RES DL_OK_ACK 19 to DL_DISCONNECT_REQ Provider Provider D gt 45 18 i ve SABMEE 4 lt gt va i APB D amp LLC II LAPB D amp LLC II Protocol gt Protocol lt dlpi_listen performing open attach and bind can substitute for events 7 and 19 Figure 24 DL_DISCONNECT_IND arrives after DL_CONNECT_RES is sent for LAPB LAPD and LLC II The following network events in Figure 24 are defined as follows event 12 Connect sequence ends here event 13 Disconnect starts here 74 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION RELEASE SERVICES FOR LAPB D AND LLC II Connection Release Services for LAPB LAPD and LLC II 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 that has not been delivered to the DLS user will be di
125. pi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file lt 0 Request failed See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 stream successfully unbound DLPI API GuipE 197 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_xid_req Prototype Include File s Description Parameters Return 198 DLPI API GUIDE int dlpi_xid_req int dlipi_data unsigned long pfb char datap int length lt gcom dIpiapi h gt This routine sends a DL_XID_REQ dlpi_data streams file ID This is the file descriptor returned by a call to dlpi_open pfb If non zero poll final bit will be set in the request datap Pointer to a user supplied buffer of data to send with the request length Length of the buffer at datap lt 0 Request failed See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Sent APRIL 2003 GcoM INC dlpi_xid_res Prototype Include File s Description Parameters Return APRIL 2003 DLPI_SET_UNNUM_FRAME_HANDLER int dlpi_xid_res int dlpi_data unsigned long pfb char datap int length lt gcom dIpiapi h gt This routine sends a DL_XID_RES the response to a DL_XID_IND dlpi_data streams file ID This is the file descriptor returned by a call to dlpi_
126. pplication dipi_rcv 3 dlpi_send_reset_res dipi_rev 5 6 dlpi_send_reset_res dlpi_rcv or dlpi_complete_req dlpi_rcv or dlpi_complete_req DLPI API DLPI API Library Library DL_RESETIND 1 4 DL_RESET_RES DL_RESET_IND 4 7 DL_RESET_RES DL_OK_ACK 11 DL_OK_ACK 8 to DL_RESET_RES G 7 Kernel Level PH RESET_RES DLPI DLPI Provider Provider 0 O a as SABM 2 LAPB D amp LLC II vA LAPB D amp LLC II Protocol lt Protocol y dlpi_reset_res can also substitute for event pairs 3 12 and 6 9 Figure 31 DLS provider invoked connection reset for LAPB LAPD and LLC II 82 DLPI API GUIDE APRIL 2003 APRIL 2003 SECTION HDLC SDLC Connection Oriented Services 85 Understanding Connection Oriented Data Transfer 86 Normal Connection Establishment for HDLC SDLC 88 Normal Data Transfer for HDLC SDLC 89 U Frame Service for HDLC SDLC 89 XID Service 90 TEST Service 91 Connection Oriented Unnumbered Information U Frame Service for HDLC SDLC Primary 92 Connection Oriented Unnumbered Information U Frame Service for HDLC SDLC Secondary 93 Connection Establishment Rejections for HDLC SDLC 93 Called DLS User Connection Rejection 94 DLS Provider Connection Rejection 95 Connection Retraction for HDLC SDLC 95 User Retracts Connection Request 96 DL_DISCONNECT_IND Arrives After DL_CONNECT_RE
127. ptr bfr_len out_code DLPI_RCV stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file Typically your application previously used DLPI API procedures to attach a PPA bind a DLSAP and listen for or initiate a connection However these steps are not required Pointer to your application s buffer Connection oriented data and U frames are returned to your application using this pointer The data_ptr parameter must not be NULL The length of the actual data placed in your application s buffer is in the integer global dlpi_data_cnt A positive integer specifying the length of the application s buffer A pointer to an application variable used to returned additional information The pointer must not be null The semantics of the value returned via this pointer depends on the value returned by the function as follows If the DLPIAPI_DATA return code is set and out_code is set to DLPIAPI MOREDATA this indicates a fragment more data Other bits are reserved for future use The last fragment in a frame is indicated by DLPIAPI_MOREDATA being reset DLPIAPI_POLL_FINAL This is set when delivering DLPIAPI_XID_IND DLPIAPI_XID_CON DLPIAPI_TEST_IND DLPIAPI_TEST_CON or DLPIAPI_UIC_IND if the poll final bit is set in the received message DLPIAPI_OK_ACK The acknowledged DLPI primitive DLPIAPI_ERROR_ACK The rejected DLPI primitive DLPIAPIL RESET INDICATION Reason code DLPIA
128. r HDLC SDLC secondary 103 DLS provider user simultaneous conn release 78 DLS provider invoked conn release 77 DLS provider invoked release for HDLC SDLC primary 100 DLS user aborts conn req after HDLC SDLC SNRM E sent 96 DLS user aborts conn req after LAPB D amp LLC I SABM E sent 74 DLS user simultaneous release for HDLC SDLC 99 DLS user provider release for HDLC SDLC primary 102 DLS user invoked connection release 75 DLS user invoked release for HDLC SDLC primary 97 DLS user invoked simultaneous conn release 76 discard_un_iframes parameter defined 131 disconnect indication respond via AutoConnect input flag 162 APRIL 2003 GcoM INC indication respond via AutoListen input flag 163 indications logged 119 request for HDLC SDLC 95 96 request for LAPB D amp LLC II 73 74 request response via DLPIAPI_DISC_COMPLETED 166 request send via dlpi_send_disconnect_req 179 request sent via dlpi_disconnect_req 142 DL_ DLPI primitives partial listing of 131 DL_ primitives for dlpi_set_signal_handling 192 DL_BIND_ACK copy in dlpi_bind_ack 121 DL_CONNECT_IND in dlpi_conn_ind 121 dl_connect_ind_t structure contains correlation parameter 177 DL_DISC_ reason codes defined 142 DL_IDLE state w unbind 53 DL_INFO_ACK returns requested information 47 DL_STYLE1 described 146 DL_STYLEI DLS provider defined 33 DL_STYLE2 described 146 DL_STYLE2 DLS provider defined 34 DL_UNATTACHED s
129. r_ptr Failure See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values Message successfully sent DLPI API GUIDE 189 A DLPI API LIBRARY ROUTINES REFERENCE GCcoM INC dlpi_set_log_size Prototype int dlpi_set_log_size long log_size Include File s lt gceom dlpiapi h gt Description This routine sets the maximum length of the DLPI log file When the logfile reaches this length it will wrap and begin writing new data at the beginning of the file The newest data will be followed by a line marking the end of the log Parameters log_size Maximum length in bytes for the log file Return lt 0 Failure See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Message successfully sent 190 DLPI API GUIDE APRIL 2003 GcoM INC DLPI_SET_SIGNAL_HANDLING dlpi_set_signal_handling Prototype int dlpi_set_signal_handling int dlipi_data dlpi_sig_func_t func int sig_num int primitive_mask Include File s lt gceom dlpiapi h gt lt signum h gt lt gcom dlpi h gt lt gcom dlpi_ext h gt APRIL 2003 Description This routine requests that the specified signal be generated by the DLPI provider when the DLPI provider sends any of the messages indicated by primitive_mask up stream After the DLPI provider generates the signal the signal is cau
130. ransfer 65 82 local service 47 53 defined 31 local_dlsap parameter defined 133 log default options 119 default DLPILOG_NAME 117 file specified via dlpi_init_FILE 148 options defined 119 log_FILE parameter defined 148 log_name parameter defined 147 log_optns parameter defined 147 loopback program Gcom_Istn 110 m M_PCSIG 191 M_PROTO length in dlpi_ctl_cnt 122 received in dlpi_ctl_buf 121 M_SIG 191 major device PPA assignment 33 management requests handled via dlpi_rcv 159 message build data 122 written to log 119 minor device PPA assignment 33 Multilink Procedure See MLP APRIL 2003 GcoM INC n non blocking I O set 118 supported via dlpi_rev 160 notes purpose of 18 Novell documentation 17 O open DLPI STREAM via dlpi_connect 134 error 118 session via dlpi_open_data call 48 STREAM to DLPI driver via dlpi_open_data 152 open to access DLS user 30 open system call accepted 48 OSI Reference Model knowledge requirements 17 out_code parameter defined 161 P path setting up to other DL users 33 peer_sap parameter defined 136 pfb parameter defined 184 Physical Point of Attachment See PPA Poll DLS provider invoked release for HDLC SDLC secondary 101 DLS user connect reset for HDLC SDLC secondary 106 DLS user invoked release for HDLC SDLC secondary 98 Poll UI U frame transfer for HDLC SDLC secondary 92 PPA assign via attach service 50 assigned via DL_ST
131. ray dlpi_conn_con so that it can be viewed directly by the application program The routine dlpi_connect is equivalent to dlpi_connect_host The ppa parameter specifies either the multiplexor ID or the Lower Point of Attachment LPA over which the connection is to be issued If the number is negative then the absolute value is assumed to be the LPA Otherwise it is assumed to be the multiplexor ID of the lower stream of the DLPI multiplexor If the value OL is passed the default of 1L line 1 is substituted The bind_dlsap is used to bind the stream to a station Once bound the local_dlsap and remote_dlsap values are used to configure the addresses of the station If the local and remote DLSAPs are zero then the configured defaults for the station will be used For an NRM primary or secondary only one of the local or remote DLSAPs need be non zero since these modes of operation require only one address For ABM both addresses must be supplied or neither for using defaults For DLPI driver style 1 the DL_ATTACH_REQ is not sent to DLPI ppa The multiplexor ID or LPA to which to attach the stream bind_dlsap The DLSAP to use in the DL_BIND_REQ local_dlsap The DLSAP to use as the local address remote_dlsap The DLSAP of the remote system APRIL 2003 GcoM INC Return APRIL 2003 Note All of these parameters are of type long lt 0 gt 0 DLPI_CONFIGURE_DLSAPS An error occurred message written to lo
132. re with a DL_ERROR_ACK A bind request is valid only when the stream is attached to a PPA but not bound to a DLSAP DL_UNBOUND The normal sequence of events is illustrated in Figure 11 Application dlpi_rcv or dlpi_complete_req DLPI API Library DLPI Provider Any Frame Level Protocol dlpi_bind_dlsap can be substituted for events 1 and 4 Figure 11 Binding a stream to a DLSAP all frame level protocols APRIL 2003 DLPI API GUIDE 52 GcoM INC BIND UNBIND SERVICES Unbind The dlpi_unbind_dlsap or dlpi_send_unbind_req routine requests the DLS provider to unbind all DLSAPs from a stream The DLS provider indicates success with DL_OK_ACK or failure with DL_ERROR_ACK An unbind request is valid only when the stream is bound to a DLSAP but not in a connected state DL_IDLE E Note GCOM suggests unbinding and detaching using the dlpi_close command The normal sequence of events is illustrated in Figure 12 Application dlpi_rcv or dipi_complete_req O dlpi_send_unbind_req DLPI API Library DL_OK_ACK 3 DL_UNBIND_REQ DLPI Provider Any Frame Level Protocol dlpi_unbind_dlsap can be substituted for events 1 and 4 Figure 12 Unbinding a stream from a DLSAP for all frame level protocols APRIL 2003 DLPI API GUIDE 53 GcoM INC BIND UNBIND SERVICES APRIL 2003 DLPI API GUIDE 5
133. riptor returned by an open call on the dev dlpi_clone file func User application s signal message handler function sig_num Signal to be generated by the DLPI provider as it sends to the user a message specified in the primitive _mask argument If sig_num is zero no further signals are generated by the DLPI provider primitive_mask The set of DLPI protocol messages that cause the DLPI provider to generate a signal as it sends the message to the user Return Unused Zero is recommended 192 DLPI API GUIDE APRIL 2003 GcoM INC DLPI_SET_UNNUM_FRAME_HANDLER dlpi_set_unnum_frame_handler Prototype Include File s Description ifdef PROTOTYPE B int dlpi_set_unnum_frame_handler int dlpi_data unnum_frame_t handler lt gcom dlpiapi h gt This routine specifies an application routine to be called when an XID TEST or unnumbered information U frame is read by any of the following API routines e dlpi_connect_req which is called by dlpi_connect e dlpi_connect_wait which is called by dlpi_listen e dlpi_read_data e dlpi_rcv e dlpi_complete_req Your application s U frame handler is defined as follows typedef void unnum_frame_t int fid unsigned char ctl_ptr int ctl_length unsigned char data_ptr int data_length else typedef void unnum_frame_t ndif Parameters dlpi_data The stream from which to receive a protocol message Return APRIL
134. rtion was read If the received data does not fit in your application s buffer the UNIX getmsg MOREDATA bit is returned If the received control M_PROTO does not fit in the API s global dlpi_ctl_buf MORECTL is returned However the MORECTL should not actually occur because the API dlpi_ctl_buf is large See the UNIX manual page concerning getmsg for further information dlpi_data The stream from which to get a message buf The buffer into which to receive the data portion of the message cnt The maximum amount of data to receive lt 0 An error occurred message optionally written to log file See for a complete list of the possible error return values Success gt 0 MOREDATA and or MORECTL bit set as described previously DLPI API GUIDE 143 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_get_both Prototype Include Files Description Parameters Return 144 DLPI API GUIDE int dlpi_get_both int strm char A ctr1 perry char data_ptr lt gcom dlpiapi h gt lt gcom dlpi h gt lt gcom dlpi_ext h gt Much like the dlpi_get_a_msg strm data_buf data_buf_size with a different interface Call the getmsg streams routine Any data is read into the dlpi_data_buf while any control bytes are read into dlpi_ctl_buf The caller does not need to be aware of the names of the buffers as the buffer pointers are returned The global variable dlpi_data_cnt contains the number of data bytes
135. s return value should not occur The DLPI Provider is reporting the acceptance of a request DL_OK_ACKs to attach bind connect reset and disconnect requests should be reported through other return values The accepted request code is returned through out_code DLPIAPI_INFO_ACK Contains a response to a previously issued information request The response is in the global dlpi_ctl_buf DLPIAPL TOKEN_ACK Reserved for future use DLPIAPIL PHYS ADDR ACK Reserved for future use DLPIAPL STATISTICS_ACK Reserved for future use DLPI API GUIDE 167 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC Return Values continued 168 DLPI API GUIDE DLPIAPI_OTHER A DLPI primitive unsupported by d pi_rcv was read The DLPI primitive code is returned through out_code Your application can examine the received message through the d pi_ctl_buf global or it can ignore the message entirely DLPIAPI_XID_IND DLPIAPI_XID_CON DLPIAPI_TEST_IND DLPIAPI_TEST_CON DLPIAPI_UIC_IND These five event codes are used to deliver U frames to your application Your application must explicitly request U frames or else they are silently discarded For your application to receive a U frame event code the corresponding flags bit ReturnXID ReturnTEST ReturnUIC must be set If the appropriate flags bit is not set an attempt is made to deliver the U frame using the unnumbered handler mechanism See dlpi_set_unnum_frame_handler for details If
136. scarded A DL_DISCONNECT_REQ primitive requests that a connection be released and DL_DISCONNECT_IND informs the DLS user that a connection has been release DLS User Invoked Connection Release Normally one DLS user requests disconnection and the DLS provider issues an indication of the ensuing release to the other DLS user as shown in Figure 25 below User Level ppacanon dlpi_send_disconnect_req dlpi_rcv or voy F dlpi_complete_req gt dlpi_rcv or dlpi_complete_req DLPI API DLPI API Library Library DL_OK_ACK 7 DL_DISCONNECT_IND 6 to DL_DISCONNECT_REQ Kernel Level DLPI DLPI Provider Provider eq O DISC 4 gt LAPB D amp LLC II UA yt LAPB D amp LLC II Protocol lt lt Protocol dlpi_disconnect_req can also substitute for events 1 and 8 The time sequence runs uncoupled starting at event 5 Figure 25 DLS user invoked connection release for LAPB LAPD and LLC II APRIL 2003 DLPI API GuIDE 75 dlpi_complete_req 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GcoM INC Simultaneous DLS User Invoked Connection Release Figure 26 below illustrates that when two DLS users independently invoke the connection release service neither one receives a DL_DISCONNECT_IND primitive dlpi_rcv or Application O dlpi_send_disconnect_req DLPI API
137. sconnect_req dlpi_send_connect_req dlpi_rcv or dlpi_complete_req User Level dlpi_rcv or dlpi_complete_req r DLPI API DLPI API Library Library of LLL __ PL CONNECT_IND KON _ 9 _DL_DISCONNECT_REQ ay DL_OK_ACK 2 eee DL_DISCONNECT_IND Q3 7 A to DL_DISCONNECT_REQ AD Kernel Level a DLPI DLPI Provider Provider T w fan R LAPB D amp LLC II 11 LAPB D amp LLC II Protocol lt Protocol dlpi_connect performing open attach and bind can substitute for events 1 and 14 dlpi_connect_req can also substitute for events 1 and 14 Figure 21 Called DLS user connection rejection for LAPB LAPD and LLC II APRIL 2003 DLPI API GUIDE 71 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GcoM INC DLS Provider Connection Rejection In Figure 22 below the DLS provider rejects a connect request for lack of resources or other reasons The DLS provider sends DL_DISCONNECT_IND in response to the connect request Applicati pplication User Level dlpi_rcv or dlpi_complete_req va 4 Q dlpi_send_connect_req DLPI API Library Kernel Level DLPI Provider LAPB D amp LLC II Protocol dlpi_connect performing open attach and bind can substitute for event 1 dlpi_connect_req can also substitute for event 1 Figure
138. set for HDLC SDLC secondary 106 SNRM E connection establishment for HDLC SDLC 87 DLS user aborts conn req after HDLC SDLC SNRM E sent 96 DLS user connect reset for HDLC SDLC primary 105 APRIL 2003 GcoM INC DLS user connection reject for HDLC SDLC 93 DLS user simultaneous connect reset for HDLC SDLC 107 stderr messages written to 119 STREAM configures for the DLSAPs passed 133 style 2 attach service 50 style type returned via dlpi_get_style 146 t terminology conventions 19 TEST application to call when read 193 connection mode service 69 request sent via dlpi_send_test_req 184 response sent via dlpi_send_test_res 185 service command response 60 text conventions 19 type vs enter 19 u UA connection establishment 66 connection establishment for HDLC SDLC 87 DLS provider user simultaneous conn release 78 DLS provider invoked conn release 77 DLS provider invoked conn reset 82 DLS user aborts conn req after HDLC SDLC SNRM E sent 96 DLS user aborts conn req after LAPB D amp LLC II SABM E sent 74 DLS user connect reset for HDLC SDLC primary 105 DLS user connect reset for HDLC SDLC secondary 106 DLS user simultaneous connect reset for HDLC SDLC 107 DLS user simultaneous release for APRIL 2003 HDLC SDLC 99 DLS user invoked conn reset 80 DLS user invoked connection release 75 DLS user invoked release for HDLC SDLC primary 97 DLS user invoked simultaneous conn re
139. set_res dlpi_rcv or dlpi_complete_req 14 dlpi_rcv or dlpi_complete_req DLPI API DLPI API Library Library DL_RESETIND 6 DL_RESET_CON 13 2 DL_RESET_REQ DL__OK_ACK 0 9 DL_RESET_RES Kernel Level PU RESET RES 7 DLPI DLPI Provider Provider SNRM E 4 HDLC SDLC UA i gt HDLC SDLC Protocol lt Protocol Primary Secondary dipi_reset_req can also substitute for events 1 and 14 dipi_reset_res can also substitute for events 8 and 11 Figure 49 DLS User Invoked Connection Reset for HDLC SDLC Primary APRIL 2003 DLPI API Gume 105 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCcoM INC DLS User Invoked Connection Reset for HDLC SDLC Secondary Figure 50 illustrates the message flow for a reset invoked by one DLS user The HDLC SDLC protocol does not support a secondary initiating a reset sequence A DLPI provider reset request results in the SDLC connection being terminated Figure 50 shows the primary side application responding to the disconnect indication with a connect request The resulting connection setup is not shown for the secondary Application dlpi_send_reset_req Applicati pplication User Level dipi_rcv 9 dlpi_send_connect_req dlpi_rcv or dipi pi_rev or dlpi_complete_req dlpi_complete_req DLPI API DLPI API Library Library
140. sfer for HDLC SDLC secondary 92 XID connection mode service 68 XID service 59 XID transfer for HDLC SDLC 89 dlpi_reset_reqQ DLS user connect reset for HDLC SDLC primary 105 DLS user connect reset for HDLC SDLC secondary 106 DLS user simultaneous connect reset for HDLC SDLC 107 DLS user invoked conn reset 80 simultaneous DLS user connection reset 81 dlpi_reset_res described 173 DLS provider invoked conn reset 82 DLS user connect reset for HDLC SDLC primary 105 DLS user invoked conn reset 80 dlpi_send_attach_req attach service 50 described 174 dlpi_send_bind_reqQ bind service 52 described 175 dlpi_send_connect_req connection establishment 66 connection establishment for HDLC SDLC 87 connection rejection 71 described 176 DLS provider connection reject for HDLC SDLC 94 DLS provider connection rejection 72 DLS user aborts conn req after HDLC SDLC SNRM E sent 96 DLS user aborts conn req after LAPB D amp LLC I SABM E sent 74 DLS user connect reset for HDLC SDLC secondary 106 DLS user connection reject for HDLC SDLC 93 APRIL 2003 GcoM INC DLS user connection retraction 73 DLS user retracts connection request 95 dlpi_send_connect_res connection establishment 66 connection establishment for HDLC SDLC 87 DLS user aborts conn req after HDLC SDLC SNRMCE sent 96 DLS user aborts conn req after LAPB D amp LLC II SABM E sent 74 dlpi_send_detach_req described 178
141. ssages to perform data tracing DLPI API GuipE 201 A DLPI API LIBRARY ROUTINES REFERENCE GCoM INC As a practical note when X ray streams are going to be used the streams configuration must have an extra CDI UPA or two beyond those needed to support the protocol drivers These extra UPA s are used by the X ray streams Parameters fid The file descriptor of the data stream to use as the X ray stream upa The DLPI UPA to be X rayed on_off Non zero to turn X ray on zero to turn X ray off hi_wat A high water mark for the stream Should probably be relatively large 60000 or so lo_wat A low water mark for the stream Should probably be about 75 of the high water mark Return Values The request was successfully sent lt 0 The request was not sent error condition 202 DLPI API GUIDE APRIL 2003 INDEX Index a AcceptConnect input flag for dlpi_rev defined 163 acknowledgement defined 39 addr_ptr parameter defined 184 address DLSAP to be bound to the STREAM 128 addressing DLPI 33 angle bracket conventions 19 attach PPA to STREAM 50 request sent via dlpi_send_attach_req 174 return values 166 STREAM to PPA 127 auto_flags parameter defined 175 AutoConnect input flag for dlpi_rcv defined 162 AutoListen input flag for dlpi_rcv defined 163 AutoReset input flag for dlpi_rcv defined 162 b bfr_len parameter defined 161 bind acknowledge in dlpi_bind_ack 121 DLPI STREAM via d
142. t and AutoListen are not set the DLPIAPL DISC_IND is returned without further action DLPIAPI_DISC_COMPLETED Your application previously sent a disconnect request and the DLPI Provider s response has been received DLPIAPI_RESET_INDICATION Indicates that a DL_RESET_IND protocol message was received Data may have been lost If the AutoReset flags bit was set a reset response was returned to the DLPI Provider Your application should call dlpi_rcv again to wait for the reset sequence to complete 166 DLPI API GUIDE APRIL 2003 GcoM INC Return Values continued APRIL 2003 DLPI_RCV DLPIAPI_RESET_COMPLETE A reset sequence has completed and your application may resume transmitting data The reset sequence may have been initiated by your application with a reset request or by the peer with a reset indication DLPIAPI_CONNECT_IND The peer is requesting a connection If the AcceptConnect flags bit was set dlpi_rcv has returned a connect response Your application should call dlpi_rcv to wait for connection setup to complete DLPIAPI_CONNECT_COMPLETE A connection setup sequence has completed and your application can now exchange data with it s peer The connection setup may have been initiated by your application with a connection request or by the peer with a connection indication DLPIAPI_ERROR_ACK The DLPI Provider rejected a request The DLPI request code is returned in out_code DLPIAPI_OK_ACK Thi
143. tate w attach 50 DL_UNBOUND state w bind request 52 state w detach 51 DLP user abort conn req after HDLC SDLC SNRM E sent 96 DLPI alternate definition 30 API purpose 23 architecture 28 described 23 primitives partial listing of 131 provider info via dlpi_get_info 145 dipi 130 DLPI API library 23 APRIL 2003 dlpi h contains primitive definitions 161 dlpi log default log file name 110 dlpi log default log file name 117 DLPI_ logging options defined 119 dlpi_attach_ppa attach service 50 described 127 dlpi_bind_ack bind ack copied to via dlpi_bind_dlsap 128 dipi_bind_ack global variable 121 dlpi_bind_dlsapQ bind service 52 described 128 dlpi_clear_zombies described 129 dipi_clone dlpi_data returned via 127 dlpi_close 25 49 61 dlpi_close 51 53 130 dlpi_complete_req attach service 50 bind service 52 called upon XID TEXT or UI U frame 193 connection establishment 66 connection establishment for HDLC SDLC 87 described 131 detach service 51 DLS provider connection reject for HDLC SDLC 94 DLS provider connection rejection 72 DLS provider user release for HDLC SDLC secondary 103 DLS provider user simultaneous conn release 78 DLS provider invoked conn reset 82 DLS user aborts conn req after HDLC SDLC SNRM E sent 96 DLS user aborts conn req after LAPB D amp LLC I SABM E sent 74 DLS user connect reset for HDLC SDLC primary 105 DLS user connect reset for HDLC SDLC DLPI API GUI
144. the stream of DLSDUs that are transmitted by the responding DLS user The DL_RESET_CON acts as a synchronization mark in the stream of DLSDUs that are received by the DLS user that originally issued the reset These are the resynchronizing properties of the reset service e No DLSDU transmitted by the DLS user before the synchronization mark in that transmitted stream will be delivered to the other DLS user after the synchronization mark in that received stream e 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 e The DLS provider discards 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 e No DLSDU transmitted by the DLS user after the synchronization mark in that transmitted stream will be delivered to the other DLS user before the synchronization mark in that received stream The complete message flow depends upon the origin of the reset which might be the DLS provider or either DLS user APRIL 2003 GcoM INC CONNECTION RESET SERVICE FOR HDLC SDLC DLS User Invoked Connection Reset for HDLC SDLC Primary Figure 49 illustrates the message flow for a reset invoked by one DLS user Applicati User Level dlpi_send_reset_req Application dlpi_send_re
145. tion A successful connection will be indicated with a DL_OK_ACK of a DL_CONNECT_CON Failure will be indicated with a DL_ERROR_ACK of a connect primitive ReturnInfo If specified DL_INFO_ACK DL_TOKEN_ACK DL_PHYS_ADDR_ACK and DL_GET_STATISTICS_ACK messages are returned to the user Otherwise they are discarded These messages are generated by the DLPI Provider in response to their corresponding requests DLPI API GUIDE 169 A DLPI API LIBRARY ROUTINES REFERENCE GCcoM INC ReturnUnnum If set XIDs TESTs and UIs are returned to the user If not set then the un numbered frame handler mechanism is used to optionally deliver these frames to the user Return lt 0 An error occurred message written to log file 0 DLPI control message is present in d pi_ctl_buf length dlpi_ctl_cnt Any associated data is in the user s buffer length in the global dlpi_data_cnt gt 0 Number of bytes read into user buffer 170 DLPI API GUDE APRIL 2003 GcoM INC dlpi_read_data Prototype Include File s Description Parameters Return APRIL 2003 DLPIL_READ_DATA int dlpi_read_data int dlipi_data char buf int ent lt gcom dlpiapi h gt This routine reads a single data message from the DLPI driver on the indicated stream Up to cnt bytes of data can be read into the buffer area pointed to by buf Connection oriented data are returned directly by this routine If connectionless data are being re
146. to your application After your application has completed its response to the DLPIAPI_CONNECT_IND event your application should call d pi_rcv to wait for the connection setup to be completed This is reported to your application by returning DLPIAPI_CONNECT_COMPLETE If AutoListen and AcceptConnect are reset when a DLPI connected indication is received DLPIAPI_CONNECT_IND is returned to your application without further action Note Jf your application has specified non blocking I O on the data stream see the UNIX fentl system call this flag should not be used ReturnInfo If this flag is set DLPIAPI_INFO_ACK is returned to your application in response to a DLPI information acknowledge DL_INFO_ACK Otherwise the DL_INFO_ACK is silently discarded DLPI API GuIDE 163 A DLPI API LIBRARY ROUTINES REFERENCE Input Flags in Detail continued 164 DLPI API GUIDE GcoM INC RetryOnSignal If RetryOnSignal is set d pi_rcv retries the getmsg ReturnXID ReturnUIC ReturnTEST call when a system call is interrupted Otherwise DLPIAPI_EINTR is returned If a putmsg is interrupted with a signal theputmsg is retried independent of the setting of the RetryOnSignal flag UNIX signals may interrupt most system calls including getmsg see the EINTR signal defined in dipiapi h If your application is using signals your application may need to control how dlpi_rcv reacts when getmsg is interrupted with a signa
147. tor returned by an open call on the dev dlpi_clone file lt 0 See for a complete list of the possible error return values A disconnect indication was received Connection is now in the DL_IDLE state gt 0 Reset sequence completed successfully Connection is now in the data transfer state APRIL 2003 GcoM INC dlpi_reset_res Prototype Include File s APRIL 2003 Description Parameters Return DLPI_RESET_RES int dlpi_reset_res int dlpi_data lt gcom dIpiapi h gt This routine sends a reset response to DLPI and awaits the receipt of a DL_OK_ACK from DLPI It is appropriate to call this routine after receiving a DL_RESET_IND on a data stream If you are using dlpi_read_data and if it returns a specific result you may want to check the dlpi_ctl_buf to see if it contains a DL_RESET_IND If so and if you wish to keep your connection going you may then call dlpi_reset_res to acknowledge the reset and put the connection back in the data state Caution The receipt of aDL_RESET_IND means that data messages may have been lost dlpi_data stream to which to send the DL_RESET_RES lt 0 See for a complete list of the possible error return values 0 Connection disconnected gt 0 Reset sequence completed successfully Connection is now in the data transfer state DLPI API GUIDE 173 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_send_attach_req Prototype Include File s
148. turned dlpi_read_data makes an attempt to call the dlpi_set_unnum_frame_handler routine whose code must be modified to fit the circumstances The dlpi_set_unnum_frame_handler routine is described on page 193 This routine does not expect to read a protocol message from the stream It is considered an error to receive a protocol message Similarly if the return from getmsg indicates that no data message has been read an error is returned Under these circumstances messages are written to the log file Note To read data and process protocol messages use the dlpi_tcv procedure For connectionless data transfer environments using dipi_read_data is usually sufficient The ordinary case is that dlpi_read_data will receive a message with no protocol portion and valid data In such a case it simply returns the length of the data dlpi_data stream from which to read data buf Buffer to which to read the data cnt Maximum number of bytes to read lt 0 An error occurred message written to log file gt 0 Number of bytes read into user buffer DLPI API GuipeE 171 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_reset_req Prototype Include File s Description Parameters Return 172 DLPI API GUIDE int dlpi_reset_req int dlpi_data lt gcom dIpiapi h gt This routine sends a DL_LRESET_REQ primitive and waits for the corresponding DL_RESET_CON dlpi_data stream file ID This is the file descrip
149. ude File s lt gceom dlpiapi h gt lt gcom dlpi h gt Description This routine returns the style used to configure the DLPI provider The inquiry is made using the stream represented by the file descriptor parameter Return DLPIAPI UNUSABLE Clone open failed or unable to get style from provider probably because provider was not initialized by the dlpi_init routine gt 0 The provider style is returned The two legal values are as follows DL_STYLE1 This indicates that the Physical Point of Attachment PPA is implicitly bound at open time amp Note In practice this style almost never occurs DL_STYLE2 This indicates that the PPA must be explicitly attached Refer to dlpi_attach_req for further details 146 DLPI API GUIDE APRIL 2003 GcoM INC dlpi_init Prototype Include File s APRIL 2003 Description Parameters Return DLPI_GET_STYLE int dlpi_init unsigned log_optns char log_name lt gcom dlpiapi h gt This routine performs initialization functions for the DLPI API library It should be called prior to using any other library routine log_optns log_name lt 0 gt 0 Options for controlling messages that the DLPI API library writes to its log file This parameter consists of a number of single bit values that are ORed together to form the parameter value See DLPI API Logging Options on page 119 for the options If a NULL log file name was speci
150. upled starting at event 5 Figure 42 DLS user invoked connection release for HDLC SDLC primary APRIL 2003 DLPI API GUIDE 97 7 HDLC SDLC CONNECTION ORIENTED SERVICES GCcoM INC DLS User Invoked Connection Release for HDLC SDLC Secondary Normally one DLS user requests disconnection and the DLS provider issues an indication of the ensuing release to the other DLS user as shown in Figure 43 below Application User Level Application di vein l dlpi_rcv or D dlpi_send_disconnect_req dlpi_complete_req dlpi_complete_req g DLPI API DLPI API Library Library DL_DISCONNECT_REQ DL_DISCONNECT_IND 7 DL_OK_ACK 6 Kernel Level DLPI DLPI Provider Provider 7 pS 6 G Poll 4 HDLC SDLC DM yt gt HDLC SDLC Protocol lt Protocol Primary Secondary dlpi_disconnect_req can also substitute for event 1 and 7 f The time sequence runs uncoupled starting at event 5 Figure 43 DLS user invoked connection release for HDLC SDLC secondary 98 DLPI API GUIDE APRIL 2003 GcoM INC CONNECTION RELEASE SERVICES FOR HDLC SDLC Simultaneous DLS User Invoked Connection Release Figure 44 below illustrates that when two DLS users independently invoke the connection release service neither one receives a DL_DISCONNECT_IND primitive Application dlpi_send_disconnect_req User Level Application dlpi send_disconn
151. urn Defines on page 118 for a complete list of the possible error return values Success DLPI API GUIDE 179 A DLPI API LIBRARY ROUTINES REFERENCE GCOM INC dlpi_send_info_req Prototype Include File s Description Parameters Return 180 DLPI API GUIDE int dlpi_send_info_req int dlpi_data lt gcom dIpiapi h gt This routine formats and sends a DL_INFO_REQ primitive Your application is responsible for reading the response dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Request successfully sent APRIL 2003 GcoM INC DLPI_SEND_RESET_REQ dlpi_send_reset_req Prototype Include File s Description Parameters Return APRIL 2003 int dlpi_send_reset_req int dlpi_data lt gcom dIpiapi h gt This routine formats and sends a DL_RESET_REQ primitive on the specified data stream Your application is responsible for reading the response dlpi_data stream file ID This is the file descriptor returned by an open call on the dev dlpi_clone file lt 0 See DLPI API Library Routine Error Return Defines on page 118 for a complete list of the possible error return values gt 0 Success DLPI API Guipe 181 A DLPI API LIBRARY ROUTINES REFERENCE GCoM INC dlpi_send_r
152. urned Application dlpi_open DLPI API Library open accepted and handle returned DLPI Provider Any Frame Level Protocol Figure8 Open services for all frame level protocols APRIL 2003 DLPI API GUDE 48 GcoM INC OPEN CLOSE LOCAL SERVICES Close Service The last thing your application must do before a session is complete is close the session This involves unbinding detaching and closing GCOM recommends simply using the d pi_close routine Your application would seldom need to explicitly detach and unbind a session However the DLPI API Library supplies such routines if you need to use them APRIL 2003 DLPI API GUIDE 49 GcoM INC ATTACH DETACH LOCAL SERVICES Attach Detach Local Services APRIL 2003 Attach The attach service assigns a Physical Point of Attachment PPA to a stream This service is required for style 2 DLS providers explained in DLPI Addressing on page 33 to specify the physical medium over which communication occurs The DLS provider indicates success with a DL_OK_ACK and failure with a DL_ERROR_ACK An attach request is only valid when the stream is detached DL_UNATTACHED The normal sequence of events is illustrated in Figure 9 Application dlpi_rcv or dlpi_complete_req dlpi_send_attach_req DLPI API Library DLPI Provider Any Frame Level Protocol
153. v or dlpi_read_data DLPI API DLPI API Library Library M_DATA 6 D M_DATA Kernel Level DLPI DLPI Provider Provider 3 5 I Frame 4 LAPB D amp LLC II RR 5 LAPB D amp LLC II Protocol lt Protocol y Figure 17 Normal data transfer for LAPB LAPD and LLC II APRIL 2003 DLPI API GUDE 67 6 LAPB LAPD AND LLC II CONNECTION ORIENTED SERVICES GCcoM INC U Frame Services for LAPB LAPD and LLC II The GCOM DLPI API Library routines support U frame service for connection oriented protocols XID Service The local DLS user requests that an XID command response be sent to the remote DLS user The feature that allows the DLS user to request automatic handling of the XID response at bind time is not supported at this time Application Application User Level lpi_send_xid_req 8 dlpi_send_xid_res dlpi_rcv dlpi_rcv 7 DLPI API DLPI API Library Library 2 DL_XID_REQ 9 DL_XID_RES DL_XID_CON 13 DL XID ND 6 Kernel Level ar DLPI DLPI Provider Provider D 5 10 XID Command 4 5i LAPB D amp LLC II XID Response aD LAPB D amp LLC II Protocol lt Protocol dlpi_read_data can also substitute for events 7 and 14 if you are using the unnumbered frame handler routine Figure 18 XID service for connecti
154. written and produced by Senior Technical Writer Debra J Schweiger using Microsoft Word 97SR 2 and FrameMaker 6 0 on a Windows Millenium platform with the help of subject matter specialists Dave Healy and Dave Grothe This manual was printed in the U S A FOR FURTHER INFORMATION If you want more information about GCOM products contact us at GCOM Inc 1800 Woodfield Dr Savoy IL 61874 217 351 4241 FAX 217 351 4240 e mail support gcom com homepage http www gcom com ONTENTS Table of Contents 5 Table of Contents Il Figures 15 Tables 17 About This Guide 17 Purpose of This Guide 17 Knowledge Requirements 18 Organization of This Guide 18 Conventions Used In This Guide 18 Special Notices 19 Text Conventions 20 Naming Conventions for DLPI Routines 21 Product Overview 23 Product Description 23 Using the DLPI API Library 24 Gcom Remote API 24 Architecture 24 Client Server Model 25 Running the RAPI Server 25 Using the RAPI Library 26 Architecture of the Data Link Layer 28 Model of the Service Interface 31 Modes of Communication 31 Connection Oriented Service 32 Connectionless Service 33 DLPI Addressing 33 Physical Attachment Identification 34 Data Link User Identification 35 The Service Reference Model 37 Reference Model Terminology 39 Reference Model Primitives 41 DLPI Specification Services Overview 41 Standard DLPI Services 43 GCOM Extensions to the DLPI Servic

Download Pdf Manuals

image

Related Search

Related Contents

MM1010  Samsung 22F5400  Samsung Gear fit Kullanıcı Klavuzu  ISSPICE4 USER'S GUIDE Personal Computer Circuit Design Tools  CoolBox H309  HomeGlide stairlift User Manual  Siemens CFX65 User's Manual  FX Positionining Control Systems  DTC1000/4000 User Guide  Delta Electronics EMV-APP01 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file