IP Programmer's Guide and Referencepublibz.boulder.ibm.com/epubs/pdf/f1a2d313.pdf · 2017-06-13 ·...

1186
z/OS Communications Server IP Programmer's Guide and Reference Version 2 Release 2 SC27-3659-06 IBM

Transcript of IP Programmer's Guide and Referencepublibz.boulder.ibm.com/epubs/pdf/f1a2d313.pdf · 2017-06-13 ·...

  • z/OS Communications Server

    IP Programmer's Guide and ReferenceVersion 2 Release 2

    SC27-3659-06

    IBM

  • Note:Before using this information and the product it supports, be sure to read the general information under “Notices” on page1111.

    This edition applies to Version 2 Release 2 of z/OS (5650-ZOS), and to subsequent releases and modifications untilotherwise indicated in new editions.

    IBM welcomes your comments. You can send us comments electronically by using one of the following methods:

    Internet email:[email protected]

    World Wide Web:http://www.ibm.com/systems/z/os/zos/webqs.html

    If you would like a reply, be sure to include your name, address, and telephone number. Make sure to include thefollowing information in your comment or note:v Title and order number of this documentv Page number or topic related to your commentWhen you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in anyway it believes appropriate without incurring any obligation to you.

    © Copyright IBM Corporation 2000, 2017.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contractwith IBM Corp.

    http://www.ibm.com/systems/z/os/zos/webqs.html

  • Contents

    Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix

    Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi

    About this document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxixWho should read this document . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxixHow this document is organized . . . . . . . . . . . . . . . . . . . . . . . . . . . xxixHow to use this document. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi

    Determining whether a publication is current . . . . . . . . . . . . . . . . . . . . . . xxxiHow to contact IBM service . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi

    Conventions and terminology that are used in this document . . . . . . . . . . . . . . . . . . xxxiiHow to read a syntax diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxiiiPrerequisite and related information . . . . . . . . . . . . . . . . . . . . . . . . . . xxxv

    Summary of changes for IP Programmer's Guide and Reference. . . . . . . . . . . xliChanges made in z/OS Communications Server Version 2 Release 2, as updated June 2017 . . . . . . . . xliChanges made in z/OS Version 2 Release 2, as updated 2017. . . . . . . . . . . . . . . . . . . xliChanges made in z/OS Version 2 Release 2, as updated September 2016 . . . . . . . . . . . . . . . xliChanges made in z/OS Version 2 Release 2, as updated March 2016 . . . . . . . . . . . . . . . . xliiChanges made in z/OS Version 2 Release 2 . . . . . . . . . . . . . . . . . . . . . . . . xliiChanges made in z/OS Version 2 Release 1, as updated September 2014 . . . . . . . . . . . . . . xliiiChanges made in z/OS Version 2 Release 1, as updated December 2013 . . . . . . . . . . . . . . xliiiSummary of changes for z/OS Version 2 Release 1 . . . . . . . . . . . . . . . . . . . . . . xliii

    Chapter 1. General programming information . . . . . . . . . . . . . . . . . . . 1Overview of Distributed Protocol Interface (DPI) versions 1.1 and 2.0 . . . . . . . . . . . . . . . . 1

    Chapter 2. SNMP agent Distributed Protocol Interface version 1.1 . . . . . . . . . . . 3SNMP agents and subagents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Processing DPI requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    Processing a GET request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Processing a SET request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Processing a GET-NEXT request . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Processing a REGISTER request . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Processing a TRAP request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5SNMP agent DPI header files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    SNMP agent DPI: Compiling and linking . . . . . . . . . . . . . . . . . . . . . . . . . . 6SNMP agent DPI: Sample compilation cataloged procedure additions . . . . . . . . . . . . . . . 6SNMP agent DPI: Sample link-edit cataloged procedure additions . . . . . . . . . . . . . . . . 6

    SNMP DPI library routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6mkDPIlist() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6fDPIparse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7mkDPIregister() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8mkDPIresponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8mkDPIset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9mkDPItrap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10mkDPItrape() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11pDPIpacket() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11query_DPI_port() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    Sample SNMP DPI client program for C sockets for version 1.1 . . . . . . . . . . . . . . . . . . 14Using the DPISAMPL program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14DPISAMPN NCCFLST for the SNMP manager . . . . . . . . . . . . . . . . . . . . . . 15Compiling and linking the DPISAMPL.C source code . . . . . . . . . . . . . . . . . . . . 16dpiSample table MIB descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    © Copyright IBM Corp. 2000, 2017 iii

  • The DPISAMPL.C source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    Chapter 3. SNMP agent Distributed Protocol Interface version 2.0 . . . . . . . . . . 35SNMP agents and subagents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    DPI agent requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36SNMP DPI version 2.0 library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    SNMP DPI Version 2.0 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Compiling and linking DPI Version 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    Compiling and linking DPI Version 2.0: UNIX System Services environment. . . . . . . . . . . . . 38Compiling and linking DPI Version 2.0: MVS environment . . . . . . . . . . . . . . . . . . 39

    DPI Version 1.x base code considerations . . . . . . . . . . . . . . . . . . . . . . . . . 39Migrating your SNMP DPI subagent to Version 2.0 . . . . . . . . . . . . . . . . . . . . . . 39

    Required actions for migrating your SNMP DPI subagent to Version 2.0 . . . . . . . . . . . . . . 39Recommended actions for migrating your SNMP DPI subagent to Version 2.0 . . . . . . . . . . . . 40snmp_dpi_xxxx_packet structures name changes . . . . . . . . . . . . . . . . . . . . . . 41

    SNMP DPI environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42SNMP DPI subagent programming concepts . . . . . . . . . . . . . . . . . . . . . . . . 42Specifying the SNMP DPI API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    DPI subagent connect processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 43DPI subagent OPEN request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43DPI subagent REGISTER request . . . . . . . . . . . . . . . . . . . . . . . . . . . 44DPI subagent GET processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46DPI subagent SET processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46DPI subagent GETNEXT processing . . . . . . . . . . . . . . . . . . . . . . . . . . 47DPI subagent GETBULK processing request . . . . . . . . . . . . . . . . . . . . . . . 48DPI subagent TRAP request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49DPI subagent ARE_YOU_THERE request . . . . . . . . . . . . . . . . . . . . . . . . 49DPI subagent UNREGISTER request . . . . . . . . . . . . . . . . . . . . . . . . . . 49DPI subagent CLOSE request . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    Multithreading programming considerations . . . . . . . . . . . . . . . . . . . . . . . . 50Functions, data structures, and constants . . . . . . . . . . . . . . . . . . . . . . . . . 51Basic DPI API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

    The DPIdebug() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53The DPI_PACKET_LEN() macro . . . . . . . . . . . . . . . . . . . . . . . . . . . 53The fDPIparse() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54The fDPIset() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54The mkDPIAreYouThere() function . . . . . . . . . . . . . . . . . . . . . . . . . . 55The mkDPIclose() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56The mkDPIopen() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57The mkDPIregister() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59The mkDPIresponse() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60The mkDPIset() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62The mkDPItrap() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64The mkDPIunregister() function . . . . . . . . . . . . . . . . . . . . . . . . . . . 65The pDPIpacket() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    Transport-related DPI API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 67The DPIawait_packet_from_agent() function . . . . . . . . . . . . . . . . . . . . . . . 67The DPIconnect_to_agent_TCP() function . . . . . . . . . . . . . . . . . . . . . . . . 69The DPIconnect_to_agent_UNIXstream() function. . . . . . . . . . . . . . . . . . . . . . 70The DPIdisconnect_from_agent() function . . . . . . . . . . . . . . . . . . . . . . . . 71The DPIget_fd_for_handle() function . . . . . . . . . . . . . . . . . . . . . . . . . . 72The DPIsend_packet_to_agent() function. . . . . . . . . . . . . . . . . . . . . . . . . 73The lookup_host() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74The lookup_host6() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    DPI structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75The snmp_dpi_close_packet structure. . . . . . . . . . . . . . . . . . . . . . . . . . 76The snmp_dpi_get_packet structure . . . . . . . . . . . . . . . . . . . . . . . . . . 76The snmp_dpi_hdr structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77The snmp_dpi_next_packet structure . . . . . . . . . . . . . . . . . . . . . . . . . . 79The snmp_dpi_resp_packet structure . . . . . . . . . . . . . . . . . . . . . . . . . . 80The snmp_dpi_set_packet structure . . . . . . . . . . . . . . . . . . . . . . . . . . 81

    iv z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • The snmp_dpi_ureg_packet structure . . . . . . . . . . . . . . . . . . . . . . . . . . 82The snmp_dpi_u64 structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    DPI OPEN character set selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84SNMP DPI constants, values, return codes, and include file . . . . . . . . . . . . . . . . . . . 84DPI CLOSE reason codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85DPI packet types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85DPI RESPONSE error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85DPI UNREGISTER reason codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86DPI SNMP value types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87Value representation of DPI SNMP value types . . . . . . . . . . . . . . . . . . . . . . . 87Value ranges and limits for DPI SNMP value types . . . . . . . . . . . . . . . . . . . . . . 88Return codes from DPI transport-related functions . . . . . . . . . . . . . . . . . . . . . . 88The snmp_dpi.h include file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    snmp_dpi.h include parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 89snmp_dpi.h include description . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    DPI subagent example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90Overview of subagent processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90SNMP DPI: Connecting to the agent . . . . . . . . . . . . . . . . . . . . . . . . . . . 92SNMP DPI: Registering a subtree with the agent . . . . . . . . . . . . . . . . . . . . . . . 94SNMP DPI: Processing requests from the agent . . . . . . . . . . . . . . . . . . . . . . . 97SNMP DPI: Processing a GET request . . . . . . . . . . . . . . . . . . . . . . . . . . 100SNMP DPI: Processing a GETNEXT request . . . . . . . . . . . . . . . . . . . . . . . . 103SNMP DPI: Processing a SET/COMMIT/UNDO request . . . . . . . . . . . . . . . . . . . . 107SNMP DPI: Processing an UNREGISTER request . . . . . . . . . . . . . . . . . . . . . . 110SNMP DPI: Processing a CLOSE request . . . . . . . . . . . . . . . . . . . . . . . . . 110SNMP DPI: Generating a TRAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

    Chapter 4. Running the sample SNMP DPI client program for version 2.0 . . . . . . 115Using the sample SNMP DPI client program . . . . . . . . . . . . . . . . . . . . . . . . 115Compiling and linking the dpi_mvs_sample.c source code . . . . . . . . . . . . . . . . . . . 115DPISimple-MIB descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    Chapter 5. SNMP manager API . . . . . . . . . . . . . . . . . . . . . . . . . 117SNMP protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117The SNMP manager API overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 118The SNMP notification API overview . . . . . . . . . . . . . . . . . . . . . . . . . . 118SNMP manager API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

    Configuration entry considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 118snmpAddVarBind – Adds a VarBind to the SnmpVarBinds structure . . . . . . . . . . . . . . . 119snmpBuildPDU – Builds an SNMP PDU . . . . . . . . . . . . . . . . . . . . . . . . 120snmpBuildSession – Creates a session . . . . . . . . . . . . . . . . . . . . . . . . . 121snmpCreateVarBinds – Creates a VarBind structure . . . . . . . . . . . . . . . . . . . . . 122snmpFreeDecodedPDU - Free the decoded PDU. . . . . . . . . . . . . . . . . . . . . . 123snmpFreeOID - Free an OID string . . . . . . . . . . . . . . . . . . . . . . . . . . 123snmpFreePDU – Frees the resources of a PDU . . . . . . . . . . . . . . . . . . . . . . 124snmpFreeVarBinds – Frees the VarBinds structure . . . . . . . . . . . . . . . . . . . . . 124snmpGetErrorInfo - Get the error information from the PDU response . . . . . . . . . . . . . . 124snmpGetNumberOfVarBinds – Get the number of VarBinds attached to the PDU. . . . . . . . . . . 125snmpGetOID – Get the OID from the VarBind structure . . . . . . . . . . . . . . . . . . . 126snmpGetRequestId – Get the PDU’s requestId value . . . . . . . . . . . . . . . . . . . . 126snmpGetSockFd – Get the socket’s file descriptor . . . . . . . . . . . . . . . . . . . . . 127snmpGetValue – Get the value from the VarBind structure . . . . . . . . . . . . . . . . . . 127snmpGetVarbind – Get a VarBind attached to the PDU . . . . . . . . . . . . . . . . . . . 127snmpInitialize – Initialize the manager environment . . . . . . . . . . . . . . . . . . . . 128snmpSendRequest – Send the snmpPDU request to an agent . . . . . . . . . . . . . . . . . 129snmpSetLogFunction – Set the logging level . . . . . . . . . . . . . . . . . . . . . . . 131snmpSetLogLevel – Set the logging level . . . . . . . . . . . . . . . . . . . . . . . . 131snmpSetRequestId – Set the PDU’s requestId value. . . . . . . . . . . . . . . . . . . . . 132snmpTerminate – Release the resources . . . . . . . . . . . . . . . . . . . . . . . . . 133snmpTerminateSession – Terminate a session . . . . . . . . . . . . . . . . . . . . . . . 133

    Contents v

  • snmpValueCreateCounter32 – Create an smiValue of type Counter32 . . . . . . . . . . . . . . . 134snmpValueCreateCounter64 – Create an smiValue of type Counter64 . . . . . . . . . . . . . . . 134snmpValueCreateGauge32 – Create an smiValue of type Gauge32 . . . . . . . . . . . . . . . . 134snmpValueCreateInteger – Create an smiValue of type Integer . . . . . . . . . . . . . . . . . 135snmpValueCreateInteger32 – Create an smiValue of type Integer32 . . . . . . . . . . . . . . . 135snmpValueCreateIPAddr – Create an smiValue of type IPAddr . . . . . . . . . . . . . . . . . 136snmpValueCreateNull – Create an smiValue of type Null . . . . . . . . . . . . . . . . . . . 136snmpValueCreateOctet – Create an smiValue of type Octet . . . . . . . . . . . . . . . . . . 136snmpValueCreateOID – Create an smiValue of type OID . . . . . . . . . . . . . . . . . . . 137snmpValueCreateOpaque – Create an smiValue of type Opaque . . . . . . . . . . . . . . . . 137snmpValueCreateTimerTicks – Create an smiValue of type TimerTicks . . . . . . . . . . . . . . 138snmpValueCreateUnsigned32 – Create an smiValue of type Unsigned32 . . . . . . . . . . . . . . 138

    SNMP notification API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139snmpBuildV1TrapPDU – Builds an SNMP V1 trap PDU . . . . . . . . . . . . . . . . . . . 139snmpBuildV2TrapOrInformPDU – Builds an SNMP V2 trap or inform PDU . . . . . . . . . . . . 141

    SNMP manager API configuration file . . . . . . . . . . . . . . . . . . . . . . . . . . 142SNMP manager API statement syntax . . . . . . . . . . . . . . . . . . . . . . . . . 142Steps for compiling and linking SNMP manager API applications . . . . . . . . . . . . . . . . 145Running your SNMP manager API application . . . . . . . . . . . . . . . . . . . . . . 145Debugging the SNMP manager API . . . . . . . . . . . . . . . . . . . . . . . . . . 146Sample SNMP manager API source code . . . . . . . . . . . . . . . . . . . . . . . . 147

    Chapter 6. Resource Reservation Setup Protocol API (RAPI) . . . . . . . . . . . . 149API outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150Compiling and linking RAPI applications . . . . . . . . . . . . . . . . . . . . . . . . . 150Running RAPI applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151Event upcall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

    rapi_event_rtn_t - Event upcall . . . . . . . . . . . . . . . . . . . . . . . . . . . 151Client library services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

    rapi_release - Remove a session . . . . . . . . . . . . . . . . . . . . . . . . . . . 154rapi_reserve - Make, modify, or delete a reservation . . . . . . . . . . . . . . . . . . . . 154rapi_sender - Specify sender parameters . . . . . . . . . . . . . . . . . . . . . . . . 156rapi_session - Create a session. . . . . . . . . . . . . . . . . . . . . . . . . . . . 157rapi_version - RAPI version . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

    RAPI formatting routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158rapi_fmt_adspec - Format an adspec. . . . . . . . . . . . . . . . . . . . . . . . . . 159rapi_fmt_filtspec - Format a filtspec . . . . . . . . . . . . . . . . . . . . . . . . . . 159rapi_fmt_flowspec - Format a flowspec . . . . . . . . . . . . . . . . . . . . . . . . . 160rapi_fmt_tspec - Format a tspec . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

    RAPI objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162RAPI objects - Flowspecs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162RAPI objects - Sender tspecs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162RAPI objects - Adspecs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163RAPI objects - Filter specs and sender templates. . . . . . . . . . . . . . . . . . . . . . 163

    RAPI asynchronous event handling . . . . . . . . . . . . . . . . . . . . . . . . . . . 163rapi_dispatch - Dispatch API event . . . . . . . . . . . . . . . . . . . . . . . . . . 165rapi_getfd - Get file descriptor. . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

    RAPI error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165RAPI error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166RSVP error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

    RAPI header files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168RAPI header files: Integer and floating point types . . . . . . . . . . . . . . . . . . . . . 168The header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168Integrated services data structures and macros . . . . . . . . . . . . . . . . . . . . . . 174

    Chapter 7. X Window System interface in the z/OS Communications Serverenvironment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183X Window System and Motif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

    DLL support for the X Window System . . . . . . . . . . . . . . . . . . . . . . . . 184How the X Window System interface works in the MVS environment . . . . . . . . . . . . . . 185

    vi z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • X Window System programming considerations . . . . . . . . . . . . . . . . . . . . . 186Running an X Window System or Motif DLL-enabled application . . . . . . . . . . . . . . . . 187X Window System environment variables . . . . . . . . . . . . . . . . . . . . . . . . 188Motif environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189EBCDIC/ASCII translation in the X Window System . . . . . . . . . . . . . . . . . . . . 190Standard clients supplied with MVS z/OS UNIX X Window System support . . . . . . . . . . . . 190Demonstration programs supplied with MVS z/OS UNIX X Window System support . . . . . . . . . 191X Window System and Motif files locations . . . . . . . . . . . . . . . . . . . . . . . 191

    Chapter 8. Remote procedure calls in the z/OS Communications Server environment 195The RPC interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195Portmapper and rpcbind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

    Contacting portmapper or rpcbind . . . . . . . . . . . . . . . . . . . . . . . . . . 198Portmapper and rpcbind target assistance . . . . . . . . . . . . . . . . . . . . . . . . 198Registering with rpcbind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199Deregistering with rpcbind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200Obtaining address lists from the rpcbind server . . . . . . . . . . . . . . . . . . . . . . 200RPC servers in a CINET environment . . . . . . . . . . . . . . . . . . . . . . . . . 201Using ENF event code 80 to listen for rpcbind events . . . . . . . . . . . . . . . . . . . . 201RPCGEN command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202clnt_stat enumerated type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

    Porting RPC applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204Remapping file names with MANIFEST.H. . . . . . . . . . . . . . . . . . . . . . . . 204Accessing system return messages . . . . . . . . . . . . . . . . . . . . . . . . . . 204Printing system return messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 205Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205Header files for remote procedure calls . . . . . . . . . . . . . . . . . . . . . . . . . 205

    Compiling and linking RPC applications . . . . . . . . . . . . . . . . . . . . . . . . . 205Compatibility considerations when compiling and linking RPC applications . . . . . . . . . . . . 206Sample compilation cataloged procedure additions . . . . . . . . . . . . . . . . . . . . . 206Compiling and linking RPC applications: Nonreentrant modules . . . . . . . . . . . . . . . . 206Compiling and linking RPC applications: Reentrant modules . . . . . . . . . . . . . . . . . 206

    RPC global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206rpc_createerr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207svc_fds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207svc_fdset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207Remote procedure and external data representation calls . . . . . . . . . . . . . . . . . . . . 208auth_destroy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208authnone_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208authunix_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209authunix_create_default() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209callrpc() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210clnt_broadcast(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211clnt_call(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212clnt_control() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213clnt_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214clnt_destroy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215clnt_freeres() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216clnt_geterr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216clnt_pcreateerror() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217clnt_perrno() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218clnt_perror() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218clnt_spcreateerror() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219clnt_sperrno() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220clnt_sperror() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220clntraw_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221clnttcp_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222clntudp_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223get_myaddress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224getrpcport() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225pmap_getmaps() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

    Contents vii

  • pmap_getport() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226pmap_rmtcall() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227pmap_set() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228pmap_unset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229registerrpc() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230svc_destroy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231svc_freeargs() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231svc_getargs() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232svc_getcaller() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233svc_getreq() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233svc_getreqset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233svc_register() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234svc_run() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235svc_sendreply(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235svc_unregister() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236svcerr_auth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237svcerr_decode(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237svcerr_noproc() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238svcerr_noprog(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238svcerr_progvers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239svcerr_systemerr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239svcerr_weakauth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240svcraw_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240svctcp_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241svcudp_create(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241xdr_accepted_reply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242xdr_array() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243xdr_authunix_parms() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244xdr_bool() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244xdr_bytes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245xdr_callhdr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246xdr_callmsg() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246xdr_char() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247xdr_destroy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248xdr_double() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248xdr_enum() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249xdr_float() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250xdr_free(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250xdr_getpos() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251xdr_inline() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252xdr_int() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252xdr_long() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253xdr_opaque() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254xdr_opaque_auth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254xdr_pmap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255xdr_pmaplist() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256xdr_pointer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256xdr_reference() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257xdr_rejected_reply() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258xdr_replymsg() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259xdr_setpos() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259xdr_short() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260xdr_string() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261xdr_text_char() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261xdr_u_char(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262xdr_u_int() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263xdr_u_long() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263xdr_u_short() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264xdr_union() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265xdr_vector() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266xdr_void() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267

    viii z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • xdr_wrapstring() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267xdrmem_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268xdrrec_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268xdrrec_endofrecord() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269xdrrec_eof() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270xdrrec_skiprecord() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270xdrstdio_create() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270xprt_register() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271xprt_unregister() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271Sample RPC programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272

    Running RPC sample programs . . . . . . . . . . . . . . . . . . . . . . . . . . . 272RPC client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272RPC server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273RPC raw data stream. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

    RPCGEN sample programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278Generating your own sequential data sets . . . . . . . . . . . . . . . . . . . . . . . . 278Building client and server executable modules . . . . . . . . . . . . . . . . . . . . . . 278Running RPCGEN sample programs . . . . . . . . . . . . . . . . . . . . . . . . . 278

    Chapter 9. Remote procedure calls in the z/OS UNIX System Services environment 281Deviations from Sun RPC 4.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281Using z/OS UNIX System Services RPC . . . . . . . . . . . . . . . . . . . . . . . . . 282Support for 64-bit integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282UDP transport protocol CLIENT handles . . . . . . . . . . . . . . . . . . . . . . . . . 283RPC restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

    Chapter 10. Network Computing System. . . . . . . . . . . . . . . . . . . . . 285NCS and the Network Computing Architecture . . . . . . . . . . . . . . . . . . . . . . . 285NCS components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

    Remote procedure call runtime library . . . . . . . . . . . . . . . . . . . . . . . . . 285Location broker. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286Network interface definition language compiler . . . . . . . . . . . . . . . . . . . . . . 286

    MVS implementation of NCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286NCS system IDL data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288NCS C header data sets and the Pascal include data set . . . . . . . . . . . . . . . . . . . . 288NCS RPC run-time library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288NCS portability issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

    NCS defines NCSDEFS.H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289Required user-defined USERDEFS.H . . . . . . . . . . . . . . . . . . . . . . . . . 289

    NCS: Preprocessing, compiling, and linking . . . . . . . . . . . . . . . . . . . . . . . . 290NCS preprocessor programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290Compiling and linking NCS programs . . . . . . . . . . . . . . . . . . . . . . . . . 295

    Running UUID@GEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297NCS sample programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297The NCSSMP sample program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297

    NCS sample redefines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298Compiling, linking, and running the sample BINOP program . . . . . . . . . . . . . . . . . . 298

    Setting up the sample BINOP program . . . . . . . . . . . . . . . . . . . . . . . . . 299Compiling the sample BINOP program. . . . . . . . . . . . . . . . . . . . . . . . . 300Linking the sample BINOP program. . . . . . . . . . . . . . . . . . . . . . . . . . 301Running the sample BINOP program . . . . . . . . . . . . . . . . . . . . . . . . . 302

    Compiling, linking, and running the NCSSMP program . . . . . . . . . . . . . . . . . . . . 303Setting up the NCSSMP program. . . . . . . . . . . . . . . . . . . . . . . . . . . 303Compiling the NCSSMP program . . . . . . . . . . . . . . . . . . . . . . . . . . 304Linking the NCSSMP program . . . . . . . . . . . . . . . . . . . . . . . . . . . 305Running the NCSSMP program . . . . . . . . . . . . . . . . . . . . . . . . . . . 307

    Compiling, linking, and running the sample BANK program . . . . . . . . . . . . . . . . . . 307Setting up the sample BANK program . . . . . . . . . . . . . . . . . . . . . . . . . 308Compiling the sample BANK program . . . . . . . . . . . . . . . . . . . . . . . . . 309Linking the sample BANK program . . . . . . . . . . . . . . . . . . . . . . . . . . 310

    Contents ix

  • Running the sample BANK program . . . . . . . . . . . . . . . . . . . . . . . . . 312

    Chapter 11. Running the sample mail filter program . . . . . . . . . . . . . . . . 313Compiling and linking the lf_smpl.c source code . . . . . . . . . . . . . . . . . . . . . . 313Specifying filters in the sendmail configuration file . . . . . . . . . . . . . . . . . . . . . . 313Running the sample mail filter program . . . . . . . . . . . . . . . . . . . . . . . . . 313Library control functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

    smfi_register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314smfi_setconn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315smfi_settimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315smfi_main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

    Data access functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316smfi_getsymval. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316smfi_getpriv. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317smfi_setpriv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317smfi_setreply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318

    Message modification functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318smfi_addheader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319smfi_chgheader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319smfi_addrcpt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320smfi_delrcpt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321smfi_replacebody . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

    Mail filter callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322xxfi_connect - Connection information . . . . . . . . . . . . . . . . . . . . . . . . . 323xxfi_helo - SMTP HELO/EHLO command . . . . . . . . . . . . . . . . . . . . . . . 323xxfi_envfrom - Envelope sender . . . . . . . . . . . . . . . . . . . . . . . . . . . 324xxfi_envrcpt - Envelope recipient . . . . . . . . . . . . . . . . . . . . . . . . . . . 324xxfi_header - Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325xxfi_eoh - End of header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326xxfi_body - body block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326xxfi_eom - End of message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326xxfi_abort - Message aborted . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327xxfi_close - Connection cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

    Chapter 12. Policy API (PAPI) . . . . . . . . . . . . . . . . . . . . . . . . . 329API outline for retrieving data from Policy Agent . . . . . . . . . . . . . . . . . . . . . . 329Compiling and linking PAPI applications . . . . . . . . . . . . . . . . . . . . . . . . . 329Running PAPI applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330PAPI return codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330PAPI client library services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331PAPI: Connecting and retrieving data . . . . . . . . . . . . . . . . . . . . . . . . . . 332

    papi_connect - Connect to Policy Agent . . . . . . . . . . . . . . . . . . . . . . . . 332papi_debug - Set debug capability . . . . . . . . . . . . . . . . . . . . . . . . . . 333papi_disconnect - Disconnect from the Policy Agent . . . . . . . . . . . . . . . . . . . . 333papi_free_perf_data - Free retrieved QoS performance data . . . . . . . . . . . . . . . . . . 334papi_get_perf_data - Retrieve QoS performance data . . . . . . . . . . . . . . . . . . . . 335

    PAPI helper functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337papi_get_action_perf_by_id - Obtain performance information on the action specified by the action ID . . . 337papi_get_action_perf_info - Obtain performance information on a particular action . . . . . . . . . . 338papi_get_actions_count - Obtain number of actions in the policy performance data . . . . . . . . . . 339papi_get_policy_instance - Obtain policy instance number for policies in the policy performance data . . . . 339papi_get_rule_perf_by_id - Obtain performance information on the rule specified by the rule ID . . . . . 340papi_get_rule_perf_info - Obtain performance information on a particular rule . . . . . . . . . . . 340papi_get_rules_count - Obtain number of rules in the policy performance data . . . . . . . . . . . 341papi_strerror - Return string describing PAPI return code value . . . . . . . . . . . . . . . . 342

    Chapter 13. FTP Client Application Programming Interface (API) . . . . . . . . . . 343FTP client API compatibility considerations . . . . . . . . . . . . . . . . . . . . . . . . 344FTP client API guidelines and requirements . . . . . . . . . . . . . . . . . . . . . . . . 344Java call formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

    x z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • COBOL, C, REXX, assembler, and PL/I call formats . . . . . . . . . . . . . . . . . . . . . 347Converting parameter descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 348z/OS FTP client behavior when invoked from the FTP client API . . . . . . . . . . . . . . . . . 348FTP Client Application Interface (FCAI) control block . . . . . . . . . . . . . . . . . . . . . 350FTP Client Application Interface (FCAI) stem variables . . . . . . . . . . . . . . . . . . . . 358

    Predefined REXX variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359Sending requests to the FTP client API . . . . . . . . . . . . . . . . . . . . . . . . . . 365

    INIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366SCMD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369POLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372GETL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374TERM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380

    FTP client API for C functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382FAPI_INIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382FAPI_SCMD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383FAPI_POLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383FAPI_GETL_COPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384FAPI_GETL_FIND. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384FAPI_TERM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385

    FTP client API for REXX function . . . . . . . . . . . . . . . . . . . . . . . . . . . 385Handling of SIGCHLD signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . 386FTP client API for REXX trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386FTP client API requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389FTP client API for REXX trace return codes . . . . . . . . . . . . . . . . . . . . . . . 402

    Output register information for the FTP client API . . . . . . . . . . . . . . . . . . . . . . 403FTP client API: Other output that is returned to the application . . . . . . . . . . . . . . . . . 403Prompts from the client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404

    Prompts not used by the FTP client API . . . . . . . . . . . . . . . . . . . . . . . . 404Prompts returned in FCAI-Status . . . . . . . . . . . . . . . . . . . . . . . . . . . 405FTP client API command prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . 406

    FTP client API messages and replies . . . . . . . . . . . . . . . . . . . . . . . . . . . 406Interpreting results from an interface request . . . . . . . . . . . . . . . . . . . . . . . . 407

    FCAI request completion values . . . . . . . . . . . . . . . . . . . . . . . . . . . 407Considerations when evaluating request completion values . . . . . . . . . . . . . . . . . . 409

    Programming notes for the FTP client API. . . . . . . . . . . . . . . . . . . . . . . . . 409FCAI_Status_TraceFailed and FCAI_TraceStatus: Reporting failures in the interface trace function . . . . . 409FCAI_IE_LengthInvalid: Improper lengths passed to the interface . . . . . . . . . . . . . . . . 410FCAI_ReqTimer: Controlling requests that retrieve results from the created z/OS FTP client process . . . . 410FCAI_PollWait: Specifying a wait time before POLL . . . . . . . . . . . . . . . . . . . . 411FCAI_IE_InternalErr: Unanticipated exceptional conditions in the interface . . . . . . . . . . . . . 412Exceptional conditions in the z/OS FTP client . . . . . . . . . . . . . . . . . . . . . . 412

    Using the FTP client API trace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413FTP client API sample programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417

    Chapter 14. Network management interfaces . . . . . . . . . . . . . . . . . . . 419Local IPSec NMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420

    Local IPSec NMI: Configuring the interface . . . . . . . . . . . . . . . . . . . . . . . 421Local IPSec NMI: Connecting to the server . . . . . . . . . . . . . . . . . . . . . . . 422IPSec NMI request/response format . . . . . . . . . . . . . . . . . . . . . . . . . . 423IPSec NMI request messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428IPSec NMI monitoring request format . . . . . . . . . . . . . . . . . . . . . . . . . 430IPSec NMI control request formats . . . . . . . . . . . . . . . . . . . . . . . . . . 435IPSec NMI response messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439IPSec NMI initialization and termination messages . . . . . . . . . . . . . . . . . . . . . 475IPSec NMI return and reason codes . . . . . . . . . . . . . . . . . . . . . . . . . . 475

    Network security services (NSS) network management NMI . . . . . . . . . . . . . . . . . . 478Network security services NMI: Configuring the interface . . . . . . . . . . . . . . . . . . 479Network security services NMI: Connecting to the server . . . . . . . . . . . . . . . . . . 480Network security services NMI request and response format . . . . . . . . . . . . . . . . . 480Network security services NMI request messages . . . . . . . . . . . . . . . . . . . . . 481Network security services NMI response messages . . . . . . . . . . . . . . . . . . . . . 481

    Contents xi

  • Network security services NMI initialization and termination messages . . . . . . . . . . . . . . 484Network security services NMI return and reason codes . . . . . . . . . . . . . . . . . . . 484

    Real-time application-controlled TCP/IP trace NMI (EZBRCIFR) . . . . . . . . . . . . . . . . . 488Real-time control NMI: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 489Real-time control NMI: Configuration and enablement . . . . . . . . . . . . . . . . . . . 491Real-time control NMI: Invoking the requests . . . . . . . . . . . . . . . . . . . . . . 492Real-time control NMI: Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . 497

    Real-time TCP/IP network monitoring NMI . . . . . . . . . . . . . . . . . . . . . . . . 527Steps for using the real-time NMI . . . . . . . . . . . . . . . . . . . . . . . . . . 529Real-time NMI: Configuration and enablement . . . . . . . . . . . . . . . . . . . . . . 530Real-time NMI: Connecting to the server . . . . . . . . . . . . . . . . . . . . . . . . 532Real-time NMI: Interacting with the servers . . . . . . . . . . . . . . . . . . . . . . . 532Real-time NMI: Common record header . . . . . . . . . . . . . . . . . . . . . . . . 533Real-time NMI: Requests sent by the client to the server . . . . . . . . . . . . . . . . . . . 534Real-time NMI: Records sent by the server to the client . . . . . . . . . . . . . . . . . . . 534Real-time NMI: Copying the real-time data . . . . . . . . . . . . . . . . . . . . . . . 537Real-time NMI: Processing the output records . . . . . . . . . . . . . . . . . . . . . . 541Real-time SMF NMI: FTP SMF type 119 subtypes 100-104 record formats . . . . . . . . . . . . . 546

    Resolver NMI (EZBREIFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569Resolver NMI: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569Resolver NMI: Configuration and enablement . . . . . . . . . . . . . . . . . . . . . . 569Resolver NMI: Using the EZBREIFR requests . . . . . . . . . . . . . . . . . . . . . . . 569Resolver NMI: Request and response formats . . . . . . . . . . . . . . . . . . . . . . 573Resolver NMI: Request and response data structures . . . . . . . . . . . . . . . . . . . . 582Resolver NMI: Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582

    SMF records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584SMF type 109 records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585SMF type 118 records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585SMF type 119 records. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586

    SNA network monitoring NMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587SNA network monitoring NMI configuration . . . . . . . . . . . . . . . . . . . . . . . 587SNA network monitoring NMI: Enabling and disabling the interface . . . . . . . . . . . . . . . 588SNA network monitoring NMI: Communicating with the server . . . . . . . . . . . . . . . . 588SNA network monitoring NMI request/response format . . . . . . . . . . . . . . . . . . . 589NMI request errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599

    TCP/IP callable NMI (EZBNMIFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 600EZBNMIFR overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601EZBNMIFR: Configuration and enablement . . . . . . . . . . . . . . . . . . . . . . . 602Using the EZBNMIFR requests . . . . . . . . . . . . . . . . . . . . . . . . . . . 602TCP/IP NMI request format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606TCP/IP NMI response format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619TCP/IP NMI request and response data structures . . . . . . . . . . . . . . . . . . . . . 628TCP/IP NMI examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628

    Trace record formatting NMI (EZBCTAPI) . . . . . . . . . . . . . . . . . . . . . . . . . 632EZBCTAPI NMI: Configuration and enablement. . . . . . . . . . . . . . . . . . . . . . 634EZBCTAPI NMI: Invoking the interface . . . . . . . . . . . . . . . . . . . . . . . . 634EZBCTAPI NMI: Passing options to the trace formatter . . . . . . . . . . . . . . . . . . . 648

    Common real-time trace record attributes . . . . . . . . . . . . . . . . . . . . . . . . . 651Network management diagnosis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655File storage locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656

    Chapter 15. Application Transparent Transport Layer Security (AT-TLS) . . . . . . . 659CICS transaction considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660Using the SIOCTTLSCTL ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661

    Starting AT-TLS on a connection . . . . . . . . . . . . . . . . . . . . . . . . . . . 661Stopping AT-TLS on a connection . . . . . . . . . . . . . . . . . . . . . . . . . . 661Requesting AT-TLS queries and additional functions . . . . . . . . . . . . . . . . . . . . 662Steps for implementing an aware server application . . . . . . . . . . . . . . . . . . . . 662Steps for implementing a controlling server application . . . . . . . . . . . . . . . . . . . 663

    Coding the SIOCTTLSCTL ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665SIOCTTLSCTL (X'C038D90B') . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667

    xii z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • SIOCTTLSCTL ioctl return values . . . . . . . . . . . . . . . . . . . . . . . . . . 677SIOCTTLSCTL ioctl coding examples . . . . . . . . . . . . . . . . . . . . . . . . . 679

    Chapter 16. Trusted TCP connections . . . . . . . . . . . . . . . . . . . . . . 683Sysplex-specific connection routing information . . . . . . . . . . . . . . . . . . . . . . . 683

    Steps for retrieving connection routing information. . . . . . . . . . . . . . . . . . . . . 685Partner security credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686

    Steps for retrieving partner security credentials . . . . . . . . . . . . . . . . . . . . . . 686Programming requirements for the SO_CLUSTERCONNTYPE socket option . . . . . . . . . . . . . 688Programming requirements for the SIOCGPARTNERINFO and SIOCSPARTNERINFO ioctl calls . . . . . . 688Coding the SO_CLUSTERCONNTYPE socket option . . . . . . . . . . . . . . . . . . . . . 689Coding the SIOCSPARTNERINFO and SIOCGPARTNERINFO ioctl calls . . . . . . . . . . . . . . 690

    SIOCSPARTNERINFO (X'8004F613') . . . . . . . . . . . . . . . . . . . . . . . . . . 691SIOCGPARTNERINFO (X'C000F612') . . . . . . . . . . . . . . . . . . . . . . . . . 692Coding examples – SIOCSPARTNERINFO and SIOCGPARTNERINFO ioctl calls . . . . . . . . . . . 699

    Chapter 17. Interfacing with the Digital Certificate Access Server (DCAS) . . . . . . 703Understanding how clients interface to DCAS . . . . . . . . . . . . . . . . . . . . . . . 703Interfacing with the DCAS: Defining the format for request and response specifications . . . . . . . . . 704Configuring the DCAS server to work with your solution . . . . . . . . . . . . . . . . . . . 708

    Chapter 18. Miscellaneous programming interfaces . . . . . . . . . . . . . . . . 711SIOCSAPPLDATA IOCTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711

    SIOCSAPPLDATA input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711SIOCSAPPLDATA output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712SIOCSAPPLDATA C language example. . . . . . . . . . . . . . . . . . . . . . . . . 712

    SIOCSMOCTL IOCTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713SIOCSMOCTL input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713SIOCSMOCTL output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714Steps for creating an ancillary socket . . . . . . . . . . . . . . . . . . . . . . . . . 715Applications in a common INET environment . . . . . . . . . . . . . . . . . . . . . . 715

    TCP_KeepAlive socket option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716

    Appendix A. Well-known port assignments . . . . . . . . . . . . . . . . . . . 719Well-known UDP port assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . 720

    Appendix B. Programming interfaces for providing classification data to be used indifferentiated services policies . . . . . . . . . . . . . . . . . . . . . . . . . 723Passing application classification data on SENDMSG . . . . . . . . . . . . . . . . . . . . . 724Additional SENDMSG considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 727

    Appendix C. Type 109 SMF records . . . . . . . . . . . . . . . . . . . . . . . 729

    Appendix D. Type 118 SMF records . . . . . . . . . . . . . . . . . . . . . . . 731Standard subtype record numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 731TN3270E Telnet server SMF record layout . . . . . . . . . . . . . . . . . . . . . . . . . 732FTP server Type 118 SMF record layout . . . . . . . . . . . . . . . . . . . . . . . . . 733SMF record layout for API calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735SMF record layout for FTP client calls . . . . . . . . . . . . . . . . . . . . . . . . . . 736SMF record layout for Telnet client calls . . . . . . . . . . . . . . . . . . . . . . . . . 738SMF record layout for TCPIPSTATISTICS . . . . . . . . . . . . . . . . . . . . . . . . . 739

    Appendix E. Type 119 SMF records . . . . . . . . . . . . . . . . . . . . . . . 743Mapping SMF records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744

    Assembler applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744C/C++ applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744

    Processing SMF records for IP security . . . . . . . . . . . . . . . . . . . . . . . . . . 745Common Type 119 SMF record format . . . . . . . . . . . . . . . . . . . . . . . . . . 745SMF 119 record subtypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746

    Contents xiii

  • Standard data format concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748Common TCP/IP identification section . . . . . . . . . . . . . . . . . . . . . . . . . . 749TCP connection initiation record (subtype 1) . . . . . . . . . . . . . . . . . . . . . . . . 751TCP connection termination record (subtype 2) . . . . . . . . . . . . . . . . . . . . . . . 753FTP client transfer completion record (subtype 3) . . . . . . . . . . . . . . . . . . . . . . 764TCP/IP profile event record (subtype 4) . . . . . . . . . . . . . . . . . . . . . . . . . 769

    Relationship to GetProfile Callable NMI . . . . . . . . . . . . . . . . . . . . . . . . 770Continuing the SMF record. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770Two-phase SMF record creation for VIPADYNAMIC/ENDVIPADYNAMIC profile statement information . . 770Cancelled configuration information. . . . . . . . . . . . . . . . . . . . . . . . . . 771Data format concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772TCP/IP profile record self-defining section . . . . . . . . . . . . . . . . . . . . . . . 772TCP/IP profile record TCP/IP stack identification section . . . . . . . . . . . . . . . . . . 774TCP/IP profile record profile information common section . . . . . . . . . . . . . . . . . . 775TCP/IP profile record profile information data set name section . . . . . . . . . . . . . . . . 778TCP/IP profile record autolog procedure section . . . . . . . . . . . . . . . . . . . . . 778TCP/IP profile record IPv4 configuration section . . . . . . . . . . . . . . . . . . . . . 779TCP/IP profile record IPv6 configuration section . . . . . . . . . . . . . . . . . . . . . 783TCP/IP profile record TCP configuration section . . . . . . . . . . . . . . . . . . . . . 786TCP/IP profile record UDP configuration section . . . . . . . . . . . . . . . . . . . . . 787TCP/IP profile record Global configuration section . . . . . . . . . . . . . . . . . . . . . 788TCP/IP profile record Port section . . . . . . . . . . . . . . . . . . . . . . . . . . 792TCP/IP profile record interface section . . . . . . . . . . . . . . . . . . . . . . . . . 795TCP/IP profile record IPv6 address section . . . . . . . . . . . . . . . . . . . . . . . 802TCP/IP profile record Routing section . . . . . . . . . . . . . . . . . . . . . . . . . 803TCP/IP profile record source IP section . . . . . . . . . . . . . . . . . . . . . . . . 805TCP/IP profile record management section . . . . . . . . . . . . . . . . . . . . . . . 808TCP/IP profile record IPSec common section . . . . . . . . . . . . . . . . . . . . . . . 810TCP/IP profile record IPSec rule section . . . . . . . . . . . . . . . . . . . . . . . . 811TCP/IP profile record network access section. . . . . . . . . . . . . . . . . . . . . . . 817TCP/IP profile record dynamic VIPA (DVIPA) address section . . . . . . . . . . . . . . . . . 820TCP/IP profile record dynamic VIPA (DVIPA) routing section . . . . . . . . . . . . . . . . . 823TCP/IP profile record distributed dynamic VIPA (DVIPA) section . . . . . . . . . . . . . . . . 824TCP/IP profile record policy table for IPv6 default address selection section . . . . . . . . . . . . 828

    TCP/IP statistics record (subtype 5) . . . . . . . . . . . . . . . . . . . . . . . . . . . 829Interface statistics record (subtype 6) . . . . . . . . . . . . . . . . . . . . . . . . . . 842Server port statistics record (subtype 7). . . . . . . . . . . . . . . . . . . . . . . . . . 846TCP/IP stack start/stop record (subtype 8) . . . . . . . . . . . . . . . . . . . . . . . . 848UDP socket close record (subtype 10) . . . . . . . . . . . . . . . . . . . . . . . . . . 849TN3270E Telnet server SNA session initiation record (subtype 20) . . . . . . . . . . . . . . . . . 851TN3270E Telnet server SNA session termination record (subtype 21) . . . . . . . . . . . . . . . . 852TSO Telnet client connection initiation record (subtype 22) . . . . . . . . . . . . . . . . . . . 858TSO Telnet client connection termination record (subtype 23) . . . . . . . . . . . . . . . . . . 859TN3270E Telnet server profile event record (subtype 24) . . . . . . . . . . . . . . . . . . . . 860

    Relationship to GetTnProfile Callable NMI . . . . . . . . . . . . . . . . . . . . . . . 861Continuing the SMF record. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861Data format concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861TN3270E Telnet server profile record self-defining section . . . . . . . . . . . . . . . . . . 862TN3270E Telnet server profile record TCP/IP stack identification section . . . . . . . . . . . . . 865TN3270E Telnet server profile record profile information common section . . . . . . . . . . . . . 865TN320E Telnet server profile record profile information data set name section . . . . . . . . . . . . 866TN3270E Telnet server profile record TelnetGlobals section . . . . . . . . . . . . . . . . . . 866TN3270E Telnet server profile record TelnetParms section . . . . . . . . . . . . . . . . . . 868TN3270E Telnet server profile record LU section. . . . . . . . . . . . . . . . . . . . . . 876TN3270E Telnet server profile record LU Group section . . . . . . . . . . . . . . . . . . . 877TN3270E Telnet server profile record SLU Group section . . . . . . . . . . . . . . . . . . . 878TN3270E Telnet server profile record APPL group section . . . . . . . . . . . . . . . . . . 878TN3270E Telnet server profile record Printer section . . . . . . . . . . . . . . . . . . . . 879TN3270E Telnet server profile record PrintGroup section . . . . . . . . . . . . . . . . . . . 880TN3270 Telnet server profile record SPRTGROUP section. . . . . . . . . . . . . . . . . . . 880TN3270 Telnet server profile record ParmsGroup section . . . . . . . . . . . . . . . . . . . 881

    xiv z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • TN3270E Telnet server profile record MonitorGroup section . . . . . . . . . . . . . . . . . . 881TN3270E Telnet server profile record Client Identifier structure. . . . . . . . . . . . . . . . . 882TN3270E Telnet server profile record LinkGroup section . . . . . . . . . . . . . . . . . . . 883TN3270E Telnet server profile record IpGroup section . . . . . . . . . . . . . . . . . . . . 884TN3270E Telnet server profile record UserGroup section . . . . . . . . . . . . . . . . . . . 885TN3270E Telnet server profile record DestIPGroup section . . . . . . . . . . . . . . . . . . 885TN3270E Telnet server profile record HnGroup section . . . . . . . . . . . . . . . . . . . 886TN3270E Telnet server profile record AllowAppl/RestrictAppl section . . . . . . . . . . . . . . 887TN3270E Telnet server profile record DefaultAppl section . . . . . . . . . . . . . . . . . . 887TN3270E Telnet server profile record PrtDefaultAppl section . . . . . . . . . . . . . . . . . 888TN3270E Telnet server profile record LineModeAppl section . . . . . . . . . . . . . . . . . 889TN3270E Telnet server profile record MapAppl section . . . . . . . . . . . . . . . . . . . 889TN3270E Telnet server profile record USSTCP section . . . . . . . . . . . . . . . . . . . . 890TN3270E Telnet server profile record INTERPTCP section . . . . . . . . . . . . . . . . . . 890TN3270E Telnet server profile record ParmsMap section . . . . . . . . . . . . . . . . . . . 891TN3270E Telnet server profile record LUMap section . . . . . . . . . . . . . . . . . . . . 891TN3270E Telnet server profile record PrtMap section . . . . . . . . . . . . . . . . . . . . 892TN3270E Telnet server profile record MonitorMap section . . . . . . . . . . . . . . . . . . 892

    DVIPA status change record (subtype 32) . . . . . . . . . . . . . . . . . . . . . . . . . 893DVIPA removed record (subtype 33). . . . . . . . . . . . . . . . . . . . . . . . . . . 895DVIPA target added record (subtype 34) . . . . . . . . . . . . . . . . . . . . . . . . . 897DVIPA target removed record (subtype 35) . . . . . . . . . . . . . . . . . . . . . . . . 899DVIPA target server started record (subtype 36) . . . . . . . . . . . . . . . . . . . . . . . 901DVIPA target server ended record (subtype 37) . . . . . . . . . . . . . . . . . . . . . . . 902SMC-R link group statistics record (subtype 41) . . . . . . . . . . . . . . . . . . . . . . . 904SMC-R link state start record (subtype 42) . . . . . . . . . . . . . . . . . . . . . . . . . 908SMC-R link state end record (subtype 43) . . . . . . . . . . . . . . . . . . . . . . . . . 909RDMA network interface card (RNIC) interface statistics record (subtype 44) . . . . . . . . . . . . . 912CSSMTP configuration record (CONFIG subtype 48) . . . . . . . . . . . . . . . . . . . . . 914CSSMTP connection record (CONNECT subtype 49) . . . . . . . . . . . . . . . . . . . . . 919CSSMTP mail record (MAIL subtype 50) . . . . . . . . . . . . . . . . . . . . . . . . . 923CSSMTP spool file record (SPOOL subtype 51) . . . . . . . . . . . . . . . . . . . . . . . 927CSSMTP statistical record (STATS subtype 52) . . . . . . . . . . . . . . . . . . . . . . . 932FTP server transfer completion record (subtype 70) . . . . . . . . . . . . . . . . . . . . . . 937FTP daemon configuration record (subtype 71) . . . . . . . . . . . . . . . . . . . . . . . 943FTP server logon failure record (subtype 72) . . . . . . . . . . . . . . . . . . . . . . . . 963IPSec IKE tunnel activation and refresh record (subtype 73) . . . . . . . . . . . . . . . . . . . 966IPSec IKE tunnel deactivation and expire record (subtype 74) . . . . . . . . . . . . . . . . . . 973IPSec dynamic tunnel activation and refresh record (subtype 75) . . . . . . . . . . . . . . . . . 976IPSec dynamic tunnel deactivation record (subtype 76) . . . . . . . . . . . . . . . . . . . . 989IPSec dynamic tunnel added record (subtype 77) . . . . . . . . . . . . . . . . . . . . . . 990IPSec dynamic tunnel removed record (subtype 78) . . . . . . . . . . . . . . . . . . . . . 991IPSec manual tunnel activation record (subtype 79). . . . . . . . . . . . . . . . . . . . . . 993IPSec manual tunnel deactivation record (subtype 80) . . . . . . . . . . . . . . . . . . . . . 994VTAM 3270 Intrusion Detection Services event record (subtype 81) . . . . . . . . . . . . . . . . 995

    Appendix F. EZAENF80 Parameter list for ENF event code 80 listen exits . . . . . . 1001

    Appendix G. Application data . . . . . . . . . . . . . . . . . . . . . . . . . 1003Identifying application data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1003CICS socket interface and listener application data . . . . . . . . . . . . . . . . . . . . . 1004z/OS IP FTP client application data . . . . . . . . . . . . . . . . . . . . . . . . . . 1004FTP client application data format for the control connection . . . . . . . . . . . . . . . . . . 1005FTP client application data format for the data connection . . . . . . . . . . . . . . . . . . . 1006FTP daemon application data format . . . . . . . . . . . . . . . . . . . . . . . . . . 1007FTP server application data format for the control connection . . . . . . . . . . . . . . . . . . 1008FTP server application data format for the data connection . . . . . . . . . . . . . . . . . . . 1009Application data format for IP CICS sockets. . . . . . . . . . . . . . . . . . . . . . . . 1010Application data format for CSSMTP . . . . . . . . . . . . . . . . . . . . . . . . . . 1015TN3270E Telnet server application data . . . . . . . . . . . . . . . . . . . . . . . . . 1017

    Contents xv

    ||

  • Application data format for Telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . 1018

    Appendix H. X Window System interface V11R4 and Motif version 1.1 . . . . . . . 1021Software requirements for X Window System interface V11R4 and Motif version 1.1 . . . . . . . . . . 1022How the X Window System interface works in the MVS environment . . . . . . . . . . . . . . . 1022X Window System interface in the MVS environment: Identifying the target display . . . . . . . . . . 1024X Window System interface in the MVS environment: Application resource file . . . . . . . . . . . . 1024X Window System interface in the MVS environment: Creating an application . . . . . . . . . . . . 1025

    X Window System header files . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025X Window System interface in the MVS environment: Compiling and linking . . . . . . . . . . . . 1027

    X Window System interface in the MVS environment: Nonreentrant modules . . . . . . . . . . . 1028X Window System interface in the MVS environment: Reentrant modules. . . . . . . . . . . . . 1029

    Using sample X Window System programs . . . . . . . . . . . . . . . . . . . . . . . . 1031X Window System Interface V11r4: Environment variables . . . . . . . . . . . . . . . . . . . 1032Standard X client applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033

    Building X client modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1036X Window System routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1038

    X Window System routines: Opening and closing a display . . . . . . . . . . . . . . . . . 1038X Window System routines: Creating and destroying windows . . . . . . . . . . . . . . . . 1038X Window System routines: Manipulating windows . . . . . . . . . . . . . . . . . . . . 1038X Window System routines: Changing window attributes . . . . . . . . . . . . . . . . . . 1039X Window System routines: Obtaining window information . . . . . . . . . . . . . . . . . 1039X Window System routines: Obtaining properties and atoms . . . . . . . . . . . . . . . . . 1040X Window System routines: Manipulating window properties . . . . . . . . . . . . . . . . 1040X Window System routines: Setting window selections . . . . . . . . . . . . . . . . . . . 1040X Window System routines: Manipulating colormaps . . . . . . . . . . . . . . . . . . . 1040X Window System routines: Manipulating color cells . . . . . . . . . . . . . . . . . . . 1041X Window System routines: Creating and freeing pixmaps . . . . . . . . . . . . . . . . . . 1041X Window System routines: Manipulating graphics contexts . . . . . . . . . . . . . . . . . 1041X Window System routines: Clearing and copying areas . . . . . . . . . . . . . . . . . . 1042X Window System routines: Drawing lines . . . . . . . . . . . . . . . . . . . . . . . 1042X Window System routines: Filling areas. . . . . . . . . . . . . . . . . . . . . . . . 1043X Window System routines: Loading and freeing fonts . . . . . . . . . . . . . . . . . . . 1043X Window System routines: Querying character string sizes . . . . . . . . . . . . . . . . . 1043X Window System routines: Drawing text . . . . . . . . . . . . . . . . . . . . . . . 1044X Window System routines: Transferring images . . . . . . . . . . . . . . . . . . . . . 1044X Window System routines: Manipulating cursors . . . . . . . . . . . . . . . . . . . . 1044X Window System routines: Handling window manager functions . . . . . . . . . . . . . . . 1045X Window System routines: Manipulating keyboard settings . . . . . . . . . . . . . . . . . 1046X Window System routines: Controlling the screen saver . . . . . . . . . . . . . . . . . . 1046X Window System routines: Manipulating hosts and access control . . . . . . . . . . . . . . . 1046X Window System routines: Handling events . . . . . . . . . . . . . . . . . . . . . . 1047X Window System routines: Enabling and disabling synchronization . . . . . . . . . . . . . . 1047X Window System routines: Using default error handling . . . . . . . . . . . . . . . . . . 1048X Window System routines: Communicating with window managers . . . . . . . . . . . . . . 1048X Window System routines: Manipulating keyboard event functions . . . . . . . . . . . . . . 1049X Window System routines: Manipulating regions . . . . . . . . . . . . . . . . . . . . 1050X Window System routines: Using cut and paste buffers . . . . . . . . . . . . . . . . . . 1050X Window System routines: Querying visual types . . . . . . . . . . . . . . . . . . . . 1051X Window System routines: Manipulating images. . . . . . . . . . . . . . . . . . . . . 1051X Window System routines: Manipulating bit maps . . . . . . . . . . . . . . . . . . . . 1051X Window System routines: Using the resource manager . . . . . . . . . . . . . . . . . . 1051X Window System routines: Manipulating display functions . . . . . . . . . . . . . . . . . 1052

    X Window System routines: Extension routines . . . . . . . . . . . . . . . . . . . . . . 1054X Window System routines: MIT extensions to X . . . . . . . . . . . . . . . . . . . . . . 1055X Window System routines: Associate table functions . . . . . . . . . . . . . . . . . . . . 1056X Window System routines: Miscellaneous utility routines . . . . . . . . . . . . . . . . . . . 1057X Window System routines: X authorization routines . . . . . . . . . . . . . . . . . . . . 1059X Window System toolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1060

    Xt Intrinsics routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1061X Window System toolkit: Application resources . . . . . . . . . . . . . . . . . . . . . . 1069

    xvi z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • X Window System routines: Athena widget support . . . . . . . . . . . . . . . . . . . . . 1070X Window System routines: Motif-based widget support . . . . . . . . . . . . . . . . . . . 1073X Window System routines: z/OS UNIX System Services support . . . . . . . . . . . . . . . . 1074

    X Window System routines: What is provided with z/OS UNIX System Services . . . . . . . . . . 1075X Window System routines: z/OS UNIX System Services software requirements . . . . . . . . . . 1075X Window System routines: z/OS UNIX System Services application resource file . . . . . . . . . . 1075Identifying the target display in z/OS UNIX System Services . . . . . . . . . . . . . . . . . 1076Compiling and linking with z/OS UNIX System Services . . . . . . . . . . . . . . . . . . 1076Compiling and linking with z/OS UNIX System Services using c89 . . . . . . . . . . . . . . . 1078Standard X client applications for z/OS UNIX System Services . . . . . . . . . . . . . . . . 1078Application resources for z/OS UNIX System Services . . . . . . . . . . . . . . . . . . . 1078

    Appendix I. Syslog daemon name/token pair and ECSA storage mapping . . . . . . 1081

    Appendix J. Related protocol specifications . . . . . . . . . . . . . . . . . . 1083

    Appendix K. Accessibility. . . . . . . . . . . . . . . . . . . . . . . . . . . 1107

    Notices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1111Programming interface information. . . . . . . . . . . . . . . . . . . . . . . . . . . 1119Policy for unsupported hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . 1119Trademarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1119

    Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1121

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1125

    Communicating your comments to IBM . . . . . . . . . . . . . . . . . . . . 1139

    Contents xvii

  • xviii z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • Figures

    1. SNMP Dist Prog Interface subagent sample . . . . . . . . . . . . . . . . . . . . . . . 332. Remote procedure call (client) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1963. Remote procedure call (server) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1974. RPC client program sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2735. RPC server program sample . . . . . . . . . . . . . . . . . . . . . . . . . . . 2756. RPC raw data stream program sample . . . . . . . . . . . . . . . . . . . . . . . . 2777. Macro to maintain IBM System/370 portability . . . . . . . . . . . . . . . . . . . . . 2898. NCSDEFS.H and USERDEFS.H include statements . . . . . . . . . . . . . . . . . . . . 2909. Message header and records . . . . . . . . . . . . . . . . . . . . . . . . . . . 426

    10. NMI monitoring request format . . . . . . . . . . . . . . . . . . . . . . . . . . 43011. NMsec_ACTIVATE_IPTUNMANUAL request form . . . . . . . . . . . . . . . . . . . . 43612. NMsec_ACTIVATE_IPTUNDYN request format . . . . . . . . . . . . . . . . . . . . . 43713. NMsec_DEACTIVATE_IPTUNMANUAL request format . . . . . . . . . . . . . . . . . . 43714. NMsec_DEACTIVATE_IPTUNDYN request format . . . . . . . . . . . . . . . . . . . . 43715. NMsec_DEACTIVATE_IKETUN request format . . . . . . . . . . . . . . . . . . . . . 43816. NMsec_REFRESH_IPTUNDYN request format . . . . . . . . . . . . . . . . . . . . . 43817. NMsec_REFRESH_IKETUN request format . . . . . . . . . . . . . . . . . . . . . . 43818. NMsec_GET_STACKINFO response format . . . . . . . . . . . . . . . . . . . . . . 43919. NMsec_GET_SUMMARY response format . . . . . . . . . . . . . . . . . . . . . . . 44220. NMsec_GET_IPFLTCURR, NMsec_GET_IPFLTDEFAULT, and NMsec_GET_IPFLTPOLICY response format 44521. NMsec_GET_PORTTRAN response format . . . . . . . . . . . . . . . . . . . . . . . 45222. NMsec_GET_IPTUNMANUAL response format . . . . . . . . . . . . . . . . . . . . . 45323. NMsec_GET_IPTUNDYNSTACK response format . . . . . . . . . . . . . . . . . . . . 45824. NMsec_GET_IPTUNDYNIKE response format . . . . . . . . . . . . . . . . . . . . . 46325. NMsec_GET_IKETUN response format . . . . . . . . . . . . . . . . . . . . . . . . 46626. NMsec_GET_IKETUNCASCADE response format . . . . . . . . . . . . . . . . . . . . 47227. NMsec_GET_IPINTERFACES response format . . . . . . . . . . . . . . . . . . . . . 47228. NMsec_GET_IKENSINFO response format. . . . . . . . . . . . . . . . . . . . . . . 47329. Tunnel control response format . . . . . . . . . . . . . . . . . . . . . . . . . . 47530. NMsec_GET_CLIENTINFO response format . . . . . . . . . . . . . . . . . . . . . . 48131. CTE layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63432. SIOCTTLSCTL with TTLS_Query_Only . . . . . . . . . . . . . . . . . . . . . . . . 66533. SIOCTTLSCTL with TTLS_Init_Connection. . . . . . . . . . . . . . . . . . . . . . . 66534. SIOCTTLSCTL with TTLS_Reset_Session or TTLS_Reset_Cipher . . . . . . . . . . . . . . . 66535. MVS X Window System application to server . . . . . . . . . . . . . . . . . . . . . 102336. Resources specified for a typical X Window System application . . . . . . . . . . . . . . . 1025

    © Copyright IBM Corp. 2000, 2017 xix

  • xx z/OS V2R2.0 Communications Server: IP Programmer's Guide and Reference

  • Tables

    1. Components of DPI version 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 372. Environment variables for the SNMP DPI . . . . . . . . . . . . . . . . . . . . . . . 423. SNMP manager API debug levels . . . . . . . . . . . . . . . . . . . . . . . . . . 1464. Environment variables for the X Window System interface . . . . . . . . . . . . . . . . . 1885. Environment variables for Motif . . . . . . . . . . . . . . . . . . . . . . . . . . 1896. Callback return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3227. PAPI function return codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3308. Programming requirements for the FTP client API . . . . . . . . . . . . . . . . . . . . 3449. FCAI control block. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

    10. FCAI_Version field value . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35211. FCAI_TraceIt field value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35212. FCAI_TraceCAPI field value . . . . . . . . . . . . . . . . . . . . . . . . . . . 35313. FCAI_TraceStatus field value . . . . . . . . . . . . . . . . . . . . . . . . . . . 35314. FCAI_Result field value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35315. FCAI_Status field values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35416. FCAI_IE field values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35417. FCAI stem variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35818. Predefined REXX variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35919. FTP client API for REXX return codes . . . . . . . . . . . . . . . . . . . . . . . . 38920. FTP client CREATE request return codes . . . . . . . . . . . . . . . . . . . . . . . 39021. FTP client INIT request return codes . . . . . . . . . . . . . . . . . . . . . . . . . 39222. FTP client SCMD request return codes . . . . . . . . . . . . . . . . . . . . . . . . 39323. FTP client POLL request return codes . . . . . . . . . . . . . . . . . . . . . . . . 39424. FTP client GETL_FIND request return codes . . . . . . . . . . . . . . . . . . . . . . 39625. FTP client GETL_COPY request return codes . . . . . . . . . . . . . . . . . . . . . . 39726. FTP client SET_TRACE request return codes . . . . . . . . . . . . . . . . . . . . . . 39827. FTP client SET_REQUEST_TIMER request return codes . . . . . . . . . . . . . . . . . . 39928. FCAI_Map structure elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 40029. FTP client GET_FCAI_MAP request return codes . . . . . . . . . . . . . . . . . . . . 40130. FTP client TERM request return codes . . . . . . . . . . . . . . . . . . . . . . . . 40231. FTP client API for REXX trace return codes . . . . . . . . . . . . . . . . . . . . . . 40232. NMsecMessageHdr structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 42333. Input record descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42534. Output record descriptor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42535. NMsecRecordHdr structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42636. NMsecSecDesc structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42737. NMsecCascadingSecDesc structure . . . . . . . . . . . . . . . . . . . . . . . . . 42738. Valid input filter specifications for request types . . . . . . . . . . . . . . . . . . . . . 43039. NMsecInFilter structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43140. NMsecTunnel field descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . 43541. NMsecPolicySource data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43942. NMsecStack structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44043. NMsecStackExclAddr structure . . . . . . . . . . . . . . . . . . . . . . . . . . 44144. NMsecStatistics structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44245. NMsecIPFilter structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44646. NMsec_GET_PORTTRAN structure . . . . . . . . . . . . . . . . . . . . . . . . . 45247. NMsecIPTunnel structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45348. NMsecIPManualTunnel structure . . . . . . . . . . . . . . . . . . . . . . . . . . 45749. NMsecIPDynTunnel structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 45850. NMsecIPDynamicStack structure . . . . . . . . . . . . . . . . . . . . . . . . . . 46251. NMsecIPDynamicIKE structure . . . . . . . . . . . . . . . . . . . . . . . . . . 46452. NMsecIKETunnel structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46653. IKE tunnel statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47154. NMsecInterface structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47355. NMsec_GET_IKENSINFO structure . . . . . . . . . . . . . . . . . . . . . . . . . 473

    © Copyright IBM Corp. 2000, 2017 xxi

  • 56. NMsecTunCntlResponse structure. . . . . . . . . . . . . . . . . . . . . . . . . . 47557. Return and reason codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47658. NMsecNSClient structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48159. Request return and reason codes . . . . . . . . . . . . . . . . . . . . . . . . . . 48460. Requirements to invoke the NMI requests . . . . . . . . . . . . . . . . . . . . . . . 49361. Request structure definition files . . . . . . . . . . . . . . . . . . . . . . . . . . 49462. Common EZBRCIFR Return values, return codes, and reason codes . . . . . . . . . . . . . . 49563. RCCHeader structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49764. RCCOpenInfo structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49965. RCCOpen return and reason codes . . . . . . . . . . . . . . . . . . . . . . . . . 50066. RCCFilt structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50567. RCCPkt structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50668. RCCDat structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51069. RCCSetFilters return and reason codes . . . . . . . . . . . . . . . . . . . . . . . . 51370. RCCStart Return values, return codes, and reason codes . . . . . . . . . . . . . . . . . . 51571. RCCGetInfo structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51872. RCCGetRecords return and reason codes . . . . . . . . . . . . . . . . . . . . . . . 52073. cte structure definition file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52174. RCCLost structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52475. RCCStop Return values, return codes, and reason codes . . . . . . . . . . . . . . . . . . 52676. Real-time NMI interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52877. Interface descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52878. SMF 119 record subtypes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54679. FTP server transfer initialization self-defining section . . . . . . . . . . . . . . . . . . . 54680. FTP server transfer initialization record section . . . . . . . . . . . . . . . . . . . . . 54881. FTP server hostname section . . . . . . . . . . . . . . . . . . . . . . . . . . . 54982. FTP server transfer initialization record section: First associated data set name . . . . . . . . . . . 55083. FTP server transfer initialization record section: Second associated data set name . . . . . . . . . . 55084. FTP server security section . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55085. FTP client transfer initialization record section . . . . . . . . . . . . . . . . . . . . . 55386. FTP client associated data set name section . . . . . . . . . . . . . . . . . . . . . . 55587. FTP client SOCKS section . . . . . . . . . . . . . . . . . . . . . . . .