ACC X.25 Protocol User’s Guide Edition 1 HP 9000 Networking Manufacturing Part Number : Z7345-90010 E0204 © Copyright 2004 Hewlett-Packard Company.
Notices The information in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this manual, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Hewlett-Packard shall not be held liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material. Warranty.
This software is based in part on the Fourth Berkeley Software Distribution under license from the Regents of the University of California. ©copyright 1980, 1984, 1986 Novell, Inc. ©copyright 1986-1992 Sun Microsystems, Inc. ©copyright 1985-86, 1988 Massachusetts Institute of Technology. ©copyright 1989-93 The Open Software Foundation, Inc. ©copyright 1986 Digital Equipment Corporation. ©copyright 1990 Motorola, Inc.
Publishing History The manual publishing date and part number indicate its current edition. The publishing date will change when a new edition is published. Minor changes may be made without changing the publishing date. The manual part number will change when extensive changes are made. Manual updates may be issued between editions to correct errors or document product changes. To ensure that you receive the updated or new editions, you should subscribe to the appropriate product support service.
Contents 1. Overview Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Supported Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2. Installation Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Timeout Processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary of Timer Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Level 2 X.25 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Level 3 X.
Contents ZX25L2STAT_RCVR (3X) — ACC X.25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ZX25RESET (3X) — ACC X.25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ZX25RESET_CONF (3X) — ACC X.25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ZX25SEND_INT (3X) — ACC X.25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 120 123 126 A. X.25 Status and Completion Messages Introduction . .
Contents 10
1 Chapter 1 Overview 11
Overview Introduction Introduction This document describes the particular ACC implementation of recommendation X.25 for use through the ZCOM API, identifying which of the optional features described in the ITU-T (formerly CCITT) standard have been implemented. This manual describes: • how to install the protocol. • protocol specific configuration details. • X.25 programming using the ZCOM and ACC X.25 API routines. • systems messages logged by the ACC X.25 subsystem.
Overview Supported Devices Supported Devices Any device (or public or private packet switching network) which conforms to the ITU-T recommendation X.25 (or a subset thereof) should be supportable by this ACC X.25 implementation. However, the X.25 recommendation leaves many areas open to different interpretations and implementations, and operation in any particular case may require careful selection of a compatible set of configuration parameters. Note that this X.
Overview References References For information on installing the ACC base product, how to load the relocatable firmware files, and how to start up the ACC subsystem, refer to the ACC Installation and Configuration Guide. For general information on writing ZCOM application programs, refer to the ACC Programmers’ Reference Guide. For information on using the utilities related to the ACC base product, refer to the ACC Utilities Reference Guide.
2 Chapter 2 Installation 15
Installation Introduction Introduction This chapter describes the installation of the X.25 protocol related software that is included in the ACC Protocols for Application Developers product. The ACC Protocols for Application Developers requires the ACC Base product to be installed prior to or together with X.25 protocol software.
Installation Installation Depot Contents Installation Depot Contents The ACC Protocols for Application Developers product contains the software required for ACC application development. The ACC X.25 related software includes the HDLC/LAP-B protocol module and the X.25 protocol module, which is a locatable firmware file: /opt/acc/protocol/zx25.zrel. It also contains the program zx25d_init, a pre-linked firmware file /opt/acc//x25.zabs, an HP-UX ACC X.25 driver module /usr/conf/lib/libzx25d.
Installation Software Loading Procedure Software Loading Procedure The ACC X.25 related software is included with the ACC Protocols for Application Developers product. The software is installed from the HP-UX Application CD-ROM, in superuser mode, using the swinstall utility. The steps are shown below. Step 1. Log in to the system as “root”. Step 2. Place the media in a local or remote CD-ROM drive. Step 3. Run swinstall, which behaves the same in the GUI interface as for the terminal interface.
Installation Installation Verification Installation Verification A sample configuration file /opt/acc/cfg/x25_sample.answ file is provided with the ACC Protocols for Application Developers product. This sample file can be used to verify that the X.25 protocol module has been properly installed and is functional. Note that this file will need to be customized to reflect the location of the mux card(s) and to reflect the mux ports to be used. (The x25_sample.answ file is shown at the end of this chapter.
Installation Installation Verification Verification Steps The procedure described involves using the zmlog, ttgen, zmntr, and zterm utilities. These utilities are described in the ACC Utilities Reference Guide. Step 1. Modify the Mux definition statement in the /opt/acc/cfg/x25_sample.answ to reflect the location of the ACC Mux cards. (Refer to the “Configuration” section in Chapter 3, ZX25D X.25 Protocol Driver, of this manual for information on how to modify this statement.) Step 2.
Installation Installation Verification ---------------------------------------------------------------------Tue Mar 1 09:48:51 2000: zmlog: message logging resumed ---------------------------------------------------------------------09:48:52 zmon 00002 Resource manager (Rev 1.32) for ZCOM 6.2.0.0 09:48:52 zmon 00003 Cold start with: /opt/acc/cfg/x25_sample.tmem 09:48:52 zmon 00100 Card 0 starting up ...
Installation Installation Verification The zmntr utility can be used at this point to show that Level 2 connections have been established: % zmntr ZMNTR> tt,1,200 ZLU# 0010 0100 0020 0200 **** Mx 00 00 00 00 ** Pt 0L 0V 1L 1V ** Terminal Description....Rx.Mes Tx.Mes Error X25DTE POS 226633004 1 6 0 SVCI =n/c 226633011 0 0 0 X25DCE POS 226633004 1 6 0 SVCO =n/c 226633011 0 0 0 Message totals 2 12 0 E.Rate 0.00% 0.00% 0.00% 0.00% 0.00% State.......
Installation Installation Verification The zmntr utility can be used to show that the Level 3 connections have been established: % ZMNTR ZMNTR> tt,1,200 ZLU# 0010 0100 0020 0200 **** Mx 00 00 00 00 ** Pt 0L 0V 1L 1V ** Terminal Description....Rx.Mes Tx.Mes Error X25 DTE POS 226633004 2 10 0 SVCI =0004 226633011 0 0 0 X25DCE POS 226633004 2 10 0 SVCO =0004 226633011 0 0 0 Message totals 4 20 0 E.Rate 0.00% 0.00% 0.00% 0.00% 0.00% State.......
Installation Installation Verification Step 8. The sent data can now be received and displayed: ZTERM> rx,list 10:34:34 Msg from tmnl ZLU#00200(00123) Lcn .00. .01. .02. .03. .04. .05. .06. 000 5A74 3031 3431 3300 206D 6573 7361 010 2030 3030 3031 206C 656E 6774 6820 020 6F70 7172 7374 7576 7758 10:34:34 Msg from tmnl ZLU#00200(00123) Lcn .00. .01. .02. .03. .04. .05. .06. 000 5A74 3031 3431 3300 206D 6573 7361 010 2030 3030 3032 206C 656E 6774 6820 020 6F70 7172 7374 7576 7758 len 50 No error detected .
Installation Using the X.25 Protocol Module Using the X.25 Protocol Module The Multi-protocol ACC Installation and Configuration Guide contains the general procedure for creating downloadable firmware files, creating the ttgen configuration file, starting up the ACC subsystem with the new protocol and new configuration. The X.25 specific requirements are noted below: Chapter 2 • Include the zx25.zrel protocol module when creating the .zabs firmware file (non-PCI bus only).
Installation Using the X.
3 Chapter 3 ZX25D X.
ZX25D X.25 Protocol Driver Overview Overview This chapter describes in detail how to create a TTGEN configuration file for the ACC X.25 subsystem. It also discusses in detail the implementation and run-time usage of the ACC X.25 subsystem; for example, how to display X.25 specific information using the zmntr utility. The zx25d X.
ZX25D X.25 Protocol Driver Configuration Configuration This section describes how to create a TTGEN configuration file for the ACC X.25 subsystem. That is, it discusses those parts of the TTGEN that are specific to X.25 configuration. For a general discussion of the TTGEN configuration file, you should consult the ACC Utilities Reference Guide. This section assumes that the reader has previously configured a ZCOM subsystem and is familiar with the format and content of a TTGEN configuration file.
ZX25D X.25 Protocol Driver Configuration subparameter is specified for any virtual circuit terminal definition statement. Note that this definition is not needed if the call user data will always be supplied as a parameter in the zx25...() routines or if no call user data is being sent. This definition, if required, is as follows: logical-data app X25UDT 0 20 The app number is the application number parameter from the virtual circuit terminal definition statement.
ZX25D X.25 Protocol Driver Configuration Z7340A Z7340A Z7340A 0 1 2 0:2:0 0:5:0 0:8:0 /opt/acc/z7340a/x25.zabs /opt/acc/z7340a/x25.zabs /opt/acc/z7340a/x25.zabs The “.zabs” firmware file must have at least the X.25 and LAP-B protocol modules loaded into it, and it may contain other protocol modules. Refer to the TTGEN section of the ACC Utilities Reference Guide for more information on specifying the Mux number, bus, and slot parameters.
ZX25D X.25 Protocol Driver Configuration Term * 0100 01:4 X25.LAPB X25_LINK_DTE_400 ~ 10 0 0 0 0 CALL:226633004 ”X25 DTE POS 226633004” no_autostart option 02h last_pvc 3 first_insvc 4 last_insvc 6 first_svc 9 last_svc 12 first_outsvc 14 last_outsvc 15 def_inpacket 7 def_outpacket 7 def_inwindow 2 def_outwindow 2 T1_timer res_100ms 4 T2_timer res_10ms 20 T3_T4_timer res_10s 4 Note that the “no_autostart” parameter is commented out which means that when the zx25d_init program is used to initialize the X.
ZX25D X.25 Protocol Driver Configuration SVCs on this link have the inbound and outbound packet size set to 7 (128 bytes) and the inbound and outbound window size set to 2. These are the default parameters for the SVCs on this link, and they can be altered for an individual SVC at call setup through facilities negotiation. The equivalent parameters for PVCs are individually specified in the PVC’s poll/select configuration bytes. The T1, T2 and T4 timers have all been preconfigured for this link.
ZX25D X.25 Protocol Driver Configuration poll/select The ‘POLL’ and ‘SELECT’ parameters for the ZCOM terminal definition. These are used to specify: • whether the link acts as a DTE or DCE, • whether to use the 1980 or 1984/1988 X.25 standard, • the maximum L3 incoming packet size, • whether or not to reset L2 if CTS or DCD is dropped, • the T1 and T2 timeout values, • the frame level window size, and • the N2 retry limit.
ZX25D X.25 Protocol Driver Configuration option Option Word Override (optional) This keyword allows you to override the default value of the option word for the link terminal. The available options are covered in the section “Device Option Word Definitions” below. NOTE The following X.25 link keywords are case sensitive and, if used, must be specified exactly as indicated, one per line. last_pvc Highest PVC Logical Channel Number - Default is 0 (e.g. no PVCs). Maximum value is 255.
ZX25D X.25 Protocol Driver Configuration last_outsvc Highest Outgoing SVC Logical Channel Number Default is 0. If these have a value other than zero, all the Logical Channels from first_outsvc to last_outsvc can be used for CALLs to be made from the DTE to the DCE only. def_inpacket Default Inbound SVC Packet Size. Default is 0. def_outpacket Default Outbound SVC Packet Size. Default is 0.
ZX25D X.25 Protocol Driver Configuration NOTE T1_timer Optional override configuration for T1. If this parameter is not supplied, T1 is set from the Select Word configured for the Link terminal. If this parameter is supplied then other options and configuration parameters have no affect on the T1 timer. Two parameters must be supplied with this keyword, the resolution (one of: res_10ms, res_100ms, res_1s, or res_10s) and the multiplier (an integer in the range 2 to 255).
ZX25D X.25 Protocol Driver Configuration LCN Assignment Constraints The Logical Channel Number (LCN) assignment table is used to indicate which channel numbers to use for PVCs and the different types of SVCs. The table is always specified from the perspective of the DTE, even if the link has been configured as a DCE. When assigning the last_pvc, first_insvc, last_insvc, etc. parameters, the following constraints apply: • The range of values that may be used for LCNs is 1 to 4095.
ZX25D X.25 Protocol Driver Configuration The POLL and SELECT words configure the following parameters for the X.25 Link (terminal type 25) configuration: T1,T2 L2 acknowledgment timers DTE/DCE Operating mode - DTE or DCE 80/84 X.25 revision selection L2E Modulo 8 or 128 transmit sequence numbering CTS Ignore CTS and DCD signals (to avoid L2 reset if one or both of these signals is not stable).
ZX25D X.25 Protocol Driver Configuration POLL Word for an X.25 Link Configuration 15 14 13 12 11 10 9 8 7 T/C 80 CT S N C T3 L2E IUF 0 Extended K T/C : 80 : CTS : ND : T3 : 6 5 4 3 2 1 0 Max_inpact 0 Port to act as DCE 1 Port to act as DTE 0 X.25 1984/1988 standard 1 X.
ZX25D X.25 Protocol Driver Configuration IUF : 0 Normal error handling (level 2 link reset) on receipt of unsolicited response frame with F=1. 1 Ignore F=1 (treat as if F=0) for any unsolicited response frames with F=1. Extended K : When level 2 modulo 128 sequence number is selected by setting L2E to 1, the level 2 window size is specified by combining “Extended K” (providing the most significant bits 6 through 3) with “K” from the select word (providing the least significant bits 2 through 0).
ZX25D X.25 Protocol Driver Configuration Select Word for an X.25 Link Configuration 15 14 T2 Res 13 12 11 10 9 8 7 T2 Timer (1-63) T2 Res 6 K (1-7) 0-3 5 4 3 2 1 0 N2 (1-31) T2 timer resolution value 0 1 2 3 10 ms 100 ms 1 Sec 10 Secs T2 Timer 1-63 Set Timer 2 to value given (1 to 63), and Set Timer 1 to value given * 2 (2 to 126). Note that 0 is an error and is not allowed. K 1-7 L2 Window size values 1 to 7 allowed. Note that 0 is an error and is not allowed.
ZX25D X.25 Protocol Driver Configuration X.25 Link Device Option Word Definition The option word for the X.25 link (LAP-B) terminal defines: • • • • • • The default D-bit enable setting for automatic call generation. Whether to use the T25 timer (on outstanding DATA packets). Whether to complete transmitted messages immediately or wait for acknowledgment. Whether incomplete received data packet sequences can be sent up to the receiving application.
ZX25D X.25 Protocol Driver Configuration many transmitted messages, delayed responses from the network, and/or a large window size. It is recommended that this bit always be set. WARNING IRX The “Incomplete Rx Message” option is for use on Muxes with high loads (that is, many logical channels and/or large messages) and allows the Mux to send partially complete messages to the application with a “More” bit set in the tag byte (bit 4), thus reducing the demand on receive buffers in the Mux.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions Virtual Circuit Definitions The virtual circuits (switched and permanent) for X.25 are defined using the TERM definition line in the TTGEN configuration file. The virtual circuit definition defines those parameters required for level 3 of the X.25 protocol. A sample virtual circuit definition is given below: Term 120 01:4:1 X25.SVC.AUTO X25_VC_Q0_D0 ~ 79 1 201 0 1 CALL:226633011 ”X.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions mux:port:subc The Mux must have been defined in a Mux Definition statement. The port must have been defined in a Port Definition statement. The “:subc” information must be supplied for a 4-port E1/T1 card and should be omitted for all other card types. The subc must have been defined in a Subch Definition statement. This Mux and port must be valid for X.25 and there must be an X.25 link terminal defined on the port or subchannel.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions wkst. no. Workstation number, as for a normal terminal. area no. Area number, as for a normal terminal. call (dte) For an ‘X25.SVC.IN’ or ‘X25.SVC.IO’ this number specifies the remote X.121 subscription address from which this virtual circuit will accept an incoming call. If omitted, then any remote address will be allowed to establish a call on this virtual circuit and the address will remain set in the physical terminal table from then on.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions Udata This parameter allows X.25 call user data to be specified for X25.SVC.AUTO, X25.SVC.IO or X25.SVC virtual circuits which will generate outgoing calls. This call user data will be stored in a logical terminal table (LTT) extension area. The Udata entry is related to the previous Lterm or Term entry that came before it. In other words, the affected LTT extension area belongs to the LTT created for the previous Lterm or Term entry.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions Udata "abc\\045def" This will place the ASCII characters “abc\045def ” into the Udata buffer. Note that the X25UDT Logical-Data area must be defined before you can use the Udata parameter. Refer to the “Reserved Logical Data Area Definition” section on how to allocate this storage. Note that call user data is always assumed to start from byte 0 in its X25UDT Logical-Data area.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions Configuration Parameters Definition The following configuration values are currently defined for use in X.25 configuration as a replacement for the POLL and SELECT address fields. These values are used as a symbolic way of configuring the associated two 16-bit hexadecimal values. For example, X25_VC_DFLT_Q_D can be used to set the POLL address to 0 and the SELECT address to 0.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions Poll Word for X.25 SVC Configuration 15 14 13 D 12 11 10 9 8 ST D Not Used (must be 0) 7 6 5 4 3 2 1 0 D 1 => Set D-bit (End-to-End packet acknowledge) in auto call packet STD 1 => take D value from bit 14 of POLL word, else take D value from X.25 Link Option word D bit Select Word for X.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions Select Word for X.25 SVC Configuration 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Not Used (default to 0) VC Device Option Word Definition The option word for the X.25 logical channel (VC) terminal defines whether the channel is to be a permanent or switched virtual circuit (PVC or SVC), the type of SVC, and other operational characteristics to be used between the application and the X.25 protocol driver.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions Chapter 3 ACK If set, the application will confirm incoming CALLs using zx25callacc(). If clear, then the X.25 protocol driver will automatically accept an inbound call by sending an X.25 level 3 Call Accept protocol packet. Note that if this bit is set, the CNT bit should also be set so that the application is notified that an inbound call has arrived. VCT Virtual circuit type - 0=SVC, 1=PVC. IN If set, then incoming Calls are allowed.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions APD Using end-to-end acknowledgments with the D-bit set in data messages can severely reduce the maximum achievable throughput on a VC. WARNING INTC 54 This bit is used to control how inbound data packets which have the D-bit set, should be acknowledged and when definite write completion status messages are returned for transmitted messages which have the D-bit set.
ZX25D X.25 Protocol Driver Virtual Circuit Definitions Seven possible valid combinations of these option bits are covered by the predefined device types defined in /opt/acc/cfg/zcomdevice.txt. Predefined Name VC Typ e Description Optio n Word X25.SVC SVC outgoing calls 0x800 X25.SVC.IN SVC incoming calls, null call address 0x050 X25.SVC.AUTO SVC outgoing calls on enable 0x820 X25.SVC.OUT SVC outgoing calls 0x800 X25.SVC.IO SVC in/out going calls, null call address 0x850 X25.SVC.
ZX25D X.25 Protocol Driver Sample X.25 TTGEN Configuration File Sample X.25 TTGEN Configuration File This example is based on x25_sample.answ in /opt/acc/cfg. #include ”/opt/acc/cfg/ttgendefine” ttgen Configuration System-name Program-zlu Terminal-zlu Logical-Term Physical-Term Buffer-Pool Logical-Size Logical-Data Queue-Limit Transmit-Limit Unack-Limit Port-Limit E1T1-Port-Limit Node-Entry ”ACC X.
ZX25D X.25 Protocol Driver Sample X.25 TTGEN Configuration File last_outsvc 15 def_inpacket 7 def_outpacket 7 def_inwindow 2 def_outwindow 2 T1_timer res_100ms 40 T2_timer res_100ms 20 T3_T4_timer res_10s 3 Term 100 0:0 x25.pvc 0001h 9797h 79 0 0 0 0 ”X.25 PVC LCN 1” Term 101 0:0 x25.pvc 0002h 9797h 79 0 0 0 0 ”X.25 PVC LCN 2” Term 102 0:0 x25.pvc 0003h 9797h 79 0 0 0 0 ”X.25 PVC LCN 3” Term 103 0:0 x25.svc.in X25_VC_Q0_D0 ~ 79 1 201 0 1 CALL:226633004 ”X.25 SVC in from 33004” Repeat 2 Term 106 0:0 x25.
ZX25D X.25 Protocol Driver Implementation Notes Implementation Notes Overview For a complete description of the frame and packet level formats used within X.25, refer to the ITU-T recommendation, or to the documentation produced by most PTT authorities for use in conjunction with their own public packet switched networks. Each unit transmitted over an X.25 link is called a ‘frame’.
ZX25D X.25 Protocol Driver Implementation Notes acknowledgment. When an I-frame is received, timer T2 is started, and if an I-frame is transmitted, the acknowledgment will be sent with it and timer T2 will be cancelled. Only if T2 expires (no I-frame having been transmitted) will an explicit flow control frame be transmitted. The T2 timer value may be explicitly set by using the T2_timer statement.
ZX25D X.25 Protocol Driver Implementation Notes Level 2 X.25 Timers DTE - Mandatory Timers: T1 - T2 * 2 (see note) T2 - Configurable (20 milliseconds to 630 seconds) T4 - N2*T1*6 approx. (see note) DCE - Timers: NOTE T1 - T2 * 2 (see note) T2 - Configurable (20 milliseconds to 630 seconds) T3 - N2*T1*6 (see note) T1, and T3/T4 may be independently set by the use of the T1_timer, T2_timer, and T3_T4_timer keywords in the X.25 link terminal definition. See the “X.
ZX25D X.25 Protocol Driver Implementation Notes T28 - Not Supported DCE - Optional Timers: T10 - 60 seconds T11 - 180 seconds T12 - 60 seconds T13 - 60 seconds Error Handling The ZLU error counter for the X.25 link ZLU is incremented whenever an invalid frame is received, any frame needs to be re-transmitted or a FRMR (Frame Reject) frame is either transmitted or received. These counters can be viewed via the tt and ttx commands of the ZMNTR utility.
ZX25D X.25 Protocol Driver Special ZMNTR X.25 Facilities Special ZMNTR X.25 Facilities Refer to the separate ZMNTR (ZCOM monitor) documentation within the ACC Utilities Reference Guide for further information on the commands described below. Information on how the commands can be used for X.25 may be obtained from within ZMNTR by entering: ??,MOD ZMNTR has been enhanced to include facilities for the display of information specific to X.25.
4 Chapter 4 X.
X.25 Application Programming Introduction Introduction CAUTION The API described here may not be used for an X.25 link or VC ZLU that is accessed or used by the X.25/9000 Streams product. This chapter contains a general discussion of programming using the ZCOM and ACC X.25 API calls for communicating across X.25 Virtual Circuits. However, before reading this chapter you should review chapters 1, 2, and the section “Message Header” in chapter 3 of the ACC Programmer’s Reference Guide.
X.25 Application Programming Introduction NOTE This example is intended to show the general order of how these routines are called and so the parameters have been omitted. #include #include /* Initialize access to the ZCOM subsystem */ zinit(...); /* Create a program ZLU for inbound events */ zopen(&pzlu, ...); /* Initialize access to the ACC X.25 subsystem */ zx25info(...); /* Scan through the current active config and look for X.25 links and VCs */ Repeat zinfo (...
X.25 Application Programming Introduction zread(&pzlu, ...); /* Get data and/or status messages */ switch (msg type) { /* Take action based on msg type and/or status received. */ } } zclos( ...
X.25 Application Programming Programmatically Configuring X.25 Programmatically Configuring X.25 The previous chapter discussed how to create an X.25 configuration through the TTGEN configuration file. This section discusses how to programmatically modify the X.25 link and virtual circuit configurations and when those changes will take effect. Before you begin to modify an X.25 link’s configuration, all of the VC ZLUs and the X.25 link ZLU must be disabled (using zcntl).
X.25 Application Programming Programmatically Configuring X.25 If you intend to dynamically create the X.25 link ZLU, you must do this before any of the VC ZLUs are defined. If you dynamically delete the X.25 link ZLU, all of the X.25 VC ZLUs on that link must also be deleted as well. The following code fragment provides an example of how to dynamically create an X.25 link ZLU and to configure the various X.25 link related parameters. This example creates an X.
X.25 Application Programming Programmatically Configuring X.25 /* rdata.data.termret.zaddr now contains X.25 link ZLU (zcom address). */ l2zlu = rdata.data.termret.zaddr; /* Retrieve the contents of the LTT including the Logical Data Area */ if (rc = zinfo(&l2zlu, 1, (char *)<t_lda, sizeof(ltt_lda)) { /* Handle Error */ } /* Now find the Logical Data Area in the LTT (Note: X25LTAP, X25CNTN, and X25LTSZ are all defined in zcomx25.h).
X.25 Application Programming Programmatically Configuring X.25 /* Initialize the Physical Device type, poll, select and option words for the X.25 link and insert them into the Physical Terminal Table. */ term_parms.pttype = 25; /* Must be 25 for an X.25 Link ZLU. */ term_parms.ptport = 1; /* We created this link on Port 1 */ term_parms.ptpoll = 0x9009; /* DTE, Enforced D-bit negotiation, 512 pkt size */ term_parms.ptselect = 0x01EA; /* K = 7, N2 = 10 */ term_parms.
X.25 Application Programming Programmatically Configuring X.25 #include #include zaddr_type zaddr_type zconfig_type zcfgret_type struct { unsigned char unsigned char unsigned short unsigned short unsigned short } term_parms; 13zlu; pzlu; cdata; rdata; /* /* /* /* Holds X.25 Virtual Circuit ZLU. */ Our application’s program ZLU.
X.25 Application Programming X.25 Link Initialization X.25 Link Initialization Before you can communicate across an X.25 link, it must be put into an operational state. In the ZCOM subsystem this is initiated by enabling the X.25 link ZLU using the zcntl() routine. There are three components to X.25 which must all be functioning before you can communicate on a Virtual Circuit. There is X.
X.25 Application Programming X.25 Link Initialization In addition, the ACC X.25 subsystem also generates an unsolicited status message to indicate that X.25 at level 3 is up. At this point the X.25 link is in a normal operational state and can be used to establish calls and transfer data across virtual circuits. However, note that VC ZLUs must also be enabled and activated before they can be used.
X.25 Application Programming Sending and Receiving Data Sending and Receiving Data Before you can send to or receive data from an X.25 Virtual Circuit, the X.25 Link must be up, the VC ZLU must be enabled and activated, and in the case of an SVC, a call must be established. The zcntl() routine is used to enable and activate the VC ZLU and the ACC X.25 API routines are used to establish a call on an SVC.
X.25 Application Programming Sending and Receiving Data #include #include int int unsigned char zmhd_type zaddr_type zaddr_type rc; rlen; rdata[1204]; msghdr; l3zlu; pzlu; /* /* /* /* /* /* General return code. */ # of bytes returned in rdata. */ Buffer for inbound data. */ ZCOM Message header structure. */ Our X.25 Virtual Circuit ZLU. */ Our application’s program ZLU. */ /* Issue a request to enable and activate the VC ZLU.
X.25 Application Programming Sending and Receiving Data case ZCOM_MSTYPE_RSLT: /* (6) Status from local VC ZLU (terminal) */ { if (msghdr.mrq.mrqcode == ZCOM_MRQCODE_STATUS) /* Unsolicited Status */ { switch (msghdr.mrq.
X.25 Application Programming Sending and Receiving Data Receiving and Confirming Interrupt Data Inbound interrupt data packets always arrive in unsolicited status messages. Specifically the data returned by zread() will have a message type (mstype) of ZCOM_MSTYPE_RSLT, a message request code (mrqcode) of ZCOM_MRQCODE_STATUS, and a message status code (mrqstat) value of ST26INTPT. From the example above, rlen contains the length of the interrupt data and rdata contains the interrupt data, itself. In the X.
X.25 Application Programming Sending and Receiving Data Sending Interrupt Data To send an X.25 interrupt data packet, you should use the ZCOM API call zx25send_int(). If the X.25 link has been configured for 1980 operations, you may send only one byte of interrupt data. If you are using 1984 or later, you may send up to 32 bytes of interrupt data.
X.25 Application Programming Sending and Receiving Data M-Bit Handling If bit-4 of the tag byte is set by the application as it sends a message then the last packet of that message will be transmitted with the M-bit set. It is important, when making use of this facility, that the application send exact multiples of the Level 3 packet size, as a partially complete packet with the “More” bit set is illegal and will not be allowed by the network.
X.25 Application Programming Sending and Receiving Data Application End-to-End Acknowledgments Disabled (APD=0) End-to-end application acknowledgment handling is controlled through the VC ZLU’s option word APD bit. When this bit is set to zero, application end-to-end acknowledgments are disabled and all data packet D-bit handling is performed by the X.25 firmware running on the ACC card.
X.25 Application Programming Sending and Receiving Data • For received messages or message fragments with the D-bit set, the X.25 firmware does not send an X.25 level 3 acknowledgment for the message. This is now the responsibility of the application. The application must determine whether the D-bit was set by examining the tag byte.
X.25 Application Programming Using the X.25 ZCOM API Routines Using the X.25 ZCOM API Routines The remainder of this chapter contains a detailed description of each of the ACC X.25 related Application Programming Interface routines provided with the ACC X.25 protocol accessory. Note that these routines may not be used with ZLUs that are associated with a port or subchannel being used by the X.25/ACC product. That is, the J2793B X.25/9000 product.
X.25 Application Programming Using the X.25 ZCOM API Routines zx25dbit_ack Send D-bit acknowledgment (RR) for inbound data. zx25int_conf Send Interrupt Confirmation for inbound interrupt data. X.25 Manual Pages These X.25 application routines are described in detail in the man pages that follow. Facility Handling The ACC X.25 API routines provide a low-level interface to the ACC X.25 subsystem. These low-level routines do not provide any facilities checking or negotiation.
X.25 Application Programming X25STAT (3X) X25STAT (3X) x25stat – Return a formatted X.25 status or ZCOM error message NAME SYNOPSIS #include #include /* if compiled with ANSI C (recommended) */ char *x25stat (req, stat) int32 req; int32 stat; DESCRIPTION Routine x25stat returns a character string which gives an explanation of the X.25 and ZCOM status codes. It can be used as a replacement for zcomstatus where the X.25 protocol is being used.
X.25 Application Programming X25STAT (3X) PARAMETERS: req The request code associated with the terminal operation. This will be returned either with a zread call for a type 6 (ZCOM_MSTYPE_RSLT) or 14 (ZCOM_MSTYPE_RSRT) message (zmhd.mrq.mrqcode), or will be known from the call context for a mode 8 zsend, zcntl, or zport call. stat Status code (ZCOM error code if < 0). NOTES This routine reads a message file for the status message text. It uses the file zstatmsg.msg in /opt/acc/msg (ZCOM_MESSAGE_PATH).
X.25 Application Programming ZX25CALLACC (3X) — ACC X.25 ZX25CALLACC (3X) — ACC X.25 NAME zx25callacc – Confirm (accept) an inbound call SYNOPSIS #include #include int zx25callacc (zxip, vzap, fbuf, flen, ubuf, ulen, dbit, clngaddr, caldaddr) zx25info_type *zxip; zaddr_type *vzap; char *fbuf; int flen; char *ubuf; int ulen; int dbit; char *clngaddr; char *caldaddr; DESCRIPTION Routine zx25callacc is used to confirm (accept) an inbound X.25 call.
X.25 Application Programming ZX25CALLACC (3X) — ACC X.25 See the following NOTES section for more information on using this routine in a multi-threaded application. PARAMETERS: RETURN VALUE Chapter 4 zxip ZCOM X.25 access data structure (from zx25info call). vzap ZCOM address of the Virtual Circuit (terminal ZLU). fbuf Facilities data buffer. flen Facilities data length (in bytes). ubuf Call user data buffer. ulen Call user data length (in bytes).
X.25 Application Programming ZX25CALLACC (3X) — ACC X.25 ZxeUNKNOWN_VC_ZLU (13) The ZLU specified is not an X.25 Virtual Circuit ZLU. ZxeINVALID_CUD_LEN (14) The length specified for the Call User data is longer than the maximum permissible value (usually 128 bytes). ZxeINVALID_FAC_LEN (15) The length specified for the Facilities data is longer than the maximum permissible value (usually 109 bytes). ZxeRESTRICT_FAS_SEL (16) Restricted fast-select facility was specified in the inbound call.
X.25 Application Programming ZX25CALLACC (3X) — ACC X.25 NOTES 1. The X.121 call address consists of 8 bytes, and it is used a a 15-digit BCD number plus a length digit in the last position. For example, in hex: DD DD DD DD DD DD DD DL where D is a 4-bit BCD digit, whose range is from 0 to 9 L is a 4-bit length digit, whose range is from 1 to 15 The 15 address digits should be left-justified and without leading zero. The length digit indicates the number of address digits.
X.25 Application Programming ZX25CALLACC (3X) — ACC X.25 FILES SEE ALSO 90 /opt/acc/include/zcom/zcomsys.h ZCOM subsystem general include file, containing data types, data structures, constants, error codes, masks, etc. Note that this must be the first include file before any other ZCOM include files. /opt/acc/include/zcom/zcomx25.h ZCOM X.25 access data structures.
X.25 Application Programming ZX25CALLOUT (3X) — ACC X.25 ZX25CALLOUT (3X) — ACC X.25 NAME zx25callout – Initiate an out-going call SYNOPSIS #include #include int zx25callout (zxip, vzap, fbuf, flen, ubuf, ulen, dbit, clngaddr, caldaddr) zx25info_type zaddr_type char int char int int char char DESCRIPTION *zxip; *vzap; *fbuf; flen; *ubuf; ulen; dbit; *clngaddr; *caldaddr; Routine zx25callout is used to initiate an outgoing call on the SVC ZLU supplied in vzap.
X.25 Application Programming ZX25CALLOUT (3X) — ACC X.25 Threads Considerations This routine may be called from a multi-threaded application using the POSIX (1003.1c) kernel threads API package. It has the following characteristics when called by multi-threaded applications: cancellation point Thread cancellation can occur when a thread calls this routine. async-cancel unsafe The calling thread’s cancelability type must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.
X.25 Application Programming ZX25CALLOUT (3X) — ACC X.25 RETURN VALUE Routine zx25callout returns a 0 when successful. If there was a ZCOM error, it returns a negative value. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and their meanings. If zx25callout itself failed, one of the following positive error codes is returned: ZxeUNKNOWN_L2_ZLU (02) Unable to find the X.25 link ZLU for this SVC ZLU. ZxeREQ_TIMEOUT (04) The remote ZCOM system did not respond within 30 seconds.
X.25 Application Programming ZX25CALLOUT (3X) — ACC X.25 ZxeX25_NOT_INITIALIZED (98) The ACC X.25 subsystem has not been initialized. You must run zx25d_init before issuing any zx25...() calls. ZxeX25_TBL_FULL (99) NOTES The X.25 routines maintain an internal table for accessing remote ZCOM nodes. This table has room to access up to 20 different ZCOM nodes (including the local node).
X.25 Application Programming ZX25CALLOUT (3X) — ACC X.25 EXAMPLE #include #include
X.25 Application Programming ZX25CALLREJ (3X) — ACC X.25 ZX25CALLREJ (3X) — ACC X.25 NAME zx25callrej – Clear (reject) an X.25 call SYNOPSIS #include #include
X.25 Application Programming ZX25CALLREJ (3X) — ACC X.25 Threads Considerations This routine may be called from a multi-threaded application using the POSIX (1003.1c) kernel threads API package. It has the following characteristics when called by multi-threaded applications: cancellation point Thread cancellation can occur when a thread calls this routine. async-cancel unsafe The calling thread’s cancelability type must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.
X.25 Application Programming ZX25CALLREJ (3X) — ACC X.25 RETURN VALUE Routine zx25callrej returns a 0 when successful. If there was a ZCOM error, it returns a negative value. (See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and their meanings.) If zx25callrej, itself, failed, one of the following positive error codes is returned: ZxeUNKNOWN_L2_ZLU (02) Unable to find the X.25 link ZLU for this SVC ZLU. ZxeREQ_TIMEOUT (04) The remote ZCOM system did not respond within 30 seconds.
X.25 Application Programming ZX25CALLREJ (3X) — ACC X.25 ZxeX25_TBL_FULL (99) NOTES The X.25 routines maintain an internal table for accessing remote ZCOM nodes. This table has room to access up to 20 different ZCOM nodes (including the local node). This request attempted to access the 21st ZCOM remote node and the internal table used had insufficient space to save the routing data. 1. The X.
X.25 Application Programming ZX25CALLREJ (3X) — ACC X.25 EXAMPLE #include #include
X.25 Application Programming ZX25CLOSE (3X) — ACC X.25 ZX25CLOSE (3X) — ACC X.25 NAME zx25close - Clean up resources from a previous zx25info call SYNOPSIS #include #include int zx25close zx25info_type DESCRIPTION (zxip) *zxip; Routine zx25close cleans up the resources which were allocated in the previous zx25info call. After this call, the zxip pointer should not be used in other “zx25...” calls. The libraries libzx25.a, libzcom_c.a and libpthread.
X.25 Application Programming ZX25CLOSE (3X) — ACC X.25 RETURN VALUE Routine zx25close returns a 0 when successful. If there was a ZCOM error, it returns a negative value. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and their meanings. NOTES In a multi-threaded application, each thread must make a separate call to zx25info using a per-thread ZCOM X.25 access data buffer zxip.
X.25 Application Programming ZX25CLOSE (3X) — ACC X.25 FILES SEE ALSO Chapter 4 /opt/acc/include/zcom/zcomsys.h ZCOM system general include file, containing data types, data structures, constants, error codes, masks, etc. (Note: must be the first include file before any other ZCOM include files). /opt/acc/include/zcom/zcomx25.h ZCOM X.25 access data structures.
X.25 Application Programming ZX25DBIT_ACK (3X) — ACC X.25 ZX25DBIT_ACK (3X) — ACC X.25 NAME zx25dbit_ack – Send acknowledgment for a data message with the D-bit set SYNOPSIS #include #include int zx25dbit_ack (zxip, vzap) zx25info_type *zxip; zaddr_type *vzap; DESCRIPTION Routine zx25dbit_ack requests that a D-bit acknowledgment (RR) be sent in response to an inbound data message (or message fragment) which had the D-bit set. That is, an X.
X.25 Application Programming ZX25DBIT_ACK (3X) — ACC X.25 Threads Considerations This routine may be called from a multi-threaded application using the POSIX (1003.1c) kernel threads API package. It has the following characteristics when called by multi-threaded applications: cancellation point Thread cancellation can occur when a thread calls this routine. async-cancel unsafe The calling thread’s cancelability type must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.
X.25 Application Programming ZX25DBIT_ACK (3X) — ACC X.25 ZxeMUST_CALL_ZX25INFO (17) The zx25info() routine has not been called. You must call zx25info before issuing any other zx25...() calls. ZxeBAD_ZX25INFO_ADDR (18) The pointer to the zx25info_type structure does not contain the same address that was passed to the zx25info() routine. ZxeX25_NOT_INITIALIZED (98) The ACC X.25 subsystem has not been initialized. You must run zx25d_init before issuing any zx25...() calls. ZxeX25_TBL_FULL (99) The X.
X.25 Application Programming ZX25DBIT_ACK (3X) — ACC X.25 FILES SEE ALSO Chapter 4 /opt/acc/include/zcom/zcomsys.h ZCOM system general include file, containing data types, data structures, constants, error codes, masks, etc. Note that this must be the first include file before any other ZCOM include files. /opt/acc/include/zcom/zcomx25.h ZCOM X.25 access data structure declarations.
X.25 Application Programming ZX25INFO (3X) — ACC X.25 ZX25INFO (3X) — ACC X.25 NAME zx25info - Set up ACC X.25 information for subsequent “zx25...” calls SYNOPSIS #include #include int zx25info (zxip, auxname) zx25info_type char DESCRIPTION *zxip; *auxname; Routine zx25info sets up the ACC X.25 access data structure which is used in subsequent “zx25...” calls. This routine may allocate some internal resources.
X.25 Application Programming ZX25INFO (3X) — ACC X.25 PARAMETERS: RETURN VALUE NOTES zxip (Return Param) Address of the user supplied ZCOM X.25 access data structure. On successful return, access information will be setup in this buffer. This data structure is then used in subsequent zx25...(3X) calls. auxname User supplied name to use for opening the response ZLU. The name must be unique within the local node. It may be a maximum of 7 characters long, plus a terminating NULL.
X.25 Application Programming ZX25INFO (3X) — ACC X.25 EXAMPLE #include #include int zx25info_type char ierr; zxi; auxname[size]; /* size is user-defined */ if (ierr = zx25info (&zxi, auxname)) { /* error return code */ } else { /* good return code */ } FILES SEE ALSO 110 /opt/acc/include/zcom/zcomsys.h ZCOM subsystem general include file, containing data types, data structures, constants, error codes, masks, etc.
X.25 Application Programming ZX25INT_CONF (3X) — ACC X.25 ZX25INT_CONF (3X) — ACC X.25 NAME zx25int_conf – Send acknowledgment for a received interrupt packet SYNOPSIS #include #include int zx25int_conf (zxip, vzap) zx25info_type *zxip; zaddr_type *vzap; DESCRIPTION Routine zx25int_conf requests that an Interrupt Confirmation packet be sent in response to an inbound interrupt message.
X.25 Application Programming ZX25INT_CONF (3X) — ACC X.25 Threads Considerations This routine may be called from a multi-threaded application using the POSIX (1003.1c) kernel threads API package. It has the following characteristics when called by multi-threaded applications: cancellation point Thread cancellation can occur when a thread calls this routine. async-cancel unsafe The calling thread’s cancelability type must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.
X.25 Application Programming ZX25INT_CONF (3X) — ACC X.25 ZxeMUST_CALL_ZX25INFO (17) The zx25info() routine has not been called. You must call zx25info before issuing any other zx25...() calls. ZxeBAD_ZX25INFO_ADDR (18) The pointer to the zx25info_type structure does not contain the same address that was passed to the zx25info() routine. ZxeX25_NOT_INITIALIZED (98) The ACC X.25 subsystem has not been initialized. You must run zx25d_init before issuing any zx25...() calls.
X.25 Application Programming ZX25INT_CONF (3X) — ACC X.25 EXAMPLE #include #include int ierr; zx25info_type zxi; if (ierr = zx25int_conf (&zxi, &vzaddr)) { /* error return code */ } else { /* good return code */ } FILES SEE ALSO 114 /opt/acc/include/zcom/zcomsys.h ZCOM system general include file, containing data types, data structures, constants, error codes, masks, etc. Note that this must be the first include file before any other ZCOM include files.
X.25 Application Programming ZX25L2STAT_RCVR (3X) — ACC X.25 ZX25L2STAT_RCVR (3X) — ACC X.25 NAME zx25l2stat_rcvr – Setup receiver for X.25 link status messages SYNOPSIS #include #include int zx25l2stat_rcvr (zxip, action, lzap, pzap) zx25info_type int zaddr_type zaddr_type DESCRIPTION *zxip; action; *lzap; *pzap; The zx25l2stat_rcvr routine is used to add or remove the primary or shared receiver for X.25 Link unsolicited status messages.
X.25 Application Programming ZX25L2STAT_RCVR (3X) — ACC X.25 The libraries libzx25.a, libzcom_c.a and libpthread.a must be linked into the calling program by giving the “-lzx25 -lzcom_c -lpthread” options to cc(1) or ld(1). Threads Considerations This routine may be called from a multi-threaded application using the POSIX (1003.1c) kernel threads API package.
X.25 Application Programming ZX25L2STAT_RCVR (3X) — ACC X.25 RETURN VALUE Routine zx25l2stat_rcvr returns a 0 when successful. If there was a ZCOM error, it returns a negative value. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and their meanings. If zx25l2stat_rcvr, itself, failed, one of the following positive error codes is returned: ZxeUNKNOWN_L2_ZLU (02) The ZLU specified is not an X.25 link (HDLC/LAP-B) ZLU.
X.25 Application Programming ZX25L2STAT_RCVR (3X) — ACC X.25 The calling program (or thread) must call zx25info before calling this routine. In a multi-threaded application, each thread must make a separate call to zx25info using a per-thread ZCOM X.25 access data buffer zxip. The per-thread data buffer can then be used to call this routine. NOTES EXAMPLE #include #include
X.25 Application Programming ZX25L2STAT_RCVR (3X) — ACC X.25 FILES SEE ALSO Chapter 4 /opt/acc/include/zcom/zcomsys.h ZCOM system general include file, containing data types, data structures, constants, error codes, masks, etc. Note that this must be the first include file before any other ZCOM include files. /opt/acc/include/zcom/zcomx25.h ZCOM access data structure declarations.
X.25 Application Programming ZX25RESET (3X) — ACC X.25 ZX25RESET (3X) — ACC X.25 NAME zx25reset – Request a virtual circuit reset SYNOPSIS #include #include int zx25reset (zxip, vzap, cause, diag) zx25info_type zaddr_type int int DESCRIPTION *zxip; *vzap; cause; diag; Routine zx25reset requests a virtual circuit reset. It is used to initiate an X.25 RESET Request on the logical channel of the supplied Virtual Circuit ZLU. The libraries libzx25.a, libzcom_c.
X.25 Application Programming ZX25RESET (3X) — ACC X.25 PARAMETERS: RETURN VALUE zxip ZCOM X.25 access data structure (from zx25info call). vzap ZCOM address of the Virtual Circuit terminal. cause Cause code. The cause code supplied should conform to the CCITT specification for the X.25 protocol. The value must be in the range 0 to 255, but is not validated. diag Diagnostic code. The diagnostic code supplied should conform to the CCITT specification for the X.25 protocol.
X.25 Application Programming ZX25RESET (3X) — ACC X.25 ZxeX25_TBL_FULL (99) The X.25 routines maintain an internal table for accessing remote ZCOM nodes. This table has room to access up to 20 different ZCOM nodes (including the local node). This request attempted to access the 21st ZCOM remote node and the internal table used had insufficient space to save the routing data. NOTES The calling program (or thread) must call zx25info before calling this routine.
X.25 Application Programming ZX25RESET_CONF (3X) — ACC X.25 ZX25RESET_CONF (3X) — ACC X.25 NAME zx25reset_conf – Request a virtual circuit reset confirmation SYNOPSIS #include #include int zx25reset_conf (zxip, vzap) zx25info_type *zxip; zaddr_type *vzap; DESCRIPTION Routine zx25reset_conf requests a virtual circuit reset confirmation packet be sent in response to an inbound reset indication.
X.25 Application Programming ZX25RESET_CONF (3X) — ACC X.25 PARAMETERS: RETURN VALUE zxip ZCOM X.25 access data structure (from zx25info call). vzap ZCOM address of the Virtual Circuit terminal. Routine zx25reset_conf returns a 0 when successful. If there was a ZCOM error, it returns a negative value. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and their meanings.
X.25 Application Programming ZX25RESET_CONF (3X) — ACC X.25 ZxeX25_TBL_FULL (99) The X.25 routines maintain an internal table for accessing remote ZCOM nodes. This table has room to access up to 20 different ZCOM nodes (including the local node). This request attempted to access the 21st ZCOM remote node and the internal table used had insufficient space to save the routing data. NOTES The calling program (or thread) must call zx25info before calling this routine.
X.25 Application Programming ZX25SEND_INT (3X) — ACC X.25 ZX25SEND_INT (3X) — ACC X.25 NAME zx25send_int – Send Interrupt data on a Virtual Circuit SYNOPSIS #include #include int zx25send_int zx25info_type zaddr_type char int DESCRIPTION (zxip, vzap, ibuf, len) *zxip; *vzap; *ibuf; len; Routine zx25send_int requests that an Interrupt packet be sent on a Virtual Circuit. This function should only be called if the Virtual Circuit has already been setup.
X.25 Application Programming ZX25SEND_INT (3X) — ACC X.25 See the NOTES section that follows for more information on using this routine in a multi-threaded application. PARAMETERS: RETURN VALUE zxip ZCOM X.25 access data structure (from zx25info call). vzap ZCOM address of the Virtual Circuit terminal. ibuf Buffer to send (character array). len Length in Bytes to be sent Routine zx25send_int returns a 0 when successful. If there was a ZCOM error, it returns a negative value.
X.25 Application Programming ZX25SEND_INT (3X) — ACC X.25 ZxeX25_TBL_FULL (99) The X.25 routines maintain an internal table for accessing remote ZCOM nodes. This table has room to access up to 20 different ZCOM nodes (including the local node). This request attempted to access the 21st ZCOM remote node and the internal table used had insufficient space to save the routing data. NOTES The calling program (or thread) must call zx25info before calling this routine.
A Appendix A X.
X.25 Status and Completion Messages Introduction Introduction X.25 may produce a wide range of buffer status codes and unsolicited status messages, apart from the standard communications statuses. Most of the messages are received by the zx25d driver. The ACC X.25 driver (zx25d) may also produce error messages which will be logged to the system error logging device by zmlog. Refer to the Multiprotocol ACC Utilities Reference Guide for more information on zmlog.
X.25 Status and Completion Messages Introduction contains buffer completion status for a write request (zsend). Usually, this indicates an error condition. Appendix A mhdp->mid.mzsrce.zlu will contain the ZLU number of the X.25 link or Virtual Circuit the status message is associated with. mhdp->mrq.mrqstat will contain one of the status codes listed below in the lower seven bits of the field (e.g. bits 0-6).
X.25 Status and Completion Messages Buffer Completion Statuses Buffer Completion Statuses At the link level (X.25 link ZLU), the following two buffer (write) completion error statuses may be returned, as well as the more usual standard statuses. Although these are a part of the standard status set, they are not used by most protocols, and have a particular significance within X.25. Either condition will prevent the transmission of any frames across the local X.25 link.
X.25 Status and Completion Messages Unsolicited Status Messages Unsolicited Status Messages The X.25 subsystem generates many different types of X.25 unsolicited status messages. Some of the status messages provide X.25 link specific information, that is, some of the status codes are only generated by the X.25 link and will never be generated by a Virtual Circuit ZLU. Other codes pertain to various VC related protocol errors. Typically these are only delivered to the zx25d X.25 protocol driver.
X.25 Status and Completion Messages Unsolicited Status Messages an enable of the X.25 link ZLU. Most likely the remote end of the link is not responding to the HDLC/LAP-B protocol packets sent by the ACC. If bit 7 = 0, then the link is up (at level 2). ST25DSBL (65) The X.25 link has been disconnected due to a disable request on the X.25 link ZLU. ST25XDCD (66) X.25 Link disconnected or restarted due to loss of DCD. Bit 7 of the mrqstat field will indicate the current up/down state of the link.
X.25 Status and Completion Messages Unsolicited Status Messages ST25RXUA (74) X.25 Link disconnected or restarted due to a received UA (Unnumbered Acknowledgment) frame. Bit 7 of the mrqstat field will indicate the current up/down state of the link. ST25RUFR (75) X.25 Link disconnected or restarted due to a received unsolicited final response frame. Bit 7 of the mrqstat field will indicate the current up/down state of the link. ST25ENF (77) X.25 Link ZLU enable failed due to an invalid configuration.
X.25 Status and Completion Messages Unsolicited Status Messages sending large contiguous messages and/or using a TTGEN configuration file with a Port-Limit parameter that is too large. Try reducing the port limit and insure that no applications are sending large contiguous messages. If an application is sending a large contiguous message, it is recommended that the message be broken up and sent in 4,096 byte blocks using the M-bit where appropriate. ST25RSTRT (85) X.25 link Restart processing complete.
X.25 Status and Completion Messages Unsolicited Status Messages ST25BADPS (93) Bad P(S) in received packet. This indicates that a data packet received on a VC contained an invalid sequence number in the P(S) field. This will cause the VC to be reset. ST25BADPR (94) Bad P(R) in received packet. This indicates that a data packet received on a VC contained an invalid sequence number in the P(R) field. This will cause the VC to be reset. ST25RXREJ (95) The VC received a REJECT packet.
X.25 Status and Completion Messages Unsolicited Status Messages ST25RNRTO (98) A VC RNR timeout has occurred. This indicates that the remote end of the link sent an level 3 RNR which halted the outbound data traffic to the associated VC. If this condition is not cleared within 180 seconds, this status message is generated. This will cause the VC to be reset. ST25LCNBF (99) A buffer shortage has occurred for the associated Virtual Circuit.
X.25 Status and Completion Messages Unsolicited Status Messages ST25SHMPK (106) Invalid short data packet received on Virtual Circuit. This indicates a data packet was received with the M-bit set whose length was less than the X.25 level 3 packet size for this VC. This will cause the VC to be reset. ST25RNRFL (107) X.25 link port break has been issued. This is used for internal purposes. ST25PKSHT (108) Packet too short. This will cause the VC to be reset. ST25ILINT (109) Illegal interrupt packet.
X.25 Status and Completion Messages Unsolicited Status Messages this status message is received. This status message also contains 16 bits of data containing the Logical Channel Number (LCN) used for this Virtual Circuit. ST26LCDN (115) The Virtual Circuit is now in the DOWN state. This status message usually indicates the completion of the Call Clear processing for an SVC. Note that if you have issued a Clear Request, you should not attempt to place a call on this VC until you receive this status message.
X.25 Status and Completion Messages Unsolicited Status Messages ** ST26LCRSR (121) Reset Indication received on VC. If the RSET bit is set to 1 in the VC ZLU’s option word, then the application is required to confirm the reset within 60 seconds by calling zx25reset_conf(). If the RSET bit is set to 0, then the ACC X.25 subsystem will automatically issue a Reset Confirmation packet on the VC. This status is also accompanied by data structure containing the reset cause and diagnostic codes.
X.25 Status and Completion Messages Unsolicited Status Messages The status code symbolic names are available to C application programs by including the file /opt/acc/include/zcom/zx25status.h. The statuses marked “**” are received by the application with the packet data. These statuses are only received if the “notify application” option is enabled for the virtual circuit terminal. The packet data layout is described in /opt/acc/include/zcom/zcomx25.h for C as described in the following diagrams.
X.25 Status and Completion Messages Unsolicited Status Messages } char x25pkdata[X25PKDATALEN]; x25pkform_type Figure A-1 /* Facility and user data */ Packet Data layout 16 Bits X X Delivery Confirmation Bit State X25PKDBIT Cause X25PKCAUS Diagnostic X25PKDIAG Use this address instead of default X25PKDFLG Called X.121 Address (BCD) X25PKCALD (8 Bytes) 4-Bit Length X Use this address instead of default X25PKGFLG Called X.
X.