TCP/IP Programmer's Reference
Total Page:16
File Type:pdf, Size:1020Kb
VSI OpenVMS TCP/IP Programmer's Reference Document Number: DO-DVTPRG-01B Publication Date: January 2020 This manual documents the programmer's interface to VSI TCP/IP and is intended to guide the programmer in developing applications that use network services. Revision Update Information: This guide supercedes the VSI TCP/IP Programmer's Reference, Version 10.5. Operating System and Version: VSI OpenVMS Version 8.4-2L1 or higher Software Version: VSI TCP/IP for OpenVMS Version 10.6 VMS Software, Inc., (VSI) Bolton, Massachusetts, USA TCP/IP Programmer's Reference: Copyright © 2020 VMS Software, Inc. (VSI), Bolton, Massachusetts, USA Legal Notice Confidential computer software. Valid license from VSI required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice. The only warranties for VSI products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. VSI shall not be liable for technical or editorial errors or omissions contained herein. HPE, HPE Integrity, HPE Alpha, and HPE Proliant are trademarks or registered trademarks of Hewlett Packard Enterprise. Intel, Itanium and IA64 are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Java, the coffee cup logo, and all Java based marks are trademarks or registered trademarks of Oracle Corporation in the United States or other countries. Kerberos is a trademark of the Massachusetts Institute of Technology. Microsoft, Windows, Windows-NT and Microsoft XP are U.S. registered trademarks of Microsoft Corporation. Microsoft Vista is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries. Motif is a registered trademark of The Open Group UNIX is a registered trademark of The Open Group. The VSI OpenVMS documentation set is available on CD. ii TCP/IP Programmer's Reference Preface ................................................................................................................................... vii 1. About VSI .................................................................................................................... vii 2. Intended Audience ........................................................................................................ vii 3. Typographical Conventions ........................................................................................... vii 4. VSI TCP/IP Support .................................................................................................... viii 5. VSI Encourages Your Comments .................................................................................... ix 6. How to Order Additional Documentation ........................................................................ ix Chapter 1. VSI TCP/IP Programming Tutorial ................................................................. 1 1.1. Sockets ........................................................................................................................ 1 1.2. TCP Client .................................................................................................................. 3 1.3. TCP Server .................................................................................................................. 3 1.4. UDP ............................................................................................................................ 3 1.5. BSD-Specific Tips ....................................................................................................... 4 1.5.1. BSD Sockets Porting Note ................................................................................. 4 1.5.2. BSD 4.4 TCP/IP Future Compatibility Considerations ......................................... 4 1.5.3. TCP/IP Services (UCX) Compatibility ................................................................ 6 1.6. TCP/IP Services (UCX) Compatibility .......................................................................... 6 Chapter 2. Socket Library Functions .................................................................................. 7 2.1. Debugging and Tracing ................................................................................................ 7 2.2. AST Reentrancy ........................................................................................................... 7 2.3. Socket Library Functions .............................................................................................. 8 2.4. Domain Name Resolver Routines ................................................................................ 15 2.5. SCTP ......................................................................................................................... 86 Chapter 3. Using the $QIO System Service ...................................................................... 93 3.1. $QIO System Service Variations ................................................................................. 93 3.2. $QIO Format ............................................................................................................. 93 3.2.1. Symbol Definition Files ................................................................................... 93 3.3. $QIO Functions .......................................................................................................... 94 3.4. $QIO Arguments ........................................................................................................ 95 3.4.1. $QIO Function-Independent Arguments ............................................................ 95 3.4.2. I/O Status Block .............................................................................................. 95 3.4.3. $QIO Function-Dependent Arguments .............................................................. 96 3.5. Passing Arguments by Descriptor ................................................................................ 97 3.5.1. Specifying an Input Parameter List ................................................................... 98 3.5.2. Specifying an Output Parameter List ............................................................... 100 3.5.3. Specifying a Socket Name ............................................................................. 101 3.5.4. Specifying a Buffer List ................................................................................. 102 Chapter 4. $QIO Interface ............................................................................................... 105 IO$_ACCEPT ................................................................................................................ 106 IO$_ACCEPT_WAIT .................................................................................................... 107 IO$_BIND ..................................................................................................................... 107 IO$_CONNECT ............................................................................................................ 108 IO$_GETPEERNAME .................................................................................................. 109 IO$_GETSOCKNAME ................................................................................................. 110 IO$_GETSOCKOPT ..................................................................................................... 111 IO$_IOCTL ................................................................................................................... 112 IO$_LISTEN ................................................................................................................. 113 IO$_RECEIVE (IO$_READVBLK) .............................................................................. 113 IO$_SELECT ................................................................................................................ 115 IO$_SEND ..................................................................................................................... 116 iii TCP/IP Programmer's Reference IO$_SENSEMODE ........................................................................................................ 118 IO$_SENSEMODE | IO$M_CTRL ............................................................................... 120 IO$_SETCHAR ............................................................................................................. 129 IO$_SETMODE|IO$M_ATTNAST ............................................................................... 130 IO$_SETSOCKOPT ...................................................................................................... 131 IO$_SHUTDOWN ......................................................................................................... 132 IO$_SOCKET ............................................................................................................... 133 SYS$CANCEL ............................................................................................................... 134 SYS$DASSGN ............................................................................................................... 134 Chapter 5. SNMP Extensible Agent API Routines .......................................................