home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcp30tkt.zip / PGMG1.ZIP / DOC / TCPPR.INF (.txt) < prev   
OS/2 Help File  |  1995-12-04  |  473KB  |  18,643 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. About This Information ΓòÉΓòÉΓòÉ
  3.  
  4. This IBM TCP/IP Version 3.0 for OS/2 Warp Programmer's Reference describes the 
  5. routines for application programming in the TCP/IP Version 3.0 for OS/2 Warp 
  6. environment on a workstation. 
  7.  
  8. This document contains reference information about the following topics: 
  9.  
  10.      Installation and General Programming Information 
  11.  
  12.       Provides information about installing the Programmer's Toolkit, as well 
  13.       as fundamental, technical information about APIs provided with TCP/IP for 
  14.       OS/2. 
  15.  
  16.      Sockets General Programming Information 
  17.  
  18.       Describes the TCP/IP socket interface and how to use the socket routines 
  19.       in a user-written application. 
  20.  
  21.      Sockets in the Internet Domain 
  22.  
  23.       Describes TCP/IP network protocols, getting started with sockets in the 
  24.       Internet domain, Internet address formats, and TCP/IP-specific network 
  25.       utility routines. 
  26.  
  27.      Sockets over Local IPC 
  28.  
  29.       Describes how programmers can communicate on the same machine using the 
  30.       sockets API, and the local IPC address format. 
  31.  
  32.      Sockets over NetBIOS 
  33.  
  34.       Describes how programmers can communicate with NetBIOS using the sockets 
  35.       API, and the NetBIOS address format. 
  36.  
  37.      Protocol-Independent C Sockets API 
  38.  
  39.       Describes the protocol-independent socket calls supported by Network 
  40.       Services. 
  41.  
  42.      TCP/IP Network Utility Routines 
  43.  
  44.       Describes the sockets utility function calls supported by Network 
  45.       Services. 
  46.  
  47.      Remote Procedure Calls (RPCs) 
  48.  
  49.       Describes the remote procedure calls and how to use them in a 
  50.       user-written application. 
  51.  
  52.      File Transfer Protocol Application Programming Interface 
  53.  
  54.       Describes the file transfer protocol routines and how to use them in a 
  55.       user-written application. 
  56.  
  57.      SNMP Agent Distributed Protocol Interface (DPI) 
  58.  
  59.       Describes the agent DPI, which is used to manipulate variables in a local 
  60.       Management Information Base (MIB). 
  61.  
  62.      NETWORKS File Structure 
  63.  
  64.       Provides examples of network names contained in the TCPIP\ETC\NETWORKS 
  65.       file. 
  66.  
  67.      Socket Error Constants 
  68.  
  69.       Provides the socket error codes and descriptions. 
  70.  
  71.      Well-Known Port Assignments 
  72.  
  73.       Provides a list of the well-known ports supported by TCP/IP. 
  74.  
  75.  This information also includes index and search functions, which are available 
  76.  using the push buttons at the bottom of the information window. 
  77.  
  78.  First-time readers should review Installation and General Programming 
  79.  Information before proceeding to whatever section is most relevant to them. 
  80.  
  81.  Who Should Use This Information 
  82.  
  83.  This information is intended for application and system programmers with 
  84.  experience in writing application programs on a workstation. You should also 
  85.  be familiar with the OS/2 operating system and know multitasking operating 
  86.  system concepts.  It is important that you also know the C programming 
  87.  language. 
  88.  
  89.  If you are not familiar with TCP/IP concepts, see Internetworking With TCP/IP 
  90.  Volume I:  Principles, Protocols, and Architecture, and Internetworking With 
  91.  TCP/IP Volume II:  Implementation and Internals. 
  92.  
  93.  How the Term "Internet" Is Used 
  94.  
  95.  An internet is a logical collection of networks supported by gateways, 
  96.  routers, bridges, hosts, and various layers of protocols that permit the 
  97.  network to function as a large, virtual network. 
  98.  
  99.  The term internet is used as a generic term for a TCP/IP network and should 
  100.  not be confused with the Internet (note capital I), which consists of large 
  101.  national backbone networks (such as MILNET, NSFNet, and CREN) and a myriad of 
  102.  regional and local campus networks all over the world. 
  103.  
  104.  
  105. ΓòÉΓòÉΓòÉ 2. Installation and General Programming Information ΓòÉΓòÉΓòÉ
  106.  
  107. This section contains information about installing the Toolkit, as well as 
  108. technical information you need to know before working with the application 
  109. program interfaces (APIs) provided with TCP/IP Version 3.0 for OS/2 Warp. 
  110.  
  111. Before you can work with the APIs, the TCP/IP Version 3.0 for OS/2 Warp product 
  112. and APIs must be installed in the MPTN directory (or the directory specified by 
  113. the ETC environment variable). For example, all files in the ETC directory are 
  114. in the MPTN\ETC directory. 
  115.  
  116. Topics 
  117.  
  118.       Installing the Toolkit 
  119.       Header Files 
  120.       Library Files 
  121.       Porting Considerations 
  122.       Compiling and Linking an API Application 
  123.       Accessing a TCP/IP API DLL from an Intermediate DLL 
  124.  
  125.  
  126. ΓòÉΓòÉΓòÉ 2.1. Installing the Toolkit ΓòÉΓòÉΓòÉ
  127.  
  128. This section describes how to install the Toolkit. 
  129.  
  130. Topics 
  131.  
  132.       Software Requirements 
  133.       Installing the Toolkit from the Product Diskette 
  134.  
  135.  
  136. ΓòÉΓòÉΓòÉ 2.1.1. Software Requirements ΓòÉΓòÉΓòÉ
  137.  
  138. You must have one of the following items installed on your system: 
  139.  
  140.      IBM OS/2 Warp Version 3.0 or higher with the Internet Connection for OS/2 
  141.       (from the BonusPak). 
  142.  
  143.      IBM OS/2 Warp Connect Version 3.0 or higher with TCP/IP Version 3.0 for 
  144.       OS/2 Warp (TCP/IP Version 3.0 for OS/2 Warp is a part of Warp Connect). 
  145.  
  146.  In addition, you must have the following installed on your system: 
  147.  
  148.      Any IBM 32-bit compiler for OS/2, including: 
  149.  
  150.         -  VisualAge C++ 
  151.         -  C Set++ 
  152.  
  153.  
  154. ΓòÉΓòÉΓòÉ 2.1.2. Installing the Toolkit from the Product Diskette ΓòÉΓòÉΓòÉ
  155.  
  156. To install the TCP/IP Version 3.0 for OS/2 Warp Toolkit, perform the following 
  157. steps: 
  158.  
  159.    1. Insert the Toolkit diskette. 
  160.    2. At an OS/2 command prompt, type A:\INSTALL and press Enter. 
  161.    3. Select the Install push button. 
  162.    4. Follow the installation instructions. 
  163.  
  164.  After you have installed the Toolkit, you may want to set your environment 
  165.  variables to find: 
  166.  
  167.      Header files 
  168.      Link libraries 
  169.      Executable programs 
  170.  
  171.  You can set your environment variables interactively or you can include them 
  172.  in your CONFIG.SYS file.  For information on setting the environment variables 
  173.  in your CONFIG.SYS file, see Compiling and Linking an API Application. 
  174.  
  175.  
  176. ΓòÉΓòÉΓòÉ 2.2. Header Files ΓòÉΓòÉΓòÉ
  177.  
  178. This section lists the header files for each API.  These files are in the 
  179. TCPIP\INCLUDE directory. 
  180.  
  181. Topics 
  182.  
  183.       Sockets 
  184.       Remote Procedure Calls (RPCs) 
  185.       File Transfer Protocol Application Programming Interface (FTP API) 
  186.       Simple Network Management Protocol (SNMP) Agent Distributed Program 
  187.       Interface (DPI) 
  188.  
  189.  
  190. ΓòÉΓòÉΓòÉ 2.2.1. Sockets ΓòÉΓòÉΓòÉ
  191.  
  192. The socket application header files are: 
  193.  
  194.       ARPA\NAMESER.H 
  195.       NERRNO.H 
  196.       NET\IF.H 
  197.       NET\IF_ARP.H 
  198.       NET\ROUTE.H 
  199.       NETDB.H 
  200.       NETDB\NB.H 
  201.       NETINET\IF_ETHER.H 
  202.       NETINET\IN.H 
  203.       NETINET\IN_SYSTM.H 
  204.       NETINET\IP.H 
  205.       NETINET\IP_ICMP.H 
  206.       NETINET\TCP.H 
  207.       RESOLV.H 
  208.       SYS\IOCTL.H 
  209.       SYS\SELECT.H 
  210.       SYS\SOCKET.H 
  211.       SYS\TIME.H 
  212.       SYS\UN.H 
  213.       TYPES.H 
  214.       UTILS.H 
  215.  
  216.  
  217. ΓòÉΓòÉΓòÉ 2.2.2. Remote Procedure Calls (RPCs) ΓòÉΓòÉΓòÉ
  218.  
  219. The RPC application header files are: 
  220.  
  221.       RPC\AUTH.H 
  222.       RPC\AUTH_UNI.H 
  223.       RPC\CLNT.H 
  224.       RPC\PMAP_CLN.H 
  225.       RPC\PMAP_PRO.H 
  226.       RPC\RPC.H 
  227.       RPC\RPC_MSG.H 
  228.       RPC\RPCNETDB.H 
  229.       RPC\RPCTYPES.H 
  230.       RPC\SVC.H 
  231.       RPC\SVC_AUTH.H 
  232.       RPC\XDR.H 
  233.  
  234.  
  235. ΓòÉΓòÉΓòÉ 2.2.3. File Transfer Protocol Application Programming Interface (FTP API) ΓòÉΓòÉΓòÉ
  236.  
  237. The only FTP API application header file is: 
  238.  
  239.       FTPAPI.H 
  240.  
  241.  
  242. ΓòÉΓòÉΓòÉ 2.2.4. Simple Network Management Protocol (SNMP) Agent Distributed Program Interface (DPI) ΓòÉΓòÉΓòÉ
  243.  
  244. The only SNMP DPI application header file is: 
  245.  
  246.       DPI\SNMP_DPI.H 
  247.  
  248.  
  249. ΓòÉΓòÉΓòÉ 2.3. Library Files ΓòÉΓòÉΓòÉ
  250.  
  251. The tables in this section list library files to which an application must 
  252. link. As shipped from IBM, the files listed in the first table are in either 
  253. the TCPIP\LIB directory or MPTN\LIB directory, and the files listed in the 
  254. second table are in either the TCPIP\DLL or MPTN\DLL directory. 
  255.  
  256. Note:  Before you run the program, verify that DLL files are in a directory 
  257. listed in the LIBPATH system environment variable. 
  258.  
  259. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  260. Γöé Table 1. Library Files and Their Applications                 Γöé
  261. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  262. Γöé LIBRARY FILE       Γöé APPLICATION                     Γöé
  263. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  264. Γöé DPI20DLL.LIB       Γöé Dynamic SNMP DPI calls               Γöé
  265. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  266. Γöé FTPAPI.LIB        Γöé Dynamic FTP API calls                Γöé
  267. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  268. Γöé RPC32DLL.LIB       Γöé Dynamic Sun remote procedure calls         Γöé
  269. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  270. Γöé SO32DLL.LIB       Γöé Dynamic socket calls                Γöé
  271. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  272. Γöé TCP32DLL.LIB       Γöé Dynamic TCP/IP network library calls        Γöé
  273. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  274.  
  275. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  276. Γöé Table 2. DLL Files and Their Applications                   Γöé
  277. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  278. Γöé DLL FILE         Γöé APPLICATION                     Γöé
  279. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  280. Γöé DPI20DLL.DLL       Γöé Executable SNMP DPI calls              Γöé
  281. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  282. Γöé FTPAPI.DLL        Γöé Executable FTP API calls              Γöé
  283. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  284. Γöé RPC32DLL.DLL       Γöé Executable remote procedure calls          Γöé
  285. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  286. Γöé SO32DLL.DLL       Γöé Executable socket calls               Γöé
  287. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  288. Γöé TCP32DLL.DLL       Γöé Executable TCP/IP network library calls       Γöé
  289. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  290.  
  291.  
  292. ΓòÉΓòÉΓòÉ 2.4. Porting Considerations ΓòÉΓòÉΓòÉ
  293.  
  294. Be aware of the following when you port your applications: 
  295.  
  296.      To access system return values, use only the errno.h include statement 
  297.       supplied with the compiler. 
  298.  
  299.      To access network return values, add the following include statement: 
  300.  
  301.             #include <nerrno.h>
  302.  
  303.      Error codes set by the OS/2 TCP/IP sockets implementation are not made 
  304.       available via the global errno variable.  Instead, error codes are 
  305.       accessed by using the sock_errno() API described in sock_errno().  Use 
  306.       psock_errno(), instead of perror(), to produce a short error message on 
  307.       the standard error device describing the last error encountered during a 
  308.       call to a socket library function. An application cannot assign new 
  309.       values to error codes. 
  310.  
  311.       This is intended to obtain per-thread error codes in a multithreaded 
  312.       application environment and to avoid conflict with standard IBM compiler 
  313.       error constants. 
  314.  
  315.       For compatibility with BSD (Berkeley Software Distribution), an 
  316.       application can choose to define: 
  317.  
  318.             #define errno sock_errno()
  319.             #define perror psock_errno
  320.  
  321.       If a source file includes code that checks errno for both OS/2 socket and 
  322.       OS/2 nonsocket functions, this mechanism cannot be used. 
  323.  
  324.  For more information about how to port a specific application, see the section 
  325.  for that application. 
  326.  
  327.  
  328. ΓòÉΓòÉΓòÉ 2.5. Compiling and Linking an API Application ΓòÉΓòÉΓòÉ
  329.  
  330. Follow these steps to compile and link an API application using an IBM 32-bit 
  331. compiler for OS/2: 
  332.  
  333.    1. Set your environment variables to find the following: 
  334.  
  335.           Executable programs 
  336.           Link libraries 
  337.           Header files 
  338.  
  339.       You can set the environment variables in your CONFIG.SYS file.  An 
  340.       example of the entries you might have in your CONFIG.SYS file follows: 
  341.  
  342.             LIBPATH=E:\IBMC\DLL;C:\MPTN\DLL;C:\TCPIP\DLL;
  343.             SET PATH=E:\IBMC\BIN;
  344.             SET DPATH=E:\IBMC\LOCALE;E:\IBMC\HELP;
  345.             SET LIB=E:\IBMC\LIB;C:\MPTN\LIB;C:\TCPIP\LIB;
  346.             SET INCLUDE=E:\IBMC\INCLUDE;C:\TCPIP\INCLUDE;
  347.             SET HELP=E:\IBMC\HELP;
  348.             SET BOOKSHELF=E:\IBMC\HELP;
  349.             SET TMP=E:\IBMC\TMP
  350.             SET TZ=EST5EDT,0,0,0,0,0,0,0,0,0
  351.  
  352.    2. To compile your program, enter: 
  353.  
  354.             icc /Ti /DOS2 /Sm /Ss /Q /Gm /Gt /C myprog.c
  355.  
  356.    3. To create an executable program, you can enter: 
  357.  
  358.       For VisualAge C++ 
  359.  
  360.             ilink /NOFREEFORMAT /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  361.  
  362.       For C Set++ 
  363.  
  364.             link386 /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  365.  
  366.  Note: 
  367.  
  368.    1. Before you run a program, verify that the DLL files are in a directory 
  369.       listed in the LIBPATH system environment variable. 
  370.  
  371.    2. For more information about the compile and link options, multithreaded 
  372.       libraries, and dynamic link libraries, see the User's Guide provided with 
  373.       your compiler. 
  374.  
  375.  
  376. ΓòÉΓòÉΓòÉ 2.6. Accessing a TCP/IP API DLL from an Intermediate DLL ΓòÉΓòÉΓòÉ
  377.  
  378. A TCP/IP API DLL can be accessed both directly from an application and through 
  379. an intermediate DLL. An example of an intermediate DLL would be a virtual 
  380. network API layer that supports generalized network functionality for 
  381. applications and that uses the TCP/IP API. 
  382.  
  383. The IBM TCP/IP Version 3.0 for OS/2 Warp Programmer's Toolkit contains the 
  384. sample program to build a DLL.  You can find the program in the 
  385. TCPIP\SAMPLES\SAMPDLL directory. 
  386.  
  387. For more information about DLLs, refer to the OS/2 Warp Technical Library, 
  388. Control Programming Guide, G25H-7101. 
  389.  
  390.  
  391. ΓòÉΓòÉΓòÉ 3. Sockets General Programming Information ΓòÉΓòÉΓòÉ
  392.  
  393. This section contains technical information for planning, designing, and 
  394. writing application programs that use the Network Services sockets application 
  395. programming interface (API) in a TCP/IP Version 3.0 for OS/2 Warp environment. 
  396.  
  397. Topics 
  398.  
  399.       Introduction to Network Services 
  400.       Programming with Sockets 
  401.       Multithreading Considerations 
  402.       Typical Socket Session Diagrams 
  403.       Using Socket Calls 
  404.       Porting a Sockets API Application 
  405.       Compiling and Linking a Sockets API Application 
  406.  
  407.  
  408. ΓòÉΓòÉΓòÉ 3.1. Introduction to Network Services ΓòÉΓòÉΓòÉ
  409.  
  410. IBM's Network Services for TCP/IP Version 3.0 for OS/2 Warp provides a solution 
  411. to interconnect applications across networks. Network Services provides a 
  412. 32-bit sockets API for the Internet (TCP/IP), local interprocess communication 
  413. (Local IPC), and NetBIOS communication domains. Network Services sockets is 
  414. based on the Berkeley Software Distribution (BSD) Version 4.3 sockets 
  415. implementation. 
  416.  
  417. The sockets API allows you to write distributed or client/server applications 
  418. in supported communication domains to allow applications to communicate across 
  419. networks. In addition, the interface allows interprocess communication within 
  420. the same workstation. Applications can have full network access by just using 
  421. the sockets API. You can run an existing sockets application in another 
  422. communications domain by modifying the communications domain selection and the 
  423. networking addressing parameters used by the application. You must then 
  424. recompile and relink the application. 
  425.  
  426. The following figure describes the internal structure of TCP/IP Version 3.0 for 
  427. OS/2 Warp. 
  428.  
  429.  
  430. Internal Structure of TCP/IP
  431.  
  432. The major components of the TCP/IP stack are: 
  433.  
  434.      Control program: 
  435.  
  436.       CNTRL.EXE is a very important component of our stack. CNTRL.EXE provides 
  437.       threads for proper running of our stack.  It provides a thread for each 
  438.       of the following: 
  439.  
  440.         -  IP input processing 
  441.         -  TCP slow timeout processing 
  442.         -  Debug thread for IP 
  443.         -  ARP timeout processing 
  444.         -  Ifndis debug thread 
  445.         -  Watchdog thread for the adapter status 
  446.         -  Loopback IP packets processing 
  447.  
  448.       CNTRL.EXE is normally started from CONFIG.SYS with a RUN=statement.  It 
  449.       should be the first program to begin executing when TCP/IP is started. 
  450.       CNTRL.EXE for Version 3.0 is different from that in Version 2.0 stack. 
  451.  
  452.      DLLs: 
  453.  
  454.       Both the TCP32DLL.DLL and SO32DLL.DLL are 32-bit DLLs. The TCPIPDLL.DLL 
  455.       is still shipped for backwards compatibility with TCP/IP Version 1.2.1, 
  456.       but no service is done on it. 
  457.  
  458.       TCP32DLL.DLL contains the getXbyY() code in it and is thread re-entrant. 
  459.       This DLL is also SLIP and LAN aware; that is, hosts on local LANs and the 
  460.       Internet (by way of SLIP) can be accessed simultaneously. 
  461.  
  462.       SO32DLL.DLL contains all sockets APIs and is thread re-entrant. 
  463.  
  464.      Device drivers: 
  465.  
  466.       SOCKETS.SYS provides the sockets layer for the stack.  All the protocol 
  467.       device drivers are below the sockets layer. Applications written to 
  468.       sockets API first pass through SOCKETS.SYS.  The socket address families 
  469.       that are supported are AF_OS2 (or AF_UNIX), AF_INET, and AF_NB. 
  470.  
  471.       AFOS2.SYS is the Local Interprocess Communication (LIPC) device driver. 
  472.       This driver supports AF_OS2 (or AF_UNIX) type sockets. The AF_OS2 socket 
  473.       types can be used by applications within one OS/2 machine to communicate 
  474.       with each other (using sockets APIs). 
  475.  
  476.       AFNB.SYS device driver provides support for sockets over NetBIOS.  This 
  477.       driver supports applications written using AF_NB type sockets (and 
  478.       sockets APIs).  But the communication takes place using NetBIOS. 
  479.  
  480.       AFINET.SYS is the transport protocol device driver for AF_INET sockets. 
  481.       AFINET.SYS is essentially TCP/IP code.  SLIP, PPP, X25, and SNAlink use a 
  482.       special interface in this driver to their respective hardware.  For 
  483.       example, SLIP.EXE creates a special interface inside the stack for the 
  484.       ComPort. IP packets for this SLIP interface are then passed on to the 
  485.       ComPort rather than to IFNDIS.SYS. 
  486.  
  487.       IFNDIS.SYS is the NDIS bottom half of AFINET.SYS.  IFNDIS.SYS is 
  488.       compliant with NDIS specs Version 2.0.1. Any MAC driver written to these 
  489.       specifications should work with the Version 3.0 stack.  This driver takes 
  490.       IP packets from AFINET.SYS, adds a MAC header to it, and transmits it to 
  491.       the MAC driver (for example, IBMTOK.OS2).  The MAC header from the 
  492.       incoming packets is stripped off and the remaining IP packet is passed 
  493.       onto AFINET.SYS. 
  494.  
  495.  
  496. ΓòÉΓòÉΓòÉ 3.2. Programming with Sockets ΓòÉΓòÉΓòÉ
  497.  
  498. This section contains introductory information about sockets and the sockets 
  499. API. 
  500.  
  501. The sockets API allows an application to communicate across networks with other 
  502. applications.  You can, for example, make use of the sockets interface when you 
  503. write a client application that may communicate with a server application 
  504. running on the same or another workstation. 
  505.  
  506. To use sockets, you must know the C programming language. 
  507.  
  508. The Network Services sockets API provides a standard interface to all supported 
  509. communication domains: Internet, Local IPC, and NetBIOS. Network Services 
  510. supports four socket types: datagram, raw, sequenced packet, and stream. Each 
  511. communication domain supports certain socket types. 
  512.  
  513. Topics 
  514.  
  515.       What Is a Socket? 
  516.       Socket Protocol Families and Supported Communication Domains 
  517.       Socket Address Families 
  518.       Connection Modes 
  519.       Socket Types 
  520.       Socket Addresses and Data Structure Format 
  521.  
  522.  
  523. ΓòÉΓòÉΓòÉ 3.2.1. What Is a Socket? ΓòÉΓòÉΓòÉ
  524.  
  525. A socket is an endpoint for communication. From an application program 
  526. perspective, it is a resource allocated by Network Services.  It is represented 
  527. by an integer called a socket descriptor. A pair of sockets, one in each of two 
  528. tasks, is used for interprocess communication (IPC) between them, on a single 
  529. workstation or different workstations. 
  530.  
  531. Sockets are full-duplex, which means that data can be transmitted and received 
  532. simultaneously. 
  533.  
  534. Each socket is created for a particular communication domain and socket type. 
  535. Communication can occur only between applications using the same socket type 
  536. within the same communications domain. 
  537.  
  538. The sockets API is designed to provide applications with access to the network 
  539. that hides the details of the physical network. You choose a socket type (refer 
  540. to Socket Types) that reflects the communication characteristics that you 
  541. desire.  For example, stream sockets offer a reliable method of data 
  542. transmission without message boundaries. 
  543.  
  544.  
  545. ΓòÉΓòÉΓòÉ 3.2.2. Socket Protocol Families and Supported Communication Domains ΓòÉΓòÉΓòÉ
  546.  
  547. Communication domains are specified in Network Services as protocol families. 
  548. Specifying the protocol family indicates to the system the underlying network 
  549. protocol used during communications. All servers in the same protocol family 
  550. understand and use the same scheme of addressing socket endpoints. 
  551.  
  552. The protocol families are defined in the <SYS\SOCKET.H> header file and are 
  553. listed in the following table: 
  554.  
  555. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  556. Γöé Table 3. Communication Domains Supported                   Γöé
  557. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  558. Γöé         Γöé PROTOCOL FAMILY   Γöé           Γöé          Γöé
  559. Γöé COMMUNICATION  Γöé #DEFINE IN     Γöé SUPPORTED PROTO-  Γöé SUPPORTED SOCKET Γöé
  560. Γöé DOMAIN     Γöé <SYS\SOCKET.H>   Γöé COLS        Γöé TYPES       Γöé
  561. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  562. Γöé Internet    Γöé PF_INET       Γöé ICMP, IP, TCP, UDP Γöé Datagram, Raw,  Γöé
  563. Γöé         Γöé           Γöé           Γöé Stream      Γöé
  564. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  565. Γöé Local IPC    Γöé PF_OS2 or PF_UNIX  Γöé Local IPC      Γöé Datagram, Stream Γöé
  566. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  567. Γöé NetBIOS     Γöé PF_NETBIOS or    Γöé NetBIOS       Γöé Datagram,     Γöé
  568. Γöé         Γöé PF_NB        Γöé           Γöé Sequenced Packet Γöé
  569. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  570.  
  571. As the table indicates, some socket types can be used in more than one 
  572. communications domain. Socket Types provides more information on socket types. 
  573.  
  574. The table below lists the default protocols for each communication 
  575. domain-socket type that is supported: 
  576.  
  577. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  578. Γöé Table 4. Default Protocols                          Γöé
  579. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  580. Γöé COMMUNI-  Γöé           Γöé DEFAULT PROTOCOL   Γöé           Γöé
  581. Γöé CATION   Γöé           Γöé #DEFINE IN      Γöé OTHER PROTOCOLS   Γöé
  582. Γöé DOMAIN   Γöé SOCKET TYPE     Γöé <SYS\SOCKET.H>    Γöé SUPPORTED      Γöé
  583. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  584. Γöé Internet  Γöé Datagram      Γöé UDP (IPPROTO_UDP)   Γöé           Γöé
  585. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  586. Γöé       Γöé Raw         Γöé Raw IP (IPPROTO_RAW) Γöé ICMP        Γöé
  587. Γöé       Γöé           Γöé            Γöé (IPPROTO_ICMP)   Γöé
  588. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  589. Γöé       Γöé Stream       Γöé TCP (IPPROTO_TCP)   Γöé           Γöé
  590. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  591. Γöé Local IPC  Γöé Datagram      Γöé none (0)       Γöé           Γöé
  592. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  593. Γöé       Γöé Stream       Γöé none (0)       Γöé           Γöé
  594. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  595. Γöé NetBIOS   Γöé Datagram      Γöé NetBIOS (NBPROTO_NB) Γöé           Γöé
  596. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  597. Γöé       Γöé Sequenced Packet  Γöé NetBIOS (NBPROTO_NB) Γöé           Γöé
  598. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  599.  
  600.  
  601. ΓòÉΓòÉΓòÉ 3.2.3. Socket Address Families ΓòÉΓòÉΓòÉ
  602.  
  603. An address family is a specific address format that conforms to the rules of 
  604. the communication domain that the address family is used in. The address family 
  605. indicates to the system how to interpret supplied addresses. The address 
  606. families that are supported by TCP/IP Version 3.0 for OS/2 Warp Network 
  607. Services are defined in the <SYS\SOCKET.H> header file, as follows: 
  608.  
  609. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  610. Γöé Table 5. Socket Address Families                        Γöé
  611. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  612. Γöé       Γöé                       Γöé ADDRESS FAMILY    Γöé
  613. Γöé ADDRESS   Γöé                       Γöé #DEFINE IN      Γöé
  614. Γöé FAMILY   Γöé DESCRIPTION                 Γöé <SYS\SOCKET.H>    Γöé
  615. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  616. Γöé Internet  Γöé Defines addresses in the Internet Protocol Γöé AF_INET        Γöé
  617. Γöé       Γöé version 4 address format.          Γöé            Γöé
  618. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  619. Γöé Local IPC  Γöé Defines addresses in the Local IPC address Γöé AF_OS2 or AF_UNIX   Γöé
  620. Γöé       Γöé format.                   Γöé            Γöé
  621. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  622. Γöé NetBIOS   Γöé Defines addresses in the NetBIOS address  Γöé AF_NETBIOS or AF_NB  Γöé
  623. Γöé       Γöé format.                   Γöé            Γöé
  624. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  625.  
  626.  
  627. ΓòÉΓòÉΓòÉ 3.2.4. Connection Modes ΓòÉΓòÉΓòÉ
  628.  
  629. A connection mode refers to whether there is an established logical channel for 
  630. the transmission of data between two application programs. 
  631.  
  632. The Network Services sockets API supports two connection modes: 
  633.  
  634.      Connection-oriented 
  635.      Connectionless 
  636.  
  637.  The connection-oriented mode requires a logical connection to be established 
  638.  between two applications before data transfer or communication can occur. 
  639.  Applications encounter some overhead during the connection establishment phase 
  640.  as the applications negotiate the connection request. This mode is useful for 
  641.  applications that use long datastream transmissions or require reliable 
  642.  transmissions of data. 
  643.  
  644.  The connectionless mode does not require a logical connection to allow 
  645.  communication between applications. Rather, individual messages are 
  646.  transmitted independently from one application to another application. Each 
  647.  message must contain the data and all information required for delivery of the 
  648.  message to its destination. Normally, datagram and raw socket types use the 
  649.  connectionless mode. 
  650.  
  651.  The term connected refers to two endpoints that have an established logical 
  652.  connection between them. Stream and sequenced packet socket types use the 
  653.  connection-oriented mode. For information on how datagram and raw socket types 
  654.  can be connected, see "Datagram or raw sockets" in connect(). 
  655.  
  656.  
  657. ΓòÉΓòÉΓòÉ 3.2.5. Socket Types ΓòÉΓòÉΓòÉ
  658.  
  659. This section discusses the following topics: 
  660.  
  661.      Stream Sockets 
  662.      Sequenced Packet Sockets 
  663.      Datagram Sockets 
  664.      Raw Sockets 
  665.      Guidelines for Using Socket Types 
  666.  
  667.  Each socket has an associated type, which describes the semantics of 
  668.  communication for the socket. The socket type determines the socket 
  669.  communication properties such as reliability, ordering, and prevention of 
  670.  duplication of messages. The Network Services sockets API supports 
  671.  communications only between applications using the same socket type. 
  672.  
  673.  The socket type is passed as a parameter to the socket() call.  For more 
  674.  detailed information, see socket(). Socket Types Summary Table summarizes the 
  675.  attributes and features of each socket type. 
  676.  
  677.  
  678. ΓòÉΓòÉΓòÉ 3.2.5.1. Stream Sockets ΓòÉΓòÉΓòÉ
  679.  
  680. Stream sockets model full-duplex byte streams and define a reliable 
  681. connection-oriented service.  Data is sent without errors or duplication and is 
  682. received in the same order as it was sent. Flow control is built in to avoid 
  683. data overruns. Note that there is no guarantee for a one-to-one correspondence 
  684. of send and receive calls.  It is possible for data sent by one or more send 
  685. calls to be received by one or more different receive calls. 
  686.  
  687. Stream sockets are connected sockets and are either active or passive. Active 
  688. sockets are used by clients who initiate connection requests with connect(). 
  689. Passive sockets are used by servers to accept connection requests with the 
  690. listen() and accept() calls. A passive socket that has indicated its 
  691. willingness to accept connections with the listen() call cannot be used to 
  692. initiate connection requests. 
  693.  
  694. After a connection has been established between stream sockets, any of the data 
  695. transfer calls can be used: 
  696.  
  697.       send() and recv() 
  698.       sendto() and recvfrom() 
  699.       sendmsg() and recvmsg() 
  700.       writev() and readv() 
  701.  
  702.  Usually, a send()-recv() pair is used for sending data on stream sockets. 
  703.  
  704.  
  705. ΓòÉΓòÉΓòÉ 3.2.5.2. Sequenced Packet Sockets ΓòÉΓòÉΓòÉ
  706.  
  707. Sequenced packet sockets define a reliable connection-oriented service.  Data 
  708. is sent without error or duplication and is received in the same order as it 
  709. was sent.  Flow control is built in to avoid data overruns.  Every sequenced 
  710. packet is sent and received as a complete record. 
  711.  
  712. After a connection has been established between sequenced packet sockets, any 
  713. of the data transfer calls can be used: 
  714.  
  715.       send() and recv() 
  716.       sendto() and recvfrom() 
  717.       sendmsg() and recvmsg() 
  718.       writev() and readv() 
  719.  
  720.  Usually, a send()-recv() pair is used for sending data on sequenced packet 
  721.  sockets. 
  722.  
  723.  
  724. ΓòÉΓòÉΓòÉ 3.2.5.3. Datagram Sockets ΓòÉΓòÉΓòÉ
  725.  
  726. Datagram sockets provide connectionless message exchange with no guarantees of 
  727. delivery. Data can be lost or duplicated, and datagrams can arrive out of 
  728. order. Datagrams are sent and received as complete records. 
  729.  
  730. Datagram sockets are connectionless sockets by default. A datagram socket 
  731. operating in connectionless mode can exchange datagrams using the sendto() and 
  732. recvfrom() calls or the sendmsg() and recvmsg() calls. If an application 
  733. program is using datagram sockets and calls connect() fully specifying the 
  734. destination address, the socket will be considered connected. The application 
  735. program can then use the other data transfer calls send() and recv() or 
  736. writev() and readv(). The connected or unconnected method of data transfer 
  737. stays in effect until connect() is called again with a different destination 
  738. address. Refer to "Datagram or raw sockets" in connect() for additional 
  739. information. 
  740.  
  741. Datagram sockets may be used to send broadcast messages in the Internet and 
  742. NetBIOS communications domain. For the Internet domain, the constant 
  743. INADDR_BROADCAST, defined in <SYS\SOCKET.H>, can be used to send a broadcast 
  744. datagram. For the NetBIOS domain, the address format has a type field that 
  745. specifies whether the address is unique, multicast, or broadcast. 
  746.  
  747.  
  748. ΓòÉΓòÉΓòÉ 3.2.5.4. Raw Sockets ΓòÉΓòÉΓòÉ
  749.  
  750. Raw sockets provide connectionless message exchange with the same data transfer 
  751. semantics as previously described for datagram sockets. You can use raw sockets 
  752. to directly access the protocol specified in the socket() call, such as the 
  753. Internet Protocol (IP), or the Internet Control Message Protocol (ICMP). Raw 
  754. sockets are often used for testing new protocol implementations or gaining 
  755. access to some of the more advanced facilities of an existing protocol. 
  756.  
  757. Raw sockets are connectionless mode sockets by default. Raw sockets can be 
  758. connected if connect() is called to specify the destination address. Refer to 
  759. "Datagram or raw sockets" in connect() for additional information. 
  760.  
  761.  
  762. ΓòÉΓòÉΓòÉ 3.2.5.5. Socket Types Summary Table ΓòÉΓòÉΓòÉ
  763.  
  764. The following table summarizes many of the attributes and features of supported 
  765. socket types: 
  766.  
  767. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  768. Γöé Table 6. Socket Types                              Γöé
  769. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  770. Γöé      Γöé           Γöé         Γöé CON-    Γöé         Γöé
  771. Γöé SOCKET   Γöé #DEFINE IN     Γöé         Γöé NECTION  Γöé PRIMARY     Γöé
  772. Γöé TYPE    Γöé <SYS\SOCKET.H>   Γöé DOMAINS     Γöé ORIENTED? Γöé SOCKET CALLS   Γöé
  773. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  774. Γöé Stream   Γöé SOCK_STREAM     Γöé INET, Local IPC Γöé yes    Γöé send - recv   Γöé
  775. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  776. Γöé Sequenced Γöé SOCK_SEQPACKET   Γöé NetBIOS     Γöé yes    Γöé send - recv   Γöé
  777. Γöé Packet   Γöé           Γöé         Γöé      Γöé         Γöé
  778. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  779. Γöé Datagram  Γöé SOCK_DGRAM     Γöé INET, Local   Γöé no (*)   Γöé sendto -     Γöé
  780. Γöé      Γöé           Γöé IPC, NetBIOS   Γöé      Γöé recvfrom(*)   Γöé
  781. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  782. Γöé Raw    Γöé SOCK_RAW      Γöé INET       Γöé no (*)   Γöé sendto -     Γöé
  783. Γöé      Γöé           Γöé         Γöé      Γöé recvfrom(*)   Γöé
  784. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  785. Γöé NOTE:  (*) Datagram sockets and raw sockets are connectionless, unless the   Γöé
  786. Γöé application has called connect() for the socket.  In this case, the socket is  Γöé
  787. Γöé CONNECTED.  Refer to Connection Modes for additional information.        Γöé
  788. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  789.  
  790.  
  791. ΓòÉΓòÉΓòÉ 3.2.5.6. Guidelines for Using Socket Types ΓòÉΓòÉΓòÉ
  792.  
  793. If you are communicating with an existing application, you must use the same 
  794. socket type and the same communication domain as the existing application. 
  795.  
  796. Raw sockets have a special purpose of interfacing directly to the underlying 
  797. protocol layer. If you are writing a new protocol on top of Internet Protocol 
  798. (IP) or wish to use the Internet Control Message Protocol (ICMP), then you must 
  799. use raw sockets. 
  800.  
  801. You should consider the following factors in choosing a socket type for new 
  802. applications: 
  803.  
  804.      Reliability: Stream and sequenced packet sockets provide the most 
  805.       reliable connection. Connectionless datagram and raw sockets are 
  806.       unreliable because packets can be discarded, duplicated, or received out 
  807.       of order. This may be acceptable if the application does not require 
  808.       reliability, or if the application implements the reliability on top of 
  809.       the sockets API.  The trade-off is the increased performance available 
  810.       over stream and sequenced packet sockets. 
  811.  
  812.      Performance: The overhead associated with reliability, flow control, 
  813.       packet reassembly, and connection maintenance degrades the performance of 
  814.       stream and sequenced packet sockets so that these socket types do not 
  815.       perform as well as datagram sockets acting in a connectionless mode. 
  816.  
  817.      Amount of data to be transferred:  Datagram and sequenced packet sockets 
  818.       impose a limit on the amount of data transferred. As the amount of data 
  819.       in a single transaction increases, it is preferable to use stream or 
  820.       sequenced packet sockets. 
  821.  
  822.  
  823. ΓòÉΓòÉΓòÉ 3.2.6. Socket Addresses and Data Structure Format ΓòÉΓòÉΓòÉ
  824.  
  825. A socket can be bound to a unique local address with the bind() call so that 
  826. other sockets can connect to it. The socket address format conforms to the 
  827. rules governing network addresses for each communication domain. For example, 
  828. in the Internet communication domain, a socket address consists of a 32-bit 
  829. internet host address and a 16-bit local port number. Each communication domain 
  830. has different rules for valid socket names and interpretation of names. 
  831.  
  832. A socket address is defined by the following sockaddr structure, which is found 
  833. in the <SYS\SOCKET.H> header file: 
  834.  
  835. struct sockaddr
  836. {
  837.     u_short sa_family;       /* address family */
  838.     char   sa_data[14];     /* address value */
  839. };
  840.  
  841. The sa_family field contains the address family. The sa_data field is different 
  842. for each address family. Each address family defines its own structure, which 
  843. is overlaid on the sockaddr structure. 
  844.  
  845. Socket address structures for the Internet, Local IPC, and NetBIOS 
  846. communication domains (sockaddr_in, sockaddr_un, sockaddr_nb) are described in 
  847. "Addressing within an Internet Domain", Local IPC Address Format, and NetBIOS 
  848. Address Format. 
  849.  
  850.  
  851. ΓòÉΓòÉΓòÉ 3.3. Multithreading Considerations ΓòÉΓòÉΓòÉ
  852.  
  853. The sockets and network utility routines are completely re-entrant. Multiple 
  854. threads of an application can call any socket call. 
  855.  
  856.  
  857. ΓòÉΓòÉΓòÉ 3.4. Typical Socket Session Diagrams ΓòÉΓòÉΓòÉ
  858.  
  859. The following figures show a graphical representation for the general sequence 
  860. of socket calls needed to provide communication between applications for 
  861. supported socket types. For stream or sequenced packet socket types, and for 
  862. datagram socket types, see the following figures. This basic sequence is the 
  863. same for each supported communication domain for all supported socket types. 
  864. This means that a programmer can modify the communications domain selection and 
  865. the networking addressing parameters of an existing sockets program, recompile 
  866. and relink, and the program can be run in another domain. This also allows 
  867. programs that use sockets in multiple domains to be easily constructed. 
  868.  
  869.  
  870. A Typical Stream or Sequenced Packet Socket Session
  871.  
  872. There is an alternative to the serialized sequence as shown in the next figure. 
  873. The server can call accept() to create a new thread to handle this new socket. 
  874. Using the original thread, the server can then call accept() again and begin 
  875. waiting for more requests. 
  876.  
  877.  
  878. A Typical Datagram Socket Session
  879.  
  880.  
  881. ΓòÉΓòÉΓòÉ 3.5. Using Socket Calls ΓòÉΓòÉΓòÉ
  882.  
  883. A detailed description of how to use the basic socket calls follows. These 
  884. examples show communication between applications in the Internet communication 
  885. domain using stream sockets. Sample programs can be found in the 
  886. TCPIP\SAMPLES\SOCKET directory. Additional information for other supported 
  887. domains can be found in Sockets over Local IPC and Sockets over NetBIOS. 
  888.  
  889.    1. An application must get a socket descriptor using the socket() call: 
  890.  
  891.  
  892.             An Application Uses the socket() Call
  893.  
  894.             int socket(int domain, int type, int protocol); /* extracted from sys\socket.h */
  895.             int s;
  896.             .
  897.             .
  898.             .
  899.             s = socket(PF_INET, SOCK_STREAM, 0);
  900.  
  901.       In this example, the socket() call allocates a socket descriptor s in the 
  902.       Internet communication domain. The communication domain is specified in 
  903.       the domain parameter. The domain is specified with one of the supported 
  904.       protocol families.  This example specifies the protocol family PF_INET. 
  905.       The type parameter is a constant that specifies the type of socket.  For 
  906.       the Internet communication domain, this can be SOCK_STREAM, SOCK_DGRAM, 
  907.       or SOCK_RAW. The protocol parameter is a constant that specifies which 
  908.       protocol to use. Passing 0 chooses the default protocol for the specified 
  909.       socket type. Socket Protocol Families and Supported Communication Domains 
  910.       includes information on default protocols. If successful, socket() 
  911.       returns a non-negative integer socket descriptor. 
  912.  
  913.    2. After an application has a socket descriptor, it can explicitly bind() a 
  914.       unique name to the socket: 
  915.  
  916.  
  917.             An Application Uses the bind() Call
  918.  
  919.             int rc;
  920.             int s;
  921.             struct sockaddr_in myname;
  922.             int bind(int s, struct sockaddr *name, int namelen); /* extracted from sys\socket.h */
  923.  
  924.             /* clear the structure */
  925.             memset(&myname, 0, sizeof(myname));
  926.             myname.sin_family = AF_INET;
  927.             myname.sin_addr.s_addr = inet_addr("129.5.24.1"); /* specific interface */
  928.             myname.sin_port = htons(1024);
  929.             .
  930.             .
  931.             .
  932.             rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  933.  
  934.       For a server in the Internet domain to be able to listen() for 
  935.       connections on a stream socket or issue recvfrom() on a datagram socket, 
  936.       the server must first bind() the socket to a specific address family and 
  937.       port. This example binds myname to socket s. Note that the sockaddr_in 
  938.       structure should be cleared before calling bind(). For a more detailed 
  939.       description, see bind(). For information on the sockaddr_in structure, 
  940.       see Internet Address Formats. 
  941.  
  942.       The unique name myname specifies that the application uses an Internet 
  943.       address family (AF_INET) at Internet address 129.5.24.1, and is bound to 
  944.       port 1024. The preceding example shows two useful network utility 
  945.       routines. 
  946.  
  947.           inet_addr()  takes an Internet address in dotted-decimal form and 
  948.            returns it in network-byte order. For a more detailed description, 
  949.            see inet_addr(). 
  950.  
  951.           htons()  takes a port number in host-byte order and returns the port 
  952.            in network-byte order.  For a more detailed description, see 
  953.            htons(). 
  954.  
  955.       The next figure shows how the bind() call on the server side uses the 
  956.       network utility routine getservbyname() to find a well-known port number 
  957.       for a specified service from the ETC\SERVICES file (for more information 
  958.       on well-known ports, see Ports). The figure also shows the use of the 
  959.       internet address wildcard value INADDR_ANY.  This is the value generally 
  960.       used on a socket bind() call.  It binds the socket to all internet 
  961.       addresses available on the local machine, without requiring the program 
  962.       to know the local internet address. (The code fragment in the preceding 
  963.       figure will run successfully only on the machine with internet address 
  964.       192.5.24.1.) If a host has more than one internet address (that is, if it 
  965.       is multihomed host), messages sent to any of the addresses will be 
  966.       deliverable to a socket bound to INADDR_ANY. 
  967.  
  968.  
  969.             A bind() Call Uses the getservbyname() Call
  970.  
  971.             int rc;
  972.             int s;
  973.             struct sockaddr_in myname;
  974.             int bind(int s, struct sockaddr *name, int namelen); /* extracted from sys\socket.h */
  975.             struct servent *sp;
  976.             .
  977.             .
  978.             .
  979.             sp = getservbyname("login","tcp");  /* get application specific */
  980.                                                 /* well-known port          */
  981.  
  982.             .
  983.             .
  984.             .
  985.             /* clear the structure */
  986.             memset(&myname,0,sizeof(myname));
  987.             myname.sin_family = AF_INET;
  988.             myname.sin_addr.s_addr = INADDR_ANY;  /* any interface */
  989.             myname.sin_port = sp->s_port;
  990.             .
  991.             .
  992.             .
  993.             rc = bind(s,(struct sockaddr *)&myname,sizeof(myname));
  994.  
  995.    3. After binding a name to a socket, a server using stream sockets must 
  996.       indicate its readiness to accept connections from clients. The server 
  997.       does this with the listen() call: 
  998.  
  999.  
  1000.             An Application Uses the listen() Call
  1001.  
  1002.             int s;
  1003.             int backlog;
  1004.             int rc;
  1005.             int listen(int s, int backlog);  /* extracted from sys\socket.h */
  1006.             .
  1007.             .
  1008.             .
  1009.             rc = listen(s, 5);
  1010.  
  1011.       The listen() call is used to indicate the server is ready to begin 
  1012.       accepting connections. In this example, a maximum of five connection 
  1013.       requests can be queued for the server. Additional requests are ignored. 
  1014.       For a more detailed description, see listen(). 
  1015.  
  1016.    4. Clients using stream sockets call connect() to request a connection: 
  1017.  
  1018.  
  1019.             An Application Uses the connect() Call
  1020.  
  1021.             int s;
  1022.             struct sockaddr_in servername;
  1023.             int rc;
  1024.             int connect(int s, struct sockaddr *name, int namelen);  /* extracted from sys\socket.h */
  1025.             .
  1026.             .
  1027.             .
  1028.             memset(&servername, 0,sizeof(servername));
  1029.             servername.sin_family = AF_INET;
  1030.             servername.sin_addr.s_addr = inet_addr("129.5.24.1");
  1031.             servername.sin_port = htons(1024);
  1032.             .
  1033.             .
  1034.             .
  1035.             rc = connect(s, (struct sockaddr *) &servername, sizeof(servername));
  1036.  
  1037.       The connect() call attempts to connect socket s to the server with name 
  1038.       supplied in servername. This could be the server that was used in the 
  1039.       previous bind() example. With TCP stream sockets the caller blocks until 
  1040.       the connection is accepted by the server.  On successful return from 
  1041.       connect(), the socket s is associated with the connection to the server. 
  1042.       Refer to ioctl() for additional information about determining blocking 
  1043.       and nonblocking behavior. Note that the sockaddr_in structure should be 
  1044.       cleared before calling connect(). For a more detailed description, see 
  1045.       connect(). 
  1046.  
  1047.  
  1048.             An Application Uses the gethostbyname() Call
  1049.  
  1050.             int s;
  1051.             struct sockaddr_in servername;
  1052.             char *hostname = "serverhost";
  1053.             int rc;
  1054.             int connect(int s, struct sockaddr *name, int namelen);  /* extracted from sys\socket.h */
  1055.             struct hostent *hp;
  1056.             .
  1057.             .
  1058.             .
  1059.  
  1060.             hp = gethostbyname(hostname);
  1061.  
  1062.             /* clear the structure */
  1063.             memset(&servername,0,sizeof(servername));
  1064.             servername.sin_family = AF_INET;
  1065.             servername.sin_addr.s_addr = *((u_long *)hp->h_addr);
  1066.             servername.sin_port = htons(1024);
  1067.             .
  1068.             .
  1069.             .
  1070.             rc = connect(s,(struct sockaddr *)&servername,sizeof(servername));
  1071.  
  1072.       The above figure shows an example of using the gethostbyname() network 
  1073.       utility routine to find out the Internet address of serverhost from the 
  1074.       name server or the ETC\HOSTS file. 
  1075.  
  1076.    5. Servers using stream sockets accept a connection request with the 
  1077.       accept() call: 
  1078.  
  1079.  
  1080.             An Application Uses the accept() Call
  1081.  
  1082.             int clientsocket;
  1083.             int s;
  1084.             struct sockaddr clientaddress;
  1085.             int addrlen;
  1086.             int accept(int s, struct sockaddr *addr, int *addrlen); /* extracted from sys\socket.h */
  1087.             .
  1088.             .
  1089.             .
  1090.             addrlen = sizeof(clientaddress);
  1091.             .
  1092.             .
  1093.             .
  1094.             clientsocket = accept(s, &clientaddress, &addrlen);
  1095.  
  1096.       If connection requests are not pending on socket s, the accept() call 
  1097.       will block the server unless ioctl() has been called. Refer to ioctl() 
  1098.       for additional information about determining blocking and nonblocking 
  1099.       behavior. When a connection request is accepted on socket s, the name of 
  1100.       the client and length of the client name are returned, along with a new 
  1101.       socket descriptor.  The new socket descriptor is associated with the 
  1102.       client that initiated the connection and socket s is again available to 
  1103.       accept new connections.  For a more detailed description, see accept(). 
  1104.  
  1105.    6. There are several sockets API calls available to clients and servers for 
  1106.       data transfer. The readv() and writev(), and send() and recv() calls can 
  1107.       be used on connected sockets. The sendto() and recvfrom() calls can be 
  1108.       used on both connected and unconnected sockets. 
  1109.  
  1110.  
  1111.             An Application Uses the send() and recv() Calls
  1112.  
  1113.             int bytes_sent;
  1114.             int bytes_received;
  1115.             char data_sent[256] = "data to be sent on connected socket";
  1116.             char data_received[256];
  1117.             int send(int socket, char *buf, int buflen, int flags);  /* extracted from sys\socket.h */
  1118.             int recv(int socket, char *buf, int buflen, int flags);  /* extracted from sys\socket.h */
  1119.             int s;
  1120.             .
  1121.             .
  1122.             .
  1123.             bytes_sent = send(s, data_sent, sizeof(data_sent), 0);
  1124.             .
  1125.             .
  1126.             .
  1127.             bytes_received = recv(s, data_received, sizeof(data_received), 0);
  1128.  
  1129.       The example above shows an application sending data on a connected socket 
  1130.       and receiving data in response. The flags field can be used to specify 
  1131.       additional options to send() or recv(), such as sending out-of-band data. 
  1132.       For additional information, see send() and recv(). 
  1133.  
  1134.    7. If the socket is not connected, additional addressing information must be 
  1135.       passed using sendto() and may be optionally returned using recvfrom(). 
  1136.       The following figure shows an example of using the sendto() and 
  1137.       recvfrom() calls: 
  1138.  
  1139.  
  1140.             An Application Uses the sendto() and recvfrom() Call
  1141.  
  1142.             int bytes_sent;
  1143.             int bytes_received;
  1144.             char data_sent[256] = "data to be sent using sendto()";
  1145.             char data_received[256];
  1146.             struct sockaddr_in to;
  1147.             struct sockaddr from;
  1148.             int addrlen;
  1149.             int sendto(int socket, char *buf, int buflen, int flags,
  1150.                        struct sockaddr *addr, int addrlen);      /* extracted from sys\socket.h */
  1151.             int recvfrom(int socket, char *buf, int buflen, int flags,
  1152.                        struct sockaddr *addr, int *addrlen);     /* extracted from sys\socket.h */
  1153.             int s;
  1154.             .
  1155.             .
  1156.             .
  1157.             memset(&to, 0, sizeof(to));
  1158.             to.sin_family = AF_INET;
  1159.             to.sin_addr.s_addr   = inet_addr("129.5.24.1");
  1160.             to.sin_port   = htons(1024);
  1161.             .
  1162.             .
  1163.             .
  1164.             bytes_sent = sendto(s, data_sent, sizeof(data_sent), 0, (struct sockaddr *) &to, sizeof(to));
  1165.             .
  1166.             .
  1167.             .
  1168.             addrlen = sizeof(from); /* must be initialized */
  1169.             bytes_received = recvfrom(s, data_received, sizeof(data_received), 0, &from, &addrlen);
  1170.  
  1171.       The sendto() and recvfrom() calls take additional parameters that allow 
  1172.       the caller to specify the recipient of the data or to be notified of the 
  1173.       sender of the data. See recvfrom(), and sendto(), for more information 
  1174.       about these additional parameters. 
  1175.  
  1176.    8. The writev() and readv() calls provide the additional features of scatter 
  1177.       gather read/write of data. Scattered data can be located in multiple data 
  1178.       buffers. The writev() call gathers the scattered data and sends it. The 
  1179.       readv() call receives data and scatters it into multiple buffers. 
  1180.  
  1181.    9. Applications can handle multiple sockets. In such situations, you can use 
  1182.       the select() call to determine the sockets that have data to be read, 
  1183.       those that are ready for data to be written, and the sockets that have 
  1184.       pending exception conditions. If the timeout parameter is positive, 
  1185.       select() waits up to this amount of time for at least one socket to 
  1186.       become ready on the indicated conditions. This is useful for applications 
  1187.       servicing multiple connections that cannot afford to block, waiting for 
  1188.       data on one connection. 
  1189.  
  1190.       There are two versions of the select() call: a TCP/IP Version 3.0 for 
  1191.       OS/2 Warp version and a version modeled after the BSD select() call. An 
  1192.       example of how the TCP/IP Version 3.0 for OS/2 Warp select() call is used 
  1193.       is shown in the next figure. For information on using the BSD version of 
  1194.       the select() call, refer to BSD Version. 
  1195.  
  1196.  
  1197.             An Application Uses the select() Call
  1198.  
  1199.             .
  1200.             .
  1201.             .
  1202.             int socks[3];    /* array of sockets */
  1203.             long timeout = MAX_TIMEOUT;
  1204.             int s1, s2, s3;
  1205.             int number_ready;
  1206.             .
  1207.             .
  1208.             .
  1209.                /* put sockets to check in socks[] */
  1210.                socks[0] = s1;     /* read socket number */
  1211.                socks[1] = s2;     /* write socket number */
  1212.                socks[2] = s3;     /* second write socket number */
  1213.  
  1214.                /* check for READ on s1, WRITE on s2 and s3 */
  1215.                number_ready = select(socks, 1, 2, 0, timeout);
  1216.  
  1217.       In this example, the application indicates the sockets to be checked for 
  1218.       readability or readiness for writing. 
  1219.  
  1220.   10. In addition to select(), applications can use the ioctl() call to help 
  1221.       perform asynchronous (nonblocking) socket operations.  An example of the 
  1222.       use of the ioctl() call follows: 
  1223.  
  1224.  
  1225.             An Application Uses the ioctl() Call
  1226.  
  1227.             int s;
  1228.             int bytes_received;
  1229.             int dontblock;
  1230.             char buf[256];
  1231.             int rc;
  1232.             int ioctl(int s, int command, char *command_data, int datasize);
  1233.                                               /* extracted from sys\socket.h */
  1234.             .
  1235.             .
  1236.             .
  1237.             dontblock = 1;
  1238.             .
  1239.             .
  1240.             .
  1241.             rc = ioctl(s, FIONBIO, (char *) &dontblock, sizeof(dontblock));
  1242.             .
  1243.             .
  1244.             .
  1245.             bytes_received = recv(s, buf, sizeof(buf), 0);
  1246.             if (bytes_received == -1)
  1247.             {
  1248.               if (sock_errno() == SOCEWOULDBLOCK)
  1249.                          /* data is not present */
  1250.               else
  1251.                          /* error occurred */
  1252.             }
  1253.             else
  1254.                /* bytes_ received indicates amount of data received in buf */
  1255.  
  1256.       This example causes the socket s to be placed in nonblocking mode.  When 
  1257.       this socket is passed as a parameter to calls that would block, such as 
  1258.       recv() when data is not present, it causes the call to return with an 
  1259.       error code, and sets the error value to SOCEWOULDBLOCK.  Setting the mode 
  1260.       of the socket to be nonblocking allows an application to continue 
  1261.       processing without becoming blocked. For a more detailed description, 
  1262.       seeioctl(). 
  1263.  
  1264.   11. The socket descriptor s is deallocated with the soclose() call. For a 
  1265.       more detailed description, see soclose(). Here is an example of the 
  1266.       soclose() call: 
  1267.  
  1268.  
  1269.             An Application Uses the soclose() Call
  1270.  
  1271.             int soclose(int s);   /* extracted from sys\socket.h */
  1272.             .
  1273.             .
  1274.             .
  1275.             /* close the socket */
  1276.             soclose(s);
  1277.             .
  1278.             .
  1279.             .
  1280.  
  1281.  
  1282. ΓòÉΓòÉΓòÉ 3.6. Porting a Sockets API Application ΓòÉΓòÉΓòÉ
  1283.  
  1284. Network Services sockets is based on the Berkeley Software Distribution version 
  1285. 4.3 sockets implementation. 
  1286.  
  1287. The IBM OS/2 socket implementation differs from the Berkeley socket 
  1288. implementation as follows: 
  1289.  
  1290.      Sockets are not OS/2 files or devices.  Socket numbers have no 
  1291.       relationship to OS/2 file handles.  Therefore, read(), write(), and 
  1292.       close() do not work for sockets. Using read(), write(), or close() gives 
  1293.       incorrect results.  Use the recv(), send(), and soclose() functions 
  1294.       instead. 
  1295.  
  1296.      Socket calls require that you call the sock_init() routine before you 
  1297.       call them.  Therefore, always call sock_init() at the beginning of 
  1298.       programs using the socket interface. 
  1299.  
  1300.      Error codes set by the OS/2 TCP/IP sockets implementation are not made 
  1301.       available via the global errno variable.  Instead, error codes are 
  1302.       accessed by using the sock_errno() API described in sock_errno().  Use 
  1303.       psock_errno(), instead of perror(), to write a short error message to the 
  1304.       standard error device describing the last error encountered during a call 
  1305.       to a socket library function.  It is not possible for an application to 
  1306.       assign new values to error codes. 
  1307.  
  1308.       This is intended to obtain per-thread error codes in a multithreaded 
  1309.       application environment and to avoid conflict with standard IBM C Set++ 
  1310.       error constants. 
  1311.  
  1312.       For compatibility with BSD, an application can choose to define: 
  1313.  
  1314.             #define errno sock_errno()
  1315.             #define perror psock_errno()
  1316.  
  1317.       If a source file includes code that checks errno for both OS/2 socket and 
  1318.       OS/2 nonsocket functions, this mechanism cannot be used. 
  1319.  
  1320.       BSD-style error checking is as follows: 
  1321.  
  1322.                    -  rt = recv(s, buf, sizeof(buf), 0);
  1323.                          if (rt == -1 && errno == EWOULDBLOCK)
  1324.                          {...}
  1325.  
  1326.                    -  if (recv(s, buf, sizeof(buf), 0) < 0) {
  1327.                           perror("Recv()");
  1328.                           exit(1);
  1329.                       }
  1330.  
  1331.       The preferred OS/2-style error checking is as follows: 
  1332.  
  1333.                    -  rt = recv(s, buf, sizeof(buf), 0);
  1334.                          if (rt == -1 && sock_errno() == SOCEWOULDBLOCK)
  1335.                          {...}
  1336.  
  1337.                    -  if (recv(s, buf, sizeof(buf), 0) < 0)
  1338.                       {
  1339.                           psock_errno("Recv()");
  1340.                           exit(1);
  1341.                       }
  1342.  
  1343.       Error constants consistent with BSD sockets are provided for 
  1344.       compatibility purposes; your application can use the error constant 
  1345.       EWOULDBLOCK, instead of SOCEWOULDBLOCK.  Refer to Socket Error Constants, 
  1346.       or the <NERRNO.H> file for definitions of error constants. 
  1347.  
  1348.      The select() call has a different interface.  Unlike the Berkeley 
  1349.       select() call, you cannot use the OS/2 select() call to wait for activity 
  1350.       on devices other than sockets.  See select() for more information. 
  1351.  
  1352.      ioctl() implementation might differ from the current Berkeley ioctl() 
  1353.       implementation.  For example, IBM has added a lendata parameter, which 
  1354.       the current Berkeley ioctl() implementation does not support.  Other 
  1355.       functions of the IBM ioctl() call might also differ from the current 
  1356.       Berkeley ioctl() implementation.  In addition, the getsockopt() and 
  1357.       setsockopt() might provide different support. 
  1358.  
  1359.  See ioctl(), getsockopt(), and setsockopt() for more information. 
  1360.  
  1361.  You must define the constant OS2 by doing one of the following: 
  1362.  
  1363.      Place #define OS2 at the top of each file that includes TCP/IP header 
  1364.       files. 
  1365.  
  1366.      Use the /DOS2 option when compiling the source for your application. 
  1367.  
  1368.  
  1369. ΓòÉΓòÉΓòÉ 3.7. Compiling and Linking a Sockets API Application ΓòÉΓòÉΓòÉ
  1370.  
  1371. Follow these steps to compile and link a sockets API application using an IBM 
  1372. 32-bit OS/2 compiler: 
  1373.  
  1374.    1. Set your environment variables to find the following: 
  1375.  
  1376.           Executable programs 
  1377.           Link libraries 
  1378.           Header files 
  1379.  
  1380.       You can set the environment variables in your CONFIG.SYS file.  An 
  1381.       example of the entries you might have in your CONFIG.SYS file follows: 
  1382.  
  1383.             LIBPATH=E:\IBMC\DLL;C:\MPTN\DLL;C:\TCPIP\DLL;
  1384.             SET PATH=E:\IBMC\BIN;
  1385.             SET DPATH=E:\IBMC\LOCALE;E:\IBMC\HELP;
  1386.             SET LIB=E:\IBMC\LIB;C:\MPTN\LIB;C:\TCPIP\LIB;
  1387.             SET INCLUDE=E:\IBMC\INCLUDE;C:\TCPIP\INCLUDE;
  1388.             SET HELP=E:\IBMC\HELP;
  1389.             SET BOOKSHELF=E:\IBMC\HELP;
  1390.             SET TMP=E:\IBMC\TMP
  1391.             SET TZ=EST5EDT,0,0,0,0,0,0,0,0,0
  1392.  
  1393.    2. To compile your program, enter: 
  1394.  
  1395.             icc /Ti /DOS2 /Sm /Ss /Q /Gm /Gt /C myprog.c
  1396.  
  1397.    3. To create an executable program, you can enter: 
  1398.  
  1399.       For VisualAge C++ 
  1400.  
  1401.             ilink /NOFREEFORMAT /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  1402.  
  1403.       For C Set++ 
  1404.  
  1405.             link386 /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  1406.  
  1407.  Note: 
  1408.  
  1409.    1. Before you run a sockets application, verify that the DLL files 
  1410.       (so32dll.dll and tcp32dll.dll) are in a directory listed in the LIBPATH 
  1411.       system environment variable. 
  1412.  
  1413.    2. For more information about the compile and link options, multithreaded 
  1414.       libraries, and dynamic link libraries, see the User's Guide provided with 
  1415.       your compiler. 
  1416.  
  1417.  
  1418. ΓòÉΓòÉΓòÉ 4. Sockets in the Internet Domain ΓòÉΓòÉΓòÉ
  1419.  
  1420. This section describes the use of sockets in the Internet domain. 
  1421.  
  1422. Topics 
  1423.  
  1424.       Protocols Used in the Internet Domain 
  1425.       Getting Started with Sockets in the Internet Domain 
  1426.       Network-Byte Order 
  1427.       Internet Address Formats 
  1428.       TCP/IP Specific Network Utility Routines 
  1429.  
  1430.  
  1431. ΓòÉΓòÉΓòÉ 4.1. Protocols Used in the Internet Domain ΓòÉΓòÉΓòÉ
  1432.  
  1433. This section describes the network protocols in TCP/IP. The Internet domain is 
  1434. supported only by the TCP/IP protocol suite. Networking protocols like TCP/IP 
  1435. are layered as shown in the following figure. For more information on the 
  1436. Internet domain and the TCP/IP protocol suite, refer to TCP/IP Illustrated, 
  1437. Volume 1: The Protocols, Douglas E. Comer, Addison-Wesley Publishing Co., 1993. 
  1438.  
  1439.  
  1440. The Internet Layered Architecture
  1441.  
  1442. Topics 
  1443.  
  1444.       Transmission Control Protocol (TCP) 
  1445.       User Datagram Protocol (UDP) 
  1446.       Internet Protocol (IP) 
  1447.       Internet Control Message Protocol (ICMP) 
  1448.       Address Resolution Protocol (ARP) 
  1449.  
  1450.  
  1451. ΓòÉΓòÉΓòÉ 4.1.1. Transmission Control Protocol (TCP) ΓòÉΓòÉΓòÉ
  1452.  
  1453. TCP is a transport protocol that provides a reliable mechanism for delivering 
  1454. packets between hosts on an Internet. TCP takes a stream of data, breaks it 
  1455. into datagrams, sends each one individually using Internet Protocol (IP), and 
  1456. reassembles the datagrams at the destination node. If any datagrams are lost or 
  1457. damaged during transmission, TCP detects this and resends the missing 
  1458. datagrams. The received data stream is a reliable copy of the transmitted data 
  1459. stream. 
  1460.  
  1461. Note:  The PUSH flag is a notification from the sender to the receiver for the 
  1462. receiver to pass all the data that it has to the receiving process.  This data 
  1463. consists of whatever is in the segment with the PUSH flag, along with any other 
  1464. data the receiving TCP has collected for the receiving process. Our TCP 
  1465. implementation automatically sets the PUSH flag if the data in the segment 
  1466. being sent empties the send buffer. In addition, our implementation ignores a 
  1467. received PUSH flag because we don't delay the delivery of the received data to 
  1468. the application. 
  1469.  
  1470. You can use TCP sockets for both passive (server) and active (client) 
  1471. applications. While some calls are necessary for both types, some are 
  1472. role-specific. TCP is the default protocol for stream sockets in the Internet 
  1473. domain. See the Toolkit for sample C socket communication client and server 
  1474. programs. 
  1475.  
  1476. TCP is a connection-oriented protocol.  It is used to communicate between pairs 
  1477. of applications. After you make a connection, it exists until you close the 
  1478. socket. During the connection, data is either delivered or an error code is 
  1479. returned by Network Services. 
  1480.  
  1481.  
  1482. ΓòÉΓòÉΓòÉ 4.1.2. User Datagram Protocol (UDP) ΓòÉΓòÉΓòÉ
  1483.  
  1484. UDP is a transport-layer datagram protocol that sends and receives whole 
  1485. packets across the network. UDP is used for application-to-application programs 
  1486. between TCP/IP hosts. UDP does not offer a guarantee of datagram delivery or 
  1487. duplication protection.  UDP does provide checksums for both the header and 
  1488. data portions of a datagram. However, applications that require reliable 
  1489. delivery of streams of data should use TCP. UDP is the default protocol for 
  1490. datagram sockets in the Internet domain. 
  1491.  
  1492. Unlike applications using TCP, UDP applications are usually connectionless.  A 
  1493. UDP socket application can become connected by calling the connect() API. An 
  1494. unconnected socket can be used to communicate with many hosts; but a connected 
  1495. socket, because it has a dedicated destination, can send data to, and receive 
  1496. data from, only one host at a time. 
  1497.  
  1498. UDP is considered an unreliable protocol because it sends its data over the 
  1499. network without verification. Consequently, after a packet has been accepted by 
  1500. the UDP interface, the arrival of the packet and the arrival order of the 
  1501. packet at the destination cannot be guaranteed. 
  1502.  
  1503.  
  1504. ΓòÉΓòÉΓòÉ 4.1.3. Internet Protocol (IP) ΓòÉΓòÉΓòÉ
  1505.  
  1506. The IP network layer provides the interface from the transport layer 
  1507. (host-to-host) protocols to the link-level protocols. IP is the basic transport 
  1508. mechanism for routing IP packets to the next gateway, router, or destination 
  1509. host. 
  1510.  
  1511. IP provides the means to transmit packets of data from sources to destinations. 
  1512. Sources and destinations are hosts identified by 32-bit IP addresses, which are 
  1513. assigned independent of the underlying physical network. Outgoing packets 
  1514. automatically have an IP header prefixed to them, and incoming packets have 
  1515. their IP header removed before being sent to the higher-level protocols. This 
  1516. protocol ensures the unique addressing of hosts in an Internet network. 
  1517.  
  1518. IP does not ensure a reliable communication, because it does not require 
  1519. acknowledgments from the sending host, the receiving host, or intermediate 
  1520. hosts. IP does not provide error control for data; it provides only a header 
  1521. checksum. IP treats each packet as an independent entity unrelated to any other 
  1522. packet. IP does not perform retransmissions or flow control. A higher-level 
  1523. protocol, TCP/IP, for example, that uses IP must implement its own reliability 
  1524. procedures. 
  1525.  
  1526. Applications do not typically access IP directly, but rather use TCP or UDP 
  1527. which, in turn, use IP. Raw sockets can use IP. 
  1528.  
  1529.  
  1530. ΓòÉΓòÉΓòÉ 4.1.4. Internet Control Message Protocol (ICMP) ΓòÉΓòÉΓòÉ
  1531.  
  1532. ICMP is used to pass control information between hosts. For example, the 
  1533. information can be sent in any of the following situations: 
  1534.  
  1535.      When a host checks to see if another host is available (PING) 
  1536.      When a packet cannot reach its destination 
  1537.      When a gateway or router can direct a host to send traffic on a shorter 
  1538.       route 
  1539.      When a gateway or router does not have the buffering capacity to forward 
  1540.       a packet 
  1541.  
  1542.  ICMP provides feedback about problems in the communication environment; it 
  1543.  does not make IP reliable. The use of ICMP does not guarantee that an IP 
  1544.  packet will be delivered reliably or that an ICMP message will be returned to 
  1545.  the source host when an IP packet is not delivered or is incorrectly 
  1546.  delivered. 
  1547.  
  1548.  Raw sockets can use ICMP and, like IP, ICMP is not typically used by 
  1549.  application programs directly. 
  1550.  
  1551.  
  1552. ΓòÉΓòÉΓòÉ 4.1.5. Address Resolution Protocol (ARP) ΓòÉΓòÉΓòÉ
  1553.  
  1554. ARP maps IP addresses to hardware addresses. TCP/IP uses ARP to collect and 
  1555. distribute the information for mapping tables. 
  1556.  
  1557. ARP is not directly available to users or applications. When an application 
  1558. sends an Internet packet, IP requests the appropriate address mapping. If the 
  1559. mapping is not in the mapping table, an ARP broadcast packet is sent to all the 
  1560. hosts on the local network requesting the physical hardware address for the 
  1561. host. 
  1562.  
  1563.  
  1564. ΓòÉΓòÉΓòÉ 4.2. Getting Started with Sockets in the Internet Domain ΓòÉΓòÉΓòÉ
  1565.  
  1566. This section provides some basic information for getting started with sockets 
  1567. in the Internet domain: 
  1568.  
  1569.      Use the socket() call to create a socket in the Internet domain 
  1570.       specifying PF_INET for the domain parameter. 
  1571.  
  1572.      Use AF_INET for the address family. 
  1573.  
  1574.      The following socket types are supported for the Internet domain: 
  1575.  
  1576.         -  Datagram (SOCK_DGRAM) 
  1577.         -  Raw (SOCK_RAW) 
  1578.         -  Stream (SOCK_STREAM) 
  1579.  
  1580.       The socket type is passed as a parameter to the socket() call. For 
  1581.       additional information, refer to Socket Types and general socket 
  1582.       programming concepts in Sockets General Programming Information. 
  1583.  
  1584.      Datagram sockets use the UDP protocol, stream sockets use the TCP 
  1585.       protocol, and raw sockets can use the raw, ICMP, or IGMP protocols. 
  1586.  
  1587.      Use the network utility routines to get addresses with a given name 
  1588.       (refer to TCP/IP Specific Network Utility Routines for additional 
  1589.       information). 
  1590.  
  1591.  
  1592. ΓòÉΓòÉΓòÉ 4.3. Network-Byte Order ΓòÉΓòÉΓòÉ
  1593.  
  1594. Ports and addresses are specified to sockets API calls by using the 
  1595. network-byte ordering convention. Network-byte order is also known as big 
  1596. endian byte ordering, which has the high-order byte at the starting address. By 
  1597. contrast, little endian has the low-order byte at the starting address. Using 
  1598. network-byte ordering for data exchanged between hosts allows hosts using 
  1599. different underlying byte ordering conventions to exchange address information. 
  1600. There is a set of network utility API calls for translating addresses from 
  1601. host-byte to network-byte order and from network-byte to host-byte order. For 
  1602. more information about network-byte order and address translation, see: 
  1603.  
  1604.      bind() 
  1605.      htonl() 
  1606.      htons() 
  1607.      ntohl() 
  1608.      ntohs() 
  1609.  
  1610.  Note:  The socket interface does not handle application data byte ordering 
  1611.         differences. Application writers must handle data buffer byte order 
  1612.         differences themselves. 
  1613.  
  1614.  
  1615. ΓòÉΓòÉΓòÉ 4.4. Internet Address Formats ΓòÉΓòÉΓòÉ
  1616.  
  1617. This section describes the address formats used in the Internet domain. 
  1618.  
  1619. Internet addresses (IP) are 32-bit values that represent a network interface. 
  1620. Every Internet address within an administered Internet (AF_INET) communication 
  1621. domain must be unique. A host can have as many Internet addresses as it has 
  1622. network interfaces. For more information about Internet address formats, see 
  1623. Internetworking with TCP/IP Volume I:  Principles, Protocols, and 
  1624. Architectures, and Volume II:  Implementation and Internals, Douglas E. Comer, 
  1625. Prentice Hall, 1991. 
  1626.  
  1627. Each Internet host is assigned at least one unique Internet address. This 
  1628. address is used by IP and other higher-level protocols. When a host is a 
  1629. gateway, it has more than one IP address.  Gateway hosts connect two or more 
  1630. physical networks and have one IP address per connected physical network. 
  1631.  
  1632. Addresses within an Internet consist of a network number and a local address. 
  1633. All physical host IP addresses share the same network number and are logically 
  1634. part of the same network even if that network is connected with various 
  1635. physical media. 
  1636.  
  1637. Hosts on disjoint physical networks might also have the same network number, 
  1638. but are not part of the same Internet network. Hosts that are part of the same 
  1639. Internet network can exchange packets directly without going through 
  1640. intermediate routers. An Internet network can be subdivided logically using 
  1641. subnet mask. All host interfaces to the same physical network are given the 
  1642. same subnetwork number. An Internet domain can provide standards for assigning 
  1643. addresses to networks, broadcasts, and subnetworks. 
  1644.  
  1645. Dotted-Decimal Notation: A commonly used notation for Internet host addresses 
  1646. is the dotted-decimal format, which divides the 32-bit address into four 8-bit 
  1647. fields. The value of each field is specified as a decimal number, and the 
  1648. fields are separated by periods (for example, 10.2.0.52). 
  1649.  
  1650. Address examples in this document use dotted-decimal notation in the following 
  1651. forms: 
  1652.  
  1653.      nnn.lll.lll.lll 
  1654.      nnn.nnn.lll.lll 
  1655.      nnn.nnn.nnn.lll 
  1656.  
  1657.  where: 
  1658.  
  1659.  nnn     represents part or all of a network number. 
  1660.  lll     represents part or all of a local address. 
  1661.  
  1662.  Note:  Additional details about Internet network address format class A, B, C, 
  1663.  and D addresses, subnetwork address format, and broadcast address formats can 
  1664.  be found in TCP/IP User's Guide. 
  1665.  
  1666.  Addressing within an Internet Domain: A socket address in an Internet 
  1667.  communication domain is composed of the five fields in the following 
  1668.  sockaddr_in structure: length, address family, port, an Internet address, and 
  1669.  a reserved field. The sockaddr_in structure should be cleared before use. The 
  1670.  structure is located in the <NETINET\IN.H> header file: 
  1671.  
  1672.                struct in_addr {
  1673.                        u_long s_addr;
  1674.                };
  1675.  
  1676.                struct sockaddr_in {
  1677.                        u_short  sin_family;        /* AF_INET */
  1678.                        u_short sin_port;          /* port id */
  1679.                        struct  in_addr sin_addr;  /* address */
  1680.                        char    sin_zero[8];       /* not used */
  1681.                };
  1682.  
  1683.  The sin_family field is set to AF_INET. 
  1684.  
  1685.  The sin_port field is set to the port number in network-byte order. If you are 
  1686.  specifying your workstation address in sin_addr and you set sin_portto 0 using 
  1687.  the bind() call, the system assigns an available port. If you specify a 
  1688.  different workstation address in sin_addr, you must specify the port. For more 
  1689.  information on ports, see Ports. 
  1690.  
  1691.  The sin_addr field is set to the Internet address represented in network-byte 
  1692.  order. When specified as a parameter to bind(), sin_addr is usually set to the 
  1693.  constant INADDR_ANY, as defined in in <NETINET\IN.H>. This binds the socket to 
  1694.  any and all local internet addresses. By using INADDR_ANY, an application can 
  1695.  bind a socket without specifying the local internet address. The constant 
  1696.  INADDR_ANY also allows an application running on a host with multiple 
  1697.  interfaces (called a multihomed host) to receive UDP datagrams and TCP 
  1698.  connection requests arriving at any interface on a single socket. (The 
  1699.  application is not required to have one socket per interface, with each 
  1700.  interface bound to a specific internet address). 
  1701.  
  1702.  To specify your workstation address, you can leave sin_addr unspecified.  If 
  1703.  you are specifying a different workstation address, you must specify a valid 
  1704.  internet address for that workstation. 
  1705.  
  1706.  The sin_zero field is not used, and it should be set to 0 by the application 
  1707.  before passing the address structure to any sockets call. 
  1708.  
  1709.  
  1710. ΓòÉΓòÉΓòÉ 4.5. TCP/IP Specific Network Utility Routines ΓòÉΓòÉΓòÉ
  1711.  
  1712. This section describes the library of network utility routines. 
  1713.  
  1714. The TCP/IP protocol provides a library, TCP32DLL, that can be used in addition 
  1715. to the protocol-independent SO32DLL library. This library provides a set of 
  1716. network utility routines to perform useful tasks such as Internet address 
  1717. translation, domain name resolution, network-byte order translation, and access 
  1718. to the database of useful network information. This library can only be used 
  1719. for the PF_INET protocol family. Network utility routines are described in the 
  1720. following sections. 
  1721.  
  1722. Topics 
  1723.  
  1724.       Host Names Information 
  1725.       Network Names Information 
  1726.       Protocol Names Information 
  1727.       Service Names Information 
  1728.       Network-Byte Order Translation 
  1729.       Internet Address Manipulation 
  1730.       Domain Name Resolution 
  1731.       Ports 
  1732.  
  1733.  
  1734. ΓòÉΓòÉΓòÉ 4.5.1. Host Names Information ΓòÉΓòÉΓòÉ
  1735.  
  1736. The following is a list of host related calls: 
  1737.  
  1738.      gethostbyname() 
  1739.      gethostbyaddr() 
  1740.      sethostent() 
  1741.      gethostent() 
  1742.      endhostent() 
  1743.      gethostname() 
  1744.  
  1745.  The gethostbyname() call takes an Internet host name and returns a hostent 
  1746.  structure, which contains the name of the host, aliases, host address family 
  1747.  and host address. The hostent structure is defined in the <NETDB.H> header 
  1748.  file. The gethostbyaddr() call maps the Internet host address into a hostent 
  1749.  structure. 
  1750.  
  1751.  The database for these calls is provided by the name server or the ETC\HOSTS 
  1752.  file if a name server is not present or is unable to resolve the host name. 
  1753.  
  1754.  The sethostent(), gethostent(), and endhostent() calls open, provide 
  1755.  sequential access to, and close the ETC\HOSTS file. 
  1756.  
  1757.  The gethostname() call gets the name for the local host machine. 
  1758.  
  1759.  
  1760. ΓòÉΓòÉΓòÉ 4.5.2. Network Names Information ΓòÉΓòÉΓòÉ
  1761.  
  1762. The following is a list of network related calls: 
  1763.  
  1764.      getnetbyname() 
  1765.      getnetbyaddr() 
  1766.      setnetent() 
  1767.      getnetent() 
  1768.      endnetent() 
  1769.  
  1770.  The getnetbyname() call takes a network name and returns a netent structure, 
  1771.  which contains the name of the network, aliases, network address family, and 
  1772.  network number.  The netent structure is defined in the <NETDB.H> header file. 
  1773.  The getnetbyaddr() call maps the network number into a netent structure. 
  1774.  
  1775.  The database for these calls is provided by the ETC\NETWORKS file. 
  1776.  
  1777.  The setnetent(), getnetent(), and endnetent() calls open, provide sequential 
  1778.  access to, and close the ETC\NETWORKS file. 
  1779.  
  1780.  
  1781. ΓòÉΓòÉΓòÉ 4.5.3. Protocol Names Information ΓòÉΓòÉΓòÉ
  1782.  
  1783. The following is a list of protocol related calls: 
  1784.  
  1785.      getprotobyname() 
  1786.      getprotobynumber() 
  1787.      setprotoent() 
  1788.      getprotoent() 
  1789.      endprotoent() 
  1790.  
  1791.  The getprotobyname() call takes the protocol name and returns a protoent 
  1792.  structure, which contains the name of the protocol, aliases, and protocol 
  1793.  number.  The protoent structure is defined in the <NETDB.H> header file.  The 
  1794.  getprotobynumber() call maps the protocol number into a protoent structure. 
  1795.  
  1796.  The database for these calls is provided by the ETC\PROTOCOL file. 
  1797.  
  1798.  The setprotoent(), getprotoent(), and endprotoent() calls open, provide 
  1799.  sequential access to, and close the ETC\PROTOCOL file. 
  1800.  
  1801.  
  1802. ΓòÉΓòÉΓòÉ 4.5.4. Service Names Information ΓòÉΓòÉΓòÉ
  1803.  
  1804. The following is a list of service related calls: 
  1805.  
  1806.      getservbyname() 
  1807.      getservbyport() 
  1808.      setservent() 
  1809.      getservent() 
  1810.      endservent() 
  1811.  
  1812.  The getservbyname() call takes the service name and protocol, and returns a 
  1813.  servent structure that contains the name of the service, aliases, port number, 
  1814.  and protocol.  The servent structure is defined in the <NETDB.H> header file. 
  1815.  The getservbyport() call maps the port number and protocol into a servent 
  1816.  structure. 
  1817.  
  1818.  The database for these calls is provided by the ETC\SERVICES file. 
  1819.  
  1820.  The setservent(), getservent(), and endservent() calls provide open, provide 
  1821.  sequential access to, and close the ETC\SERVICES file. 
  1822.  
  1823.  
  1824. ΓòÉΓòÉΓòÉ 4.5.5. Network-Byte Order Translation ΓòÉΓòÉΓòÉ
  1825.  
  1826. Internet domain ports and addresses are usually specified to calls using the 
  1827. network-byte ordering convention.  The following calls translate integers from 
  1828. host- to network-byte order and from network- to host-byte order. 
  1829.  
  1830.       htonl()          Translates host to network, long integer(32-bit) 
  1831.       htons()          Translates host to network, short integer(16-bit) 
  1832.       ntohl()          Translates network to host, long integer(32-bit) 
  1833.       ntohs()          Translates network to host, short integer(16-bit) 
  1834.  
  1835.  
  1836. ΓòÉΓòÉΓòÉ 4.5.6. Internet Address Manipulation ΓòÉΓòÉΓòÉ
  1837.  
  1838. The following calls convert Internet addresses and decimal notation, and 
  1839. manipulate the network number and local network address portions of an Internet 
  1840. address: 
  1841.  
  1842.       inet_addr()              Translates dotted-decimal notation to a 32-bit 
  1843.                                Internet address (network-byte order). 
  1844.  
  1845.       inet_network()           Translates dotted-decimal notation to a network 
  1846.                                number (host-byte order), and zeros in the host 
  1847.                                part. 
  1848.  
  1849.       inet_ntoa()              Translates 32-bit Internet address (network-byte 
  1850.                                order) to dotted-decimal notation. 
  1851.  
  1852.       inet_netof()             Extracts network number (host-byte order) from 
  1853.                                32-bit Internet address (network-byte order). 
  1854.  
  1855.       inet_lnaof()             Extracts local network address (host-byte order) 
  1856.                                from 32-bit Internet address (network-byte 
  1857.                                order). 
  1858.  
  1859.       inet_makeaddr()          Constructs Internet address (network-byte order) 
  1860.                                from network number and local network address. 
  1861.  
  1862.  
  1863. ΓòÉΓòÉΓòÉ 4.5.7. Domain Name Resolution ΓòÉΓòÉΓòÉ
  1864.  
  1865. In TCP/IP, communication is based on internet addresses. When a TCP/IP 
  1866. application receives a symbolic host name, it calls a host name resolver 
  1867. routine to resolve the symbolic name into an internet address. The host name 
  1868. resolver routine queries a domain name server or a local HOSTS file, or both, 
  1869. to perform the name resolution. 
  1870.  
  1871. If a RESOLV2 file or RESOLV file exists in the ETC subdirectory, the host name 
  1872. resolver routine first tries to resolve the name by querying the name servers 
  1873. specified in that file. 
  1874.  
  1875. If resolution through a name server fails or if a RESOLV2 or RESOLV file does 
  1876. not exist, the host name resolver routine tries to resolve the name locally by 
  1877. searching the HOSTS file in the ETC subdirectory for a match of the symbolic 
  1878. host name. 
  1879.  
  1880. If a match is found, the routine returns the corresponding internet address. If 
  1881. a match is not found, the routine displays a message stating that the host is 
  1882. unknown. 
  1883.  
  1884. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1885. Γöé Table 7. RESOLV and RESOLV2 files             Γöé
  1886. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1887. Γöé NETWORK   Γöé RESOLV FILE      Γöé RESOLV2 FILE     Γöé
  1888. Γöé CONNECTION Γöé            Γöé            Γöé
  1889. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1890. Γöé LAN only  Γöé            Γöé X           Γöé
  1891. Γöé connection Γöé            Γöé            Γöé
  1892. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1893. Γöé SLIP only  Γöé X           Γöé            Γöé
  1894. Γöé connection Γöé            Γöé            Γöé
  1895. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1896. Γöé LAN and   Γöé X           Γöé X (used for domain  Γöé
  1897. Γöé SLIP con-  Γöé            Γöé name resolution)   Γöé
  1898. Γöé nections  Γöé            Γöé            Γöé
  1899. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1900.  
  1901. Note:  TCP/IP does not include a RESOLV2 file.  If you want to use one, you 
  1902. must create it and place it in the ETC subdirectory. If you use the 
  1903. Configuration notebook to configure name resolution, the Configuration notebook 
  1904. creates a RESOLV2 file for you.  Otherwise you can create one manually. 
  1905.  
  1906. The following resolver calls are used to make, send, and interpret packets for 
  1907. name servers in the Internet domain: 
  1908.  
  1909.      res_mkquery() 
  1910.      res_send() 
  1911.      res_init() 
  1912.      dn_comp() 
  1913.      dn_expand() 
  1914.  
  1915.  
  1916. ΓòÉΓòÉΓòÉ 4.5.8. Ports ΓòÉΓòÉΓòÉ
  1917.  
  1918. A port is used to differentiate between different applications on a host using 
  1919. the same protocol (TCP or UDP).  It is an additional qualifier used by the 
  1920. system software to get data to the correct application. Physically, a port is a 
  1921. 16-bit integer.  Some ports are reserved for particular applications and are 
  1922. called well-known ports. Well-Known Port Assignments contains the well-known 
  1923. port assignments list. 
  1924.  
  1925.  
  1926. ΓòÉΓòÉΓòÉ 5. Sockets over Local IPC ΓòÉΓòÉΓòÉ
  1927.  
  1928. This section describes how sockets over Local IPC allow the programmer to 
  1929. communicate between applications on the same machine using the sockets API. 
  1930. Local IPC sockets are not bound to a network protocol, but rather use the 
  1931. underlying host facilities to provide high performance IPC. 
  1932.  
  1933. Topics 
  1934.  
  1935.       Getting Started with Sockets Over Local IPC 
  1936.       Local IPC Address Format 
  1937.  
  1938.  
  1939. ΓòÉΓòÉΓòÉ 5.1. Getting Started with Sockets Over Local IPC ΓòÉΓòÉΓòÉ
  1940.  
  1941. This section provides some basic information for getting started with sockets 
  1942. over Local IPC: 
  1943.  
  1944.      Use PF_OS2, or PF_UNIX for the protocol family 
  1945.  
  1946.      Use AF_OS2, or AF_UNIX for the address family 
  1947.  
  1948.      The following socket types are supported for the Local IPC domain: 
  1949.  
  1950.         -  Datagram (SOCK_DGRAM) 
  1951.         -  Stream (SOCK_STREAM) 
  1952.  
  1953.       The socket type is passed as a parameter to the socket() call. For 
  1954.       additional information, refer to Socket Types and general socket 
  1955.       programming concepts in Sockets General Programming Information. 
  1956.  
  1957.      A unique text string is used as a name.  Refer to the following section 
  1958.       for additional details. 
  1959.  
  1960.      If a connect() socket call is received without an explicit bind(), an 
  1961.       implicit bind is automatically performed.  In this case, the application 
  1962.       does not care about its own name and a unique Local IPC name is generated 
  1963.       by Network Services. You can retrieve the Local IPC name by using the 
  1964.       getsockname() call. 
  1965.  
  1966.  
  1967. ΓòÉΓòÉΓòÉ 5.2. Local IPC Address Format ΓòÉΓòÉΓòÉ
  1968.  
  1969. A socket address in a local system is composed of the three fields in the 
  1970. following sockaddr_un structure: length, address family, and the path name. The 
  1971. structure is located in the <SYS\UN.H> header file: 
  1972.  
  1973.              struct sockaddr_un {
  1974.                  u_short sun_family;         /* AF_OS2 or AF_UNIX */
  1975.                  char   sun_path[108];      /* path name */
  1976.              };
  1977.              struct sockaddr_un un;
  1978.  
  1979. The sun_family field is set to AF_OS2 or AF_UNIX. 
  1980.  
  1981. The sun_path field is the OS/2 Warp Connect file and pathname to be used as the 
  1982. address of the Local IPC socket. If the address is NULL, the bind call binds a 
  1983. unique local address to the socket descriptor s. Each address is a combination 
  1984. of address family (sun_family) and a character string (sun_path) no longer than 
  1985. 108 characters. 
  1986.  
  1987. Each socket must use a unique character string as its local name to bind a name 
  1988. to a socket. The name in sun_path should begin with "\socket\". 
  1989.  
  1990. For example, 
  1991.  
  1992.                  struct sockaddr_un un;
  1993.                  int sd;
  1994.                  sd = socket(PF_OS2, SOCK_STREAM, 0);
  1995.                  memset(&un, 0, sizeof(un));
  1996.                  un.sun_family=AF_OS2;
  1997.                  strcpy(un.sun_path, "\socket\XYZ", 12);
  1998.                  bind(sd, (struct sockaddr *)&un, sizeof(un));
  1999.  
  2000.  
  2001. ΓòÉΓòÉΓòÉ 6. Sockets over NetBIOS ΓòÉΓòÉΓòÉ
  2002.  
  2003. This section describes the use of sockets with NetBIOS. Each application 
  2004. assigns itself one or more NetBIOS names for each adapter.  The NetBIOS 
  2005. protocol maintains a table of the names that a node is known by on the network. 
  2006. NetBIOS supports two types of names: unique and group.  When the name is 
  2007. unique, the application binds the name and NetBIOS checks the network to ensure 
  2008. that the name is not already being used as a unique name. NetBIOS supports 
  2009. multicast by allowing applications to bind to a group name and communicate. 
  2010.  
  2011. Topics 
  2012.  
  2013.       Getting Started with Sockets Over NetBIOS 
  2014.       NetBIOS Address Format 
  2015.  
  2016.  
  2017. ΓòÉΓòÉΓòÉ 6.1. Getting Started with Sockets Over NetBIOS ΓòÉΓòÉΓòÉ
  2018.  
  2019. This section provides some basic information for getting started with sockets 
  2020. over NetBIOS: 
  2021.  
  2022.      Use PF_NETBIOS or PF_NB for the protocol family. 
  2023.  
  2024.      Use AF_NETBIOS or AF_NB for the address family. 
  2025.  
  2026.      The following socket types are supported for the NetBIOS domain: 
  2027.  
  2028.         -  Datagram (SOCK_DGRAM) 
  2029.         -  Sequenced packet (SOCK_SEQPACKET) 
  2030.  
  2031.       The socket type is passed as a parameter to the socket() call. For 
  2032.       additional information, refer to Socket Types and general socket 
  2033.       programming concepts in Sockets General Programming Information. 
  2034.  
  2035.      If a connect() socket call is received without an explicit bind(), an 
  2036.       implicit bind is automatically performed.  In this case, the application 
  2037.       does not care about its own name, and a unique NetBIOS name is generated 
  2038.       by Network Services. You can retrieve the NetBIOS name by using the 
  2039.       getsockname() call. 
  2040.  
  2041.      Applications using the NetBIOS communication domain can use sockets in 
  2042.       both a connection-oriented (sequenced packet) and connectionless 
  2043.       (datagram) mode. 
  2044.  
  2045.      A NetBIOS application on one workstation can use sockets to communicate 
  2046.       with an NCB NetBIOS application on a different workstation. 
  2047.  
  2048.  
  2049. ΓòÉΓòÉΓòÉ 6.2. NetBIOS Address Format ΓòÉΓòÉΓòÉ
  2050.  
  2051. A socket address in a NetBIOS address family is composed of the six fields in 
  2052. the following sockaddr_nb structure: length, address family, address type, a 
  2053. reserved field, adapter number, and NetBIOS name. This structure is located in 
  2054. the <NETNB\NB.H> header file: 
  2055.  
  2056.              struct      sockaddr_nb {
  2057.                  u_short   snb_family;               /* AF_NETBIOS */
  2058.                  short    snb_type;                 /* 0=unique or 1=group */
  2059.                  char     snb_nbnetid[NB_NETIDLEN]; /* RESERVED */
  2060.                  unsigned short snb_adapter;        /* adapter number */
  2061.                  char     snb_name[NAMELEN];        /* NetBIOS name */
  2062.              }
  2063.  
  2064. The snb_family field is set to AF_NETBIOS or AF_NB. 
  2065.  
  2066. The address type field (snb_type) is used to specify the name as either a 
  2067. unique (NB_UNIQUE) or a group (NB_GROUP) name. 
  2068.  
  2069. The snb_adapter field contains the adapter number that the name is associated 
  2070. with. The adapter number must be a numeric value in the range 0-255. 
  2071.  
  2072. The snb_name field contains the 16-byte NetBIOS name, and is used as is. 
  2073.  
  2074. If a connect() socket call is received without an explicit bind(), an implicit 
  2075. bind is automatically performed.  In this case, the application does not care 
  2076. about its own name and is asking the system to select one for it.  A NetBIOS 
  2077. name is generated for this socket by converting the 6-byte MAC address to an 
  2078. ASCII hex string, and postpended with a 2-byte number that increments after 
  2079. each use. You can retrieve the NetBIOS name by using the getsockname() call. 
  2080.  
  2081. Note that for the NetBIOS domain, more than one socket can be bound to the same 
  2082. local address to establish multiple connections to one or more remote 
  2083. destinations. To enable this feature, the socket option SO_REUSEADDR must be 
  2084. set.  See setsockopt(). In addition, you can bind more than one address to the 
  2085. same adapter. 
  2086.  
  2087.  
  2088. ΓòÉΓòÉΓòÉ 7. Protocol-Independent C Sockets API ΓòÉΓòÉΓòÉ
  2089.  
  2090. The following table briefly describes each protocol-independent socket call 
  2091. supported by Network Services and identifies where you can find the syntax, 
  2092. parameters, and other appropriate information. The socket calls described in 
  2093. this section can be used to access services for all protocols: 
  2094.  
  2095. Note:  If you are using the Internet communications domain (PF_INET protocol 
  2096. family), you can use all APIs in the following table and those in TCP/IP 
  2097. Network Utility Routines. 
  2098.  
  2099. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2100. Γöé Table 8. Protocol-Independent Sockets API Quick Reference                               Γöé
  2101. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2102. Γöé SOCKET CALL   Γöé DESCRIPTION                     Γöé LOCATION                    Γöé
  2103. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2104. Γöé accept()     Γöé Accepts a connection request from a remote host   Γöé accept()                    Γöé
  2105. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2106. Γöé bind()      Γöé Binds a local name to the socket          Γöé bind()                     Γöé
  2107. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2108. Γöé connect()    Γöé Requests a connection to a remote host       Γöé connect()                   Γöé
  2109. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2110. Γöé getpeername()  Γöé Gets the name of the peer connected to socket    Γöé getpeername()                 Γöé
  2111. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2112. Γöé getsockname()  Γöé Gets the local socket name             Γöé getsockname()                 Γöé
  2113. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2114. Γöé getsockopt()   Γöé Gets the socket options associated with a socket  Γöé getsockopt()                  Γöé
  2115. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2116. Γöé ioctl()     Γöé Performs special operations on socket        Γöé ioctl()                    Γöé
  2117. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2118. Γöé listen()     Γöé Completes the binding necessary for a socket to   Γöé listen()                    Γöé
  2119. Γöé         Γöé accept connections and creates a connection     Γöé                        Γöé
  2120. Γöé         Γöé request queue for incoming requests         Γöé                        Γöé
  2121. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2122. Γöé psock_error()  Γöé Writes a short error message to the standard error Γöé psock_errno()                 Γöé
  2123. Γöé         Γöé device                       Γöé                        Γöé
  2124. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2125. Γöé readv()     Γöé Receives data on a socket into a set of buffers   Γöé readv()                    Γöé
  2126. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2127. Γöé recv()      Γöé Receives data on a connected socket         Γöé recv()                     Γöé
  2128. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2129. Γöé recvfrom()    Γöé Receives data on a socket              Γöé recvfrom()                   Γöé
  2130. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2131. Γöé recvmsg()    Γöé Receives data and control information on a socket  Γöé recvmsg()                   Γöé
  2132. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2133. Γöé select()     Γöé Gets read, write, and exception status on a group  Γöé select()                    Γöé
  2134. Γöé         Γöé of sockets                     Γöé                        Γöé
  2135. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2136. Γöé send()      Γöé Sends data on a connected socket          Γöé send()                     Γöé
  2137. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2138. Γöé sendmsg()    Γöé Sends data and control information on a socket   Γöé sendmsg()                   Γöé
  2139. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2140. Γöé sendto()     Γöé Sends data on a socket               Γöé sendto()                    Γöé
  2141. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2142. Γöé setsockopt()   Γöé Sets options associated with a socket        Γöé setsockopt()                  Γöé
  2143. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2144. Γöé shutdown()    Γöé Shuts down all or part of a full duplex connection Γöé shutdown()                   Γöé
  2145. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2146. Γöé so_cancel()   Γöé Cancels a pending blocking sockets API call on a  Γöé so_cancel()                  Γöé
  2147. Γöé         Γöé socket.                       Γöé                        Γöé
  2148. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2149. Γöé sock_errno()   Γöé Returns error code set by a socket call       Γöé sock_errno()                  Γöé
  2150. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2151. Γöé socket()     Γöé Creates an endpoint for communication and returns  Γöé socket()                    Γöé
  2152. Γöé         Γöé a socket descriptor representing the endpoint    Γöé                        Γöé
  2153. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2154. Γöé soclose()    Γöé Shuts down a socket and frees resources allocated  Γöé soclose()                   Γöé
  2155. Γöé         Γöé to the socket                    Γöé                        Γöé
  2156. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2157. Γöé writev()     Γöé Writes data from a set of specified buffers on a  Γöé writev()                    Γöé
  2158. Γöé         Γöé socket                       Γöé                        Γöé
  2159. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2160.  
  2161.  
  2162. ΓòÉΓòÉΓòÉ 7.1. accept() ΓòÉΓòÉΓòÉ
  2163.  
  2164. The accept() socket call accepts a connection request from a remote host. 
  2165.  
  2166. Syntax 
  2167.  
  2168. #include <types.h>
  2169. #include <sys\socket.h>
  2170. #include <netinet\in.h>
  2171. #include <netnb\nb.h>
  2172. #include <sys\un.h>
  2173.  
  2174. int accept(s, name, namelen)
  2175. int s;
  2176. sockaddr *name;
  2177. int *namelen;
  2178.  
  2179. Parameters 
  2180.  
  2181.  s 
  2182.    Socket descriptor 
  2183.  
  2184.  name 
  2185.    Pointer to a sockaddr structure that contains the socket address of the 
  2186.    connection client when the accept() call returns. The format of name is 
  2187.    determined by the communications domain where the client resides. This 
  2188.    parameter can be NULL if the caller is not interested in the client address. 
  2189.  
  2190.  namelen 
  2191.    Must initially point to an integer that contains the size in bytes of the 
  2192.    storage pointed to by name.  On return, that integer contains the size of 
  2193.    the data returned in the storage pointed to by name. If name is NULL, 
  2194.    namelen is ignored and can be NULL. 
  2195.  
  2196.  Description 
  2197.  
  2198.  This call is used by a server acting in a connection-oriented mode to accept a 
  2199.  connection request from a client.  The call accepts the first connection on 
  2200.  its queue of pending connection requests. The accept() call creates a new 
  2201.  socket descriptor with the same properties as s and returns it to the caller. 
  2202.  The new socket descriptor cannot be used to accept new connections. The 
  2203.  original socket, s, remains available to accept more connection requests. 
  2204.  
  2205.  If the queue has no pending connection requests, accept() blocks the caller 
  2206.  unless s is in nonblocking mode.  If no connection requests are queued and s 
  2207.  is in nonblocking mode, accept() returns -1 and sets the return code to 
  2208.  SOCEWOULDBLOCK. 
  2209.  
  2210.  The s parameter must be a socket descriptor created with the socket() call. 
  2211.  It is usually bound to an address with the bind() call and must be made 
  2212.  capable of accepting connections with the listen() call.  The listen() call 
  2213.  marks the socket as one that accepts connections and allocates a queue to hold 
  2214.  pending connection requests. The listen() call allows the caller to place an 
  2215.  upper boundary on the size of the queue. 
  2216.  
  2217.  The name parameter is a pointer to a buffer where the connection requester 
  2218.  address is placed. The name parameter is optional and can be set to be the 
  2219.  NULL pointer.  If set to NULL, the requester address is not copied into the 
  2220.  buffer.  The exact format of name depends on the communications domain where 
  2221.  the communication request originated. For example, if the connection request 
  2222.  originated in the Internet domain, name points to a sockaddr_in structure as 
  2223.  defined in the header file <NETINET\IN.H>. 
  2224.  
  2225.  The namelen parameter is used only if name is not NULL. Before calling 
  2226.  accept(), you must set the integer pointed to by namelen to the size, in 
  2227.  bytes, of the buffer pointed to by name. On successful return, the integer 
  2228.  pointed to by namelen contains the actual number of bytes copied into the 
  2229.  buffer. If the buffer is not large enough to hold the address, up to namelen 
  2230.  bytes of the requester address are copied. 
  2231.  
  2232.  This call is used only with SOCK_STREAM or SOCK_SEQPACKET sockets. You cannot 
  2233.  screen requesters without calling accept().  The application cannot tell the 
  2234.  system the requesters it will accept connections from.  The caller can, 
  2235.  however, choose to close a connection immediately after discovering the 
  2236.  identity of the requester. 
  2237.  
  2238.  The select() call can be used to check the socket for incoming connection 
  2239.  requests. 
  2240.  
  2241.  Return Values 
  2242.  
  2243.  A non-negative socket descriptor indicates success; the value -1 indicates an 
  2244.  error. You can get the specific error code by calling sock_errno() or 
  2245.  psock_errno(). 
  2246.  
  2247.  Error Code             Description 
  2248.  
  2249.  SOCENOTSOCK            The s parameter is not a valid socket descriptor. 
  2250.  
  2251.  SOCEFAULT              Using name and namelen would result in an attempt to 
  2252.                         copy the address into a portion of the caller address 
  2253.                         space into which information cannot be written. 
  2254.  
  2255.  SOCEINTR               Interrupted system call. 
  2256.  
  2257.  SOCEINVAL              Listen() was not called for socket s. 
  2258.  
  2259.  SOCENOBUFS             Insufficient buffer space available to create the new 
  2260.                         socket. 
  2261.  
  2262.  SOCEOPNOTSUPP          The s parameter is not connection-oriented. 
  2263.  
  2264.  SOCEWOULDBLOCK         The s parameter is in nonblocking mode and no 
  2265.                         connections are on the queue. 
  2266.  
  2267.  SOCECONNABORTED        The software caused a connection close. 
  2268.  
  2269.  Examples 
  2270.  
  2271.  The following are two examples of the accept() call.  In the first, the caller 
  2272.  wants to have the requester address returned. In the second, the caller does 
  2273.  not want to have the requester address returned. 
  2274.  
  2275.   int clientsocket;
  2276.   int s;
  2277.   struct sockaddr clientaddress;
  2278.   int addrlen;
  2279.   int accept(int s, struct sockaddr *addr, int *addrlen); /* extracted from sys/socket.h */
  2280.   /* socket(), bind(), and listen() have been called */
  2281.   /* EXAMPLE 1: I want the address now */
  2282.  
  2283.   addrlen = sizeof(clientaddress);
  2284.   clientsocket = accept(s, &clientaddress, &addrlen);
  2285.   /* EXAMPLE 2: I can get the address later using getpeername() */
  2286.   clientsocket = accept(s, (struct sockaddr *) 0, (int *) 0);
  2287.  
  2288.  
  2289. ΓòÉΓòÉΓòÉ 7.2. bind() ΓòÉΓòÉΓòÉ
  2290.  
  2291. The bind() socket call binds a local name to the socket. 
  2292.  
  2293. Syntax 
  2294.  
  2295. #include <types.h>
  2296. #include <sys\socket.h>
  2297.  
  2298. int bind(s, name, namelen)
  2299. int s;
  2300. struct sockaddr *name;
  2301. int namelen;
  2302.  
  2303. Parameters 
  2304.  
  2305.  s 
  2306.    Socket descriptor returned by a previous call to socket() 
  2307.  
  2308.  name 
  2309.    Pointer to a sockaddr structure containing the name that is to be bound to s 
  2310.  
  2311.  namelen 
  2312.    Size in bytes of the sockaddr structure pointed to by name 
  2313.  
  2314.  Description 
  2315.  
  2316.  The bind() call binds a unique local name to the socket with descriptor s. 
  2317.  After calling socket(), a descriptor does not have a name associated with it. 
  2318.  However, it does belong to a particular addressing family as specified when 
  2319.  socket() is called.  The exact format of a name depends on the addressing 
  2320.  family.  The bind() procedure also allows servers to specify from which 
  2321.  network interfaces they wish to receive UDP packets and TCP connection 
  2322.  requests. 
  2323.  
  2324.  Because s was created in the AF_INET domain, the format of the name buffer is 
  2325.  expected to be sockaddr_in as defined in the header file <NETINET\IN.H>: 
  2326.  
  2327.   struct in_addr
  2328.   {
  2329.           u_long s_addr;
  2330.   };
  2331.  
  2332.   struct sockaddr_in
  2333.   {
  2334.           short   sin_family;
  2335.           u_short sin_port;
  2336.           struct  in_addr sin_addr;
  2337.           char    sin_zero[8];
  2338.   };
  2339.  
  2340.  The sin_family field must be set to AF_INET.  The sin_port field is set to the 
  2341.  port to which the application must bind.  It must be specified in network byte 
  2342.  order.  If sin_port is set to 0, the caller leaves it to the system to assign 
  2343.  an available port.  The application can call getsockname() to discover the 
  2344.  port number assigned.  The sin_addr field is set to the internet address and 
  2345.  must be specified in network byte order.  On hosts with more than one network 
  2346.  interface (called multihomed hosts), a caller can select the interface with 
  2347.  which it is to bind. 
  2348.  
  2349.  Subsequently, only UDP packets and TCP connection requests from this interface 
  2350.  (which match the bound name) are routed to the application.  If sin_addr is 
  2351.  set to the constant INADDR_ANY, as defined in <NETINET\IN.H>, the caller is 
  2352.  requesting that the socket be bound to all network interfaces on the host. 
  2353.  Subsequently, UDP packets and TCP connections from all interfaces (which match 
  2354.  the bound name) are routed to the application.  This becomes important when a 
  2355.  server offers a service to multiple networks.  By leaving the address 
  2356.  unspecified, the server can accept all UDP packets and TCP connection requests 
  2357.  made for its port, regardless of the network interface on which the requests 
  2358.  arrived.  The sin_zero field is not used and must be set to all zeros. 
  2359.  
  2360.  In the NetBIOS (AF_NET) domain, set all 16 characters in snb_name in the 
  2361.  sockaddr_nb structure to binary zero's (null). The system will generate a name 
  2362.  for the socket. 
  2363.  
  2364.  Return Values 
  2365.  
  2366.  The value 0 indicates success; the value -1 indicates an error. You can get 
  2367.  the specific error code by calling sock_errno() or psock_errno(). 
  2368.  
  2369.  Error Code              Description 
  2370.  
  2371.  SOCEADDRINUSE           The address is already in use.  See the SO_REUSEADDR 
  2372.                          option described under getsockopt() and the 
  2373.                          SO_REUSEADDR option described under setsockopt(). 
  2374.  
  2375.  SOCEADDRNOTAVAIL        The address specified is not valid on this host.  For 
  2376.                          example, the Internet address does not specify a valid 
  2377.                          network interface. 
  2378.  
  2379.  SOCEAFNOSUPPORT         The address family is not supported. 
  2380.  
  2381.  SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  2382.  
  2383.  SOCEFAULT               Using name and namelen would result in an attempt to 
  2384.                          copy the address into a non-writable portion of the 
  2385.                          caller's address space. 
  2386.  
  2387.  SOCEINVAL               The socket is already bound to an address, or namelen 
  2388.                          is not the expected length. 
  2389.  
  2390.  SOCENOBUFS              No buffer space is available. 
  2391.  
  2392.  Examples 
  2393.  
  2394.  Note the following about the bind() call examples: 
  2395.  
  2396.      For the Internet examples, put the Internet address and port in 
  2397.       network-byte order. To put the port into network-byte order, use the 
  2398.       htons() utility routine to convert a short integer from host-byte order 
  2399.       to network-byte order. 
  2400.  
  2401.      For the Internet examples, set the address field using the inet_addr() 
  2402.       utility routine, which takes a character string representing the 
  2403.       dotted-decimal address of an interface and returns the binary Internet 
  2404.       address representation in network-byte order. 
  2405.  
  2406.      Zero the structure before using it to ensure that the name requested does 
  2407.       not set any reserved fields. 
  2408.  
  2409.  See connect() for examples of how a client might connect to servers. 
  2410.  
  2411.   int rc;
  2412.   int s;
  2413.   struct sockaddr_in myname;
  2414.   int bind(int s, struct sockaddr *name, int namelen); /* extracted from sys/socket.h */
  2415.  
  2416.   /* Bind to a specific interface in the Internet domain */
  2417.   /* clear the structure */
  2418.   memset(&myname, 0, sizeof(myname));
  2419.   myname.sin_family = AF_INET;
  2420.   myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  2421.   myname.sin_port = htons(1024);
  2422.   .
  2423.   .
  2424.   .
  2425.   rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  2426.  
  2427.   /* Bind to all Internet network interfaces on the system */
  2428.   /* clear the structure */
  2429.   memset(&myname, 0, sizeof(myname));
  2430.   myname.sin_family = AF_INET;
  2431.   myname.sin_addr.s_addr = INADDR_ANY; /* all interfaces */
  2432.   myname.sin_port = htons(1024);
  2433.   .
  2434.   .
  2435.   .
  2436.   rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  2437.  
  2438.   /* Bind to a specific interface in the Internet domain.
  2439.      Let the system choose a port                        */
  2440.   /* clear the structure */
  2441.   memset(&myname, 0, sizeof(myname));
  2442.   myname.sin_family = AF_INET;
  2443.   myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  2444.   myname.sin_port = 0;
  2445.   .
  2446.   .
  2447.   .
  2448.   rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  2449.  
  2450.   /* Bind to a unique NetBIOS name on adapter 0 */
  2451.   struct sockaddr_nb nbname;
  2452.   memset(&nbname, 0, sizeof(nbname));
  2453.   nbname.snb_family = AF_NB;
  2454.   nbname.snb_type = NB_UNIQUE;
  2455.   nbname.snb_adapter = 0;
  2456.   strcpy(nbname.snb_name, "NBSERVER");    /* Note that a NetBIOS name is
  2457.                                              16 bytes long.  In this example,
  2458.                                              the last 8 bytes are filled
  2459.                                              with zeros.                    */
  2460.  
  2461.   .
  2462.   .
  2463.   .
  2464.   rc = bind(s, (struct sockaddr *) &nbname, sizeof(nbname));
  2465.  
  2466.  
  2467. ΓòÉΓòÉΓòÉ 7.3. connect() ΓòÉΓòÉΓòÉ
  2468.  
  2469. The connect() socket call requests a connection to a remote host. 
  2470.  
  2471. Syntax 
  2472.  
  2473. #include <types.h>
  2474. #include <sys\socket.h>
  2475.  
  2476. int connect(s, name, namelen)
  2477. int s;
  2478. struct sockaddr *name;
  2479. int namelen;
  2480.  
  2481. Parameters 
  2482.  
  2483.  s 
  2484.    Socket descriptor used to originate the connection request 
  2485.  
  2486.  name 
  2487.    Pointer to a sockaddr structure containing the address of the socket to 
  2488.    which a connection will be attempted 
  2489.  
  2490.  namelen 
  2491.    Size in bytes of the sockaddr structure pointed to by name 
  2492.  
  2493.  Description 
  2494.  
  2495.  Stream or sequenced packet sockets:  The connect() call performs two tasks 
  2496.  when called for a stream or sequenced packet socket:  1) it completes the 
  2497.  binding if necessary for a socket, and 2) it attempts to create a connection 
  2498.  between two sockets. 
  2499.  
  2500.  This call is used by the client side of socket-based applications to establish 
  2501.  a connection with a server. The remote server must have a passive open 
  2502.  pending. This means the server must successfully call bind() and listen() 
  2503.  Otherwise, connect() returns -1 and the error value is set to SOCECONNREFUSED. 
  2504.  
  2505.  In the Internet communication domain, a timeout occurs if a connection to the 
  2506.  remote host is not successful within 75 seconds (1 minute and 15 seconds). 
  2507.  There is no timeout for Local IPC. In the NetBIOS communication domain, a 
  2508.  timeout occurs if a connection to the host is not successful within the time 
  2509.  defined by the NetBIOS protocol parameters Transmit Timer multiplied by 
  2510.  Transmit Retry. 
  2511.  
  2512.  If s is in blocking mode, the connect() call blocks the caller until the 
  2513.  connection is established or until an error is received.  If the socket is in 
  2514.  nonblocking mode, connect() returns -1 and sets the error value to 
  2515.  SOCEINPROGRESS if the connection was successfully initiated. The caller can 
  2516.  test the completion of the connection setup by calling: 1) select() to test 
  2517.  for the ability to write to the socket, and 2) getsockopt() with option 
  2518.  SO_ERROR to test if the connection succeeded. 
  2519.  
  2520.  Stream or sequenced packet sockets can call connect() only once. 
  2521.  
  2522.  Datagram or raw sockets: The connect() call specifies the destination peer 
  2523.  address when called for a datagram or raw socket. Normally, datagram and raw 
  2524.  sockets use connectionless data transfer calls such as sendto() and 
  2525.  recvfrom().  However, applications can call connect() to specify and store the 
  2526.  destination peer address for this socket.  The system will then know which 
  2527.  address to send data to on this socket. This method of communication allows 
  2528.  datagram and raw sockets to be connected. However, data is still not 
  2529.  guaranteed to be delivered. Thus, the normal features of connectionless mode 
  2530.  sockets is maintained. The address is remembered until another connect() call 
  2531.  is made. This permits the use of readv(), recv(), send(), and writev(), which 
  2532.  are usually reserved for connection-oriented sockets. The application can 
  2533.  still use sendto(), recvfrom(), sendmsg(), and recvmsg().  The advantage of 
  2534.  calling connect() and being connected is that the destination peer address 
  2535.  does not have to be specified for all datagrams sent. 
  2536.  
  2537.  Datagram and raw sockets can call connect() multiple times. The application 
  2538.  can reset their destination address by specifying a new address on the 
  2539.  connect() call. In addition, the socket can be returned to operate in a 
  2540.  connectionless mode by calling connect() with a null destination address. The 
  2541.  null address is created by zeroing the sockaddr structure and only setting the 
  2542.  address family field. The call to connect will return -1, indicating that the 
  2543.  connection to the null address cannot be established.  Calling sock_errno() 
  2544.  will return SOCEADDRNOTAVAIL. For more information on connecting datagram 
  2545.  sockets, see "Description" for sendto(). 
  2546.  
  2547.  Return Values 
  2548.  
  2549.  The value 0 indicates success; the value -1 indicates an error. You can get 
  2550.  the specific error code by calling sock_errno() or psock_errno(). 
  2551.  
  2552.  Error Code              Description 
  2553.  
  2554.  SOCEADDRNOTAVAIL        The calling host cannot reach the specified 
  2555.                          destination. 
  2556.  
  2557.  SOCEAFNOSUPPORT         The address family is not supported. 
  2558.  
  2559.  SOCEALREADY             The socket s is marked nonblocking, and a previous 
  2560.                          connection attempt has not completed. 
  2561.  
  2562.  SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  2563.  
  2564.  SOCECONNREFUSED         The connection request was rejected by the destination 
  2565.                          host. 
  2566.  
  2567.  SOCEFAULT               Using name and namelen would result in an attempt to 
  2568.                          copy the address into a portion of the caller's 
  2569.                          address space to which data cannot be written. 
  2570.  
  2571.  SOCEINPROGRESS          The socket s is marked nonblocking, and the connection 
  2572.                          cannot be completed immediately. The SOCEINPROGRESS 
  2573.                          value does not indicate an error condition. 
  2574.  
  2575.  SOCEINTR                Interrupted system call. 
  2576.  
  2577.  SOCEINVAL               The namelen parameter is not a valid length. 
  2578.  
  2579.  SOCEISCONN              The socket s is already connected. 
  2580.  
  2581.  SOCENETUNREACH          The network cannot be reached from this host. 
  2582.  
  2583.  SOCETIMEDOUT            The connection establishment timed out before a 
  2584.                          connection was made. 
  2585.  
  2586.  SOCENOBUFS              No buffer space is available. 
  2587.  
  2588.  SOCEOPNOTSUPP           The operation is not supported on socket s. 
  2589.  
  2590.  Examples 
  2591.  
  2592.  Note the following about these connect() call examples: 
  2593.  
  2594.      For the Internet examples, put the Internet address and port in 
  2595.       network-byte order.  To put the port into network-byte order, use the 
  2596.       htons() utility routine to convert a short integer from host-byte order 
  2597.       to network-byte order. 
  2598.  
  2599.      For the Internet examples, set the address field using the inet_addr() 
  2600.       utility routine, which takes a character string representing the 
  2601.       dotted-decimal address of an interface and returns the binary Internet 
  2602.       address representation in network-byte order. 
  2603.  
  2604.      To ensure that the name requested does not set any reserved fields, zero 
  2605.       the structure before using it. 
  2606.  
  2607.  These examples could be used to connect to the servers shown in the examples 
  2608.  listed for bind(). 
  2609.  
  2610.   int s;
  2611.   struct sockaddr_in servername;
  2612.   int rc;
  2613.   int connect(int s, struct sockaddr *name, int namelen); /* extracted from sys/socket.h */
  2614.  
  2615.   /* Connect to server bound to a specific interface in the Internet domain */
  2616.   /* clear the structure */
  2617.   memset(&servername, 0, sizeof(servername));
  2618.   servername.sin_family = AF_INET;
  2619.   servername.sin_addr.s_addr = inet_addr("129.5.24.1"); /* specific interface */
  2620.   servername.sin_port = htons(1024); /* set to the port to which */
  2621.                                              /* the server is bound */
  2622.   .
  2623.   .
  2624.   .
  2625.   rc = connect(s, (struct sockaddr *) &servername, sizeof(servername));
  2626.  
  2627.   /* Connect to a NetBIOS server */
  2628.   struct sockaddr_nb nbservername;
  2629.   memset(&nbservername, 0, sizeof(nbservername));
  2630.   nbservername.snb_family = AF_NB;
  2631.   nbservername.snb_type = NB_UNIQUE;
  2632.   nbservername.snb_adapter = 0;
  2633.   strcpy(nbservername.snb_name, "NBSERVER");
  2634.   .
  2635.   .
  2636.   .
  2637.   rc = connect(s, (struct sockaddr *) &nbservername, sizeof(nbservername));
  2638.  
  2639.  
  2640. ΓòÉΓòÉΓòÉ 7.4. getpeername() ΓòÉΓòÉΓòÉ
  2641.  
  2642. The getpeername() socket call gets the name of the peer connected to socket. 
  2643.  
  2644. Syntax 
  2645.  
  2646. #include <types.h>
  2647. #include <sys\socket.h>
  2648.  
  2649. int getpeername(s, name, namelen)
  2650. int s;
  2651. struct sockaddr *name;
  2652. int *namelen;
  2653.  
  2654. Parameters 
  2655.  
  2656.  s 
  2657.    Socket descriptor 
  2658.  
  2659.  name 
  2660.    Pointer to a sockaddr structure.  The name of the peer connected to socket s 
  2661.    is returned. The exact format of name is determined by the domain where 
  2662.    communication occurs. 
  2663.  
  2664.  namelen 
  2665.    Pointer to the size in bytes of the sockaddr structure pointed to by name 
  2666.  
  2667.  Description 
  2668.  
  2669.  This call returns the name of the peer connected to socket s. The namelen 
  2670.  parameter must be initialized to indicate the size of the space pointed to by 
  2671.  name. On return, namelen is set to the size of the peer name copied. If the 
  2672.  buffer is too small, the peer name is truncated. 
  2673.  
  2674.  This call operates only on connected sockets. 
  2675.  
  2676.  Return Values 
  2677.  
  2678.  The value 0 indicates success; the value -1 indicates an error. You can get 
  2679.  the specific error code by calling sock_errno() or psock_errno(). 
  2680.  
  2681.  Error Code          Description 
  2682.  
  2683.  SOCENOTSOCK         The s parameter is not a valid socket descriptor. 
  2684.  
  2685.  SOCEFAULT           Using the name and namelen parameters as specified would 
  2686.                      result in an attempt to access storage outside of the 
  2687.                      address space of the caller. 
  2688.  
  2689.  SOCENOTCONN         The socket is not connected. 
  2690.  
  2691.  SOCENOBUFS          No buffer space is available. 
  2692.  
  2693.  
  2694. ΓòÉΓòÉΓòÉ 7.5. getsockname() ΓòÉΓòÉΓòÉ
  2695.  
  2696. The getsockname() socket call gets the local socket name. 
  2697.  
  2698. Syntax 
  2699.  
  2700. #include <types.h>
  2701. #include <sys\socket.h>
  2702.  
  2703. int getsockname(s, name, namelen)
  2704. int s;
  2705. struct sockaddr *name;
  2706. int *namelen;
  2707.  
  2708. Parameters 
  2709.  
  2710.  s 
  2711.    Socket descriptor 
  2712.  
  2713.  name 
  2714.    Pointer to a sockaddr structure. The name of s is returned. 
  2715.  
  2716.  namelen 
  2717.    Pointer to the size in bytes of the buffer pointed to by name 
  2718.  
  2719.  Description 
  2720.  
  2721.  This call returns the name for the socket specified by the s parameter in the 
  2722.  structure pointed to by the name parameter.  It returns the address to the 
  2723.  socket that has been bound.  If the socket is not bound to an address, the 
  2724.  call returns with the family set and the rest of the structure is set to zero. 
  2725.  For example, an unbound socket in the Internet domain would cause the name to 
  2726.  point to a sockaddr_in structure with the sin_family field set to AF_INET and 
  2727.  all other fields zeroed. 
  2728.  
  2729.  The namelen parameter must be initialized to indicate the size of the space 
  2730.  pointed to by name and is set to the size of the local name copied. If the 
  2731.  buffer is too small, the local name is truncated. 
  2732.  
  2733.  Sockets are explicitly assigned a name after a successful call to bind(). 
  2734.  Stream and sequenced packet sockets are implicitly assigned a name after a 
  2735.  successful call to connect() or accept() if bind() was not called. 
  2736.  
  2737.  The getsockname() call is often used to discover the port assigned to a socket 
  2738.  after the socket has been implicitly bound to a port.  For example, an 
  2739.  application can call connect() without previously calling bind(). In this 
  2740.  case, the connect() call completes the binding necessary by assigning a port 
  2741.  to the socket. 
  2742.  
  2743.  Return Values 
  2744.  
  2745.  The value 0 indicates success; the value -1 indicates an error. You can get 
  2746.  the specific error code by calling sock_errno() or psock_errno(). 
  2747.  
  2748.  Error Code        Description 
  2749.  
  2750.  SOCENOTSOCK       The s parameter is not a valid socket descriptor. 
  2751.  
  2752.  SOCEFAULT         Using the name and namelen parameters as specified would 
  2753.                    result in an attempt to access storage outside of the 
  2754.                    address space of the caller. 
  2755.  
  2756.  SOCENOBUFS        No buffer space available. 
  2757.  
  2758.  
  2759. ΓòÉΓòÉΓòÉ 7.6. getsockopt() ΓòÉΓòÉΓòÉ
  2760.  
  2761. The getsockopt() socket call gets the socket options associated with a socket. 
  2762.  
  2763. Syntax 
  2764.  
  2765. #include <types.h>
  2766. #include <sys\socket.h>
  2767.  
  2768. int getsockopt(s, level, optname, optval, optlen)
  2769. int s;
  2770. int level;
  2771. int optname;
  2772. char *optval;
  2773. int *optlen;
  2774.  
  2775. Parameters 
  2776.  
  2777.  s 
  2778.    Socket descriptor 
  2779.  
  2780.  level 
  2781.    Specifies which option level is being queried for the specified optname 
  2782.  
  2783.  optname 
  2784.    Name of a specified socket option. Only one option can be specified on a 
  2785.    call. 
  2786.  
  2787.  optval 
  2788.    Pointer to buffer to receive the option data requested 
  2789.  
  2790.  optlen 
  2791.    Pointer to the size of the buffer 
  2792.  
  2793.  Description 
  2794.  
  2795.  This call returns the value of a socket option at the socket or protocol 
  2796.  level. It can be called for sockets of all domain types. Some options are 
  2797.  supported only for specific socket types. You must specify the level of the 
  2798.  option and the name of the option to retrieve option values. The following 
  2799.  table lists the supported levels. 
  2800.  
  2801.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2802.   Γöé Table 9. Supported Levels            Γöé
  2803.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2804.   Γöé Supported Level    Γöé #define in        Γöé
  2805.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2806.   Γöé SOL_SOCKET      Γöé <SYS\SOCKET.H>      Γöé
  2807.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2808.   Γöé IPPROTO_IP      Γöé <NETINET\IN.H>      Γöé
  2809.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2810.   Γöé IPPROTO_TCP      Γöé <NETINET\IN.H>      Γöé
  2811.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2812.   Γöé NBPROTO_NB      Γöé <NETNB\NB.H>       Γöé
  2813.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2814.  
  2815.  The optval parameter is a pointer to the buffer where the option values are 
  2816.  returned. The optlen parameter must be initially set to the size of the buffer 
  2817.  before calling getsockopt().  On return, the optlen parameter is set to the 
  2818.  actual size of the data returned. For socket options that are boolean, the 
  2819.  option is enabled if optval is nonzero and disabled if optval is 0. 
  2820.  
  2821.  The following tables list the supported options for getsockopt() at each level 
  2822.  (SOL_SOCKET, IPPROTO_IP, IPPROTO_TCP). Detailed descriptions of the options 
  2823.  follow each table. 
  2824.  
  2825.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2826.   Γöé Table 10. Supported getsockopt() Socket Options for SOL_SOCKET                            Γöé
  2827.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2828.   Γöé          Γöé              Γöé                Γöé           Γöé BOOLEAN/      Γöé
  2829.   Γöé OPTION NAME    Γöé DESCRIPTION        Γöé      DOMAINS(*)      Γöé DATA TYPE      Γöé VALUE       Γöé
  2830.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2831.   Γöé SO_BROADCAST   Γöé allows sending of broad-  Γöé I    Γöé     Γöé N     Γöé int         Γöé boolean      Γöé
  2832.   Γöé          Γöé cast messages       Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  2833.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2834.   Γöé SO_DEBUG     Γöé turn on recording of    Γöé I    Γöé L    Γöé      Γöé int         Γöé boolean      Γöé
  2835.   Γöé          Γöé debugging information   Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  2836.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2837.   Γöé SO_DONTROUTE   Γöé bypass routing tables   Γöé I    Γöé L    Γöé      Γöé int         Γöé boolean      Γöé
  2838.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2839.   Γöé SO_ERROR     Γöé get any pending error and Γöé I    Γöé L    Γöé      Γöé int         Γöé value       Γöé
  2840.   Γöé          Γöé clear           Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  2841.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2842.   Γöé SO_KEEPALIVE   Γöé keep connections alive   Γöé I    Γöé     Γöé      Γöé int         Γöé boolean      Γöé
  2843.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2844.   Γöé SO_LINGER     Γöé linger on close if data  Γöé I    Γöé     Γöé      Γöé struct linger    Γöé value       Γöé
  2845.   Γöé          Γöé present          Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  2846.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2847.   Γöé SO_OOBINLINE   Γöé leave received OOB data  Γöé I    Γöé     Γöé      Γöé int         Γöé boolean      Γöé
  2848.   Γöé          Γöé in-line          Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  2849.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2850.   Γöé SO_RCVBUF     Γöé receive buffer size    Γöé I    Γöé L    Γöé N     Γöé long        Γöé value       Γöé
  2851.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2852.   Γöé SO_RCVLOWAT    Γöé receive low-water mark   Γöé I    Γöé L    Γöé      Γöé int         Γöé value       Γöé
  2853.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2854.   Γöé SO_REUSEADDR   Γöé allow local address reuse Γöé I    Γöé     Γöé N     Γöé int         Γöé boolean      Γöé
  2855.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2856.   Γöé SO_SNDBUF     Γöé send buffer size      Γöé I    Γöé L    Γöé N     Γöé long        Γöé value       Γöé
  2857.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2858.   Γöé SO_SNDLOWAT    Γöé send low-water mark    Γöé I    Γöé L    Γöé      Γöé int         Γöé value       Γöé
  2859.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2860.   Γöé SO_TYPE      Γöé get socket type      Γöé I    Γöé L    Γöé N     Γöé int         Γöé value       Γöé
  2861.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2862.   Γöé SO_USELOOPBACK  Γöé bypass hardware when pos- Γöé I    Γöé L    Γöé      Γöé int         Γöé value       Γöé
  2863.   Γöé          Γöé sible           Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  2864.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2865.   Γöé NOTE:  (*) This column specifies I for Internet, L for Local IPC, and N for NetBIOS communication domains.      Γöé
  2866.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2867.  
  2868.  The following options are recognized for SOL_SOCKET: 
  2869.  
  2870.  Option                Description 
  2871.  
  2872.  SO_BROADCAST          (datagram sockets only) Retrieves the current ability of 
  2873.                        the socket to broadcast messages. If this option is 
  2874.                        enabled, it allows the application to send broadcast 
  2875.                        messages over s, if the interface specified in the 
  2876.                        destination supports broadcasting of packets. 
  2877.  
  2878.  SO_DEBUG              Retrieves the current ability for recording debug 
  2879.                        information for a socket. 
  2880.  
  2881.  SO_DONTROUTE          Retrieves the current ability for the socket to bypass 
  2882.                        routing. When this option is enabled, it causes outgoing 
  2883.                        messages to bypass the standard routing algorithm and be 
  2884.                        directed to the appropriate network interface, according 
  2885.                        to the network portion of the destination address. When 
  2886.                        enabled, packets can be sent only to directly connected 
  2887.                        networks (networks this host has an interface for). 
  2888.  
  2889.  SO_ERROR              Returns any pending error on the socket and clears the 
  2890.                        error status.  It can be used to check for asynchronous 
  2891.                        errors on connected datagram sockets or for other 
  2892.                        asynchronous errors (errors that are not returned 
  2893.                        explicitly by one of the socket calls). 
  2894.  
  2895.  SO_KEEPALIVE          (stream sockets only) Retrieves the current ability of 
  2896.                        the socket to send keepalive packets. TCP uses a timer 
  2897.                        called the keepalive timer.  This timer is used to 
  2898.                        monitor idle connections that might have been 
  2899.                        disconnected because of a peer crash or timeout. If this 
  2900.                        option is set on, a keepalive packet is periodically 
  2901.                        sent to the peer.  This is mainly used to allow servers 
  2902.                        to close connections that are no longer active as a 
  2903.                        result of clients going away without properly closing 
  2904.                        connections. 
  2905.  
  2906.  SO_LINGER             (stream sockets only) Retrieves the current ability of 
  2907.                        the socket to linger on close if data is present.  When 
  2908.                        this option is enabled and there is unsent data present 
  2909.                        when soclose() is called, the calling application is 
  2910.                        blocked during the soclose() call until the data is 
  2911.                        transmitted or the connection has timed out. If this 
  2912.                        option is disabled, the soclose() call returns without 
  2913.                        blocking the caller, and TCP waits to try to send the 
  2914.                        data. Although the data transfer is usually successful, 
  2915.                        it cannot be guaranteed, because TCP waits only a finite 
  2916.                        amount of time trying to send the data. 
  2917.  
  2918.  SO_OOBINLINE          (stream sockets only) Retrieves the current ability of 
  2919.                        the socket to receive out-of-band data. When this option 
  2920.                        is enabled, it causes out-of-band data to be placed in 
  2921.                        the normal data input queue as it is received, making it 
  2922.                        available to recv(), and recvfrom() without having to 
  2923.                        specify the MSG_OOB flag in those calls.  When this 
  2924.                        option is disabled, it causes out-of-band data to be 
  2925.                        placed in the priority data input queue as it is 
  2926.                        received, making it available to recv(), and recvfrom(), 
  2927.                        only by specifying the MSG_OOB flag in those calls. 
  2928.  
  2929.  SO_RCVBUF             Retrieves buffer size for input. This value tailors the 
  2930.                        receive buffer size for specific application needs, such 
  2931.                        as increasing the buffer size for high-volume 
  2932.                        connections. 
  2933.  
  2934.  SO_RCVLOWAT           Retrieves receive low-water mark information. 
  2935.  
  2936.  SO_REUSEADDR          (stream and datagram sockets only) Retrieves the current 
  2937.                        ability of the socket to reuse local addresses. When 
  2938.                        enabled, this option allows local addresses that are 
  2939.                        already in use to be bound. This alters the normal 
  2940.                        algorithm used in the bind() call. At connect time, the 
  2941.                        system checks to be sure that no local address and port 
  2942.                        have the same foreign address and port. The error 
  2943.                        SOCEADDRINUSE is returned if the association already 
  2944.                        exists. 
  2945.  
  2946.  SO_SNDBUF             Retrieves the size of the send buffer. This value 
  2947.                        tailors the send buffer size for specific application 
  2948.                        needs, such as increasing the buffer size for 
  2949.                        high-volume connections. 
  2950.  
  2951.  SO_SNDLOWAT           Retrieves send low-water mark information. For the 
  2952.                        NetBIOS domain, this value limits the length of a 
  2953.                        blocking send call.  This value is ignored for 
  2954.                        nonblocking calls.  For the Internet domain, this value 
  2955.                        is not used. 
  2956.  
  2957.  SO_TYPE               Returns the type of the socket.  On return, the integer 
  2958.                        pointed to by optval is set to one of the following: 
  2959.                        SOCK_STREAM, SOCK_DGRAM, or SOCK_RAW. 
  2960.  
  2961.  SO_USELOOPBACK        Bypasses hardware when possible. 
  2962.  
  2963.  struct linger: For the SO_LINGER option, optval points to a linger structure. 
  2964.  This structure is defined in <SYS\SOCKET.H> and contains the following fields: 
  2965.  
  2966.  Field          Description 
  2967.  l_onoff        Option on/off 
  2968.  l_linger       Linger time 
  2969.  
  2970.  The l_onoff field is set to zero if the SO_LINGER option is being disabled. A 
  2971.  nonzero value enables the option. 
  2972.  
  2973.  The l_linger field specifies the amount of time in seconds to linger on close. 
  2974.  A value of zero will cause so_close() to wait until the disconnect completes. 
  2975.  
  2976.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2977.   Γöé Table 11. Supported getsockopt() Socket Options for IPPROTO_TCP                            Γöé
  2978.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2979.   Γöé Option Name      Γöé Description           Γöé Data Type              Γöé Boolean/        Γöé
  2980.   Γöé            Γöé                 Γöé                   Γöé Value          Γöé
  2981.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2982.   Γöé TCP_NODELAY      Γöé don't delay send to coalesce  Γöé int                 Γöé boolean         Γöé
  2983.   Γöé            Γöé packets             Γöé                   Γöé             Γöé
  2984.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2985.  
  2986.  The following options are recognized for IPPROTO_TCP: 
  2987.  
  2988.  Option                Description 
  2989.  
  2990.  TCP_NODELAY           (stream sockets only) Retrieves the current ability of 
  2991.                        the socket to disable the buffering algorithm so that 
  2992.                        the client's TCP sends small packets as soon as 
  2993.                        possible.  This often has no performance effects on 
  2994.                        LANs, but can degrade performance on Wide Area Networks 
  2995.                        (WAN). 
  2996.  
  2997.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2998.   Γöé Table 12. Supported getsockopt() Socket Options for NBPROTO_NB                            Γöé
  2999.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3000.   Γöé Option Name      Γöé Description           Γöé Data Type              Γöé Boolean/        Γöé
  3001.   Γöé            Γöé                 Γöé                   Γöé Value          Γöé
  3002.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3003.   Γöé NB_DGRAM_TYPE     Γöé type of datagrams to receive  Γöé int                 Γöé value          Γöé
  3004.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3005.  
  3006.  The following option is recognized for NBPROTO_NB: 
  3007.  
  3008.  Option                Description 
  3009.  
  3010.  NB_DGRAM_TYPE         (datagram sockets only) Gets type of datagrams to be 
  3011.                        received on the socket.  The possible values are: 
  3012.  
  3013.                        NB_DGRAM               The socket is to receive normal 
  3014.                                               (unicast) datagrams only. 
  3015.                        NB_BROADCAST           The socket is to receive 
  3016.                                               broadcast datagrams only. 
  3017.                        NB_DGRAM_ANY           The socket can receive both 
  3018.                                               normal or broadcast datagrams. 
  3019.  
  3020.  Return Values 
  3021.  
  3022.  The value 0 indicates success; the value -1 indicates an error. You can get 
  3023.  the specific error code by calling sock_errno() or psock_errno(). 
  3024.  
  3025.  sock_errno() Value       Description 
  3026.  
  3027.  SOCEADDRINUSE            The address is already in use. 
  3028.  
  3029.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  3030.  
  3031.  SOCEFAULT                Using optval and optlen parameters would result in an 
  3032.                           attempt to access memory outside the caller's address 
  3033.                           space. 
  3034.  
  3035.  SOCENOPROTOOPT           The optname parameter or level parameter is not 
  3036.                           recognized. 
  3037.  
  3038.  Examples 
  3039.  
  3040.  The following are examples of the getsockopt() call. See setsockopt() for 
  3041.  examples of how the options are set. 
  3042.  
  3043.   int rc;
  3044.   int s;
  3045.   int optval;
  3046.   int optlen;
  3047.   struct linger lstruct;
  3048.   int getsockopt(int s, int level, int optname, char *optval, int *optlen);
  3049.                                                            /* extracted from sys/socket.h */
  3050.   .
  3051.   .
  3052.   .
  3053.   /* Is out of band data in the normal input queue? */
  3054.   optlen = sizeof(int);
  3055.   rc = getsockopt( s, SOL_SOCKET, SO_OOBINLINE, (char *) &optval, &optlen);
  3056.   if (rc == 0)
  3057.   {
  3058.       if (optlen == sizeof(int))
  3059.       {
  3060.            if (optval)
  3061.               /* yes it is in the normal queue */
  3062.            else
  3063.               /* no it is not                  */
  3064.       }
  3065.   }
  3066.  
  3067.   .
  3068.   .
  3069.   .
  3070.   /* Do I linger on close? */
  3071.   optlen = sizeof(lstruct);
  3072.   rc = getsockopt( s, SOL_SOCKET, SO_LINGER, (char *) &lstruct, &optlen);
  3073.   if (rc == 0)
  3074.   {
  3075.       if (optlen == sizeof(lstruct))
  3076.       {
  3077.            if (lstruct.l_onoff)
  3078.               /* yes I linger */
  3079.            else
  3080.               /* no I do not  */
  3081.       }
  3082.   }
  3083.  
  3084.  
  3085. ΓòÉΓòÉΓòÉ 7.7. ioctl() ΓòÉΓòÉΓòÉ
  3086.  
  3087. The ioctl() socket call performs special operations on socket. 
  3088.  
  3089. Syntax 
  3090.  
  3091. #include <types.h>
  3092. #include <sys\socket.h>
  3093. #include <sys\ioctl.h>
  3094. #include <net\route.h>
  3095. #include <net\if.h>
  3096. #include <net\if_arp.h>
  3097.  
  3098. int ioctl(s, cmd, data, lendata)
  3099. int s;
  3100. int cmd;
  3101. caddr_t data;
  3102. int lendata;
  3103.  
  3104. Parameters 
  3105.  
  3106.  s 
  3107.    Socket descriptor 
  3108.  
  3109.  cmd 
  3110.    Command to perform 
  3111.  
  3112.  data 
  3113.    Pointer to the data associated with cmd 
  3114.  
  3115.  lendata 
  3116.    Length of the data in bytes 
  3117.  
  3118.  Description 
  3119.  
  3120.  This call controls the operating characteristics of sockets. The data 
  3121.  parameter is a pointer to data associated with the particular command, and its 
  3122.  format depends on the command that is requested. 
  3123.  
  3124.  Option             Description 
  3125.  
  3126.  FIOASYNC           This option has no effect. 
  3127.  
  3128.  FIONBIO            Sets or clears nonblocking input/output for a socket. When 
  3129.                     this option is set, input/output calls will not block until 
  3130.                     the call is completed. The data parameter is a pointer to 
  3131.                     an integer. If the integer is 0, nonblocking input/output 
  3132.                     on the socket is cleared. Otherwise, the socket is set for 
  3133.                     nonblocking input/output. 
  3134.  
  3135.  FIONREAD           Gets the number of immediately readable bytes for the 
  3136.                     socket. The data parameter is a pointer to an integer. Sets 
  3137.                     the value of the integer to the number of immediately 
  3138.                     readable characters for the socket. 
  3139.  
  3140.  Internet: The following ioctl commands are supported for the Internet domain: 
  3141.  
  3142.  Option             Description 
  3143.  
  3144.  SIOCADDRT          Adds a routing table entry.  data is a pointer to a rtentry 
  3145.                     structure, as defined in <NET\ROUTE.H>. The routing table 
  3146.                     entry, passed as an argument, is added to the routing 
  3147.                     tables. 
  3148.  
  3149.  SIOCATMARK         Queries whether the current location in the data input is 
  3150.                     pointing to out-of-band data. data is a pointer to an 
  3151.                     integer.  Sets the argument to 1 if the socket points to a 
  3152.                     mark in the data stream for out-of-band data.  Otherwise, 
  3153.                     sets the argument to 0. 
  3154.  
  3155.  SIOCDARP           Deletes an arp table entry. data is a pointer to a arpreq 
  3156.                     as defined in <NET\IF_ARP.H>.  The arp table entry passed 
  3157.                     as an argument is deleted from the arp tables, if it 
  3158.                     exists. 
  3159.  
  3160.  SIOCDELRT          Deletes a routing table entry. data is a pointer to a 
  3161.                     rtentry structure, as defined in <NET\ROUTE.H>. If it 
  3162.                     exists, the routing table entry passed as an argument is 
  3163.                     deleted from the routing tables. 
  3164.  
  3165.  SIOCGARP           Gets the arp table entries. data is a pointer to an arpreq, 
  3166.                     as defined in <NET\IF_ARP.H>.  The arp table entry passed 
  3167.                     as an argument is returned from the arp tables if it 
  3168.                     exists. 
  3169.  
  3170.  SIOCGIFADDR        Gets the network interface address. data is a pointer to an 
  3171.                     ifreq structure, as defined in <NET\IF.H>. The interface 
  3172.                     address is returned in the argument. 
  3173.  
  3174.  SIOCGIFBRDADDR     Gets the network interface broadcast address. data is a 
  3175.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  3176.                     The interface broadcast address is returned in the 
  3177.                     argument. 
  3178.  
  3179.  SIOCGIFCONF        Gets the network interface configuration. data is a pointer 
  3180.                     to an ifconf structure, as defined in <NET\IF.H>.  The 
  3181.                     interface configuration is returned in the argument. 
  3182.  
  3183.  SIOCGIFDSTADDR     Gets the network interface destination address. data is a 
  3184.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  3185.                     The interface destination (point-to-point) address is 
  3186.                     returned in the argument. 
  3187.  
  3188.  SIOCGIFFLAGS       Gets the network interface flags. data is a pointer to an 
  3189.                     ifreq structure, as defined in <NET\IF.H>.  The interface 
  3190.                     flags are returned in the argument. 
  3191.  
  3192.  SIOCGIFMETRIC      Gets the network interface routing metric. data is a 
  3193.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  3194.                     The interface routing metric is returned in the argument. 
  3195.  
  3196.  SIOCGIFNETMASK     Gets the network interface network mask. data is a pointer 
  3197.                     to an ifreq structure, as defined in <NET\IF.H>. The 
  3198.                     interface network mask is returned in the argument. 
  3199.  
  3200.  SIOCSARP           Sets an arp table entry. data is a pointer to an arpreq as 
  3201.                     defined in <NET\IF_ARP.H>.  The arp table entry passed as 
  3202.                     an argument is added to the arp tables. 
  3203.  
  3204.  SIOCSIFADDR        Sets the network interface address. data is a pointer to an 
  3205.                     ifreq structure, as defined in <NET\IF.H>. Sets the 
  3206.                     interface address to the value passed in the argument. 
  3207.  
  3208.  SIOCSIFBRDADDR     Sets the network interface broadcast address. data is a 
  3209.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  3210.                     Sets the interface broadcast address to the value passed in 
  3211.                     the argument. 
  3212.  
  3213.  SIOCSIFDSTADDR     Sets the network interface destination address. data is a 
  3214.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  3215.                     Sets the interface destination (point-to-point) address to 
  3216.                     the value passed in the argument. 
  3217.  
  3218.  SIOCSIFFLAGS       Sets the network interface flags. data is a pointer to an 
  3219.                     ifreq structure, as defined in <NET\IF.H>.  Sets the 
  3220.                     interface flags to the values passed in the argument. 
  3221.  
  3222.  SIOCSIFMETRIC      Sets the network interface routing metric. data is a 
  3223.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  3224.                     Sets the interface routing metric to the value passed in 
  3225.                     the argument. 
  3226.  
  3227.  SIOCSIFNETMASK     Sets the network interface network mask. data is a pointer 
  3228.                     to an ifreq structure, as defined in <NET\IF.H>. Sets the 
  3229.                     interface network mask to the value passed in the argument. 
  3230.  
  3231.  Return Values 
  3232.  
  3233.  The value 0 indicates success; the value -1 indicates an error. You can get 
  3234.  the specific error code by calling sock_errno() or psock_errno(). 
  3235.  
  3236.  sock_errno() Value       Description 
  3237.  
  3238.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  3239.  
  3240.  SOCEINVAL                The request is not valid or not supported. 
  3241.  
  3242.  SOCEOPNOTSUPP            The operation is not supported on the socket. 
  3243.  
  3244.  SOCEFAULT                Using data and lendata would result in an attempt to 
  3245.                           access memory outside the caller address space. 
  3246.  
  3247.  Examples 
  3248.  
  3249.  The following is an example of the ioctl() call. 
  3250.  
  3251.   int s;
  3252.   int dontblock;
  3253.   int rc;
  3254.   int ioctl(int s, int cmd, caddr_t data, int lendata);  /* extracted from sys\socket.h */
  3255.   .
  3256.   .
  3257.   .
  3258.   /* Place the socket into nonblocking mode */
  3259.   dontblock = 1;
  3260.   rc = ioctl(s, FIONBIO, (char *) &dontblock, sizeof(dontblock));
  3261.   .
  3262.   .
  3263.   .
  3264.  
  3265.  
  3266. ΓòÉΓòÉΓòÉ 7.8. listen() ΓòÉΓòÉΓòÉ
  3267.  
  3268. The listen() socket call completes the binding necessary for a socket to accept 
  3269. connections and creates a connection request queue for incoming requests. 
  3270.  
  3271. Syntax 
  3272.  
  3273. #include <types.h>
  3274. #include <sys\socket.h>
  3275.  
  3276. int listen(s, backlog)
  3277. int s;
  3278. int backlog;
  3279.  
  3280. Parameters 
  3281.  
  3282.  s 
  3283.    Socket descriptor. 
  3284.  
  3285.  backlog 
  3286.    Controls the maximum queue length for pending connections. 
  3287.  
  3288.  Description 
  3289.  
  3290.  The listen() call performs two tasks: 1) completes the binding necessary for a 
  3291.  socket s, if bind() has not been called for s. 2) creates a connection request 
  3292.  queue of length backlog to queue incoming connection requests. When the queue 
  3293.  is full, additional connection requests are ignored. 
  3294.  
  3295.  The listen() call indicates a readiness to accept client connection requests. 
  3296.  It transforms an active socket into a passive socket.  After listen() is 
  3297.  called, s can never be used as an active socket to initiate connection 
  3298.  requests. Listen() is called after allocating a socket with socket() and after 
  3299.  binding a name to s with bind().  Listen() must be called before calling 
  3300.  accept(). 
  3301.  
  3302.  Listen() can only be called on connection-oriented sockets. 
  3303.  
  3304.  If the backlog parameter is less than 0, then listen() interprets backlog as 
  3305.  0. If the backlog parameter is greater than SOMAXCONN, as defined in 
  3306.  <SYS\SOCKET.H>, then listen() interprets backlog as SOMAXCONN. 
  3307.  
  3308.  Return Values 
  3309.  
  3310.  The value 0 indicates success, the value -1 indicates an error. You can get 
  3311.  the specific error code by calling sock_errno() or psock_errno(). 
  3312.  
  3313.  Error Code           Description 
  3314.  
  3315.  SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  3316.  
  3317.  SOCEOPNOTSUPP        The s parameter is not a socket descriptor that supports 
  3318.                       the listen() call. 
  3319.  
  3320.  
  3321. ΓòÉΓòÉΓòÉ 7.9. psock_errno() ΓòÉΓòÉΓòÉ
  3322.  
  3323. The psock_errno() socket call writes a short error message to the standard 
  3324. error device. 
  3325.  
  3326. Syntax 
  3327.  
  3328. #include <nerrno.h>
  3329.  
  3330.  
  3331. void psock_errno(s)
  3332. char *s;
  3333.  
  3334. Parameters 
  3335.  
  3336.  s 
  3337.    Pointer to a buffer 
  3338.  
  3339.  Description 
  3340.  
  3341.  This call writes a short error message to the standard error display 
  3342.  describing the last error encountered during a call to a socket library 
  3343.  function. If s is not a NULL pointer and does not point to a null string, the 
  3344.  string it points to is printed, followed by a colon, followed by a space, 
  3345.  followed by the message.  If s is a NULL pointer or points to a null string, 
  3346.  only the message is printed. 
  3347.  
  3348.  The error code is acquired by calling sock_errno().  The error code is set 
  3349.  when errors occur.  Subsequent socket calls do not clear the error code. 
  3350.  
  3351.  
  3352. ΓòÉΓòÉΓòÉ 7.10. readv() ΓòÉΓòÉΓòÉ
  3353.  
  3354. The readv() socket call receives data on a socket into a set of buffers. 
  3355.  
  3356. Syntax 
  3357.  
  3358. #include <types.h>
  3359. #include <sys\socket.h>
  3360.  
  3361. int readv(s, iov, iovcnt)
  3362. int s;
  3363. struct iovec *iov;
  3364. int iovcnt;
  3365.  
  3366. Parameters 
  3367.  
  3368.  s 
  3369.    Socket descriptor 
  3370.  
  3371.  iov 
  3372.    Pointer to an array of iovec structures 
  3373.  
  3374.  iovcnt 
  3375.    Number of iovec structures pointed to by the iov parameter. The maximum 
  3376.    number of iovec structures is 16. 
  3377.  
  3378.  Description 
  3379.  
  3380.  This call reads data on a socket with descriptor s and stores it in a set of 
  3381.  buffers. The data is scattered into the buffers specified by 
  3382.  iov[0]...iov[iovcnt-1]. The iovec structure is defined in <SYS\SOCKET.H> and 
  3383.  contains the following fields: 
  3384.  
  3385.  Field          Description 
  3386.  iov_base       Points to the buffer 
  3387.  iov_len        Length of the buffer 
  3388.  
  3389.  The readv() call applies only to connected sockets. For information on how to 
  3390.  use readv() with datagram and raw sockets, see "Datagram or raw sockets" in 
  3391.  connect(). 
  3392.  
  3393.  This call returns up to the number of bytes in the buffers pointed to by the 
  3394.  iov parameter.  This number is the sum of all iov_len fields. If less than the 
  3395.  number of bytes requested is available, the call returns the number currently 
  3396.  available. If data is not available at the socket with descriptor s, the 
  3397.  readv() call waits for data to arrive and blocks the caller, unless the socket 
  3398.  is in nonblocking mode. See ioctl() for a description of how to set 
  3399.  nonblocking mode. The UDP sockets can send and receive datagrams as large as 
  3400.  32739 bytes (32 * 1024, -1, - IP header (20 bytes) - UDP header (8 bytes)). 
  3401.  
  3402.  Return Values 
  3403.  
  3404.  If successful, the number of bytes read into the buffers is returned. The 
  3405.  value -1 indicates an error. You can get the specific error code by calling 
  3406.  sock_errno() or psock_errno(). 
  3407.  
  3408.  sock_errno() Value       Description 
  3409.  
  3410.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  3411.  
  3412.  SOCEFAULT                Using iov and iovcnt would result in an attempt to 
  3413.                           access memory outside the caller's address space. 
  3414.  
  3415.  SOCEINTR                 Interrupted system call. 
  3416.  
  3417.  SOCEINVAL                iovcnt was not valid, or one of the fields in the iov 
  3418.                           array was not valid. 
  3419.  
  3420.  SOCEWOULDBLOCK           The s parameter is in nonblocking mode and no data is 
  3421.                           available to read, OR the SO_RCVTIMEO option has been 
  3422.                           set for socket s and the timeout expired before any 
  3423.                           data arrived to read. 
  3424.  
  3425.  
  3426. ΓòÉΓòÉΓòÉ 7.11. recv() ΓòÉΓòÉΓòÉ
  3427.  
  3428. The socket call receives data on a connected socket. 
  3429.  
  3430. Syntax 
  3431.  
  3432. #include <types.h>
  3433. #include <sys\socket.h>
  3434.  
  3435. int recv(s, buf, len, flags)
  3436. int s;
  3437. char *buf;
  3438. int len;
  3439. int flags;
  3440.  
  3441. Parameters 
  3442.  
  3443.  s 
  3444.    Socket descriptor 
  3445.  
  3446.  buf 
  3447.    Pointer to the buffer that receives the data 
  3448.  
  3449.  len 
  3450.    Length of the buffer in bytes pointed to by the buf parameter. 
  3451.  
  3452.  flags 
  3453.    Set by specifying one or more of the following flags. If you specify more 
  3454.    than one flag, use the logical OR operator (|) to separate them. Setting 
  3455.    this parameter is supported only for sockets in the Internet domain. 
  3456.  
  3457.    MSG_OOB           Reads any out-of-band data on the socket. 
  3458.  
  3459.    MSG_PEEK          Peeks at the data present on the socket; the data is 
  3460.                      returned but not consumed, so that a subsequent receive 
  3461.                      operation sees the same data. 
  3462.  
  3463.  Description 
  3464.  
  3465.  This call receives data on a socket with descriptor s and stores it in the 
  3466.  buffer pointed to by buf. The recv() call applies only to connected sockets. 
  3467.  For information on how to use recv() with datagram and raw sockets, see 
  3468.  "Datagram or raw sockets" in connect(). 
  3469.  
  3470.  The recv() call returns the length of the incoming data. If a datagram or 
  3471.  sequenced packet is too long to fit in the buffer, the excess is discarded. 
  3472.  No data is discarded for stream or sequenced packet sockets. If data is not 
  3473.  available at the socket with descriptor s, the recv() call waits for a message 
  3474.  to arrive and blocks the caller, unless the socket is in nonblocking mode. See 
  3475.  ioctl() for a description of how to set nonblocking mode. 
  3476.  
  3477.  Return Values 
  3478.  
  3479.  If successful, the length in bytes of the data is returned.  The value 0 
  3480.  indicates that the connection is closed. The value -1 indicates an error. You 
  3481.  can get the specific error code by calling sock_errno() or psock_errno(). 
  3482.  
  3483.  Error Code           Description 
  3484.  
  3485.  SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  3486.  
  3487.  SOCEFAULT            Using the buf and len parameters would result in an 
  3488.                       attempt to access memory outside the caller's address 
  3489.                       space. 
  3490.  
  3491.  SOCEINTR             Interrupted system call. 
  3492.  
  3493.  SOCEINVAL            Invalid argument. 
  3494.  
  3495.  SOCEWOULDBLOCK       The s parameter is in nonblocking mode and no data is 
  3496.                       available to receive, or the SO_RCVTIMEO option has been 
  3497.                       set for socket s and the timeout expired before any data 
  3498.                       arrived to receive. 
  3499.  
  3500.  
  3501. ΓòÉΓòÉΓòÉ 7.12. recvfrom() ΓòÉΓòÉΓòÉ
  3502.  
  3503. The socket call receives data on a socket. 
  3504.  
  3505. Syntax 
  3506.  
  3507. #include <types.h>
  3508. #include <sys\socket.h>
  3509.  
  3510. int recvfrom(s, buf, len, flags, name, namelen)
  3511. int s;
  3512. char *buf;
  3513. int len;
  3514. int flags;
  3515. struct sockaddr *name;
  3516. int *namelen;
  3517.  
  3518. Parameters 
  3519.  
  3520.  s 
  3521.    Socket descriptor 
  3522.  
  3523.  buf 
  3524.    Pointer to the buffer that receives the data 
  3525.  
  3526.  len 
  3527.    Length of the buffer in bytes pointed to by the buf parameter 
  3528.  
  3529.  flags 
  3530.    Set by specifying one or more of the following flags. If you specify more 
  3531.    than one flag, use the logical OR operator (|) to separate them. Setting 
  3532.    this parameter is supported only for sockets in the Internet domain. 
  3533.  
  3534.    MSG_OOB             Reads any out-of-band data on the socket. 
  3535.  
  3536.    MSG_PEEK            Peeks at the data present on the socket; the data is 
  3537.                        returned but not consumed, so that a subsequent receive 
  3538.                        operation sees the same data. 
  3539.  
  3540.  name 
  3541.    Pointer to a sockaddr structure (buffer) that data is received from. If name 
  3542.    is a nonzero value, the source address is returned. 
  3543.  
  3544.  namelen 
  3545.    Pointer to the size in bytes of the buffer pointed to by name 
  3546.  
  3547.  Description 
  3548.  
  3549.  The recvfrom() call receives data on a socket with descriptor s and stores it 
  3550.  in a buffer. The recvfrom() call applies to any socket type, whether connected 
  3551.  or not. 
  3552.  
  3553.  If name is nonzero, the address of the data sender is returned. The namelen 
  3554.  parameter is first initialized to the size of the buffer associated with name; 
  3555.  on return, it is modified to indicate the actual number of bytes stored there. 
  3556.  
  3557.  The recvfrom() call returns the length of the incoming message or data. If a 
  3558.  datagram or sequenced packet is too long to fit in the supplied buffer, the 
  3559.  excess is discarded. No data is discarded for stream or sequenced packet 
  3560.  sockets. If data is not available at the socket with descriptor s, the 
  3561.  recvfrom() call waits for a message to arrive and blocks the caller, unless 
  3562.  the socket is in nonblocking mode.  See ioctl() for a description of how to 
  3563.  set nonblocking mode. 
  3564.  
  3565.  Return Values 
  3566.  
  3567.  If successful, the length, in bytes, of the data is returned. The value -1 
  3568.  indicates an error. You can get the specific error code by calling 
  3569.  sock_errno() or psock_errno(). 
  3570.  
  3571.  Error Code            Description 
  3572.  
  3573.  SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  3574.  
  3575.  SOCEFAULT             Using the buf and len parameters would result in an 
  3576.                        attempt to access memory outside the caller's address 
  3577.                        space. 
  3578.  
  3579.  SOCEWOULDBLOCK        The s parameter is in nonblocking mode and no data is 
  3580.                        available to receive, or the SO_RCVTIMEO option has been 
  3581.                        set for socket s and the timeout expired before any data 
  3582.                        arrived to receive. 
  3583.  
  3584.  SOCEINVAL             Invalid argument. 
  3585.  
  3586.  
  3587. ΓòÉΓòÉΓòÉ 7.13. recvmsg() ΓòÉΓòÉΓòÉ
  3588.  
  3589. The socket call receives data and control information on a specified socket. 
  3590.  
  3591. Syntax 
  3592.  
  3593. #include <types.h>
  3594. #include <sys\socket.h>
  3595.  
  3596. int recvmsg(s, msg, flags)
  3597. int s;
  3598. struct msghdr *msg;
  3599. int flags;
  3600.  
  3601. Parameters 
  3602.  
  3603.  s 
  3604.    Socket descriptor 
  3605.  
  3606.  msg 
  3607.    Pointer to a message header that receives the message 
  3608.  
  3609.  flags 
  3610.    Set by specifying one or more of the following flags. If you specify more 
  3611.    than one flag, use the logical OR operator (|) to separate them. Setting 
  3612.    this parameter is supported only for sockets in the Internet domain. 
  3613.  
  3614.    MSG_OOB           Reads any out-of-band data on the socket. 
  3615.  
  3616.    MSG_PEEK          Peeks at the data present on the socket; the data is 
  3617.                      returned but not consumed, so that a subsequent receive 
  3618.                      operation will see the same data 
  3619.  
  3620.  Description 
  3621.  
  3622.  This call receives a message on a socket with descriptor s. 
  3623.  
  3624.  Network Services supports the following the following msghdr structure. 
  3625.  
  3626.  Note:  The fields msg_accrights and msg_accrightslen are ignored for the 
  3627.  NetBIOS and Local IPC domains.  For the internet domain, these fields are not 
  3628.  supported, and you must set msg_accrights to NULL and msg_accrightslen to 0. 
  3629.  
  3630.     struct msghdr {
  3631.            caddr_t msg_name;             /* optional pointer to destination address buffer */
  3632.            int     msg_namelen;          /* size of address buffer */
  3633.            struct iovec  *msg_iovec;     /* scatter/gather array */
  3634.            int     msg_iovlen;           /* how many elements in msg_iov */
  3635.            caddr_t msg_accrights;        /* access rights sent/recvd */
  3636.            int     msg_accrightslen;     /* access rights information length */
  3637.     };
  3638.  
  3639.  The recvmsg() call applies to connection-oriented or connectionless sockets. 
  3640.  
  3641.  This call returns the length of the data received. If a datagram or sequenced 
  3642.  packet is too long to fit in the supplied buffer, the excess is discarded.  No 
  3643.  data is discarded for stream or sequenced packet sockets. If data is not 
  3644.  available at the socket with descriptor s, the recvmsg() call waits for a 
  3645.  message to arrive and blocks the caller, unless the socket is in nonblocking 
  3646.  mode. See ioctl() for a description of how to set nonblocking mode. 
  3647.  
  3648.  Return Values 
  3649.  
  3650.  If successful, the length of the message in bytes is returned. The value 0 
  3651.  indicates the connection is closed; the value -1 indicates an error. You can 
  3652.  get the specific error code by calling sock_errno() or psock_errno(). 
  3653.  
  3654.  Error Code           Description 
  3655.  
  3656.  SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  3657.  
  3658.  SOCEFAULT            Using msg would result in an attempt to access memory 
  3659.                       outside the caller's address space. 
  3660.  
  3661.  SOCEINTR             Interrupted system call. 
  3662.  
  3663.  SOCENOTCONN          The socket is not connected. 
  3664.  
  3665.  SOCEWOULDBLOCK       The s parameter is in nonblocking mode, and no data is 
  3666.                       available to receive. 
  3667.  
  3668.  
  3669. ΓòÉΓòÉΓòÉ 7.14. select() ΓòÉΓòÉΓòÉ
  3670.  
  3671. The socket call gets read, write, and exception status on a group of sockets. 
  3672.  
  3673. Network Services supports two versions of the select() call: 
  3674.  
  3675.      TCP/IP Version 3.0 for OS/2 Warp Version 
  3676.      Berkeley Software Distributions (BSD) Version 
  3677.  
  3678.  Either version of select() can be used. The TCP/IP Version 3.0 for OS/2 Warp 
  3679.  version has better performance. However, the BSD version is more portable. 
  3680.  
  3681.  
  3682. ΓòÉΓòÉΓòÉ 7.14.1. TCP/IP Version 3.0 for OS/2 Warp Version ΓòÉΓòÉΓòÉ
  3683.  
  3684. In the OS/2 Warp Connect version, the socket numbers are specified as an array 
  3685. of integers, in which the read socket numbers are followed by write socket 
  3686. numbers, followed by the exception pending connection socket numbers. This 
  3687. version monitors the activity on a socket by specifying the number of sockets 
  3688. to be checked for readability, readiness for writing, and exception pending 
  3689. conditions. 
  3690.  
  3691. Syntax 
  3692.  
  3693. #include <types.h>
  3694. #include <sys\socket.h>
  3695.  
  3696. int select(s, noreads, nowrites, noexcepts, timeout)
  3697. int *s;
  3698. int noreads;
  3699. int nowrites;
  3700. int noexcepts;
  3701. long timeout;
  3702.  
  3703. Parameters 
  3704.  
  3705.  s 
  3706.    Pointer to an array of socket numbers where the read socket numbers are 
  3707.    followed by the write socket numbers, and then followed by the exception 
  3708.    socket numbers. 
  3709.  
  3710.  noreads 
  3711.    Number of sockets to be checked for readability. 
  3712.  
  3713.  nowrites 
  3714.    Number of sockets to be checked for readiness for writing. 
  3715.  
  3716.  noexcepts 
  3717.    Number of sockets to be checked for exceptional pending conditions. For 
  3718.    Network Services sockets, the only exceptional pending condition is 
  3719.    out-of-band data in the receive buffer. 
  3720.  
  3721.  timeout 
  3722.    Maximum interval, in milliseconds, to wait for the selection to complete. 
  3723.  
  3724.  Description 
  3725.  
  3726.  This call monitors activity on a set of different sockets until a timeout 
  3727.  expires, to see if any sockets are ready for reading or writing, or if any 
  3728.  exceptional conditions are pending. 
  3729.  
  3730.  If the timeout value is 0, select() does not wait before returning. If the 
  3731.  timeout value is -1, select() does not timeout, but returns when a socket 
  3732.  becomes ready. If the timeout value is a number of milliseconds, select() 
  3733.  waits for the specified interval before returning. The select() call checks 
  3734.  all indicated sockets at the same time and returns when any of them is ready. 
  3735.  
  3736.  It is recommended to reinitialize the socket array every time select() is 
  3737.  called. 
  3738.  
  3739.  Return Values 
  3740.  
  3741.  The number of ready sockets is returned. The value -1 indicates an error. The 
  3742.  value 0 indicates an expired time limit. If the return value is greater than 
  3743.  0, the socket numbers in s that were not ready are set to -1. You can get the 
  3744.  specific error code by calling sock_errno() or psock_errno(). 
  3745.  
  3746.  Error Code         Description 
  3747.  SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  3748.  SOCEFAULT          The address is not valid. 
  3749.  SOCEINVAL          Invalid argument. 
  3750.  SOCEINTR           Interrupted system call. 
  3751.  
  3752.  Examples 
  3753.  
  3754.  The following is an example of the OS/2 Warp Connect select() call. 
  3755.  
  3756.   #define MAX_TIMEOUT  1000
  3757.  
  3758.   /* input_ready(insock)- Check to see if there is available input on
  3759.    * socket insock.
  3760.    * Returns 1 if input is available.
  3761.    *         0 if input is not available.
  3762.    *        -1 on error.
  3763.    */
  3764.  
  3765.    int input_ready(insock)
  3766.    int insock;                 /* input socket descriptor */
  3767.  
  3768.    {
  3769.      int socks[1];    /* array of sockets */
  3770.      long timeout = MAX_TIMEOUT;
  3771.  
  3772.      /* put socket to check in socks[] */
  3773.      socks[0] = insock;
  3774.  
  3775.      /* check for READ availability on this socket */
  3776.      return select(socks, 1, 0, 0, timeout);
  3777.    }
  3778.  
  3779.  
  3780. ΓòÉΓòÉΓòÉ 7.14.2. BSD Version ΓòÉΓòÉΓòÉ
  3781.  
  3782. The BSD version monitors the activity on sockets by specifying a set mask 
  3783. (fd_set) of socket numbers for which the caller wants to read the data, write 
  3784. the data, and check exception pending conditions. The BSD version provides 
  3785. FD_SET, FD_CLR, FD_ISSET, and FD_ZERO macros to add or delete socket numbers 
  3786. from the set mask. 
  3787.  
  3788. Note:  You must define #define BSD_SELECT before including the Network Services 
  3789. header files to access the BSD version of the select() call. Otherwise, the 
  3790. OS/2 Warp Connect version is assumed. 
  3791.  
  3792. Syntax 
  3793.  
  3794. #define BSD_SELECT
  3795. #include <types.h>
  3796. #include <sys\select.h>
  3797. #include <sys\time.h>
  3798.  
  3799. int select(nfds, readfds, writefds, exceptfds, timeout)
  3800. int nfds;
  3801. fd_set *readfds;
  3802. fd_set *writefds;
  3803. fd_set *exceptfds;
  3804. struct timeval *timeout;
  3805.  
  3806. Parameters 
  3807.  
  3808.  nfds 
  3809.    The range of socket descriptors to be checked.  select() tests socket 
  3810.    descriptors in the range of 0 to (nfds - 1). 
  3811.  
  3812.  readfds 
  3813.    Pointer to a bit mask of descriptors to be checked for reading. 
  3814.  
  3815.  writefds 
  3816.    Pointer to a bit mask of descriptors to be checked for writing. 
  3817.  
  3818.  exceptfds 
  3819.    Pointer to a bit mask of descriptors to be checked for exceptional pending 
  3820.    conditions. For Network Services sockets, the only exceptional pending 
  3821.    condition is out-of-band data in the receive buffer. 
  3822.  
  3823.  timeout 
  3824.    Pointer to the time to wait for the select() call to complete. 
  3825.  
  3826.  Description 
  3827.  
  3828.  This call monitors activity on a set of different sockets until a timeout 
  3829.  expires, to see if any sockets are ready for reading or writing, or if any 
  3830.  exceptional conditions are pending. 
  3831.  
  3832.  It is recommended to reinitialize readfds, writefds, and exceptfds every time 
  3833.  select() is called. 
  3834.  
  3835.  If timeout is a NULL pointer, the call blocks indefinitely until one of the 
  3836.  requested conditions is satisfied. If timeout is non-NULL, it specifies the 
  3837.  maximum time to wait for the call to complete. To poll a set of sockets, the 
  3838.  timeout pointer should point to a zeroed timeval structure. The timeval 
  3839.  structure is defined in the <SYS\TIME.H> header file and contains the 
  3840.  following fields: 
  3841.  
  3842.  Field          Description 
  3843.  tv_sec         Number of seconds 
  3844.  tv_usec        Number of microseconds 
  3845.  
  3846.  A bit mask is made up of an array of integers. Macros are provided to 
  3847.  manipulate the bit masks. 
  3848.  
  3849.  Macro                                   Description 
  3850.  
  3851.  FD_SET(socket, bit_mask_address)        Sets the bit for the socket in the bit 
  3852.                                          mask pointed to by bit_mask_address. 
  3853.  
  3854.  FD_CLR(socket, bit_mask_address)        Clears the bit. 
  3855.  
  3856.  FD_ISSET(socket, bit_mask_address)      Returns true if the bit is set for 
  3857.                                          this socket descriptor; otherwise, it 
  3858.                                          returns false. 
  3859.  
  3860.  FD_ZERO(socket, bit_mask_address)       Clears the entire bit mask for all 
  3861.                                          socket descriptors. 
  3862.  
  3863.  Note: 
  3864.  
  3865.    1. For macros FD_SET, FD_CLR, FD_ISSET, and FD_ZERO, you define the 
  3866.       parameters socket and bit_mask_address in the following manner: 
  3867.  
  3868.             int socket;
  3869.             struct fd_set *bit_mask_address;
  3870.  
  3871.    2. The first nfds descriptors in each bit mask are tested for the specified 
  3872.       condition. 
  3873.  
  3874.    3. A socket descriptor with a value of 8 is actually the 9th descriptor in 
  3875.       the fd_set (the socket descriptor value of 0 is the first descriptor). To 
  3876.       check the socket descriptor 8, nfds would have to be greater than or 
  3877.       equal to 9. 
  3878.  
  3879.  Socket descriptors are specified by setting bits in a bit mask. 
  3880.  
  3881.  Setting any of the descriptor pointers to zero indicates that no checks are to 
  3882.  be made for the conditions. For example, setting exceptfds to be a NULL 
  3883.  pointer causes the select call to check for only read and write conditions. 
  3884.  
  3885.  Return Values 
  3886.  
  3887.  The total number of ready sockets (in all bit masks) is returned. The value -1 
  3888.  indicates an error. The value 0 indicates an expired time limit. If the return 
  3889.  value is greater than 0, the socket descriptors in each bit mask that are 
  3890.  ready are set to 1. All others are set to 0. You can get the specific error 
  3891.  code by calling sock_errno() or psock_errno(). 
  3892.  
  3893.  sock_errno() Value       Description 
  3894.  
  3895.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  3896.  
  3897.  SOCEFAULT                The address is not valid. 
  3898.  
  3899.  SOCEINVAL                Invalid argument. 
  3900.  
  3901.  Examples 
  3902.  
  3903.  The following is an example of the BSD version of the select() call. 
  3904.  
  3905.   #define BSD_SELECT
  3906.   .
  3907.   .
  3908.   .
  3909.   fd_set readsocks;
  3910.   fd_set writesocks;
  3911.   fd_set exceptsocks;
  3912.   struct timeval timeout;
  3913.   int number_of_sockets;
  3914.   int number_found;
  3915.   .
  3916.   .
  3917.   .
  3918.   /* set bits in read/write/except bit masks.  To set mask for a descriptor s use
  3919.   *   readsocks |= fd_set(s);
  3920.   *
  3921.   * set number of sockets to be checked
  3922.   * number_of_sockets = x;
  3923.   */
  3924.   .
  3925.   .
  3926.   .
  3927.   number_found = select(number_of_sockets,
  3928.                         &readsocks, &writesocks, &exceptsocks, &timeout);
  3929.  
  3930.  
  3931. ΓòÉΓòÉΓòÉ 7.15. send() ΓòÉΓòÉΓòÉ
  3932.  
  3933. The socket call sends data on a connected socket. 
  3934.  
  3935. Syntax 
  3936.  
  3937. #include <types.h>
  3938. #include <sys\socket.h>
  3939.  
  3940. int send(s, msg, len, flags)
  3941. int s;
  3942. char *msg;
  3943. int len;
  3944. int flags;
  3945.  
  3946. Parameters 
  3947.  
  3948.  s 
  3949.    Socket descriptor 
  3950.  
  3951.  msg 
  3952.    Pointer to a buffer containing the message to transmit 
  3953.  
  3954.  len 
  3955.    Length of the message pointed to by the msg parameter. 
  3956.  
  3957.  flags 
  3958.    Set by specifying one or more of the following flags. If you specify more 
  3959.    than one flag, use the logical OR operator (|) to separate them. Setting 
  3960.    this parameter is supported only for sockets in the Internet domain. 
  3961.  
  3962.    MSG_OOB             Sends out-of-band data on sockets that support 
  3963.                        SOCK_STREAM communication. 
  3964.  
  3965.    MSG_DONTROUTE       The SO_DONTROUTE option is turned on for the duration of 
  3966.                        the operation.  This is usually used only by diagnostic 
  3967.                        or routing programs. 
  3968.  
  3969.  Description 
  3970.  
  3971.  This call sends data on the socket with descriptor s. The send() call applies 
  3972.  to connected sockets. For information on how to use send() with datagram and 
  3973.  raw sockets, see "Datagram or raw sockets" in connect(). 
  3974.  
  3975.  If buffer space is not available at the socket to hold the message to be sent, 
  3976.  the send() call normally blocks, unless the socket is placed in nonblocking 
  3977.  mode. See ioctl() for a description of how to set nonblocking mode. Use the 
  3978.  select() call to determine when it is possible to send more data. 
  3979.  
  3980.  Return Values 
  3981.  
  3982.  If successful, the number of bytes of the socket with descriptor s that is 
  3983.  added to the send buffer is returned. This may be less than the number of 
  3984.  bytes specified in the length parameter. Successful completion does not imply 
  3985.  that the data has already been delivered to the receiver. The return value -1 
  3986.  indicates an error was detected on the sending side of the connection. You can 
  3987.  get the specific error code by calling sock_errno() or psock_errno(). 
  3988.  
  3989.  Error Code            Description 
  3990.  
  3991.  SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  3992.  
  3993.  SOCEFAULT             Using the msg and len parameters would result in an 
  3994.                        attempt to access memory outside the caller's address 
  3995.                        space. 
  3996.  
  3997.  SOCEINTR              Interrupted system call. 
  3998.  
  3999.  SOCEINVAL             Invalid argument. 
  4000.  
  4001.  SOCENOBUFS            No buffer space is available to send the message. 
  4002.  
  4003.  SOCEWOULDBLOCK        The s parameter is in nonblocking mode and the data 
  4004.                        cannot be sent without blocking, or the SO_SNDTIMEO 
  4005.                        option has been set for socket s and the timeout expired 
  4006.                        before any data was sent. 
  4007.  
  4008.  
  4009. ΓòÉΓòÉΓòÉ 7.16. sendmsg() ΓòÉΓòÉΓòÉ
  4010.  
  4011. The socket call sends data and control information on a specified socket. 
  4012.  
  4013. Syntax 
  4014.  
  4015. #include <types.h>
  4016. #include <sys\socket.h>
  4017.  
  4018. int sendmsg(s, msg, flags)
  4019. int s;
  4020. struct msghdr *msg;
  4021. int flags;
  4022.  
  4023. Parameters 
  4024.  
  4025.  s 
  4026.    Socket descriptor 
  4027.  
  4028.  msg 
  4029.    Pointer to a message header containing a message to be sent 
  4030.  
  4031.  flags 
  4032.    Set by specifying one or more of the following flags. If you specify more 
  4033.    than one flag, use the logical OR operator (|) to separate them. Setting 
  4034.    this parameter is supported only for sockets in the Internet domain. 
  4035.  
  4036.    MSG_OOB                Sends out-of-band data on the socket. 
  4037.  
  4038.    MSG_DONTROUTE          The SO_DONTROUTE option is turned on for the duration 
  4039.                           of the operation.  This is usually used only by 
  4040.                           diagnostic or routing programs. 
  4041.  
  4042.  Description 
  4043.  
  4044.  This call sends a msghdr structure on a socket with descriptor s. 
  4045.  
  4046.  Network Services supports the following the following msghdr structure. 
  4047.  
  4048.  Note:  The fields msg_accrights and msg_accrightslen are ignored for the 
  4049.  NetBIOS and Local IPC domains.  For the internet domain, these fields are not 
  4050.  supported, and you must set msg_accrights to NULL and msg_accrightslen to 0. 
  4051.  
  4052.     struct msghdr {
  4053.            caddr_t msg_name;             /* optional pointer to destination address buffer */
  4054.            int     msg_namelen;          /* size of address buffer */
  4055.            struct iovec  *msg_iovec;     /* scatter/gather array */
  4056.            int     msg_iovlen;           /* how many elements in msg_iov */
  4057.            caddr_t msg_accrights;        /* access rights sent/recvd */
  4058.            int     msg_accrightslen;     /* access rights information length */
  4059.     };
  4060.  
  4061.  The sendmsg() call applies to connection-oriented and connectionless sockets. 
  4062.  
  4063.  This call returns the length of the data sent. If the socket with descriptor s 
  4064.  is not ready for sending data, the sendmsg() call waits unless the socket is 
  4065.  in nonblocking mode. See ioctl() for a description of how to set nonblocking 
  4066.  mode. 
  4067.  
  4068.  Return Values 
  4069.  
  4070.  If successful, the number of bytes sent is returned.  Successful completion 
  4071.  does not guarantee delivery of the data to the receiver. The return value -1 
  4072.  indicates an error was detected on the sending side of the connection. You can 
  4073.  get the specific error code by calling sock_errno() or psock_errno(). 
  4074.  
  4075.  Error Code            Description 
  4076.  
  4077.  SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  4078.  
  4079.  SOCEFAULT             Using msg would result in an attempt to access memory 
  4080.                        outside the caller's address space. 
  4081.  
  4082.  SOCEINTR              Interrupted system call. 
  4083.  
  4084.  SOCEINVAL             msg_namelen is not the size of a valid address for the 
  4085.                        specified address family. 
  4086.  
  4087.  SOCEMSGSIZE           The message was too big to be sent as a single datagram. 
  4088.  
  4089.  SOCENOBUFS            No buffer space is available to send the message. 
  4090.  
  4091.  SOCENOTCONN           The socket is not connected. 
  4092.  
  4093.  SOCEWOULDBLOCK        The s parameter is in nonblocking mode and the data 
  4094.                        cannot be sent without blocking. 
  4095.  
  4096.  
  4097. ΓòÉΓòÉΓòÉ 7.17. sendto() ΓòÉΓòÉΓòÉ
  4098.  
  4099. The socket call sends data on a socket. 
  4100.  
  4101. Syntax 
  4102.  
  4103. #include <types.h>
  4104. #include <sys\socket.h>
  4105.  
  4106. int sendto(s, msg, len, flags, to, tolen)
  4107. int s;
  4108. char *msg;
  4109. int len;
  4110. int flags;
  4111. struct sockaddr *to;
  4112. int tolen;
  4113.  
  4114. Parameters 
  4115.  
  4116.  s 
  4117.    Socket descriptor 
  4118.  
  4119.  msg 
  4120.    Pointer to the buffer containing the message to transmit 
  4121.  
  4122.  len 
  4123.    Length of the message in the buffer pointed to by the msg parameter 
  4124.  
  4125.  flags 
  4126.    Set to 0 or one or more of the following flags. If you specify more than one 
  4127.    flag, use the logical OR operator (|) to separate them. Setting this 
  4128.    parameter is supported only for sockets in the Internet domain. 
  4129.  
  4130.    MSG_OOB                  Sends out-of-band data on the socket. 
  4131.  
  4132.    MSG_DONTROUTE            The SO_DONTROUTE option is turned on for the 
  4133.                             duration of the operation. This is usually used 
  4134.                             only by diagnostic or routing programs. 
  4135.  
  4136.  to 
  4137.    Pointer to a sockaddr structure (buffer) containing the destination address 
  4138.  
  4139.  tolen 
  4140.    Size in bytes of the buffer pointed to by the to parameter 
  4141.  
  4142.  Description 
  4143.  
  4144.  This call sends data on the socket with descriptor s. The sendto() call 
  4145.  applies to connected or unconnected sockets. For unconnected datagram and raw 
  4146.  sockets, the sendto() call sends data to the specified destination address. 
  4147.  For stream and sequenced packet sockets the destination address is ignored. 
  4148.  
  4149.  Datagram sockets are connected by calling connect().  This identifies the peer 
  4150.  to send/receive the datagram.  Once a datagram socket is connected to a peer, 
  4151.  you may still use the sendto() call but a destination address cannot be 
  4152.  included. 
  4153.  
  4154.  To change the peer address when using connected datagram sockets, issue a 
  4155.  connect() call with a null address.  Specifying a null address on a connected 
  4156.  datagram socket removes the peer address specification.  You can then either 
  4157.  issue a sendto() call specifying a different destination address or issue a 
  4158.  connect() call to connect to a different peer. For more information on 
  4159.  connecting datagram sockets and specifying null addresses, see "Datagram or 
  4160.  raw sockets" in connect(). 
  4161.  
  4162.  Return Values 
  4163.  
  4164.  If successful, the number of bytes sent is returned.  Successful completion 
  4165.  does not guarantee delivery of the data to the receiver. The return value -1 
  4166.  indicates an error was detected on the sending side. You can get the specific 
  4167.  error code by calling sock_errno() or psock_errno(). 
  4168.  
  4169.  Error Code              Description 
  4170.  
  4171.  SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  4172.  
  4173.  SOCEFAULT               Using the msg and len parameters would result in an 
  4174.                          attempt to access memory outside the caller's address 
  4175.                          space. 
  4176.  
  4177.  SOCEINVAL               The tolen parameter is not the size of a valid address 
  4178.                          for the specified address family. 
  4179.  
  4180.  SOCEMSGSIZE             The message was too big to be sent as a single 
  4181.                          datagram. 
  4182.  
  4183.  SOCENOBUFS              No buffer space is available to send the message. 
  4184.  
  4185.  SOCEWOULDBLOCK          The s parameter is in nonblocking mode and the data 
  4186.                          cannot be sent without blocking, or the SO_SNDTIMEO 
  4187.                          option has been set for socket s and the timeout 
  4188.                          expired before any data was sent. 
  4189.  
  4190.  SOCENOTCONN             The socket is not connected. 
  4191.  
  4192.  SOCEDESTADDRREQ         Destination address required. 
  4193.  
  4194.  
  4195. ΓòÉΓòÉΓòÉ 7.18. setsockopt() ΓòÉΓòÉΓòÉ
  4196.  
  4197. The socket call sets options associated with a socket. 
  4198.  
  4199. Syntax 
  4200.  
  4201. #include <types.h>
  4202. #include <sys\socket.h>
  4203.  
  4204. int setsockopt(s, level, optname, optval, optlen)
  4205. int s;
  4206. int level;
  4207. int optname;
  4208. char *optval;
  4209. int optlen;
  4210.  
  4211. Parameters 
  4212.  
  4213.  s 
  4214.    Socket descriptor 
  4215.  
  4216.  level 
  4217.    Specifies which option level is being set 
  4218.  
  4219.  optname 
  4220.    Name of a specified socket option 
  4221.  
  4222.  optval 
  4223.    Pointer to the option data 
  4224.  
  4225.  optlen 
  4226.    Length of the option data 
  4227.  
  4228.  Description 
  4229.  
  4230.  This call sets options associated with a socket such as enabling debugging at 
  4231.  the socket or protocol level, control timeouts, or permit socket data 
  4232.  broadcast. Options can exist at the socket or the protocol level; options are 
  4233.  always present at the highest socket level. When setting socket options, the 
  4234.  level of the option and the name of the option must be specified. The 
  4235.  following table lists the supported levels: 
  4236.  
  4237.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4238.   Γöé Table 13. Supported Levels            Γöé
  4239.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4240.   Γöé SUPPORTED LEVEL    Γöé #DEFINE IN        Γöé
  4241.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4242.   Γöé SOL_SOCKET      Γöé <SYS\SOCKET.H>      Γöé
  4243.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4244.   Γöé IPPROTO_IP      Γöé <NETINET\IN.H>      Γöé
  4245.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4246.   Γöé IPPROTO_TCP      Γöé <NETINET\IN.H>      Γöé
  4247.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4248.   Γöé NBPROTO_NB      Γöé <NETNB\NB.H>       Γöé
  4249.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4250.  
  4251.  The optval and optlen parameters are used to pass data used by the particular 
  4252.  set command. The optval parameter points to a buffer containing the data 
  4253.  needed by the set command. The optval parameter is optional and if data is not 
  4254.  needed by the command, can be set to the NULL pointer. The optlen parameter 
  4255.  must be set to the size of the data or data type pointed to by optval. For 
  4256.  socket options that are toggles, the option is enabled if optval is nonzero 
  4257.  and disabled if optval is 0. 
  4258.  
  4259.  The following tables list the supported options for setsockopt() at each level 
  4260.  (SOL_SOCKET, IPPROTO_IP, IPPROTO_TCP). Detailed descriptions of the options 
  4261.  follow each table. 
  4262.  
  4263.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4264.   Γöé Table 14. Supported setsockopt() Socket Options for SOL_SOCKET                            Γöé
  4265.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4266.   Γöé          Γöé              Γöé                Γöé           Γöé BOOLEAN/      Γöé
  4267.   Γöé OPTION NAME    Γöé DESCRIPTION        Γöé      DOMAINS(*)      Γöé DATA TYPE      Γöé VALUE       Γöé
  4268.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4269.   Γöé SO_BROADCAST   Γöé allows sending of broad-  Γöé I    Γöé     Γöé N     Γöé int         Γöé boolean      Γöé
  4270.   Γöé          Γöé cast messages       Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  4271.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4272.   Γöé SO_DEBUG     Γöé turn on recording of    Γöé I    Γöé L    Γöé      Γöé int         Γöé boolean      Γöé
  4273.   Γöé          Γöé debugging information   Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  4274.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4275.   Γöé SO_DONTROUTE   Γöé bypass routing tables   Γöé I    Γöé     Γöé      Γöé int         Γöé boolean      Γöé
  4276.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4277.   Γöé SO_KEEPALIVE   Γöé keep connections alive   Γöé I    Γöé     Γöé      Γöé int         Γöé boolean      Γöé
  4278.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4279.   Γöé SO_LINGER     Γöé linger on close if data  Γöé I    Γöé     Γöé      Γöé struct linger    Γöé value       Γöé
  4280.   Γöé          Γöé present          Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  4281.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4282.   Γöé SO_OOBINLINE   Γöé leave received OOB data  Γöé I    Γöé     Γöé      Γöé int         Γöé boolean      Γöé
  4283.   Γöé          Γöé in-line          Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  4284.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4285.   Γöé SO_RCVBUF     Γöé receive buffer size    Γöé I    Γöé L    Γöé N     Γöé long        Γöé value       Γöé
  4286.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4287.   Γöé SO_RCVLOWAT    Γöé receive low-water mark   Γöé I    Γöé L    Γöé      Γöé int         Γöé value       Γöé
  4288.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4289.   Γöé SO_REUSEADDR   Γöé allow local address reuse Γöé I    Γöé     Γöé N     Γöé int         Γöé boolean      Γöé
  4290.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4291.   Γöé SO_SNDBUF     Γöé send buffer size      Γöé I    Γöé L    Γöé N     Γöé long        Γöé value       Γöé
  4292.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4293.   Γöé SO_SNDLOWAT    Γöé send low-water mark    Γöé I    Γöé L    Γöé      Γöé int         Γöé value       Γöé
  4294.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4295.   Γöé SO_USELOOPBACK  Γöé bypass hardware when pos- Γöé I    Γöé     Γöé      Γöé int         Γöé value       Γöé
  4296.   Γöé          Γöé sible           Γöé     Γöé     Γöé      Γöé           Γöé          Γöé
  4297.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4298.   Γöé NOTE:  (*) This column specifies I for Internet, L for Local IPC, and N for NetBIOS communication domains.      Γöé
  4299.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4300.  
  4301.  The following options are recognized for SOL_SOCKET: 
  4302.  
  4303.  Option                 Description 
  4304.  
  4305.  SO_BROADCAST           (datagram sockets only) Sets the ability to broadcast 
  4306.                         messages. If this option is enabled, it allows the 
  4307.                         application to send broadcast messages over s, if the 
  4308.                         interface specified in the destination supports 
  4309.                         broadcasting of packets. 
  4310.  
  4311.  SO_DEBUG               Sets the ability to record debug information for a 
  4312.                         socket. 
  4313.  
  4314.  SO_DONTROUTE           Sets the ability for the socket to bypass the routing 
  4315.                         of outgoing messages. When this option is enabled, it 
  4316.                         causes outgoing messages to bypass the standard routing 
  4317.                         algorithm and be directed to the appropriate network 
  4318.                         interface according to the network portion of the 
  4319.                         destination address. When enabled, packets can be sent 
  4320.                         only to directly connected networks (networks for which 
  4321.                         this host has an interface). 
  4322.  
  4323.  SO_KEEPALIVE           (stream sockets only) Sets the ability of the socket to 
  4324.                         send keepalive packets that will keep the connection 
  4325.                         alive. TCP uses a timer called the keepalive timer. 
  4326.                         This timer is used to monitor idle connections that 
  4327.                         might have been disconnected because of a peer crash or 
  4328.                         timeout. If this option is set on, a keepalive packet 
  4329.                         is periodically sent to the peer. This is mainly used 
  4330.                         to allow servers to close connections that are no 
  4331.                         longer active as a result of clients going away without 
  4332.                         properly closing connections. 
  4333.  
  4334.  SO_LINGER              (stream sockets only) Sets the ability of the socket to 
  4335.                         linger on close if data is present. When this option is 
  4336.                         enabled and there is unsent data present when soclose() 
  4337.                         is called, the calling application is blocked during 
  4338.                         the soclose() call until the data is transmitted or the 
  4339.                         connection has timed out. If this option is disabled, 
  4340.                         the soclose() call returns without blocking the caller, 
  4341.                         and TCP waits to try to send the data. Although the 
  4342.                         data transfer is usually successful, it cannot be 
  4343.                         guaranteed, because TCP waits only a finite amount of 
  4344.                         time trying to send the data. 
  4345.  
  4346.  SO_OOBINLINE           (stream sockets only) Sets the ability of the socket to 
  4347.                         receive out-of-band data. As stated in TCP/IP 
  4348.                         Illustrated, Volume 1: The Protocols out-of-band data 
  4349.                         is "a logically separate data path using the same 
  4350.                         connection as the normal data path." 
  4351.  
  4352.                         When this option is enabled, it causes out-of-band data 
  4353.                         to be placed in the normal data input queue as it is 
  4354.                         received, making it available to recv(), and 
  4355.                         recvfrom(), without having to specify the MSG_OOB flag 
  4356.                         in those calls. When this option is disabled, it causes 
  4357.                         out-of-band data to be placed in the priority data 
  4358.                         input queue as it is received, making it available to 
  4359.                         recv(), and recvfrom(), only by specifying the MSG_OOB 
  4360.                         flag in those calls. 
  4361.  
  4362.  SO_RCVBUF              Sets buffer size for input. This option sets the size 
  4363.                         of the receive buffer to the value contained in the 
  4364.                         buffer pointed to by optval. This allows the buffer 
  4365.                         size to be tailored for specific application needs, 
  4366.                         such as increasing the buffer size for high-volume 
  4367.                         connections. 
  4368.  
  4369.  SO_RCVLOWAT            Sets receive low-water mark. 
  4370.  
  4371.  SO_REUSEADDR           (stream and datagram sockets only) Sets the ability of 
  4372.                         a socket to reuse a local address. When enabled, this 
  4373.                         option allows local addresses that are already in use 
  4374.                         to be bound. This alters the normal algorithm used in 
  4375.                         the bind() call. The system checks at connect time to 
  4376.                         be sure that no local address and port have the same 
  4377.                         foreign address and port. The error SOCEADDRINUSE is 
  4378.                         returned if the association already exists. 
  4379.  
  4380.  SO_SNDBUF              Sets buffer size for output. This option sets the size 
  4381.                         of the send buffer to the value contained in the buffer 
  4382.                         pointed to by optval.  This allows the send buffer size 
  4383.                         to be tailored for specific application needs, such as 
  4384.                         increasing the buffer size for high-volume connections. 
  4385.  
  4386.  SO_SNDLOWAT            Sets send low-water mark. 
  4387.  
  4388.  SO_USELOOPBACK         Bypasses hardware when possible. 
  4389.  
  4390.  struct linger: For the SO_LINGER option, optval points to a linger structure. 
  4391.  This structure is defined in <SYS\SOCKET.H> and contains the following fields: 
  4392.  
  4393.  Field          Description 
  4394.  l_onoff        Option on/off 
  4395.  l_linger       Linger time 
  4396.  
  4397.  The l_onoff field is set to zero if the SO_LINGER option is being disabled. A 
  4398.  nonzero value enables the option. 
  4399.  
  4400.  The l_linger field specifies the amount of time in seconds to linger on close. 
  4401.  A value of zero will cause so_close() to wait until the disconnect completes. 
  4402.  
  4403.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4404.   Γöé Table 15. Supported setsockopt() Socket Options for IPPROTO_TCP                            Γöé
  4405.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4406.   Γöé            Γöé                 Γöé                   Γöé BOOLEAN/        Γöé
  4407.   Γöé OPTION NAME      Γöé DESCRIPTION           Γöé DATA TYPE              Γöé VALUE          Γöé
  4408.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4409.   Γöé TCP_NODELAY      Γöé don't delay send to coalesce  Γöé int                 Γöé boolean         Γöé
  4410.   Γöé            Γöé packets             Γöé                   Γöé             Γöé
  4411.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4412.  
  4413.  The following options are recognized for IPPROTO_TCP: 
  4414.  
  4415.  Option                 Description 
  4416.  
  4417.  TCP_NODELAY            (stream sockets only) Setting on disables the buffering 
  4418.                         algorithm so that the client's TCP sends small packets 
  4419.                         as soon as possible.  This often has no performance 
  4420.                         effects on LANs, but can degrade performance on Wide 
  4421.                         Area Networks (WAN). 
  4422.  
  4423.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4424.   Γöé Table 16. Supported setsockopt() Socket Options for NBPROTO_NB                            Γöé
  4425.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4426.   Γöé            Γöé                 Γöé                   Γöé BOOLEAN/        Γöé
  4427.   Γöé OPTION NAME      Γöé DESCRIPTION           Γöé DATA TYPE              Γöé VALUE          Γöé
  4428.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4429.   Γöé NB_DGRAM_TYPE     Γöé type of datagrams to receive  Γöé int                 Γöé value          Γöé
  4430.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4431.  
  4432.  The following option is recognized for NBPROTO_NB: 
  4433.  
  4434.  Option                 Description 
  4435.  
  4436.  NB_DGRAM_TYPE          (datagram sockets only) Sets type of datagrams to be 
  4437.                         received on the socket.  The possible values are: 
  4438.  
  4439.                         NB_DGRAM               The socket is to receive normal 
  4440.                                                (unicast) datagrams only. 
  4441.                         NB_BROADCAST           The socket is to receive 
  4442.                                                broadcast datagrams only. 
  4443.                         NB_DGRAM_ANY           The socket can receive both 
  4444.                                                normal or broadcast datagrams. 
  4445.                         This option can be changed at any time. 
  4446.  
  4447.  Return Values 
  4448.  
  4449.  The value 0 indicates success; the value -1 indicates an error. You can get 
  4450.  the specific error code by calling sock_errno() or psock_errno(). 
  4451.  
  4452.  sock_errno() Value       Description 
  4453.  
  4454.  SOCEADDRINUSE            The address is already in use. 
  4455.  
  4456.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  4457.  
  4458.  SOCEFAULT                Using optval and optlen parameters would result in an 
  4459.                           attempt to access memory outside the caller's address 
  4460.                           space. 
  4461.  
  4462.  SOCENOPROTOOPT           The optname parameter is unrecognized. 
  4463.  
  4464.  SOCEINVAL                Invalid argument. 
  4465.  
  4466.  SOCENOBUFS               No buffer space is available. 
  4467.  
  4468.  Examples 
  4469.  
  4470.  The following are examples of the setsockopt() call. See getsockopt() for 
  4471.  examples of how the options are queried. 
  4472.  
  4473.   int rc;
  4474.   int s;
  4475.   int optval;
  4476.   struct linger lstruct;
  4477.   /* extracted from sys/socket.h */
  4478.   int setsockopt(int s, int level, int optname, char *optval, int optlen);
  4479.   .
  4480.   .
  4481.   .
  4482.   /* I want out of band data in the normal input queue */
  4483.   optval = 1;
  4484.   rc = setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *) &optval, sizeof(int));
  4485.  
  4486.   .
  4487.   .
  4488.   .
  4489.   /* I want to linger on close */
  4490.   lstruct.l_onoff  = 1;
  4491.   lstruct.l_linger = 100;
  4492.   rc = setsockopt(s, SOL_SOCKET, SO_LINGER, (char *) &lstruct, sizeof(lstruct));
  4493.  
  4494.  
  4495. ΓòÉΓòÉΓòÉ 7.19. shutdown() ΓòÉΓòÉΓòÉ
  4496.  
  4497. The socket call shuts down all or part of a full duplex connection. 
  4498.  
  4499. Syntax 
  4500.  
  4501. int shutdown(s, howto)
  4502. int s;
  4503. int howto;
  4504.  
  4505. Parameters 
  4506.  
  4507.  s 
  4508.    Socket descriptor 
  4509.  
  4510.  howto 
  4511.    Condition of the shutdown 
  4512.  
  4513.  Description 
  4514.  
  4515.  This call shuts down all or part of a full duplex connection. Since data flows 
  4516.  in one direction are independent of data flowing from the other direction, the 
  4517.  shutdown call allows you to independently stop data flow in either direction 
  4518.  or all data flows with one API call. For example, you may want to stop the 
  4519.  sender(s) from sending data to you, but you still want to send data. 
  4520.  
  4521.  Using the shutdown() call is optional. 
  4522.  
  4523.  The howto parameter sets the condition for shutting down the connection to 
  4524.  socket s. It can be set to one of the following: 
  4525.  
  4526.      0 - no more data can be received on socket s. 
  4527.      1 - no more data can be sent on socket s. 
  4528.      2 - no more data can be sent or received on socket s. 
  4529.  
  4530.  Note:  In the NetBIOS domain, the shutdown() call is valid, but the function 
  4531.  of shutdown() is not implemented.  When called, shutdown() will return a 
  4532.  successful return code, but no shutdown occurs. 
  4533.  
  4534.  Return Values 
  4535.  
  4536.  The value 0 indicates success; the value -1 indicates an error. You can get 
  4537.  the specific error code by calling sock_errno() or psock_errno(). 
  4538.  
  4539.  Error Code         Description 
  4540.  
  4541.  SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  4542.  
  4543.  SOCEINVAL          The howto parameter was not set to one of the valid values. 
  4544.  
  4545.  
  4546. ΓòÉΓòÉΓòÉ 7.20. so_cancel() ΓòÉΓòÉΓòÉ
  4547.  
  4548. The socket call cancels a pending blocking sockets API call on a socket. 
  4549.  
  4550. Syntax 
  4551.  
  4552. #include <types.h>
  4553. #include <sys\socket.h>
  4554. int so_cancel (s)
  4555. int s;
  4556.  
  4557. Parameters 
  4558.  
  4559.  s 
  4560.    Socket descriptor 
  4561.  
  4562.  Description 
  4563.  
  4564.  This call sends an interrupt signal to a socket with the socket descriptor s. 
  4565.  If there is any thread blocking on a sockets API (for example, select()) on 
  4566.  the same descriptors, that sockets API returns an SOCEINTR (interrupted system 
  4567.  call) socket error code and a return value of -1. 
  4568.  
  4569.  The so_cancel call is used in multithreaded applications where one thread 
  4570.  needs to 'wake up' another thread which is blocked in a sockets API call. 
  4571.  
  4572.  Return Values 
  4573.  
  4574.  The value 0 indicates success; the value -1 indicates an error. You can get 
  4575.  the specific error code by calling sock_errno() or psock_errno(). 
  4576.  
  4577.  Error Code         Description 
  4578.  
  4579.  SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  4580.  
  4581.  
  4582. ΓòÉΓòÉΓòÉ 7.21. sock_errno() ΓòÉΓòÉΓòÉ
  4583.  
  4584. The socket call returns error code set by a socket call. 
  4585.  
  4586. Syntax 
  4587.  
  4588. #include <nerrno.h>
  4589.  
  4590.  
  4591. int sock_errno()
  4592.  
  4593. Description 
  4594.  
  4595. The sock_errno() call returns the last error code set by a socket call. 
  4596.  
  4597. Return Values 
  4598.  
  4599. The value 0 indicates success; the value 1 indicates an error. 
  4600.  
  4601.  
  4602. ΓòÉΓòÉΓòÉ 7.22. socket() ΓòÉΓòÉΓòÉ
  4603.  
  4604. The socket call creates an endpoint for communication and returns a socket 
  4605. descriptor representing the endpoint. 
  4606.  
  4607. Syntax 
  4608.  
  4609. #include <types.h>
  4610. #include <sys\socket.h>
  4611.  
  4612. int socket(domain, type, protocol)
  4613. int domain;
  4614. int type;
  4615. int protocol;
  4616.  
  4617. Parameters 
  4618.  
  4619.  domain 
  4620.    Communication domain requested 
  4621.  
  4622.  type 
  4623.    Type of socket created 
  4624.  
  4625.  protocol 
  4626.    Protocol requested 
  4627.  
  4628.  Description 
  4629.  
  4630.  This call creates an endpoint for communication and returns a socket 
  4631.  descriptor representing the endpoint. Each socket type provides a different 
  4632.  communication service. 
  4633.  
  4634.  Sockets are deallocated with the soclose() call. 
  4635.  
  4636.  The domain parameter specifies a communications domain where communication is 
  4637.  to take place. This parameter specifies the protocol family which is used. 
  4638.  
  4639.  Protocol Family          Description 
  4640.  
  4641.  PF_OS2 or PF_UNIX        Use addresses in the Local IPC format which take the 
  4642.                           form of OS/2 Warp Connect file and path names. 
  4643.  
  4644.  PF_INET                  Use addresses in the Internet address format. 
  4645.  
  4646.  PF_NETBIOS or PF_NB      Use addresses in the NetBIOS address format. 
  4647.  
  4648.  The type parameter specifies the type of socket created. The type is analogous 
  4649.  with the semantics of the communication requested.  These socket type 
  4650.  constants are defined in the <SYS\SOCKET.H> header file. Refer to Socket Types 
  4651.  for additional details. The types supported are: 
  4652.  
  4653.  Type                Description 
  4654.  
  4655.  SOCK_STREAM         Provides sequenced, two-way byte streams that are reliable 
  4656.                      and connection-oriented. It supports a mechanism for 
  4657.                      out-of-band data. 
  4658.  
  4659.                      Stream sockets are supported by the Internet (PF_INET) 
  4660.                      communication domain and Local IPC (PF_OS2, PF_UNIX, or 
  4661.                      PF_LOCAL). 
  4662.  
  4663.  SOCK_DGRAM          Provides datagrams, which are connectionless messages of a 
  4664.                      fixed length whose reliability is not guaranteed. 
  4665.                      Datagrams can be received out of order, lost, or delivered 
  4666.                      multiple times. 
  4667.  
  4668.                      Datagram sockets are supported by the Internet (PF_INET), 
  4669.                      Local IPC (PF_OS2, PF_UNIX, or PF_LOCAL), and NetBIOS 
  4670.                      (PF_NETBIOS or PF_NB) communication domains. 
  4671.  
  4672.  SOCK_RAW            Provides the interface to internal protocols (such as IP 
  4673.                      and ICMP).  Raw sockets are supported by the Internet 
  4674.                      (PF_INET) communication domain. 
  4675.  
  4676.  SOCK_SEQPACKET      Provides sequenced byte streams that are reliable and 
  4677.                      connection-oriented.  Data is sent without error or 
  4678.                      duplication and is received in the same order as it was 
  4679.                      sent. Sequenced packet sockets are supported by the 
  4680.                      NetBIOS (PF_NETBIOS or PF_NB) communication domain. 
  4681.  
  4682.  The protocol parameter specifies a particular protocol to be used with the 
  4683.  socket. If the protocol field is set to 0 (default), the system selects the 
  4684.  default protocol number for the domain and socket type requested. Default and 
  4685.  valid protocol number-protocol family combinations are in the Socket Protocol 
  4686.  Families and Supported Communication Domains section. The getprotobyname() 
  4687.  call can be used to get the protocol number for a protocol with a well-known 
  4688.  name. 
  4689.  
  4690.  Return Values 
  4691.  
  4692.  A non-negative socket descriptor return value indicates success. The return 
  4693.  value -1 indicates an error. You can get the specific error code by calling 
  4694.  sock_errno() or psock_errno(). 
  4695.  
  4696.  sock_errno() Value              Description 
  4697.  
  4698.  SOCEMFILE                       The maximum number of sockets are currently in 
  4699.                                  use. 
  4700.  
  4701.  SOCEPROTONOSUPPORT              The protocol is not supported in the specified 
  4702.                                  domain or the protocol is not supported for 
  4703.                                  the specified socket type. 
  4704.  
  4705.  SOCEPROTOTYPE                   The protocol is the wrong type for the socket. 
  4706.  
  4707.  Examples 
  4708.  
  4709.  The following are examples of the socket() call. 
  4710.  
  4711.   int s;
  4712.   struct protoent *p;
  4713.   struct protoent *getprotobyname(char *name);
  4714.   int socket(int domain, int type, int protocol); /* extracted from sys/socket.h */
  4715.   .
  4716.   .
  4717.   .
  4718.   /* Get stream socket in Internet domain with default protocol */
  4719.   s = socket(PF_INET, SOCK_STREAM, 0);
  4720.   .
  4721.   .
  4722.   .
  4723.   /* Get raw socket in Internet domain for ICMP protocol */
  4724.   p = getprotobyname("icmp");
  4725.   s = socket(PF_INET, SOCK_RAW, p->p_proto);
  4726.  
  4727.  
  4728. ΓòÉΓòÉΓòÉ 7.23. soclose() ΓòÉΓòÉΓòÉ
  4729.  
  4730. The socket call shuts down a socket and frees resources allocated to the 
  4731. socket. 
  4732.  
  4733. Syntax 
  4734.  
  4735. #include <types.h>
  4736. #include <sys\socket.h>
  4737.  
  4738. int soclose(s)
  4739. int s;
  4740.  
  4741. Parameters 
  4742.  
  4743.  s 
  4744.    Socket descriptor 
  4745.  
  4746.  Description 
  4747.  
  4748.  This call shuts down the socket associated with the socket descriptor s, and 
  4749.  frees resources allocated to the socket.  If s refers to a connected socket, 
  4750.  the connection is closed. 
  4751.  
  4752.  If the SO_LINGER socket option is enabled (see setsockopt() for additional 
  4753.  information), then the task will try to send any queued data. If the SO_LINGER 
  4754.  socket option is disabled, then the task will flush any data queued to be 
  4755.  sent. 
  4756.  
  4757.  Return Values 
  4758.  
  4759.  The value 0 indicates success; the value -1 indicates an error. You can get 
  4760.  the specific error code by calling sock_errno() or psock_errno(). 
  4761.  
  4762.  Error Code         Description 
  4763.  
  4764.  SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  4765.  
  4766.  SOCEALREADY        The socket s is marked nonblocking, and a previous 
  4767.                     connection attempt has not completed. 
  4768.  
  4769.  
  4770. ΓòÉΓòÉΓòÉ 7.24. writev() ΓòÉΓòÉΓòÉ
  4771.  
  4772. The socket call writes data from a set of specified buffers on a socket. 
  4773.  
  4774. Syntax 
  4775.  
  4776. #include <types.h>
  4777. #include <sys\socket.h>
  4778.  
  4779. int writev(s, iov, iovcnt)
  4780. int s;
  4781. struc iovec *iov;
  4782. int iovcnt;
  4783.  
  4784. Parameters 
  4785.  
  4786.  s 
  4787.    Socket descriptor 
  4788.  
  4789.  iov 
  4790.    Pointer to an array of iovec structures 
  4791.  
  4792.  iovcnt 
  4793.    Number of iovec structures pointed to by the iov parameter. The maximum 
  4794.    number of iovec structures is 32. 
  4795.  
  4796.  Description 
  4797.  
  4798.  This call writes data on a socket with descriptor s. The data is gathered from 
  4799.  the buffers specified by iov[0]...iov[iovcnt-1]. The iovec structure is 
  4800.  defined in <SYS\SOCKET.H> and contains the following fields: 
  4801.  
  4802.  Field          Description 
  4803.  iov_base       Pointer to the buffer 
  4804.  iov_len        Length of the buffer 
  4805.  
  4806.  This call writes iov_len bytes of data. If there is not enough available 
  4807.  buffer space to hold the socket data to be transmitted and the socket is in 
  4808.  blocking mode, writev() blocks the caller until additional buffer space 
  4809.  becomes available. If the socket is in a nonblocking mode, writev() returns -1 
  4810.  and sets return code to SOCEWOULDBLOCK. See ioctl() for a description of how 
  4811.  to set nonblocking mode. 
  4812.  
  4813.  For datagram sockets, this call sends the entire datagram, provided the 
  4814.  datagram fits into the protocol buffers.  Stream sockets act like streams of 
  4815.  information with no boundaries separating data.  For example, if an 
  4816.  application sends 1000 bytes, each call to this function can send 1 byte, 10 
  4817.  bytes, or the entire 1000 bytes. For a stream socket, an application can place 
  4818.  this call in a loop, calling this function until all data has been sent. 
  4819.  
  4820.  Return Values 
  4821.  
  4822.  If successful, the number of bytes written is returned.  Successful completion 
  4823.  does not guarantee the data is written. The return value -1 indicates an error 
  4824.  was detected on the sending side of the connection. You can get the specific 
  4825.  error code by calling sock_errno() or psock_errno(). 
  4826.  
  4827.  sock_errno() Value       Description 
  4828.  
  4829.  SOCENOTSOCK              s is not a valid socket descriptor. 
  4830.  
  4831.  SOCEFAULT                Using the iov and iovcnt parameters would result in 
  4832.                           an attempt to access memory outside the caller's 
  4833.                           address space. 
  4834.  
  4835.  SOCEINTR                 Interrupted system call. 
  4836.  
  4837.  SOCEINVAL                Invalid argument. 
  4838.  
  4839.  SOCENOBUFS               Buffer space is not available to send the message. 
  4840.  
  4841.  SOCEWOULDBLOCK           The s parameter is in nonblocking mode and the data 
  4842.                           cannot be written without blocking, or the 
  4843.                           SO_SNDTIMEO option has been set for socket s and the 
  4844.                           timeout expired before any data was sent. 
  4845.  
  4846.  SOCEMSGSIZE              The message was too big to be sent as a single 
  4847.                           datagram. 
  4848.  
  4849.  SOCEDESTADDRREQ          A destination address is required. 
  4850.  
  4851.  
  4852. ΓòÉΓòÉΓòÉ 8. TCP/IP Network Utility Routines ΓòÉΓòÉΓòÉ
  4853.  
  4854. The following table briefly describes each sockets utility function call 
  4855. supported by Network Services and identifies where you can find the syntax, 
  4856. parameters, and other appropriate information. The following network utility 
  4857. calls described in this section can be used to access services only for the 
  4858. Internet communication domain: 
  4859.  
  4860. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4861. Γöé Table 17. TCP/IP Network Utility Routines Quick Reference                               Γöé
  4862. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4863. Γöé SOCKET CALL     Γöé DESCRIPTION                   Γöé LOCATION                    Γöé
  4864. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4865. Γöé bswap()       Γöé Swaps bytes in a short integer         Γöé bswap()                     Γöé
  4866. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4867. Γöé dn_comp()      Γöé Compresses the expanded domain name       Γöé dn_comp()                    Γöé
  4868. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4869. Γöé dn_expand()     Γöé Expands a compressed domain name to a full   Γöé dn_expand()                   Γöé
  4870. Γöé           Γöé domain name                   Γöé                         Γöé
  4871. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4872. Γöé endhostent()    Γöé Closes the HOSTS file              Γöé endhostent()                  Γöé
  4873. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4874. Γöé endnetent()     Γöé Closes the NETWORKS file            Γöé endnetent()                   Γöé
  4875. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4876. Γöé endprotent()    Γöé Closes the PROTOCOL file            Γöé endprotoent()                  Γöé
  4877. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4878. Γöé endservent()    Γöé Closes the SERVICES file            Γöé endservent()                  Γöé
  4879. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4880. Γöé gethostbyaddr()   Γöé Returns a pointer to information about a host  Γöé gethostbyaddr()                 Γöé
  4881. Γöé           Γöé specified by an Internet address        Γöé                         Γöé
  4882. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4883. Γöé gethostbyname()   Γöé Returns a pointer to information about a host  Γöé gethostbyname()                 Γöé
  4884. Γöé           Γöé specified by a host name            Γöé                         Γöé
  4885. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4886. Γöé gethostent()    Γöé Returns a pointer to the next entry in the   Γöé gethostent()                  Γöé
  4887. Γöé           Γöé HOSTS file                   Γöé                         Γöé
  4888. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4889. Γöé gethostid()     Γöé Returns the unique identifier of the current  Γöé gethostid()                   Γöé
  4890. Γöé           Γöé host                      Γöé                         Γöé
  4891. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4892. Γöé gethostname()    Γöé Gets the standard host name for the local host Γöé gethostname()                  Γöé
  4893. Γöé           Γöé machine                     Γöé                         Γöé
  4894. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4895. Γöé getnetbyaddr()   Γöé Returns a pointer to the NETWORKS file entry  Γöé getnetbyaddr()                 Γöé
  4896. Γöé           Γöé that contains the specified network address   Γöé                         Γöé
  4897. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4898. Γöé getnetbyname()   Γöé Returns a pointer to the NETWORKS file entry  Γöé getnetbyname()                 Γöé
  4899. Γöé           Γöé that contains the specified network name    Γöé                         Γöé
  4900. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4901. Γöé getnetent()     Γöé Returns a pointer to the next entry in the   Γöé getnetent()                   Γöé
  4902. Γöé           Γöé NETWORKS file                  Γöé                         Γöé
  4903. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4904. Γöé getprotobyname()  Γöé Returns a pointer to the PROTOCOL file entry  Γöé getprotobyname()                Γöé
  4905. Γöé           Γöé specified by a protocol name          Γöé                         Γöé
  4906. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4907. Γöé getprotobynumber() Γöé Returns a pointer to the PROTOCOL file entry  Γöé getprotobynumber()               Γöé
  4908. Γöé           Γöé specified by a protocol number         Γöé                         Γöé
  4909. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4910. Γöé getprotoent()    Γöé Returns a pointer to the next entry in the   Γöé getprotoent()                  Γöé
  4911. Γöé           Γöé PROTOCOL file                  Γöé                         Γöé
  4912. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4913. Γöé getservbyname()   Γöé Returns a pointer to the SERVICES file entry  Γöé getservbyname()                 Γöé
  4914. Γöé           Γöé specified by a service name           Γöé                         Γöé
  4915. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4916. Γöé getservbyport()   Γöé Returns a pointer to the SERVICES file entry  Γöé getservbyport()                 Γöé
  4917. Γöé           Γöé specified by a port number           Γöé                         Γöé
  4918. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4919. Γöé getservent()    Γöé Returns a pointer to the next entry in the   Γöé getservent()                  Γöé
  4920. Γöé           Γöé SERVICES file                  Γöé                         Γöé
  4921. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4922. Γöé htonl()       Γöé Translates byte order from host to network for Γöé htonl()                     Γöé
  4923. Γöé           Γöé a long integer                 Γöé                         Γöé
  4924. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4925. Γöé htons()       Γöé Translates byte order from host to network for Γöé htons()                     Γöé
  4926. Γöé           Γöé a short integer                 Γöé                         Γöé
  4927. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4928. Γöé inet_addr()     Γöé Constructs an Internet address from character  Γöé inet_addr()                   Γöé
  4929. Γöé           Γöé strings representing numbers expressed in    Γöé                         Γöé
  4930. Γöé           Γöé standard dotted-decimal notation        Γöé                         Γöé
  4931. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4932. Γöé inet_lnaof()    Γöé Returns the local network portion of an     Γöé inet_lnaof()                  Γöé
  4933. Γöé           Γöé Internet address                Γöé                         Γöé
  4934. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4935. Γöé inet_makeaddr()   Γöé Constructs an Internet address from a network  Γöé inet_makeaddr()                 Γöé
  4936. Γöé           Γöé number and a local address           Γöé                         Γöé
  4937. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4938. Γöé inet_netof()    Γöé Returns the network portion of the Internet   Γöé inet_netof()                  Γöé
  4939. Γöé           Γöé address in network-byte order          Γöé                         Γöé
  4940. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4941. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4942. Γöé Table 17. TCP/IP Network Utility Routines Quick Reference                               Γöé
  4943. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4944. Γöé SOCKET CALL     Γöé DESCRIPTION                   Γöé LOCATION                    Γöé
  4945. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4946. Γöé inet_network()   Γöé Constructs a network number from character   Γöé inet_network()                 Γöé
  4947. Γöé           Γöé strings representing numbers expressed in    Γöé                         Γöé
  4948. Γöé           Γöé standard dotted-decimal notation        Γöé                         Γöé
  4949. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4950. Γöé inet_ntoa()     Γöé Returns a pointer to a string in dotted-    Γöé inet_ntoa()                   Γöé
  4951. Γöé           Γöé decimal notation                Γöé                         Γöé
  4952. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4953. Γöé lswap()       Γöé Swaps bytes in a long integer          Γöé lswap()                     Γöé
  4954. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4955. Γöé ntohl()       Γöé Translates byte order from network to host for Γöé ntohl()                     Γöé
  4956. Γöé           Γöé a long integer                 Γöé                         Γöé
  4957. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4958. Γöé ntohs()       Γöé Translates byte order from network to host for Γöé ntohs()                     Γöé
  4959. Γöé           Γöé a short integer                 Γöé                         Γöé
  4960. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4961. Γöé res_init()     Γöé Reads the RESOLV file for the default domain  Γöé res_init()                   Γöé
  4962. Γöé           Γöé name                      Γöé                         Γöé
  4963. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4964. Γöé res_mkquery()    Γöé Makes query message for the name servers in   Γöé res_mkquery()                  Γöé
  4965. Γöé           Γöé the Internet domain               Γöé                         Γöé
  4966. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4967. Γöé res_send()     Γöé Sends query to a local name server       Γöé res_send()                   Γöé
  4968. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4969. Γöé sethostent()    Γöé Opens and rewinds the HOSTS file        Γöé sethostent()                  Γöé
  4970. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4971. Γöé setnetent()     Γöé Opens and rewinds the NETWORKS file       Γöé setnetent()                   Γöé
  4972. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4973. Γöé setprotoent()    Γöé Opens and rewinds the PROTOCOL file       Γöé setprotoent()                  Γöé
  4974. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4975. Γöé setservent()    Γöé Opens and rewinds the SERVICES file       Γöé setservent()                  Γöé
  4976. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4977.  
  4978.  
  4979. ΓòÉΓòÉΓòÉ 8.1. bswap() ΓòÉΓòÉΓòÉ
  4980.  
  4981. The socket call swaps bytes in a short integer. 
  4982.  
  4983. Syntax 
  4984.  
  4985. #include <types.h>
  4986. #include <utils.h>
  4987.  
  4988. u_short bswap(a)
  4989. u_short a;
  4990.  
  4991. Parameters 
  4992.  
  4993.  a 
  4994.    Unsigned short integer whose bytes are to be swapped 
  4995.  
  4996.  Description 
  4997.  
  4998.  This call swaps bytes in a short integer. 
  4999.  
  5000.  Return Values 
  5001.  
  5002.  Returns the translated short integer. 
  5003.  
  5004.  
  5005. ΓòÉΓòÉΓòÉ 8.2. dn_comp() ΓòÉΓòÉΓòÉ
  5006.  
  5007. The socket call compresses the expanded domain name. 
  5008.  
  5009. Syntax 
  5010.  
  5011. #include <types.h>
  5012. #include <netinet\in.h>
  5013. #include <arpa\nameser.h>
  5014. #include <resolv.h>
  5015.  
  5016. int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
  5017. u_char *exp_dn;
  5018. u_char *comp_dn;
  5019. int length;
  5020. u_char **dnptrs;
  5021. u_char **lastdnptr;
  5022.  
  5023. Parameters 
  5024.  
  5025.  exp_dn 
  5026.    Pointer to the location of an expanded domain name 
  5027.  
  5028.  comp_dn 
  5029.    Pointer to an array containing the compressed domain name 
  5030.  
  5031.  length 
  5032.    Length of the array in bytes pointed to by the comp_dn parameter 
  5033.  
  5034.  dnptrs 
  5035.    List of pointers to previously compressed names in the current message 
  5036.  
  5037.  lastdnptr 
  5038.    Pointer to the end of the array pointed to by dnptrs 
  5039.  
  5040.  Description 
  5041.  
  5042.  This call compresses the domain name pointed to by the exp_dn parameter and 
  5043.  stores it in the area pointed to by the comp_dn parameter. It uses the global 
  5044.  _res structure, which is defined in the <RESOLV.H> header file. 
  5045.  
  5046.  Return Values 
  5047.  
  5048.  When successful, the dn_comp()  call returns the size of the compressed domain 
  5049.  name. If it fails, the call returns a value of -1. 
  5050.  
  5051.  
  5052. ΓòÉΓòÉΓòÉ 8.3. dn_expand() ΓòÉΓòÉΓòÉ
  5053.  
  5054. The socket call expands a compressed domain name to a full domain name. 
  5055.  
  5056. Syntax 
  5057.  
  5058. #include <types.h>
  5059. #include <netinet\in.h>
  5060. #include <arpa\nameser.h>
  5061. #include <resolv.h>
  5062.  
  5063. int dn_expand(msg, eomorig, comp_dn, exp_dn, length)
  5064. u_char *msg;
  5065. u_char *eomorig;
  5066. u_char *comp_dn;
  5067. u_char *exp_dn;
  5068. int length;
  5069.  
  5070. Parameters 
  5071.  
  5072.  msg 
  5073.    Pointer to the beginning of a message 
  5074.  
  5075.  eomorig 
  5076.    Pointer to the end of the original message that contains the compressed 
  5077.    domain name 
  5078.  
  5079.  comp_dn 
  5080.    Pointer to the compressed domain name 
  5081.  
  5082.  exp_dn 
  5083.    Pointer to a buffer that holds the resulting expanded domain name 
  5084.  
  5085.  length 
  5086.    Length of the buffer in bytes pointed to by the exp_dn parameter 
  5087.  
  5088.  Description 
  5089.  
  5090.  This call expands a compressed domain name to a full domain name, converting 
  5091.  the expanded name to all uppercase letters. It uses the global _res structure, 
  5092.  which is defined in the <RESOLV.H> header file. 
  5093.  
  5094.  Return Values 
  5095.  
  5096.  If it succeeds, the dn_expand() call returns the size of the expanded domain 
  5097.  name. If it fails, the call returns a value of -1. 
  5098.  
  5099.  
  5100. ΓòÉΓòÉΓòÉ 8.4. endhostent() ΓòÉΓòÉΓòÉ
  5101.  
  5102. The socket call closes the HOSTS file. 
  5103.  
  5104. Syntax 
  5105.  
  5106. void endhostent()
  5107.  
  5108. Description 
  5109.  
  5110. This call closes the ETC\HOSTS file, which contains information about known 
  5111. hosts. 
  5112.  
  5113.  
  5114. ΓòÉΓòÉΓòÉ 8.5. endnetent() ΓòÉΓòÉΓòÉ
  5115.  
  5116. The socket call closes the NETWORKS file. 
  5117.  
  5118. Syntax 
  5119.  
  5120. void endnetent()
  5121.  
  5122. Description 
  5123.  
  5124. The endnetent() call closes the ETC\NETWORKS file, which contains information 
  5125. about known networks. 
  5126.  
  5127.  
  5128. ΓòÉΓòÉΓòÉ 8.6. endprotoent() ΓòÉΓòÉΓòÉ
  5129.  
  5130. The socket call closes the PROTOCOL file. 
  5131.  
  5132. Syntax 
  5133.  
  5134. void endprotoent()
  5135.  
  5136. Description 
  5137.  
  5138. This call closes the ETC\PROTOCOL file, which contains information about known 
  5139. protocols. 
  5140.  
  5141.  
  5142. ΓòÉΓòÉΓòÉ 8.7. endservent() ΓòÉΓòÉΓòÉ
  5143.  
  5144. The socket call closes the SERVICES file. 
  5145.  
  5146. Syntax 
  5147.  
  5148. void endservent()
  5149.  
  5150. Description 
  5151.  
  5152. This call closes the ETC\SERVICES file, which contains information about known 
  5153. services. 
  5154.  
  5155.  
  5156. ΓòÉΓòÉΓòÉ 8.8. gethostbyaddr() ΓòÉΓòÉΓòÉ
  5157.  
  5158. The socket call returns a pointer to information about a host specified by an 
  5159. Internet address. 
  5160.  
  5161. Syntax 
  5162.  
  5163. #include <netdb.h>
  5164.  
  5165. struct hostent *gethostbyaddr(addr, addrlen, addrfam)
  5166. char *addr;
  5167. int addrlen;
  5168. int addrfam;
  5169.  
  5170. Parameters 
  5171.  
  5172.  addr 
  5173.    Pointer to a 32-bit Internet address in network-byte order 
  5174.  
  5175.  addrlen 
  5176.    Size of addr in bytes 
  5177.  
  5178.  addrfam 
  5179.    Address family supported (AF_INET) 
  5180.  
  5181.  Description 
  5182.  
  5183.  This call resolves the host name through a name server, if one is present. If 
  5184.  a name server is not present or cannot resolve the host name, gethostbyaddr() 
  5185.  searches the ETC\HOSTS file in sequence until a matching host address is found 
  5186.  or an end-of-file (EOF) marker is reached. This search order can be reversed 
  5187.  by the following statement in your config.sys file: 
  5188.  
  5189.               SET USE_HOSTS_FIRST=1
  5190.  
  5191.  Return Values 
  5192.  
  5193.  The return value points to static data that subsequent API calls can modify. 
  5194.  This call returns a pointer to a hostent structure for the host address 
  5195.  specified on the call and indicates success. A NULL pointer indicates an error 
  5196.  or EOF. 
  5197.  
  5198.  The <NETDB.H> header file defines the hostent structure and contains the 
  5199.  following elements: 
  5200.  
  5201.  Element        Description 
  5202.  h_name         Official name of the host 
  5203.  h_aliases      Zero-terminated array of alternative names for the host 
  5204.  h_addrtype     The address family of the network address being returned, 
  5205.                 always set to AF_INET 
  5206.  h_length       Length of the address in bytes 
  5207.  h_addr         Pointer to the network address of the host 
  5208.  
  5209.  The value of h_errno indicates the specific error. 
  5210.  
  5211.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5212.    Γöé H_ERRNO VALUE  Γöé CODE  Γöé DESCRIPTION                  Γöé
  5213.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5214.    Γöé HOST_NOT_FOUND  Γöé  1   Γöé The host specified by the addr parameter is  Γöé
  5215.    Γöé         Γöé    Γöé not found.                   Γöé
  5216.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5217.    Γöé TRY_AGAIN    Γöé  2   Γöé The local server does not receive a response  Γöé
  5218.    Γöé         Γöé    Γöé from an authorized server.  Try again later.  Γöé
  5219.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5220.    Γöé NO_RECOVERY   Γöé  3   Γöé This error code indicates an unrecoverable   Γöé
  5221.    Γöé         Γöé    Γöé error.                     Γöé
  5222.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5223.    Γöé NO_DATA     Γöé  4   Γöé The requested addr is valid, but does not   Γöé
  5224.    Γöé         Γöé    Γöé have an Internet address at the name server.  Γöé
  5225.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5226.    Γöé NO_ADDRESS    Γöé  4   Γöé The requested addr is valid, but does not   Γöé
  5227.    Γöé         Γöé    Γöé have an Internet address at the name server.  Γöé
  5228.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5229.  
  5230.  
  5231. ΓòÉΓòÉΓòÉ 8.9. gethostbyname() ΓòÉΓòÉΓòÉ
  5232.  
  5233. The socket call returns a pointer to information about a host specified by a 
  5234. host name. 
  5235.  
  5236. Syntax 
  5237.  
  5238. #include <netdb.h>
  5239.  
  5240. struct hostent *gethostbyname(name)
  5241. char *name;
  5242.  
  5243. Parameters 
  5244.  
  5245.  name 
  5246.    Pointer to the name of the host being queried 
  5247.  
  5248.  Description: 
  5249.  
  5250.  This call resolves the host name through a name server, if one is present. If 
  5251.  a name server is not present or is unable to resolve the host name, 
  5252.  gethostbyname() searches the ETC\HOSTS file in sequence until a matching host 
  5253.  name is found or an EOF marker is reached. This search order can be reversed 
  5254.  by the following statement in your config.sys file: 
  5255.  
  5256.               SET USE_HOSTS_FIRST=1
  5257.  
  5258.  Return Values 
  5259.  
  5260.  The return value points to static data that subsequent API calls can modify. 
  5261.  This call returns a pointer to a hostent structure for the host address 
  5262.  specified on the call and indicates success. A NULL pointer indicates an error 
  5263.  or EOF. 
  5264.  
  5265.  The <NETDB.H> header file defines the hostent structure and contains the 
  5266.  following elements: 
  5267.  
  5268.  Element        Description 
  5269.  h_name         Official name of the host 
  5270.  h_aliases      Zero-terminated array of alternative names for the host 
  5271.  h_addrtype     The address family of the network address being returned, 
  5272.                 always set to AF_INET 
  5273.  h_length       Length of the address in bytes 
  5274.  h_addr         Pointer to the network address of the host 
  5275.  
  5276.  The value of h_errno indicates the specific error. 
  5277.  
  5278.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5279.    Γöé H_ERRNO VALUE  Γöé CODE  Γöé DESCRIPTION                  Γöé
  5280.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5281.    Γöé HOST_NOT_FOUND  Γöé  1   Γöé The host specified by the name parameter is  Γöé
  5282.    Γöé         Γöé    Γöé not found.                   Γöé
  5283.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5284.    Γöé TRY_AGAIN    Γöé  2   Γöé The local server does not receive a response  Γöé
  5285.    Γöé         Γöé    Γöé from an authorized server.  Try again later.  Γöé
  5286.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5287.    Γöé NO_RECOVERY   Γöé  3   Γöé This error code indicates an unrecoverable   Γöé
  5288.    Γöé         Γöé    Γöé error.                     Γöé
  5289.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5290.    Γöé NO_DATA     Γöé  4   Γöé The requested name is valid, but does not   Γöé
  5291.    Γöé         Γöé    Γöé have an Internet address at the name server.  Γöé
  5292.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5293.    Γöé NO_ADDRESS    Γöé  4   Γöé The requested name is valid, but does not   Γöé
  5294.    Γöé         Γöé    Γöé have an Internet address at the name server.  Γöé
  5295.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5296.  
  5297.  
  5298. ΓòÉΓòÉΓòÉ 8.10. gethostent() ΓòÉΓòÉΓòÉ
  5299.  
  5300. The socket call returns a pointer to the next entry in the HOSTS file. 
  5301.  
  5302. Syntax 
  5303.  
  5304. #include <manifest.h>
  5305. #include <netdb.h>
  5306.  
  5307. struct hostent *gethostent()
  5308.  
  5309. Description 
  5310.  
  5311. This call returns a pointer to the next entry in the HOSTS file. 
  5312.  
  5313. Return Values 
  5314.  
  5315. The return value points to static data that subsequent API calls can modify. 
  5316. This call returns a pointer to a hostent structure for the host address 
  5317. specified on the call and indicates success. A NULL pointer indicates an error 
  5318. or EOF. 
  5319.  
  5320. The <NETDB.H> header file defines the hostent structure and contains the 
  5321. following elements: 
  5322.  
  5323.  Element        Description 
  5324.  h_name         Official name of the host 
  5325.  h_aliases      Zero-terminated array of alternative names for the host 
  5326.  h_addrtype     The address family of the network address being returned, 
  5327.                 always set to AF_INET 
  5328.  h_length       Length of the address in bytes 
  5329.  h_addr         Pointer to the network address of the host 
  5330.  
  5331.  
  5332. ΓòÉΓòÉΓòÉ 8.11. gethostid() ΓòÉΓòÉΓòÉ
  5333.  
  5334. The socket call returns the unique identifier of the current host. 
  5335.  
  5336. Syntax 
  5337.  
  5338. #include <types.h>
  5339.  
  5340. u_long gethostid()
  5341.  
  5342. Description 
  5343.  
  5344. This call gets the unique 32-bit identifier for the current host. 
  5345.  
  5346. Return Values 
  5347.  
  5348. The gethostid() call returns the 32-bit identifier, in host-byte order of the 
  5349. current host, which should be unique across all hosts. This identifier is 
  5350. usually the IP address of the primary interface. The default primary interface 
  5351. is lan0.  For a slip only or PPP only configuration, the sl0 or ppp0 is the 
  5352. primary interface.  If no primary interface exists, the call returns a 
  5353. hexadecimal of X'FFFFFFFF'. 
  5354.  
  5355.  
  5356. ΓòÉΓòÉΓòÉ 8.12. gethostname() ΓòÉΓòÉΓòÉ
  5357.  
  5358. The socket call gets the standard host name for the local host machine. 
  5359.  
  5360. Syntax 
  5361.  
  5362. #include <netdb.h>
  5363.  
  5364. int gethostname(name, namelen)
  5365. char *name;
  5366. int namelen;
  5367.  
  5368. Parameters 
  5369.  
  5370.  name 
  5371.    Pointer to a buffer 
  5372.  
  5373.  namelen 
  5374.    Length of the buffer 
  5375.  
  5376.  Description 
  5377.  
  5378.  This call copies the standard host name for the local host into the buffer 
  5379.  specified by the name parameter. The returned name is a null-terminated 
  5380.  string. 
  5381.  
  5382.  Return Values 
  5383.  
  5384.  The value 0 indicates success; the value -1 indicates an error. 
  5385.  
  5386.  
  5387. ΓòÉΓòÉΓòÉ 8.13. getnetbyaddr() ΓòÉΓòÉΓòÉ
  5388.  
  5389. The socket call returns a pointer to the NETWORKS file entry that contains the 
  5390. specified network address. 
  5391.  
  5392. Syntax 
  5393.  
  5394. #include <netdb.h>
  5395.  
  5396. struct netent *getnetbyaddr(net, type)
  5397. u_long net;
  5398. int type;
  5399.  
  5400. Parameters 
  5401.  
  5402.  net 
  5403.    Network address 
  5404.  
  5405.  type 
  5406.    Address family supported (AF_INET) 
  5407.  
  5408.  Description 
  5409.  
  5410.  The getnetbyaddr() call searches the ETC\NETWORKS file for the specified 
  5411.  network address. 
  5412.  
  5413.  Return Values 
  5414.  
  5415.  The return value points to static data that subsequent API calls can modify. 
  5416.  A pointer to a netent structure indicates success.  A NULL pointer indicates 
  5417.  an error or EOF. 
  5418.  
  5419.  The netent structure is defined in the <NETDB.H> header file and contains the 
  5420.  following elements: 
  5421.  
  5422.  Element        Description 
  5423.  
  5424.  n_name         Official name of the network 
  5425.  
  5426.  n_aliases      An array, terminated with a NULL pointer, of alternative names 
  5427.                 for the network 
  5428.  
  5429.  n_addrtype     The address family of the network address being returned, 
  5430.                 always set to AF_INET 
  5431.  
  5432.  n_net          Network number, returned in host-byte order 
  5433.  
  5434.  
  5435. ΓòÉΓòÉΓòÉ 8.14. getnetbyname() ΓòÉΓòÉΓòÉ
  5436.  
  5437. The socket call returns a pointer to the NETWORKS file entry that contains the 
  5438. specified network name. 
  5439.  
  5440. Syntax 
  5441.  
  5442. #include <netdb.h>
  5443.  
  5444. struct netent *getnetbyname(name)
  5445. char *name;
  5446.  
  5447. Parameters 
  5448.  
  5449.  name 
  5450.    Pointer to a network name 
  5451.  
  5452.  Description 
  5453.  
  5454.  This call searches the ETC\NETWORKS file for the specified network name. 
  5455.  
  5456.  Return Values 
  5457.  
  5458.  The getnetbyname() call returns a pointer to a netent structure for the 
  5459.  network name specified on the call. The return value points to static data 
  5460.  that subsequent API calls can modify.  A pointer to a netent structure 
  5461.  indicates success.  A NULL pointer indicates an error or EOF. 
  5462.  
  5463.  The netent structure is defined in the <NETDB.H> header file and contains the 
  5464.  following elements: 
  5465.  
  5466.  Element        Description 
  5467.  
  5468.  n_name         Official name of the network 
  5469.  
  5470.  n_aliases      An array, terminated with a NULL pointer, of alternative names 
  5471.                 for the network 
  5472.  
  5473.  n_addrtype     The address family of the network address being returned, 
  5474.                 always set to AF_INET 
  5475.  
  5476.  n_net          Network number, returned in host-byte order 
  5477.  
  5478.  
  5479. ΓòÉΓòÉΓòÉ 8.15. getnetent() ΓòÉΓòÉΓòÉ
  5480.  
  5481. The socket call returns a pointer to the next entry in the NETWORKS file. 
  5482.  
  5483. Syntax 
  5484.  
  5485. #include <netdb.h>
  5486.  
  5487. struct netent *getnetent()
  5488.  
  5489. Description 
  5490.  
  5491. This call returns a pointer to the next entry of the ETC\NETWORKS file. 
  5492.  
  5493. Return Values 
  5494.  
  5495. The getnetent() call returns a pointer to the next entry in the ETC\NETWORKS 
  5496. file. The return value points to static data that subsequent API calls can 
  5497. modify. A pointer to a netent structure indicates success. A NULL pointer 
  5498. indicates an error or EOF. 
  5499.  
  5500. The netent structure is defined in the <NETDB.H> header file and contains the 
  5501. following elements: 
  5502.  
  5503.  Element        Description 
  5504.  
  5505.  n_name         Official name of the network 
  5506.  
  5507.  n_aliases      An array, terminated with a NULL pointer, of alternative names 
  5508.                 for the network 
  5509.  
  5510.  n_addrtype     The address family of the network address being returned, 
  5511.                 always set to AF_INET 
  5512.  
  5513.  n_net          Network number, returned in host-byte order 
  5514.  
  5515.  
  5516. ΓòÉΓòÉΓòÉ 8.16. getprotobyname() ΓòÉΓòÉΓòÉ
  5517.  
  5518. The socket call returns a pointer to the PROTOCOL file entry specified by a 
  5519. protocol name. 
  5520.  
  5521. Syntax 
  5522.  
  5523. #include <netdb.h>
  5524.  
  5525. struct protoent *getprotobyname(name)
  5526. char *name;
  5527.  
  5528. Parameters 
  5529.  
  5530.  name 
  5531.    Pointer to the specified protocol 
  5532.  
  5533.  Description 
  5534.  
  5535.  This call searches the ETC\PROTOCOL file for the specified protocol name. 
  5536.  
  5537.  Return Values 
  5538.  
  5539.  The getprotobyname() call returns a pointer to a protoent structure for the 
  5540.  network protocol specified on the call. The return value points to static data 
  5541.  that subsequent API calls can modify. A pointer to a protoent structure 
  5542.  indicates success. A NULL pointer indicates an error or EOF. 
  5543.  
  5544.  The protoent structure is defined in the <NETDB.H> header file and contains 
  5545.  the following elements: 
  5546.  
  5547.  Element        Description 
  5548.  
  5549.  p_name         Official name of the protocol 
  5550.  
  5551.  p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  5552.                 the protocol 
  5553.  
  5554.  p_proto        Protocol number 
  5555.  
  5556.  
  5557. ΓòÉΓòÉΓòÉ 8.17. getprotobynumber() ΓòÉΓòÉΓòÉ
  5558.  
  5559. The socket call returns a pointer to the PROTOCOL file entry specified by a 
  5560. protocol number. 
  5561.  
  5562. Syntax 
  5563.  
  5564. #include <netdb.h>
  5565.  
  5566. struct protoent * getprotobynumber(proto)
  5567. int proto;
  5568.  
  5569. Parameters 
  5570.  
  5571.  proto 
  5572.    Protocol number 
  5573.  
  5574.  Description 
  5575.  
  5576.  This call searches the ETC\PROTOCOL file for the specified protocol number. 
  5577.  
  5578.  Return Values 
  5579.  
  5580.  The getprotobynumber() call returns a pointer to a protoent structure for the 
  5581.  network protocol specified on the call. The return value points to static data 
  5582.  that subsequent API calls can modify. A pointer to a protoent structure 
  5583.  indicates success. A NULL pointer indicates an error or EOF. 
  5584.  
  5585.  The protoent structure is defined in the <NETDB.H> header file and contains 
  5586.  the following elements: 
  5587.  
  5588.  Element        Description 
  5589.  
  5590.  p_name         Official name of the protocol 
  5591.  
  5592.  p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  5593.                 the protocol 
  5594.  
  5595.  p_proto        Protocol number 
  5596.  
  5597.  
  5598. ΓòÉΓòÉΓòÉ 8.18. getprotoent() ΓòÉΓòÉΓòÉ
  5599.  
  5600. The socket call returns a pointer to the next entry in the PROTOCOL file. 
  5601.  
  5602. Syntax 
  5603.  
  5604. #include <netdb.h>
  5605.  
  5606. struct protoent *getprotoent()
  5607.  
  5608. Description 
  5609.  
  5610. This call searches for the next entry in the ETC\PROTOCOL file. 
  5611.  
  5612. Return Values 
  5613.  
  5614. The getprotoent() call returns a pointer to the next entry in the file, 
  5615. ETC\PROTOCOL. The return value points to static data that subsequent API calls 
  5616. can modify. A pointer to a protoent structure indicates success. A NULL pointer 
  5617. indicates an error or EOF. 
  5618.  
  5619. The protoent structure is defined in the <NETDB.H> header file and contains the 
  5620. following elements: 
  5621.  
  5622.  Element        Description 
  5623.  
  5624.  p_name         Official name of the protocol 
  5625.  
  5626.  p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  5627.                 the protocol 
  5628.  
  5629.  p_proto        Protocol number 
  5630.  
  5631.  
  5632. ΓòÉΓòÉΓòÉ 8.19. getservbyname() ΓòÉΓòÉΓòÉ
  5633.  
  5634. The socket call returns a pointer to the SERVICES file entry specified by a 
  5635. service name. 
  5636.  
  5637. Syntax 
  5638.  
  5639. #include <netdb.h>
  5640.  
  5641. struct servent *getservbyname(name, proto)
  5642. char *name;
  5643. char *proto;
  5644.  
  5645. Parameters 
  5646.  
  5647.  name 
  5648.    Pointer to the service name 
  5649.  
  5650.  proto 
  5651.    Pointer to the specified protocol 
  5652.  
  5653.  Description 
  5654.  
  5655.  This call searches the ETC\SERVICES file for the specified service name, which 
  5656.  must match the protocol if a protocol is stated. 
  5657.  
  5658.  Return Values 
  5659.  
  5660.  The call returns a pointer to a servent structure for the network service 
  5661.  specified on the call. The return value points to static data that subsequent 
  5662.  API calls can modify. A pointer to a servent structure indicates success. A 
  5663.  NULL pointer indicates an error or EOF. 
  5664.  
  5665.  The servent structure is defined in the <NETDB.H> header file and contains the 
  5666.  following elements: 
  5667.  
  5668.  Element        Description 
  5669.  
  5670.  s_name         Official name of the service 
  5671.  
  5672.  s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  5673.                 the service 
  5674.  
  5675.  s_port         Port number of the service 
  5676.  
  5677.  s_proto        Required protocol to contact the service 
  5678.  
  5679.  
  5680. ΓòÉΓòÉΓòÉ 8.20. getservbyport() ΓòÉΓòÉΓòÉ
  5681.  
  5682. The socket call returns a pointer to the SERVICES file entry specified by a 
  5683. port number. 
  5684.  
  5685. Syntax 
  5686.  
  5687. #include <netdb.h>
  5688.  
  5689. struct servent *getservbyport(port, proto)
  5690. int port;
  5691. char *proto;
  5692.  
  5693. Parameters 
  5694.  
  5695.  port 
  5696.    Specified port 
  5697.  
  5698.  proto 
  5699.    Pointer to the specified protocol 
  5700.  
  5701.  Description 
  5702.  
  5703.  This call sequentially searches the ETC\SERVICES file for the specified port 
  5704.  number, which must match the protocol if a protocol is stated. 
  5705.  
  5706.  Return Values 
  5707.  
  5708.  The getservbyport() call returns a pointer to a servent structure for the port 
  5709.  number specified on the call. The return value points to static data that 
  5710.  subsequent API calls can modify. A pointer to a servent structure indicates 
  5711.  success. A NULL pointer indicates an error or EOF. 
  5712.  
  5713.  The servent structure is defined in the <NETDB.H> header file and contains the 
  5714.  following elements: 
  5715.  
  5716.  Element        Description 
  5717.  
  5718.  s_name         Official name of the service 
  5719.  
  5720.  s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  5721.                 the service 
  5722.  
  5723.  s_port         Port number of the service 
  5724.  
  5725.  s_proto        Required protocol to contact the service 
  5726.  
  5727.  
  5728. ΓòÉΓòÉΓòÉ 8.21. getservent() ΓòÉΓòÉΓòÉ
  5729.  
  5730. The socket call returns a pointer to the next entry in the SERVICES file. 
  5731.  
  5732. Syntax 
  5733.  
  5734. #include <netdb.h>
  5735.  
  5736. struct servent *getservent()
  5737.  
  5738. Description 
  5739.  
  5740. This call searches for the next line in the ETC\SERVICES file. 
  5741.  
  5742. Return Values 
  5743.  
  5744. The getservent() call returns a pointer to the next entry in the ETC\SERVICES 
  5745. file. The return value points to static data that subsequent API calls can 
  5746. modify. A pointer to a servent structure indicates success. A NULL pointer 
  5747. indicates an error or EOF. 
  5748.  
  5749. The servent structure is defined in the <NETDB.H> header file and contains the 
  5750. following elements: 
  5751.  
  5752.  Element        Description 
  5753.  
  5754.  s_name         Official name of the service 
  5755.  
  5756.  s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  5757.                 the service 
  5758.  
  5759.  s_port         Port number of the service 
  5760.  
  5761.  s_proto        Required protocol to contact the service 
  5762.  
  5763.  
  5764. ΓòÉΓòÉΓòÉ 8.22. htonl() ΓòÉΓòÉΓòÉ
  5765.  
  5766. The socket call translates a long integer from host-byte order to network-byte 
  5767. order. 
  5768.  
  5769. Syntax 
  5770.  
  5771. #include <types.h>
  5772. #include <utils.h>
  5773.  
  5774. u_long htonl(a)
  5775. u_long a;
  5776.  
  5777. Parameters 
  5778.  
  5779.  a 
  5780.    Unsigned long integer to be put into network-byte order 
  5781.  
  5782.  Description 
  5783.  
  5784.  This call translates a long integer from host-byte order to network-byte 
  5785.  order. 
  5786.  
  5787.  Return Values 
  5788.  
  5789.  Returns the translated long integer. 
  5790.  
  5791.  
  5792. ΓòÉΓòÉΓòÉ 8.23. htons() ΓòÉΓòÉΓòÉ
  5793.  
  5794. The socket call translates a short integer from host-byte order to network-byte 
  5795. order. 
  5796.  
  5797. Syntax 
  5798.  
  5799. #include <types.h>
  5800. #include <utils.h>
  5801.  
  5802. u_short htons(a)
  5803. u_short a;
  5804.  
  5805. Parameters 
  5806.  
  5807.  a 
  5808.    Unsigned short integer to be put into network-byte order 
  5809.  
  5810.  Description 
  5811.  
  5812.  This call translates a short integer from host-byte order to network-byte 
  5813.  order. 
  5814.  
  5815.  Return Values 
  5816.  
  5817.  Returns the translated short integer. 
  5818.  
  5819.  
  5820. ΓòÉΓòÉΓòÉ 8.24. inet_addr() ΓòÉΓòÉΓòÉ
  5821.  
  5822. The socket call constructs an Internet address from character strings 
  5823. representing numbers expressed in standard dotted-decimal notation. 
  5824.  
  5825. Syntax 
  5826.  
  5827. #include <types.h>
  5828.  
  5829. u_long inet_addr(cp)
  5830. char *cp;
  5831.  
  5832. Parameters 
  5833.  
  5834.  cp 
  5835.    A character string in standard dotted-decimal notation 
  5836.  
  5837.  Description 
  5838.  
  5839.  This call interprets character strings representing numbers expressed in 
  5840.  standard dotted-decimal notation and returns numbers suitable for use as an 
  5841.  Internet address. 
  5842.  
  5843.  Values specified in standard dotted-decimal notation take one of the following 
  5844.  forms: 
  5845.  
  5846.   a.b.c.d
  5847.   a.b.c
  5848.   a.b
  5849.   a
  5850.  
  5851.  When a four-part address is specified, each part is interpreted as a byte of 
  5852.  data and assigned, from left to right, to one of the 4 bytes of an Internet 
  5853.  address. 
  5854.  
  5855.  When a three-part address is specified, the last part is interpreted as a 
  5856.  16-bit quantity and placed in the two rightmost bytes of the network address. 
  5857.  This makes the three-part address format convenient for specifying Class B 
  5858.  network addresses as 128.net.host. 
  5859.  
  5860.  When a two-part address is specified, the last part is interpreted as a 24-bit 
  5861.  quantity and placed in the three rightmost bytes of the network address. This 
  5862.  makes the two-part address format convenient for specifying Class A network 
  5863.  addresses as net.host. 
  5864.  
  5865.  When a one-part address is specified, the value is stored directly in the 
  5866.  network address space without any rearrangement of its bytes. 
  5867.  
  5868.  Numbers supplied as address parts in standard dotted-decimal notation can be 
  5869.  decimal, hexadecimal, or octal. Numbers are interpreted in C language syntax. 
  5870.  A leading 0x implies hexadecimal; a leading 0 implies octal. A number without 
  5871.  a leading 0 implies decimal. 
  5872.  
  5873.  Return Values 
  5874.  
  5875.  The Internet address is returned in network-byte order. 
  5876.  
  5877.  
  5878. ΓòÉΓòÉΓòÉ 8.25. inet_lnaof() ΓòÉΓòÉΓòÉ
  5879.  
  5880. The socket call returns the local network portion of an Internet address. 
  5881.  
  5882. Syntax 
  5883.  
  5884. #include <types.h>
  5885. #include <netinet\in.h>
  5886.  
  5887. u_long inet_lnaof(in)
  5888. struct in_addr in;
  5889.  
  5890. Parameters 
  5891.  
  5892.  in 
  5893.    Host Internet address 
  5894.  
  5895.  Description 
  5896.  
  5897.  This call breaks apart the Internet host address and returns the local network 
  5898.  address portion. 
  5899.  
  5900.  Return Values 
  5901.  
  5902.  The local network address is returned in host-byte order. 
  5903.  
  5904.  
  5905. ΓòÉΓòÉΓòÉ 8.26. inet_makeaddr() ΓòÉΓòÉΓòÉ
  5906.  
  5907. The socket call constructs an Internet address from a network number and a 
  5908. local address. 
  5909.  
  5910. Syntax 
  5911.  
  5912. #include <types.h>
  5913. #include <netinet\in.h>
  5914.  
  5915. struct in_addr inet_makeaddr(net, lna)
  5916. u_long net;
  5917. u_long lna;
  5918.  
  5919. Parameters 
  5920.  
  5921.  net 
  5922.    Network number 
  5923.  
  5924.  lna 
  5925.    Local network address 
  5926.  
  5927.  Description 
  5928.  
  5929.  This call takes a network number and a local network address and constructs an 
  5930.  Internet address. 
  5931.  
  5932.  Return Values 
  5933.  
  5934.  The Internet address is returned in network-byte order. 
  5935.  
  5936.  
  5937. ΓòÉΓòÉΓòÉ 8.27. inet_netof() ΓòÉΓòÉΓòÉ
  5938.  
  5939. The socket call returns the network portion of the Internet host address in 
  5940. network-byte order. 
  5941.  
  5942. Syntax 
  5943.  
  5944. #include <types.h>
  5945. #include <netinet\in.h>
  5946.  
  5947. u_long inet_netof(in)
  5948. struct in_addr in;
  5949.  
  5950. Parameters 
  5951.  
  5952.  in 
  5953.    Internet address in network-byte order 
  5954.  
  5955.  Description 
  5956.  
  5957.  This call breaks apart the Internet host address and returns the network 
  5958.  number portion. 
  5959.  
  5960.  Return Values 
  5961.  
  5962.  The network number is returned in host-byte order. 
  5963.  
  5964.  
  5965. ΓòÉΓòÉΓòÉ 8.28. inet_network() ΓòÉΓòÉΓòÉ
  5966.  
  5967. The socket call constructs a network number from character strings representing 
  5968. numbers expressed in standard dotted-decimal notation. 
  5969.  
  5970. Syntax 
  5971.  
  5972. #include <types.h>
  5973.  
  5974. u_long inet_network(cp)
  5975. char *cp;
  5976.  
  5977. Parameters 
  5978.  
  5979.  cp 
  5980.    A character string in standard dotted-decimal notation 
  5981.  
  5982.  Description 
  5983.  
  5984.  This call interprets character strings representing numbers expressed in 
  5985.  standard dotted-decimal notation and returns numbers suitable for use as a 
  5986.  network number. 
  5987.  
  5988.  Return Values 
  5989.  
  5990.  The network number is returned in host-byte order. 
  5991.  
  5992.  
  5993. ΓòÉΓòÉΓòÉ 8.29. inet_ntoa() ΓòÉΓòÉΓòÉ
  5994.  
  5995. The socket call returns a pointer to a string in dotted-decimal notation. 
  5996.  
  5997. Syntax 
  5998.  
  5999. #include <types.h>
  6000. #include <netinet\in.h>
  6001.  
  6002. char *inet_ntoa(in)
  6003. struct in_addr in;
  6004.  
  6005. Parameters 
  6006.  
  6007.  in 
  6008.    Host Internet address 
  6009.  
  6010.  Description 
  6011.  
  6012.  This call returns a pointer to a string expressed in the dotted-decimal 
  6013.  notation. The inet_ntoa() call accepts an Internet address expressed as a 
  6014.  32-bit quantity in network-byte order and returns a string expressed in 
  6015.  dotted-decimal notation. 
  6016.  
  6017.  Return Values 
  6018.  
  6019.  Returns a pointer to the Internet address expressed in dotted-decimal 
  6020.  notation. 
  6021.  
  6022.  
  6023. ΓòÉΓòÉΓòÉ 8.30. lswap() ΓòÉΓòÉΓòÉ
  6024.  
  6025. The socket call swaps bytes in a long integer. 
  6026.  
  6027. Syntax 
  6028.  
  6029. #include <types.h>
  6030. #include <utils.h>
  6031.  
  6032. u_long lswap(a)
  6033. u_long a;
  6034.  
  6035. Parameters 
  6036.  
  6037.  a 
  6038.    Unsigned long integer whose bytes are to be swapped 
  6039.  
  6040.  Description 
  6041.  
  6042.  This call swaps bytes in a long integer. 
  6043.  
  6044.  Return Values 
  6045.  
  6046.  Returns the translated long integer. 
  6047.  
  6048.  
  6049. ΓòÉΓòÉΓòÉ 8.31. ntohl() ΓòÉΓòÉΓòÉ
  6050.  
  6051. The socket call translates a long integer from network-byte order to host-byte 
  6052. order. 
  6053.  
  6054. Syntax 
  6055.  
  6056. #include <types.h>
  6057. #include <utils.h>
  6058.  
  6059. u_long ntohl(a)
  6060. u_long a;
  6061.  
  6062. Parameters 
  6063.  
  6064.  a 
  6065.    Unsigned long integer to be put into host-byte order 
  6066.  
  6067.  Description 
  6068.  
  6069.  This call translates a long integer from network-byte order to host-byte 
  6070.  order. 
  6071.  
  6072.  Return Values 
  6073.  
  6074.  Returns the translated long integer. 
  6075.  
  6076.  
  6077. ΓòÉΓòÉΓòÉ 8.32. ntohs() ΓòÉΓòÉΓòÉ
  6078.  
  6079. The socket call translates a short integer from network-byte order to host-byte 
  6080. order. 
  6081.  
  6082. Syntax 
  6083.  
  6084. #include <types.h>
  6085. #include <utils.h>
  6086.  
  6087. u_short ntohs(a)
  6088. u_short a;
  6089.  
  6090. Parameters 
  6091.  
  6092.  a 
  6093.    Unsigned short integer to be put into host-byte order 
  6094.  
  6095.  Description 
  6096.  
  6097.  This call translates a short integer from network-byte order to host-byte 
  6098.  order. 
  6099.  
  6100.  Return Values 
  6101.  
  6102.  The ntohs() call returns the translated short integer. 
  6103.  
  6104.  
  6105. ΓòÉΓòÉΓòÉ 8.33. res_init() ΓòÉΓòÉΓòÉ
  6106.  
  6107. The socket call initializes the default domain name. 
  6108.  
  6109. Syntax 
  6110.  
  6111. include <types.h>
  6112. #include <netinet\in.h>
  6113. #include <arpa\nameser.h>
  6114. #include <resolv.h>
  6115.  
  6116. void res_init()
  6117.  
  6118. Description 
  6119.  
  6120. This call reads the ETC\RESOLV and ETC\RESOLV2 files for the domain name 
  6121. information and for the IP addresses of the initial hosts running the name 
  6122. server. If none of these files exist, name resolution will use the ETC\HOSTS 
  6123. file. One of these files should be operational. 
  6124.  
  6125. The call stores domain name information in the global _res structure, which is 
  6126. defined in the <RESOLV.H> header file. 
  6127.  
  6128.  
  6129. ΓòÉΓòÉΓòÉ 8.34. res_mkquery() ΓòÉΓòÉΓòÉ
  6130.  
  6131. The socket call makes a query message for the name servers in the Internet 
  6132. domain. 
  6133.  
  6134. Syntax 
  6135.  
  6136. #include <types.h>
  6137. #include <netinet\in.h>
  6138. #include <arpa\nameser.h>
  6139. #include <resolv.h>
  6140.  
  6141. int res_mkquery (op, dname, class, type, data, datalen, newrr,
  6142.                 buf, buflen)
  6143. int op;
  6144. char *dname;
  6145. int class;
  6146. int type;
  6147. char *data;
  6148. int datalen;
  6149. struct rrec *newrr;
  6150. char *buf;
  6151. int buflen;
  6152.  
  6153. Parameters 
  6154.  
  6155.  op 
  6156.    The usual type is QUERY, but you can set the parameter to any query type 
  6157.    defined in the <ARPA\NAMESER.H> header file. 
  6158.  
  6159.  dname 
  6160.    Pointer to the domain name. If dname points to a single label and the 
  6161.    RES_DEFNAMES bit in the _res structure defined in the <RESOLV.H> header file 
  6162.    is set, the call appends dname to the current domain name. The current 
  6163.    domain name is defined in the ETC\RESOLV file. 
  6164.  
  6165.  class 
  6166.    One of the following values: 
  6167.  
  6168.    C_IN           ARPA Internet 
  6169.    C_CHAOS        Chaos network at MIT 
  6170.  
  6171.  type 
  6172.    One of the following type values for resources and queries: 
  6173.  
  6174.    T_A            Host address 
  6175.    T_NS           Authoritative server 
  6176.    T_MD           Mail destination 
  6177.    T_MF           Mail forwarder 
  6178.    T_CNAME        Canonical name 
  6179.    T_SOA          Start of authority zone 
  6180.    T_MB           Mailbox domain name 
  6181.    T_MG           Mail group member 
  6182.    T_MR           Mail rename name 
  6183.    T_NULL         NULL resource record 
  6184.    T_WKS          Well-known service 
  6185.    T_PTR          Domain name pointer 
  6186.    T_HINFO        Host information 
  6187.    T_MINFO        Mailbox information 
  6188.    T_MX           Mail routing information 
  6189.    T_UINFO        User information 
  6190.    T_UID          User ID 
  6191.    T_GID          Group ID 
  6192.  
  6193.  data 
  6194.    Pointer to the data sent to the name server as a search key 
  6195.  
  6196.  datalen 
  6197.    Size of the data parameter in bytes 
  6198.  
  6199.  newrr 
  6200.    Reserved. Unused parameter. 
  6201.  
  6202.  buf 
  6203.    Pointer to the query message 
  6204.  
  6205.  buflen 
  6206.    Length of the buffer in bytes pointed to by the buf parameter 
  6207.  
  6208.  Description 
  6209.  
  6210.  This call makes a query message for the name servers in the Internet domain 
  6211.  and puts that query message in the location pointed by the buf parameter. It 
  6212.  uses global _res structure, which is defined in the <RESOLV.H> header file. 
  6213.  
  6214.  Return Values 
  6215.  
  6216.  If it succeeds, the res_mkquery() call returns the size of the query.  If the 
  6217.  query is larger than the value of buflen, the call fails and returns a value 
  6218.  of -1. 
  6219.  
  6220.  
  6221. ΓòÉΓòÉΓòÉ 8.35. res_send() ΓòÉΓòÉΓòÉ
  6222.  
  6223. The socket call sends a query to a local name server. 
  6224.  
  6225. Syntax 
  6226.  
  6227. #include <types.h>
  6228. #include <netinet\in.h>
  6229. #include <arpa\nameser.h>
  6230. #include <resolv.h>
  6231.  
  6232. int re_send(msg, msglen, ans, anslen)
  6233. char *msg;
  6234. int msglen;
  6235. char *ans;
  6236. int anslen;
  6237.  
  6238. Parameters 
  6239.  
  6240.  msg 
  6241.    Pointer to the beginning of a message 
  6242.  
  6243.  msglen 
  6244.    Length of the buffer in bytes pointed to by the msg parameter 
  6245.  
  6246.  ans 
  6247.    Pointer to the location where the received response is stored 
  6248.  
  6249.  anslen 
  6250.    Length of the buffer in bytes pointed by the ans parameter 
  6251.  
  6252.  Description 
  6253.  
  6254.  This call sends a query to the local name server and calls the res_init() call 
  6255.  if the RES_INIT option of the global _res structure is not set. It also 
  6256.  handles timeouts and retries. It uses the global _res structure, which is 
  6257.  defined in the <RESOLV.H> header file. 
  6258.  
  6259.  Return Values 
  6260.  
  6261.  If it succeeds, the call returns the length of the message. If it fails, the 
  6262.  call returns a value of -1. 
  6263.  
  6264.  
  6265. ΓòÉΓòÉΓòÉ 8.36. sethostent() ΓòÉΓòÉΓòÉ
  6266.  
  6267. The socket call opens and rewinds the HOSTS file. 
  6268.  
  6269. Syntax 
  6270.  
  6271. #include <stdio.h>
  6272.  
  6273. void sethostent(stayopen)
  6274. int stayopen;
  6275.  
  6276. Parameters 
  6277.  
  6278.  stayopen 
  6279.    Allows the ETC\HOSTS file to stay open after each call 
  6280.  
  6281.  Description 
  6282.  
  6283.  This call opens and rewinds the ETC\HOSTS file. If the stayopen parameter is 
  6284.  nonzero, the ETC\HOSTS file stays open after each of the gethost calls. 
  6285.  
  6286.  Return Values 
  6287.  
  6288.  The sethostent() call returns a global pointer to the FILE structure defined 
  6289.  in the <STDIO.H> header file. A NULL pointer indicates an error or EOF. 
  6290.  
  6291.  
  6292. ΓòÉΓòÉΓòÉ 8.37. setnetent() ΓòÉΓòÉΓòÉ
  6293.  
  6294. The socket call opens and rewinds the NETWORKS file. 
  6295.  
  6296. Syntax 
  6297.  
  6298. #include <stdio.h>
  6299.  
  6300. void setnetent(stayopen)
  6301. int stayopen;
  6302.  
  6303. Parameters 
  6304.  
  6305.  stayopen 
  6306.    Allows the ETC\NETWORKS file to stay open after each call 
  6307.  
  6308.  Description 
  6309.  
  6310.  This call opens and rewinds the ETC\NETWORKS file, which contains information 
  6311.  about known networks.  If the stayopen parameter is nonzero, the ETC\NETWORKS 
  6312.  file stays open after each of the getnet calls. 
  6313.  
  6314.  Return Values 
  6315.  
  6316.  The setnetent() call returns a global pointer to the FILE structure defined in 
  6317.  the <STDIO.H> header file. A NULL pointer indicates an error or EOF. 
  6318.  
  6319.  
  6320. ΓòÉΓòÉΓòÉ 8.38. setprotoent() ΓòÉΓòÉΓòÉ
  6321.  
  6322. The socket call opens and rewinds the PROTOCOL file. 
  6323.  
  6324. Syntax 
  6325.  
  6326. #include <stdio.h>
  6327.  
  6328. void setprotoent(stayopen)
  6329. int stayopen;
  6330.  
  6331. Parameters 
  6332.  
  6333.  stayopen 
  6334.    Allows the ETC\PROTOCOL file to stay open after each call 
  6335.  
  6336.  Description 
  6337.  
  6338.  This call opens and rewinds the ETC\PROTOCOL file, which contains information 
  6339.  about known protocols. If the stayopen parameter is nonzero, the ETC\PROTOCOL 
  6340.  file stays open after each of the getproto calls. 
  6341.  
  6342.  Return Values 
  6343.  
  6344.  The setprotoent() call returns a global pointer to the FILE structure defined 
  6345.  in the <STDIO.H> header file. A NULL pointer indicates an error or EOF. 
  6346.  
  6347.  
  6348. ΓòÉΓòÉΓòÉ 8.39. setservent() ΓòÉΓòÉΓòÉ
  6349.  
  6350. The socket call opens and rewinds the SERVICES file. 
  6351.  
  6352. Syntax 
  6353.  
  6354. #include <stdio.h>
  6355.  
  6356. void setservent(stayopen)
  6357. int stayopen;
  6358.  
  6359. Parameters 
  6360.  
  6361.  stayopen 
  6362.    Allows the ETC\SERVICES file to stay open after each call 
  6363.  
  6364.  Description 
  6365.  
  6366.  This call opens and rewinds the ETC\SERVICES file, which contains information 
  6367.  about known services and well-known ports. If the stayopen parameter is 
  6368.  nonzero, the ETC\SERVICES file stays open after each of the getserv calls. 
  6369.  
  6370.  Return Values 
  6371.  
  6372.  The setservent() call returns a global pointer to the FILE structure defined 
  6373.  in the <STDIO.H> header file. A NULL pointer indicates an error or EOF. 
  6374.  
  6375.  
  6376. ΓòÉΓòÉΓòÉ 9. Remote Procedure Calls (RPCs) ΓòÉΓòÉΓòÉ
  6377.  
  6378. This section describes the high-level remote procedure calls (RPCs) implemented 
  6379. in TCP/IP for OS/2, including the RPC programming interface to the C language 
  6380. and communication between processes. 
  6381.  
  6382. Topics 
  6383.  
  6384.       RPC Protocol 
  6385.       Remote Programs and Procedures 
  6386.       Portmapper 
  6387.       eXternal Data Representation (XDR) 
  6388.       RPC Intermediate Layer 
  6389.       RPC Lowest Layer 
  6390.       rpcgen Command 
  6391.       rpcinfo Command 
  6392.       enum clnt_stat Structure 
  6393.       Remote Procedure Call Library 
  6394.       Porting an RPC API Application 
  6395.       Compiling and Linking an RPC API Application 
  6396.       Remote Procedure and eXternal Data Representation Calls 
  6397.  
  6398.  
  6399. ΓòÉΓòÉΓòÉ 9.1. RPC Protocol ΓòÉΓòÉΓòÉ
  6400.  
  6401. The RPC protocol enables remote execution of subroutines across a TCP/IP 
  6402. network. RPC, together with the eXternal Data Representation (XDR) protocol, 
  6403. defines a standard for representing data that is independent of internal 
  6404. protocols or formatting. RPCs can communicate between processes on the same or 
  6405. different hosts. 
  6406.  
  6407. The RPC protocol enables users to work with remote procedures as if the 
  6408. procedures were local. The remote procedure calls are defined through routines 
  6409. contained in the RPC protocol.  Each call message is matched with a reply 
  6410. message. The RPC protocol is a message-passing protocol that implements other 
  6411. non-RPC protocols, such as batching and broadcasting remote calls.  The RPC 
  6412. protocol also supports callback procedures and the select subroutine on the 
  6413. server side. 
  6414.  
  6415. RPC provides an authentication process that identifies the server and client to 
  6416. each other.  RPC includes a slot for the authentication parameters on every 
  6417. remote procedure call so that the caller can identify itself to the server. The 
  6418. client package generates and returns authentication parameters. RPC supports 
  6419. various types of authentication, such as the UNIX systems. 
  6420.  
  6421. In RPC, each server supplies a program that is a set of procedures. The 
  6422. combination of a host address, a program number, and a procedure number 
  6423. specifies one remote service procedure. In the RPC model, the client makes a 
  6424. procedure call to send a data packet to the server. When the packet arrives, 
  6425. the server calls a dispatch routine, performs whatever service is requested, 
  6426. and sends a reply back to the client.  The procedure call then returns to the 
  6427. client. 
  6428.  
  6429. RPC is divided into two layers:  intermediate and lowest. Generally, you use 
  6430. the RPC interface to communicate between processes on different workstations in 
  6431. a network. However, RPC works just as well for communication between different 
  6432. processes on the same workstation. 
  6433.  
  6434. The Portmapper program maps RPC program and version numbers to a 
  6435. transport-specific port number. The Portmapper program makes dynamic binding of 
  6436. remote programs possible. 
  6437.  
  6438. To write network applications using RPC, programmers need a working knowledge 
  6439. of network theory and C programming language. For most applications, 
  6440. understanding the RPC mechanisms usually hidden by the RPCGEN protocol compiler 
  6441. is also helpful. However, RPCGEN makes understanding the details of RPC 
  6442. unnecessary. The figures in The RPC Interface give an overview of the 
  6443. high-level RPC client and server processes from initialization through cleanup. 
  6444. See the SAMPLES\RPC directory for sample RPC client, server, and raw data 
  6445. stream programs. RPCGEN samples are in the SAMPLES\RPCGEN directory. 
  6446.  
  6447. For more information about the RPC and XDR protocols, see the Sun Microsystems 
  6448. publication, Networking on the Sun Workstation:  Remote Procedure Call 
  6449. Programming Guide, RFC 1057 and RFC 1014. 
  6450.  
  6451.  
  6452. ΓòÉΓòÉΓòÉ 9.2. The RPC Interface ΓòÉΓòÉΓòÉ
  6453.  
  6454. The RPC model is similar to the local procedure call model. In the local model, 
  6455. the caller places the argument to a procedure in a specified location such as a 
  6456. result register. Then, the caller transfers control to the procedure. The 
  6457. caller eventually regains control, extracts the results of the procedure, and 
  6458. continues the execution. 
  6459.  
  6460. RPC works in the same way: One thread of control winds logically through the 
  6461. caller and server processes as follows: 
  6462.  
  6463.    1. The caller process sends a call message that includes the procedure 
  6464.       parameters to the server process and then waits for a reply message 
  6465.       (blocks). 
  6466.  
  6467.    2. A process on the server side, which is dormant until the arrival of the 
  6468.       call message, extracts the procedure parameters, computes the results, 
  6469.       and sends a reply message.  Then the server waits for the next call 
  6470.       message. 
  6471.  
  6472.    3. A process on the caller side receives the reply message and extracts the 
  6473.       results of the procedure. The caller then resumes the execution. 
  6474.  
  6475.  See the following figures for an illustration of the RPC model: 
  6476.  
  6477.  
  6478.   Remote Procedure Call (Client)
  6479.  
  6480.  
  6481.   Remote Procedure Call (Server)
  6482.  
  6483.  
  6484. ΓòÉΓòÉΓòÉ 9.3. Remote Programs and Procedures ΓòÉΓòÉΓòÉ
  6485.  
  6486. The RPC call message has three unsigned fields: 
  6487.  
  6488.      Remote program number 
  6489.      Remote program version number 
  6490.      Remote procedure number 
  6491.  
  6492.  The three fields uniquely identify the procedure to be called. The program 
  6493.  number defines a group of related remote procedures, each of which has a 
  6494.  different procedure number. Each program also has a version number. 
  6495.  
  6496.  The central system authority administers the program number. A remote program 
  6497.  number is assigned by groups of 0x20000000, as shown in the following list: 
  6498.  
  6499.  Program Number          Description 
  6500.  
  6501.  0-1xxxxxxx              Is predefined and administered by the OS/2 TCP/IP 
  6502.                          system. 
  6503.  
  6504.  20000000-3xxxxxxx       Represents the user defined numbers 
  6505.  
  6506.  40000000-5xxxxxxx       Represents transient numbers 
  6507.  
  6508.  60000000-7xxxxxxx       Reserved 
  6509.  
  6510.  80000000-9xxxxxxx       Reserved 
  6511.  
  6512.  a0000000-bxxxxxxx       Reserved 
  6513.  
  6514.  c0000000-dxxxxxxx       Reserved 
  6515.  
  6516.  e0000000-fxxxxxxx       Reserved 
  6517.  
  6518.  
  6519. ΓòÉΓòÉΓòÉ 9.4. Portmapper ΓòÉΓòÉΓòÉ
  6520.  
  6521. This section describes the Portmapper service and its uses. 
  6522.  
  6523. Topics 
  6524.  
  6525.       Portmapper Protocol 
  6526.       Registering and Unregistering a Port with Portmapper 
  6527.       Contacting Portmapper 
  6528.       Portmapper Procedures 
  6529.  
  6530.  
  6531. ΓòÉΓòÉΓòÉ 9.4.1. Portmapper Protocol ΓòÉΓòÉΓòÉ
  6532.  
  6533. The Portmapper protocol defines a network service that clients use to look up 
  6534. the port number of any remote program supported by the server. The client 
  6535. programs must find the port numbers of the server programs that they intend to 
  6536. use. 
  6537.  
  6538. The Portmapper program: 
  6539.  
  6540.      Maps RPC program and version numbers to transport specific port numbers. 
  6541.  
  6542.      Makes dynamic binding of remote programs. This is desirable because the 
  6543.       range of reserved port numbers is small, and the number of potential 
  6544.       remote programs is large. When running only the Portmapper program on a 
  6545.       reserved port, you can determine the port numbers of other remote 
  6546.       programs by querying Portmapper. 
  6547.  
  6548.      Supports both the UDP and TCP protocols. 
  6549.  
  6550.  The RPC client contacts Portmapper on port number 111 on either of these 
  6551.  protocols. 
  6552.  
  6553.  
  6554. ΓòÉΓòÉΓòÉ 9.4.2. Registering and Unregistering a Port with Portmapper ΓòÉΓòÉΓòÉ
  6555.  
  6556. Portmapper is the only network service that must have a dedicated port (111). 
  6557. Other RPC network services can be assigned port numbers statically or 
  6558. dynamically, if the services register their ports with the host's local 
  6559. Portmapper. The RPC server can register or unregister their services by using 
  6560. the following calls: 
  6561.  
  6562.  svc_register()        Associates a program with the service dispatch routine 
  6563.  
  6564.  svc_unregister()      Removes all local mappings to dispatch routines and port 
  6565.                        numbers 
  6566.  
  6567.  registerrpc()         Registers a procedure with the local Portmapper and 
  6568.                        creates a control structure to remember the server 
  6569.                        procedure and its XDR routine 
  6570.  
  6571.  
  6572. ΓòÉΓòÉΓòÉ 9.4.3. Contacting Portmapper ΓòÉΓòÉΓòÉ
  6573.  
  6574. To find the port of a remote program, the client sends an RPC request to 
  6575. well-known port 111 of the server's host. If Portmapper has a port number entry 
  6576. for the remote program, Portmapper provides the port number in the RPC reply. 
  6577. The client then requests the remote program by sending an RPC request to the 
  6578. port number provided by Portmapper. 
  6579.  
  6580. Clients can save port numbers of recently called remote programs to avoid 
  6581. having to contact Portmapper for each request to a server. 
  6582.  
  6583. RPC also provides the following calls for interfacing with Portmapper: 
  6584.  
  6585.  Call                  Description 
  6586.  
  6587.  pmap_getmaps()        Returns a list of current program-to-port mappings on 
  6588.                        the foreign host 
  6589.  
  6590.  pmap_getport()        Returns the port number associated with the remove 
  6591.                        program, version, and transport protocol 
  6592.  
  6593.  pmap_rmtcall()        Instructs Portmapper to make an RPC call to a procedure 
  6594.                        on the host 
  6595.  
  6596.  pmap_set()            Sets the mapping of a program to a port on the local 
  6597.                        machine 
  6598.  
  6599.  pmap_unset()          Removes mappings associated with the program and version 
  6600.                        number on the local machine 
  6601.  
  6602.  xdr_pmap()            Translates an RPC procedure identification 
  6603.  
  6604.  xdr_pmaplist()        Translates a variable number of RPC procedure 
  6605.                        identifications 
  6606.  
  6607.  
  6608. ΓòÉΓòÉΓòÉ 9.4.4. Portmapper Procedures ΓòÉΓòÉΓòÉ
  6609.  
  6610. The Portmapper program supports the following procedures: 
  6611.  
  6612.  Procedure               Description 
  6613.  
  6614.  PMAPPROC_NULL           Has no parameters. A caller can use the return code to 
  6615.                          determine if Portmapper is running. 
  6616.  
  6617.  PMAPPROC_SET            Registers itself with the Portmapper program on the 
  6618.                          same machine. It passes the: 
  6619.  
  6620.                              Program number 
  6621.                              Program version number 
  6622.                              Transport protocol number 
  6623.                              Port number 
  6624.  
  6625.                          The procedure has successfully established the mapping 
  6626.                          if the return value is TRUE. The procedure does not 
  6627.                          establish a mapping if one already exists. 
  6628.  
  6629.  PMAPPROC_UNSET          Unregisters the program and version numbers with 
  6630.                          Portmapper on the same machine. 
  6631.  
  6632.  PMAPPROC_GETPORT        Returns the port number when given a program number, 
  6633.                          version number, and transport protocol number. A port 
  6634.                          value of 0 indicates the program has not been 
  6635.                          registered. 
  6636.  
  6637.  PMAPPROC_DUMP           Takes no input, but returns a list of program, 
  6638.                          version, protocol, and port numbers. 
  6639.  
  6640.  PMAPPROC_CALLIT         Allows a caller to call another remote procedure on 
  6641.                          the same machine without knowing the remote 
  6642.                          procedure's port number. The PMAPPROC_CALLIT procedure 
  6643.                          sends a response only if the procedure is successfully 
  6644.                          run. 
  6645.  
  6646.  
  6647. ΓòÉΓòÉΓòÉ 9.5. eXternal Data Representation (XDR) ΓòÉΓòÉΓòÉ
  6648.  
  6649. This section describes the eXternal Data Representation (XDR) standard and its 
  6650. use. 
  6651.  
  6652. Topics 
  6653.  
  6654.       The XDR Standard 
  6655.       Basic Block Size 
  6656.       The XDR Subroutine Format 
  6657.       XDR Data Types and their Filter Primitives 
  6658.       XDR Nonfilter Primitives 
  6659.  
  6660.  
  6661. ΓòÉΓòÉΓòÉ 9.5.1. The XDR Standard ΓòÉΓòÉΓòÉ
  6662.  
  6663. An eXternal Data Representation (XDR) is a data representation standard that is 
  6664. independent of languages, operating systems, manufacturers, and hardware 
  6665. architecture. This standard enables networked computers to share data 
  6666. regardless of the machine on which the data is produced or consumed. The XDR 
  6667. language permits transfer of data between diverse computer architectures and 
  6668. has been used to communicate data between diverse machines. 
  6669.  
  6670. An XDR approach to standardizing data representations is canonical. That is, 
  6671. XDR defines a single byte (big endian), a single floating-point representation 
  6672. (IEEE), and so on. Any program running on any machine can use XDR to create 
  6673. portable data by translating its local representation to the XDR standards. 
  6674. Similarly, any program running on any machine can read portable data by 
  6675. translating the XDR standard representations to its local equivalents. 
  6676.  
  6677. The XDR standard is the backbone of the RPC, because data for remote procedure 
  6678. calls is sent using the XDR standard. 
  6679.  
  6680. To use XDR routines, C programs must include the <RPC\XDR.H> header file, which 
  6681. is automatically included by the <RPC\RPC.H> header file. 
  6682.  
  6683.  
  6684. ΓòÉΓòÉΓòÉ 9.5.2. Basic Block Size ΓòÉΓòÉΓòÉ
  6685.  
  6686. The XDR language is based on the assumption that bytes (an octet) can be ported 
  6687. to, and encoded on, media that preserve the meaning of the bytes across the 
  6688. hardware boundaries of data. XDR does not represent bit fields or bit maps; it 
  6689. represents data in blocks of multiples of 4 bytes (32 bits). If the bytes 
  6690. needed to contain the data are not a multiple of four, enough (0 to 3) bytes to 
  6691. make the total byte count a multiple of four follow the n bytes. The bytes are 
  6692. read from, or written to, a byte stream in order. The order dictates that byte 
  6693. m precedes m+1. Bytes are ported and encoded from low order to high order in 
  6694. local area networks (LANs). Representing data in standardized formats resolves 
  6695. situations that occur when different byte-ordering formats exist on networked 
  6696. machines. This also enables machines with different structure-alignment 
  6697. algorithms to communicate with each other. 
  6698.  
  6699.  
  6700. ΓòÉΓòÉΓòÉ 9.5.3. The XDR Subroutine Format ΓòÉΓòÉΓòÉ
  6701.  
  6702. An XDR routine is associated with each data type. XDR routines have the 
  6703. following format: 
  6704.  
  6705. xdr_xxx(xdrs,dp)
  6706.       XDR *xdrs;
  6707.       xxx *dp;
  6708. {
  6709. }
  6710.  
  6711. The routine has the following parameters: 
  6712.  
  6713.  xxx 
  6714.    XDR data type. 
  6715.  
  6716.  xdrs 
  6717.    Opaque handle that points to an XDR stream. The system passes the opaque 
  6718.    handle pointer to the primitive XDR routines. 
  6719.  
  6720.  dp 
  6721.    Address of the data value that is to be encoded or decoded. 
  6722.  
  6723.  If they succeed, the XDR routines return a value of 1; if they do not succeed, 
  6724.  they return a value of 0. 
  6725.  
  6726.  
  6727. ΓòÉΓòÉΓòÉ 9.5.4. XDR Data Types and their Filter Primitives ΓòÉΓòÉΓòÉ
  6728.  
  6729. The following basic and constructed data types are defined in the XDR standard: 
  6730.  
  6731. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6732. Γöé o  Integers              Γöé o  Structures            Γöé
  6733. Γöé o  Enumeration            Γöé o  Discriminated unions       Γöé
  6734. Γöé o  Booleans              Γöé o  Void               Γöé
  6735. Γöé o  Floating-point decimals      Γöé o  Constants             Γöé
  6736. Γöé o  Opaque data            Γöé o  Typedef              Γöé
  6737. Γöé o  Arrays               Γöé o  Optional data           Γöé
  6738. Γöé o  Strings              Γöé o  Pointers             Γöé
  6739. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6740.  
  6741. The XDR filter primitives are routines that define the basic and constructed 
  6742. data types. The XDR language provides RPC programmers with a specification for 
  6743. uniform representation that includes filter primitives for basic and 
  6744. constructed data types. 
  6745.  
  6746. The basic data types include: 
  6747.  
  6748. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6749. Γöé o  Integers              Γöé o  Void               Γöé
  6750. Γöé o  Enumeration            Γöé o  Constants             Γöé
  6751. Γöé o  Booleans              Γöé o  Typedef              Γöé
  6752. Γöé o  Floating point decimals      Γöé o  Optional data           Γöé
  6753. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6754.  
  6755. The constructed data types include: 
  6756.  
  6757. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6758. Γöé o  Arrays               Γöé o  Structures            Γöé
  6759. Γöé o  Opaque data            Γöé o  Discriminated unions       Γöé
  6760. Γöé o  Strings              Γöé o  Pointers             Γöé
  6761. Γöé o  Byte arrays            Γöé                    Γöé
  6762. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6763.  
  6764. The XDR standard translates both basic and constructed data types. For basic 
  6765. data types such as integer, XDR provides basic filter primitives that: 
  6766.  
  6767.      Serialize information from the local host's representation to XDR 
  6768.       representation 
  6769.  
  6770.      Deserialize information from the XDR representation to the local host's 
  6771.       representation 
  6772.  
  6773.  For constructed data types, XDR provides constructed filter primitives that 
  6774.  allow the use of basic data types (such as integers and floating-point 
  6775.  numbers) to create more complex constructs (such as arrays and discriminated 
  6776.  unions). 
  6777.  
  6778.  
  6779. ΓòÉΓòÉΓòÉ 9.5.4.1. Integer Filter Primitives ΓòÉΓòÉΓòÉ
  6780.  
  6781. The XDR filters cover signed and unsigned integers, as well as signed and 
  6782. unsigned short and long integers. 
  6783.  
  6784. The routines for XDR integer filters are: 
  6785.  
  6786.  Routine          Description 
  6787.  
  6788.  xdr_int()        Translates between C integers and their external 
  6789.                   representations 
  6790.  
  6791.  xdr_u_int()      Translates between C unsigned integers and their external 
  6792.                   representations 
  6793.  
  6794.  xdr_long()       Translates between C long integers and their external 
  6795.                   representations 
  6796.  
  6797.  xdr_u_long()     Translates between C unsigned long integers and their 
  6798.                   external representations 
  6799.  
  6800.  xdr_short()      Translates between C short integers and their external 
  6801.                   representations 
  6802.  
  6803.  xdr_u_short()    Translates between C unsigned short integers and their 
  6804.                   external representations 
  6805.  
  6806.  
  6807. ΓòÉΓòÉΓòÉ 9.5.4.2. Enumeration Filter Primitives ΓòÉΓòÉΓòÉ
  6808.  
  6809. The XDR library provides a primitive for generic enumerations based on the 
  6810. assumption that a C enumeration value (enum) has the same representation. A 
  6811. special enumeration in XDR, known as the Boolean, provides a value of 0 or 1 
  6812. represented internally in a binary notation. 
  6813.  
  6814. The routines for the XDR library enumeration filters are: 
  6815.  
  6816.  Routine         Description 
  6817.  
  6818.  xdr_enum()      Translates between C language enums and their external 
  6819.                  representations 
  6820.  
  6821.  xdr_bool()      Translates between Booleans and their external representations 
  6822.  
  6823.  
  6824. ΓòÉΓòÉΓòÉ 9.5.4.3. Floating-Point Filter Primitives ΓòÉΓòÉΓòÉ
  6825.  
  6826. The XDR library provides primitives that translate between floating-point data 
  6827. and their external representations. Floating-point data encodes an integer with 
  6828. an exponent. Floats and double-precision numbers compose floating-point data. 
  6829.  
  6830. Note:  Numbers are represented as Institute of Electrical and Electronics 
  6831. Engineers (IEEE) standard floating points. Routines might fail when decoding 
  6832. IEEE representations into machine specific representations. 
  6833.  
  6834. The routines for the XDR floating-point filters are: 
  6835.  
  6836.  Routine         Description 
  6837.  
  6838.  xdr_float()     Translates between C language floats and their external 
  6839.                  representations 
  6840.  
  6841.  xdr_double()    Translates between C language double-precision numbers and 
  6842.                  their external representations 
  6843.  
  6844.  
  6845. ΓòÉΓòÉΓòÉ 9.5.4.4. Opaque Data Filter Primitive ΓòÉΓòÉΓòÉ
  6846.  
  6847. Opaque data is composed of bytes of a fixed size that are not interpreted as 
  6848. they pass through the data streams. Opaque data bytes, such as handles, are 
  6849. passed between server and client without being inspected by the client. The 
  6850. client uses the data as it is and then returns it to the server. By definition, 
  6851. the actual data contained in the opaque object is not portable between 
  6852. computers. 
  6853.  
  6854. The XDR library includes the following routine for opaque data: 
  6855.  
  6856.  Routine         Description 
  6857.  xdr_opaque()    Translates between opaque data and its external representation 
  6858.  
  6859.  
  6860. ΓòÉΓòÉΓòÉ 9.5.4.5. Array Filter Primitives ΓòÉΓòÉΓòÉ
  6861.  
  6862. Arrays are constructed filter primitives that can be generic arrays or byte 
  6863. arrays. The XDR library provides filter primitives for handling both types of 
  6864. arrays. 
  6865.  
  6866.  
  6867. ΓòÉΓòÉΓòÉ 9.5.4.5.1. Generic Arrays ΓòÉΓòÉΓòÉ
  6868.  
  6869. These consist of arbitrary elements. You use them in much the same way as byte 
  6870. arrays, which handle a subset of generic arrays where the size of the elements 
  6871. is 1 and their external descriptions are predetermined. The primitive for 
  6872. generic arrays requires an additional parameter to define the size of the 
  6873. element in the array and to call an XDR routine to encode or decode each 
  6874. element in the array. 
  6875.  
  6876. The XDR library includes the following routines for generic arrays: 
  6877.  
  6878.  Routine         Description 
  6879.  
  6880.  xdr_array()     Translates between variable-length arrays and their 
  6881.                  corresponding external representations 
  6882.  
  6883.  xdr_vector()    Translates between fixed-length arrays and their corresponding 
  6884.                  external representations 
  6885.  
  6886.  
  6887. ΓòÉΓòÉΓòÉ 9.5.4.5.2. Byte Arrays ΓòÉΓòÉΓòÉ
  6888.  
  6889. These differ from strings by having a byte count. That is, the length of the 
  6890. array is set to an unsigned integer. They also differ in that byte arrays do 
  6891. not end with a null character. The XDR library provides a primitive for byte 
  6892. arrays. External and internal representations of byte arrays are the same. 
  6893.  
  6894. The XDR library includes the following routine for byte arrays: 
  6895.  
  6896.  Routine         Description 
  6897.  xdr_bytes()     Translates between counted byte string arrays and their 
  6898.                  external representations 
  6899.  
  6900.  
  6901. ΓòÉΓòÉΓòÉ 9.5.4.6. String Filter Primitives ΓòÉΓòÉΓòÉ
  6902.  
  6903. A string is a constructed filter primitive that consists of a sequence of bytes 
  6904. terminated by a null byte. The null byte does not figure into the length of the 
  6905. string. Externally, strings are represented by a sequence of American Standard 
  6906. Code Information Interchange (ASCII) characters. Internally, XDR represents 
  6907. them as pointers to characters with the designation char *. 
  6908.  
  6909. The XDR library includes primitives for the following string routines: 
  6910.  
  6911.  Routine             Description 
  6912.  
  6913.  xdr_string()        Translates between C language strings and their external 
  6914.                      representations 
  6915.  
  6916.  xdr_wrapstring()    Calls the xdr_string subroutine 
  6917.  
  6918.  
  6919. ΓòÉΓòÉΓòÉ 9.5.4.7. Primitive for Pointers to Structures ΓòÉΓòÉΓòÉ
  6920.  
  6921. The XDR library provides the primitive for pointers so that structures 
  6922. referenced within other structures can be easily serialized, deserialized, and 
  6923. released. 
  6924.  
  6925. The XDR library includes the following routine for pointers to structures: 
  6926.  
  6927.  Routine             Description 
  6928.  
  6929.  xdr_reference()     Provides pointer chasing within structures 
  6930.  
  6931.  
  6932. ΓòÉΓòÉΓòÉ 9.5.4.8. Primitive for Discriminated Unions ΓòÉΓòÉΓòÉ
  6933.  
  6934. A discriminated union is a C language union, which is an object that holds 
  6935. several data types.  One arm of the union contains an enumeration value 
  6936. (enum_t), or discriminant, that holds a specific object to be processed over 
  6937. the system first. 
  6938.  
  6939. The XDR library includes the following routine for discriminated unions: 
  6940.  
  6941.  Routine         Description 
  6942.  xdr_union()     Translates between discriminated unions and their external 
  6943.                  representations 
  6944.  
  6945.  
  6946. ΓòÉΓòÉΓòÉ 9.5.4.9. Passing Routines without Data ΓòÉΓòÉΓòÉ
  6947.  
  6948. Sometimes an XDR routine must be supplied to the RPC system, but no data is 
  6949. required or passed. The XDR library provides the following primitive for this 
  6950. function: 
  6951.  
  6952.  Routine         Description 
  6953.  xdr_void()      Supplies an XDR subroutine to the RPC system without sending 
  6954.                  data 
  6955.  
  6956.  
  6957. ΓòÉΓòÉΓòÉ 9.5.5. XDR Nonfilter Primitives ΓòÉΓòÉΓòÉ
  6958.  
  6959. Use the XDR nonfilter primitives to create, manipulate, implement, and destroy 
  6960. XDR data streams. These primitives allow you to: 
  6961.  
  6962.      Describe the data stream position 
  6963.      Change the data stream position 
  6964.      Destroy a data stream 
  6965.  
  6966.  
  6967. ΓòÉΓòÉΓòÉ 9.5.5.1. Creating and Using XDR Data Streams ΓòÉΓòÉΓòÉ
  6968.  
  6969. You get XDR data streams by calling creation routines that take arguments 
  6970. specifically designed to the properties of the stream. There are existing XDR 
  6971. data streams for serializing or deserializing data in standard input and output 
  6972. streams, memory streams, and record streams. 
  6973.  
  6974. Note:  RPC clients do not have to create XDR streams, because the RPC system 
  6975. creates and passes these streams to the client. 
  6976.  
  6977. The types of data streams include: 
  6978.  
  6979.      Standard I/O streams 
  6980.      Memory streams 
  6981.      Record streams 
  6982.  
  6983.  
  6984. ΓòÉΓòÉΓòÉ 9.5.5.1.1. Standard I/O Streams ΓòÉΓòÉΓòÉ
  6985.  
  6986. XDR data streams serialize and deserialize standard input/output( I/O) by 
  6987. calling the standard I/O creation routine to initialize the XDR data stream 
  6988. pointed to by the xdrs parameter. 
  6989.  
  6990. The XDR library includes the following routine for standard I/O data streams: 
  6991.  
  6992.  Routine                 Description 
  6993.  xdrstdio_create()       Initializes the XDR data stream pointed to by the xdrs 
  6994.                          parameter 
  6995.  
  6996.  
  6997. ΓòÉΓòÉΓòÉ 9.5.5.1.2. Memory Streams ΓòÉΓòÉΓòÉ
  6998.  
  6999. XDR data streams serialize and deserialize data from memory by calling the XDR 
  7000. memory creation routine to initialize, in local memory, the XDR stream pointed 
  7001. at by the xdrs parameter. In RPC, the UDP/IP implementation of remote procedure 
  7002. calls uses this routine to build entire call and reply messages in memory 
  7003. before sending the message to the recipient. 
  7004.  
  7005. The XDR library includes the following routine for memory data streams: 
  7006.  
  7007.  Routine                 Description 
  7008.  xdrmem_create()         Initializes, in local memory, the XDR stream pointed 
  7009.                          to by the xdrs parameter 
  7010.  
  7011.  
  7012. ΓòÉΓòÉΓòÉ 9.5.5.1.3. Record Streams ΓòÉΓòÉΓòÉ
  7013.  
  7014. Record streams are XDR streams built on top of record fragments, which are 
  7015. built on TCP/IP streams. TCP/IP is a connection protocol for transporting large 
  7016. streams of data at one time rather than transporting a single data packet at a 
  7017. time. 
  7018.  
  7019. The primary use of a record stream is to interface remote procedure calls to 
  7020. TCP connections.  It can also be used to stream data into or out of normal 
  7021. files. 
  7022.  
  7023. XDR provides the following routines for use with record streams: 
  7024.  
  7025.  Routine                       Description 
  7026.  
  7027.  xdrrec_create()               Provides an XDR stream that can contain long 
  7028.                                sequences of records 
  7029.  
  7030.  xdrrec_endofrecord()          Causes the current outgoing data to be marked as 
  7031.                                a record 
  7032.  
  7033.  xdrrec_skiprecord()           Causes the position of an input stream to move 
  7034.                                to the beginning of the next record 
  7035.  
  7036.  xdrrec_eof()                  Checks the buffer for an input stream that 
  7037.                                identifies the end of file (EOF) 
  7038.  
  7039.  
  7040. ΓòÉΓòÉΓòÉ 9.5.5.2. Manipulating an XDR Data Stream ΓòÉΓòÉΓòÉ
  7041.  
  7042. XDR provides the following routines for describing the data stream position and 
  7043. changing the data stream position: 
  7044.  
  7045.  Routine             Description 
  7046.  
  7047.  xdr_getpos()        Returns an unsigned integer that describes the current 
  7048.                      position in the data stream 
  7049.  
  7050.  xdr_setpos()        Changes the current position in the XDR stream 
  7051.  
  7052.  
  7053. ΓòÉΓòÉΓòÉ 9.5.5.3. Implementing an XDR Data Stream ΓòÉΓòÉΓòÉ
  7054.  
  7055. You can create and implement XDR data streams. The following example shows the 
  7056. abstract data types (XDR handle) required for you to implement your own XDR 
  7057. streams. They contain operations applied to the stream (an operation vector for 
  7058. the particular implementation) and two private fields for using that 
  7059. implementation. 
  7060.  
  7061. enum xdr_op  { XDR_ENCODE=0, XDR_DECODE=1, XDR_FREE=2 };
  7062. typedef struct xdr {
  7063.         enum xdr_op  x_op;
  7064.         struct xdr_ops {
  7065.                 bool_t  (*x_getlong)(struct xdr *, long *);
  7066.                 bool_t  (*x_putlong)(struct xdr *, long *);
  7067.                 bool_t  (*x_getbytes)(struct xdr *, caddr_t, u_int);
  7068.             /* get some bytes from " */
  7069.                 bool_t  (*x_putbytes)(struct xdr *, caddr_t, u_int);
  7070.             /* put some bytes to " */
  7071.                 u_int   (*x_getpostn)(struct xdr *);
  7072.                 bool_t  (*x_setpostn)(struct xdr *,u_int);
  7073.                 long *  (*x_inline)(struct xdr *,u_int);
  7074.                 void    (*x_destroy)(struct xdr *);
  7075.         } *x_ops;
  7076.         caddr_t         x_public;
  7077.         caddr_t         x_private;
  7078.         caddr_t         x_base;
  7079.         int             x_handy;
  7080.  } XDR;
  7081.  
  7082. The following parameters are pointers to XDR stream manipulation routines: 
  7083.  
  7084.  Parameter           Description 
  7085.  x_getlong           Gets long integer values from the data stream. 
  7086.  x_putlong           Puts long integer values into the data stream. 
  7087.  x_getbytes          Gets bytes from the data streams. 
  7088.  x_putbytes          Puts bytes into the data streams. 
  7089.  x_getpostn          Returns the stream offset. 
  7090.  x_setpostn          Repositions the offset. 
  7091.  x_inline            Points to an internal data buffer, used for any purpose. 
  7092.  x_destroy           Frees the private data structure. 
  7093.  x_ops               Specifies the current operation being performed on the 
  7094.                      stream. This field is important to the XDR primitives, but 
  7095.                      the stream's implementation does not depend on the value 
  7096.                      of this parameter. 
  7097.  
  7098.  The following fields are specific to a stream's implementation: 
  7099.  
  7100.  Field           Description 
  7101.  
  7102.  x_public        Specific user data that is private to the stream's 
  7103.                  implementation and that is not used by the XDR primitive 
  7104.  
  7105.  x_private       Points to the private data 
  7106.  
  7107.  x_base          Contains the position information in the data stream that is 
  7108.                  private to the user implementation 
  7109.  
  7110.  x_handy         Data can contain extra information as necessary 
  7111.  
  7112.  
  7113. ΓòÉΓòÉΓòÉ 9.5.5.4. Destroying an XDR Data Stream ΓòÉΓòÉΓòÉ
  7114.  
  7115. XDR provides a routine that destroys the XDR stream pointed to by the xdrs 
  7116. parameter and frees the private data structures allocated to the stream. 
  7117.  
  7118.  Routine             Description 
  7119.  xdr_destroy()       Destroys the XDR stream pointed to by the xdrs parameter 
  7120.  
  7121.  The use of the XDR stream handle is undefined after it is destroyed. 
  7122.  
  7123.  
  7124. ΓòÉΓòÉΓòÉ 9.6. RPC Intermediate Layer ΓòÉΓòÉΓòÉ
  7125.  
  7126. The calls of the RPC intermediate layer are: 
  7127.  
  7128.  Routine             Description 
  7129.  registerrpc()       Registers a procedure with the local Portmapper 
  7130.  callrpc()           Calls a remote procedure on the specified system 
  7131.  svc_run()           Accepts RPC requests and calls the appropriate service 
  7132.                      using svc_getreq() 
  7133.  
  7134.  The transport mechanism is the User Datagram Protocol (UDP). The UDP transport 
  7135.  mechanism handles only arguments and results that are less than 8K bytes in 
  7136.  length. At this level, RPC does not allow time-out specifications, choice of 
  7137.  transport, or process control, in case of errors. If you need this kind of 
  7138.  control, consider the lowest layer of RPC. 
  7139.  
  7140.  With only these three RPC calls, you can write a powerful RPC-based network 
  7141.  application.  The sequence of events follows: 
  7142.  
  7143.    1. Use the registerrpc() call to register your remote program with the local 
  7144.       Portmapper. See Portmapper for more information. The following is an 
  7145.       example of an RPC server: 
  7146.  
  7147.             /* define remote program number and version */
  7148.  
  7149.             #define RMTPROGNUM (u_long)0x3fffffffL
  7150.             #define RMTPROGVER (u_long)0x1
  7151.             #define RMTPROCNUM (u_long)0x1
  7152.  
  7153.             #include <stdio.h>
  7154.             #include <rpc\rpc.h>
  7155.  
  7156.             main()
  7157.              {
  7158.               int *rmtprog();
  7159.  
  7160.               /* register remote program with portmapper */
  7161.               registerrpc(RMTPROGNUM, RMTPROGVER, RMTPROCNUM, rmtprog,
  7162.                                  xdr_int, xdr_int);
  7163.               /* infinite loop, waits for RPC request from client */
  7164.               svc_run();
  7165.               printf("Error: svc_run should never reach this point \n");
  7166.               exit(1);
  7167.              }
  7168.  
  7169.             int *
  7170.             rmtprog(inproc)          /* remote program */
  7171.             int *inproc;
  7172.  
  7173.             {
  7174.              int *outproc;
  7175.              ...
  7176.              /* Process request */
  7177.              ...
  7178.              return (outproc);
  7179.             }
  7180.  
  7181.       The registerrpc() call registers a C procedure rmtprog, which corresponds 
  7182.       to a given RPC procedure number. 
  7183.  
  7184.       The registerrpc() call has six parameters: 
  7185.  
  7186.           The first three parameters, RMTPROGNUM, RMTPROGVER, and RMTPROCNUM, 
  7187.            are the program, version, and procedure numbers of the remote 
  7188.            procedure to be registered. 
  7189.  
  7190.           The fourth parameter, rmtprog, is the name of the local procedure 
  7191.            that implements the remote procedure. 
  7192.  
  7193.           The last two parameters, xdr_int, are the XDR filters for the remote 
  7194.            procedure's arguments and results. 
  7195.  
  7196.       After registering a procedure, the RPC server goes into an infinite loop 
  7197.       waiting for a client request to service. 
  7198.  
  7199.    2. The RPC client uses callrpc() to make a service request to the RPC 
  7200.       server. The following is an example of an RPC client using the callrpc() 
  7201.       call: 
  7202.  
  7203.  
  7204.             /* define remote program number and version */
  7205.  
  7206.             #define RMTPROGNUM (u_long)0x3fffffffL
  7207.             #define RMTPROGVER (u_long)0x1
  7208.             #define RMTPROCNUM (u_long)0x1
  7209.  
  7210.             #include <stdio.h>
  7211.             #include <rpc\rpc.h>
  7212.  
  7213.             main()
  7214.             {
  7215.               int inproc=100, outproc, rstat;
  7216.  
  7217.               ...
  7218.  
  7219.               /* service request to host RPCSERVER_HOST */
  7220.               if (rstat = callrpc("RPCSERVER_HOST", RMTPROGNUM,
  7221.                           RMTPROGVER, RMTPROCNUM, xdr_int, (char *)&inproc,
  7222.                           xdr_int, (char *)&outproc)!= 0)
  7223.                  {
  7224.                    clnt_perrno(rstat);   /* Why  callrpc() failed ? */
  7225.                    exit(1);
  7226.                  }
  7227.               ...
  7228.  
  7229.              }
  7230.  
  7231.       The callrpc() call has eight parameters: 
  7232.  
  7233.           The first is the name of the remote server machine. 
  7234.  
  7235.           The next three parameters are the program, version, and procedure 
  7236.            numbers. 
  7237.  
  7238.           The fifth and sixth parameters are an XDR filter, and an argument to 
  7239.            be encoded and passed to the remote procedure. 
  7240.  
  7241.           The final two parameters are a filter for decoding the results 
  7242.            returned by the remote procedure, and a pointer to the place where 
  7243.            the procedure's results are to be stored. 
  7244.  
  7245.       You handle multiple arguments and results by embedding them in 
  7246.       structures. The callrpc() call returns 0 if it succeeds, otherwise 
  7247.       nonzero. The exact meaning of the returned code is in the <RPC\CLNT.H> 
  7248.       header file and is an enum clnt_stat structure cast into an integer. 
  7249.  
  7250.  
  7251. ΓòÉΓòÉΓòÉ 9.7. RPC Lowest Layer ΓòÉΓòÉΓòÉ
  7252.  
  7253. This section describes the lowest layer of RPC and when to use it. 
  7254.  
  7255. Topics 
  7256.  
  7257.       When to Use the RPC Lowest Layer 
  7258.       Server Side Program 
  7259.       Client Side Program 
  7260.  
  7261.  
  7262. ΓòÉΓòÉΓòÉ 9.7.1. When to Use the RPC Lowest Layer ΓòÉΓòÉΓòÉ
  7263.  
  7264. Use the lowest layer of RPC in the following situations: 
  7265.  
  7266.      You need to use TCP. The intermediate layer uses UDP, which restricts RPC 
  7267.       calls to 8K bytes of data.  TCP permits calls to send long streams of 
  7268.       data. 
  7269.  
  7270.      You want to allocate and free memory while serializing or deserializing 
  7271.       messages with XDR routines. No RPC call at the intermediate level 
  7272.       explicitly permits freeing memory. XDR routines are used for memory 
  7273.       allocation as well as for serializing and deserializing. 
  7274.  
  7275.      You need to perform authentication on the client side or the server side 
  7276.       by supplying credentials or verifying them. 
  7277.  
  7278.  
  7279. ΓòÉΓòÉΓòÉ 9.7.2. Server Side Program ΓòÉΓòÉΓòÉ
  7280.  
  7281. The following is an example of the lowest layer of RPC on the server side 
  7282. program: 
  7283.  
  7284. #define RMTPROGNUM   (u_long)0x3fffffffL
  7285. #define RMTPROGVER   (u_long)0x1L
  7286. #define LONGPROC   1
  7287. #define STRINGPROC 2
  7288.  
  7289. #define MAXLEN 100
  7290.  
  7291. #include <stdio.h>
  7292. #include <rpc\rpc.h>
  7293. #include <sys\socket.h>
  7294.  
  7295. main(argc, argv)
  7296. int argc;
  7297. char *argv[ ];
  7298.  
  7299. {
  7300.      int rmtprog();
  7301.      SVCXPRT *transp;
  7302.  
  7303.      ...
  7304.  
  7305. /* create TCP transport handle */
  7306.      transp = svctcp_create(RPC_ANYSOCK, 1024*10, 1024*10);
  7307. /* or create UDP transport handle */
  7308. /*   transp = svcudp_create(RPC_ANYSOCK);  */
  7309.      if (transp == NULL)   /* check transport handle creation */
  7310.       {
  7311.         fprintf(stderr, "can't create an RPC server transport\n");
  7312.         exit(-1);
  7313.       }
  7314.  
  7315. /* If exists, remove the mapping of remote program and port */
  7316.      pmap_unset(RMTPROGNUM, RMTPROGVER);
  7317.  
  7318. /* register remote program (TCP transport) with local portmapper */
  7319.      if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog,
  7320.                          IPPROTO_TCP))
  7321. /* or register remote program (UDP transport) with local portmapper */
  7322. /*   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog,*/
  7323.                       /* IPPROTO_UDP)) */
  7324.       {
  7325.         fprintf(stderr, "can't register rmtprog() service\n");
  7326.         exit(-1);
  7327.       }
  7328.  
  7329.      svc_run();
  7330.      printf("Error:svc_run should never reaches this point \n");
  7331.      exit(1);
  7332.  
  7333. }
  7334.  
  7335. rmtprog(rqstp, transp)           /* code for remote program */
  7336. struct svc_req *rqstp;
  7337. SVCXPRT *transp;
  7338. {
  7339.    long in_long,out_long;
  7340.    char buf[100], *in_string=buf, *out_string=buf;
  7341.    ...
  7342.    switch((int)rqstp->rq_proc)   /* Which procedure ? */
  7343.     {
  7344.       case NULLPROC:
  7345.          if (!svc_sendreply(transp,xdr_void, 0))
  7346.           {
  7347.             fprintf(stderr,"can't reply to RPC call\n");
  7348.             exit(-1);
  7349.           }
  7350.          return;
  7351.  
  7352.       case LONGPROC:
  7353.          ...
  7354.          /* Process the request */
  7355.          if (!svc_sendreply(transp,xdr_long,&out_long))
  7356.           {
  7357.             fprintf(stderr,"can't reply to RPC call\n");
  7358.             exit(-1);
  7359.           }
  7360.          return;
  7361.  
  7362.       case STRINGPROC:   /* send received "Hello" message back */
  7363.                                    /* to client */
  7364.          svc_getargs(transp,xdr_wrapstring,(char *)&in_string);
  7365.          strcpy(out_string,in_string);
  7366.  
  7367.          /* send a reply back to a RPC client */
  7368.          if (!svc_sendreply(transp,xdr_wrapstring,
  7369.                                          (char *)&out_string))
  7370.           {
  7371.             fprintf(stderr,"can't reply to RPC call\n");
  7372.             exit(-1);
  7373.           }
  7374.          return;
  7375.       case ... :
  7376.          ...
  7377.          /* Any Remote procedure in RMTPROGNUM program */
  7378.          ...
  7379.       default:
  7380.          /* Requested procedure not found */
  7381.          svcerr_noproc(transp);
  7382.          return;
  7383.     }
  7384. }
  7385.  
  7386. The following steps describe the lowest layer of RPC on the server side 
  7387. program: 
  7388.  
  7389.    1. Service the transport handle. 
  7390.  
  7391.       The svctcp_create() and svcudp_create() calls create TCP and UDP 
  7392.       transport handles (SVCXPRT) respectively, used for receiving and replying 
  7393.       to RPC messages. The SVCXPRT transport handle structure is defined in the 
  7394.       <RPC\SVC.H> header file. 
  7395.  
  7396.       If the argument of the svctcp_create() call is RPC_ANYSOCK, the RPC 
  7397.       library creates a socket on which to receive and reply to remote 
  7398.       procedure calls. The svctcp_create() and clnttcp_create() calls cause the 
  7399.       RPC library calls to bind the appropriate socket, if it is not already 
  7400.       bound. 
  7401.  
  7402.       If the argument of the svctcp_create() call is not RPC_ANYSOCK, the 
  7403.       svctcp_create() call expects its argument to be a valid socket number. 
  7404.       If you specify your own socket, it can be bound or unbound.  If it is 
  7405.       bound to a port by you, the port numbers of the svctcp_create() and 
  7406.       clnttcp_create() calls must match. 
  7407.  
  7408.       If the send and receive buffer size parameter of svctcp_create() is 0, 
  7409.       the system selects a reasonable default. 
  7410.  
  7411.    2. Register the rmtprog service with Portmapper. 
  7412.  
  7413.       If the rmtprog service terminated abnormally the last time it was used, 
  7414.       the pmap_unset() call erases any trace of it before restarting. The 
  7415.       pmap_unset() call erases the entry for RMTPROGNUM from the Portmapper's 
  7416.       table. 
  7417.  
  7418.       A service can register its port number with the local Portmapper service 
  7419.       by specifying a nonzero protocol number in the svc_register() call. A 
  7420.       programmer at the client machine can determine the server port number by 
  7421.       consulting Portmapper at the server machine. You can do this 
  7422.       automatically by specifying 0 as the port number in the clntudp_create() 
  7423.       or clnttcp_create() calls. 
  7424.  
  7425.       Finally, the program and version number are associated with the rmtprog 
  7426.       procedure. The final argument to the svc_register() call is the protocol 
  7427.       being used, which in this case is IPPROTO_TCP. Register at the program 
  7428.       level, not at the procedure level. 
  7429.  
  7430.    3. Run the remote program RMTPROG. 
  7431.  
  7432.       The rmtprog service routine must call and dispatch the appropriate XDR 
  7433.       calls based on the procedure number. Unlike the registerrpc() call, which 
  7434.       performs them automatically, the rmtprog routine requires two tasks: 
  7435.  
  7436.           When the NULLPROC procedure (currently 0) returns with no results, 
  7437.            use it as a simple test for detecting whether a remote program is 
  7438.            running. 
  7439.  
  7440.           Check for incorrect procedure numbers. If you detect one, call the 
  7441.            svcerr_noproc() call to handle the error. 
  7442.  
  7443.       As an example, the procedure STRINGPROC has an argument for a character 
  7444.       string and returns the character string back to the client. The 
  7445.       svc_getargs() call takes an SVCXPRT handle, the xdr_wrapstring() call, 
  7446.       and a pointer that indicates where to place the input. 
  7447.  
  7448.       The user service (rmtprog) serializes the results and returns them to the 
  7449.       RPC caller through the svc_sendreply() call. 
  7450.  
  7451.       Parameters of the svc_sendreply() call include the: 
  7452.  
  7453.           SVCXPRT handle 
  7454.           XDR routine, which indicates return data type 
  7455.           Pointer to the data to be returned 
  7456.  
  7457.  
  7458. ΓòÉΓòÉΓòÉ 9.7.3. Client Side Program ΓòÉΓòÉΓòÉ
  7459.  
  7460. The following is an example of the lowest layer of RPC on the client side 
  7461. program: 
  7462.  
  7463. #define RMTPROGNUM  (u_long)0x3fffffffL
  7464. #define RMTPROGVER  (u_long)0x1L
  7465. #define STRINGPROC  (u_long)2
  7466.  
  7467. #include <stdio.h>
  7468. #include <rpc\rpc.h>
  7469. #include <sys\socket.h>
  7470. #include <netdb.h>
  7471.  
  7472. main(argc, argv)
  7473. int argc;
  7474. char *argv[ ];
  7475. {
  7476.    struct hostent *hp;
  7477.    struct timeval pertry_timeout, total_timeout;
  7478.    struct sockaddr_in server_addr;
  7479.    int sock = RPC_ANYSOCK;
  7480.    static char buf[100], *strc_in= "Hello", *strc_out=buf;
  7481.    char *parrc_in, *parrc_out;
  7482.    register CLIENT *clnt;
  7483.    enum clnt_stat cs;
  7484.    ...
  7485.    /* get the Internet address of RPC server host */
  7486.    if ((hp = gethostbyname("RPCSERVER_HOST")) == NULL)
  7487.     {
  7488.       fprintf(stderr,"Can't get address for %s\n","RPCSERVER_HOST");
  7489.       exit (-1);
  7490.     }
  7491.  
  7492.    pertry_timeout.tv_sec = 3;
  7493.    pertry_timeout.tv_usec = 0;
  7494.  
  7495.    /* set sockaddr_in structure */
  7496.    bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr,
  7497.                           hp->h_length);
  7498.    server_addr.sin_family = AF_INET;
  7499.    server_addr.sin_port = 0;
  7500.  
  7501.    /* create clnt TCP handle */
  7502.    if ((clnt = clnttcp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  7503.                              &sock, 1024*10, 1024*10)) == NULL)
  7504.      {
  7505.        clnt_pcreateerror("clnttcp_create fail"); /* Why failed ? */
  7506.        exit(-1);
  7507.      }
  7508.  
  7509. /*
  7510.  *  create clnt UDP handle
  7511.  *  if ((clnt = clntudp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  7512.  *                             pertry_timeout, &sock)) == NULL)
  7513.  *   {
  7514.  *     clnt_pcreateerror("clntudp_create fail");
  7515.  *     exit(-1);
  7516.  *   }
  7517.  */
  7518.    total_timeout.tv_sec = 10;
  7519.    total_timeout.tv_usec = 0;
  7520.    ...
  7521.  
  7522.    /*call the remote procedure STRINGPROC associated with */
  7523.    /*client handle (clnt) */
  7524.    cs=clnt_call(clnt, STRINGPROC,xdr_wrapstring,
  7525.    (char *)&strc_in[j],
  7526.                    xdr_wrapstring, (char *)&strc_out,total_timeout);
  7527.         if (cs != RPC_SUCCESS)
  7528.               printf("*Error* clnt_call fail :\n");
  7529.  
  7530.    clnt_destroy(clnt);  /* deallocate any memory associated  */
  7531.                         /* with clnt handle                  */
  7532.    ...
  7533. }
  7534.  
  7535. The following steps describe the lowest layer of RPC on the client side 
  7536. program: 
  7537.  
  7538.    1. Determine the internet address of the RPC server host. 
  7539.  
  7540.       Use the gethostbyname() call to determine the internet address of the 
  7541.       host, which is running the RPC server. Initialize the socaddr_in 
  7542.       structure, found in the <NETINET\IN.H> header file. 
  7543.  
  7544.       If you are not familiar with socket calls, see Sockets General 
  7545.       Programming Information. 
  7546.  
  7547.    2. Use the client RPC handle. 
  7548.  
  7549.       The clnttcp_create() and clntudp_create() calls create TCP and UDP client 
  7550.       RPC handles (CLIENT), respectively. The CLIENT structure is defined in 
  7551.       the <RPC\CLNT.H> header file. 
  7552.  
  7553.       There are six parameters for the clnttcp_create() call: 
  7554.  
  7555.           Server address 
  7556.           Program number 
  7557.           Version number 
  7558.           Pointer to a valid socket descriptor 
  7559.           Send buffer size 
  7560.           Receive buffer size 
  7561.  
  7562.       Use the same parameters for the clntudp_create() call, except for the 
  7563.       send and receive buffer size. Instead, specify a time-out value (between 
  7564.       tries). 
  7565.  
  7566.    3. Call the remote procedure. 
  7567.  
  7568.       The low-level version of the callrpc() call is the clnt_call(), which has 
  7569.       seven parameters: 
  7570.  
  7571.           CLIENT pointer 
  7572.           Remote procedure number (STRINGPROC) 
  7573.           XDR call for serializing the argument 
  7574.           Pointer to the argument 
  7575.           XDR call for deserializing the return value from the RPC server 
  7576.           Pointer to where the return value is to be placed 
  7577.           Total time in seconds to wait for a reply 
  7578.  
  7579.       For UDP transport, the number of tries is the clnt_call() time-out 
  7580.       divided by the clntudp_create() time-out. 
  7581.  
  7582.       The return code RPC_SUCCESS indicates a successful call; otherwise, an 
  7583.       error has occurred. You find the RPC error code in the <RPC\CLNT.H> 
  7584.       header file. 
  7585.  
  7586.       The clnt_destroy() call always deallocates the space associated with the 
  7587.       client handle. If the RPC library opened the socket associated with the 
  7588.       client handle, the clnt_destroy() call closes it. If you open the socket, 
  7589.       it stays open. 
  7590.  
  7591.  
  7592. ΓòÉΓòÉΓòÉ 9.8. rpcgen Command ΓòÉΓòÉΓòÉ
  7593.  
  7594. Use the rpcgen command to generate C code to implement an RPC protocol. The 
  7595. input to RPCGEN is a language similar to C, known as RPC language. 
  7596.  
  7597. You normally use rpcgen infile to generate the following four output files. For 
  7598. example, if the infile is named PROTO.X, rpcgen generates: 
  7599.  
  7600.      A header file called PROTO.H 
  7601.      XDR routines called PROTOX.C 
  7602.      Server-side stubs called PROTOS.C 
  7603.      Client-side stubs called PROTOC.C 
  7604.  
  7605.  For more information on the rpcgen command, see the Sun Microsystems 
  7606.  publication, Networking on the Sun Workstation:  Remote Procedure Call 
  7607.  Programming Guide. 
  7608.  
  7609.  Syntax 
  7610.  
  7611.   >>ΓöÇΓöÇrpcgenΓöÇΓöÇ infileΓöÇΓöÇ><
  7612.  
  7613.   >>ΓöÇΓöÇrpcgenΓöÇΓöÇΓö¼ΓöÇ -cΓöÇΓö¼ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ><
  7614.         Γö£ΓöÇ -hΓöÇΓöñ  ΓööΓöÇ -o outfileΓöÇΓöÿ  ΓööΓöÇ infileΓöÇΓöÿ
  7615.         Γö£ΓöÇ -lΓöÇΓöñ
  7616.         ΓööΓöÇ -mΓöÇΓöÿ
  7617.  
  7618.   >>ΓöÇΓöÇrpcgenΓöÇΓöÇ -s transportΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ><
  7619.                 ΓööΓöÇ -o outfileΓöÇΓöÿ  ΓööΓöÇ infileΓöÇΓöÿ
  7620.  
  7621.  Parameters 
  7622.  
  7623.  -c Compiles into XDR routines. 
  7624.  
  7625.  -h Compiles into C data definitions (a header file). 
  7626.  
  7627.  -l Compiles into client-side stubs. 
  7628.  
  7629.  -m Compiles into server-side stubs without generating a main routine. 
  7630.  
  7631.  -o outfile Specifies the name of the output file. If none is specified, 
  7632.    standard output is used for -c, -h, -l, -m, and -s modes. 
  7633.  
  7634.  infile Specifies the name of the input file written in the RPC language. 
  7635.  
  7636.  -s transport Compiles into server-side stubs, using the given transport. 
  7637.  
  7638.  
  7639. ΓòÉΓòÉΓòÉ 9.9. rpcinfo Command ΓòÉΓòÉΓòÉ
  7640.  
  7641. The rpcinfo command makes an RPC call to the RPC server and reports the status 
  7642. of the server, which is registered and operational with Portmapper. 
  7643.  
  7644. Syntax 
  7645.  
  7646. rpcinfo for a Host 
  7647.  
  7648.           ΓöîΓöÇ local_hostΓöÇΓöÉ
  7649. >>ΓöÇΓöÇrpcinfoΓöÇΓöÇ -pΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ><
  7650.          ΓööΓöÇ hostΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  ΓööΓöÇ > filenameΓöÇΓöÿ
  7651.  
  7652.  rpcinfo for a Host Using UDP 
  7653.  
  7654. >>ΓöÇΓöÇrpcinfoΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ -u host prognumΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ>
  7655.        ΓööΓöÇ -n portnumΓöÇΓöÿ           ΓööΓöÇ versnumΓöÇΓöÿ
  7656. >ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ><
  7657.   ΓööΓöÇ > filenameΓöÇΓöÿ
  7658.  
  7659.  rpcinfo for a Host Using TCP 
  7660.  
  7661. >>ΓöÇΓöÇrpcinfoΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ -t host prognumΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ>
  7662.        ΓööΓöÇ -n portnumΓöÇΓöÿ           ΓööΓöÇ versnumΓöÇΓöÿ
  7663. >ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ><
  7664.   ΓööΓöÇ > filenameΓöÇΓöÿ
  7665.  
  7666.  rpcinfo for a Broadcast to Hosts Using UDP 
  7667.  
  7668. >>ΓöÇΓöÇrpcinfoΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ prognumΓöÇΓöÇ versnumΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ><
  7669.        ΓööΓöÇ -bΓöÇΓöÿ            ΓööΓöÇ > filenameΓöÇΓöÿ
  7670.  
  7671.  Parameters 
  7672.  
  7673.  -p host 
  7674.    Queries the Portmapper about the specified host and prints a list of all 
  7675.    registered RPC programs. If the host is not specified, the system defaults 
  7676.    to the local host name. 
  7677.  
  7678.  > filename 
  7679.    Specifies a file to which to redirect the list of registered RPC programs. 
  7680.  
  7681.  -n portnum 
  7682.    Specifies the port number to be used for the -t and -u parameters. This 
  7683.    value replaces the port number that is given by the Portmapper. 
  7684.  
  7685.  -u host prognum versnum 
  7686.    Sends an RPC call to procedure 0 of prognum and versnum on the specified 
  7687.    host using UDP and reports whether a response is received. 
  7688.  
  7689.  -t host prognum versnum 
  7690.    Sends an RPC call to procedure 0 of prognum and versnum on the specified 
  7691.    host using TCP and reports whether a response is received. 
  7692.  
  7693.  -b prognum versnum 
  7694.    Sends an RPC broadcast to procedure 0 of the specified prognum and versnum 
  7695.    using UDP and reports all hosts that respond. 
  7696.  
  7697.  The prognum argument can be either a name or a number. If you specify a 
  7698.  versnum, the rpcinfo command tries to call that version of the specified 
  7699.  program. Otherwise, it tries to find all the registered version numbers for 
  7700.  the program you specify by calling version 0; then it tries to call each 
  7701.  registered version. 
  7702.  
  7703.  The TCPIP\ETC\RPC file is associated with the rpcinfo command.  This file 
  7704.  contains a list of server names and their corresponding RPC program numbers 
  7705.  and aliases. 
  7706.  
  7707.  Examples 
  7708.  
  7709.  Use the rpcinfo command as follows to display RPC services registered on the 
  7710.  local host: 
  7711.  
  7712.   rpcinfo -p
  7713.  
  7714.  Examples 
  7715.  
  7716.  Use the rpcinfo command as follows to display RPC services registered on a 
  7717.  remote host named charm: 
  7718.  
  7719.   rpcinfo -p charm
  7720.  
  7721.  Examples 
  7722.  
  7723.  Use the rpcinfo command as follows to display the status of a particular RPC 
  7724.  program on the remote host named charm: 
  7725.  
  7726.   rpcinfo -u charm 100003 2
  7727.  
  7728.  or 
  7729.  
  7730.   rpcinfo -u charm nfs 2
  7731.  
  7732.  In the previous examples, the rpcinfo command shows one of the following: 
  7733.  
  7734.   Program 100003 Version 2 ready and waiting
  7735.  
  7736.  or 
  7737.  
  7738.   Program 100003 Version 2 is not available
  7739.  
  7740.  Examples 
  7741.  
  7742.  Use the rpcinfo command as follows to display all hosts on the local network 
  7743.  that are running a certain version of a specific RPC server: 
  7744.  
  7745.   rpcinfo -b 100003 2
  7746.  
  7747.  or 
  7748.  
  7749.   rpcinfo -b nfsprog 2
  7750.  
  7751.  In these examples, the rpcinfo command lists all hosts that are running 
  7752.  Version 2 of the NFS daemon. 
  7753.  
  7754.  Note:  The version number is required for the -b parameter. 
  7755.  
  7756.  
  7757. ΓòÉΓòÉΓòÉ 9.10. enum clnt_stat Structure ΓòÉΓòÉΓòÉ
  7758.  
  7759. The enum clnt_stat structure is defined in the <RPC\CLNT.H> file. RPCs 
  7760. frequently return enum clnt_stat information. The format of the enum clnt_stat 
  7761. structure follows: 
  7762.  
  7763. enum clnt_stat  {
  7764.    RPC_SUCCESS=0,            /* call succeeded */
  7765.    /*
  7766.     * local errors
  7767.     */
  7768.    RPC_CANTENCODEARGS=1,     /* can't encode arguments */
  7769.    RPC_CANTDECODERES=2,      /* can't decode results */
  7770.    RPC_CANTSEND=3,           /* failure in sending call */
  7771.    RPC_CANTRECV=4,           /* failure in receiving result */
  7772.    RPC_TIMEDOUT=5,           /* call timed out */
  7773.    /*
  7774.     * remote errors
  7775.     */
  7776.    RPC_VERSMISMATCH=6,       /* RPC versions not compatible */
  7777.    RPC_AUTHERROR=7,          /* authentication error */
  7778.    RPC_PROGUNAVAIL=8,        /* program not available */
  7779.    RPC_PROGVERSMISMATCH=9,   /* program version mismatched */
  7780.    RPC_PROCUNAVAIL=10,       /* procedure unavailable */
  7781.    RPC_CANTDECODEARGS=11,    /* decode arguments error */
  7782.    RPC_SYSTEMERROR=12,       /* generic "other problem" */
  7783.    /*
  7784.     * callrpc errors
  7785.     */
  7786.    RPC_UNKNOWNHOST=13,       /* unknown host name */
  7787.    /*
  7788.     * create errors
  7789.     */
  7790.    RPC_PMAPFAILURE=14,        /* the pmapper failed in its call */
  7791.    RPC_PROGNOTREGISTERED=15,  /* remote program is not registered */
  7792.    /*
  7793.     * unspecified error
  7794.     */
  7795.    RPC_FAILED=16
  7796.                };
  7797.  
  7798.  
  7799. ΓòÉΓòÉΓòÉ 9.11. Remote Procedure Call Library ΓòÉΓòÉΓòÉ
  7800.  
  7801. To use the RPCs described in this section, you must have the following header 
  7802. files in your TCPIP\INCLUDE directory: 
  7803.  
  7804.  RPC Header File       What It Contains 
  7805.  
  7806.  RPC\AUTH.H            Authentication interface 
  7807.  
  7808.  RPC\AUTH_UNI.H        Protocol for UNIX-style authentication parameters for 
  7809.                        RPC 
  7810.  
  7811.  RPC\CLNT.H            Client-side remote procedure call interface 
  7812.  
  7813.  RPC\PMAP_CLN.H        Supplies C routines to get to PORTMAP services 
  7814.  
  7815.  RPC\PMAP_PRO.H        Protocol for the local binder service, or pmap 
  7816.  
  7817.  RPC\RPC.H             Includes the RPC header files necessary to do remote 
  7818.                        procedure calling 
  7819.  
  7820.  RPC\RPC_MSG.H         Message definitions 
  7821.  
  7822.  RPC\RPCNETDB.H        Data definitions for network utility calls 
  7823.  
  7824.  RPC\RPCTYPES.H        RPC additions to <TYPES.H> 
  7825.  
  7826.  RPC\SVC.H             Server-side remote procedure call interface 
  7827.  
  7828.  RPC\SVC_AUTH.H        Service side of RPC authentication 
  7829.  
  7830.  RPC\XDR.H             eXternal Data Representation serialization routines 
  7831.  
  7832.  The RPC routines are in the RPC32DLL.LIB file in the LIB directory. You must 
  7833.  also have the SO32DLL.LIB and TCP32DLL.LIB files in your LIB directory. 
  7834.  
  7835.  Put the following statement at the beginning of any file using RPC code: 
  7836.  
  7837.   #include <rpc\rpc.h>
  7838.  
  7839.  You must define the OS/2 variable by doing one of the following: 
  7840.  
  7841.      Place #define OS2 at the top of each file that includes TCP/IP header 
  7842.       files. 
  7843.  
  7844.      Use the /DOS2 option when compiling the source for your application. 
  7845.  
  7846.  
  7847. ΓòÉΓòÉΓòÉ 9.12. Porting an RPC API Application ΓòÉΓòÉΓòÉ
  7848.  
  7849. The IBM OS/2 RPC implementation differs from the Sun Microsystems RPC 
  7850. implementation as follows: 
  7851.  
  7852.      The global variables svc_socks[] and noregistered are used in place of 
  7853.       the svc_fds global variable. See svc_socks [] for the use of these 
  7854.       variables. 
  7855.  
  7856.      Functions that rely on file descriptor structures are not supported. 
  7857.  
  7858.      The svc_getreq() call supports the socks and noavail global variables. In 
  7859.       the Sun Microsystems implementation, the svc_getreq() call supports the 
  7860.       rdfds global variable. 
  7861.  
  7862.      TYPES.H for RPC has been renamed to RPCTYPES.H. 
  7863.  
  7864.  
  7865. ΓòÉΓòÉΓòÉ 9.13. Compiling and Linking an RPC API Application ΓòÉΓòÉΓòÉ
  7866.  
  7867. Follow these steps to compile and link the RPC API application using an IBM 
  7868. 32-bit compiler for OS/2: 
  7869.  
  7870.    1. Set your environment variables to find the following: 
  7871.  
  7872.           Executable programs 
  7873.           Link libraries 
  7874.           Header files 
  7875.  
  7876.       You can set the environment variables in your CONFIG.SYS file. An example 
  7877.       of entries you might have in your CONFIG.SYS file follows: 
  7878.  
  7879.             LIBPATH=E:\IBMC\DLL;C:\MPTN\DLL;C:\TCPIP\DLL;
  7880.             SET PATH=E:\IBMC\BIN;
  7881.             SET DPATH=E:\IBMC\LOCALE;E:\IBMC\HELP;
  7882.             SET LIB=E:\IBMC\LIB;C:\MPTN\LIB;C:\TCPIP\LIB;
  7883.             SET INCLUDE=E:\IBMC\INCLUDE;C:\TCPIP\INCLUDE;
  7884.             SET HELP=E:\IBMC\HELP;
  7885.             SET BOOKSHELF=E:\IBMC\HELP;
  7886.             SET TMP=E:\IBMC\TMP
  7887.             SET TZ=EST5EDT,0,0,0,0,0,0,0,0,0
  7888.  
  7889.    2. To compile your program, enter: 
  7890.  
  7891.             icc /Ti /DOS2 /Sm /Ss /Q /Su4 /Gt /C myprog.c
  7892.  
  7893.    3. To create an executable program, you can enter: 
  7894.  
  7895.       For VisualAge C++ 
  7896.  
  7897.             ilink /NOFREEFORMAT /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  7898.             rpc32dll.lib
  7899.  
  7900.       For C Set++ 
  7901.  
  7902.             link386 /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib rpc32dll.lib
  7903.  
  7904.  Note: 
  7905.  
  7906.    1. The RPC API is not re-entrant.  If you are using a multithreaded program, 
  7907.       you must serialize the access to the APIs. 
  7908.  
  7909.    2. Before you run a program, verify that the DLL files are in a directory 
  7910.       listed in the LIBPATH system environment variable. 
  7911.  
  7912.    3. For more information about the compile and link options, and dynamic link 
  7913.       libraries, see the User's Guide provided with your compiler. 
  7914.  
  7915.  
  7916. ΓòÉΓòÉΓòÉ 9.14. Remote Procedure and eXternal Data Representation Calls ΓòÉΓòÉΓòÉ
  7917.  
  7918. This section provides the syntax, parameters, and other appropriate information 
  7919. for each remote procedure and eXternal Data Representation call supported by 
  7920. TCP/IP for OS/2. 
  7921.  
  7922. Topics 
  7923.  
  7924.       auth_destroy() 
  7925.       authnone_create() 
  7926.       authunix_create() 
  7927.       authunix_create_default() 
  7928.       callrpc() 
  7929.       clnt_broadcast() 
  7930.       clnt_call() 
  7931.       clnt_destroy() 
  7932.       clnt_freeres() 
  7933.       clnt_geterr() 
  7934.       clnt_pcreateerror() 
  7935.       clnt_perrno() 
  7936.       clnt_perror() 
  7937.       clntraw_create() 
  7938.       clnttcp_create() 
  7939.       clntudp_create() 
  7940.       get_myaddress() 
  7941.       getrpcbyname() 
  7942.       getrpcbynumber() 
  7943.       getrpcent() 
  7944.       pmap_getmaps() 
  7945.       pmap_getport() 
  7946.       pmap_rmtcall() 
  7947.       pmap_set() 
  7948.       pmap_unset() 
  7949.       registerrpc() 
  7950.       rpc_createerr 
  7951.       svc_destroy() 
  7952.       svc_freeargs() 
  7953.       svc_getargs() 
  7954.       svc_getcaller() 
  7955.       svc_getreq() 
  7956.       svc_register() 
  7957.       svc_run() 
  7958.       svc_sendreply() 
  7959.       svc_socks [] 
  7960.       svc_unregister() 
  7961.       svcerr_auth() 
  7962.       svcerr_decode() 
  7963.       svcerr_noproc() 
  7964.       svcerr_noprog() 
  7965.       svcerr_progvers() 
  7966.       svcerr_systemerr() 
  7967.       svcerr_weakauth() 
  7968.       svcraw_create() 
  7969.       svctcp_create() 
  7970.       svcudp_create() 
  7971.       xdr_accepted_reply() 
  7972.       xdr_array() 
  7973.       xdr_authunix_parms() 
  7974.       xdr_bool() 
  7975.       xdr_bytes() 
  7976.       xdr_callhdr() 
  7977.       xdr_callmsg() 
  7978.       xdr_double() 
  7979.       xdr_enum() 
  7980.       xdr_float() 
  7981.       xdr_getpos() 
  7982.       xdr_inline() 
  7983.       xdr_int() 
  7984.       xdr_long() 
  7985.       xdr_opaque() 
  7986.       xdr_opaque_auth() 
  7987.       xdr_pmap() 
  7988.       xdr_pmaplist() 
  7989.       xdr_reference() 
  7990.       xdr_rejected_reply() 
  7991.       xdr_replymsg() 
  7992.       xdr_setpos() 
  7993.       xdr_short() 
  7994.       xdr_string() 
  7995.       xdr_u_int() 
  7996.       xdr_u_long() 
  7997.       xdr_u_short() 
  7998.       xdr_union() 
  7999.       xdr_vector() 
  8000.       xdr_void() 
  8001.       xdr_wrapstring() 
  8002.       xdrmem_create() 
  8003.       xdrrec_create() 
  8004.       xdrrec_endofrecord() 
  8005.       xdrrec_eof() 
  8006.       xdrrec_skiprecord() 
  8007.       xdrstdio_create() 
  8008.       xprt_register() 
  8009.       xprt_unregister() 
  8010.  
  8011.  
  8012. ΓòÉΓòÉΓòÉ 9.14.1. auth_destroy() ΓòÉΓòÉΓòÉ
  8013.  
  8014. The auth_destroy() call destroys authentication information. 
  8015.  
  8016. Syntax 
  8017.  
  8018. #include <rpc\rpc.h>
  8019.  
  8020. void
  8021. auth_destroy(auth)
  8022. AUTH *auth;
  8023.  
  8024. Parameters 
  8025.  
  8026.  auth 
  8027.    Pointer to authentication information 
  8028.  
  8029.  Description 
  8030.  
  8031.  The auth_destroy() call deletes the authentication information for auth. After 
  8032.  you call this procedure, auth is undefined. 
  8033.  
  8034.  Related Calls 
  8035.  
  8036.   authnone_create()
  8037.   authunix_create()
  8038.   authunix_create_default()
  8039.  
  8040.  
  8041. ΓòÉΓòÉΓòÉ 9.14.2. authnone_create() ΓòÉΓòÉΓòÉ
  8042.  
  8043. The authnone_create() call creates and returns a NULL RPC authentication 
  8044. handle. 
  8045.  
  8046. Syntax 
  8047.  
  8048. #include <rpc\rpc.h>
  8049.  
  8050. AUTH *
  8051. authnone_create()
  8052.  
  8053. Description 
  8054.  
  8055. The authnone_create() call creates and returns an RPC authentication handle. 
  8056. The handle passes the NULL authentication on each call. 
  8057.  
  8058. Related Calls 
  8059.  
  8060. auth_destroy()
  8061. authunix_create()
  8062. authunix_create_default()
  8063.  
  8064.  
  8065. ΓòÉΓòÉΓòÉ 9.14.3. authunix_create() ΓòÉΓòÉΓòÉ
  8066.  
  8067. The authunix_create() call creates and returns a UNIX-based authentication 
  8068. handle. 
  8069.  
  8070. Syntax 
  8071.  
  8072. #include <rpc\rpc.h>
  8073.  
  8074. AUTH *
  8075. authunix_create(host, uid, gid, len, aup_gids)
  8076. char *host;
  8077. int uid;
  8078. int gid;
  8079. int len;
  8080. int *aup_gids;
  8081.  
  8082. Parameters 
  8083.  
  8084.  host 
  8085.    Pointer to the symbolic name of the host where the desired server is located 
  8086.  
  8087.  uid 
  8088.    User's user ID 
  8089.  
  8090.  gid 
  8091.    User's group ID 
  8092.  
  8093.  len 
  8094.    Length of the information pointed to by aup_gids 
  8095.  
  8096.  aup_gids 
  8097.    Pointer to an array of groups to which the user belongs 
  8098.  
  8099.  Description 
  8100.  
  8101.  The authunix_create() call creates and returns an authentication handle that 
  8102.  contains UNIX-based authentication information. 
  8103.  
  8104.  Related Calls 
  8105.  
  8106.   auth_destroy()
  8107.   authnone_create()
  8108.   authunix_create_default()
  8109.  
  8110.  
  8111. ΓòÉΓòÉΓòÉ 9.14.4. authunix_create_default() ΓòÉΓòÉΓòÉ
  8112.  
  8113. The authunix_create_default() call calls authunix_create() with default 
  8114. parameters. 
  8115.  
  8116. Syntax 
  8117.  
  8118. #include <rpc\rpc.h>
  8119.  
  8120. AUTH *
  8121. authunix_create_default()
  8122.  
  8123. Description 
  8124.  
  8125. The authunix_create_default() call calls authunix_create() with default 
  8126. parameters. 
  8127.  
  8128. Related Calls 
  8129.  
  8130. auth_destroy()
  8131. authnone_create()
  8132. authunix_create()
  8133.  
  8134.  
  8135. ΓòÉΓòÉΓòÉ 9.14.5. callrpc() ΓòÉΓòÉΓòÉ
  8136.  
  8137. The callrpc() call calls remote procedures. 
  8138.  
  8139. Syntax 
  8140.  
  8141. #include <rpc\rpc.h>
  8142.  
  8143. enum clnt_stat
  8144. callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
  8145. char *host;
  8146. u_long prognum;
  8147. u_long versnum;
  8148. u_long procnum;
  8149. xdrproc_t inproc;
  8150. char *in;
  8151. xdrproc_t outproc;
  8152. char *out;
  8153.  
  8154. Parameters 
  8155.  
  8156.  host 
  8157.    Pointer to the symbolic name of the host where the desired server is located 
  8158.  
  8159.  prognum 
  8160.    Program number of the remote procedure 
  8161.  
  8162.  versnum 
  8163.    Version number of the remote procedure 
  8164.  
  8165.  procnum 
  8166.    Procedure number of the remote procedure 
  8167.  
  8168.  inproc 
  8169.    XDR procedure used to encode the arguments of the remote procedure 
  8170.  
  8171.  in 
  8172.    Pointer to the arguments of the remote procedure 
  8173.  
  8174.  outproc 
  8175.    XDR procedure used to decode the results of the remote procedure 
  8176.  
  8177.  out 
  8178.    Pointer to the results of the remote procedure 
  8179.  
  8180.  Return Values 
  8181.  
  8182.  RPC_SUCCESS indicates success; otherwise, an error has occurred. The results 
  8183.  of the remote procedure call return to out. 
  8184.  
  8185.  Description 
  8186.  
  8187.  The callrpc() call calls the remote procedure described by prognum, versnum, 
  8188.  and procnum running on the host system.  It encodes and decodes the parameters 
  8189.  for transfer. 
  8190.  
  8191.  Note: 
  8192.  
  8193.    1. You can use clnt_perrno() to translate the return code into messages. 
  8194.  
  8195.    2. callrpc() cannot call the procedure xdr_enum. See xdr_enum() for more 
  8196.       information. 
  8197.  
  8198.    3. This procedure uses UDP as its transport layer. See clntudp_create() for 
  8199.       more information. 
  8200.  
  8201.  Examples 
  8202.  
  8203.   #define RMTPROGNUM (u_long)0x3fffffffL
  8204.   #define RMTPROGVER (u_long)0x1
  8205.   #define RMTPROCNUM (u_long)0x1
  8206.  
  8207.   int inproc=100, outproc, rstat;
  8208.   ...
  8209.   /* service request to host RPCSERVER_HOST */
  8210.   if (rstat = callrpc("RPCSERVER_HOST", RMTPROGNUM, RMTPROGVER, RMTPROCNUM,
  8211.                       xdr_int, (char *)&inproc, xdr_int,
  8212.                       (char *)&outproc)!= 0)
  8213.      {
  8214.        clnt_perrno(rstat);
  8215.        exit(1);
  8216.      }
  8217.   ...
  8218.  
  8219.  Related Calls 
  8220.  
  8221.   clnt_call()
  8222.   clnt_perrno()
  8223.   clntudp_create()
  8224.  
  8225.  
  8226. ΓòÉΓòÉΓòÉ 9.14.6. clnt_broadcast() ΓòÉΓòÉΓòÉ
  8227.  
  8228. The clnt_broadcast() call broadcasts a remote program to all locally connected 
  8229. broadcast networks. 
  8230.  
  8231. Syntax 
  8232.  
  8233. #include <rpc\rpc.h>
  8234.  
  8235. enum clnt_stat
  8236. clnt_broadcast(prognum, versnum, procnum, inproc, in,
  8237.                outproc, out, eachresult)
  8238. u_long prognum;
  8239. u_long versnum;
  8240. u_long procnum;
  8241. xdrproc_t inproc;
  8242. caddr_t in;
  8243. xdrproc_t outproc;
  8244. caddr_t out;
  8245. resultproc_t eachresult;
  8246.  
  8247. Parameters 
  8248.  
  8249.  prognum 
  8250.    Program number of the remote procedure 
  8251.  
  8252.  versnum 
  8253.    Version number of the remote procedure 
  8254.  
  8255.  procnum 
  8256.    Procedure number of the remote procedure 
  8257.  
  8258.  inproc 
  8259.    XDR procedure used to encode the arguments of the remote procedure 
  8260.  
  8261.  in 
  8262.    Pointer to the arguments of the remote procedure 
  8263.  
  8264.  outproc 
  8265.    XDR procedure used to decode the results of the remote procedure 
  8266.  
  8267.  out 
  8268.    Pointer to the results of the remote procedure 
  8269.  
  8270.  eachresult 
  8271.    Procedure called after each response 
  8272.  
  8273.  Note:  resultproc_t is a type definition: 
  8274.  
  8275.   typedef bool_t (*resultproc_t) ();
  8276.  
  8277.  Return Values 
  8278.  
  8279.  If eachresult() returns 0, clnt_broadcast() waits for more replies; otherwise, 
  8280.  eachresult() returns the appropriate status. 
  8281.  
  8282.  Note:  Broadcast sockets are limited in size to the maximum transfer unit of 
  8283.  the data link. 
  8284.  
  8285.  Description 
  8286.  
  8287.  The clnt_broadcast() call broadcasts a remote program described by prognum, 
  8288.  versnum, and procnum to all locally connected broadcast networks. Each time 
  8289.  clnt_broadcast() receives a response, it calls eachresult(). The format of 
  8290.  eachresult() is: 
  8291.  
  8292.   #include <netinet\in.h>
  8293.   #include <rpc\rpctypes.h>
  8294.  
  8295.   bool_t eachresult(out, addr)
  8296.   char *out;
  8297.   struct sockaddr_in *addr;
  8298.  
  8299.  Parameters 
  8300.  
  8301.  out 
  8302.    Has the same function as it does for clnt_broadcast(), except that the 
  8303.    output of the remote procedure is decoded 
  8304.  
  8305.  addr 
  8306.    Pointer to the address of the machine that sent the results 
  8307.  
  8308.  Examples 
  8309.  
  8310.   enum clnt_stat cs;
  8311.   u_long prognum, versnum;
  8312.   ...
  8313.   cs = clnt_broadcast(prognum, versnum, NULLPROC, xdr_void,
  8314.                       (char *)NULL, xdr_void, (char *)NULL, eachresult);
  8315.   if ((cs != RPC_SUCCESS) && (cs != RPC_TIMEDOUT))
  8316.     {
  8317.      fprintf( " broadcast failed: \n");
  8318.      exit(-1);
  8319.     }
  8320.   ...
  8321.   bool_t
  8322.   eachresult(out, addr)
  8323.   void *out;                                    /* Nothing comes back */
  8324.   struct sockaddr_in *addr;                        /* Reply from whom */
  8325.   {
  8326.       register struct hostent *hp;
  8327.       ...
  8328.       hp = gethostbyaddr((char *) &addr->sin_addr, sizeof addr->sin_addr,
  8329.           AF_INET);
  8330.       printf("%s %s\n", inet_ntoa(addr->sin_addr), hp->h_name);
  8331.       ...
  8332.       return(FALSE);
  8333.   }
  8334.  
  8335.  Related Calls 
  8336.  
  8337.   callrpc()
  8338.   clnt_call()
  8339.  
  8340.  
  8341. ΓòÉΓòÉΓòÉ 9.14.7. clnt_call() ΓòÉΓòÉΓòÉ
  8342.  
  8343. The clnt_call() call calls the remote procedure associated with the client 
  8344. handle. 
  8345.  
  8346. Syntax 
  8347.  
  8348. #include <rpc\rpc.h>
  8349.  
  8350. enum clnt_stat
  8351. clnt_call(clnt, procnum, inproc, in, outproc, out, tout)
  8352. CLIENT *clnt;
  8353. u_long procnum;
  8354. xdrproc_t inproc;
  8355. char *in;
  8356. xdrproc_t outproc;
  8357. char *out;
  8358. struct timeval tout;
  8359.  
  8360. Parameters 
  8361.  
  8362.  clnt 
  8363.    Pointer to a client handle that was previously obtained using 
  8364.    clntraw_create(), clnttcp_create(), or clntudp_create() 
  8365.  
  8366.  procnum 
  8367.    Remote procedure number 
  8368.  
  8369.  inproc 
  8370.    XDR procedure used to encode procnum's arguments 
  8371.  
  8372.  in 
  8373.    Pointer to the remote procedure's arguments 
  8374.  
  8375.  outproc 
  8376.    XDR procedure used to decode the remote procedure's results 
  8377.  
  8378.  out 
  8379.    Pointer to the remote procedure's results 
  8380.  
  8381.  tout 
  8382.    Time allowed for the server to respond, in units of 0.1 seconds 
  8383.  
  8384.  Return Values 
  8385.  
  8386.  RPC_SUCCESS indicates success; otherwise, an error has occurred. The results 
  8387.  of the remote procedure call are returned to out. 
  8388.  
  8389.  Description 
  8390.  
  8391.  The clnt_call() call calls the remote procedure (procnum) associated with the 
  8392.  client handle (clnt). 
  8393.  
  8394.  Examples 
  8395.  
  8396.   u_long procnum;
  8397.   register CLIENT *clnt;
  8398.   enum clnt_stat cs;
  8399.   struct timeval  total_timeout;
  8400.   int intsend, intrecv;
  8401.  
  8402.   cs=clnt_call(clnt, procnum, xdr_int, &intsend,
  8403.      xdr_int, &intrecv, total_timeout);
  8404.   if ( cs != RPC_SUCCESS)
  8405.          printf("*Error* clnt_call fail :\n");
  8406.  
  8407.  Related Calls 
  8408.  
  8409.   callrpc()
  8410.   clnt_perror()
  8411.   clntraw_create()
  8412.   clnttcp_create()
  8413.   clntudp_create()
  8414.  
  8415.  
  8416. ΓòÉΓòÉΓòÉ 9.14.8. clnt_destroy() ΓòÉΓòÉΓòÉ
  8417.  
  8418. The clnt_destroy() call destroys a client's RPC handle. 
  8419.  
  8420. Syntax 
  8421.  
  8422. #include <rpc\rpc.h>
  8423.  
  8424. void
  8425. clnt_destroy(clnt)
  8426. CLIENT *clnt;
  8427.  
  8428. Parameters 
  8429.  
  8430.  clnt 
  8431.    Pointer to a client handle that was previously created using 
  8432.    clntudp_create(), clnttcp_create(), or clntraw_create() 
  8433.  
  8434.  Description 
  8435.  
  8436.  The clnt_destroy() call deletes a client RPC transport handle. This procedure 
  8437.  involves the deallocation of private data resources, including clnt. After you 
  8438.  use this procedure, clnt is undefined. Open sockets associated with clnt must 
  8439.  be closed. 
  8440.  
  8441.  Related Calls 
  8442.  
  8443.   clntraw_create()
  8444.   clnttcp_create()
  8445.   clntudp_create()
  8446.  
  8447.  
  8448. ΓòÉΓòÉΓòÉ 9.14.9. clnt_freeres() ΓòÉΓòÉΓòÉ
  8449.  
  8450. The clnt_freeres() call deallocates resources assigned for decoding the results 
  8451. of an RPC. 
  8452.  
  8453. Syntax 
  8454.  
  8455. #include <rpc\rpc.h>
  8456.  
  8457. bool_t
  8458. clnt_freeres(clnt, outproc, out)
  8459. CLIENT *clnt;
  8460. xdrproc_t outproc;
  8461. char *out;
  8462.  
  8463. Parameters 
  8464.  
  8465.  clnt 
  8466.    Pointer to a client handle that was previously obtained using 
  8467.    clntraw_create(), clnttcp_create(), or clntudp_create() 
  8468.  
  8469.  outproc 
  8470.    XDR procedure used to decode the remote procedure's results 
  8471.  
  8472.  out 
  8473.    Pointer to the results of the remote procedure 
  8474.  
  8475.  Return Values 
  8476.  
  8477.  The value 1 indicates success; the value 0 indicates an error. 
  8478.  
  8479.  Description 
  8480.  
  8481.  The clnt_freeres() call de-allocates any resources that were assigned by the 
  8482.  system to decode the results of an RPC. 
  8483.  
  8484.  Related Calls 
  8485.  
  8486.   clntraw_create()
  8487.   clnttcp_create()
  8488.   clntudp_create()
  8489.  
  8490.  
  8491. ΓòÉΓòÉΓòÉ 9.14.10. clnt_geterr() ΓòÉΓòÉΓòÉ
  8492.  
  8493. The clnt_geterr() call copies the error structure from a client's handle to the 
  8494. local structure. 
  8495.  
  8496. Syntax 
  8497.  
  8498. #include <rpc\rpc.h>
  8499.  
  8500. void
  8501. clnt_geterr(clnt, errp)
  8502. CLIENT *clnt;
  8503. struct rpc_err *errp;
  8504.  
  8505. Parameters 
  8506.  
  8507.  clnt 
  8508.    Pointer to a client handle that was previously obtained using 
  8509.    clntraw_create(), clnttcp_create(), or clntudp_create() 
  8510.  
  8511.  errp 
  8512.    Pointer to the address into which the error structure is copied 
  8513.  
  8514.  Description 
  8515.  
  8516.  The clnt_geterr() call copies the error structure from the client handle to 
  8517.  the structure at address errp. 
  8518.  
  8519.  Examples 
  8520.  
  8521.   u_long procnum;
  8522.   register CLIENT *clnt;
  8523.   enum clnt_stat cs;
  8524.   struct timeval  total_timeout;
  8525.   int intsend = 100, intrecv;
  8526.   struct rpc_err error;
  8527.   ...
  8528.   total_timeout.tv_sec = 20;
  8529.   total_timeout.tv_usec = 0;
  8530.   ...
  8531.   cs=clnt_call(clnt, procnum, xdr_int, &intsend,
  8532.      xdr_int, &intrecv, total_timeout);
  8533.   if ( cs != RPC_SUCCESS)
  8534.        {
  8535.             clnt_geterr(clnt, &error);
  8536.             clnt_perror(clnt, "recv from server");
  8537.         }
  8538.   ...
  8539.  
  8540.  Related Calls 
  8541.  
  8542.   clnt_call()
  8543.   clnt_pcreateerror()
  8544.   clnt_perrno()
  8545.   clnt_perror()
  8546.   clntraw_create()
  8547.   clnttcp_create()
  8548.   clntudp_create()
  8549.  
  8550.  
  8551. ΓòÉΓòÉΓòÉ 9.14.11. clnt_pcreateerror() ΓòÉΓòÉΓòÉ
  8552.  
  8553. The clnt_pcreateerror() call indicates why a client handle cannot be created. 
  8554.  
  8555. Syntax 
  8556.  
  8557. #include <rpc\rpc.h>
  8558.  
  8559. void
  8560. clnt_pcreateerror(s)
  8561. char *s;
  8562.  
  8563. Parameters 
  8564.  
  8565.  s 
  8566.    Pointer to a string that is to be printed in front of the message. The 
  8567.    string is followed by a colon. 
  8568.  
  8569.  Description 
  8570.  
  8571.  The clnt_pcreateerror() call writes a message to the standard error device, 
  8572.  indicating why a client handle cannot be created. Use this procedure after the 
  8573.  clntraw_create(), clnttcp_create(), or clntudp_create() call fails. 
  8574.  
  8575.  For an example of the clnt_pcreateerror() call, see clnttcp_create(). 
  8576.  
  8577.  Related Calls 
  8578.  
  8579.   clnt_geterr()
  8580.   clnt_perrno()
  8581.   clnt_perror()
  8582.   clntraw_create()
  8583.   clnttcp_create()
  8584.   clntudp_create()
  8585.  
  8586.  
  8587. ΓòÉΓòÉΓòÉ 9.14.12. clnt_perrno() ΓòÉΓòÉΓòÉ
  8588.  
  8589. The clnt_perrno() call writes a message to the standard error device 
  8590. corresponding to the condition indicated by stat. 
  8591.  
  8592. Syntax 
  8593.  
  8594. #include <rpc\rpc.h>
  8595.  
  8596. void
  8597. clnt_perrno(stat)
  8598. enum clnt_stat stat;
  8599.  
  8600. Parameters 
  8601.  
  8602.  stat 
  8603.    The client status 
  8604.  
  8605.  Description 
  8606.  
  8607.  The clnt_perrno() call writes a message to the standard error device 
  8608.  corresponding to the condition indicated by stat. Use this procedure after 
  8609.  callrpc() and clnt_broadcast() if there is an error. 
  8610.  
  8611.  Related Calls 
  8612.  
  8613.   callrpc()
  8614.   clnt_geterr()
  8615.   clnt_pcreateerror()
  8616.   clnt_perror()
  8617.  
  8618.  
  8619. ΓòÉΓòÉΓòÉ 9.14.13. clnt_perror() ΓòÉΓòÉΓòÉ
  8620.  
  8621. The clnt_perror() call writes an error message indicating why RPC failed. 
  8622.  
  8623. Syntax 
  8624.  
  8625. #include <rpc\rpc.h>
  8626.  
  8627. void
  8628. clnt_perror(clnt, s)
  8629. CLIENT *clnt;
  8630. char *s;
  8631.  
  8632. Parameters 
  8633.  
  8634.  clnt 
  8635.    Pointer to a client handle that was previously obtained using 
  8636.    clntudp_create(), clnttcp_create(), or clntraw_create(). 
  8637.  
  8638.  s 
  8639.    Pointer to a string that is to be printed in front of the message. The 
  8640.    string is followed by a colon. 
  8641.  
  8642.  Description 
  8643.  
  8644.  The clnt_perror() call writes a message to the standard error device, 
  8645.  indicating why an RPC failed. Use this procedure after clnt_call() if there is 
  8646.  an error. 
  8647.  
  8648.  For an example of the clnt_perror() call, see clnt_geterr(). 
  8649.  
  8650.  Related Calls 
  8651.  
  8652.   clnt_call()
  8653.   clnt_geterr()
  8654.   clnt_pcreateerror()
  8655.   clnt_perrno()
  8656.   clntraw_create()
  8657.   clnttcp_create()
  8658.   clntudp_create()
  8659.  
  8660.  
  8661. ΓòÉΓòÉΓòÉ 9.14.14. clntraw_create() ΓòÉΓòÉΓòÉ
  8662.  
  8663. The clntraw_create() call creates a client transport handle to use in a single 
  8664. task. 
  8665.  
  8666. Syntax 
  8667.  
  8668. #include <rpc\rpc.h>
  8669.  
  8670. CLIENT *
  8671. clntraw_create(prognum, versnum)
  8672. u_long prognum;
  8673. u_long versnum;
  8674.  
  8675. Parameters 
  8676.  
  8677.  prognum 
  8678.    Remote program number 
  8679.  
  8680.  versnum 
  8681.    Version number of the remote program 
  8682.  
  8683.  Return Values 
  8684.  
  8685.  NULL indicates failure. 
  8686.  
  8687.  Description 
  8688.  
  8689.  The clntraw_create() call creates a dummy client for the remote double 
  8690.  (prognum, versnum). Because messages are passed using a buffer within the 
  8691.  address space of the local process, the server should also use the same 
  8692.  address space, which simulates RPC programs within one address space. See 
  8693.  svcraw_create() for more information. 
  8694.  
  8695.  Related Calls 
  8696.  
  8697.   clnt_call()
  8698.   clnt_destroy()
  8699.   clnt_pcreateerror()
  8700.   clnttcp_create()
  8701.   clntudp_create()
  8702.   svcraw_create()
  8703.  
  8704.  
  8705. ΓòÉΓòÉΓòÉ 9.14.15. clnttcp_create() ΓòÉΓòÉΓòÉ
  8706.  
  8707. The clnttcp_create() call creates an RPC client transport handle for the remote 
  8708. program using TCP transport. 
  8709.  
  8710. Syntax 
  8711.  
  8712. #include <rpc\rpc.h>
  8713.  
  8714. CLIENT *
  8715. clnttcp_create(addr, prognum, versnum, sockp, sendsz, recvsz)
  8716. struct sockaddr_in *addr;
  8717. u_long prognum;
  8718. u_long versnum;
  8719. int *sockp;
  8720. u_int sendsz;
  8721. u_int recvsz;
  8722.  
  8723. Parameters 
  8724.  
  8725.  addr 
  8726.    Pointer to the internet address of the remote program. If addr points to a 
  8727.    port number of 0, addr is set to the port on which the remote program is 
  8728.    receiving. 
  8729.  
  8730.  prognum 
  8731.    Remote program number. 
  8732.  
  8733.  versnum 
  8734.    Version number of the remote program. 
  8735.  
  8736.  sockp 
  8737.    Pointer to the socket. If sockp is RPC_ANYSOCK, then this routine opens a 
  8738.    new socket and sets sockp. 
  8739.  
  8740.  sendsz 
  8741.    Size of the send buffer.  Specify 0 to have clnttcp_create() pick a suitable 
  8742.    default size. 
  8743.  
  8744.  recvsz 
  8745.    Size of the receive buffer.  Specify 0 to have clnttcp_create() pick a 
  8746.    suitable default size. 
  8747.  
  8748.  Return Values 
  8749.  
  8750.  NULL indicates failure. 
  8751.  
  8752.  Description 
  8753.  
  8754.  The clnttcp_create() call creates an RPC client transport handle for the 
  8755.  remote program specified by (prognum, versnum).  The client uses TCP as the 
  8756.  transport layer. 
  8757.  
  8758.  Examples 
  8759.  
  8760.   #define RMTPROGNUM   (u_long)0x3fffffffL
  8761.   #define RMTPROGVER   (u_long)0x1L
  8762.  
  8763.   register CLIENT *clnt;
  8764.   int sock = RPC_ANYSOCK; /* can be also valid socket descriptor */
  8765.   struct hostent *hp;
  8766.   struct sockaddr_in server_addr;
  8767.  
  8768.   /* get the internet address of RPC server */
  8769.   if ((hp = gethostbyname("RPCSERVER_HOST") == NULL)
  8770.     {
  8771.       fprintf(stderr,"Can't get address for %s\n",argv[2]);
  8772.       exit (-1);
  8773.     }
  8774.  
  8775.   bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr, hp->h_length);
  8776.   server_addr.sin_family = AF_INET;
  8777.   server_addr.sin_port = 0;
  8778.  
  8779.   /* create TCP handle */
  8780.   if  ((clnt = clnttcp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  8781.                                &sock, 1024*10, 1024*10)) == NULL)
  8782.      {
  8783.        clnt_pcreateerror("clnttcp_create");
  8784.        exit(-1);
  8785.       }
  8786.  
  8787.  Related Calls 
  8788.  
  8789.   clnt_destroy()
  8790.   clnt_pcreateerror()
  8791.   clntraw_create()
  8792.   clntudp_create()
  8793.  
  8794.  
  8795. ΓòÉΓòÉΓòÉ 9.14.16. clntudp_create() ΓòÉΓòÉΓòÉ
  8796.  
  8797. The clntudp_create() call creates an RPC client transport handle for the remote 
  8798. program using UDP transport. 
  8799.  
  8800. Syntax 
  8801.  
  8802. #include <rpc\rpc.h>
  8803. #include <netdb.h>
  8804.  
  8805. CLIENT *
  8806. clntudp_create(addr, prognum, versnum, wait, sockp)
  8807. struct sockaddr_in *addr;
  8808. u_long prognum;
  8809. u_long versnum;
  8810. struct timeval wait;
  8811. int *sockp;
  8812.  
  8813. Parameters 
  8814.  
  8815.  addr 
  8816.    Pointer to the internet address of the remote program. If addr points to a 
  8817.    port number of 0, addr is set to the port on which the remote program is 
  8818.    receiving. The remote PORTMAP service is used for this. 
  8819.  
  8820.  prognum 
  8821.    Remote program number. 
  8822.  
  8823.  versnum 
  8824.    Version number of the remote program. 
  8825.  
  8826.  wait 
  8827.    Interval at which UDP resends the call request, until either a response is 
  8828.    received or the call times out. Set the time-out length using the 
  8829.    clnt_call() procedure. 
  8830.  
  8831.  sockp 
  8832.    Pointer to the socket. If sockp is RPC_ANYSOCK, this routine opens a new 
  8833.    socket and sets sockp. 
  8834.  
  8835.  Return Values 
  8836.  
  8837.  NULL indicates failure. 
  8838.  
  8839.  Description 
  8840.  
  8841.  The clntudp_create() call creates a client transport handle for the remote 
  8842.  program (prognum) with version (versnum).  UDP is used as the transport layer. 
  8843.  
  8844.  Note:  Do not use this procedure with procedures that use large arguments or 
  8845.  return large results. UDP RPC messages can contain only 2K bytes of encoded 
  8846.  data. 
  8847.  
  8848.  Examples 
  8849.  
  8850.   #define RMTPROGNUM   (u_long)0x3fffffffL
  8851.   #define RMTPROGVER   (u_long)0x1L
  8852.  
  8853.   register CLIENT *clnt;
  8854.   int sock = RPC_ANYSOCK; /* can be also valid socket descriptor */
  8855.   struct hostent *hp;
  8856.   struct timeval pertry_timeout;
  8857.   struct sockaddr_in server_addr;
  8858.  
  8859.   /* get the internet address of RPC server */
  8860.   if ((hp = gethostbyname("RPC_HOST") == NULL)
  8861.     {
  8862.       fprintf(stderr,"Can't get address for %s\n",argv[2]);
  8863.       exit (-1);
  8864.     }
  8865.  
  8866.   pertry_timeout.tv_sec = 3;
  8867.   pertry_timeout.tv_usec = 0;
  8868.   bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr, hp->h_length);
  8869.   server_addr.sin_family = AF_INET;
  8870.   server_addr.sin_port = 0;
  8871.  
  8872.   /* create UDP handle */
  8873.   if ((clnt = clntudp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  8874.                                pertry_timeout, &sock)) == NULL)
  8875.      {
  8876.       clnt_pcreateerror("clntudp_create");
  8877.       exit(-1);
  8878.      }
  8879.  
  8880.  Related Calls 
  8881.  
  8882.   clnt_destroy()
  8883.   clnt_pcreateerror()
  8884.   clntraw_create()
  8885.   clnttcp_create()
  8886.  
  8887.  
  8888. ΓòÉΓòÉΓòÉ 9.14.17. get_myaddress() ΓòÉΓòÉΓòÉ
  8889.  
  8890. The get_myaddress() call returns the local host's internet address. 
  8891.  
  8892. Syntax 
  8893.  
  8894. #include <rpc\rpc.h>
  8895.  
  8896. void
  8897. get_myaddress(addr)
  8898. struct sockaddr_in *addr;
  8899.  
  8900. Parameters 
  8901.  
  8902.  addr 
  8903.    Pointer to the location where the local internet address is placed 
  8904.  
  8905.  Description 
  8906.  
  8907.  The get_myaddress() call puts the local host's internet address into addr. The 
  8908.  port number (addr->sin_port) is set to htons (PMAPPORT), which is 111. 
  8909.  
  8910.  
  8911. ΓòÉΓòÉΓòÉ 9.14.18. getrpcbyname() ΓòÉΓòÉΓòÉ
  8912.  
  8913. The getrpcbyname() call returns an RPC program entry specified by a name in the 
  8914. RPC file. 
  8915.  
  8916. Syntax 
  8917.  
  8918. #include <rpcnetdb.h>
  8919.  
  8920. struct rpcent *getrpcbyname(name)
  8921. char  *name;
  8922.  
  8923. Parameters 
  8924.  
  8925.  name 
  8926.    Pointer to the specified RPC program 
  8927.  
  8928.  Return Values 
  8929.  
  8930.  The getrpcbyname() call returns a pointer to an object with the rpcent 
  8931.  structure for the RPC program specified on the call. The rpcent structure is 
  8932.  defined in the <RPC\RPCNETDB.H> header file and contains the following 
  8933.  elements: 
  8934.  
  8935.  Element       Description 
  8936.  
  8937.  r_name        The name of the server for this RPC program 
  8938.  
  8939.  r_aliases     A zero terminated list of alternate names for the RPC program 
  8940.  
  8941.  r_number      The RPC program number for this service 
  8942.  
  8943.  The return value points to static data that later calls overwrite. A pointer 
  8944.  to an rpcent structure indicates success. A NULL pointer indicates an error or 
  8945.  EOF. 
  8946.  
  8947.  Description 
  8948.  
  8949.  The getrpcbyname() call sequentially searches from the beginning of the 
  8950.  TCPIP\ETC\RPC file until it finds a matching RPC program name or encounters 
  8951.  EOF. 
  8952.  
  8953.  Related Calls 
  8954.  
  8955.   getrpcbynumber()
  8956.   getrpcent()
  8957.  
  8958.  
  8959. ΓòÉΓòÉΓòÉ 9.14.19. getrpcbynumber() ΓòÉΓòÉΓòÉ
  8960.  
  8961. The getrpcbynumber() call returns an RPC program entry specified by a number in 
  8962. the RPC file. 
  8963.  
  8964. Syntax 
  8965.  
  8966. #include <rpcnetdb.h>
  8967.  
  8968. struct rpcent *getrpcbynumber(number)
  8969. u_long number;
  8970.  
  8971. Parameters 
  8972.  
  8973.  number 
  8974.    RPC program number 
  8975.  
  8976.  Return Values 
  8977.  
  8978.  The getrpcbynumber() call returns a pointer to an object with the rpcent 
  8979.  structure for the RPC program specified on the call. The rpcent structure is 
  8980.  defined in <RPC\RPCNETDB.H> header file and contains the following elements: 
  8981.  
  8982.  Element       Description 
  8983.  
  8984.  r_name        The name of the server for this RPC program 
  8985.  
  8986.  r_aliases     A zero terminated list of alternate names for the RPC program 
  8987.  
  8988.  r_number      The RPC program number for this service 
  8989.  
  8990.  The return value points to static data that later calls overwrite. A pointer 
  8991.  to an rpcent structure indicates success. A NULL pointer indicates an error or 
  8992.  EOF. 
  8993.  
  8994.  Description 
  8995.  
  8996.  The getrpcbynumber() call sequentially searches from the beginning of the 
  8997.  TCPIP\ETC\RPC file until it finds a matching RPC program number or encounters 
  8998.  EOF. 
  8999.  
  9000.  Related Calls 
  9001.  
  9002.   getrpcbyname()
  9003.   getrpcent()
  9004.  
  9005.  
  9006. ΓòÉΓòÉΓòÉ 9.14.20. getrpcent() ΓòÉΓòÉΓòÉ
  9007.  
  9008. The getrpcent() call returns the next entry in the RPC file. 
  9009.  
  9010. Syntax 
  9011.  
  9012. #include <rpcnetdb.h>
  9013.  
  9014. struct rpcent *getrpcent()
  9015.  
  9016. Return Values 
  9017.  
  9018. The getrpcent() call returns a pointer to the next entry in the TCPIP\ETC\RPC 
  9019. file. The rpcent structure is defined in the <RPC\RPCNETDB.H> header file and 
  9020. contains the following elements: 
  9021.  
  9022.  Element       Description 
  9023.  
  9024.  r_name        The name of the server for this RPC program 
  9025.  
  9026.  r_aliases     A zero terminated list of alternate names for the RPC program 
  9027.  
  9028.  r_number      The RPC program number for this service 
  9029.  
  9030.  The return value points to static data that later calls overwrite. A pointer 
  9031.  to an rpcent structure indicates success. A NULL pointer indicates an error or 
  9032.  EOF. 
  9033.  
  9034.  Description 
  9035.  
  9036.  The getrpcent() call searches for the next line in the TCPIP\ETC\RPC file. 
  9037.  
  9038.  Related Calls 
  9039.  
  9040.   getrpcbyname()
  9041.   getrpcbynumber()
  9042.  
  9043.  
  9044. ΓòÉΓòÉΓòÉ 9.14.21. pmap_getmaps() ΓòÉΓòÉΓòÉ
  9045.  
  9046. The pmap_getmaps() call returns a list of current program-to-port mappings on a 
  9047. specified remote host's Portmapper. 
  9048.  
  9049. Syntax 
  9050.  
  9051. #include <rpc\rpc.h>
  9052.  
  9053. struct pmaplist *
  9054. pmap_getmaps(addr)
  9055. struct sockaddr_in *addr;
  9056.  
  9057. Parameters 
  9058.  
  9059.  addr 
  9060.    Pointer to the internet address of the remote host 
  9061.  
  9062.  Description 
  9063.  
  9064.  The pmap_getmaps() call returns a list of current program-to-port mappings on 
  9065.  the remote host's Portmapper specified by addr. 
  9066.  
  9067.  Examples 
  9068.  
  9069.   struct hostent *hp;
  9070.   struct sockaddr_in pmapper_addr;
  9071.   struct pmaplist *my_pmaplist = NULL;
  9072.  
  9073.   if ((hp = gethostbyname("PMAP_HOST") == NULL)
  9074.     {
  9075.       fprintf(stderr,"Can't get address for %s\n","PMAP_HOST");
  9076.       exit (-1);
  9077.     }
  9078.  
  9079.   bcopy(hp->h_addr, (caddr_t)&pmapper_addr.sin_addr.s_addr, hp->h_length);
  9080.   pmapper_addr.sin_family = AF_INET;
  9081.   pmapper_addr.sin_port = 0;
  9082.  
  9083.   /*
  9084.    *  get the list of program, version, protocol and port number
  9085.    *  from remote portmapper
  9086.    *
  9087.    *     struct pmap {
  9088.    *              long unsigned pm_prog;
  9089.    *              long unsigned pm_vers;
  9090.    *              long unsigned pm_prot;
  9091.    *              long unsigned pm_port;
  9092.    *             };
  9093.  
  9094.    *     struct pmaplist {
  9095.    *             struct pmap     pml_map;
  9096.    *             struct pmaplist *pml_next;
  9097.    *            };
  9098.    */
  9099.    my_pmaplist = pmap_getmaps(&pmapper_addr);
  9100.    ...
  9101.  
  9102.  Related Calls 
  9103.  
  9104.   pmap_getport()
  9105.   pmap_rmtcall()
  9106.   pmap_set()
  9107.   pmap_unset()
  9108.  
  9109.  
  9110. ΓòÉΓòÉΓòÉ 9.14.22. pmap_getport() ΓòÉΓòÉΓòÉ
  9111.  
  9112. The pmap_getport() call returns the port number associated with a remote 
  9113. program. 
  9114.  
  9115. Syntax 
  9116.  
  9117. #include <rpc\rpc.h>
  9118.  
  9119. u_short
  9120. pmap_getport(addr, prognum, versnum, protocol)
  9121. struct sockaddr_in *addr;
  9122. u_long prognum;
  9123. u_long versnum;
  9124. u_long protocol;
  9125.  
  9126. Parameters 
  9127.  
  9128.  addr 
  9129.    Pointer to the internet address of the remote host 
  9130.  
  9131.  prognum 
  9132.    Program number to be mapped 
  9133.  
  9134.  versnum 
  9135.    Version number of the program to be mapped 
  9136.  
  9137.  protocol 
  9138.    Transport protocol used by the program 
  9139.  
  9140.  Return Values 
  9141.  
  9142.  The value 0 indicates that the mapping does not exist or that the remote 
  9143.  PORTMAP could not be contacted. If Portmapper cannot be contacted, 
  9144.  rpc_createerr contains the RPC status. 
  9145.  
  9146.  Description 
  9147.  
  9148.  The pmap_getport() call returns the port number associated with the remote 
  9149.  program (prognum), the version (versnum), and the transport protocol 
  9150.  (protocol). 
  9151.  
  9152.  Related Calls 
  9153.  
  9154.   pmap_getmaps()
  9155.   pmap_rmtcall()
  9156.   pmap_set()
  9157.   pmap_unset()
  9158.  
  9159.  
  9160. ΓòÉΓòÉΓòÉ 9.14.23. pmap_rmtcall() ΓòÉΓòÉΓòÉ
  9161.  
  9162. The pmap_rmtcall() call instructs Portmapper to make an RPC call to a procedure 
  9163. on a host on your behalf. 
  9164.  
  9165. Syntax 
  9166.  
  9167. #include <rpc\rpc.h>
  9168. #include <netdb.h>
  9169.  
  9170. enum clnt_stat
  9171. pmap_rmtcall(addr, prognum, versnum, procnum, inproc, in,
  9172.              outproc, out, tout, portp)
  9173. struct sockaddr_in *addr;
  9174. u_long prognum;
  9175. u_long versnum;
  9176. u_long procnum;
  9177. xdrproc_t inproc;
  9178. char *in;
  9179. xdrproc_t outproc;
  9180. char *out;
  9181. struct timeval tout;
  9182. u_long *portp;
  9183.  
  9184. Parameters 
  9185.  
  9186.  addr 
  9187.    Pointer to the internet address of the foreign host 
  9188.  
  9189.  prognum 
  9190.    Remote program number 
  9191.  
  9192.  versnum 
  9193.    Version number of the remote program 
  9194.  
  9195.  procnum 
  9196.    Procedure to be called 
  9197.  
  9198.  inproc 
  9199.    XDR procedure that encodes the arguments of the remote procedure 
  9200.  
  9201.  in 
  9202.    Pointer to the arguments of the remote procedure 
  9203.  
  9204.  outproc 
  9205.    XDR procedure that decodes the results of the remote procedure 
  9206.  
  9207.  out 
  9208.    Pointer to the results of the remote procedure 
  9209.  
  9210.  tout 
  9211.    Time-out period for the remote request 
  9212.  
  9213.  portp 
  9214.    Port number of the triple (prognum, versnum, procnum), if the call from the 
  9215.    remote PORTMAP service succeeds 
  9216.  
  9217.  Return Values 
  9218.  
  9219.  RPC_SUCCESS indicates success; otherwise, an error has occurred. The results 
  9220.  of the remote procedure call return to out. 
  9221.  
  9222.  Description 
  9223.  
  9224.  The pmap_rmtcall() call instructs Portmapper to make an RPC call to a 
  9225.  procedure on a host, on your behalf. Use this procedure only for ping-type 
  9226.  functions. 
  9227.  
  9228.  Examples 
  9229.  
  9230.   int inproc, outproc,rc;
  9231.   u_long portp;
  9232.   struct timeval total_timeout;
  9233.   struct sockaddr_in *addr;
  9234.   ...
  9235.   get_myaddress(addr);
  9236.   ...
  9237.   total_timeout.tv_sec = 20;
  9238.   total_timeout.tv_usec = 0;
  9239.  
  9240.   rc = pmap_rmtcall(addr,RMTPROGNUM,RMTPROGVER,RMTPROCNUM,xdr_int,
  9241.                     &inproc,xdr_int,&outproc,total_timeout,&portp);
  9242.   if (rc != 0)
  9243.    {
  9244.      fprintf(stderr,"error: pmap_rmtcall() failed: %d \n",rc);
  9245.      clnt_perrno(rc);
  9246.      exit(1);
  9247.    }
  9248.  
  9249.  Related Calls 
  9250.  
  9251.   pmap_getmaps()
  9252.   pmap_getport()
  9253.   pmap_set()
  9254.   pmap_unset()
  9255.  
  9256.  
  9257. ΓòÉΓòÉΓòÉ 9.14.24. pmap_set() ΓòÉΓòÉΓòÉ
  9258.  
  9259. The pmap_set() call sets the mapping of a server program to a port on the local 
  9260. machine's Portmapper. 
  9261.  
  9262. Syntax 
  9263.  
  9264. #include <rpc\rpc.h>
  9265.  
  9266. bool_t
  9267. pmap_set(prognum, versnum, protocol, port)
  9268. u_long prognum;
  9269. u_long versnum;
  9270. u_long protocol;
  9271. u_short port;
  9272.  
  9273. Parameters 
  9274.  
  9275.  prognum 
  9276.    Local program number 
  9277.  
  9278.  versnum 
  9279.    Version number of the local program 
  9280.  
  9281.  protocol 
  9282.    Transport protocol used by the local program 
  9283.  
  9284.  port 
  9285.    Port to which the local program is mapped 
  9286.  
  9287.  Return Values 
  9288.  
  9289.  The value 1 indicates success; the value 0 indicates an error. 
  9290.  
  9291.  Description 
  9292.  
  9293.  The pmap_set() call sets the mapping of the program (specified by prognum, 
  9294.  versnum, and protocol) to port on the local machine's Portmapper. This 
  9295.  procedure is automatically called by the svc_register() procedure. 
  9296.  
  9297.  Related Calls 
  9298.  
  9299.   pmap_getmaps()
  9300.   pmap_getport()
  9301.   pmap_rmtcall()
  9302.   pmap_unset()
  9303.  
  9304.  
  9305. ΓòÉΓòÉΓòÉ 9.14.25. pmap_unset() ΓòÉΓòÉΓòÉ
  9306.  
  9307. The pmap_unset() call removes the mappings on the local machine's Portmapper. 
  9308.  
  9309. Syntax 
  9310.  
  9311. #include <rpc\rpc.h>
  9312.  
  9313. bool_t
  9314. pmap_unset(prognum, versnum)
  9315. u_long prognum;
  9316. u_long versnum;
  9317.  
  9318. Parameters 
  9319.  
  9320.  prognum 
  9321.    Local program number 
  9322.  
  9323.  versnum 
  9324.    Version number of the local program 
  9325.  
  9326.  Return Values 
  9327.  
  9328.  The value 1 indicates success; the value 0 indicates an error. 
  9329.  
  9330.  Description 
  9331.  
  9332.  The pmap_unset() call removes the mappings associated with prognum and versnum 
  9333.  on the local machine's Portmapper. All ports for each transport protocol 
  9334.  currently mapping the prognum and versnum are removed from the PORTMAP 
  9335.  service. 
  9336.  
  9337.  Examples 
  9338.  
  9339.   #define RMTPROGNUM   (u_long)0x3fffffffL
  9340.   #define RMTPROGVER   (u_long)0x1L
  9341.   ...
  9342.   /* remove the mapping of remote program */
  9343.   /* and its port from local portmapper   */
  9344.   pmap_unset(RMTPROGNUM, RMTPROGVER);
  9345.   ...
  9346.  
  9347.  Related Calls 
  9348.  
  9349.   pmap_getmaps()
  9350.   pmap_getport()
  9351.   pmap_rmtcall()
  9352.   pmap_set()
  9353.  
  9354.  
  9355. ΓòÉΓòÉΓòÉ 9.14.26. registerrpc() ΓòÉΓòÉΓòÉ
  9356.  
  9357. The registerrpc() call registers a procedure with the local Portmapper. 
  9358.  
  9359. Syntax 
  9360.  
  9361. #include <rpc\rpc.h>
  9362.  
  9363. int
  9364. registerrpc(prognum, versnum, procnum, procname, inproc, outproc)
  9365. u_long prognum;
  9366. u_long versnum;
  9367. u_long procnum;
  9368. char *(*procname) ();
  9369. xdrproc_t inproc;
  9370. xdrproc_t outproc;
  9371.  
  9372. Parameters 
  9373.  
  9374.  prognum 
  9375.    Program number to register. 
  9376.  
  9377.  versnum 
  9378.    Version number to register. 
  9379.  
  9380.  procnum 
  9381.    Procedure number to register. 
  9382.  
  9383.  procname 
  9384.    Procedure that is called when the registered program is requested. procname 
  9385.    must accept a pointer to its arguments and return a static pointer to its 
  9386.    results. 
  9387.  
  9388.  inproc 
  9389.    XDR procedure that decodes the arguments. 
  9390.  
  9391.  outproc 
  9392.    XDR procedure that encodes the results. 
  9393.  
  9394.  Note:  You cannot use xdr_enum() as an argument to registerrpc(). See 
  9395.  xdr_enum() for more information. 
  9396.  
  9397.  Return Values 
  9398.  
  9399.  The value 0 indicates success; the value -1 indicates an error. 
  9400.  
  9401.  Description 
  9402.  
  9403.  The registerrpc() call registers a procedure with the local Portmapper and 
  9404.  creates a control structure to remember the server procedure and its XDR 
  9405.  routine. The svc_run() call uses the control structure. Procedures registered 
  9406.  using registerrpc() are accessed using the UDP transport layer. 
  9407.  
  9408.  Examples 
  9409.  
  9410.   #define RMTPROGNUM (u_long)0x3fffffffL
  9411.   #define RMTPROGVER (u_long)0x1
  9412.   #define RMTPROCNUM (u_long)0x1
  9413.  
  9414.   main()
  9415.    {
  9416.     int *rmtprog();
  9417.  
  9418.     /* register remote program with portmapper */
  9419.     registerrpc(RMTPROGNUM, RMTPROGVER, RMTPROCNUM, rmtprog,
  9420.                        xdr_int, xdr_int);
  9421.  
  9422.     /* infinite loop, waits for RPC request from client */
  9423.     svc_run();
  9424.     printf("Error: svc_run should never reach this point \n");
  9425.     exit(1);
  9426.    }
  9427.  
  9428.   int *
  9429.   rmtprog(inproc)          /* remote program */
  9430.   int *inproc;
  9431.  
  9432.   {
  9433.    int *outproc;
  9434.    ...
  9435.    /* Process request */
  9436.    ...
  9437.    return (outproc);
  9438.   }
  9439.  
  9440.  Related Calls 
  9441.  
  9442.   svc_register()
  9443.   svc_run()
  9444.  
  9445.  
  9446. ΓòÉΓòÉΓòÉ 9.14.27. rpc_createerr ΓòÉΓòÉΓòÉ
  9447.  
  9448. rpc_createerr is a global variable set when any RPC client creation routine 
  9449. fails. 
  9450.  
  9451. Syntax 
  9452.  
  9453. #include <rpc\rpc.h>
  9454.  
  9455. struct  rpc_createerr rpc_createerr;
  9456.  
  9457. Description 
  9458.  
  9459. rpc_createerr is a global variable that is set when any RPC client creation 
  9460. routine fails. Use clnt_pcreateerror() to print the message. 
  9461.  
  9462.  
  9463. ΓòÉΓòÉΓòÉ 9.14.28. svc_destroy() ΓòÉΓòÉΓòÉ
  9464.  
  9465. The svc_destroy() call destroys the RPC service transport handle. 
  9466.  
  9467. Syntax 
  9468.  
  9469. #include <rpc\rpc.h>
  9470.  
  9471. void
  9472. svc_destroy(xprt)
  9473. SVCXPRT *xprt;
  9474.  
  9475. Parameter 
  9476.  
  9477.  xprt 
  9478.    Pointer to the service transport handle 
  9479.  
  9480.  Description 
  9481.  
  9482.  The svc_destroy() call deletes the RPC service transport handle xprt, which 
  9483.  becomes undefined after this routine is called. 
  9484.  
  9485.  Related Calls 
  9486.  
  9487.   svcraw_create()
  9488.   svctcp_create()
  9489.   svcudp_create()
  9490.  
  9491.  
  9492. ΓòÉΓòÉΓòÉ 9.14.29. svc_freeargs() ΓòÉΓòÉΓòÉ
  9493.  
  9494. The svc_freeargs() call frees storage allocated for argument decoding. 
  9495.  
  9496. Syntax 
  9497.  
  9498. #include <rpc\rpc.h>
  9499.  
  9500. bool_t
  9501. svc_freeargs(xprt, inproc, in)
  9502. SVCXPRT *xprt;
  9503. xdrproc_t inproc;
  9504. char *in;
  9505.  
  9506. Parameters 
  9507.  
  9508.  xprt 
  9509.    Pointer to the service transport handle 
  9510.  
  9511.  inproc 
  9512.    XDR routine that decodes the arguments 
  9513.  
  9514.  in 
  9515.    Pointer to the input arguments 
  9516.  
  9517.  Return Values 
  9518.  
  9519.  The value 1 indicates success; the value 0 indicates an error. 
  9520.  
  9521.  Description 
  9522.  
  9523.  The svc_freeargs() call frees storage allocated to decode the arguments 
  9524.  received by svc_getargs(). 
  9525.  
  9526.  Related Calls 
  9527.  
  9528.   svc_getargs()
  9529.  
  9530.  
  9531. ΓòÉΓòÉΓòÉ 9.14.30. svc_getargs() ΓòÉΓòÉΓòÉ
  9532.  
  9533. The svc_getargs() call decodes arguments from an RPC request. 
  9534.  
  9535. Syntax 
  9536.  
  9537. #include <rpc\rpc.h>
  9538.  
  9539. bool_t
  9540. svc_getargs(xprt, inproc, in)
  9541. SVCXPRT *xprt;
  9542. xdrproc_t inproc;
  9543. char *in;
  9544.  
  9545. Parameters 
  9546.  
  9547.  xprt 
  9548.    Pointer to the service transport handle 
  9549.  
  9550.  inproc 
  9551.    XDR routine that decodes the arguments 
  9552.  
  9553.  in 
  9554.    Pointer to the decoded arguments 
  9555.  
  9556.  Return Values 
  9557.  
  9558.  The value 1 indicates success; the value 0 indicates an error. 
  9559.  
  9560.  Description 
  9561.  
  9562.  The svc_getargs() call uses the XDR routine inproc to decode the arguments of 
  9563.  an RPC request associated with the RPC service transport handle xprt. The 
  9564.  results are placed at address in. 
  9565.  
  9566.  Examples 
  9567.  
  9568.   #define RMTPROGNUM   (u_long)0x3fffffffL
  9569.   #define RMTPROGVER   (u_long)0x1L
  9570.  
  9571.   ...
  9572.  
  9573.   SVCXPRT *transp;
  9574.  
  9575.   transp = svcudp_create(RPC_ANYSOCK);
  9576.   if (transp == NULL)
  9577.      {
  9578.         fprintf(stderr, "can't create an RPC server transport\n");
  9579.         exit(-1);
  9580.      }
  9581.   pmap_unset(RMTPROGNUM, RMTPROGVER);
  9582.   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  9583.      {
  9584.         fprintf(stderr, "can't register rmtprog() service\n");
  9585.         exit(-1);
  9586.      }
  9587.   printf("rmtprog() service registered.\n");
  9588.  
  9589.   svc_run();
  9590.   printf("Error:svc_run should never reach this point \n");
  9591.   exit(1);
  9592.   ...
  9593.  
  9594.   rmtprog(rqstp, transp)
  9595.   struct svc_req *rqstp;
  9596.   SVCXPRT *transp;
  9597.   {
  9598.       int intrecv;
  9599.  
  9600.        switch((int)rqstp->rq_proc)
  9601.           {
  9602.                case PROCNUM1:
  9603.                         svc_getargs(transp, xdr_int, &intrecv);
  9604.                         ...
  9605.                         return;
  9606.                case PROCNUM2:
  9607.                ...
  9608.             }
  9609.   ...
  9610.   }
  9611.  
  9612.  Related Calls 
  9613.  
  9614.   svc_freeargs()
  9615.  
  9616.  
  9617. ΓòÉΓòÉΓòÉ 9.14.31. svc_getcaller() ΓòÉΓòÉΓòÉ
  9618.  
  9619. The svc_getcaller() call gets the network address of the client associated with 
  9620. the service transport handle. 
  9621.  
  9622. Syntax 
  9623.  
  9624. #include <rpc\rpc.h>
  9625.  
  9626. struct sockaddr_in *
  9627. svc_getcaller(xprt)
  9628. SVCXPRT *xprt;
  9629.  
  9630. Parameters 
  9631.  
  9632.  xprt 
  9633.    Pointer to the service transport handle 
  9634.  
  9635.  Description 
  9636.  
  9637.  This call gets the network address of the client associated with the service 
  9638.  transport handle. 
  9639.  
  9640.  
  9641. ΓòÉΓòÉΓòÉ 9.14.32. svc_getreq() ΓòÉΓòÉΓòÉ
  9642.  
  9643. The svc_getreq() call implements asynchronous event processing and returns 
  9644. control to the program after all sockets have been serviced. 
  9645.  
  9646. Syntax 
  9647.  
  9648. #include <rpc\rpc.h>
  9649.  
  9650. void
  9651. svc_getreq(socks, noavail)
  9652. int socks[];
  9653. int noavail;
  9654.  
  9655. Parameters 
  9656.  
  9657.  socks 
  9658.    Array of socket descriptors 
  9659.  
  9660.  noavail 
  9661.    Integer specifying the number of socket descriptors in the array 
  9662.  
  9663.  Description 
  9664.  
  9665.  Use the svc_getreq() call rather than svc_run() to do asynchronous event 
  9666.  processing. The routine returns control to the program when all sockets in the 
  9667.  socks array have been serviced. 
  9668.  
  9669.  Related Calls 
  9670.  
  9671.   svc_run()
  9672.   svc_socks[]
  9673.  
  9674.  
  9675. ΓòÉΓòÉΓòÉ 9.14.33. svc_register() ΓòÉΓòÉΓòÉ
  9676.  
  9677. The svc_register() call registers procedures on the local Portmapper. 
  9678.  
  9679. Syntax 
  9680.  
  9681. #include <rpc\rpc.h>
  9682. #include <netdb.h>
  9683.  
  9684. bool_t
  9685. svc_register(xprt, prognum, versnum, dispatch, protocol)
  9686. SVCXPRT *xprt;
  9687. u_long prognum;
  9688. u_long versnum;
  9689. void (*dispatch) ();
  9690. int protocol;
  9691.  
  9692. Parameters 
  9693.  
  9694.  xprt 
  9695.    Pointer to the service transport handle. 
  9696.  
  9697.  prognum 
  9698.    Program number to be registered. 
  9699.  
  9700.  versnum 
  9701.    Version number of the program to be registered. 
  9702.  
  9703.  dispatch 
  9704.    Dispatch routine associated with prognum and versnum. The structure of the 
  9705.    dispatch routine is as follows: 
  9706.  
  9707.       dispatch(request, xprt)
  9708.       struct svc_req *request;
  9709.       SVCXPRT *xprt;
  9710.  
  9711.  protocol 
  9712.    Protocol used. The value is generally one of the following: 
  9713.  
  9714.        0 (zero) 
  9715.        IPPROTO_UDP 
  9716.        IPPROTO_TCP 
  9717.  
  9718.    When you use a value of 0, the service is not registered with Portmapper. 
  9719.  
  9720.  Return Values 
  9721.  
  9722.  The value 1 indicates success; the value 0 indicates an error. 
  9723.  
  9724.  Description 
  9725.  
  9726.  The svc_register() call associates the specified program with the service 
  9727.  dispatch routine dispatch. 
  9728.  
  9729.  Note:  When you use a toy RPC service transport created with svcraw_create(), 
  9730.  make a call to xprt_register() immediately after a call to svc_register(). 
  9731.  
  9732.  Examples 
  9733.  
  9734.  
  9735.   #define RMTPROGNUM   (u_long)0x3fffffffL
  9736.   #define RMTPROGVER   (u_long)0x1L
  9737.  
  9738.   SVCXPRT *transp;
  9739.  
  9740.   /* register the remote program with local portmapper */
  9741.   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  9742.         {
  9743.           fprintf(stderr, "can't register rmtprog() service\n");
  9744.           exit(-1);
  9745.         }
  9746.  
  9747.   /* code for remote program; rmtprog  */
  9748.   rmtprog(rqstp, transp)
  9749.   struct svc_req *rqstp;
  9750.   SVCXPRT *transp;
  9751.     {
  9752.        ...
  9753.        ...
  9754.      }
  9755.  
  9756.  Related Calls 
  9757.  
  9758.   registerrpc()
  9759.   svc_unregister()
  9760.   xprt_register()
  9761.  
  9762.  
  9763. ΓòÉΓòÉΓòÉ 9.14.34. svc_run() ΓòÉΓòÉΓòÉ
  9764.  
  9765. The svc_run() call accepts RPC requests and calls the appropriate service. 
  9766.  
  9767. Syntax 
  9768.  
  9769. #include <rpc\rpc.h>
  9770.  
  9771. void
  9772. svc_run()
  9773.  
  9774. Description 
  9775.  
  9776. The svc_run() call accepts RPC requests and calls the appropriate service using 
  9777. svc_getreq(). The svc_run() call does not return control to the caller. 
  9778.  
  9779. Examples 
  9780.  
  9781. #define RMTPROGNUM   (u_long)0x3fffffffL
  9782. #define RMTPROGVER   (u_long)0x1L
  9783.  
  9784. ...
  9785.  
  9786. SVCXPRT *transp;
  9787.  
  9788. transp = svcudp_create(RPC_ANYSOCK);
  9789. if (transp == NULL)
  9790.    {
  9791.       fprintf(stderr, "can't create an RPC server transport\n");
  9792.       exit(-1);
  9793.     }
  9794. pmap_unset(RMTPROGNUM, RMTPROGVER);
  9795. if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  9796.    {
  9797.       fprintf(stderr, "can't register rmtprog() service\n");
  9798.       exit(-1);
  9799.     }
  9800. printf("rmtprog() service registered.\n");
  9801.  
  9802. svc_run();
  9803.  
  9804. printf("Error:svc_run should never reach this point \n");
  9805. exit(1);
  9806. ...
  9807.  
  9808. rmtprog(rqstp, transp)
  9809. struct svc_req *rqstp;
  9810. SVCXPRT *transp;
  9811.  {
  9812.  ...
  9813.  }
  9814.  
  9815. Related Calls 
  9816.  
  9817. registerrpc()
  9818. svc_getreq()
  9819.  
  9820.  
  9821. ΓòÉΓòÉΓòÉ 9.14.35. svc_sendreply() ΓòÉΓòÉΓòÉ
  9822.  
  9823. The svc_sendreply() call sends the results of an RPC to the caller. 
  9824.  
  9825. Syntax 
  9826.  
  9827. #include <rpc\rpc.h>
  9828.  
  9829. bool_t
  9830. svc_sendreply(xprt, outproc, out)
  9831. SVCXPRT *xprt;
  9832. xdrproc_t outproc;
  9833. char *out;
  9834.  
  9835. Parameters 
  9836.  
  9837.  xprt 
  9838.    Pointer to the caller's transport handle 
  9839.  
  9840.  outproc 
  9841.    XDR procedure that encodes the results 
  9842.  
  9843.  out 
  9844.    Pointer to the results 
  9845.  
  9846.  Return Values 
  9847.  
  9848.  The value 1 indicates success; the value 0 indicates an error. 
  9849.  
  9850.  Description 
  9851.  
  9852.  The service dispatch routine calls the svc_sendreply() call to send the 
  9853.  results of the call to the caller. 
  9854.  
  9855.  Examples 
  9856.  
  9857.   #define RMTPROGNUM   (u_long)0x3fffffffL
  9858.   #define RMTPROGVER   (u_long)0x1L
  9859.  
  9860.   ...
  9861.  
  9862.   SVCXPRT *transp;
  9863.  
  9864.   transp = svcudp_create(RPC_ANYSOCK);
  9865.   if (transp == NULL)
  9866.      {
  9867.         fprintf(stderr, "can't create an RPC server transport\n");
  9868.         exit(-1);
  9869.       }
  9870.   pmap_unset(RMTPROGNUM, RMTPROGVER);
  9871.   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  9872.       {
  9873.          fprintf(stderr, "can't register rmtprog() service\n");
  9874.          exit(-1);
  9875.        }
  9876.   printf("rmtprog() service registered.\n");
  9877.  
  9878.   svc_run();
  9879.  
  9880.   printf("Error:svc_run should never reach this point \n");
  9881.   exit(1);
  9882.   ...
  9883.  
  9884.  
  9885.   rmtprog(rqstp, transp)
  9886.   struct svc_req *rqstp;
  9887.   SVCXPRT *transp;
  9888.   {
  9889.  
  9890.       int intrecv;
  9891.       int replysend;
  9892.       switch((int)rqstp->rq_proc)
  9893.        {
  9894.           case PROCNUM0:
  9895.              svc_getargs(transp, xdr_int, &intrecv);
  9896.              ...
  9897.              /* process intrecv parameter */
  9898.              replysend = ( intrecv * 1000) + 100;
  9899.              /*  send reply to client */
  9900.              if (!svc_sendreply(transp, xdr_int, &replysend))
  9901.                 {
  9902.                      fprintf(stderr,"can't reply to RPC call\n");
  9903.                      exit(-1);
  9904.                  }
  9905.               return;
  9906.           case PROCNUM1:
  9907.             ...
  9908.             ...
  9909.          }
  9910.   ...
  9911.   }
  9912.  
  9913.  
  9914. ΓòÉΓòÉΓòÉ 9.14.36. svc_socks [] ΓòÉΓòÉΓòÉ
  9915.  
  9916. svc_socks[] is an array of socket descriptors being serviced. 
  9917.  
  9918. Syntax 
  9919.  
  9920. #include <rpc\rpc.h>
  9921.  
  9922. int svc_socks[];
  9923.  
  9924. #include <rpc\rpc.h>
  9925.  
  9926. int noregistered;
  9927.  
  9928. Description 
  9929.  
  9930. svc_socks[] is an array of socket descriptors being serviced. noregistered is 
  9931. an integer that specifies the number of socket descriptors in svc_socks[]. 
  9932.  
  9933. Related Calls 
  9934.  
  9935. svc_getreq()
  9936.  
  9937.  
  9938. ΓòÉΓòÉΓòÉ 9.14.37. svc_unregister() ΓòÉΓòÉΓòÉ
  9939.  
  9940. The svc_unregister() call removes the local mapping. 
  9941.  
  9942. Syntax 
  9943.  
  9944. #include <rpc\rpc.h>
  9945.  
  9946. void
  9947. svc_unregister(prognum, versnum)
  9948. u_long prognum;
  9949. u_long versnum;
  9950.  
  9951. Parameters 
  9952.  
  9953.  prognum 
  9954.    Program number of the removed program 
  9955.  
  9956.  versnum 
  9957.    Version number of the removed program 
  9958.  
  9959.  Description 
  9960.  
  9961.  The svc_unregister() call removes all local mappings of (prognum, versnum) to 
  9962.  dispatch routines and (prognum, versnum, *) to port numbers. 
  9963.  
  9964.  Examples 
  9965.  
  9966.   #define RMTPROGNUM   (u_long)0x3fffffffL
  9967.   #define RMTPROGVER   (u_long)0x1L
  9968.   ...
  9969.     /* unregister remote program from local portmapper */
  9970.     svc_unregister(RMTPROGNUM, RMTPROGVER);
  9971.   ...
  9972.  
  9973.  Related Calls 
  9974.  
  9975.   svc_register()
  9976.  
  9977.  
  9978. ΓòÉΓòÉΓòÉ 9.14.38. svcerr_auth() ΓòÉΓòÉΓòÉ
  9979.  
  9980. The svcerr_auth() call sends an error reply when the service dispatch routine 
  9981. cannot execute an RPC request because of authentication errors. 
  9982.  
  9983. Syntax 
  9984.  
  9985. #include <rpc\rpc.h>
  9986.  
  9987. void
  9988. svcerr_auth(xprt, why)
  9989. SVCXPRT *xprt;
  9990. enum auth_stat why;
  9991.  
  9992. Parameters 
  9993.  
  9994.  xprt 
  9995.    Pointer to the service transport handle 
  9996.  
  9997.  why 
  9998.    Reason why the call is refused 
  9999.  
  10000.  Description 
  10001.  
  10002.  A service dispatch routine that refuses to run an RPC request because of 
  10003.  authentication errors calls svcerr_auth(). 
  10004.  
  10005.  Related Calls 
  10006.  
  10007.   svcerr_decode()
  10008.   svcerr_noproc()
  10009.   svcerr_noprog()
  10010.   svcerr_progvers()
  10011.   svcerr_systemerr()
  10012.   svcerr_weakauth()
  10013.  
  10014.  
  10015. ΓòÉΓòÉΓòÉ 9.14.39. svcerr_decode() ΓòÉΓòÉΓòÉ
  10016.  
  10017. The svcerr_decode() call sends an error reply when the service dispatch routine 
  10018. cannot decode its parameters. 
  10019.  
  10020. Syntax 
  10021.  
  10022. #include <rpc\rpc.h>
  10023.  
  10024. void
  10025. svcerr_decode(xprt)
  10026. SVCXPRT *xprt;
  10027.  
  10028. Parameters 
  10029.  
  10030.  xprt 
  10031.    Pointer to the service transport handle 
  10032.  
  10033.  Description 
  10034.  
  10035.  A service dispatch routine that cannot decode its parameters calls 
  10036.  svcerr_decode(). 
  10037.  
  10038.  Related Calls 
  10039.  
  10040.   svcerr_auth()
  10041.   svcerr_noproc()
  10042.   svcerr_noprog()
  10043.   svcerr_progvers()
  10044.   svcerr_systemerr()
  10045.   svcerr_weakauth()
  10046.  
  10047.  
  10048. ΓòÉΓòÉΓòÉ 9.14.40. svcerr_noproc() ΓòÉΓòÉΓòÉ
  10049.  
  10050. The svcerr_noproc() call sends an error reply when the service dispatch routine 
  10051. cannot call the procedure requested. 
  10052.  
  10053. Syntax 
  10054.  
  10055. #include <rpc\rpc.h>
  10056.  
  10057. void
  10058. svcerr_noproc(xprt)
  10059. SVCXPRT *xprt;
  10060.  
  10061. Parameters 
  10062.  
  10063.  xprt 
  10064.    Pointer to the service transport handle 
  10065.  
  10066.  Description 
  10067.  
  10068.  A service dispatch routine that does not implement the requested procedure 
  10069.  calls the svcerr_noproc() call. 
  10070.  
  10071.  Related Calls 
  10072.  
  10073.   svcerr_auth()
  10074.   svcerr_decode()
  10075.   svcerr_noprog()
  10076.   svcerr_progvers()
  10077.   svcerr_systemerr()
  10078.   svcerr_weakauth()
  10079.  
  10080.  
  10081. ΓòÉΓòÉΓòÉ 9.14.41. svcerr_noprog() ΓòÉΓòÉΓòÉ
  10082.  
  10083. The svcerr_noprog() call sends an error code when the requested program is not 
  10084. registered. 
  10085.  
  10086. Syntax 
  10087.  
  10088. #include <rpc\rpc.h>
  10089.  
  10090. void
  10091. svcerr_noprog(xprt)
  10092. SVCXPRT *xprt;
  10093.  
  10094. Parameters 
  10095.  
  10096.  xprt 
  10097.    Pointer to the service transport handle 
  10098.  
  10099.  Description 
  10100.  
  10101.  Use the svcerr_noprog() call when the desired program is not registered. 
  10102.  
  10103.  Related Calls 
  10104.  
  10105.   svcerr_auth()
  10106.   svcerr_decode()
  10107.   svcerr_noproc()
  10108.   svcerr_progvers()
  10109.   svcerr_systemerr()
  10110.   svcerr_weakauth()
  10111.  
  10112.  
  10113. ΓòÉΓòÉΓòÉ 9.14.42. svcerr_progvers() ΓòÉΓòÉΓòÉ
  10114.  
  10115. The svcerr_progvers() call sends the low version number and high version number 
  10116. of RPC service when the version numbers of two RPC programs do not match. 
  10117.  
  10118. Syntax 
  10119.  
  10120. #include <rpc\rpc.h>
  10121.  
  10122. void
  10123. svcerr_progvers(xprt, low_vers, high_vers)
  10124. SVCXPRT *xprt;
  10125. u_long low_vers;
  10126. u_long high_vers;
  10127.  
  10128. Parameters 
  10129.  
  10130.  xprt 
  10131.    Pointer to the service transport handle 
  10132.  
  10133.  low_vers 
  10134.    Low version number 
  10135.  
  10136.  high_vers 
  10137.    High version number 
  10138.  
  10139.  Description 
  10140.  
  10141.  A service dispatch routine calls the svcerr_progvers() call when the version 
  10142.  numbers of two RPC programs do not match. The call sends the supported low 
  10143.  version and high version of RPC service. 
  10144.  
  10145.  Related Calls 
  10146.  
  10147.   svcerr_decode()
  10148.   svcerr_noproc()
  10149.   svcerr_noprog()
  10150.   svcerr_progvers()
  10151.   svcerr_systemerr()
  10152.   svcerr_weakauth()
  10153.  
  10154.  
  10155. ΓòÉΓòÉΓòÉ 9.14.43. svcerr_systemerr() ΓòÉΓòÉΓòÉ
  10156.  
  10157. The svcerr_systemerr() call sends an error reply when the service dispatch 
  10158. routine detects a system error that has not been handled. 
  10159.  
  10160. Syntax 
  10161.  
  10162. #include <rpc\rpc.h>
  10163.  
  10164. void
  10165. svcerr_systemerr(xprt)
  10166. SVCXPRT *xprt;
  10167.  
  10168. Parameters 
  10169.  
  10170.  xprt 
  10171.    Pointer to the service transport handle 
  10172.  
  10173.  Description 
  10174.  
  10175.  A service dispatch routine calls the svcerr_systemerr() call when it detects a 
  10176.  system error that is not handled by the protocol. 
  10177.  
  10178.  Related Calls 
  10179.  
  10180.   svcerr_auth()
  10181.   svcerr_decode()
  10182.   svcerr_noproc()
  10183.   svcerr_noprog()
  10184.   svcerr_progvers()
  10185.   svcerr_weakauth()
  10186.  
  10187.  
  10188. ΓòÉΓòÉΓòÉ 9.14.44. svcerr_weakauth() ΓòÉΓòÉΓòÉ
  10189.  
  10190. The svcerr_weakauth() call sends an error reply when the service dispatch 
  10191. routine cannot run an RPC because of weak authentication parameters. 
  10192.  
  10193. Syntax 
  10194.  
  10195. #include <rpc\rpc.h>
  10196.  
  10197. void
  10198. svcerr_progvers(xprt)
  10199. SVCXPRT *xprt;
  10200.  
  10201. Parameters 
  10202.  
  10203.  xprt 
  10204.    Pointer to the service transport handle 
  10205.  
  10206.  Description 
  10207.  
  10208.  A service dispatch routine calls the svcerr_weakauth() call when it cannot run 
  10209.  an RPC because of correct but weak authentication parameters 
  10210.  
  10211.  Note:  This is the equivalent of svcerr_auth(xprt, AUTH_TOOWEAK). 
  10212.  
  10213.  Related Calls 
  10214.  
  10215.   svcerr_auth()
  10216.   svcerr_decode()
  10217.   svcerr_noproc()
  10218.   svcerr_noprog()
  10219.   svcerr_progvers()
  10220.   svcerr_systemerr()
  10221.  
  10222.  
  10223. ΓòÉΓòÉΓòÉ 9.14.45. svcraw_create() ΓòÉΓòÉΓòÉ
  10224.  
  10225. The svcraw_create() call creates a local RPC service transport handle to 
  10226. simulate RPC programs within one host. 
  10227.  
  10228. Syntax 
  10229.  
  10230. #include <rpc\rpc.h>
  10231.  
  10232. SVCXPRT *
  10233. svcraw_create()
  10234.  
  10235. Return Values 
  10236.  
  10237. NULL indicates failure. 
  10238.  
  10239. Description 
  10240.  
  10241. The svcraw_create() call creates a local RPC service transport used for 
  10242. timings, to which it returns a pointer. Because messages are passed using a 
  10243. buffer within the address space of the local process, the client process must 
  10244. also use the same address space. This allows the simulation of RPC programs 
  10245. within one host. See clntraw_create() for more information. 
  10246.  
  10247. Related Calls 
  10248.  
  10249. clntraw_create()
  10250. svc_destroy()
  10251. svctcp_create()
  10252. svcudp_create()
  10253.  
  10254.  
  10255. ΓòÉΓòÉΓòÉ 9.14.46. svctcp_create() ΓòÉΓòÉΓòÉ
  10256.  
  10257. The svctcp_create() call creates a TCP-based service transport. 
  10258.  
  10259. Syntax 
  10260.  
  10261. #include <rpc\rpc.h>
  10262.  
  10263. SVCXPRT *
  10264. svctcp_create(sock, send_buf_size, recv_buf_size)
  10265. int sock;
  10266. u_int send_buf_size;
  10267. u_int recv_buf_size;
  10268.  
  10269. Parameters 
  10270.  
  10271.  sock 
  10272.    Socket descriptor. If sock is RPC_ANYSOCK, a new socket is created. If the 
  10273.    socket is not bound to a local TCP port, it is bound to an arbitrary port. 
  10274.  
  10275.  send_buf_size 
  10276.    Size of the send buffer. Specify 0 if you want the call to pick a suitable 
  10277.    default value. 
  10278.  
  10279.  recv_buf_size 
  10280.    Size of the receive buffer. Specify 0 if you want the call to pick a 
  10281.    suitable default value. 
  10282.  
  10283.  Return Values 
  10284.  
  10285.  NULL indicates failure. 
  10286.  
  10287.  Description 
  10288.  
  10289.  The svctcp_create() call creates a TCP-based service transport to which it 
  10290.  returns a pointer. xprt->xp_sock contains the transport's socket descriptor; 
  10291.  xprt->xp_port contains the transport's port number. 
  10292.  
  10293.  Examples 
  10294.  
  10295.   ...
  10296.   SVCXPRT *transp;
  10297.  
  10298.   transp = svctcp_create(RPC_ANYSOCK, 1024*10, 1024*10);
  10299.   ...
  10300.  
  10301.  Related Calls 
  10302.  
  10303.   svc_destroy()
  10304.   svcraw_create()
  10305.   svcudp_create()
  10306.  
  10307.  
  10308. ΓòÉΓòÉΓòÉ 9.14.47. svcudp_create() ΓòÉΓòÉΓòÉ
  10309.  
  10310. The svcudp_create() call creates a UDP-based service transport. 
  10311.  
  10312. Syntax 
  10313.  
  10314. #include <rpc\rpc.h>
  10315.  
  10316. SVCXPRT *
  10317. svcudp_create(sockp)
  10318. int sockp;
  10319.  
  10320. Parameters 
  10321.  
  10322.  sockp 
  10323.    The socket number associated with the service transport handle. If sockp is 
  10324.    RPC_ANYSOCK, a new socket is created.  If the socket is not bound to a local 
  10325.    port, it is bound to an arbitrary port. 
  10326.  
  10327.  Return Values 
  10328.  
  10329.  NULL indicates failure. 
  10330.  
  10331.  Description 
  10332.  
  10333.  The svcudp_create() call creates a UDP-based service transport to which it 
  10334.  returns a pointer. xprt->xp_sock contains the transport's socket descriptor. 
  10335.  xprt->xp_port contains the transport's port number. 
  10336.  
  10337.  Examples 
  10338.  
  10339.   ...
  10340.   SVCXPRT *transp;
  10341.  
  10342.   transp = svcudp_create(RPC_ANYSOCK);
  10343.   ...
  10344.  
  10345.  Related Calls 
  10346.  
  10347.   svc_destroy()
  10348.   svcraw_create()
  10349.   svctcp_create()
  10350.  
  10351.  
  10352. ΓòÉΓòÉΓòÉ 9.14.48. xdr_accepted_reply() ΓòÉΓòÉΓòÉ
  10353.  
  10354. The xdr_accepted_reply() call translates between an RPC reply message and its 
  10355. external representation. 
  10356.  
  10357. Syntax 
  10358.  
  10359. #include <rpc\rpc.h>
  10360.  
  10361. bool_t
  10362. xdr_accepted_reply(xdrs, ar)
  10363. XDR *xdrs;
  10364. struct accepted_reply *ar;
  10365.  
  10366. Parameters 
  10367.  
  10368.  xdrs 
  10369.    Pointer to an XDR stream 
  10370.  
  10371.  ar 
  10372.    Pointer to the reply to be represented 
  10373.  
  10374.  Return Values 
  10375.  
  10376.  The value 1 indicates success; the value 0 indicates an error. 
  10377.  
  10378.  Description 
  10379.  
  10380.  The xdr_accepted_reply() call translates between an RPC reply message and its 
  10381.  external representation. 
  10382.  
  10383.  
  10384. ΓòÉΓòÉΓòÉ 9.14.49. xdr_array() ΓòÉΓòÉΓòÉ
  10385.  
  10386. The xdr_array() call translates between an array and its external 
  10387. representation. 
  10388.  
  10389. Syntax 
  10390.  
  10391. #include <rpc\rpc.h>
  10392.  
  10393. bool_t
  10394. xdr_array(xdrs, arrp, sizep, maxsize, elsize, elproc)
  10395. XDR *xdrs;
  10396. char **arrp;
  10397. u_int *sizep;
  10398. u_int maxsize;
  10399. u_int elsize;
  10400. xdrproc_t elproc;
  10401.  
  10402. Parameters 
  10403.  
  10404.  xdrs 
  10405.    Pointer to an XDR stream 
  10406.  
  10407.  arrp 
  10408.    Address of the pointer to the array 
  10409.  
  10410.  sizep 
  10411.    Pointer to the element count of the array 
  10412.  
  10413.  maxsize 
  10414.    Maximum number of elements accepted 
  10415.  
  10416.  elsize 
  10417.    Size of each of the array's elements, found using sizeof() 
  10418.  
  10419.  elproc 
  10420.    XDR routine that translates an individual array element 
  10421.  
  10422.  Return Values 
  10423.  
  10424.  The value 1 indicates success; the value 0 indicates an error. 
  10425.  
  10426.  Description 
  10427.  
  10428.  The xdr_array() call translates between an array and its external 
  10429.  representation. 
  10430.  
  10431.  Examples 
  10432.  
  10433.   struct myarray
  10434.      {
  10435.         int  *arrdata;
  10436.         u_int   arrlength;
  10437.       };
  10438.  
  10439.   void
  10440.   xdr_myarray(xdrsp,arrp)
  10441.   XDR  *xdrsp;
  10442.   struct myarray *arrp;
  10443.   {
  10444.      xdr_array(xdrsp,(caddr_t *)&arrp->arrdata,&arrp->arrlength,
  10445.                                    MAXLEN,sizeof(int),xdr_int);
  10446.   }
  10447.  
  10448.   ...
  10449.   static int arrc_in[10],arrc_out[10];
  10450.   ...
  10451.   u_long procnum;
  10452.   register CLIENT *clnt;
  10453.   enum clnt_stat cs;
  10454.   struct timeval  total_timeout;
  10455.   ...
  10456.   total_timeout.tv_sec = 20;
  10457.   total_timeout.tv_usec = 0;
  10458.   ...
  10459.   myarrc_in.arrdata =  & arrc_in[0];
  10460.   myarrc_in.arrlength = ( sizeof(arrc_in) / sizeof (int) );
  10461.   myarrc_out.arrdata = & arrc_out[0];
  10462.   myarrc_out.arrlength = ( sizeof(arrc_out) / sizeof (int) );
  10463.  
  10464.   cs=clnt_call(clnt, procnum, xdr_myarray, (char *) &myarrc_in, xdr_myarray,
  10465.                                    (char *)&myarrc_out, total_timeout);
  10466.   if ( cs != RPC_SUCCESS)
  10467.           printf("*Error* clnt_call fail :\n");
  10468.   ...
  10469.  
  10470.  
  10471. ΓòÉΓòÉΓòÉ 9.14.50. xdr_authunix_parms() ΓòÉΓòÉΓòÉ
  10472.  
  10473. The xdr_authunix_parms() call translates between UNIX-based authentication 
  10474. information and its external representation. 
  10475.  
  10476. Syntax 
  10477.  
  10478. #include <rpc\rpc.h>
  10479.  
  10480. bool_t
  10481. xdr_authunix_parms(xdrs, aupp)
  10482. XDR *xdrs;
  10483. struct authunix_parms *aupp;
  10484.  
  10485. Parameters 
  10486.  
  10487.  xdrs 
  10488.    Pointer to an XDR stream 
  10489.  
  10490.  aupp 
  10491.    Pointer to the authentication information 
  10492.  
  10493.  Return Values 
  10494.  
  10495.  The value 1 indicates success; the value 0 indicates an error. 
  10496.  
  10497.  Description 
  10498.  
  10499.  The xdr_authunix_parms() call translates between UNIX-based authentication 
  10500.  information and its external representation. 
  10501.  
  10502.  
  10503. ΓòÉΓòÉΓòÉ 9.14.51. xdr_bool() ΓòÉΓòÉΓòÉ
  10504.  
  10505. The xdr_bool() call translates between a Boolean and its external 
  10506. representation. 
  10507.  
  10508. Syntax 
  10509.  
  10510. #include <rpc\rpc.h>
  10511.  
  10512. bool_t
  10513. xdr_bool(xdrs, bp)
  10514. XDR *xdrs;
  10515. bool_t *bp;
  10516.  
  10517. Parameters 
  10518.  
  10519.  xdrs 
  10520.    Pointer to an XDR stream 
  10521.  
  10522.  bp 
  10523.    Pointer to the Boolean 
  10524.  
  10525.  Return Values 
  10526.  
  10527.  The value 1 indicates success; the value 0 indicates an error. 
  10528.  
  10529.  Description 
  10530.  
  10531.  The xdr_bool() call translates between a Boolean and its external 
  10532.  representation. 
  10533.  
  10534.  
  10535. ΓòÉΓòÉΓòÉ 9.14.52. xdr_bytes() ΓòÉΓòÉΓòÉ
  10536.  
  10537. The xdr_bytes() call translates between byte strings and their external 
  10538. representations. 
  10539.  
  10540. Syntax 
  10541.  
  10542. #include <rpc\rpc.h>
  10543.  
  10544. bool_t
  10545. xdr_bytes(xdrs, sp, sizep, maxsize)
  10546. XDR *xdrs;
  10547. char **sp;
  10548. u_int *sizep;
  10549. u_int maxsize;
  10550.  
  10551. Parameters 
  10552.  
  10553.  xdrs 
  10554.    Pointer to an XDR stream 
  10555.  
  10556.  sp 
  10557.    Pointer to a pointer to the byte string 
  10558.  
  10559.  sizep 
  10560.    Pointer to the byte string size 
  10561.  
  10562.  maxsize 
  10563.    Maximum size of the byte string 
  10564.  
  10565.  Return Values 
  10566.  
  10567.  The value 1 indicates success; the value 0 indicates an error. 
  10568.  
  10569.  Description 
  10570.  
  10571.  The xdr_bytes() call translates between byte strings and their external 
  10572.  representations. 
  10573.  
  10574.  Examples 
  10575.  
  10576.   struct mybytes
  10577.      {
  10578.         char    *bytdata;
  10579.         u_int   bytlength;
  10580.       };
  10581.  
  10582.   void
  10583.   xdr_mybytes(xdrsp,arrp)
  10584.   XDR  *xdrsp;
  10585.   struct mybytes *arrp;
  10586.   {
  10587.      xdr_bytes(xdrsp,(caddr_t *)&arrp->bytdata,&arrp->bytlength,MAXLEN);
  10588.   }
  10589.  
  10590.   ...
  10591.   char *bytc_in ,*bytc_out;
  10592.   ...
  10593.   u_long procnum;
  10594.   register CLIENT *clnt;
  10595.   enum clnt_stat cs;
  10596.   struct timeval  total_timeout;
  10597.   ...
  10598.   total_timeout.tv_sec = 20;
  10599.   total_timeout.tv_usec = 0;
  10600.   ...
  10601.  
  10602.   mybytc_in.bytdata =  bytc_in;
  10603.   mybytc_in.bytlength = strlen(bytc_in)+1;
  10604.   cs=clnt_call(clnt, procnum, xdr_mybytes, (caddr_t *) &mybytc_in,
  10605.                xdr_mybytes, (caddr_t *)&mybytc_out, total_timeout);
  10606.   if ( cs != RPC_SUCCESS)
  10607.       printf("*Error* clnt_call fail :\n");
  10608.  
  10609.  
  10610. ΓòÉΓòÉΓòÉ 9.14.53. xdr_callhdr() ΓòÉΓòÉΓòÉ
  10611.  
  10612. The xdr_callhdr() call translates between an RPC message header and its 
  10613. external representation. 
  10614.  
  10615. Syntax 
  10616.  
  10617. #include <rpc\rpc.h>
  10618.  
  10619. void
  10620. xdr_callhdr(xdrs, chdr)
  10621. XDR *xdrs;
  10622. struct rpc_msg *chdr;
  10623.  
  10624. Parameters 
  10625.  
  10626.  xdrs 
  10627.    Pointer to the XDR stream 
  10628.  
  10629.  chdr 
  10630.    Pointer to the call header 
  10631.  
  10632.  Description 
  10633.  
  10634.  The xdr_callhdr() call translates between an RPC message header and its 
  10635.  external representation. 
  10636.  
  10637.  
  10638. ΓòÉΓòÉΓòÉ 9.14.54. xdr_callmsg() ΓòÉΓòÉΓòÉ
  10639.  
  10640. The xdr_callmsg() call translates between RPC call messages (header and 
  10641. authentication, not argument data) and their external representations. 
  10642.  
  10643. Syntax 
  10644.  
  10645. #include <rpc\rpc.h>
  10646.  
  10647. void
  10648. xdr_callmsg(xdrs, cmsg)
  10649. XDR *xdrs;
  10650. struct rpc_msg *cmsg;
  10651.  
  10652. Parameters 
  10653.  
  10654.  xdrs 
  10655.    Pointer to the XDR stream 
  10656.  
  10657.  cmsg 
  10658.    Pointer to the call message 
  10659.  
  10660.  Description 
  10661.  
  10662.  The xdr_callmsg() call translates between RPC call messages (header and 
  10663.  authentication, not argument data) and their external representations. 
  10664.  
  10665.  
  10666. ΓòÉΓòÉΓòÉ 9.14.55. xdr_double() ΓòÉΓòÉΓòÉ
  10667.  
  10668. The xdr_double() call translates between C double-precision numbers and their 
  10669. external representations. 
  10670.  
  10671. Syntax 
  10672.  
  10673. #include <rpc\rpc.h>
  10674.  
  10675. bool_t
  10676. xdr_double(xdrs, dp)
  10677. XDR *xdrs;
  10678. double *dp;
  10679.  
  10680. Parameters 
  10681.  
  10682.  xdrs 
  10683.    Pointer to the XDR stream 
  10684.  
  10685.  dp 
  10686.    Pointer to a double-precision number 
  10687.  
  10688.  Return Values 
  10689.  
  10690.  The value 1 indicates success; the value 0 indicates an error. 
  10691.  
  10692.  Description 
  10693.  
  10694.  The xdr_double() call translates between C double-precision numbers and their 
  10695.  external representations. 
  10696.  
  10697.  
  10698. ΓòÉΓòÉΓòÉ 9.14.56. xdr_enum() ΓòÉΓòÉΓòÉ
  10699.  
  10700. The xdr_enum() call translates between C-enumerated groups and their external 
  10701. representations. 
  10702.  
  10703. Syntax 
  10704.  
  10705. #include <rpc\rpc.h>
  10706.  
  10707. bool_t
  10708. xdr_enum(xdrs, ep)
  10709. XDR *xdrs;
  10710. enum_t *ep;
  10711.  
  10712. Parameters 
  10713.  
  10714.  xdrs 
  10715.    Pointer to the XDR stream 
  10716.  
  10717.  ep 
  10718.    Pointer to the enumerated number 
  10719.  
  10720.  Return Values 
  10721.  
  10722.  The value 1 indicates success; the value 0 indicates an error. 
  10723.  
  10724.  Description 
  10725.  
  10726.  The xdr_enum() call translates between C-enumerated groups and their external 
  10727.  representations. When you call the procedures callrpc() and registerrpc(), 
  10728.  create a stub procedure for both the server and the client before the 
  10729.  procedure of the application program using xdr_enum(). Verify that this 
  10730.  procedure looks like the following: 
  10731.  
  10732.   #include <rpc\rpc.h>
  10733.  
  10734.   void
  10735.   static xdr_enum_t(xdrs, ep)
  10736.   XDR *xdrs;
  10737.   enum_t *ep;
  10738.   {
  10739.           xdr_enum(xdrs, ep)
  10740.   }
  10741.  
  10742.  The xdr_enum_t procedure is used as the inproc and outproc in both the client 
  10743.  and server RPCs. 
  10744.  
  10745.  For example, an RPC client would contain the following lines: 
  10746.  
  10747.   .
  10748.   .
  10749.   .
  10750.  
  10751.   error = callrpc(argv[1],ENUMRCVPROG,VERSION,ENUMRCVPROC,
  10752.                            xdr_enum_t,&innumber,xdr_enum_t,&outnumber);
  10753.  
  10754.   .
  10755.   .
  10756.   .
  10757.  
  10758.  An RPC server would contain the following line: 
  10759.  
  10760.   .
  10761.   .
  10762.   .
  10763.  
  10764.   registerrpc(ENUMRCVPROG,VERSION,ENUMRCVPROC,xdr_enum_t,
  10765.                       xdr_enum_t);
  10766.  
  10767.   .
  10768.   .
  10769.   .
  10770.  
  10771.  
  10772. ΓòÉΓòÉΓòÉ 9.14.57. xdr_float() ΓòÉΓòÉΓòÉ
  10773.  
  10774. The xdr_float() call translates between C floating-point numbers and their 
  10775. external representations. 
  10776.  
  10777. Syntax 
  10778.  
  10779. #include <rpc\rpc.h>
  10780.  
  10781. bool_t
  10782. xdr_float(xdrs, fp)
  10783. XDR *xdrs;
  10784. float *fp;
  10785.  
  10786. Parameters 
  10787.  
  10788.  xdrs 
  10789.    Pointer to the XDR stream 
  10790.  
  10791.  fp 
  10792.    Pointer to the floating-point number 
  10793.  
  10794.  Return Values 
  10795.  
  10796.  The value 1 indicates success; the value 0 indicates an error. 
  10797.  
  10798.  Description 
  10799.  
  10800.  The xdr_float() call translates between C floating-point numbers and their 
  10801.  external representations. 
  10802.  
  10803.  
  10804. ΓòÉΓòÉΓòÉ 9.14.58. xdr_getpos() ΓòÉΓòÉΓòÉ
  10805.  
  10806. The xdr_getpos() call starts the get-position routine associated with the XDR 
  10807. stream, xdrs. 
  10808.  
  10809. Syntax 
  10810.  
  10811. #include <rpc\rpc.h>
  10812.  
  10813. u_int
  10814. xdr_getpos(xdrs)
  10815. XDR *xdrs;
  10816.  
  10817. Parameters 
  10818.  
  10819.  xdrs 
  10820.    Pointer to the XDR stream 
  10821.  
  10822.  Return Values 
  10823.  
  10824.  The xdr_getpos() call returns an unsigned integer, which indicates the 
  10825.  position of the XDR byte stream. 
  10826.  
  10827.  Description 
  10828.  
  10829.  The xdr_getpos() call starts the get-position routine associated with the XDR 
  10830.  stream, xdrs. 
  10831.  
  10832.  Related Calls 
  10833.  
  10834.   xdr_setpos
  10835.  
  10836.  
  10837. ΓòÉΓòÉΓòÉ 9.14.59. xdr_inline() ΓòÉΓòÉΓòÉ
  10838.  
  10839. The xdr_inline() call returns a pointer to a continuous piece of the XDR 
  10840. stream's buffer. 
  10841.  
  10842. Syntax 
  10843.  
  10844. #include <rpc\rpc.h>
  10845.  
  10846. long *
  10847. xdr_inline(xdrs, len)
  10848. XDR *xdrs;
  10849. int len;
  10850.  
  10851. Parameters 
  10852.  
  10853.  xdrs 
  10854.    Pointer to the XDR stream 
  10855.  
  10856.  len 
  10857.    Length in bytes of the desired buffer 
  10858.  
  10859.  Return Values 
  10860.  
  10861.  The value 1 indicates success; the value 0 indicates an error. 
  10862.  
  10863.  Description 
  10864.  
  10865.  The xdr_inline() call returns a pointer to a continuous piece of the XDR 
  10866.  stream's buffer. The value is long * rather than char *, because the external 
  10867.  data representation of any object is always an integer multiple of 32 bits. 
  10868.  
  10869.  Note:  xdr_inline() might return NULL if there is not enough space in the 
  10870.  stream buffer to satisfy the request. 
  10871.  
  10872.  
  10873. ΓòÉΓòÉΓòÉ 9.14.60. xdr_int() ΓòÉΓòÉΓòÉ
  10874.  
  10875. The xdr_int() call translates between C integers and their external 
  10876. representations. 
  10877.  
  10878. Syntax 
  10879.  
  10880. #include <rpc\rpc.h>
  10881.  
  10882. bool_t
  10883. xdr_int(xdrs, ip)
  10884. XDR *xdrs;
  10885. int *ip;
  10886.  
  10887. Parameters 
  10888.  
  10889.  xdrs 
  10890.    Pointer to the XDR stream 
  10891.  
  10892.  ip 
  10893.    Pointer to the integer 
  10894.  
  10895.  Return Values 
  10896.  
  10897.  The value 1 indicates success; the value 0 indicates an error. 
  10898.  
  10899.  Description 
  10900.  
  10901.  The xdr_int() call translates between C integers and their external 
  10902.  representations. 
  10903.  
  10904.  
  10905. ΓòÉΓòÉΓòÉ 9.14.61. xdr_long() ΓòÉΓòÉΓòÉ
  10906.  
  10907. The xdr_long() call translates between C long integers and their external 
  10908. representations. 
  10909.  
  10910. Syntax 
  10911.  
  10912. #include <rpc\rpc.h>
  10913.  
  10914. bool_t
  10915. xdr_long(xdrs, lp)
  10916. XDR *xdrs;
  10917. long *lp;
  10918.  
  10919. Parameters 
  10920.  
  10921.  xdrs 
  10922.    Pointer to an XDR stream 
  10923.  
  10924.  lp 
  10925.    Pointer to the long integer 
  10926.  
  10927.  Return Values 
  10928.  
  10929.  The value 1 indicates success; the value 0 indicates an error. 
  10930.  
  10931.  Description 
  10932.  
  10933.  The xdr_long() call translates between C long integers and their external 
  10934.  representations. 
  10935.  
  10936.  
  10937. ΓòÉΓòÉΓòÉ 9.14.62. xdr_opaque() ΓòÉΓòÉΓòÉ
  10938.  
  10939. The xdr_opaque() call translates between fixed-size opaque data and its 
  10940. external representation. 
  10941.  
  10942. Syntax 
  10943.  
  10944. #include <rpc\rpc.h>
  10945.  
  10946. bool_t
  10947. xdr_opaque(xdrs, cp, cnt)
  10948. XDR *xdrs;
  10949. char *cp;
  10950. u_int cnt;
  10951.  
  10952. Parameters 
  10953.  
  10954.  xdrs 
  10955.    Pointer to an XDR stream 
  10956.  
  10957.  cp 
  10958.    Pointer to the opaque object 
  10959.  
  10960.  cnt 
  10961.    Size of the opaque object 
  10962.  
  10963.  Return Values 
  10964.  
  10965.  The value 1 indicates success; the value 0 indicates an error. 
  10966.  
  10967.  Description 
  10968.  
  10969.  The xdr_opaque() call translates between fixed-size opaque data and its 
  10970.  external representation. 
  10971.  
  10972.  
  10973. ΓòÉΓòÉΓòÉ 9.14.63. xdr_opaque_auth() ΓòÉΓòÉΓòÉ
  10974.  
  10975. The xdr_opaque_auth() call translates between RPC message authentications and 
  10976. their external representations. 
  10977.  
  10978. Syntax 
  10979.  
  10980. #include <rpc\rpc.h>
  10981.  
  10982. bool_t
  10983. xdr_opaque_auth(xdrs, ap)
  10984. XDR *xdrs;
  10985. struct opaque_auth *ap;
  10986.  
  10987. Parameters 
  10988.  
  10989.  xdrs 
  10990.    Pointer to an XDR stream 
  10991.  
  10992.  ap 
  10993.    Pointer to the opaque authentication information 
  10994.  
  10995.  Return Values 
  10996.  
  10997.  The value 1 indicates success; the value 0 indicates an error. 
  10998.  
  10999.  Description 
  11000.  
  11001.  The xdr_opaque_auth() call translates between RPC message authentications and 
  11002.  their external representations. 
  11003.  
  11004.  
  11005. ΓòÉΓòÉΓòÉ 9.14.64. xdr_pmap() ΓòÉΓòÉΓòÉ
  11006.  
  11007. The xdr_pmap() call translates an RPC procedure identification, such as is used 
  11008. in calls to Portmapper. 
  11009.  
  11010. Syntax 
  11011.  
  11012. #include <rpc\rpc.h>
  11013.  
  11014. bool_t
  11015. xdr_pmap(xdrs, regs)
  11016. XDR *xdrs;
  11017. struct pmap *regs;
  11018.  
  11019. Parameters 
  11020.  
  11021.  xdrs 
  11022.    Pointer to an XDR stream 
  11023.  
  11024.  regs 
  11025.    Pointer to the PORTMAP parameters 
  11026.  
  11027.  Return Values 
  11028.  
  11029.  The value 1 indicates success; the value 0 indicates an error. 
  11030.  
  11031.  Description 
  11032.  
  11033.  The xdr_pmap() call translates an RPC procedure identification, such as is 
  11034.  used in calls to Portmapper. 
  11035.  
  11036.  
  11037. ΓòÉΓòÉΓòÉ 9.14.65. xdr_pmaplist() ΓòÉΓòÉΓòÉ
  11038.  
  11039. The xdr_pmaplist() call translates a variable number of RPC procedure 
  11040. identifications, such as those Portmapper creates. 
  11041.  
  11042. Syntax 
  11043.  
  11044. #include <rpc\rpc.h>
  11045.  
  11046. bool_t
  11047. xdr_pmaplist(xdrs, rp)
  11048. XDR *xdrs;
  11049. struct pmaplist **rp;
  11050.  
  11051. Parameters 
  11052.  
  11053.  xdrs 
  11054.    Pointer to an XDR stream 
  11055.  
  11056.  rp 
  11057.    Pointer to a pointer to the PORTMAP data array 
  11058.  
  11059.  Return Values 
  11060.  
  11061.  The value 1 indicates success; the value 0 indicates an error. 
  11062.  
  11063.  Description 
  11064.  
  11065.  The xdr_pmaplist() call translates a variable number of RPC procedure 
  11066.  identifications, such as those Portmapper creates. 
  11067.  
  11068.  
  11069. ΓòÉΓòÉΓòÉ 9.14.66. xdr_reference() ΓòÉΓòÉΓòÉ
  11070.  
  11071. The xdr_reference() call provides pointer chasing within structures. 
  11072.  
  11073. Syntax 
  11074.  
  11075. #include <rpc\rpc.h>
  11076.  
  11077. bool_t
  11078. xdr_reference(xdrs, pp, size, proc)
  11079. XDR *xdrs;
  11080. char **pp;
  11081. u_int size;
  11082. xdrproc_t proc;
  11083.  
  11084. Parameters 
  11085.  
  11086.  xdrs 
  11087.    Pointer to an XDR stream 
  11088.  
  11089.  pp 
  11090.    Pointer to a pointer 
  11091.  
  11092.  size 
  11093.    Size of the target 
  11094.  
  11095.  proc 
  11096.    XDR procedure that translates an individual element of the type addressed by 
  11097.    the pointer 
  11098.  
  11099.  Return Values 
  11100.  
  11101.  The value 1 indicates success; the value 0 indicates an error. 
  11102.  
  11103.  Description 
  11104.  
  11105.  The xdr_reference() call provides pointer chasing within structures. 
  11106.  
  11107.  
  11108. ΓòÉΓòÉΓòÉ 9.14.67. xdr_rejected_reply() ΓòÉΓòÉΓòÉ
  11109.  
  11110. The xdr_rejected_reply() call translates between rejected RPC reply messages 
  11111. and their external representations. 
  11112.  
  11113. Syntax 
  11114.  
  11115. #include <rpc\rpc.h>
  11116.  
  11117. bool_t
  11118. xdr_rejected_reply(xdrs, rr)
  11119. XDR *xdrs;
  11120. struct rejected_reply *rr;
  11121.  
  11122. Parameters 
  11123.  
  11124.  xdrs 
  11125.    Pointer to an XDR stream 
  11126.  
  11127.  rr 
  11128.    Pointer to the rejected reply 
  11129.  
  11130.  Return Values 
  11131.  
  11132.  The value 1 indicates success; the value 0 indicates an error. 
  11133.  
  11134.  Description 
  11135.  
  11136.  The xdr_rejected_reply() call translates between rejected RPC reply messages 
  11137.  and their external representations. 
  11138.  
  11139.  
  11140. ΓòÉΓòÉΓòÉ 9.14.68. xdr_replymsg() ΓòÉΓòÉΓòÉ
  11141.  
  11142. The xdr_replymsg() call translates between RPC reply messages and their 
  11143. external representations. 
  11144.  
  11145. Syntax 
  11146.  
  11147. #include <rpc\rpc.h>
  11148.  
  11149. bool_t
  11150. xdr_replymsg(xdrs, rmsg)
  11151. XDR *xdrs;
  11152. struct rpc_msg *rmsg;
  11153.  
  11154. Parameters 
  11155.  
  11156.  xdrs 
  11157.    Pointer to an XDR stream 
  11158.  
  11159.  rmsg 
  11160.    Pointer to the reply message 
  11161.  
  11162.  Return Values 
  11163.  
  11164.  The value 1 indicates success; the value 0 indicates an error. 
  11165.  
  11166.  Description 
  11167.  
  11168.  The xdr_replymsg() call translates between RPC reply messages and their 
  11169.  external representations. 
  11170.  
  11171.  
  11172. ΓòÉΓòÉΓòÉ 9.14.69. xdr_setpos() ΓòÉΓòÉΓòÉ
  11173.  
  11174. The xdr_setpos() starts the set-position routine associated with a XDR stream, 
  11175. xdrs. 
  11176.  
  11177. Syntax 
  11178.  
  11179. #include <rpc\rpc.h>
  11180.  
  11181. int
  11182. xdr_setpos(xdrs, pos)
  11183. XDR *xdrs;
  11184. u_int pos;
  11185.  
  11186. Parameters 
  11187.  
  11188.  xdrs 
  11189.    Pointer to an XDR stream 
  11190.  
  11191.  pos 
  11192.    Position value obtained from xdr_getpos() 
  11193.  
  11194.  Return Values 
  11195.  
  11196.  The value 1 indicates success; the value 0 indicates an error. 
  11197.  
  11198.  Description 
  11199.  
  11200.  The xdr_setpos() call starts the set-position routine associated with the XDR 
  11201.  stream, xdrs. 
  11202.  
  11203.  Related Calls 
  11204.  
  11205.   xdr_getpos
  11206.  
  11207.  
  11208. ΓòÉΓòÉΓòÉ 9.14.70. xdr_short() ΓòÉΓòÉΓòÉ
  11209.  
  11210. The xdr_short() call translates between C short integers and their external 
  11211. representations. 
  11212.  
  11213. Syntax 
  11214.  
  11215. #include <rpc\rpc.h>
  11216.  
  11217. bool_t
  11218. xdr_short(xdrs, sp)
  11219. XDR *xdrs;
  11220. short *sp;
  11221.  
  11222. Parameters 
  11223.  
  11224.  xdrs 
  11225.    Pointer to an XDR stream 
  11226.  
  11227.  sp 
  11228.    Pointer to the short integer 
  11229.  
  11230.  Return Values 
  11231.  
  11232.  The value 1 indicates success; the value 0 indicates an error. 
  11233.  
  11234.  Description 
  11235.  
  11236.  The xdr_short() call translates between C short integers and their external 
  11237.  representations. 
  11238.  
  11239.  
  11240. ΓòÉΓòÉΓòÉ 9.14.71. xdr_string() ΓòÉΓòÉΓòÉ
  11241.  
  11242. The xdr_string() call translates between C strings and their external 
  11243. representations. 
  11244.  
  11245. Syntax 
  11246.  
  11247. #include <rpc\rpc.h>
  11248.  
  11249. bool_t
  11250. xdr_string(xdrs, sp, maxsize)
  11251. XDR *xdrs;
  11252. char **sp;
  11253. u_int maxsize;
  11254.  
  11255. Parameters 
  11256.  
  11257.  xdrs 
  11258.    Pointer to an XDR stream 
  11259.  
  11260.  sp 
  11261.    Pointer to a pointer to the string 
  11262.  
  11263.  maxsize 
  11264.    Maximum size of the string 
  11265.  
  11266.  Return Values 
  11267.  
  11268.  The value 1 indicates success; the value 0 indicates an error. 
  11269.  
  11270.  Description 
  11271.  
  11272.  The xdr_string() call translates between C strings and their external 
  11273.  representations. 
  11274.  
  11275.  
  11276. ΓòÉΓòÉΓòÉ 9.14.72. xdr_u_int() ΓòÉΓòÉΓòÉ
  11277.  
  11278. The xdr_u_int() call translates between C unsigned integers and their external 
  11279. representations. 
  11280.  
  11281. Syntax 
  11282.  
  11283. #include <rpc\rpc.h>
  11284.  
  11285. bool_t
  11286. xdr_u_int(xdrs, up)
  11287. XDR *xdrs;
  11288. unsigned *up;
  11289.  
  11290. Parameters 
  11291.  
  11292.  xdrs 
  11293.    Pointer to an XDR stream 
  11294.  
  11295.  up 
  11296.    Pointer to the unsigned integer 
  11297.  
  11298.  Return Values 
  11299.  
  11300.  The value 1 indicates success; the value 0 indicates an error. 
  11301.  
  11302.  Description 
  11303.  
  11304.  The xdr_u_int() call translates between C unsigned integers and their external 
  11305.  representations. 
  11306.  
  11307.  
  11308. ΓòÉΓòÉΓòÉ 9.14.73. xdr_u_long() ΓòÉΓòÉΓòÉ
  11309.  
  11310. The xdr_u_long() call translates between C unsigned long integers and their 
  11311. external representations. 
  11312.  
  11313. Syntax 
  11314.  
  11315. #include <rpc\rpc.h>
  11316.  
  11317. bool_t
  11318. xdr_u_long(xdrs, ulp)
  11319. XDR *xdrs;
  11320. u_long *ulp;
  11321.  
  11322. Parameters 
  11323.  
  11324.  xdrs 
  11325.    Pointer to an XDR stream 
  11326.  
  11327.  ulp 
  11328.    Pointer to the unsigned long integer 
  11329.  
  11330.  Return Values 
  11331.  
  11332.  The value 1 indicates success; the value 0 indicates an error. 
  11333.  
  11334.  Description 
  11335.  
  11336.  The xdr_u_long() call translates between C unsigned long integers and their 
  11337.  external representations. 
  11338.  
  11339.  
  11340. ΓòÉΓòÉΓòÉ 9.14.74. xdr_u_short() ΓòÉΓòÉΓòÉ
  11341.  
  11342. The xdr_u_short() call translates between C unsigned short integers and their 
  11343. external representations. 
  11344.  
  11345. Syntax 
  11346.  
  11347. #include <rpc\rpc.h>
  11348.  
  11349. bool_t
  11350. xdr_u_short(xdrs, usp)
  11351. XDR *xdrs;
  11352. u_short *usp;
  11353.  
  11354. Parameters 
  11355.  
  11356.  xdrs 
  11357.    Pointer to an XDR stream 
  11358.  
  11359.  usp 
  11360.    Pointer to the unsigned short integer 
  11361.  
  11362.  Return Values 
  11363.  
  11364.  The value 1 indicates success; the value 0 indicates an error. 
  11365.  
  11366.  Description 
  11367.  
  11368.  The xdr_u_short() call translates between C unsigned short integers and their 
  11369.  external representations. 
  11370.  
  11371.  
  11372. ΓòÉΓòÉΓòÉ 9.14.75. xdr_union() ΓòÉΓòÉΓòÉ
  11373.  
  11374. The xdr_union() call translates between a discriminated C union and its 
  11375. external representation. 
  11376.  
  11377. Syntax 
  11378.  
  11379. #include <rpc\rpc.h>
  11380.  
  11381. bool_t
  11382. xdr_union(xdrs, dscmp, unp, choices, dfault)
  11383. XDR *xdrs;
  11384. int *dscmp;
  11385. char *unp;
  11386. struct xdr_discrim *choices;
  11387. xdrproc_t dfault;
  11388.  
  11389. Parameters 
  11390.  
  11391.  xdrs 
  11392.    Pointer to an XDR stream 
  11393.  
  11394.  dscmp 
  11395.    Pointer to the union's discriminant 
  11396.  
  11397.  unp 
  11398.    Pointer to the union 
  11399.  
  11400.  choices 
  11401.    Pointer to an array detailing the XDR procedure to use on each arm of the 
  11402.    union 
  11403.  
  11404.  dfault 
  11405.    Default XDR procedure to use 
  11406.  
  11407.  Return Values 
  11408.  
  11409.  The value 1 indicates success; the value 0 indicates an error. 
  11410.  
  11411.  Description 
  11412.  
  11413.  The xdr_union() call translates between a discriminated C union and its 
  11414.  external representation. 
  11415.  
  11416.  
  11417. ΓòÉΓòÉΓòÉ 9.14.76. xdr_vector() ΓòÉΓòÉΓòÉ
  11418.  
  11419. The xdr_vector() call translates between a fixed-length array and its external 
  11420. representation. 
  11421.  
  11422. Syntax 
  11423.  
  11424. #include <rpc\rpc.h>
  11425.  
  11426. bool_t
  11427. xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
  11428. XDR *xdrs;
  11429. char *basep;
  11430. u_int nelem;
  11431. u_int elemsize;
  11432. xdrproc_t xdr_elem
  11433.  
  11434. Parameters 
  11435.  
  11436.  xdrs 
  11437.    Pointer to the XDR stream 
  11438.  
  11439.  basep 
  11440.    Pointer to the base of the array 
  11441.  
  11442.  nelem 
  11443.    Element count of the array 
  11444.  
  11445.  elemsize 
  11446.    Size of each of the array's elements, found by using the sizeof() operator 
  11447.  
  11448.  xdr_elem 
  11449.    Pointer to the XDR routine that translates an individual array element 
  11450.  
  11451.  Return Values 
  11452.  
  11453.  The value 1 indicates success; the value 0 indicates an error. 
  11454.  
  11455.  Description 
  11456.  
  11457.  The xdr_vector() call translates between a fixed-length array and its external 
  11458.  representation. Unlike variable-length arrays, the storage of fixed-length 
  11459.  arrays is static and unfreeable. 
  11460.  
  11461.  
  11462. ΓòÉΓòÉΓòÉ 9.14.77. xdr_void() ΓòÉΓòÉΓòÉ
  11463.  
  11464. The xdr_void() call returns a value of 1. 
  11465.  
  11466. Syntax 
  11467.  
  11468. #include <rpc\rpc.h>
  11469.  
  11470. bool_t
  11471. xdr_void()
  11472.  
  11473. Return Values 
  11474.  
  11475. The xdr_void() call always returns a value of 1. 
  11476.  
  11477. Description 
  11478.  
  11479. The xdr_void() call is used like a command that does not require any other XDR 
  11480. functions. You can place this call in the inproc or outproc parameter of the 
  11481. clnt_call() function when you do not need to move data. 
  11482.  
  11483. Related Calls 
  11484.  
  11485. callrpc()
  11486. clnt_broadcast()
  11487. clnt_call()
  11488. clnt_freeres()
  11489. pmap_rmtcall()
  11490. registerrpc()
  11491. svc_freeargs()
  11492. svc_getargs()
  11493. svc_sendreply()
  11494.  
  11495.  
  11496. ΓòÉΓòÉΓòÉ 9.14.78. xdr_wrapstring() ΓòÉΓòÉΓòÉ
  11497.  
  11498. The xdr_wrapstring() call translates between strings and their external 
  11499. representations. 
  11500.  
  11501. Syntax 
  11502.  
  11503. #include <rpc\rpc.h>
  11504.  
  11505. bool_t
  11506. xdr_wrapstring(xdrs, sp)
  11507. XDR *xdrs;
  11508. char **sp;
  11509.  
  11510. Parameters 
  11511.  
  11512.  xdrs 
  11513.    Pointer to an XDR stream 
  11514.  
  11515.  sp 
  11516.    Pointer to a pointer to the string 
  11517.  
  11518.  Return Values 
  11519.  
  11520.  The value 1 indicates success; the value 0 indicates an error. 
  11521.  
  11522.  Description 
  11523.  
  11524.  The xdr_wrapstring() call is the same as calling xdr_string() with a maximum 
  11525.  size of MAXUNSIGNED. It is useful because many RPC procedures implicitly start 
  11526.  two-parameter XDR routines, and xdr_string() is a three-parameter routine. 
  11527.  
  11528.  
  11529. ΓòÉΓòÉΓòÉ 9.14.79. xdrmem_create() ΓòÉΓòÉΓòÉ
  11530.  
  11531. The xdrmem_create() call initializes the XDR stream pointed to by xdrs. 
  11532.  
  11533. Syntax 
  11534.  
  11535. #include <rpc\rpc.h>
  11536.  
  11537. void
  11538. xdrmem_create(xdrs, addr, size, op)
  11539. XDR *xdrs;
  11540. char *addr;
  11541. u_int size;
  11542. enum xdr_op op;
  11543.  
  11544. Parameters 
  11545.  
  11546.  xdrs 
  11547.    Pointer to an XDR stream 
  11548.  
  11549.  addr 
  11550.    Pointer to the memory location 
  11551.  
  11552.  size 
  11553.    Maximum size of addr, in multiples of 4 
  11554.  
  11555.  op 
  11556.    The direction of the XDR stream (either XDR_ENCODE, XDR_DECODE, or XDR_FREE) 
  11557.  
  11558.  Description 
  11559.  
  11560.  The xdrmem_create() call initializes the XDR stream pointed to by xdrs. Data 
  11561.  is written to, or read from, addr. 
  11562.  
  11563.  
  11564. ΓòÉΓòÉΓòÉ 9.14.80. xdrrec_create() ΓòÉΓòÉΓòÉ
  11565.  
  11566. The xdrrec_create() call initializes the XDR stream pointed to by xdrs. 
  11567.  
  11568. Syntax 
  11569.  
  11570. #include <rpc\rpc.h>
  11571.  
  11572. void
  11573. xdrrec_create(xdrs, sendsize, recvsize, handle, readit, writeit)
  11574. XDR *xdrs;
  11575. u_int sendsize;
  11576. u_int recvsize;
  11577. char *handle;
  11578. int (*readit)();
  11579. int (*writeit)();
  11580.  
  11581. Parameters 
  11582.  
  11583.  xdrs 
  11584.    Pointer to an XDR stream. 
  11585.  
  11586.  sendsize 
  11587.    Size of the send buffer.  Specify 0 to choose the default. 
  11588.  
  11589.  recvsize 
  11590.    Size of the receive buffer.  Specify 0 to choose the default. 
  11591.  
  11592.  handle 
  11593.    First parameter passed to readit() and writeit(). 
  11594.  
  11595.  readit() 
  11596.    Called when a stream's input buffer is empty. 
  11597.  
  11598.  writeit() 
  11599.    Called when a stream's output buffer is full. 
  11600.  
  11601.  Description 
  11602.  
  11603.  The xdrrec_create() call initializes the XDR stream pointed to by xdrs. 
  11604.  
  11605.  Note:  The caller must set the op field in the xdrs structure. 
  11606.  
  11607.  Warning: This XDR procedure implements an intermediate record string. 
  11608.  Additional bytes in the XDR stream provide record boundary information. 
  11609.  
  11610.  
  11611. ΓòÉΓòÉΓòÉ 9.14.81. xdrrec_endofrecord() ΓòÉΓòÉΓòÉ
  11612.  
  11613. The xdrrec_endofrecord() call marks the data in the output buffer as a 
  11614. completed record. 
  11615.  
  11616. Syntax 
  11617.  
  11618. #include <rpc\rpc.h>
  11619.  
  11620. bool_t
  11621. xdrrec_endofrecord(xdrs, sendnow)
  11622. XDR *xdrs;
  11623. int sendnow;
  11624.  
  11625. Parameters 
  11626.  
  11627.  xdrs 
  11628.    Pointer to an XDR stream 
  11629.  
  11630.  sendnow 
  11631.    Specifies nonzero to write out data in the output buffer 
  11632.  
  11633.  Return Values 
  11634.  
  11635.  The value 1 indicates success; the value 0 indicates an error. 
  11636.  
  11637.  Description 
  11638.  
  11639.  You can start the xdrrec_endofrecord() call only on streams created by 
  11640.  xdrrec_create(). Data in the output buffer is marked as a complete record. 
  11641.  
  11642.  
  11643. ΓòÉΓòÉΓòÉ 9.14.82. xdrrec_eof() ΓòÉΓòÉΓòÉ
  11644.  
  11645. The xdrrec_eof() call marks the end of the file, after using the rest of the 
  11646. current record in the XDR stream. 
  11647.  
  11648. Syntax 
  11649.  
  11650. #include <rpc\rpc.h>
  11651.  
  11652. bool_t
  11653. xdrrec_eof(xdrs)
  11654. XDR *xdrs;
  11655. int empty;
  11656.  
  11657. Parameters 
  11658.  
  11659.  xdrs 
  11660.    Pointer to an XDR stream 
  11661.  
  11662.  Return Values 
  11663.  
  11664.  The value 1 indicates the current record has been consumed; the value 0 
  11665.  indicates continued input on the stream. 
  11666.  
  11667.  Description 
  11668.  
  11669.  You can start the xdrrec_eof() call only on streams created by 
  11670.  xdrrec_create(). 
  11671.  
  11672.  
  11673. ΓòÉΓòÉΓòÉ 9.14.83. xdrrec_skiprecord() ΓòÉΓòÉΓòÉ
  11674.  
  11675. The xdrrec_skiprecord() call discards the rest of the XDR stream's current 
  11676. record in the input buffer. 
  11677.  
  11678. Syntax 
  11679.  
  11680. #include <rpc\rpc.h>
  11681.  
  11682. bool_t
  11683. xdrrec_skiprecord(xdrs)
  11684. XDR *xdrs;
  11685.  
  11686. Parameters 
  11687.  
  11688.  xdrs 
  11689.    Pointer to an XDR stream 
  11690.  
  11691.  Return Values 
  11692.  
  11693.  The value 1 indicates success; the value 0 indicates an error. 
  11694.  
  11695.  Description 
  11696.  
  11697.  You can start the xdrrec_skiprecord() call only on streams created by 
  11698.  xdrrec_create(). The XDR implementation is instructed to discard the remaining 
  11699.  data in the input buffer. 
  11700.  
  11701.  Related Calls 
  11702.  
  11703.   xdrrec_create()
  11704.  
  11705.  
  11706. ΓòÉΓòÉΓòÉ 9.14.84. xdrstdio_create() ΓòÉΓòÉΓòÉ
  11707.  
  11708. The xdrstdio_create() call initializes the XDR stream pointed to by xdrs. 
  11709.  
  11710. Syntax 
  11711.  
  11712. #include <rpc\rpc.h>
  11713. #include <stdio.h>
  11714.  
  11715. void
  11716. xdrstdio_create(xdrs, file, op)
  11717. XDR *xdrs;
  11718. FILE *file;
  11719. enum xdr_op op;
  11720.  
  11721. Parameters 
  11722.  
  11723.  xdrs 
  11724.    Pointer to an XDR stream 
  11725.  
  11726.  file 
  11727.    File name for the input and output stream 
  11728.  
  11729.  op 
  11730.    The direction of the XDR stream (either XDR_ENCODE, XDR_DECODE, or XDR_FREE) 
  11731.  
  11732.  Description 
  11733.  
  11734.  The xdrstdio_create() call initializes the XDR stream pointed to by xdrs. Data 
  11735.  is written to or read from the standard I/O stream or file. 
  11736.  
  11737.  
  11738. ΓòÉΓòÉΓòÉ 9.14.85. xprt_register() ΓòÉΓòÉΓòÉ
  11739.  
  11740. The xprt_register() call registers service transport handles with the RPC 
  11741. service package. 
  11742.  
  11743. Syntax 
  11744.  
  11745. #include <rpc\rpc.h>
  11746.  
  11747. void
  11748. xprt_register(xprt)
  11749. SVCXPRT *xprt;
  11750.  
  11751. Parameters 
  11752.  
  11753.  xprt 
  11754.    Pointer to the service transport handle 
  11755.  
  11756.  Description 
  11757.  
  11758.  The xprt_register() call registers service transport handles with the RPC 
  11759.  service package. This routine also modifies the global variable svc_socks[]. 
  11760.  
  11761.  Related Calls 
  11762.  
  11763.   svc_register()
  11764.  
  11765.  
  11766. ΓòÉΓòÉΓòÉ 9.14.86. xprt_unregister() ΓòÉΓòÉΓòÉ
  11767.  
  11768. The xprt_unregister() call unregisters the RPC service transport handle. 
  11769.  
  11770. Syntax 
  11771.  
  11772. #include <rpc\rpc.h>
  11773.  
  11774. void
  11775. xprt_unregister(xprt)
  11776. SVCXPRT *xprt;
  11777.  
  11778. Parameters 
  11779.  
  11780.  xprt 
  11781.    Pointer to the service transport handle 
  11782.  
  11783.  Description 
  11784.  
  11785.  The xprt_unregister() call unregisters an RPC service transport handle. A 
  11786.  transport handle should be unregistered with the RPC service package before it 
  11787.  is destroyed. This routine also modifies the global variable svc_socks[]. 
  11788.  
  11789.  
  11790. ΓòÉΓòÉΓòÉ 10. File Transfer Protocol Application Programming Interface ΓòÉΓòÉΓòÉ
  11791.  
  11792. This section describes the FTP API routines supported by TCP/IP Version 3.0 for 
  11793. OS/2 Warp. The File Transfer Protocol (FTP) API allows applications to have a 
  11794. client interface for file transfer. Applications written to this interface can 
  11795. communicate with multiple FTP servers at the same time. The interface supports 
  11796. a maximum of 256 simultaneous connections and enables third-party proxy 
  11797. transfers between pairs of FTP servers. Consecutive third-party transfers are 
  11798. allowed between any sequence of pairs of FTP servers. 
  11799.  
  11800. The FTP API tracks the servers to which an application is currently connected. 
  11801. When a new request for FTP service is requested, the API checks whether a 
  11802. connection to the server exists and establishes one if it does not exist.  If 
  11803. the server has dropped the connection since last use, the API re-establishes 
  11804. it. 
  11805.  
  11806. Note:  The FTP API is not re-entrant. If you are using a multithreaded program, 
  11807. you must serialize the access to the APIs. For example, without serialization, 
  11808. the program may fail if it has two threads running concurrently and each thread 
  11809. has its own connection to a server. 
  11810.  
  11811. Topics 
  11812.  
  11813.       FTP API Call Library 
  11814.       Compiling and Linking an FTP API Application 
  11815.       Return Values 
  11816.       FTP API Calls 
  11817.  
  11818.  
  11819. ΓòÉΓòÉΓòÉ 10.1. FTP API Call Library ΓòÉΓòÉΓòÉ
  11820.  
  11821. To use the FTP API described in this section, you must have the <FTPAPI.H> 
  11822. header file in your TCPIP\INCLUDE directory. The FTP API routines are in the 
  11823. FTPAPI.LIB file in the LIB directory. You must also have the SO32DLL.LIB and 
  11824. TCP32DLL.LIB files in your LIB directory. 
  11825.  
  11826. Put the following statement at the top of any file using FTP API code: 
  11827.  
  11828. #include <ftpapi.h>
  11829.  
  11830. Define the OS2 variable to the compiler by doing one of the following: 
  11831.  
  11832.      Place #define OS2 at the top of each file that includes TCP/IP header 
  11833.       files. 
  11834.  
  11835.      Use the /DOS2 option when compiling the source for your application. 
  11836.  
  11837.  
  11838. ΓòÉΓòÉΓòÉ 10.2. Compiling and Linking an FTP API Application ΓòÉΓòÉΓòÉ
  11839.  
  11840. Follow these steps to compile and link the FTP API application using an IBM 
  11841. 32-bit compiler for OS/2: 
  11842.  
  11843.    1. Set your environment variables to find the following: 
  11844.  
  11845.           Executable programs 
  11846.           Link libraries 
  11847.           Header files 
  11848.  
  11849.       You can set the environment variables in your CONFIG.SYS file.  The 
  11850.       following is an example of the entries you might have in your CONFIG.SYS 
  11851.       file: 
  11852.  
  11853.             LIBPATH=E:\IBMC\DLL;C:\MPTN\DLL;C:\TCPIP\DLL;
  11854.             SET PATH=E:\IBMC\BIN;
  11855.             SET DPATH=E:\IBMC\LOCALE;E:\IBMC\HELP;
  11856.             SET LIB=E:\IBMC\LIB;C:\MPTN\LIB;C:\TCPIP\LIB;
  11857.             SET INCLUDE=E:\IBMC\INCLUDE;C:\TCPIP\INCLUDE;
  11858.             SET HELP=E:\IBMC\HELP;
  11859.             SET BOOKSHELF=E:\IBMC\HELP;
  11860.             SET TMP=E:\IBMC\TMP
  11861.             SET TZ=EST5EDT,0,0,0,0,0,0,0,0,0
  11862.  
  11863.    2. To compile your program, enter: 
  11864.  
  11865.             icc /Ti /DOS2 /Sm /Ss /Q /Gt /C myprog.c
  11866.  
  11867.    3. To create an executable program, you can enter: 
  11868.  
  11869.       For VisualAge C++ 
  11870.  
  11871.             ilink /NOFREEFORMAT /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  11872.             ftpapi.lib
  11873.  
  11874.       For C Set++ 
  11875.  
  11876.             link386 /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  11877.             ftpapi.lib
  11878.  
  11879.  Note: 
  11880.  
  11881.    1. Programs that recognize long file names must indicate this by including 
  11882.       the NEWFILES statement in their module definition file. 
  11883.  
  11884.    2. The FTP API is not re-entrant.  If you are using a multithreaded program, 
  11885.       you must serialize the access to the APIs. 
  11886.  
  11887.    3. Before you run a program, verify that the DLL files are in a directory 
  11888.       listed in the LIBPATH system environment variable. 
  11889.  
  11890.    4. For more information about the compile and link options, and dynamic link 
  11891.       libraries, see the User's Guide provided with your compiler. 
  11892.  
  11893.  
  11894. ΓòÉΓòÉΓòÉ 10.3. Return Values ΓòÉΓòÉΓòÉ
  11895.  
  11896. Most functions return a value of -1 to indicate failure and a value of 0 to 
  11897. indicate success.  Two functions do not return 0 and -1 values: ftplogoff(), 
  11898. which is of type void, and ping(), which returns an error code rather than 
  11899. storing the return value in ftperrno.  When the value is -1, the global integer 
  11900. variable ftperrno is set to one of the following codes: 
  11901.  
  11902.  Return Code         Description 
  11903.  FTPSERVICE          Unknown service. 
  11904.  FTPHOST             Unknown host. 
  11905.  FTPSOCKET           Unable to obtain socket. 
  11906.  FTPCONNECT          Unable to connect to server. 
  11907.  FTPLOGIN            Login failed. 
  11908.  FTPABORT            Transfer aborted. 
  11909.  FTPLOCALFILE        Problem opening the local file. 
  11910.  FTPDATACONN         Problem initializing data connection. 
  11911.  FTPCOMMAND          Command failed. 
  11912.  FTPPROXYTHIRD       Proxy server does not support third party. 
  11913.  FTPNOPRIMARY        No primary connection for proxy transfer. 
  11914.  
  11915.  
  11916. ΓòÉΓòÉΓòÉ 10.4. FTP API Calls ΓòÉΓòÉΓòÉ
  11917.  
  11918. This section provides the syntax, parameters, and other appropriate information 
  11919. for each FTP API call supported by TCP/IP Version 3.0 for OS/2 Warp. 
  11920.  
  11921. Topics 
  11922.  
  11923.       ftpappend() 
  11924.       ftpcd() 
  11925.       ftpdelete() 
  11926.       ftpdir() 
  11927.       ftpget() 
  11928.       ftplogoff() 
  11929.       ftpls() 
  11930.       ftpmkd() 
  11931.       ftpping() 
  11932.       ftpproxy() 
  11933.       ftpput() 
  11934.       ftpputunique() 
  11935.       ftppwd() 
  11936.       ftpquote() 
  11937.       ftprename() 
  11938.       ftprmd() 
  11939.       ftpsite() 
  11940.       ftpsys() 
  11941.       ftptrcoff() 
  11942.       ftptrcon() 
  11943.       ftpver() 
  11944.       ping() 
  11945.  
  11946.  
  11947. ΓòÉΓòÉΓòÉ 10.4.1. ftpappend() ΓòÉΓòÉΓòÉ
  11948.  
  11949. The ftpappend() call appends information to a remote file. 
  11950.  
  11951. Syntax 
  11952.  
  11953. #include <ftpapi.h>
  11954.  
  11955. int ftpappend(host, userid, passwd, acct, local,
  11956.               remote, transfertype)
  11957. char *host;
  11958. char *userid;
  11959. char *passwd;
  11960. char *acct;
  11961. char *local;
  11962. char *remote;
  11963. int transfertype;
  11964.  
  11965. Parameters 
  11966.  
  11967.  host 
  11968.    Host running the FTP server. 
  11969.  
  11970.  userid 
  11971.    ID used for logon. 
  11972.  
  11973.  passwd 
  11974.    Password of the user ID. 
  11975.  
  11976.  acct 
  11977.    Account (when needed); can be NULL. 
  11978.  
  11979.  local 
  11980.    Local file name. 
  11981.  
  11982.  remote 
  11983.    Remote file name. 
  11984.  
  11985.  transfertype 
  11986.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  11987.    binary. 
  11988.  
  11989.  Return Values 
  11990.  
  11991.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  11992.  ftperrno indicates the specific error.  See Return Values for a description of 
  11993.  the return codes. 
  11994.  
  11995.  Description 
  11996.  
  11997.  The ftpappend() call appends information to a remote file. 
  11998.  
  11999.  Examples 
  12000.  
  12001.   int rc;
  12002.   rc=ftpappend("conypc","jason","ehgr1",NULL,"abc.doc","new.doc",T_ASCII);
  12003.  
  12004.  The local ASCII file abc.doc is appended to the file new.doc in the current 
  12005.  working directory at the host conypc. 
  12006.  
  12007.  
  12008. ΓòÉΓòÉΓòÉ 10.4.2. ftpcd() ΓòÉΓòÉΓòÉ
  12009.  
  12010. The ftpcd() call changes the current working directory on a host. 
  12011.  
  12012. Syntax 
  12013.  
  12014. #include <ftpapi.h>
  12015.  
  12016. int ftpcd(host, userid, passwd, acct, dir)
  12017. char *host;
  12018. char *userid;
  12019. char *passwd;
  12020. char *acct,
  12021. char *dir;
  12022.  
  12023. Parameters 
  12024.  
  12025.  host 
  12026.    Host running the FTP server 
  12027.  
  12028.  userid 
  12029.    ID used for logon 
  12030.  
  12031.  passwd 
  12032.    Password of the user ID 
  12033.  
  12034.  acct 
  12035.    Account (when needed); can be NULL 
  12036.  
  12037.  dir 
  12038.    New working directory 
  12039.  
  12040.  Return Values 
  12041.  
  12042.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12043.  ftperrno indicates the specific error.  See Return Values for a description of 
  12044.  the return codes. 
  12045.  
  12046.  Description 
  12047.  
  12048.  The ftpcd() call changes the current working directory. 
  12049.  
  12050.  Examples 
  12051.  
  12052.   int rc;
  12053.   rc=ftpcd("conypc","jason","ehgr1",NULL,"mydir");
  12054.  
  12055.  The current working directory is changed to mydir on the host conypc using the 
  12056.  user ID jason and the password ehgr1. 
  12057.  
  12058.  
  12059. ΓòÉΓòÉΓòÉ 10.4.3. ftpdelete() ΓòÉΓòÉΓòÉ
  12060.  
  12061. The ftpdelete() call deletes files on a remote host. 
  12062.  
  12063. Syntax 
  12064.  
  12065. #include <ftpapi.h>
  12066.  
  12067. int ftpdelete(host, userid, passwd, acct, name)
  12068. char *host;
  12069. char *userid;
  12070. char *passwd;
  12071. char *acct;
  12072. char *name;
  12073.  
  12074. Parameters 
  12075.  
  12076.  host 
  12077.    Host running the FTP server 
  12078.  
  12079.  userid 
  12080.    ID used for logon 
  12081.  
  12082.  passwd 
  12083.    Password of the user ID 
  12084.  
  12085.  acct 
  12086.    Account (when needed); can be NULL 
  12087.  
  12088.  name 
  12089.    File to be deleted 
  12090.  
  12091.  Return Values 
  12092.  
  12093.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12094.  ftperrno indicates the specific error.  See Return Values for a description of 
  12095.  the return codes. 
  12096.  
  12097.  Description 
  12098.  
  12099.  The ftpdelete() call deletes a file on a host. 
  12100.  
  12101.  Examples 
  12102.  
  12103.   int rc;
  12104.   rc=ftpdelete("conypc","jason","ehgr1",NULL,"abc.1");
  12105.  
  12106.  The file abc.1 is deleted on the host conypc using the user ID jason and the 
  12107.  password ehgr1. 
  12108.  
  12109.  
  12110. ΓòÉΓòÉΓòÉ 10.4.4. ftpdir() ΓòÉΓòÉΓòÉ
  12111.  
  12112. The ftpdir() call gets a directory in wide format from a host. 
  12113.  
  12114. Syntax 
  12115.  
  12116. #include <ftpapi.h>
  12117.  
  12118. int ftpdir(host, userid, passwd, acct, local, pattern,)
  12119. char *host;
  12120. char *userid;
  12121. char *passwd;
  12122. char *acct;
  12123. char *local;
  12124. char *pattern;
  12125.  
  12126. Parameters 
  12127.  
  12128.  host 
  12129.    Host running the FTP server. 
  12130.  
  12131.  userid 
  12132.    ID used for logon. 
  12133.  
  12134.  passwd 
  12135.    Password of the user ID. 
  12136.  
  12137.  acct 
  12138.    Account (when needed); can be NULL. 
  12139.  
  12140.  local 
  12141.    Local file name. 
  12142.  
  12143.  pattern 
  12144.    The file name or pattern of the files to be listed on the foreign host. 
  12145.    Patterns are any combination of ASCII characters.  The following two 
  12146.    characters have special meaning: 
  12147.  
  12148.    *        Shows that any character or group of characters can occupy that 
  12149.             position in the pattern. 
  12150.  
  12151.    ?        Shows that any single character can occupy that position in the 
  12152.             pattern. 
  12153.  
  12154.  Return Values 
  12155.  
  12156.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12157.  ftperrno indicates the specific error.  See Return Values for a description of 
  12158.  the return codes. 
  12159.  
  12160.  Description 
  12161.  
  12162.  The ftpdir() call gets a directory in wide format from a host. 
  12163.  
  12164.  Examples 
  12165.  
  12166.   int rc;
  12167.   rc=ftpdir("conypc","jason","ehgr1",NULL,"conypc.dir","*.c");
  12168.  
  12169.  ftpdir() gets a directory of *.c files in wide format, and stores the 
  12170.  directory in a local file, conypc.dir. 
  12171.  
  12172.  
  12173. ΓòÉΓòÉΓòÉ 10.4.5. ftpget() ΓòÉΓòÉΓòÉ
  12174.  
  12175. The ftpget() call gets a file from an FTP server. 
  12176.  
  12177. Syntax 
  12178.  
  12179. #include <ftpapi.h>
  12180.  
  12181. int ftpget(host, userid, passwd, acct, local, remote,
  12182.            mode, transfertype)
  12183. char *host;
  12184. char *userid;
  12185. char *passwd;
  12186. char *acct;
  12187. char *local;
  12188. char *remote;
  12189. char *mode;
  12190. int transfertype;
  12191.  
  12192. Parameters 
  12193.  
  12194.  host 
  12195.    Host running the FTP server. 
  12196.  
  12197.  userid 
  12198.    ID used for logon. 
  12199.  
  12200.  passwd 
  12201.    Password of the user ID. 
  12202.  
  12203.  acct 
  12204.    Account (when needed); can be NULL. 
  12205.  
  12206.  local 
  12207.    Local file name. 
  12208.  
  12209.  remote 
  12210.    Remote file name. 
  12211.  
  12212.  mode 
  12213.    Either w for write or a for append. 
  12214.  
  12215.  transfertype 
  12216.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  12217.    binary. 
  12218.  
  12219.  Return Values 
  12220.  
  12221.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12222.  ftperrno indicates the specific error.  See Return Values for a description of 
  12223.  the return codes. 
  12224.  
  12225.  Description 
  12226.  
  12227.  The ftpget() call gets a file from an FTP server. 
  12228.  
  12229.  Examples 
  12230.  
  12231.   int rc;
  12232.   rc=ftpget("conypc","jason","ehgr1",NULL,"new.doc","abc.doc","w",T_ASCII);
  12233.  
  12234.  The system copies the ASCII file abc.doc on the host conypc into the local 
  12235.  current working directory as the file new.doc.  If the file new.doc already 
  12236.  exists in the local current working directory, the contents of the file 
  12237.  abc.doc overwrite the file new.doc. 
  12238.  
  12239.  
  12240. ΓòÉΓòÉΓòÉ 10.4.6. ftplogoff() ΓòÉΓòÉΓòÉ
  12241.  
  12242. The ftplogoff() call closes all current connections. 
  12243.  
  12244. Syntax 
  12245.  
  12246. #include <ftpapi.h>
  12247.  
  12248. void ftplogoff()
  12249.  
  12250. Description 
  12251.  
  12252. The ftplogoff() call closes all current connections.  An application must call 
  12253. this before terminating. 
  12254.  
  12255.  
  12256. ΓòÉΓòÉΓòÉ 10.4.7. ftpls() ΓòÉΓòÉΓòÉ
  12257.  
  12258. The ftpls() call gets directory information in short format from a remote host 
  12259. and writes it to a local file. 
  12260.  
  12261. Syntax 
  12262.  
  12263. #include <ftpapi.h>
  12264.  
  12265. int ftpls(host, userid, passwd, acct, local, pattern)
  12266. char *host;
  12267. char *userid;
  12268. char *passwd;
  12269. char *acct;
  12270. char *local;
  12271. char *pattern;
  12272.  
  12273. Parameters 
  12274.  
  12275.  host 
  12276.    Host running the FTP server. 
  12277.  
  12278.  userid 
  12279.    ID used for logon. 
  12280.  
  12281.  passwd 
  12282.    Password of the user ID. 
  12283.  
  12284.  acct 
  12285.    Account (when needed); can be NULL. 
  12286.  
  12287.  local 
  12288.    Local file into which the information is placed. 
  12289.  
  12290.  pattern 
  12291.    The file name or pattern of the files to be listed on the foreign host. 
  12292.    Patterns are any combination of ASCII characters.  The following two 
  12293.    characters have special meaning: 
  12294.  
  12295.    *        Shows that any character or group of characters can occupy that 
  12296.             position in the pattern. 
  12297.  
  12298.    ?        Shows that any single character can occupy that position in the 
  12299.             pattern. 
  12300.  
  12301.  Return Values 
  12302.  
  12303.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12304.  ftperrno indicates the specific error.  See Return Values for a description of 
  12305.  the return codes. 
  12306.  
  12307.  Description 
  12308.  
  12309.  The ftpls() call gets directory information in short format from a host and 
  12310.  writes it to a local file. 
  12311.  
  12312.  Examples 
  12313.  
  12314.   int rc;
  12315.   rc=ftpls("conypc","jason","ehgr1",NULL,"conypc.dir","*.c");
  12316.  
  12317.  ftpls() gets a directory of *.c files in short format and stores the names in 
  12318.  the local file conypc.dir. 
  12319.  
  12320.  
  12321. ΓòÉΓòÉΓòÉ 10.4.8. ftpmkd() ΓòÉΓòÉΓòÉ
  12322.  
  12323. The ftpmkd() call creates a new directory on a target machine. 
  12324.  
  12325. Syntax 
  12326.  
  12327. #include <ftpapi.h>
  12328.  
  12329. int ftpmkd(host, userid, passwd, acct, dir)
  12330. char *host;
  12331. char *userid;
  12332. char *passwd;
  12333. char *acct;
  12334. char *dir;
  12335.  
  12336. Parameters 
  12337.  
  12338.  host 
  12339.    Host running the FTP server 
  12340.  
  12341.  userid 
  12342.    ID used for logon 
  12343.  
  12344.  passwd 
  12345.    Password of the user ID 
  12346.  
  12347.  acct 
  12348.    Account (when needed); can be NULL 
  12349.  
  12350.  dir 
  12351.    Directory to be created 
  12352.  
  12353.  Return Values 
  12354.  
  12355.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12356.  ftperrno indicates the specific error.  See Return Values for a description of 
  12357.  the return codes. 
  12358.  
  12359.  Description 
  12360.  
  12361.  The ftpmkd() call creates a new directory on a host. 
  12362.  
  12363.  Examples 
  12364.  
  12365.   int rc;
  12366.   rc=ftpmkd("conypc","jason","ehgr1",NULL,"mydir");
  12367.  
  12368.  The directory mydir is created on the host conypc, using the user ID jason and 
  12369.  the password ehgr1. 
  12370.  
  12371.  
  12372. ΓòÉΓòÉΓòÉ 10.4.9. ftpping() ΓòÉΓòÉΓòÉ
  12373.  
  12374. The ftpping() call resolves a host name and sends a ping to the remote host to 
  12375. determine if that host is responding. 
  12376.  
  12377. Syntax 
  12378.  
  12379. #include <ftpapi.h>
  12380.  
  12381. int ftpping(host, len, addr)
  12382. char *host;
  12383. int len;
  12384. unsigned long *addr;
  12385.  
  12386. Parameters 
  12387.  
  12388.  host 
  12389.    Host running the FTP server 
  12390.  
  12391.  len 
  12392.    Length of the ping packets 
  12393.  
  12394.  addr 
  12395.    Buffer in which to return the host internet address 
  12396.  
  12397.  Return Values 
  12398.  
  12399.  The following are ftpping() call return codes and their corresponding 
  12400.  descriptions: 
  12401.  
  12402.  Return Code         Description 
  12403.  PINGREPLY           Host does not reply 
  12404.  PINGSOCKET          Unable to obtain socket 
  12405.  PINGPROTO           Unknown protocol ICMP 
  12406.  PINGSEND            Send failed 
  12407.  PINGRECV            Recv failed 
  12408.  PINGHOST            Unknown host 
  12409.  
  12410.  Description 
  12411.  
  12412.  The ftpping() call tries to resolve the host name through a name server.  If 
  12413.  the name server is not present, ftpping() searches the TCPIP\ETC\HOSTS file 
  12414.  for a matching host name.  Unlike the ping() call, ftpping() could take 
  12415.  several seconds because it must resolve the host name before it sends a ping. 
  12416.  For this reason, use ftpping() only in the first try to determine if the host 
  12417.  is responding.  The ftpping() call sets the addr parameter to the internet 
  12418.  address of the host.  After the first try, use this address value to call 
  12419.  ping. 
  12420.  
  12421.  If the ftpping() return value is positive, the return value is the number of 
  12422.  milliseconds it took for the echo to return.  If the return value is negative, 
  12423.  it contains an error code.  The parameter len specifies the length of the ping 
  12424.  packet(s). 
  12425.  
  12426.  Examples 
  12427.  
  12428.   int              rc;
  12429.   unsigned long    addr;
  12430.  
  12431.   rc = ftpping("conypc", 256, &addr);
  12432.  
  12433.  The ftpping() call sends a 256-byte ping packet to the host conypc. 
  12434.  
  12435.  
  12436. ΓòÉΓòÉΓòÉ 10.4.10. ftpproxy() ΓòÉΓòÉΓòÉ
  12437.  
  12438. The ftpproxy() call transfers a file between two remote servers without sending 
  12439. the file to the local host. 
  12440.  
  12441. Syntax 
  12442.  
  12443. #include <ftpapi.h>
  12444.  
  12445. int ftpproxy(host1, userid1, passwd1, acct1, host2, userid2,
  12446.               passwd2, acct2, fn1, fn2, transfertype)
  12447. char *host1;
  12448. char *userid1;
  12449. char *passwd1;
  12450. char *acct1;
  12451. char *host2;
  12452. char *userid2;
  12453. char *passwd2;
  12454. char *acct2;
  12455. char *fn1;
  12456. char *fn2;
  12457. int transfertype;
  12458.  
  12459. Parameters 
  12460.  
  12461.  host1 
  12462.    Target host running the FTP server. 
  12463.  
  12464.  userid1 
  12465.    ID used for logon on host 1. 
  12466.  
  12467.  passwd1 
  12468.    Password of the user ID on host 1. 
  12469.  
  12470.  acct1 
  12471.    Account for host 1 (when needed); can be NULL. 
  12472.  
  12473.  host2 
  12474.    Source host running the FTP server. 
  12475.  
  12476.  userid2 
  12477.    ID used for logon on host 2. 
  12478.  
  12479.  passwd2 
  12480.    Password of the user ID on host 2. 
  12481.  
  12482.  acct2 
  12483.    Account for host 2 (when needed); can be NULL. 
  12484.  
  12485.  fn1 
  12486.    File to be written on host 1. 
  12487.  
  12488.  fn2 
  12489.    File to be copied from host 2. 
  12490.  
  12491.  transfertype 
  12492.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  12493.    binary. 
  12494.  
  12495.  Return Values 
  12496.  
  12497.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12498.  ftperrno indicates the specific error.  See Return Values for a description of 
  12499.  the return codes. 
  12500.  
  12501.  Description 
  12502.  
  12503.  The ftpproxy() call copies a file on a specified source host directly to a 
  12504.  specified target host, without involving the requesting host in the file 
  12505.  transfer.  This call is functionally the same as the FTP client subcommand 
  12506.  proxy put. 
  12507.  
  12508.  Note:  For ftpproxy() to complete successfully, both the source and the target 
  12509.  hosts must be running the FTP servers. In addition, ftpproxy() does not 
  12510.  support connections through a firewall. 
  12511.  
  12512.  Examples 
  12513.  
  12514.   int rc;
  12515.   rc=ftpproxy("pc1","oleg","erst",NULL,  /* target host information*/
  12516.               "pc2","yan", "dssa1", NULL, /* source host information*/
  12517.               "\tmp\newdoc.1",            /* target file name */
  12518.               "\tmp\doc.1",               /* source file name */
  12519.               T_ASCII);                   /* ascii transfer */
  12520.  
  12521.  The ASCII file \tmp\doc.1 on the host pc2 is copied to host pc1 as the file 
  12522.  \tmp\newdoc.1. 
  12523.  
  12524.  
  12525. ΓòÉΓòÉΓòÉ 10.4.11. ftpput() ΓòÉΓòÉΓòÉ
  12526.  
  12527. The ftpput() call transfers a file to a host. 
  12528.  
  12529. Syntax 
  12530.  
  12531. #include <ftpapi.h>
  12532.  
  12533. int ftpput(host, userid, passwd, acct, local, remote, transfertype)
  12534. char *host;
  12535. char *userid;
  12536. char *passwd;
  12537. char *acct;
  12538. char *local;
  12539. char *remote;
  12540. int transfertype;
  12541.  
  12542. Parameters 
  12543.  
  12544.  host 
  12545.    Host running the FTP server. 
  12546.  
  12547.  userid 
  12548.    ID used for logon. 
  12549.  
  12550.  passwd 
  12551.    Password of the user ID. 
  12552.  
  12553.  acct 
  12554.    Account (when needed); can be NULL. 
  12555.  
  12556.  local 
  12557.    Local file name. 
  12558.  
  12559.  remote 
  12560.    Remote file name. 
  12561.  
  12562.  transfertype 
  12563.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  12564.    binary. 
  12565.  
  12566.  Return Values 
  12567.  
  12568.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12569.  ftperrno indicates the specific error.  See Return Values for a description of 
  12570.  the return codes. 
  12571.  
  12572.  Description 
  12573.  
  12574.  The ftpput() call transfers a file to an FTP server. 
  12575.  
  12576.  Examples 
  12577.  
  12578.   int rc;
  12579.   rc=ftpput("conypc","jason","ehgr1",NULL,"abc.doc","new.doc",T_ASCII);
  12580.  
  12581.  The system copies the ASCII file abc.doc on the local current working 
  12582.  directory to the current working directory of the host conypc as file new.doc. 
  12583.  If the file new.doc already exists, the contents of the file abc.doc overwrite 
  12584.  the file new.doc. 
  12585.  
  12586.  
  12587. ΓòÉΓòÉΓòÉ 10.4.12. ftpputunique() ΓòÉΓòÉΓòÉ
  12588.  
  12589. The ftpputunique() call transfers a file to a host and ensures it is created 
  12590. with a unique name. 
  12591.  
  12592. Syntax 
  12593.  
  12594. #include <ftpapi.h>
  12595.  
  12596. int ftpputunique(host, userid, passwd, acct, local, remote,
  12597.                  transfertype)
  12598. char *host;
  12599. char *userid;
  12600. char *passwd;
  12601. char *acct;
  12602. char *local;
  12603. char *remote;
  12604. int transfertype;
  12605.  
  12606. Parameters 
  12607.  
  12608.  host 
  12609.    Host running the FTP server. 
  12610.  
  12611.  userid 
  12612.    ID used for logon. 
  12613.  
  12614.  passwd 
  12615.    Password of the user ID. 
  12616.  
  12617.  acct 
  12618.    Account (when needed); can be NULL. 
  12619.  
  12620.  local 
  12621.    Local file name. 
  12622.  
  12623.  remote 
  12624.    Remote file name. 
  12625.  
  12626.  transfertype 
  12627.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  12628.    binary. 
  12629.  
  12630.  Return Values 
  12631.  
  12632.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12633.  ftperrno indicates the specific error.  See Return Values for a description of 
  12634.  the return codes. 
  12635.  
  12636.  Description 
  12637.  
  12638.  The ftpputunique() call copies a local file to a file on a specified host.  It 
  12639.  guarantees that the new file will have a unique name and that the new file 
  12640.  will not overwrite a file with the same name. If the file already exists on 
  12641.  the host, a new and unique file name is created and used as the target of the 
  12642.  file transfer. 
  12643.  
  12644.  Examples 
  12645.  
  12646.   int rc;
  12647.   rc=ftpputunique(
  12648.          "conypc","jason","ehgr1",NULL,"abc.doc", "new.doc",T_ASCII);
  12649.  
  12650.  The ASCII file abc.doc is copied to the current working directory of the host 
  12651.  conypc as file new.doc, unless the file new.doc already exists.  If the file 
  12652.  new.doc already exists, the file new.doc is given a new name unique within the 
  12653.  current working directory on the host conypc.  The name of the new file is 
  12654.  displayed upon successful completion of the file transfer. 
  12655.  
  12656.  
  12657. ΓòÉΓòÉΓòÉ 10.4.13. ftppwd() ΓòÉΓòÉΓòÉ
  12658.  
  12659. The ftppwd() call stores the string containing the FTP server description of 
  12660. the current working directory on the host to the buffer. 
  12661.  
  12662. Syntax 
  12663.  
  12664. #include <ftpapi.h>
  12665.  
  12666. int ftppwd(host, userid, passwd, acct, buf, buflen)
  12667. char *host;
  12668. char *userid;
  12669. char *passwd;
  12670. char *acct,
  12671. char *buf;
  12672. crt *buflen;
  12673.  
  12674. Parameters 
  12675.  
  12676.  host 
  12677.    Host running the FTP server 
  12678.  
  12679.  userid 
  12680.    ID used for logon 
  12681.  
  12682.  passwd 
  12683.    Password of the user ID 
  12684.  
  12685.  acct 
  12686.    Account (when needed); can be NULL 
  12687.  
  12688.  buf 
  12689.    Buffer to store the string returned by the FTP server 
  12690.  
  12691.  buflen 
  12692.    Length of buf 
  12693.  
  12694.  Return Values 
  12695.  
  12696.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12697.  ftperrno indicates the specific error.  See Return Values for a description of 
  12698.  the return codes. 
  12699.  
  12700.  Description 
  12701.  
  12702.  The ftppwd() call stores the string containing the FTP server description of 
  12703.  the current working directory on the host to the buffer buf.  The string 
  12704.  describing the current working directory is truncated to fit buf if it is 
  12705.  longer than buflen.  The returned string is always null-terminated. 
  12706.  
  12707.  Examples 
  12708.  
  12709.   int rc;
  12710.   rc=ftppwd("conypc","jason","ehgr1","dirbuf", sizeof dirbuf);
  12711.  
  12712.  After the ftppwd() call, the buffer dirbuf contains the following: 
  12713.  
  12714.   "C:\" is current directory.
  12715.  
  12716.  The server reply describing the current working directory on host conypc using 
  12717.  user ID jason with password eghr1 is stored to dirbuf. 
  12718.  
  12719.  
  12720. ΓòÉΓòÉΓòÉ 10.4.14. ftpquote() ΓòÉΓòÉΓòÉ
  12721.  
  12722. The ftpquote() call sends a string to the server verbatim. 
  12723.  
  12724. Syntax 
  12725.  
  12726. #include <ftpapi.h>
  12727.  
  12728. int ftpquote(host, userid, passwd, acct, quotestr)
  12729. char *host;
  12730. char *userid;
  12731. char *passwd;
  12732. char *acct;
  12733. char *quotestr;
  12734.  
  12735. Parameters 
  12736.  
  12737.  host 
  12738.    Host running the FTP server 
  12739.  
  12740.  userid 
  12741.    ID used for logon 
  12742.  
  12743.  passwd 
  12744.    Password of the user ID 
  12745.  
  12746.  acct 
  12747.    Account (when needed); can be NULL 
  12748.  
  12749.  quotestr 
  12750.    Quote string to be passed to the FTP server verbatim 
  12751.  
  12752.  Return Values 
  12753.  
  12754.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12755.  ftperrno indicates the specific error.  See Return Values for a description of 
  12756.  the return codes. 
  12757.  
  12758.  Description 
  12759.  
  12760.  The ftpquote() call sends a string to the server verbatim. 
  12761.  
  12762.  Examples 
  12763.  
  12764.   int rc;
  12765.   rc=ftpquote("conypc","jason","ehgr1",NULL,"site idle 2000");
  12766.  
  12767.  The idle is set to time out in 2000 seconds. Your server might not support 
  12768.  that amount of idle time. 
  12769.  
  12770.  
  12771. ΓòÉΓòÉΓòÉ 10.4.15. ftprename() ΓòÉΓòÉΓòÉ
  12772.  
  12773. The ftprename() call renames a file on a remote host. 
  12774.  
  12775. Syntax 
  12776.  
  12777. #include <ftpapi.h>
  12778.  
  12779. int ftprename(host, userid, passwd, acct, namefrom, nameto)
  12780. char *host;
  12781. char *userid;
  12782. char *passwd;
  12783. char *acct;
  12784. char *namefrom;
  12785. char *nameto;
  12786.  
  12787. Parameters 
  12788.  
  12789.  host 
  12790.    Host running the FTP server 
  12791.  
  12792.  userid 
  12793.    ID used for logon 
  12794.  
  12795.  passwd 
  12796.    Password of the user ID 
  12797.  
  12798.  acct 
  12799.    Account (when needed); can be NULL 
  12800.  
  12801.  namefrom 
  12802.    Original file name 
  12803.  
  12804.  nameto 
  12805.    New file name 
  12806.  
  12807.  Return Values 
  12808.  
  12809.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12810.  ftperrno indicates the specific error.  See Return Values for a description of 
  12811.  the return codes. 
  12812.  
  12813.  Description 
  12814.  
  12815.  The ftprename() call renames a file on a host. 
  12816.  
  12817.  Examples 
  12818.  
  12819.   int rc;
  12820.   rc=ftprename("conypc","jason","ehgr1",NULL,"abc.1","cd.fg");
  12821.  
  12822.  The file abc.1 is renamed to cd.fg on host conypc, using user ID jason, with 
  12823.  password ehgr1. 
  12824.  
  12825.  
  12826. ΓòÉΓòÉΓòÉ 10.4.16. ftprmd() ΓòÉΓòÉΓòÉ
  12827.  
  12828. The ftprmd() call removes a directory on a target machine. 
  12829.  
  12830. Syntax 
  12831.  
  12832. #include <ftpapi.h>
  12833.  
  12834. int ftprmd(host, userid, passwd, acct, dir)
  12835. char *host;
  12836. char *userid;
  12837. char *passwd;
  12838. char *acct;
  12839. char *dir;
  12840.  
  12841. Parameters 
  12842.  
  12843.  host 
  12844.    Host running the FTP server 
  12845.  
  12846.  userid 
  12847.    ID used for logon 
  12848.  
  12849.  passwd 
  12850.    Password of the user ID 
  12851.  
  12852.  acct 
  12853.    Account (when needed); can be NULL 
  12854.  
  12855.  dir 
  12856.    Directory to be removed 
  12857.  
  12858.  Return Values 
  12859.  
  12860.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12861.  ftperrno indicates the specific error.  See Return Values for a description of 
  12862.  the return codes. 
  12863.  
  12864.  Description 
  12865.  
  12866.  The ftprmd() call removes a directory on a host. 
  12867.  
  12868.  Examples 
  12869.  
  12870.   int rc;
  12871.   rc=ftprmd("conypc","jason","ehgr1",NULL,"mydir");
  12872.  
  12873.  The directory, mydir, is removed on the host, conypc, using the user ID, 
  12874.  jason, and the password, ehgr1. 
  12875.  
  12876.  
  12877. ΓòÉΓòÉΓòÉ 10.4.17. ftpsite() ΓòÉΓòÉΓòÉ
  12878.  
  12879. The ftpsite() call executes the site command. (For more information about the 
  12880. site command, see the TCP/IP Command Reference.) 
  12881.  
  12882. Syntax 
  12883.  
  12884. #include <ftpapi.h>
  12885.  
  12886. int ftpsite(host, userid, passwd, acct, sitestr)
  12887. char *host;
  12888. char *userid;
  12889. char *passwd;
  12890. char *acct;
  12891. char *sitestr;
  12892.  
  12893. Parameters 
  12894.  
  12895.  host 
  12896.    Host running the FTP server 
  12897.  
  12898.  userid 
  12899.    ID used for logon 
  12900.  
  12901.  passwd 
  12902.    Password of the user ID 
  12903.  
  12904.  acct 
  12905.    Account (when needed); can be NULL 
  12906.  
  12907.  sitestr 
  12908.    Site string to be executed 
  12909.  
  12910.  Return Values 
  12911.  
  12912.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12913.  ftperrno indicates the specific error.  See Return Values for a description of 
  12914.  the return codes. 
  12915.  
  12916.  Description 
  12917.  
  12918.  The ftpsite() call executes the site command. 
  12919.  
  12920.  Note:  ftpsite() does not support connections through a firewall. 
  12921.  
  12922.  Examples 
  12923.  
  12924.   int rc;
  12925.   rc=ftpsite("conypc","jason","ehgr1",NULL,"idle 2000");
  12926.  
  12927.  The idle is set to time out in 2000 seconds. Your server might not support 
  12928.  that amount of idle time. 
  12929.  
  12930.  
  12931. ΓòÉΓòÉΓòÉ 10.4.18. ftpsys() ΓòÉΓòÉΓòÉ
  12932.  
  12933. The ftpsys() call stores the string containing the FTP server description of 
  12934. the operating system running on the host in a buffer. 
  12935.  
  12936. Syntax 
  12937.  
  12938. #include <ftpapi.h>
  12939.  
  12940. int ftpsys(host, userid, passwd, acct, buf, buflen)
  12941. char *host;
  12942. char *userid;
  12943. char *passwd;
  12944. char *acct,
  12945. char *buf;
  12946. int *buflen;
  12947.  
  12948. Parameters 
  12949.  
  12950.  host 
  12951.    Host running the FTP server 
  12952.  
  12953.  userid 
  12954.    ID used for logon 
  12955.  
  12956.  passwd 
  12957.    Password of the user ID 
  12958.  
  12959.  acct 
  12960.    Account (when needed); can be NULL 
  12961.  
  12962.  buf 
  12963.    Buffer to store the string returned by the FTP server 
  12964.  
  12965.  buflen 
  12966.    Length of buf 
  12967.  
  12968.  Return Values 
  12969.  
  12970.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  12971.  ftperrno indicates the specific error.  See Return Values for a description of 
  12972.  the return codes. 
  12973.  
  12974.  Description 
  12975.  
  12976.  The ftpsys() call stores the string containing the FTP server description of 
  12977.  the operating system running on the host in the buffer buf. The string 
  12978.  describing the operating system of the host is truncated to fit buf if it is 
  12979.  longer than buflen.  The returned string is always null-terminated. 
  12980.  
  12981.  Examples 
  12982.  
  12983.   int rc;
  12984.   rc=ftpsys("ralvmm","jason","ehgr1",hostsysbuf, sizeof hostsysbuf);
  12985.  
  12986.  After the ftpsys() call the buffer hostsysbuf contains the following: 
  12987.  
  12988.   VM is the operating system of this server.
  12989.  
  12990.  The FTP server reply describing the operating system of host ralvmm using user 
  12991.  ID jason with password eghr1 is stored to hostsysbuf. 
  12992.  
  12993.  
  12994. ΓòÉΓòÉΓòÉ 10.4.19. ftptrcoff() ΓòÉΓòÉΓòÉ
  12995.  
  12996. The ftptrcoff() closes the trace file and stops tracing. 
  12997.  
  12998. Syntax 
  12999.  
  13000. #include <ftpapi.h>
  13001.  
  13002.   int ftptrcoff(void)
  13003.  
  13004. Parameters 
  13005.  
  13006.    None. 
  13007.  
  13008.  Return Values 
  13009.  
  13010.  The ftptrcoff() always return a value of 0. 
  13011.  
  13012.  Description 
  13013.  
  13014.  The ftptrcoff() closes the trace file and stops tracing of the command and 
  13015.  reply sequences sent over the control connection between the local and remote 
  13016.  hosts. 
  13017.  
  13018.  Examples 
  13019.  
  13020.     int rc;
  13021.     rc = ftptrcoff();
  13022.  
  13023.  
  13024. ΓòÉΓòÉΓòÉ 10.4.20. ftptrcon() ΓòÉΓòÉΓòÉ
  13025.  
  13026. The ftptrcon() call opens the trace file specified and starts tracing. 
  13027.  
  13028. Syntax 
  13029.  
  13030.   #include <ftpapi.h>
  13031.  
  13032.   int ftptrcon(fileSpec, mode)
  13033.   char *fileSpec;
  13034.   int mode;
  13035.  
  13036. Parameters 
  13037.  
  13038.  fileSpec 
  13039.    Identifies the name of the trace file. 
  13040.  
  13041.  mode 
  13042.    Specifies the trace mode as overwrite or append.  Use M_OVERLAY for trace 
  13043.    data which overwrites previous information.  Use M_APPEND for trace data 
  13044.    which appends to previous information. 
  13045.  
  13046.  Return Values 
  13047.  
  13048.  There are three possible return values for ftptrcon(): 
  13049.  
  13050.       0 when successful 
  13051.  
  13052.       TRCMODE indicates the value set into mode was invalid 
  13053.  
  13054.       TRCOPEN indicates the trace file could not be opened 
  13055.  
  13056.  Description 
  13057.  
  13058.  The ftptrcon() call opens the trace file specified and starts tracing of the 
  13059.  command and reply sequences sent over the control connection between the local 
  13060.  and remote hosts.  The trace file can be written over or appended to. 
  13061.  
  13062.  No notification is provided if writing of trace data fails. 
  13063.  
  13064.  Telnet command and reply sequences are not traced nor are command and reply 
  13065.  sequences between the local host and a proxy host. 
  13066.  
  13067.  Examples 
  13068.  
  13069.  To write the trace data into a file named api.trc in the C:\WORK directory, 
  13070.  use : 
  13071.  
  13072.     int rc;
  13073.     rc = ftptrcon("c\\work\\api.trc", M_OVERLAY);
  13074.  
  13075.  If the file already existed, the new trace data overwrites the previous trace 
  13076.  data (overlay mode). 
  13077.  
  13078.  
  13079. ΓòÉΓòÉΓòÉ 10.4.21. ftpver() ΓòÉΓòÉΓòÉ
  13080.  
  13081. The ftpver() call stores the string containing the FTP API version. 
  13082.  
  13083. Syntax 
  13084.  
  13085.   #include <ftpapi.h>
  13086.  
  13087.   int ftpver(buf, buflen)
  13088.   char *buf;
  13089.   int buflen;
  13090.  
  13091. Parameters 
  13092.  
  13093.  buf 
  13094.    Identifies the buffer to store the version string. 
  13095.  
  13096.  buflen 
  13097.    Specifies the length of the buffer. 
  13098.  
  13099.  Return Values 
  13100.  
  13101.  The value of 0 when successful.  The value of -1  when the complete version 
  13102.  string could not be copied because the buffer length was too small. 
  13103.  
  13104.  Description 
  13105.  
  13106.  The ftpver() call stores the string containing the FTP API version. The string 
  13107.  is truncated to fit into the buffer if it is longer than the buffer length. 
  13108.  The returned string is always null-terminated. 
  13109.  
  13110.  Examples 
  13111.  
  13112.     int rc;
  13113.     rc = ftpver(verBuf, bufLen);
  13114.  
  13115.  After the ftpver() call, the buffer contains the version number. 
  13116.  
  13117.  
  13118. ΓòÉΓòÉΓòÉ 10.4.22. ping() ΓòÉΓòÉΓòÉ
  13119.  
  13120. The ping() call sends a ping to the remote host to determine if that host is 
  13121. responding. 
  13122.  
  13123. Syntax 
  13124.  
  13125. #include <ftpapi.h>
  13126.  
  13127. int ping(addr, len)
  13128. unsigned long addr;
  13129. int len;
  13130.  
  13131. Parameters 
  13132.  
  13133.  addr 
  13134.    Internet address of the host in network byte order 
  13135.  
  13136.  len 
  13137.    Length of the ping packets 
  13138.  
  13139.  Return Values 
  13140.  
  13141.  If the return value is positive, the return value is the number of 
  13142.  milliseconds it took for the echo to return.  If the return value is negative, 
  13143.  it contains an error code. 
  13144.  
  13145.  The following are ping() call return codes and their corresponding 
  13146.  descriptions: 
  13147.  
  13148.  Return Code       Description 
  13149.  PINGREPLY         Host does not reply 
  13150.  PINGSOCKET        Unable to obtain socket 
  13151.  PINGPROTO         Unknown protocol ICMP 
  13152.  PINGSEND          Send failed 
  13153.  PINGRECV          Recv failed 
  13154.  
  13155.  Description 
  13156.  
  13157.  The ping() call sends a ping to the host with ICMP Echo Request.  The ping() 
  13158.  call is useful to determine whether the host is alive before attempting FTP 
  13159.  transfers, because time-out on regular connections is more than a minute.  The 
  13160.  ping() call returns within 3 seconds, at most, if the host is not responding. 
  13161.  
  13162.  Examples 
  13163.  
  13164.   #include <stdio.h>
  13165.   #include <netdb.h>
  13166.   #include <ftpapi.h>
  13167.  
  13168.   struct hostent *hp;     /* Pointer to host info */
  13169.  
  13170.   main(int argc, char *argv[], char *envp[])
  13171.   {
  13172.      int i;
  13173.      unsigned long addr;
  13174.  
  13175.      if (argc!=2) {
  13176.          printf("Usage: p <host>\n");
  13177.          exit(1);
  13178.      }
  13179.  
  13180.      hp = gethostbyname(argv[1]);
  13181.  
  13182.      if (hp) {
  13183.              memcpy( (char *)&addr, hp->h_addr, hp->h_length);
  13184.              i = ping(addr,256);
  13185.              printf("ping reply in %d milliseconds\n",i);
  13186.      } else {
  13187.              printf("unknown host\n");
  13188.              exit(2);
  13189.      }
  13190.      ftplogoff(); /* close all connections */
  13191.   }
  13192.  
  13193.  
  13194. ΓòÉΓòÉΓòÉ 11. SNMP Agent Distributed Protocol Interface (DPI) ΓòÉΓòÉΓòÉ
  13195.  
  13196. This section describes the Simple Network Management Protocol (SNMP) agent 
  13197. distributed protocol interface (DPI). The SNMP DPI permits users to dynamically 
  13198. add, delete, or replace management variables in the local Management 
  13199. Information Base (MIB) without requiring you to recompile the SNMP agent. 
  13200.  
  13201. Topics 
  13202.  
  13203.       Introduction to SNMP Distributed Protocol Interface 
  13204.       Subagent Programming Concepts 
  13205.       Basic DPI API Functions 
  13206.       Transport-Related DPI API Functions 
  13207.       DPI Structures 
  13208.       Character Set Selection 
  13209.       Constants, Values, Return Codes, and Include File 
  13210.       SNMP DPI API Version 1.1 Considerations 
  13211.       Migrating Your SNMP DPI Subagent to Version 2.0 
  13212.       A DPI Subagent Example 
  13213.  
  13214.  
  13215. ΓòÉΓòÉΓòÉ 11.1. Introduction to SNMP Distributed Protocol Interface ΓòÉΓòÉΓòÉ
  13216.  
  13217. This section describes the SNMP DPI routines supported by TCP/IP for OS/2. 
  13218. This Application Programming Interface (API) is for the DPI subagent 
  13219. programmer. 
  13220.  
  13221. The reader may also want to obtain a copy of the relevant RFCs. 
  13222.  
  13223.      RFC1592 is the SNMP DPI 2.0 RFC. 
  13224.      RFC1440 through RFC1452 are the SNMP Version 2 RFCs. 
  13225.  
  13226.  Topics 
  13227.  
  13228.       SNMP Agents and Subagents 
  13229.       DPI Agent Requests 
  13230.       Multiple Levels of the SNMP DPI API 
  13231.       SNMP DPI API Source Files 
  13232.       DPI Library 
  13233.       Compiling, Linking, and Running a DPI API Application 
  13234.       Functions, Data Structures, and Constants 
  13235.  
  13236.  
  13237. ΓòÉΓòÉΓòÉ 11.1.1. SNMP Agents and Subagents ΓòÉΓòÉΓòÉ
  13238.  
  13239. SNMP agents are responsible for answering SNMP requests from network management 
  13240. stations.  Examples of management requests are GET, GETNEXT, and SET, performed 
  13241. on the MIB objects. 
  13242.  
  13243. A subagent extends the set of MIB objects provided by the SNMP agent.  With the 
  13244. subagent, you define MIB variables useful in your own environment and register 
  13245. them with the SNMP agent. 
  13246.  
  13247. When the agent receives a request for a MIB variable, it passes the request to 
  13248. the subagent.  The subagent then returns a response to the agent.  The agent 
  13249. creates an SNMP response packet and sends the response to the remote network 
  13250. management station that initiated the request.  The existence of the subagent 
  13251. is transparent to the network management station. 
  13252.  
  13253. To allow the subagents to perform these functions, the agent provides for two 
  13254. types of subagent connections: a 
  13255.  
  13256.      TCP connection 
  13257.      Connection via Shared Memory (SHM) 
  13258.  
  13259.  For the TCP connections, the agent binds to an arbitrarily chosen TCP port and 
  13260.  listens for connection requests.  A well-known port is not used.  Every 
  13261.  invocation of the SNMP agent could potentially use a different TCP port. 
  13262.  
  13263.  A subagent of the SNMP agent determines the port number by sending a GET 
  13264.  request for an MIB variable, which represents the value of the TCP port.  The 
  13265.  subagent is not required to create and parse SNMP packets because the DPI API 
  13266.  has a library routine query_DPI_port().  After the subagent obtains the value 
  13267.  of the DPI TCP port, it should make a TCP connection to the appropriate port. 
  13268.  After a successful connect(), the subagent registers the set of variables it 
  13269.  supports with the SNMP agent.  When all variable classes are registered, the 
  13270.  subagent waits for requests from the SNMP agent. 
  13271.  
  13272.  The query_DPI_port() function is implicitly executed by the 
  13273.  DPIconnect_to_agent_TCP() function.  The DPI subagent programmer would 
  13274.  normally use the DPIconnect_to_agent_TCP() function to connect to the agent, 
  13275.  so it does not need to obtain the value of the DPI TCP port. 
  13276.  
  13277.  For a SHM connection, the subagent can use the DPIconnect_to_agent_SHM() 
  13278.  function. 
  13279.  
  13280.  
  13281. ΓòÉΓòÉΓòÉ 11.1.2. DPI Agent Requests ΓòÉΓòÉΓòÉ
  13282.  
  13283. The SNMP agent can initiate several DPI requests: 
  13284.  
  13285.      GET 
  13286.      GETNEXT 
  13287.      GETBULK (SNMP Version 2) 
  13288.      SET, COMMIT, and UNDO 
  13289.      UNREGISTER 
  13290.      CLOSE 
  13291.  
  13292.  The GET, GETNEXT, GETBULK, and SET requests correspond to the SNMP requests 
  13293.  that a network management station can make.  The subagent responds to a 
  13294.  request with a response packet.  The response packet can be created using the 
  13295.  mkDPIresponse() library routine, which is part of the DPI API library. 
  13296.  
  13297.  The GETBULK requests are translated into multiple GETNEXT requests by the 
  13298.  agent.  According to RFC 1592, a subagent may request that the GETBULK be 
  13299.  passed to it, but the OS/2 version of DPI does not yet support that request. 
  13300.  
  13301.  The COMMIT, UNDO, UNREGISTER, and CLOSE are specific SNMP DPI requests. 
  13302.  
  13303.  The subagent normally responds to a request with a RESPONSE packet. For the 
  13304.  CLOSE and UNREGISTER request, the subagent does not need to send a RESPONSE. 
  13305.  
  13306.  Related Information 
  13307.  
  13308.       Overview of Subagent Processing 
  13309.       Connecting to the Agent 
  13310.       Registering a Sub-Tree with the Agent 
  13311.       Processing Requests from the Agent 
  13312.       Processing a GET Request 
  13313.       Processing a GETNEXT Request 
  13314.       Processing a SET/COMMIT/UNDO Request 
  13315.       Processing an UNREGISTER Request 
  13316.       Processing a CLOSE Request 
  13317.       Generating a TRAP 
  13318.  
  13319.  
  13320. ΓòÉΓòÉΓòÉ 11.1.3. Multiple Levels of the SNMP DPI API ΓòÉΓòÉΓòÉ
  13321.  
  13322. For the SNMP DPI 2.0 API, some functions are implemented as macros, because the 
  13323. older DPI Version 1.x had the same function names with different parameters. 
  13324. The new implementation has new function names, which are not always the most 
  13325. intuitive.  By defining the macros with the more natural names for the 
  13326. functions, the non-intuitive names are hidden.  This was done because the 
  13327. macros have the same names as the functions were named in DPI Version 1.  It is 
  13328. thus possible to provide either the DPI 1.x or the DPI 2.x API by properly 
  13329. defining the macros. 
  13330.  
  13331.  
  13332. ΓòÉΓòÉΓòÉ 11.1.3.1. SNMP DPI API Version 2.0 ΓòÉΓòÉΓòÉ
  13333.  
  13334. By default, when you include the snmp_dpi.h include file, you will be exposed 
  13335. to the DPI 2.0 API.  For a list of the functions provided, see The snmp_dpi.h 
  13336. Include File. This is the recommended use of the SNMP DPI API.  When you 
  13337. link-edit your object code into an executable file, you must use the new DPI 
  13338. functions as provided in the DPI20DLL.LIB and DPI20DLL.DLL files. 
  13339.  
  13340. Waiting for a DPI packet also depends on the platform and how the chosen 
  13341. transport protocol is exactly implemented.  In addition, some subagents want to 
  13342. control sending of and waiting for packets themselves, because they may need to 
  13343. be driven by other interrupts as well. 
  13344.  
  13345. There is a set of DPI transport-related functions that are implemented on all 
  13346. platforms to hide the platform dependent issues for those subagents that do not 
  13347. need detailed control about the transport themselves. 
  13348.  
  13349.  
  13350. ΓòÉΓòÉΓòÉ 11.1.3.2. Compatibility with DPI 1.x Base Code ΓòÉΓòÉΓòÉ
  13351.  
  13352. If you have DPI 1.x based code, you may choose to keep using the old DPI 1.x 
  13353. dpi\snmp_dpi.h include file and the old DPI 1.x functions as provided in 
  13354. DPI32DLL.LIB and DPI32DLL.DLL.  You will be able to communicate with the OS/2 
  13355. SNMP agent which implements DPI 2.0. 
  13356.  
  13357. In Migrating Your DPI Subagent to DPI 2.0, the changes that you must make to 
  13358. your DPI 1.x source are presented.  If you take a few minutes to look at it, 
  13359. you will see that this is not too big a task. 
  13360.  
  13361.  
  13362. ΓòÉΓòÉΓòÉ 11.1.4. SNMP DPI API Source Files ΓòÉΓòÉΓòÉ
  13363.  
  13364. The following source files are provided: 
  13365.  
  13366.  snmp_dpi.h       The public SNMP DPI 2.0 API as provided to the DPI subagent 
  13367.                   programmer.  The DPI subagent code must include this file. 
  13368.  
  13369.  dpi_samp.c       A very basic example of an SNMP DPI 2.0 subagent 
  13370.                   implementation, dpiSimp.mib. 
  13371.  
  13372.  dpiSimp.mib      The dpiSimple MIB that goes with the dpi_samp.c source. 
  13373.  
  13374.  The DPI subagent programmer can use the snmp_dpi.h include file and the 
  13375.  dpi_samp.c file as an example of using the DPI API. 
  13376.  
  13377.  
  13378. ΓòÉΓòÉΓòÉ 11.1.5. DPI Library ΓòÉΓòÉΓòÉ
  13379.  
  13380. To use the DPI library routines provided with TCP/IP for OS/2, you must have 
  13381. the <snmp_dpi.h> header file in your TCPIP\INCLUDE directory. 
  13382.  
  13383. The DPI20DLL.LIB file in the LIB directory contains the DPI library routines. 
  13384. You must also have the SO32DLL.LIB and TCP32DLL.LIB files in your LIB 
  13385. directory. 
  13386.  
  13387. You must define the OS2 variable to the compiler by doing one of the following: 
  13388.  
  13389.      Place #define OS2 at the top of each file that includes TCP/IP header 
  13390.       files. 
  13391.  
  13392.      Use the /DOS2 option when compiling the source for your application. 
  13393.  
  13394.  See the TCPIP\SAMPLES\DPI20 directory for SNMP DPI sample programs. 
  13395.  
  13396.  For more information about SNMP, see the IBM TCP/IP Version 2.0 for OS/2: 
  13397.  Installation and Administration information or the IBM TCP/IP Version 2.0 for 
  13398.  OS/2: User's Guide. 
  13399.  
  13400.  
  13401. ΓòÉΓòÉΓòÉ 11.1.6. Compiling, Linking, and Running a DPI API Application ΓòÉΓòÉΓòÉ
  13402.  
  13403. The compiling and linking procedure for the DPI API using an IBM 32-bit 
  13404. compiler for OS/2 follows: 
  13405.  
  13406.    1. Set your environment variables to find the following: 
  13407.  
  13408.           Executable programs 
  13409.           Link libraries 
  13410.           Header files 
  13411.  
  13412.       You can set the environment variables in your CONFIG.SYS file.  An 
  13413.       example of entries you could have in your CONFIG.SYS file follows: 
  13414.  
  13415.             LIBPATH=E:\IBMCPP\DLL;C:\MPTN\DLL;C:\TCPIP\DLL;
  13416.             SET PATH=E:\IBMCPP\BIN;
  13417.             SET DPATH=E:\IBMCPP\LOCALE;E:\IBMCPP\HELP;
  13418.             SET LIB=E:\IBMCPP\LIB;C:\MPTN\LIB;C:\TCPIP\LIB;
  13419.             SET INCLUDE=E:\IBMCPP\INCLUDE;C:\TCPIP\INCLUDE;
  13420.             SET HELP=E:\IBMCPP\HELP;
  13421.             SET BOOKSHELF=E:\IBMCPP\HELP;
  13422.             SET TMP=E:\IBMCPP\TMP
  13423.             SET TZ=EST5EDT,0,0,0,0,0,0,0,0,0
  13424.  
  13425.    2. To compile the program, enter: 
  13426.  
  13427.             icc /Sa /j- /Gm /C myprog.c
  13428.  
  13429.    3. To create an executable program, you can enter: 
  13430.  
  13431.       For VisualAge C++ 
  13432.  
  13433.             ilink /NOFREEFORMAT /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  13434.             os2386 dpi20dll.lib
  13435.  
  13436.       For C Set++ 
  13437.  
  13438.             link386 /De myprog,myprog.exe,NULL,so32dll.lib tcp32dll.lib
  13439.             os2386 dpi20dll.lib
  13440.  
  13441.    4. When you are ready to run your subagent, make sure that the DPI20DLL.DLL 
  13442.       is in a directory listed in your LIBPATH statement. 
  13443.  
  13444.             LIBPATH=E:\IBMCPP\DLL;C:\MPTN\DLL;C:\TCPIP\DLL;
  13445.  
  13446.  For more information about the compile and link options, see the User's Guide 
  13447.  provided with your compiler. 
  13448.  
  13449.  
  13450. ΓòÉΓòÉΓòÉ 11.1.7. Functions, Data Structures, and Constants ΓòÉΓòÉΓòÉ
  13451.  
  13452. Use these lists to locate the descriptions for the functions, data structures, 
  13453. and constants. 
  13454.  
  13455. Basic DPI Functions: 
  13456.  
  13457.       The DPIdebug() Function 
  13458.       The DPI_PACKET_LEN() macro 
  13459.       The fDPIparse() Function 
  13460.       The fDPIset() Function 
  13461.       The mkDPIAreYouThere() Function 
  13462.       The mkDPIclose() Function 
  13463.       The mkDPIopen() Function 
  13464.       The mkDPIregister() Function 
  13465.       The mkDPIresponse() Function 
  13466.       The mkDPIset() Function 
  13467.       The mkDPItrap() Function 
  13468.       The mkDPIunregister() Function 
  13469.       The pDPIpacket() Function 
  13470.  
  13471.  DPI Transport-Related Functions: 
  13472.  
  13473.       The DPIawait_packet_from_agent() Function 
  13474.       The DPIconnect_to_agent_SHM() Function 
  13475.       The DPIconnect_to_agent_TCP() Function 
  13476.       The DPIdisconnect_from_agent() Function 
  13477.       The DPIget_fd_for_handle() Function 
  13478.       The DPIsend_packet_to_agent() Function 
  13479.       The lookup_host() Function 
  13480.       The query_DPI_port() Function 
  13481.  
  13482.  Data Structures: 
  13483.  
  13484.       The snmp_dpi_bulk_packet structure 
  13485.       The snmp_dpi_close_packet structure 
  13486.       The snmp_dpi_get_packet structure 
  13487.       The snmp_dpi_next_packet structure 
  13488.       The snmp_dpi_hdr structure 
  13489.       The snmp_dpi_resp_packet structure 
  13490.       The snmp_dpi_set_packet structure 
  13491.       The snmp_dpi_ureg_packet structure 
  13492.       The snmp_dpi_u64 structure 
  13493.  
  13494.  Constants and Values: 
  13495.  
  13496.       DPI CLOSE Reason Codes 
  13497.       DPI Packet Types 
  13498.       DPI RESPONSE Error Codes 
  13499.       DPI UNREGISTER Reason Codes 
  13500.       DPI SNMP Value Types 
  13501.       Value Representation 
  13502.  
  13503.  Related Information: 
  13504.  
  13505.       Character Set Selection 
  13506.       The snmp_dpi.h Include File 
  13507.  
  13508.  
  13509. ΓòÉΓòÉΓòÉ 11.2. Subagent Programming Concepts ΓòÉΓòÉΓòÉ
  13510.  
  13511. This section contains conceptual information about subagent programming. 
  13512.  
  13513. Topics 
  13514.  
  13515.       Programming Recommendations 
  13516.       DPI API 
  13517.       GET Processing 
  13518.       SET Processing 
  13519.       GETNEXT Processing 
  13520.       GETBULK Processing 
  13521.       OPEN Request 
  13522.       CLOSE Request 
  13523.       REGISTER Request 
  13524.       UNREGISTER Request 
  13525.       TRAP Request 
  13526.       ARE_YOU_THERE Request 
  13527.       Multithreading Programming Considerations 
  13528.  
  13529.  
  13530. ΓòÉΓòÉΓòÉ 11.2.1. Programming Recommendations ΓòÉΓòÉΓòÉ
  13531.  
  13532. When implementing a subagent, it is recommended that you use the DPI Version 2 
  13533. approach.  This includes: 
  13534.  
  13535.      Use the SNMP Version 2 error codes only, even though there are 
  13536.       definitions for the SNMP Version 1 error codes. 
  13537.  
  13538.      Implement the SET, COMMIT, UNDO processing properly. 
  13539.  
  13540.      For GET requests, use the SNMP Version 2 approach and pass back 
  13541.       noSuchInstance value or noSuchObject value if appropriate.  Continue to 
  13542.       process all remaining varBinds. 
  13543.  
  13544.      For GETNEXT, use the SNMP Version 2 approach and pass back endOfMibView 
  13545.       value if appropriate.  Continue to process all remaining varBinds. 
  13546.  
  13547.      When you are processing a request from the agent (GET, GETNEXT, GETBULK, 
  13548.       SET, COMMIT, or UNDO), you are supposed to respond within the timeout 
  13549.       period.  You can specify the timeout period in the OPEN and REGISTER 
  13550.       packets. 
  13551.  
  13552.       If you fail to respond within the timeout period, the agent will probably 
  13553.       close your DPI connection and then discard your RESPONSE packet if it 
  13554.       comes in later.  If you can detect that the response is not going to be 
  13555.       received in the time period, then you might decide to stop the request 
  13556.       and return an SNMP_ERROR_genErr in the RESPONSE. 
  13557.  
  13558.      You may want to issue an SNMP DPI ARE_YOU_THERE request periodically to 
  13559.       ensure that the agent is still "connected" and still knows about you. 
  13560.  
  13561.      For OS/2, you use an ASCII based machine.  However, when you are running 
  13562.       on an EBCDIC based machine and you use the (default) native character 
  13563.       set, then all OID strings and all variable values of type 
  13564.       OBJECT_IDENTIFIER or DisplayString will be passed to you in EBCDIC 
  13565.       format.  OID strings include the group ID, instance ID, Enterprise ID, 
  13566.       and subagent ID. 
  13567.  
  13568.       When you return a response, you should then also use EBCDIC FORMAT. 
  13569.  
  13570.      For OS/2, you use an ASCII based machine.  However, when you are running 
  13571.       on an EBCDIC based machine and you use the ASCII character set (specified 
  13572.       in DPI OPEN), then all OID strings and all variable values of type 
  13573.       OBJECT_IDENTIFIER or DisplayString will be passed to you in ASCII format. 
  13574.       OID strings include the group ID, instance ID, Enterprise ID, and 
  13575.       subagent ID. 
  13576.  
  13577.       When you return a response, you should then also use ASCII FORMAT. 
  13578.  
  13579.      If you receive an error RESPONSE on the OPEN packet, you will also 
  13580.       receive a DPI CLOSE packet with an SNMP_CLOSE_openError code.  In this 
  13581.       situation, the agent closes the "connection". 
  13582.  
  13583.       For OS/2, you use an ASCII based machine.  However, when you connect to 
  13584.       an EBCDIC based agent, you may want to specify in the DPI OPEN packet 
  13585.       that you want to use ASCII character set on the agent.  This is 
  13586.       transparent to you and the burden of conversion is on the EBCDIC based 
  13587.       agent. 
  13588.  
  13589.      The DisplayString is only a textual convention.  In the SNMP PDU (SNMP 
  13590.       packet), the type is just an OCTET_STRING. 
  13591.  
  13592.       When the type is OCTET_STRING, it is not clear if this is a DisplayString 
  13593.       or any arbitrary data.  This means that the agent can only know about an 
  13594.       object being a DisplayString if the object is included in some sort of a 
  13595.       compiled MIB.  If it is, the agent will use SNMP_TYPE_DisplayString in 
  13596.       the type field of the varBind in a DPI SET packet.  When you send a 
  13597.       DisplayString in a RESPONSE packet, the agent will handle it as such. 
  13598.  
  13599.  Related Information 
  13600.  
  13601.       A DPI Subagent Example 
  13602.  
  13603.  
  13604. ΓòÉΓòÉΓòÉ 11.2.2. DPI API ΓòÉΓòÉΓòÉ
  13605.  
  13606. The primary goal of RFC 1592 is to specify the SNMP DPI.  This is a protocol by 
  13607. which subagents can exchange SNMP related information with an agent.  On top of 
  13608. this protocol, one can imagine one or possibly many Application Programming 
  13609. Interfaces, but those are not addressed in RFC 1592. 
  13610.  
  13611. In order to provide an environment that is generally platform independent, RFC 
  13612. 1592 strongly suggests that you also define a DPI API.  There is a sample DPI 
  13613. API available in the RFC.  The document describes the same sample API as the 
  13614. IBM supported DPI Version 2.0 API, see A DPI Subagent Example. 
  13615.  
  13616.  
  13617. ΓòÉΓòÉΓòÉ 11.2.3. GET Processing ΓòÉΓòÉΓòÉ
  13618.  
  13619. The DPI GET packet holds one or more varBinds that the subagent has taken 
  13620. responsibility for. 
  13621.  
  13622. If the subagent encounters an error while processing the request, it creates a 
  13623. DPI RESPONSE packet with an appropriate error indication in the error_code 
  13624. field and sets the error_index to the position of the varBind at which the 
  13625. error occurs.  The first varBind is index 1, the second varBind is index 2, and 
  13626. so on.  No name, type, length, or value information needs to be provided in the 
  13627. packet because, by definition, the varBind information is the same as in the 
  13628. request to which this is a response and the agent still has that information. 
  13629.  
  13630. If there are no errors, the subagent creates a DPI RESPONSE packet in which the 
  13631. error_code is set to SNMP_ERROR_noError (zero) and error_index is set to zero. 
  13632. The packet must also include the name, type, length, and value of each varBind 
  13633. requested. 
  13634.  
  13635. When you get a request for a non-existing object or a non-existing instance of 
  13636. an object, you must return a NULL value with a type of SNMP_TYPE_noSuchObject 
  13637. or SNMP_TYPE_noSuchInstance respectively.  These two values are not considered 
  13638. errors, so the error_code and error_index should be zero. 
  13639.  
  13640. The DPI RESPONSE packet is then sent back to the agent. 
  13641.  
  13642. Related Information 
  13643.  
  13644.       Processing a GET Request 
  13645.       The mkDPIresponse() Function 
  13646.  
  13647.  
  13648. ΓòÉΓòÉΓòÉ 11.2.4. SET Processing ΓòÉΓòÉΓòÉ
  13649.  
  13650. A DPI SET packet contains the name, type, length, and value of each varBind 
  13651. requested, plus the value type, value length, and value to be set. 
  13652.  
  13653. If the subagent encounters an error while processing the request, it creates a 
  13654. DPI RESPONSE packet with an appropriate error indication in the error_code 
  13655. field and an error_index listing the position of the varBind at which the error 
  13656. occurs.  The first varBind is index 1, the second varBind is index 2, and so 
  13657. on.  No name, type, length, or value information needs to provided in the 
  13658. packet because, by definition, the varBind information is the same as in the 
  13659. request to which this is a response and the agent still has that information. 
  13660.  
  13661. If there are no errors, the subagent creates a DPI RESPONSE packet in which the 
  13662. error_code is set to SNMP_ERROR_noError (zero) and error_index is set to zero. 
  13663. No name, type, length, or value information is needed because the RESPONSE to a 
  13664. SET should contain exactly the same varBind data as the data present in the 
  13665. request.  The agent can use the values it already has. 
  13666.  
  13667. This suggests that the agent must keep state information, and that is the case. 
  13668. It needs to do that anyway in order to be able to later pass the data with a 
  13669. DPI COMMIT or DPI UNDO packet.  Since there are no errors, the subagent must 
  13670. have allocated the required resources and prepared itself for the SET.  It does 
  13671. not yet carry out the set, that will be done at COMMIT time. 
  13672.  
  13673. The subagent sends a DPI RESPONSE packet, indicating success or failure for the 
  13674. preparation phase, back to the agent.  The agent will issue a SET request for 
  13675. all other varBinds in the same original SNMP request it received.  This may be 
  13676. to the same subagent or to one or more different subagents. 
  13677.  
  13678. Once all SET requests have returned a "no error" condition, the agent starts 
  13679. sending DPI COMMIT packets to the subagent(s).  If any SET request returns an 
  13680. error, the agent sends DPI UNDO packets to those subagents that indicated 
  13681. successful processing of the SET preparation phase. 
  13682.  
  13683. When the subagent receives the DPI COMMIT packet, all the varBind information 
  13684. will again be available in the packet.  The subagent can now carry out the SET 
  13685. request. 
  13686.  
  13687. If the subagent encounters an error while processing the COMMIT request, it 
  13688. creates a DPI RESPONSE packet with value SNMP_ERROR_commitFailed in the 
  13689. error_code field and an error_index that lists at which varBind the error 
  13690. occurs.  The first varBind is index 1, and so on.  No name, type, length, or 
  13691. value information is needed.  The fact that a commitFailed error exists does 
  13692. not mean that this error should be returned easily.  A subagent should do all 
  13693. that is possible to make a COMMIT succeed. 
  13694.  
  13695. If there are no errors and the SET and COMMIT have been carried out with 
  13696. success, the subagent creates a DPI RESPONSE packet in which the error_code is 
  13697. set to SNMP_ERROR_noError (zero) and error_index is set to zero.  No name, 
  13698. type, length, or value information is needed. 
  13699.  
  13700. So far we have discussed a successful SET and COMMIT sequence. However, after a 
  13701. successful SET, the subagent may receive a DPI UNDO packet.  The subagent must 
  13702. now undo any preparations it made during the SET processing, such as free 
  13703. allocated memory. 
  13704.  
  13705. Even after a COMMIT, a subagent may still receive a DPI UNDO packet.  This will 
  13706. occur if some other subagent could not complete a COMMIT request.  Because of 
  13707. the SNMP requirement that all varBinds in a single SNMP SET request must be 
  13708. changed "as if simultaneous", all committed changes must be undone if any of 
  13709. the COMMIT requests fail. In this case the subagent must try and undo the 
  13710. committed SET operation. 
  13711.  
  13712. If the subagent encounters an error while processing the UNDO request, it 
  13713. creates a DPI RESPONSE packet with value SNMP_ERROR_undoFailed in the 
  13714. error_code field and an error_index that lists at which varBind the error 
  13715. occurs.  The first varBind is index 1, and so on.  No name, type, length, or 
  13716. value information is needed.  The fact that an undoFailed error exists does not 
  13717. mean that this error should be returned easily.  A subagent should do all that 
  13718. is possible to make an UNDO succeed. 
  13719.  
  13720. If there are no errors and the UNDO has been successful, the subagent creates a 
  13721. DPI RESPONSE packet in which the error_code is set to SNMP_ERROR_noError (zero) 
  13722. and error_index is set to zero.  No name, type, length, or value information is 
  13723. needed. 
  13724.  
  13725. Related Information 
  13726.  
  13727.       Processing a SET/COMMIT/UNDO Request 
  13728.  
  13729.  
  13730. ΓòÉΓòÉΓòÉ 11.2.5. GETNEXT Processing ΓòÉΓòÉΓòÉ
  13731.  
  13732. The DPI GETNEXT packet contains the object(s) on which the GETNEXT operation 
  13733. must be performed.  For this operation, the subagent is to return the name, 
  13734. type, length, and value of the next variable it supports whose (ASN.1) name 
  13735. lexicographically follows the one passed in the group ID (sub-tree) and 
  13736. instance ID. 
  13737.  
  13738. In this case, the instance ID may not be present (NULL) in the incoming DPI 
  13739. packet implying that the NEXT object must be the first instance of the first 
  13740. object in the sub-tree that was registered. 
  13741.  
  13742. It is important to realize that a given subagent may support several 
  13743. discontiguous sections of the MIB tree.  In that situation, it would be 
  13744. incorrect to jump from one section to another.  This problem is correctly 
  13745. handled by examining the group ID in the DPI packet.  This group ID represents 
  13746. the "reason" why the subagent is being called.  It holds the prefix of the tree 
  13747. that the subagent had indicated it supported (registered). 
  13748.  
  13749. If the next variable supported by the subagent does not begin with that prefix, 
  13750. the subagent must return the same object instance as in the request, for 
  13751. example the group ID and instance ID with a value of SNMP_TYPE_endOfMibView 
  13752. (implied NULL value).  This endOfMibView is not considered an error, so the 
  13753. error_code and error_index should be zero. If required, the SNMP agent will 
  13754. call upon the subagent again, but pass it a different group ID (prefix).  This 
  13755. is illustrated in the discussion below. 
  13756.  
  13757. Assume there are two subagents.  The first subagent registers two distinct 
  13758. sections of the tree:  A and C.  In reality, the subagent supports variables 
  13759. A.1 and A.2, but it correctly registers the minimal prefix required to uniquely 
  13760. identify the variable class it supports. 
  13761.  
  13762. The second subagent registers section B, which appears between the two sections 
  13763. registered by the first agent. 
  13764.  
  13765. If a management station begins browsing the MIB, starting from A, the following 
  13766. sequence of queries of the form get-next(group ID,instance ID) would be 
  13767. performed: 
  13768.  
  13769.   Subagent 1 gets called:
  13770.          get-next(A,none) = A.1
  13771.          get-next(A,1)    = A.2
  13772.          get-next(A,2)    = endOfMibView
  13773.  
  13774.   Subagent 2 is then called:
  13775.          get-next(B,none) = B.1
  13776.          get-next(B,1)    = endOfMibView
  13777.  
  13778.   Subagent 1 gets called again:
  13779.          get-next(C,none) = C.1
  13780.  
  13781. Related Information 
  13782.  
  13783.       Processing a GETNEXT Request 
  13784.  
  13785.  
  13786. ΓòÉΓòÉΓòÉ 11.2.6. GETBULK Processing ΓòÉΓòÉΓòÉ
  13787.  
  13788. You can ask the agent to translate GETBULK requests into multiple GETNEXT 
  13789. requests.  This is basically the default and is specified in the DPI REGISTER 
  13790. packet.  In principle, we expect the majority of DPI subagents to run on the 
  13791. same machine as the agent, or on the same physical network.  Therefore, 
  13792. repetitive GETNEXT requests remain local and, in general, should not be a 
  13793. problem. 
  13794.  
  13795. Otherwise, the subagent can tell the agent to pass on a DPI GETBULK packet. 
  13796.  
  13797. When a GETBULK request is received, the subagent must process the request and 
  13798. send a RESPONSE that sends back as many varBinds as requested by the request, 
  13799. as long as they fit within the buffers. 
  13800.  
  13801. The GETBULK requires similar processing as a GETNEXT with regard to 
  13802. endOfMibView handling. 
  13803.  
  13804. Note:  Currently a subagent cannot select GETBULK on OS/2.  It will always be 
  13805. translated into multiple GETNEXT requests. 
  13806.  
  13807. Related Information 
  13808.  
  13809.       Processing a GETNEXT Request 
  13810.  
  13811.  
  13812. ΓòÉΓòÉΓòÉ 11.2.7. OPEN Request ΓòÉΓòÉΓòÉ
  13813.  
  13814. As the first step, a DPI subagent must open a "connection" with the agent.  To 
  13815. do so, it must send a DPI OPEN packet in which these parameters must be 
  13816. specified: 
  13817.  
  13818.      The maximum timeout value in seconds.  The agent is requested to wait 
  13819.       this long for a response to any request for an object being handled by 
  13820.       this subagent. 
  13821.  
  13822.       The agent may have an absolute maximum timeout value which will be used 
  13823.       if the subagent asks for too large a timeout value.  A value of zero can 
  13824.       be used to indicate that the agent's own default timeout value should be 
  13825.       used.  A subagent is advised to use a reasonably short interval of a few 
  13826.       seconds or so.  If a specific sub-tree needs a (much) longer time, a 
  13827.       specific REGISTER can be done for that sub-tree with a longer timeout 
  13828.       value. 
  13829.  
  13830.      The maximum number of varBinds that the subagent is prepared to handle 
  13831.       per DPI packet.  Specifying 1 would result in DPI Version 1 behavior of 
  13832.       one varBind per DPI packet that the agent sends to the subagent.  A value 
  13833.       of zero means the agent will try to combine up to as many varBinds as are 
  13834.       present in the SNMP packet that belongs to the same sub-tree. 
  13835.  
  13836.      The character set you want to use.  By default, a 0 value, which is the 
  13837.       native character set of the machine platform where the agent runs. Since 
  13838.       the subagent and agent normally run on the same system or platform, you 
  13839.       want to use the native character set, which is ASCII on many platforms. 
  13840.  
  13841.       If your platform is EBCDIC based, using the native character set of 
  13842.       EBCDIC makes it easy to recognize the string representations of the 
  13843.       fields, such as the group ID and instance ID.  At the same time, the 
  13844.       agent will translate the value from ASCII NVT to EBCDIC and vice versa 
  13845.       for objects that it knows from a compiled MIB to have a textual 
  13846.       convention of DisplayString.  This fact cannot be determined from the 
  13847.       SNMP PDU encoding because in the PDU the object is only known to be an 
  13848.       OCTET_STRING. 
  13849.  
  13850.       If your subagent runs on an ASCII based platform and the agent runs on an 
  13851.       EBCDIC based platform (or the other way around), you can specify that you 
  13852.       want to use the ASCII character set.  The agent and subagent programmer 
  13853.       knows how to handle the string-based data in this situation. 
  13854.  
  13855.       Note:  Not all agents need to support other than native character set 
  13856.       selections.  See Character Set Selection for more information on 
  13857.       character set usage. 
  13858.  
  13859.      The subagent ID.  This an ASN.1 Object Identifier that uniquely 
  13860.       identifies the subagent.  This OID is represented as a null terminated 
  13861.       string using the selected character set. 
  13862.  
  13863.       For example: "1.3.5.1.2.3.4.5" 
  13864.  
  13865.      The subagent description.  This is a DisplayString describing the 
  13866.       subagent.  This is a character string using the selected character set. 
  13867.  
  13868.       For example: "DPI sample subagent Version 2.0" 
  13869.  
  13870.  Once a subagent has sent a DPI OPEN packet to an agent, it should expect a DPI 
  13871.  RESPONSE packet that informs the subagent about the result of the request. 
  13872.  The packet ID of the RESPONSE packet should be the same as that of the OPEN 
  13873.  request to which the RESPONSE packet is the response.  See DPI RESPONSE Error 
  13874.  Codes for a list of valid codes that may be expected. 
  13875.  
  13876.  If you receive an error RESPONSE on the OPEN packet, you will also receive a 
  13877.  DPI CLOSE packet with an SNMP_CLOSE_openError code.  In this situation, the 
  13878.  agent closes the "connection". 
  13879.  
  13880.  If the OPEN is accepted, the next step is to REGISTER one or more MIB 
  13881.  sub-trees. 
  13882.  
  13883.  Related Information 
  13884.  
  13885.       Connecting to the Agent 
  13886.  
  13887.  
  13888. ΓòÉΓòÉΓòÉ 11.2.8. CLOSE Request ΓòÉΓòÉΓòÉ
  13889.  
  13890. When a subagent is finished and wants to end processing, it should first 
  13891. UNREGISTER its sub-trees and then close the "connection" with the agent.  To do 
  13892. so, it must send a DPI CLOSE packet, which specifies a reason for the closing. 
  13893. See DPI CLOSE Reason Codes for a list of valid codes.  You should not expect a 
  13894. response to the CLOSE request. 
  13895.  
  13896. A subagent should also be prepared to handle an incoming DPI CLOSE packet from 
  13897. the agent.  In this case, the packet will contain a reason code for the CLOSE 
  13898. request.  A subagent does not have to send a response to a CLOSE request.  The 
  13899. agent just assumes that the subagent will handle it appropriately.  The close 
  13900. takes place regardless of what the subagent does with it. 
  13901.  
  13902. Related Information 
  13903.  
  13904.       Processing an CLOSE Request 
  13905.  
  13906.  
  13907. ΓòÉΓòÉΓòÉ 11.2.9. REGISTER Request ΓòÉΓòÉΓòÉ
  13908.  
  13909. Before a subagent will receive any requests for MIB variables, it must first 
  13910. register the variables or sub-tree it supports with the SNMP agent.  The 
  13911. subagent must specify a number of parameters in the REGISTER request: 
  13912.  
  13913.      The sub-tree to be registered.  This is a null terminated string in the 
  13914.       selected character set.  The sub-tree must have a trailing dot. 
  13915.  
  13916.       For example: "1.3.6.1.2.3.4.5." 
  13917.  
  13918.      The requested priority for the registration.  The values are: 
  13919.  
  13920.       -1            Request for the best available priority. 
  13921.  
  13922.        0            Request for the next best available priority than the 
  13923.                     highest (best) priority currently registered for this 
  13924.                     sub-tree. 
  13925.  
  13926.       NNN           Any other positive value requests that specific priority if 
  13927.                     available or the next worse priority that is available. 
  13928.  
  13929.      The maximum timeout value in seconds.  The agent is requested to wait 
  13930.       this long for a response to any request for an object in this sub-tree. 
  13931.       The agent may have an absolute maximum timeout value which will be used 
  13932.       if the subagents asks for too large a timeout value.  A value of zero can 
  13933.       be used to indicate that the DPI OPEN value should be used for timeout. 
  13934.  
  13935.      A specification if the subagent wants to do view selection.  If it does, 
  13936.       the community name from SNMP Version 1 packets will be passed in the DPI 
  13937.       GET, GETNEXT, and SET packets.  This is not supported on OS/2. 
  13938.  
  13939.      A specification if the subagent wants to receive GETBULK packets or if it 
  13940.       just prefers that the agent converts a GETBULK into multiple GETNEXT 
  13941.       requests.  This is not supported on OS/2. 
  13942.  
  13943.  Once a subagent has sent a DPI REGISTER packet to the agent, it should expect 
  13944.  a DPI RESPONSE packet that informs the subagent about the result of the 
  13945.  request.  The packet ID of the RESPONSE packet should be the same as that of 
  13946.  the REGISTER packet to which the RESPONSE packet is the response. 
  13947.  
  13948.  If the response is successful, the error_index field in the RESPONSE packet 
  13949.  contains the priority that the agent assigned to the sub-tree registration. 
  13950.  See DPI RESPONSE Error Codes for a list of valid codes that may be expected. 
  13951.  
  13952.  Error Code: higherPriorityRegistered 
  13953.  
  13954.  The response to a REGISTER request may return the error code 
  13955.  "higherPriorityRegistered".  This may be caused by: 
  13956.  
  13957.      Another subagent already registered the same sub-tree at a better 
  13958.       priority than what you are requesting. 
  13959.  
  13960.      Another subagent already registered a sub-tree at a higher level (at any 
  13961.       priority). For instance, if a registration already exists for sub-tree 
  13962.       1.2.3.4.5.6 and you try to register for sub-tree 1.2.3.4.5.6.<anything> 
  13963.       then you will get "higherPriorityRegistered" error code. 
  13964.  
  13965.  If you receive this error code, your sub-tree will be registered, but you will 
  13966.  not see any requests for the sub-tree.  They will be passed to the sub-agent 
  13967.  which registered with a better priority.  If you stay connected, and the other 
  13968.  sub-agent goes away, then you will get control over the sub-tree at that point 
  13969.  in time. 
  13970.  
  13971.  Related Information 
  13972.  
  13973.       Registering a Sub-Tree with the Agent 
  13974.  
  13975.  
  13976. ΓòÉΓòÉΓòÉ 11.2.10. UNREGISTER Request ΓòÉΓòÉΓòÉ
  13977.  
  13978. A subagent may unregister a previously registered sub-tree.  The subagent must 
  13979. specify a few parameters in the UNREGISTER request: 
  13980.  
  13981.      The sub-tree to be unregistered.  This is a null terminated string in the 
  13982.       selected character set.  The sub-tree must have a trailing dot. 
  13983.  
  13984.       For example: "1.3.6.1.2.3.4.5." 
  13985.  
  13986.      The reason for the unregister.  See DPI UNREGISTER Reason Codes for a 
  13987.       list of valid reason codes. 
  13988.  
  13989.  Once a subagent has sent a DPI UNREGISTER packet to the agent, it should 
  13990.  expect a DPI RESPONSE packet that informs the subagent about the result of the 
  13991.  request.  The packet ID of the RESPONSE packet should be the same as that of 
  13992.  the REGISTER packet to which the RESPONSE packet is the response.  See DPI 
  13993.  RESPONSE Error Codes for a list of valid codes that may be expected. 
  13994.  
  13995.   A subagent should also be prepared to handle incoming DPI UNREGISTER packets 
  13996.  from the agent.  In this situation, the DPI packet will contain a reason code 
  13997.  for the UNREGISTER.  A subagent does not have to send a response to an 
  13998.  UNREGISTER request.  The agent just assumes that the subagent will handle it 
  13999.  appropriately.  The registration is removed regardless of what the subagent 
  14000.  returns. 
  14001.  
  14002.  Related Information 
  14003.  
  14004.       Processing an UNREGISTER Request 
  14005.  
  14006.  
  14007. ΓòÉΓòÉΓòÉ 11.2.11. TRAP Request ΓòÉΓòÉΓòÉ
  14008.  
  14009. A subagent can request that the SNMP agent generates a trap for it. The 
  14010. subagent must provide the desired values for the generic and specific 
  14011. parameters of the trap.  It may optionally provide a set of one or more name, 
  14012. type, length, or value parameters that will be included in the trap packet. 
  14013.  
  14014. It may optionally specify an Enterprise ID (Object Identifier) for the trap to 
  14015. be generated.  If a NULL value is specified for the Enterprise ID, the agent 
  14016. will use the subagent Identifier from the DPI OPEN packet as the Enterprise ID 
  14017. to be sent with the trap. 
  14018.  
  14019. Related Information 
  14020.  
  14021.       Generating a TRAP 
  14022.  
  14023.  
  14024. ΓòÉΓòÉΓòÉ 11.2.12. ARE_YOU_THERE Request ΓòÉΓòÉΓòÉ
  14025.  
  14026. A subagent can send an ARE_YOU_THERE packet to the agent.  This may be useful 
  14027. to do if you have a DPI "connection" over an unreliable transport protocol, 
  14028. such as UDP. 
  14029.  
  14030. If the "connection" is in a healthy state, the agent responds with a RESPONSE 
  14031. packet with SNMP_ERROR_DPI_noError.  If the "connection" is not in a healthy 
  14032. state, the agent may respond with a RESPONSE packet with an error indication, 
  14033. but the agent might not react at all.  In this situation, you would timeout 
  14034. while waiting for a response. 
  14035.  
  14036.  
  14037. ΓòÉΓòÉΓòÉ 11.2.13. Multithreading Programming Considerations ΓòÉΓòÉΓòÉ
  14038.  
  14039. The DPI Version 2.0 DLL for OS/2 (DPI20DLL.DLL file) has been compiled with the 
  14040. /Gm+ compiler flag.  This enables it to be used by both single and 
  14041. multithreaded subagents.  However, even a single threaded subagent must be 
  14042. compiled with the /Gm+ compiler flag. 
  14043.  
  14044. No Support for Multithreaded Environment 
  14045.  
  14046. Even though the DPI20DLL.DLL has been created with multithreading compile flag, 
  14047. they do not contain any support for a multithreaded environment. 
  14048.  
  14049. There are several static buffers in the DPI code.  For compatibility reasons, 
  14050. that cannot be changed.  Real multithread support will probably mean several 
  14051. potentially incompatible changes to the DPI 2.0 API. 
  14052.  
  14053. Use a Locking Mechanism 
  14054.  
  14055. If your subagent will be a multithreaded process, then you must always use some 
  14056. locking mechanism of your own around the use of the static buffers.  Otherwise, 
  14057. one thread maybe writing into the static buffer while another is writing into 
  14058. the same buffer at the same time. There are two static buffers.  One buffer is 
  14059. for building the serialized DPI packet before sending it out and the other 
  14060. buffer is for receiving incoming DPI packets. 
  14061.  
  14062. Basically, all DPI functions that return a pointer to an unsigned char are the 
  14063. DPI functions that write into the static buffer to create a serialized DPI 
  14064. packet: 
  14065.  
  14066. mkDPIAreYouThere()
  14067. mkDPIopen()
  14068. mkDPIregister()
  14069. mkDPIunregister()
  14070. mkDPItrap()
  14071. mkDPIresponse()
  14072. mkDPIpacket()
  14073. mkDPIclose ()
  14074.  
  14075. After you have called the DPIsend_packet_to_agent() function for the buffer, 
  14076. which is pointed to by the pointer returned by one of the above functions, it 
  14077. is free to use again. 
  14078.  
  14079. There is one function that reads the static input buffer: 
  14080.  
  14081. pDPIpacket()
  14082.  
  14083. The input buffer gets filled by the DPIawait_packet_from_agent() function.  You 
  14084. get a pointer to the static input buffer upon return from the await.  The 
  14085. pDPIpacket() function parses the static input buffer and returns a pointer to 
  14086. dynamically allocated memory. Therefore, after the pDPIparse() call, the buffer 
  14087. is available for use again. 
  14088.  
  14089. The current situation is such that if multiple threads are waiting at the same 
  14090. time and for different handles, there is the risk that two incoming DPI packets 
  14091. will overlay each other. 
  14092.  
  14093. If multiple threads are waiting for the same handle, when data arrives both 
  14094. threads come out of the wait.  If one of them issues another wait before the 
  14095. other one is finished parsing the input buffer, the buffer may get overlaid by 
  14096. a new packet before the second one gets a chance to parse the packet. 
  14097.  
  14098. The DPI internal handle structures and control blocks used by the underlying 
  14099. code to send and receive data to and from the agent are also static data areas. 
  14100. You must make sure that you use your own locking mechanism around the functions 
  14101. that add, change, or delete data in those static structures.  The functions 
  14102. that change those internal static structures are: 
  14103.  
  14104. DPIconnect_to_agentTCP()    /* everyone has this one    */
  14105. DPIconnect_to_agentSHM()    /* so-far only for          */
  14106.                             /* NetView for OS/2         */
  14107. DPIconnect_to_agentUDP()    /* not supported at all yet */
  14108. DPIdisconnect_from_agent()  /* everyone has this one    */
  14109.  
  14110. The other functions that access those static structures which must be assured 
  14111. that the structure is not being changed while they are referencing it during 
  14112. their execution are: 
  14113.  
  14114. DPIawait_packet_from_agent()
  14115. DPIsend_packet_to_agent()
  14116. DPIget_fd_for_handle()
  14117.  
  14118. While the last 3 functions can be executed concurrently in different threads, 
  14119. you must ensure that no other thread is adding or deleting handles during this 
  14120. process. 
  14121.  
  14122.  
  14123. ΓòÉΓòÉΓòÉ 11.3. Basic DPI API Functions ΓòÉΓòÉΓòÉ
  14124.  
  14125. This section describes each of the basic DPI functions that are available to 
  14126. the DPI subagent programmer. 
  14127.  
  14128. Topics 
  14129.  
  14130.       The DPIdebug() Function 
  14131.       The DPI_PACKET_LEN() Macro 
  14132.       The fDPIparse() Function 
  14133.       The fDPIset() Function 
  14134.       The mkDPIAreYouThere() Function 
  14135.       The mkDPIclose() Function 
  14136.       The mkDPIopen() Function 
  14137.       The mkDPIregister() Function 
  14138.       The mkDPIresponse() Function 
  14139.       The mkDPIset() Function 
  14140.       The mkDPItrap() Function 
  14141.       The mkDPIunregister() Function 
  14142.       The pDPIpacket() Function 
  14143.  
  14144.  
  14145. ΓòÉΓòÉΓòÉ 11.3.1. The DPIdebug() Function ΓòÉΓòÉΓòÉ
  14146.  
  14147. Syntax 
  14148.  
  14149. #include <snmp_dpi.h>
  14150.  
  14151. void DPIdebug(int level);
  14152.  
  14153. Parameters 
  14154.  
  14155.  level 
  14156.    If this value is zero, tracing is turned off.  If it has any other value, 
  14157.    tracing is turned on at the specified level.  The higher the value, the more 
  14158.    detail.  A higher level includes all lower levels of tracing.  Currently 
  14159.    there are two levels of detail: 
  14160.  
  14161.    1       Display packet creation and parsing. 
  14162.  
  14163.    2       Display hex dump of incoming and outgoing DPI packets. 
  14164.  
  14165.  Description 
  14166.  
  14167.  The DPIdebug() function turns DPI internal debugging/tracing on or off. 
  14168.  
  14169.  Examples 
  14170.  
  14171.     #include <snmp_dpi.h>
  14172.  
  14173.     DPIdebug(2);
  14174.  
  14175.  Related Information 
  14176.  
  14177.       The snmp_dpi.h Include File 
  14178.  
  14179.  
  14180. ΓòÉΓòÉΓòÉ 11.3.2. The DPI_PACKET_LEN() Macro ΓòÉΓòÉΓòÉ
  14181.  
  14182. Syntax 
  14183.  
  14184. #include <snmp_dpi.h>
  14185.  
  14186. int DPI_PACKET_LEN(unsigned char *packet_p)
  14187.  
  14188. Parameters 
  14189.  
  14190.  packet_p 
  14191.    A pointer to a serialized DPI packet. 
  14192.  
  14193.  Return Values 
  14194.  
  14195.       An integer representing the total DPI packet length. 
  14196.  
  14197.  Description 
  14198.  
  14199.  The DPI_PACKET_LEN macro generates C-code that returns an integer representing 
  14200.  the length of a DPI packet.  It uses the first two octets in network byte 
  14201.  order of the packet to calculate the length. 
  14202.  
  14203.  Examples 
  14204.  
  14205.     #include <snmp_dpi.h>
  14206.     unsigned char *pack_p;
  14207.     int            length;
  14208.  
  14209.     pack_p = mkDPIclose(SNMP_CLOSE_goingDown);
  14210.     if (pack_p) {
  14211.        length = DPI_PACKET_LEN(pack_p);
  14212.        /* send packet to agent or subagent */
  14213.     } /* endif */
  14214.  
  14215.  
  14216. ΓòÉΓòÉΓòÉ 11.3.3. The fDPIparse() Function ΓòÉΓòÉΓòÉ
  14217.  
  14218. Syntax 
  14219.  
  14220. #include <snmp_dpi.h>
  14221.  
  14222. void fDPIparse(snmp_dpi_hdr *hdr_p);
  14223.  
  14224. Parameters 
  14225.  
  14226.  hdr_p 
  14227.    A pointer to the parse tree.  The parse tree is represented by an 
  14228.    snmp_dpi_hdr structure. 
  14229.  
  14230.  Description 
  14231.  
  14232.  The fDPIparse() function frees a parse tree that was previously created by a 
  14233.  call to pDPIpacket().  The parse tree may have been created in other ways too. 
  14234.  After calling fDPIparse(), no further references to the parse tree can be 
  14235.  made. 
  14236.  
  14237.  A complete or partial DPI parse tree is also implicitly freed by call to a DPI 
  14238.  function that serializes a parse tree into a DPI packet. The section that 
  14239.  describes each function tells you if this is the case.  An example of such a 
  14240.  function is mkDPIresponse(). 
  14241.  
  14242.  Examples 
  14243.  
  14244.     #include <snmp_dpi.h>
  14245.     snmp_dpi_hdr  *hdr_p;
  14246.     unsigned char *pack_p;         /* assume pack_p points to  */
  14247.                                    /* incoming DPI packet      */
  14248.     hdr_p = pDPIpacket(pack_p);
  14249.  
  14250.     /* handle the packet and when done do the following */
  14251.     if (hdr_p) fDPIparse(hdr_p);
  14252.  
  14253.  Related Information 
  14254.  
  14255.       The snmp_dpi_hdr Structure 
  14256.       The pDPIpacket() Function 
  14257.       The snmp_dpi.h Include File 
  14258.  
  14259.  
  14260. ΓòÉΓòÉΓòÉ 11.3.4. The fDPIset() Function ΓòÉΓòÉΓòÉ
  14261.  
  14262. Syntax 
  14263.  
  14264. #include <snmp_dpi.h>
  14265.  
  14266. void fDPIset(snmp_dpi_set_packet *packet_p);
  14267.  
  14268. Parameters 
  14269.  
  14270.  packet_p 
  14271.    A pointer to the first snmp_dpi_set_packet structure in a chain of such 
  14272.    structures. 
  14273.  
  14274.  Description 
  14275.  
  14276.  The fDPIset() function is typically used if you must free a chain of one or 
  14277.  more snmp_dpi_set_packet structures.  This may be the case if you are in the 
  14278.  middle of preparing a chain of such structures for a DPI RESPONSE packet, but 
  14279.  then run into an error before you can actually make the response. 
  14280.  
  14281.  If you get to the point where you make a DPI response packet to which you pass 
  14282.  the chain of snmp_dpi_set_packet structures, then the mkDPIresponse() function 
  14283.  will free the chain of snmp_dpi_set_packet structures. 
  14284.  
  14285.  Examples 
  14286.  
  14287.   #include <snmp_dpi.h>
  14288.   unsigned char       *pack_p;
  14289.   snmp_dpi_hdr        *hdr_p;
  14290.   snmp_dpi_set_packet *set_p, *first_p;
  14291.   long int             num1 = 0, num2 = 0;
  14292.  
  14293.   hdr_p = pDPIpacket(pack_p);              /* assume pack_p     */
  14294.   /* analyze packet and assume all OK */   /* points to the     */
  14295.   /* now prepare response; 2 varBinds */   /* incoming packet   */
  14296.  
  14297.   set_p = mkDPIset(snmp_dpi_NULL_p,        /* create first one  */
  14298.                "1.3.6.1.2.3.4.5.","1.0",   /* OID=1, instance=0 */
  14299.                SNMP_TYPE_Integer32,
  14300.                sizeof(num1), &num1);
  14301.   if (set_p) {                             /* if success, then  */
  14302.      first_p = set_p;                      /* save ptr to first */
  14303.      set_p   = mkDPIset(set_p,             /* chain next one    */
  14304.                  "1.3.6.1.2.3.4.5.","1.1", /* OID=1, instance=1 */
  14305.                  SNMP_TYPE_Integer32,
  14306.                  sizeof(num2), &num2);
  14307.      if (set_p) {                          /* success 2nd one   */
  14308.         pack_p = mkDPIresponse(hdr_p,      /* make response     */
  14309.                       SNMP_ERROR_noError,  /* It will also free */
  14310.                       0L, first_p);        /* the set_p tree    */
  14311.         /* send DPI response to agent */
  14312.      } else {                              /* 2nd mkDPIset fail */
  14313.         fDPIset(first_p);                  /* must free chain   */
  14314.      } /* endif */
  14315.   } /* endif */
  14316.  
  14317.  Related Information 
  14318.  
  14319.       The fDPIparse() Function 
  14320.       The snmp_dpi_set_packet Structure 
  14321.       The mkDPIresponse() Function 
  14322.  
  14323.  
  14324. ΓòÉΓòÉΓòÉ 11.3.5. The mkDPIAreYouThere() Function ΓòÉΓòÉΓòÉ
  14325.  
  14326. Syntax 
  14327.  
  14328. #include <snmp_dpi.h>
  14329.  
  14330. unsigned char *mkDPIAreYouThere(void);
  14331.  
  14332. Parameters 
  14333.  
  14334.    None. 
  14335.  
  14336.  Return Values 
  14337.  
  14338.       If successful, a pointer to a static DPI packet buffer is returned.  The 
  14339.       first two bytes of the buffer in network byte order contain the length of 
  14340.       the remaining packet.  The macro DPI_PACKET_LEN can be used to calculate 
  14341.       the total length of the DPI packet. 
  14342.  
  14343.       If failure, a NULL pointer is returned. 
  14344.  
  14345.  Note:  The static buffer for the DPI packet is shared by other mkDPIxxxx() 
  14346.  functions that create a serialized DPI packet. 
  14347.  
  14348.  Description 
  14349.  
  14350.  The mkDPIAreYouThere() function creates a serialized DPI ARE_YOU_THERE packet 
  14351.  that can be sent to the DPI peer, which is normally the agent. 
  14352.  
  14353.  A subagent connected via TCP probably does not need this function because, 
  14354.  normally when the agent breaks the "connection", you will receive an EOF on 
  14355.  the file descriptor.  For unreliable "connections", like over UDP, this 
  14356.  function may be useful to periodically poll the agent and verify that it still 
  14357.  knows about the subagent. 
  14358.  
  14359.  If your "connection" to the agent is still healthy, the agent will send a DPI 
  14360.  RESPONSE with SNMP_ERROR_DPI_noError in the error code field and zero in the 
  14361.  error index field.  The RESPONSE will have no varBind data.  If your 
  14362.  "connection" is not healthy, the agent may send a response with an error 
  14363.  indication, or may just not send a response at all. 
  14364.  
  14365.  Examples 
  14366.  
  14367.     #include <snmp_dpi.h>
  14368.     unsigned char *pack_p;
  14369.  
  14370.     pack_p = mkDPIAreYouThere();
  14371.     if (pack_p) {
  14372.        /* send the packet to the agent */
  14373.     } /* endif */
  14374.     /* wait for response with DPIawait_packet_from_agent() */
  14375.     /* normally the response should come back pretty quickly, */
  14376.     /* but it depends on the load of the agent */
  14377.  
  14378.  Related Information 
  14379.  
  14380.       The snmp_dpi_resp_packet Structure 
  14381.       The DPIawait_packet_from_agent() Function 
  14382.  
  14383.  
  14384.  
  14385. ΓòÉΓòÉΓòÉ 11.3.6. The mkDPIclose() Function ΓòÉΓòÉΓòÉ
  14386.  
  14387. Syntax 
  14388.  
  14389. #include <snmp_dpi.h>
  14390.  
  14391. unsigned char *mkDPIclose(char reason_code);
  14392.  
  14393. Parameters 
  14394.  
  14395.  reason_code 
  14396.    The reason for closing the DPI connection.  See DPI CLOSE Reason Codes for a 
  14397.    list of valid reason codes. 
  14398.  
  14399.  Return Values 
  14400.  
  14401.       If successful, a pointer to a static DPI packet buffer is returned.  The 
  14402.       first two bytes of the buffer in network byte order contain the length of 
  14403.       the remaining packet.  The macro DPI_PACKET_LEN can be used to calculate 
  14404.       the total length of the DPI packet. 
  14405.  
  14406.       If failure, a NULL pointer is returned. 
  14407.  
  14408.  Note:  The static buffer for the DPI packet is shared by other mkDPIxxxx() 
  14409.  functions that create a serialized DPI packet. 
  14410.  
  14411.  Description 
  14412.  
  14413.  The mkDPIclose() function creates a serialized DPI CLOSE packet that can be 
  14414.  sent to the DPI peer.  As a result of sending the packet, the DPI connection 
  14415.  will be closed. 
  14416.  
  14417.  Sending a DPI CLOSE packet to the agent implies an automatic DPI UNREGISTER 
  14418.  for all registered sub-trees on the connection being closed. 
  14419.  
  14420.  Examples 
  14421.  
  14422.     #include <snmp_dpi.h>
  14423.     unsigned char *pack_p;
  14424.  
  14425.     pack_p = mkDPIclose(SNMP_CLOSE_goingDown);
  14426.     if (pack_p) {
  14427.        /* send the packet to the agent */
  14428.     } /* endif */
  14429.  
  14430.  Related Information 
  14431.  
  14432.       The snmp_dpi_close_packet Structure 
  14433.       DPI CLOSE Reason Codes 
  14434.  
  14435.  
  14436. ΓòÉΓòÉΓòÉ 11.3.7. The mkDPIopen() Function ΓòÉΓòÉΓòÉ
  14437.  
  14438. Syntax 
  14439.  
  14440. #include <snmp_dpi.h>
  14441.  
  14442. unsigned char *mkDPIopen(       /* Make a DPI open packet     */
  14443.   char          *oid_p,         /* subagent Identifier (OID) */
  14444.   char          *description_p, /* subagent descriptive name */
  14445.   unsigned long  timeout,       /* requested default timeout  */
  14446.   unsigned long  max_varBinds,  /* max varBinds per DPI ndle  */
  14447.   char           character_set, /* selected character set     */
  14448.   #define DPI_NATIVE_CSET  0    /*   0 = native character set */
  14449.   #define DPI_ASCII_CSET   1    /*   1 = ASCII  character set */
  14450.  
  14451.   unsigned long  password_len,  /* length of password (if any)*/
  14452.   unsigned char *password_p);   /* ptr to password (if any)   */
  14453.  
  14454. Parameters 
  14455.  
  14456.  oid_p 
  14457.    A pointer to a NULL terminated character string representing the OBJECT 
  14458.    IDENTIFIER which uniquely identifies the subagent. 
  14459.  
  14460.  description_p 
  14461.    A pointer to a NULL terminated character string, which is a descriptive name 
  14462.    for the subagent.  This can be any DisplayString, which basically is an 
  14463.    octet string containing only characters from the ASCII NVT set. 
  14464.  
  14465.  timeout 
  14466.    The requested timeout for this subagent.  An agent often has a limit for 
  14467.    this value and it will use that limit if this value is larger.  A timeout of 
  14468.    zero has a special meaning in the sense that the agent will use its own 
  14469.    default timeout value. 
  14470.  
  14471.  max_varBinds 
  14472.    The maximum number of varBinds per DPI packet that the subagent is prepared 
  14473.    to handle.  It must be a positive number or zero.  If a value greater than 1 
  14474.    is specified, the agent will try to combine as many varBinds which belong to 
  14475.    the same sub-tree per DPI packet as possible up to this value. 
  14476.  
  14477.    If a value of zero is specified, the agent will try to combine up to as many 
  14478.    varBinds as are present in the SNMP packet and belong to the same sub-tree. 
  14479.    For example, a value of zero means no limit. 
  14480.  
  14481.  character_set 
  14482.    The character set that you want to use for string-based data fields in the 
  14483.    DPI packets and structures.  The choices are: 
  14484.  
  14485.    DPI_NATIVE_CSET            Specifies that you want to use the native 
  14486.                               character set of the platform on which the agent 
  14487.                               that you connect to is running. 
  14488.  
  14489.    DPI_ASCII_CSET             Specifies that you want to use the ASCII 
  14490.                               character set.  The agent will translate between 
  14491.                               ASCII and the native character set as required. 
  14492.  
  14493.    See Character Set Selection for more information. 
  14494.  
  14495.  password_len 
  14496.    The length in octets of an optional password.  It depends on the agent 
  14497.    implementation if a password is needed.  If not, a zero length may be 
  14498.    specified. 
  14499.  
  14500.  password_p 
  14501.    A pointer to an octet string representing the password for this subagent.  A 
  14502.    password may include any character value, including the NULL character.  If 
  14503.    the password_len is zero, this can be a NULL pointer. 
  14504.  
  14505.  Return Values 
  14506.  
  14507.       If successful, a pointer to a static DPI packet buffer is returned.  The 
  14508.       first two bytes of the buffer in network byte order contain the length of 
  14509.       the remaining packet.  The macro DPI_PACKET_LEN can be used to calculate 
  14510.       the total length of the DPI packet. 
  14511.  
  14512.       If failure, a NULL pointer is returned. 
  14513.  
  14514.  Note:  The static buffer for the DPI packet is shared by other mkDPIxxxx() 
  14515.  functions that create a serialized DPI packet. 
  14516.  
  14517.  Description 
  14518.  
  14519.  The mkDPIopen() function creates a serialized DPI OPEN packet that can then be 
  14520.  sent to the DPI peer which is a DPI capable SNMP agent. 
  14521.  
  14522.  Normally you will want to use the native character set, which is the easiest 
  14523.  for the subagent programmer.  However, if the agent and subagent each run on 
  14524.  their own platform and those platforms use different native character sets, 
  14525.  you must select the ASCII character set, so that you both know exactly how to 
  14526.  represent string-based data that is being send back and forth. 
  14527.  
  14528.  Currently you do not need to specify a password to connect to the OS/2 SNMP 
  14529.  agent.  Therefore, you can pass a length of zero and a NULL pointer for the 
  14530.  password. 
  14531.  
  14532.  Examples 
  14533.  
  14534.     #include <snmp_dpi.h>
  14535.     unsigned char *pack_p;
  14536.  
  14537.     pack_p = mkDPIopen("1.3.6.1.2.3.4.5",
  14538.                   "Sample DPI subagent"
  14539.                   0L,2L, DPI_NATIVE_CSET, /* max 2 varBinds */
  14540.                   0,(char *)0);
  14541.     if (pack_p) {
  14542.        /* send packet to the agent */
  14543.     } /* endif */
  14544.  
  14545.  Related Information 
  14546.  
  14547.       Character Set Selection 
  14548.  
  14549.  
  14550. ΓòÉΓòÉΓòÉ 11.3.8. The mkDPIregister() Function ΓòÉΓòÉΓòÉ
  14551.  
  14552. Syntax 
  14553.  
  14554. #include <snmp_dpi.h>
  14555.  
  14556. unsigned char  *mkDPIregister(  /* Make a DPI register packet */
  14557.   unsigned short   timeout,     /* in seconds (16-bit)        */
  14558.   long int         priority,    /* requested priority         */
  14559.   char            *group_p,     /* ptr to group ID (sub-tree) */
  14560.   char             bulk_select);/* Bulk selection (GETBULK)   */
  14561.   #define DPI_BULK_NO   0       /*  map GETBULK into GETNEXTs */
  14562.   #define DPI_BULK_YES  1       /*  pass GETBULK to subagent */
  14563.  
  14564. Parameters 
  14565.  
  14566.  timeout 
  14567.    The requested timeout in seconds.  An agent often has a limit for this value 
  14568.    and it will use that limit if this value is larger.  The value zero has 
  14569.    special meaning in the sense that it tells the agent to use the timeout 
  14570.    value that was specified in the DPI OPEN packet. 
  14571.  
  14572.  priority 
  14573.    The requested priority.  This field may contain any of these values: 
  14574.  
  14575.    -1        Requests the best available priority. 
  14576.  
  14577.     0        Requests a better priority than the highest priority currently 
  14578.              registered.  Use this value to obtain the SNMP DPI Version 1 
  14579.              behavior. 
  14580.  
  14581.    nnn       Any positive value.  You will receive that priority if available, 
  14582.              otherwise the next best priority that is available. 
  14583.  
  14584.  group_p 
  14585.    A pointer to a NULL terminated character string that represents the sub-tree 
  14586.    to be registered.  This group ID must have a trailing dot. 
  14587.  
  14588.  bulk_select 
  14589.    Specifies if you want the agent to pass GETBULK on to the subagent or to map 
  14590.    them into multiple GETNEXT requests.  The choices are: 
  14591.  
  14592.    DPI_BULK_NO           Do not pass any GETBULK requests, but instead map a 
  14593.                          GETBULK request into multiple GETNEXT requests. 
  14594.  
  14595.    DPI_BULK_YES          Do pass a GETBULK request to the subagent. 
  14596.  
  14597.  Return Values 
  14598.  
  14599.       If successful, a pointer to a static DPI packet buffer is returned.  The 
  14600.       first two bytes of the buffer in network byte order contain the length of 
  14601.       the remaining packet.  The macro DPI_PACKET_LEN can be used to calculate 
  14602.       the total length of the DPI packet. 
  14603.  
  14604.       If failure, a NULL pointer is returned. 
  14605.  
  14606.  Note:  The static buffer for the DPI packet is shared by other mkDPIxxxx() 
  14607.  functions that create a serialized DPI packet. 
  14608.  
  14609.  Description 
  14610.  
  14611.  The mkDPIregister() function creates a serialized DPI REGISTER packet that can 
  14612.  then be sent to the DPI peer which is a DPI capable SNMP agent. 
  14613.  
  14614.  The bulk_select can be used to ask the agent to map an SNMP GETBULK request 
  14615.  into multiple GETNEXT requests.  This makes it easier for the DPI subagent 
  14616.  programmer because GETBULK processing doesn't need implementing. 
  14617.  
  14618.  However, if one expects that a single GETBULK might improve the performance a 
  14619.  lot, one can tell the agent to pass such requests.  This might be the case if 
  14620.  one expects a GETBULK to arrive often for a table for which one needs to do a 
  14621.  kernel dive.  Using GETBULK, one might be able to do just one dive instead of 
  14622.  many.  Although one could anticipate the dive with a GETNEXT also, and 
  14623.  therefore obtain and cache the table upon the first GETNEXT request. 
  14624.  
  14625.  According to the DPI 2.0 RFC, not all agents need to support DPI_BULK_YES. 
  14626.  These agents will return an appropriate error code in the DPI RESPONSE though 
  14627.  if such is the case. 
  14628.  
  14629.  Normally the SNMP agent sends a DPI RESPONSE packet back.  This packet 
  14630.  identifies if the register was successful or not. 
  14631.  
  14632.  Examples 
  14633.  
  14634.     #include <snmp_dpi.h>
  14635.     unsigned char *pack_p;
  14636.  
  14637.     pack_p = mkDPIregister(0,0L,"1.3.6.1.2.3.4.5."
  14638.                            DPI_BULK_NO);
  14639.     if (pack_p) {
  14640.        /* send packet to agent and await response */
  14641.     } /* endif */
  14642.  
  14643.  Related Information 
  14644.  
  14645.       The snmp_dpi_resp_packet Structure 
  14646.  
  14647.  
  14648. ΓòÉΓòÉΓòÉ 11.3.9. The mkDPIresponse() Function ΓòÉΓòÉΓòÉ
  14649.  
  14650. Syntax 
  14651.  
  14652. #include <snmp_dpi.h>
  14653.  
  14654. unsigned char    *mkDPIresponse( /* Make a DPI response packet*/
  14655.   snmp_dpi_hdr     *hdr_p,       /* ptr to packet to respnd to*/
  14656.   long int          error_code,  /* error code: SNMP_ERROR_xxx*/
  14657.   long int          error_index, /* index to varBind in error */
  14658.   snmp_dpi_set_packet *packet_p);/* ptr to varBinds, a chain  */
  14659.                                  /* of dpi_set_packets        */
  14660.  
  14661. Parameters 
  14662.  
  14663.  hdr_p 
  14664.    A pointer to the parse tree of the DPI request to which this DPI packet will 
  14665.    be the response.  The function uses this parse tree to copy the packet_id 
  14666.    and the DPI version and release, so that the DPI packet is correctly 
  14667.    formatted as a response. 
  14668.  
  14669.  error_code 
  14670.    The error code. 
  14671.  
  14672.    See DPI RESPONSE Error Codes for a list of valid codes. 
  14673.  
  14674.  error_index 
  14675.    Specifies the first varBind in error.  Counting starts at 1 for the first 
  14676.    varBind.  This field should be zero if there is no error. 
  14677.  
  14678.  packet_p 
  14679.    A pointer to a chain of snmp_dpi_set_packet structures.  This partial parse 
  14680.    tree will be freed by the mkDPIresponse() function.  So upon return you 
  14681.    cannot reference it anymore.  Pass a NULL pointer if there are no varBinds 
  14682.    to be returned. 
  14683.  
  14684.  Return Values 
  14685.  
  14686.       If successful, a pointer to a static DPI packet buffer is returned.  The 
  14687.       first two bytes of the buffer in network byte order contain the length of 
  14688.       the remaining packet.  The macro DPI_PACKET_LEN can be used to calculate 
  14689.       the total length of the DPI packet. 
  14690.  
  14691.       If failure, a NULL pointer is returned. 
  14692.  
  14693.  Note:  The static buffer for the DPI packet is shared by other mkDPIxxxx() 
  14694.  functions that create a serialized DPI packet. 
  14695.  
  14696.  Description 
  14697.  
  14698.  The mkDPIresponse() function is used at the subagent side to prepare a DPI 
  14699.  RESPONSE packet to a GET, GETNEXT, GETBULK, SET, COMMIT or UNDO request.  The 
  14700.  resulting packet can be sent to the DPI peer, which is normally a DPI capable 
  14701.  SNMP agent. 
  14702.  
  14703.  Examples 
  14704.  
  14705.     #include <snmp_dpi.h>
  14706.     unsigned char       *pack_p;
  14707.     snmp_dpi_hdr        *hdr_p;
  14708.     snmp_dpi_set_packet *set_p;
  14709.     long int             num;
  14710.  
  14711.     hdr_p = pDPIpacket(pack_p);     /* parse incoming packet */
  14712.                                     /* assume it's in pack_p */
  14713.     if (hdr_p) {
  14714.        /* analyze packet, assume GET, no error */
  14715.        set_p = mkDPIset(snmp_dpi_set_packet_NULL_p,
  14716.                         "1.3.6.1.2.3.4.5.", "1.0",
  14717.                         SNMP_TYPE_Integer32,
  14718.                         sizeof(num), &num);
  14719.        if (set_p) {
  14720.           pack_p = mkDPIresponse(hdr_p,
  14721.                         SNMP_ERROR_noError, 0L, set_p);
  14722.           if (pack_p) {
  14723.              /* send packet to subagent */
  14724.           } /* endif */
  14725.        } /* endif */
  14726.     } /* endif */
  14727.  
  14728.  The mkDPIresponse() function is used at the agent side to prepare a DPI 
  14729.  RESPONSE packet to an OPEN, REGISTER or UNREGISTER request.  In the case of a 
  14730.  RESPONSE to a REGISTER request and if there is no error, the actually assigned 
  14731.  priority must be passed in the error_index parameter.  The resulting packet 
  14732.  can be sent to the DPI peer, which is normally a subagent. 
  14733.  
  14734.  Examples 
  14735.  
  14736.     #include <snmp_dpi.h>
  14737.     unsigned char       *pack_p;
  14738.     snmp_dpi_hdr        *hdr_p;
  14739.     long int             priority;
  14740.  
  14741.     hdr_p = pDPIpacket(pack_p);     /* parse incoming packet */
  14742.                                     /* assume it's in pack_p */
  14743.     if (hdr_p) {
  14744.        /* analyze packet, assume REGISTER and OK */
  14745.        pack_p = mkDPIresponse(hdr_p,
  14746.                      SNMP_ERROR_DPI_noError,
  14747.                      priority,
  14748.                      snmp_dpi_set_packet_NULL_p);
  14749.        if (pack_p) {
  14750.           /* send packet to subagent */
  14751.        } /* endif */
  14752.     } /* endif */
  14753.  
  14754.  Related Information 
  14755.  
  14756.       The pDPIpacket() Function 
  14757.       The snmp_dpi_hdr Structure 
  14758.       The snmp_dpi_next_packet Structure 
  14759.  
  14760.  
  14761. ΓòÉΓòÉΓòÉ 11.3.10. The mkDPIset() Function ΓòÉΓòÉΓòÉ
  14762.  
  14763. Syntax 
  14764.  
  14765. #include <snmp_dpi.h>
  14766.  
  14767. snmp_dpi_set_packet *mkDPIset(    /* Make DPI set packet tree */
  14768.   snmp_dpi_set_packet *packet_p,  /* ptr to SET structure     */
  14769.   char                *group_p,   /* ptr to group ID(sub-tree)*/
  14770.   char                *instance_p,/* ptr to instance OIDstring*/
  14771.   int                  value_type,/* value type: SNMP_TYPE_xxx*/
  14772.   int                  value_len, /* length of value          */
  14773.   void                *value_p);  /* ptr to value             */
  14774.  
  14775. Parameters 
  14776.  
  14777.  packet_p 
  14778.    A pointer to a chain of snmp_dpi_set_packet structures.  Pass a NULL pointer 
  14779.    if this is the first structure to be created. 
  14780.  
  14781.  group_p 
  14782.    A pointer to a NULL terminated character string that represents the 
  14783.    registered sub-tree that caused this GET request to be passed to this DPI 
  14784.    subagent.  The sub-tree must have a trailing dot. 
  14785.  
  14786.  instance_p 
  14787.    A pointer to a NULL terminated character string that represents the rest, 
  14788.    which is the piece following the sub-tree part, of the OBJECT IDENTIFIER of 
  14789.    the variable instance being accessed.  Use of the term instance_p here 
  14790.    should not be confused with an OBJECT instance because this string may 
  14791.    consist of a piece of the OBJECT IDENTIFIER plus the INSTANCE IDENTIFIER. 
  14792.  
  14793.  value_type 
  14794.    The type of the value. 
  14795.  
  14796.    See DPI SNMP Value Types for a list of currently defined value types. 
  14797.  
  14798.  value_len 
  14799.    This is the value that specifies the length in octets of the value pointed 
  14800.    to by the value field.  The length may be zero if the value is of type 
  14801.    SNMP_TYPE_NULL. 
  14802.  
  14803.    The maximum value is 64K -1.  However, the implementation often makes the 
  14804.    length significantly less.  The OS/2 implementation limit is 4K.  The 
  14805.    SNMP_DPI_BUFFSIZE in the snmp_dpi.h include file defines the limit for OS/2. 
  14806.  
  14807.  value_p 
  14808.    A pointer to the actual value.  This field may contain a NULL pointer if the 
  14809.    value is of implicit or explicit type SNMP_TYPE_NULL. 
  14810.  
  14811.  Return Values 
  14812.  
  14813.       If successful and a chain of one or more packets was passed in the 
  14814.       packet_p parameter, the same pointer that was passed in packet_p is 
  14815.       returned.  A new dynamically allocated structure has then been added to 
  14816.       the end of that chain of snmp_dpi_get_packet structures. 
  14817.  
  14818.       If successful and a NULL pointer was passed in the packet_p parameter, a 
  14819.       pointer to a new dynamically allocated structure is returned. 
  14820.  
  14821.       If failure, a NULL pointer is returned. 
  14822.  
  14823.  Description 
  14824.  
  14825.  The mkDPIset() function is used at the subagent side to prepare a chain of one 
  14826.  or more snmp_dpi_set_packet structures.  This chain is used to create a DPI 
  14827.  RESPONSE packet by a call to mkDPIresponse() which can be sent to the DPI 
  14828.  peer, which is normally a DPI capable SNMP agent. 
  14829.  
  14830.  The chain of snmp_dpi_set_packet structures can also be used to create a DPI 
  14831.  TRAP packet that includes varBinds as explained in The mkDPItrap() Function. 
  14832.  
  14833.  For the value_len, the maximum value is 64K -1.  However, the implementation 
  14834.  often makes the length significantly less.  For example the SNMP PDU size may 
  14835.  be limited to 484 bytes at the SNMP manager or agent side.  In this case, the 
  14836.  total response packet cannot exceed 484 bytes, so a value_len is limited by 
  14837.  that.  You can send the DPI packet to the agent, but the manager will never 
  14838.  see it. 
  14839.  
  14840.  Examples 
  14841.  
  14842.     #include <snmp_dpi.h>
  14843.     unsigned char       *pack_p;
  14844.     snmp_dpi_hdr        *hdr_p;
  14845.     snmp_dpi_set_packet *set_p;
  14846.     long int             num;
  14847.  
  14848.     hdr_p = pDPIpacket(pack_p)      /* parse incoming packet */
  14849.                                     /* assume it's in pack_p */
  14850.     if (hdr_p) {
  14851.        /* analyze packet, assume GET, no error */
  14852.        set_p = mkDPIset(snmp_dpi_set_packet_NULL_p,
  14853.                         "1.3.6.1.2.3.4.5.", "1.0",
  14854.                         SNMP_TYPE_Integer32,
  14855.                         sizeof(num), &num);
  14856.        if (set_p) {
  14857.           pack_p = mkDPIresponse(hdr_p,
  14858.                         SNMP_ERROR_noError,
  14859.                         0L, set_p);
  14860.           if (pack_p)
  14861.              /* send packet to subagent */
  14862.           } /* endif */
  14863.        } /* endif */
  14864.     } /* endif */
  14865.  
  14866.  The mkDPIset() function is used at the agent side to prepare a chain of one or 
  14867.  more snmp_dpi_set_packet structures.  This chain is normally anchored in an 
  14868.  snmp_dpi_hdr structure that has its packet_type field set to SNMP_DPI_SET, 
  14869.  SNMP_DPI_COMMIT or SNMP_DPI_UNDO.  When all varBinds have been prepared into 
  14870.  snmp_dpi_set_packet structures, a call can be made to mkDPIpacket() which will 
  14871.  serialize the DPI parse tree into a DPI packet that can be sent to the DPI 
  14872.  peer, which is normally a subagent. 
  14873.  
  14874.  Examples 
  14875.  
  14876.     #include <snmp_dpi.h>
  14877.     unsigned char       *pack_p;
  14878.     snmp_dpi_hdr        *hdr_p;
  14879.     long int             num;
  14880.  
  14881.     hdr_p = mkDPIhdr(SNMP_DPI_SET);
  14882.     if (hdr_p) {
  14883.        hdr_p->data_u.set_p =
  14884.               mkDPIset(snmp_dpi_set_packet_NULL_p,
  14885.                        "1.3.6.1.2.3.4.5.", "1.0",
  14886.                        SNMP_TYPE_Integer32,
  14887.                        sizeof(num), &num);
  14888.        if (hdr_p->data_u.set_p) {
  14889.           pack_p = mkDPIpacket(hdr_p);
  14890.           if (pack_p)
  14891.              /* send packet to subagent */
  14892.           } /* endif */
  14893.        } /* endif */
  14894.     } /* endif */
  14895.  
  14896.  If you must chain many snmp_dpi_set_packet structures, be sure to note that 
  14897.  the packets are chained only by forward pointers.  It is recommended that you 
  14898.  use the last structure in the existing chain as the packet_p parameter.  Then, 
  14899.  the underlying code does not have to scan through a possibly long chain of 
  14900.  structures in order to chain the new structure at the end. 
  14901.  
  14902.  In the next example let's assume that we want to chain 20 snmp_dpi_set_packet 
  14903.  structures as a response to a GETBULK. 
  14904.  
  14905.  Examples 
  14906.  
  14907.     #include <snmp_dpi.h>
  14908.     unsigned char       *pack_p;
  14909.     snmp_dpi_hdr        *hdr_p;
  14910.     snmp_dpi_set_packet *first_p;
  14911.     snmp_dpi_set_packet *set_p;
  14912.     long int             num[20];
  14913.     int                  i;
  14914.  
  14915.     hdr_p = pDPIpacket(pack_p);    /* parse incoming packet    */
  14916.                                    /* assume it's in pack_p    */
  14917.     if (hdr_p) {
  14918.        /* analyze packet, assume GETBULK, no error. In this    */
  14919.        /* example we do not check max_repetitions as we should */
  14920.        set_p   = snmp_dpi_set_packet_NULL_p;
  14921.        first_p = snmp_dpi_set_packet_NULL_p;
  14922.        for (i=0; i<20; i++) {
  14923.            char instance[5];
  14924.  
  14925.            sprintf(instance, "%1.%d", i+1);
  14926.            set_p = mkDPIset(set_p,
  14927.                         "1.3.6.1.2.3.4.5.", instance,
  14928.                         SNMP_TYPE_Integer32,
  14929.                         sizeof(num), &num[i]);
  14930.            if (set_p) {
  14931.               if (first_p) continue; /* OK, iterate for loop  */
  14932.               first_p = set_p;       /* remember first one    */
  14933.            } else if (first_p) {     /* failed to mkDPIset    */
  14934.               fDPIset(first_p)       /* free allocated memory */
  14935.               first_p = snmp_dpi_set_packet_NULL_p; /* reset  */
  14936.            } /* endif */
  14937.        } /* endfor */
  14938.        if (first_p) {
  14939.           pack_p = mkDPIresponse(hdr_p,
  14940.                         SNMP_ERROR_noError,
  14941.                         0L, first_p);
  14942.           if (pack_p)
  14943.              /* send packet to subagent */
  14944.           } /* endif */
  14945.        } /* endif */
  14946.     } /* endif */
  14947.  
  14948.  Related Information 
  14949.  
  14950.       The pDPIpacket() Function 
  14951.       The mkDPIresponse() Function 
  14952.       The mkDPItrap() Function 
  14953.       The snmp_dpi_hdr Structure 
  14954.       The snmp_dpi_set_packet Structure 
  14955.       DPI SNMP Value Types 
  14956.       Value Representation 
  14957.  
  14958.  
  14959. ΓòÉΓòÉΓòÉ 11.3.11. The mkDPItrap() Function ΓòÉΓòÉΓòÉ
  14960.  
  14961. Syntax 
  14962.  
  14963. #include <snmp_dpi.h>
  14964.  
  14965. unsigned char      *mkDPItrap(   /* Make a DPI trap packet    */
  14966.   long int            generic,   /* generic traptype  (32 bit)*/
  14967.   long int            specific,  /* specific traptype (32 bit)*/
  14968.   snmp_dpi_set_packet *packet_p, /* ptr to varBinds, a chain  */
  14969.                                  /* of dpi_set_packets        */
  14970.   char           *enterprise_p); /* ptr to enterprise OID     */
  14971.  
  14972. Parameters 
  14973.  
  14974.  generic 
  14975.    The generic trap type.  The range of this value is 0-6, where 6, which is 
  14976.    enterprise specific, is the type that is probably used most by DPI subagent 
  14977.    programmers.  The values 0-5 are well defined standard SNMP traps. 
  14978.  
  14979.  specific 
  14980.    The enterprise specific trap type.  This can be any value that is valid for 
  14981.    the MIB sub-trees that the subagent implements. 
  14982.  
  14983.  packet_p 
  14984.    A pointer to a chain of snmp_dpi_set_structures, representing the varBinds 
  14985.    to be passed with the trap.  This partial parse tree will be freed by the 
  14986.    mkDPItrap() function so you cannot reference it anymore upon completion of 
  14987.    the call.  A NULL pointer means that there are no varBinds to be included in 
  14988.    the trap. 
  14989.  
  14990.  enterprise_p 
  14991.    A pointer to a NULL terminated character string representing the enterprise 
  14992.    ID (OBJECT IDENTIFIER) for which this trap is defined.  A NULL pointer can 
  14993.    be used.  In this case, the subagent Identifier, as passed in the DPI OPEN 
  14994.    packet, will be used when the agent receives the DPI TRAP packet. 
  14995.  
  14996.  Return Values 
  14997.  
  14998.       If successful, a pointer to a static DPI packet buffer is returned.  The 
  14999.       first two bytes of the buffer in network byte order contain the length of 
  15000.       the remaining packet.  The macro DPI_PACKET_LEN can be used to calculate 
  15001.       the total length of the DPI packet. 
  15002.  
  15003.       If failure, a NULL pointer is returned. 
  15004.  
  15005.  Note:  The static buffer for the DPI packet is shared by other mkDPIxxxx() 
  15006.  functions that create a serialized DPI packet. 
  15007.  
  15008.  Description 
  15009.  
  15010.  The mkDPItrap() function is used at the subagent side to prepare a DPI TRAP 
  15011.  packet.  The resulting packet can be sent to the DPI peer, which is normally a 
  15012.  DPI capable SNMP agent. 
  15013.  
  15014.  Examples 
  15015.  
  15016.     #include <snmp_dpi.h>
  15017.     unsigned char       *pack_p;
  15018.     snmp_dpi_set_packet *set_p;
  15019.     long int             num;
  15020.  
  15021.     set_p = mkDPIset(snmp_dpi_set_packet_NULL_p,
  15022.                      "1.3.6.1.2.3.4.5.", "1.0",
  15023.                      SNMP_TYPE_Integer32,
  15024.                      sizeof(num), &num);
  15025.     if (set_p) {
  15026.        pack_p = mkDPItrap(6,1,set_p, (char *)0);
  15027.        if (pack_p) {
  15028.           /* send packet to subagent */
  15029.        } /* endif */
  15030.     } /* endif */
  15031.  
  15032.  Related Information 
  15033.  
  15034.       The fDPIset() Function 
  15035.  
  15036.  
  15037. ΓòÉΓòÉΓòÉ 11.3.12. The mkDPIunregister() Function ΓòÉΓòÉΓòÉ
  15038.  
  15039. Syntax 
  15040.  
  15041. #include <snmp_dpi.h>
  15042.  
  15043. unsigned char *mkDPIunregister( /* Make DPI unregister packet */
  15044.   char           reason_code;   /* unregister reason code     */
  15045.   char          *group_p);      /* ptr to group ID (sub-tree) */
  15046.  
  15047. Parameters 
  15048.  
  15049.  reason_code 
  15050.    The reason for the unregister. 
  15051.  
  15052.    See DPI UNREGISTER Reason Codes for a list of the currently defined reason 
  15053.    codes. 
  15054.  
  15055.  group_p 
  15056.    A pointer to a NULL terminated character string that represents the sub-tree 
  15057.    to be unregistered.  The sub-tree must have a trailing dot. 
  15058.  
  15059.  Return Values 
  15060.  
  15061.       If successful, a pointer to a static DPI packet buffer is returned.  The 
  15062.       first two bytes of the buffer in network byte order contain the length of 
  15063.       the remaining packet.  The macro DPI_PACKET_LEN can be used to calculate 
  15064.       the total length of the DPI packet. 
  15065.  
  15066.       If failure, a NULL pointer is returned. 
  15067.  
  15068.  Note:  The static buffer for the DPI packet is shared by other mkDPIxxxx() 
  15069.  functions that create a serialized DPI packet. 
  15070.  
  15071.  Description 
  15072.  
  15073.  The mkDPIunregister() function creates a serialized DPI UNREGISTER packet that 
  15074.  can be sent to the DPI peer, which is a DPI capable SNMP agent or subagent. 
  15075.  
  15076.  Normally, the SNMP peer then sends a DPI RESPONSE packet back.  This packet 
  15077.  identifies if the unregister was successful or not. 
  15078.  
  15079.  Examples 
  15080.  
  15081.     #include <snmp_dpi.h>
  15082.     unsigned char *pack_p;
  15083.  
  15084.     pack_p = mkDPIunregister(
  15085.                   SNMP_UNREGISTER_goingDown,
  15086.                   "1.3.6.1.2.3.4.5.");
  15087.     if (pack_p) {
  15088.        /* send packet to agent or subagent and await response */
  15089.     } /* endif */
  15090.  
  15091.  Related Information 
  15092.  
  15093.       The snmp_dpi_ureg_packet Structure 
  15094.  
  15095.  
  15096. ΓòÉΓòÉΓòÉ 11.3.13. The pDPIpacket() Function ΓòÉΓòÉΓòÉ
  15097.  
  15098. Syntax 
  15099.  
  15100. #include <snmp_dpi.h>
  15101.  
  15102. snmp_dpi_hdr *pDPIpacket(unsigned char *packet_p);
  15103.  
  15104. Parameters 
  15105.  
  15106.  packet_p 
  15107.    A pointer to a serialized DPI packet. 
  15108.  
  15109.  Return Values 
  15110.  
  15111.       If successful, a pointer to a DPI parse tree (snmp_dpi_hdr) is returned. 
  15112.       Memory for the parse tree has been dynamically allocated, and it is the 
  15113.       callers responsibility to free it when no longer needed. You can use the 
  15114.       fDPIparse() function to free the parse tree. 
  15115.  
  15116.       If failure, a NULL pointer is returned. 
  15117.  
  15118.  Description 
  15119.  
  15120.  The pDPIpacket() function parses the buffer pointed to by the packet_p 
  15121.  parameter.  It ensures that the buffer contains a valid DPI packet and that 
  15122.  the packet is for a DPI version and release that is supported by the DPI 
  15123.  functions in use. 
  15124.  
  15125.  Examples 
  15126.  
  15127.     #include <snmp_dpi.h>
  15128.     unsigned char       *pack_p;
  15129.     snmp_dpi_hdr        *hdr_p;
  15130.  
  15131.     hdr_p = pDPIpacket(pack_p);       /* parse incoming packet */
  15132.                                       /* assume it's in pack_p */
  15133.     if (hdr_p) {
  15134.        /* analyze packet, and handle it */
  15135.     }
  15136.  
  15137.  Related Information 
  15138.  
  15139.       The snmp_dpi_hdr Structure 
  15140.       The snmp_dpi.h Include File 
  15141.       The fDPIparse() Function 
  15142.  
  15143.  
  15144. ΓòÉΓòÉΓòÉ 11.4. Transport-Related DPI API Functions ΓòÉΓòÉΓòÉ
  15145.  
  15146. This section describes each of the DPI transport-related functions that are 
  15147. available to the DPI subagent programmer.  These functions try to hide any 
  15148. platform specific issues for the DPI subagent programmer so that the subagent 
  15149. can be made as portable as possible.  If you need detailed control for sending 
  15150. and awaiting DPI packets, you may have to do some of the transport-related code 
  15151. yourself. 
  15152.  
  15153. The transport-related functions are basically the same for any platform, except 
  15154. for the initial call to setup a connection.  OS/2 currently supports the TCP/IP 
  15155. transport type. 
  15156.  
  15157. Topics 
  15158.  
  15159.       The DPIawait_packet_from_agent() Function 
  15160.       The DPIconnect_to_agent_SHM() Function 
  15161.       The DPIconnect_to_agent_TCP() Function 
  15162.       The DPIdisconnect_from_agent() Function 
  15163.       The DPIget_fd_for_handle() Function 
  15164.       The DPIsend_packet_to_agent() Function 
  15165.       The lookup_host() Function 
  15166.       The query_DPI_port() Function 
  15167.  
  15168.  
  15169. ΓòÉΓòÉΓòÉ 11.4.1. The DPIawait_packet_from_agent() Function ΓòÉΓòÉΓòÉ
  15170.  
  15171. Syntax 
  15172.  
  15173. #include <snmp_dpi.h>
  15174.  
  15175. int DPIawait_packet_from_agent(    /* await a DPI packet      */
  15176.   int                   handle,    /* on this connection      */
  15177.   int                   timeout,   /* timeout in seconds      */
  15178.   unsigned char       **message_p, /* receives ptr to data    */
  15179.   unsigned long        *length);   /* receives length of data */
  15180.  
  15181. Parameters 
  15182.  
  15183.  handle 
  15184.    A handle as obtained with a DPIconnect_to_agent_xxxx() call. 
  15185.  
  15186.  timeout 
  15187.    A timeout value in seconds.  There are two special values: 
  15188.  
  15189.    -1           Causes the function to wait forever until a packet arrives. 
  15190.  
  15191.     0           Means that the function will only check if a packet is waiting. 
  15192.                 If not, an immediate return is made.  If there is a packet, it 
  15193.                 will be returned. 
  15194.  
  15195.  message_p 
  15196.    The address of a pointer that will receive the address of a static DPI 
  15197.    packet buffer or, if there is no packet, a NULL pointer. 
  15198.  
  15199.  length 
  15200.    The address of an unsigned long integer that will receive the length of the 
  15201.    received DPI packet or, if there is no packet, a zero value. 
  15202.  
  15203.  Return Values 
  15204.  
  15205.       If successful, a zero (DPI_RC_noError) is returned.  The buffer pointer 
  15206.       and length of the caller will be set to point to the received DPI packet 
  15207.       and to the length of that packet. 
  15208.  
  15209.       If failure, a negative integer is returned.  It indicates the kind of 
  15210.       error that occurred.  See Return Codes from DPI Transport-Related 
  15211.       Functions for a list of possible error codes. 
  15212.  
  15213.  Description 
  15214.  
  15215.  The DPIawait_packet_from_agent() function is used at the subagent side to 
  15216.  await a DPI packet from the DPI capable SNMP agent.  The programmer can 
  15217.  specify how long to wait. 
  15218.  
  15219.  Examples 
  15220.  
  15221.     #include <snmp_dpi.h>
  15222.     int                  handle;
  15223.     unsigned char       *pack_p;
  15224.     unsigned long        length;
  15225.  
  15226.     handle = DPIconnect_to_agent_TCP("localhost", "public");
  15227.     if (handle < 0) {
  15228.        printf("Error %d from connect\n",handle);
  15229.        exit(1);
  15230.     } /* endif */
  15231.     /* do useful stuff */
  15232.     rc = DPIawait_packet_from_agent(handle, -1,
  15233.                               &pack_p, &length);
  15234.     if (rc) {
  15235.        printf("Error %d from await packet\n");
  15236.        exit(1);
  15237.     } /* endif */
  15238.     /* handle the packet */
  15239.  
  15240.  Related Information 
  15241.  
  15242.       The DPIconnect_to_agent_TCP() Function 
  15243.  
  15244.  
  15245. ΓòÉΓòÉΓòÉ 11.4.2. The DPIconnect_to_agent_SHM() Function ΓòÉΓòÉΓòÉ
  15246.  
  15247. Syntax 
  15248.  
  15249. #inlcude <snmp_dpi.h>
  15250.  
  15251. int  DPIconnect_to_agent_SHM(  /* Connect to DPI Shared Mem  */
  15252.         int          queue_id);/* target (agent) queue id    */
  15253.  
  15254. Parameters 
  15255.  
  15256.  queu_id 
  15257.    A queue_id known by the agent.  The value is a fixed queueid.  It must 
  15258.    always be 1. 
  15259.  
  15260.  Return Values 
  15261.  
  15262.       If successful, a positive integer that represents the connection is 
  15263.       returned.  It is to be used as a handle in subsequent calls to DPI 
  15264.       transport-related functions. 
  15265.  
  15266.       If failure, a negative integer is returned.  It indicates the kind of 
  15267.       error that occurred.  See Return Codes from DPI Transport-Related 
  15268.       Functions for a list of possible error codes. 
  15269.  
  15270.  Description 
  15271.  
  15272.  The DPIconnect_to_agent_SHM() function is used at the subagent side to setup a 
  15273.  connection (via SHared Memory) to the DPI capable SNMP agent. 
  15274.  
  15275.  Examples 
  15276.  
  15277.   #include <snmp_dpi.h>
  15278.   int                  handle;
  15279.  
  15280.   handle = DPIconnect_to_agent_SHM(1);
  15281.   if (handle < 0) {
  15282.      printf("Error %d from connect\n",handle);
  15283.      exit(1);
  15284.   }          /* endif */
  15285.  
  15286.  Related Information 
  15287.  
  15288.       Return Codes from DPI Transport-Related Functions 
  15289.       The DPIconnect_to_agent_TCP() Function 
  15290.  
  15291.  
  15292. ΓòÉΓòÉΓòÉ 11.4.3. The DPIconnect_to_agent_TCP() Function ΓòÉΓòÉΓòÉ
  15293.  
  15294. Syntax 
  15295.  
  15296. #include <snmp_dpi.h>
  15297.  
  15298. int DPIconnect_to_agent_TCP(    /* Connect to DPI TCP port    */
  15299.   char          *hostname_p,    /* target hostname/IP address */
  15300.   char          *community_p);  /* community name             */
  15301.  
  15302. Parameters 
  15303.  
  15304.  hostname_p 
  15305.    A pointer to a NULL terminated character string representing the host name 
  15306.    or IP address in dot notation of the host where the DPI capable SNMP agent 
  15307.    is running. 
  15308.  
  15309.  community_p 
  15310.    A pointer to a NULL terminated character string representing the community 
  15311.    name that is required to obtain the dpiPort from the SNMP agent via an SNMP 
  15312.    GET request. 
  15313.  
  15314.  Return Values 
  15315.  
  15316.       If successful, a positive integer that represents the connection is 
  15317.       returned.  It is to be used as a handle in subsequent calls to DPI 
  15318.       transport-related functions. 
  15319.  
  15320.       If failure, a negative integer is returned.  It indicates the kind of 
  15321.       error that occurred.  See Return Codes from DPI Transport-Related 
  15322.       Functions for a list of possible error codes. 
  15323.  
  15324.  Description 
  15325.  
  15326.  The DPIconnect_to_agent_TCP() function is used at the subagent side to setup a 
  15327.  TCP connection to the DPI capable SNMP agent. 
  15328.  
  15329.  Examples 
  15330.  
  15331.     #include <snmp_dpi.h>
  15332.     int                  handle;
  15333.  
  15334.     handle = DPIconnect_to_agent_TCP("localhost", "loopback");
  15335.     if (handle < 0) {
  15336.        printf("Error %d from connect\n",handle);
  15337.        exit(1);
  15338.     } /* endif */
  15339.  
  15340.  Related Information 
  15341.  
  15342.       Return Codes from DPI Transport-Related Functions 
  15343.       The DPIconnect_to_agent_SHM() Function 
  15344.  
  15345.  
  15346. ΓòÉΓòÉΓòÉ 11.4.4. The DPIdisconnect_from_agent() Function ΓòÉΓòÉΓòÉ
  15347.  
  15348. Syntax 
  15349.  
  15350. #include <snmp_dpi.h>
  15351.  
  15352. void DPIdisconnect_from_agent(  /* disconnect from DPI (agent)*/
  15353.   int                  handle); /* close this connection      */
  15354.  
  15355. Parameters 
  15356.  
  15357.  handle 
  15358.    A handle as obtained with a DPIconnect_to_agent_xxxx() call. 
  15359.  
  15360.  Return Values 
  15361.  
  15362.       If successful, a positive integer that represents the connection is 
  15363.       returned.  It is to be used as a handle in subsequent calls to DPI 
  15364.       transport-related functions. 
  15365.  
  15366.       If failure, a negative integer is returned.  It indicates the kind of 
  15367.       error that occurred.  See Return Codes from DPI Transport-Related 
  15368.       Functions for a list of possible error codes. 
  15369.  
  15370.  Description 
  15371.  
  15372.  The DPIdisconnect_from_agent() function is used at the subagent side to 
  15373.  terminate a connection to the DPI capable SNMP agent. 
  15374.  
  15375.  Examples 
  15376.  
  15377.     #include <snmp_dpi.h>
  15378.     int                  handle;
  15379.  
  15380.     handle = DPIconnect_to_agent_TCP("localhost", "loopback");
  15381.     if (handle < 0) {
  15382.        printf("Error %d from connect\n",handle);
  15383.        exit(1);
  15384.     } /* endif */
  15385.     /* do useful stuff */
  15386.     DPIdisconnect_from_agent(handle);
  15387.  
  15388.  Related Information 
  15389.  
  15390.       The DPIconnect_to_agent_TCP() Function 
  15391.  
  15392.  
  15393. ΓòÉΓòÉΓòÉ 11.4.5. The DPIget_fd_for_handle() Function ΓòÉΓòÉΓòÉ
  15394.  
  15395. Syntax 
  15396.  
  15397. #include <snmp_dpi.h>
  15398.  
  15399. int DPIget_fd_for_handle(       /* get the file descriptor    */
  15400.   int            handle);       /* for this handle            */
  15401.  
  15402. Parameters 
  15403.  
  15404.  handle 
  15405.    A handle that was obtained with a DPIconnect_to_agent_TCP() call. 
  15406.  
  15407.  Return Values 
  15408.  
  15409.       If successful, a positive integer representing the file descriptor 
  15410.       associated with the specified handle. 
  15411.  
  15412.       If failure, a negative integer is returned.  It indicates the error that 
  15413.       occurred.  See Return Codes from DPI Transport-Related Functions for a 
  15414.       list of possible error codes. 
  15415.  
  15416.  Description 
  15417.  
  15418.  The DPIget_fd_for_handle function is used to obtain the file descriptor for 
  15419.  the handle, which was obtained with a DPIconnect_to_agent_TCP() call. 
  15420.  
  15421.  The DPI subagent programmer would use this function to not only wait for DPI 
  15422.  requests, but possibly for other TCP/IP events.  The programmer may want to do 
  15423.  their own select and include for the file descriptor of the DPI connections. 
  15424.  
  15425.  Examples 
  15426.  
  15427.   #include <snmp_dpi.h>
  15428.   #include /* other include files for BSD sockets and such */
  15429.   int                  handle;
  15430.   int                  fd;
  15431.  
  15432.   handle = DPIconnect_to_agentTCP("localhost","public");
  15433.   if (handle < 0) {
  15434.      printf("Error %d from connect\n",handle);
  15435.      exit(1);
  15436.   }
  15437.   fd = DPIget_fd_for_handle(handle);
  15438.   if (fd <0) {
  15439.      printf("Error %d from get_fd\n",fd);
  15440.      exit(1);
  15441.   }
  15442.  
  15443.  Related Information 
  15444.  
  15445.       The DPIconnect_to_agent_TCP() Function 
  15446.  
  15447.  
  15448. ΓòÉΓòÉΓòÉ 11.4.6. The DPIsend_packet_to_agent() Function ΓòÉΓòÉΓòÉ
  15449.  
  15450. Syntax 
  15451.  
  15452. #include <snmp_dpi.h>
  15453.  
  15454. int DPIsend_packet_to_agent(       /* send  a DPI packet      */
  15455.   int                   handle,    /* on this connection      */
  15456.   unsigned char        *message_p, /* ptr to the packet data  */
  15457.   unsigned long         length);   /* length of the packet    */
  15458.  
  15459. Parameters 
  15460.  
  15461.  handle 
  15462.    A handle as obtained with a DPIconnect_to_agent_xxxx() call. 
  15463.  
  15464.  message_p 
  15465.    A pointer to the buffer containing the DPI packet to be sent. 
  15466.  
  15467.  length 
  15468.    The length of the DPI packet to be sent.  The DPI_PACKET_LEN macro is a 
  15469.    useful macro to calculate the length. 
  15470.  
  15471.  Return Values 
  15472.  
  15473.       If successful, a zero (DPI_RC_noError) is returned. 
  15474.  
  15475.       If failure, a negative integer is returned.  It indicates the kind of 
  15476.       error that occurred.  See Return Codes from DPI Transport-Related 
  15477.       Functions for a list of possible error codes. 
  15478.  
  15479.  Description 
  15480.  
  15481.  The DPIsend_packet_to_agent() function is used at the subagent side to send a 
  15482.  DPI packet to the DPI capable SNMP agent. 
  15483.  
  15484.  Examples 
  15485.  
  15486.     #include <snmp_dpi.h>
  15487.     int                  handle;
  15488.     unsigned char       *pack_p;
  15489.  
  15490.     handle = DPIconnect_to_agent_TCP("localhost", "public");
  15491.     if (handle < 0) {
  15492.        printf("Error %d from connect\n",handle);
  15493.        exit(1);
  15494.     } /* endif */
  15495.     pack_p = mkDPIopen("1.3.6.1.2.3.4.5",
  15496.                   "Sample DPI subagent"
  15497.                   0L,2L,,DPI_NATIVE_CSET,
  15498.                   0,(char *)0);
  15499.     if (pack_p) {
  15500.        rc = DPIsend_packet_to_agent(handle,pack_p,
  15501.                            DPI_PACKET_LEN(pack_p));
  15502.        if (rc) {
  15503.           printf("Error %d from await packet\n");
  15504.           exit(1);
  15505.        } /* endif */
  15506.     } else {
  15507.        printf("Can't make DPI OPEN packet\n");
  15508.        exit(1);
  15509.     } /* endif */
  15510.     /* await the response */
  15511.  
  15512.  Related Information 
  15513.  
  15514.       The DPIconnect_to_agent_TCP() Function 
  15515.       The DPI_PACKET_LEN() Macro 
  15516.       The mkDPIopen() Function 
  15517.  
  15518.  
  15519. ΓòÉΓòÉΓòÉ 11.4.7. The lookup_host() Function ΓòÉΓòÉΓòÉ
  15520.  
  15521. Syntax 
  15522.  
  15523. #include <snmp_dpi.h>
  15524.  
  15525. unsigned long    lookup_host(   /* find IP address in network */
  15526.   char            *hostname_p); /* byte order for this host   */
  15527.  
  15528. Parameters 
  15529.  
  15530.  hostname_p 
  15531.    A pointer to a NULL terminated character string representing the host name 
  15532.    or IP address in dot notation of the host where the DPI capable SNMP agent 
  15533.    is running. 
  15534.  
  15535.  Return Values 
  15536.  
  15537.       If successful, the IP address is returned in network byte order, so it is 
  15538.       ready to be used in a sockaddr_in structure. 
  15539.  
  15540.       If failure, a value of 0 is returned. 
  15541.  
  15542.  Description 
  15543.  
  15544.  The lookup_host() function is used to obtain the IP address in network byte 
  15545.  order of a host or IP address in dot notation. 
  15546.  
  15547.  The DPI subagent programmer only needs to use this function to code the 
  15548.  connection setup and send or await the packet.  The programmer then obtains 
  15549.  the DPI port number, finds the IP address of the agent with the lookup_host() 
  15550.  function and then sets up a socket for communication. 
  15551.  
  15552.  This function is implicitly executed by the DPIconnect_to_agent_TCP() 
  15553.  function, which is the function that the DPI subagent programmer would 
  15554.  normally use.  So the lookup_host() function is normally not used by the DPI 
  15555.  subagent programmer. 
  15556.  
  15557.  Examples 
  15558.  
  15559.   #include <snmp_dpi.h>
  15560.   #include /* other include files for BSD sockets and such */
  15561.   int                  handle;
  15562.   unsigned char       *pack_p;
  15563.   long int             dpi_port;
  15564.   int                  fd;
  15565.   struct sockaddr_in   s,t;              /* source and target   */
  15566.  
  15567.   dpi_port = query_DPI_port("localhost", /* get DPI port number */
  15568.                     "public",            /* for TCP, local host */
  15569.                     dpiPortForTCP);
  15570.   if (dpi_port < 0) exit(1);             /* error if negative   */
  15571.  
  15572.   host_addr = lookup_host("localhost");  /* find target IP addr */
  15573.   if (host_addr == 0) exit(1);           /* unknown, that's it  */
  15574.  
  15575.   fd = socket(AF_INET,SOCK_STREAM,0);    /* create a TCP socket */
  15576.   if (fd < 0) exit(1);                   /* failure to do so    */
  15577.  
  15578.   memset(&s,0,sizeof(s));
  15579.   s.sin_family      = AF_INET;           /* set AF_INET family  */
  15580.   s.sin_port        = 0;                 /* give us any port,   */
  15581.   s.sin_addr.s_addr = htonl(INADDR_ANY); /* any local IPaddress */
  15582.  
  15583.   rc = bind(fd,(struct sockaddr *)s,     /* bind our socket(fd) */
  15584.             sizeof(s_sock));             /* defined in s socket */
  15585.   if (rc < 0) exit(1);                   /* failure, so exit    */
  15586.  
  15587.   memset(&d,0,sizeof(d));
  15588.   d.sin_family      = AF_INET;           /* set AF_INET family  */
  15589.   d.sin_port        = htons(dpi_port);   /* set requested port  */
  15590.   d.sin_addr.s_addr = host_addr;         /* destination IP addr */
  15591.                                          /* network byte order  */
  15592.   rc = connect(fd,(struct sockaddr *)d,  /* connect to target   */
  15593.                sizeof(d));               /* based on d sock     */
  15594.   if (rc < 0) exit(1);                   /* failed, exit        */
  15595.   /* now we have a socket on which to send/receive DPI packets  */
  15596.  
  15597.  Related Information 
  15598.  
  15599.       The query_DPI_port() Function 
  15600.       The DPIconnect_to_agent_TCP() Function 
  15601.  
  15602.  
  15603. ΓòÉΓòÉΓòÉ 11.4.8. The query_DPI_port() Function ΓòÉΓòÉΓòÉ
  15604.  
  15605. Syntax 
  15606.  
  15607. #include <snmp_dpi.h>
  15608.  
  15609. long int query_DPI_port(        /* Query (GET) SNMP_DPI port  */
  15610.   char          *hostname_p,    /* target hostname/IPaddress  */
  15611.   char          *community_p,   /* communityname for GET      */
  15612.   int            porttype);     /* port type, one of:         */
  15613.                                 /*   dpiPortForTCP            */
  15614.                                 /*   dpiPortForUDP            */
  15615.  
  15616. Parameters 
  15617.  
  15618.  hostname_p 
  15619.    A pointer to a NULL terminated character string representing the host name 
  15620.    or IP address in dot notation of the host where the DPI capable SNMP agent 
  15621.    is running. 
  15622.  
  15623.  community_p 
  15624.    A pointer to a NULL terminated character string representing the community 
  15625.    name that is required to obtain the dpiPort from the SNMP agent via an SNMP 
  15626.    GET request. 
  15627.  
  15628.  porttype 
  15629.    The dpiPort object for a specific port type that you want to obtain. 
  15630.    Currently there are two types:  one for a TCP port and one for a UDP port. 
  15631.    The snmp_dpi.h include file has two #define statements for these DPI port 
  15632.    types: 
  15633.  
  15634.         #define dpiPortForTCP    1
  15635.         #define dpiPortForUDP    2
  15636.  
  15637.    At this time, the dpiPORTForUDP port type is not supported.  If you use it, 
  15638.    the return value is set to -1, which indicates a failure. 
  15639.  
  15640.  Return Values 
  15641.  
  15642.       If successful, the DPI port number for the specified protocol, TCP or 
  15643.       UDP, is returned. 
  15644.  
  15645.       If failure, a value of -1 is returned. 
  15646.  
  15647.  Description 
  15648.  
  15649.  The query_DPI_port function is used to obtain the port number on which the DPI 
  15650.  capable SNMP agent at the specified host is listening for connections (TCP) or 
  15651.  packets (UDP). 
  15652.  
  15653.  The DPI subagent programmer only needs to use this function to code the 
  15654.  connection setup and send or await the packet.  The programmer then obtains 
  15655.  the DPI port number, finds the IP address of the agent with the lookup_host() 
  15656.  function and then sets up a socket for communication. 
  15657.  
  15658.  This function is implicitly executed by the DPIconnect_to_agent_TCP() 
  15659.  function, which is the function that the DPI subagent programmer would 
  15660.  normally use.  So the query_DPI_port() function is normally not used by the 
  15661.  DPI subagent programmer. 
  15662.  
  15663.  Examples 
  15664.  
  15665.   #include <snmp_dpi.h>
  15666.   #include /* other include files for BSD sockets and such */
  15667.   int                  handle;
  15668.   unsigned char       *pack_p;
  15669.   long int             dpi_port;
  15670.   int                  fd;
  15671.   struct sockaddr_in   s,t;              /* source and target   */
  15672.  
  15673.   dpi_port = query_DPI_port("localhost", /* get DPI port number */
  15674.                     "public",            /* for TCP, local host */
  15675.                     dpiPortForTCP);
  15676.   if (dpi_port < 0) exit(1);             /* error if negative   */
  15677.  
  15678.   host_addr = lookup_host("localhost");  /* find target IP addr */
  15679.   if (host_addr == 0) exit(1);           /* unknown, that's it  */
  15680.  
  15681.   fd = socket(AF_INET,SOCK_STREAM,0);    /* create a TCP socket */
  15682.   if (fd < 0) exit(1);                   /* failure to do so    */
  15683.  
  15684.   memset(&s,0,sizeof(s));
  15685.   s.sin_family      = AF_INET;           /* set AF_INET family  */
  15686.   s.sin_port        = 0;                 /* give us any port,   */
  15687.   s.sin_addr.s_addr = htonl(INADDR_ANY); /* any local IPaddress */
  15688.  
  15689.   rc = bind(fd,(struct sockaddr *)s,     /* bind our socket(fd) */
  15690.             sizeof(s_sock));             /* defined in s socket */
  15691.   if (rc < 0) exit(1);                   /* failure, so exit    */
  15692.  
  15693.   memset(&d,0,sizeof(d));
  15694.   d.sin_family      = AF_INET;           /* set AF_INET family  */
  15695.   d.sin_port        = htons(dpi_port);   /* set requested port  */
  15696.   d.sin_addr.s_addr = host_addr;         /* destination IP addr */
  15697.                                          /* network byte order  */
  15698.   rc = connect(fd,(struct sockaddr *)d,  /* connect to target   */
  15699.                sizeof(d));               /* based on d sock     */
  15700.   if (rc < 0) exit(1);                   /* failed, exit        */
  15701.   /* now we have a socket on which to send/receive DPI packets  */
  15702.  
  15703.  Related Information 
  15704.  
  15705.       The lookup_host() Function 
  15706.       The DPIconnect_to_agent_TCP() Function 
  15707.  
  15708.  
  15709. ΓòÉΓòÉΓòÉ 11.5. DPI Structures ΓòÉΓòÉΓòÉ
  15710.  
  15711. This section describes each data structure that is used in the SNMP DPI API. 
  15712.  
  15713. Topics 
  15714.  
  15715.       The snmp_dpi_bulk_packet Structure 
  15716.       The snmp_dpi_close_packet Structure 
  15717.       The snmp_dpi_get_packet Structure 
  15718.       The snmp_dpi_next_packet Structure 
  15719.       The snmp_dpi_hdr Structure 
  15720.       The snmp_dpi_resp_packet Structure 
  15721.       The snmp_dpi_set_packet Structure 
  15722.       The snmp_dpi_ureg_packet Structure 
  15723.       The snmp_dpi_u64 Structure 
  15724.  
  15725.  
  15726. ΓòÉΓòÉΓòÉ 11.5.1. The snmp_dpi_bulk_packet Structure ΓòÉΓòÉΓòÉ
  15727.  
  15728. Structure Definition 
  15729.  
  15730. struct dpi_bulk_packet {
  15731.   long int          non_repeaters;   /* count of non-repeaters*/
  15732.   long int          max_repetitions; /* max repeaters         */
  15733.   struct dpi_next_packet *varBind_p; /* ptr to varBinds, chain*/
  15734.                                      /* of dpi_next_packets   */
  15735. };
  15736. typedef struct dpi_bulk_packet       snmp_dpi_bulk_packet;
  15737. #define snmp_dpi_bulk_packet_NULL_p  ((snmp_dpi_bulk_packet *)0)
  15738.  
  15739. Note:  This structure is supported only in SNMP Version 2. 
  15740.  
  15741. Structure Members 
  15742.  
  15743.  non_repeaters 
  15744.    The number of varBinds in the chain of dpi_next_packet structures that are 
  15745.    to be treated as a single GETNEXT. 
  15746.  
  15747.  max_repetitions 
  15748.    The maximum number of repetitions for the remaining set of varBinds in 
  15749.    dpi_next_packet structures treated as a single GETNEXT. 
  15750.  
  15751.  varBind_p 
  15752.    The pointer to the first varBind in the chain of dpi_next_packet structures. 
  15753.  
  15754.  Description 
  15755.  
  15756.  The snmp_dpi_bulk_packet structure represents a parse tree for a DPI GETBULK 
  15757.  packet. 
  15758.  
  15759.  At the subagent side, the snmp_dpi_bulk_packet structure is normally created 
  15760.  as a result of a call to pDPIpacket().  This is the case if the DPI packet is 
  15761.  of type SNMP_DPI_GETBULK.  The snmp_dpi_hdr structure then contains a pointer 
  15762.  to an snmp_dpi_bulk_packet structure, which in turn has a pointer to a chain 
  15763.  of one or more snmp_dpi_next_packet structures. 
  15764.  
  15765.  The DPI subagent programmer uses this structure to find out which variables 
  15766.  instances are to be returned in a DPI RESPONSE. 
  15767.  
  15768.  Related Information 
  15769.  
  15770.       The pDPIpacket() Function 
  15771.       The snmp_dpi_hdr Structure 
  15772.       The snmp_dpi_next_packet Structure 
  15773.  
  15774.  
  15775. ΓòÉΓòÉΓòÉ 11.5.2. The snmp_dpi_close_packet Structure ΓòÉΓòÉΓòÉ
  15776.  
  15777. Structure Definition 
  15778.  
  15779. struct dpi_close_packet {
  15780.   char               reason_code;    /* reason for closing    */
  15781. };
  15782. typedef struct dpi_close_packet      snmp_dpi_close_packet;
  15783. #define snmp_dpi_close_packet_NULL_p ((snmp_dpi_close_packet*)0)
  15784.  
  15785. Structure Members 
  15786.  
  15787.  reason_code 
  15788.    The reason for the close. 
  15789.  
  15790.    See DPI CLOSE Reason Codes for a list of valid reason codes. 
  15791.  
  15792.  Description 
  15793.  
  15794.  The snmp_dpi_close_packet structure represents a parse tree for a DPI CLOSE 
  15795.  packet. 
  15796.  
  15797.  The snmp_dpi_close_packet structure may be created as a result of a call to 
  15798.  pDPIpacket().  This is the case if the DPI packet is of type SNMP_DPI_CLOSE. 
  15799.  The snmp_dpi_hdr structure then contains a pointer to a snmp_dpi_close_packet 
  15800.  structure. 
  15801.  
  15802.  An snmp_dpi_close_packet_structure is also created as a result of a 
  15803.  mkDPIclose() call, but the programmer never sees the structure since 
  15804.  mkDPIclose() immediately creates a serialized DPI packet from it and then 
  15805.  frees the structure. 
  15806.  
  15807.  It is recommended that DPI subagent programmer uses mkDPIclose() to create a 
  15808.  DPI CLOSE packet. 
  15809.  
  15810.  Related Information 
  15811.  
  15812.       The pDPIpacket() Function 
  15813.       The mkDPIclose() Function 
  15814.       The snmp_dpi_hdr Structure 
  15815.  
  15816.  
  15817. ΓòÉΓòÉΓòÉ 11.5.3. The snmp_dpi_get_packet Structure ΓòÉΓòÉΓòÉ
  15818.  
  15819. Structure Definition 
  15820.  
  15821. struct dpi_get_packet {
  15822.   char                  *object_p;   /* ptr to OID string     */
  15823.   char                  *group_p;    /* ptr to sub-tree(group)*/
  15824.   char                  *instance_p; /* ptr to rest of OID    */
  15825.   struct dpi_get_packet *next_p;     /* ptr to next in chain  */
  15826. };
  15827. typedef struct dpi_get_packet        snmp_dpi_get_packet;
  15828. #define snmp_dpi_get_packet_NULL_p   ((snmp_dpi_get_packet *)0)
  15829.  
  15830. Structure Members 
  15831.  
  15832.  object_p 
  15833.    A pointer to a NULL terminated character string that represents the full 
  15834.    OBJECT IDENTIFIER of the variable instance that is being accessed.  It 
  15835.    basically is a concatenation of the fields group_p and instance_p.  Using 
  15836.    this field is not recommended because it is only included for DPI Version 1 
  15837.    compatibility and it maybe withdrawn in a later version. 
  15838.  
  15839.  group_p 
  15840.    A pointer to a NULL terminated character string that represents the 
  15841.    registered sub-tree that caused this GET request to be passed to this DPI 
  15842.    subagent.  The sub-tree must have a trailing dot. 
  15843.  
  15844.  instance_p 
  15845.    A pointer to a NULL terminated character string that represents the rest 
  15846.    which is the piece following the sub-tree part of the OBJECT IDENTIFIER of 
  15847.    the variable instance being accessed. 
  15848.  
  15849.    Use of the term instance_p here should not be confused with an OBJECT 
  15850.    instance because this string may consist of a piece of the OBJECT IDENTIFIER 
  15851.    plus the INSTANCE IDENTIFIER. 
  15852.  
  15853.  next_p 
  15854.    A pointer to a possible next snmp_dpi_get_packet structure.  If this next 
  15855.    field contains the NULL pointer, this is the end of the chain. 
  15856.  
  15857.  Description 
  15858.  
  15859.  The snmp_dpi_get_packet structure represents a parse tree for a DPI GET 
  15860.  packet. 
  15861.  
  15862.  At the subagent side, the snmp_dpi_get_packet structure is normally created as 
  15863.  a result of a call to pDPIpacket().  This is the case if the DPI packet is of 
  15864.  type SNMP_DPI_GET.  The snmp_dpi_hdr structure then contains a pointer to a 
  15865.  chain of one or more snmp_dpi_get_packet structures. 
  15866.  
  15867.  The DPI subagent programmer uses this structure to find out which variables 
  15868.  instances are to be returned in a DPI RESPONSE. 
  15869.  
  15870.  Related Information 
  15871.  
  15872.       The pDPIpacket() Function 
  15873.       The snmp_dpi_hdr Structure 
  15874.  
  15875.  
  15876. ΓòÉΓòÉΓòÉ 11.5.4. The snmp_dpi_hdr Structure ΓòÉΓòÉΓòÉ
  15877.  
  15878. Structure Definition 
  15879.  
  15880. struct snmp_dpi_hdr {
  15881.   unsigned char  proto_major;   /* always 2: SNMP_DPI_PROTOCOL*/
  15882.   unsigned char  proto_version; /* DPI version                */
  15883.   unsigned char  proto_release; /* DPI release                */
  15884.   unsigned short packet_id;     /* 16-bit, DPI packet ID      */
  15885.   unsigned char  packet_type;   /* DPI packet type            */
  15886.   union {
  15887.      snmp_dpi_reg_packet      *reg_p;
  15888.      snmp_dpi_ureg_packet     *ureg_p;
  15889.      snmp_dpi_get_packet      *get_p;
  15890.      snmp_dpi_next_packet     *next_p;
  15891.      snmp_dpi_next_packet     *bulk_p;
  15892.      snmp_dpi_set_packet      *set_p;
  15893.      snmp_dpi_resp_packet     *resp_p;
  15894.      snmp_dpi_trap_packet     *trap_p;
  15895.      snmp_dpi_open_packet     *open_p;
  15896.      snmp_dpi_close_packet    *close_p;
  15897.      unsigned char            *any_p;
  15898.   } data_u;
  15899. };
  15900. typedef struct snmp_dpi_hdr    snmp_dpi_hdr;
  15901. #define snmp_dpi_hdr_NULL_p    ((snmp_dpi_hdr *)0)
  15902.  
  15903. Structure Members 
  15904.  
  15905.  proto_major 
  15906.    The major protocol.  For SNMP DPI, it is always 2. 
  15907.  
  15908.  proto_version 
  15909.    The DPI version. 
  15910.  
  15911.  proto_release 
  15912.    The DPI release. 
  15913.  
  15914.  packet_id 
  15915.    This field contains the packet ID of the DPI packet.  When you create a 
  15916.    response to a request, the packet ID must be the same as that of the 
  15917.    request. This is taken care of if you use the mkDPIresponse() function. 
  15918.  
  15919.  packet_type 
  15920.    The type of DPI packet (parse tree) which you are dealing with. 
  15921.  
  15922.    See DPI Packet Types for a list of currently defined DPI packet types 
  15923.  
  15924.  data_u 
  15925.    A union of pointers to the different types of data structures that are 
  15926.    created based on the packet_type field.  The pointers themselves have names 
  15927.    that are self-explanatory. 
  15928.  
  15929.  The fields proto_major, proto_version, proto_release, and packet_id are 
  15930.  basically for DPI internal use.  So the DPI programmer normally does not need 
  15931.  to be concerned about them.  If you work with an unreliable DPI "connection", 
  15932.  such as UDP, you may want to use the packet_id field to ensure you are 
  15933.  handling the correct packet. 
  15934.  
  15935.  Description 
  15936.  
  15937.  The snmp_dpi_hdr structure is the anchor of a DPI parse tree.  At the subagent 
  15938.  side, the snmp_dpi_hdr structure is normally created as a result of a call to 
  15939.  pDPIpacket(). 
  15940.  
  15941.  The DPI subagent programmer uses this structure to interrogate packets. 
  15942.  Depending on the packet_type, the pointer to the chain of one or more 
  15943.  packet_type specific structures that contain the actual packet data can be 
  15944.  picked. 
  15945.  
  15946.  The storage for a DPI parse tree is always dynamically allocated. It is the 
  15947.  responsibility of the caller to free this parse tree when it is no longer 
  15948.  needed.  You can use the fDPIparse() function to do that. 
  15949.  
  15950.  Note:  Some mkDPIxxxx functions do free the parse tree that is passed to them. 
  15951.  An example is the mkDPIpacket() function. 
  15952.  
  15953.  Related Information 
  15954.  
  15955.       The fDPIparse() Function 
  15956.       The pDPIpacket() Function 
  15957.       The snmp_dpi_close_packet Structure 
  15958.       The snmp_dpi_get_packet Structure 
  15959.       The snmp_dpi_next_packet Structure 
  15960.       The snmp_dpi_bulk_packet Structure 
  15961.       The snmp_dpi_resp_packet Structure 
  15962.       The snmp_dpi_set_packet Structure 
  15963.       The snmp_dpi_ureg_packet Structure 
  15964.  
  15965.  
  15966. ΓòÉΓòÉΓòÉ 11.5.5. The snmp_dpi_next_packet Structure ΓòÉΓòÉΓòÉ
  15967.  
  15968. Structure Definition 
  15969.  
  15970. struct dpi_next_packet {
  15971.   char                   *object_p;  /* ptr to OID (string)   */
  15972.   char                   *group_p;   /* ptr to sub-tree(group)*/
  15973.   char                   *instance_p;/* ptr to rest of OID    */
  15974.   struct dpi_next_packet *next_p;    /* ptr to next in chain  */
  15975. };
  15976. typedef struct dpi_next_packet       snmp_dpi_next_packet;
  15977. #define snmp_dpi_next_packet_NULL_p  ((snmp_dpi_next_packet *)0)
  15978.  
  15979. Structure Members 
  15980.  
  15981.  object_p 
  15982.    A pointer to a NULL terminated character string that represents the full 
  15983.    OBJECT IDENTIFIER of the variable instance that is being accessed.  It 
  15984.    basically is a concatenation of the fields group_p and instance_p.  Using 
  15985.    this field is not recommended because it is only included for DPI Version 1 
  15986.    compatibility and it maybe withdrawn in a later version. 
  15987.  
  15988.  group_p 
  15989.    A pointer to a NULL terminated character string that represents the 
  15990.    registered sub-tree that caused this GETNEXT request to be passed to this 
  15991.    DPI subagent.  This sub-tree must have a trailing dot. 
  15992.  
  15993.  instance_p 
  15994.    A pointer to a NULL terminated character string that represents the rest 
  15995.    which is the piece following the sub-tree part of the OBJECT IDENTIFIER of 
  15996.    the variable instance being accessed. 
  15997.  
  15998.    Use of the term instance_p here should not be confused with an OBJECT 
  15999.    instance because this string may consist of a piece of the OBJECT IDENTIFIER 
  16000.    plus the INSTANCE IDENTIFIER. 
  16001.  
  16002.  next_p 
  16003.    A pointer to a possible next snmp_dpi_get_packet structure.  If this next 
  16004.    field contains the NULL pointer, this is the end of the chain. 
  16005.  
  16006.  Description 
  16007.  
  16008.  The snmp_dpi_next_packet structure represents a parse tree for a DPI GETNEXT 
  16009.  packet. 
  16010.  
  16011.  At the subagent side, the snmp_dpi_next_packet structure is normally created 
  16012.  as a result of a call to pDPIpacket().  This is the case if the DPI packet is 
  16013.  of type SNMP_DPI_GETNEXT.  The snmp_dpi_hdr structure then contains a pointer 
  16014.  to a chain of one or more snmp_dpi_next_packet structures. 
  16015.  
  16016.  The DPI subagent programmer uses this structure to find out which variables 
  16017.  instances are to be returned in a DPI RESPONSE. 
  16018.  
  16019.  Related Information 
  16020.  
  16021.       The pDPIpacket() Function 
  16022.       The snmp_dpi_hdr Structure 
  16023.  
  16024.  
  16025. ΓòÉΓòÉΓòÉ 11.5.6. The snmp_dpi_resp_packet Structure ΓòÉΓòÉΓòÉ
  16026.  
  16027. Structure Definition 
  16028.  
  16029. struct dpi_resp_packet {
  16030.   char                   error_code; /* like: SNMP_ERROR_xxx  */
  16031.   unsigned long int      error_index;/* 1st varBind in error  */
  16032.   #define resp_priority  error_index /* if respons to register*/
  16033.   struct dpi_set_packet *varBind_p;  /* ptr to varBind, chain */
  16034.                                      /* of dpi_set_packets    */
  16035. };
  16036. typedef struct dpi_resp_packet       snmp_dpi_resp_packet;
  16037. #define snmp_dpi_resp_packet_NULL_p  ((snmp_dpi_resp_packet *)0)
  16038.  
  16039. Structure Members 
  16040.  
  16041.  error_code 
  16042.    The return code or the error code. 
  16043.  
  16044.    See DPI RESPONSE Error Codes for a list of valid codes. 
  16045.  
  16046.  error_index 
  16047.    Specifies the first varBind is in error.  Counting starts at 1 for the first 
  16048.    varBind.  This field should be zero (SNMP_ERROR_noError) if there is no 
  16049.    error. 
  16050.  
  16051.  resp_priority 
  16052.    This is a redefinition of the error_index field.  If the response is a 
  16053.    response to a DPI REGISTER request and the error_code is equal to 
  16054.    SNMP_ERROR_DPI_noError or SNMP_ERROR_DPI_higherPriorityRegistered, then this 
  16055.    field contains the priority that was actually assigned.  Otherwise, this 
  16056.    field is set to zero for responses to a DPI REGISTER.. 
  16057.  
  16058.  varBind_p 
  16059.    A pointer to the chain of one or more snmp_dpi_set_structures, representing 
  16060.    varBinds of the response.  This field contains a NULL pointer if there are 
  16061.    no varBinds in the response. 
  16062.  
  16063.  Description 
  16064.  
  16065.  The snmp_dpi_resp_packet structure represents a parse tree for a DPI RESPONSE 
  16066.  packet. 
  16067.  
  16068.  The snmp_dpi_resp_packet structure is normally created as a result of a call 
  16069.  to pDPIpacket().  This is the case if the DPI packet is of type 
  16070.  SNMP_DPI_RESPONSE.  The snmp_dpi_hdr structure then contains a pointer to a 
  16071.  snmp_dpi_resp_packet structure. 
  16072.  
  16073.  At the DPI subagent side, a DPI RESPONSE should only be expected at 
  16074.  initialization and termination time when the subagent has issued a DPI OPEN, 
  16075.  DPI REGISTER or DPI UNREGISTER request. 
  16076.  
  16077.  The DPI programmer is advised to use the mkDPIresponse() function to prepare a 
  16078.  DPI RESPONSE packet. 
  16079.  
  16080.  Related Information 
  16081.  
  16082.       The pDPIpacket() Function 
  16083.       The mkDPIresponse() Function 
  16084.       The snmp_dpi_set_packet Structure 
  16085.       The snmp_dpi_hdr Structure 
  16086.  
  16087.  
  16088. ΓòÉΓòÉΓòÉ 11.5.7. The snmp_dpi_set_packet Structure ΓòÉΓòÉΓòÉ
  16089.  
  16090. Structure Definition 
  16091.  
  16092. struct dpi_set_packet {
  16093.   char             *object_p;    /* ptr to Object ID (string) */
  16094.   char             *group_p;     /* ptr to sub-tree (group)   */
  16095.   char             *instance_p;  /* ptr to rest of OID        */
  16096.   unsigned char     value_type;  /* value type: SNMP_TYPE_xxx */
  16097.   unsigned short    value_len;   /* value length              */
  16098.   char             *value_p;     /* ptr to the value itself   */
  16099.   struct dpi_set_packet *next_p; /* ptr to next in chain      */
  16100. };
  16101. typedef struct dpi_set_packet       snmp_dpi_set_packet;
  16102. #define snmp_dpi_set_packet_NULL_p  ((snmp_dpi_set_packet *)0)
  16103.  
  16104. Structure Members 
  16105.  
  16106.  object_p 
  16107.    A pointer to a NULL terminated character string that represents the full 
  16108.    OBJECT IDENTIFIER of the variable instance that is being accessed.  It 
  16109.    basically is a concatenation of the fields group_p and instance_p.  Using 
  16110.    this field is not recommended because it is only included for DPI Version 1 
  16111.    compatibility and it maybe withdrawn in a later version. 
  16112.  
  16113.  group_p 
  16114.    A pointer to a NULL terminated character string that represents the 
  16115.    registered sub-tree that caused this SET, COMMIT, or UNDO request to be 
  16116.    passed to this DPI subagent.  The sub-tree must have a trailing dot. 
  16117.  
  16118.  instance_p 
  16119.    A pointer to a NULL terminated character string that represents the rest, 
  16120.    which is the piece following the sub-tree part, of the OBJECT IDENTIFIER of 
  16121.    the variable instance being accessed. 
  16122.  
  16123.    Use of the term instance_p here should not be confused with an OBJECT 
  16124.    instance because this string may consist of a piece of the OBJECT IDENTIFIER 
  16125.    plus the INSTANCE IDENTIFIER. 
  16126.  
  16127.  value_type 
  16128.    The type of the value. 
  16129.  
  16130.    See DPI SNMP Value Types for a list of currently defined value types. 
  16131.  
  16132.  value_len 
  16133.    This is an unsigned 16-bit integer that specifies the length in octets of 
  16134.    the value pointed to by the value field.  The length may be zero if the 
  16135.    value if of type SNMP_TYPE_NULL. 
  16136.  
  16137.  value_p 
  16138.    A pointer to the actual value.  This field may contain a NULL pointer if the 
  16139.    value if of type SNMP_TYPE_NULL. 
  16140.  
  16141.    See Value Representation for information on how the data is represented for 
  16142.    the various value types. 
  16143.  
  16144.  next_p 
  16145.    A pointer to a possible next snmp_dpi_set_packet structure.  If this next 
  16146.    field contains the NULL pointer, this is the end of the chain. 
  16147.  
  16148.  Description 
  16149.  
  16150.  The snmp_dpi_set_packet structure represents a parse tree for a DPI SET 
  16151.  request. 
  16152.  
  16153.  The snmp_dpi_set_packet structure may be created as a result of a call to 
  16154.  pDPIpacket().  This is the case if the DPI packet is of type SNMP_DPI_SET, 
  16155.  SNMP_DPI_COMMIT or SNMP_DPI_UNDO.  The snmp_dpi_hdr structure then contains a 
  16156.  pointer to a chain of one or more snmp_dpi_set_packet structures. 
  16157.  
  16158.  This structure can also be created with a mkDPIset() call, which is typically 
  16159.  used when preparing varBinds for a DPI RESPONSE packet. 
  16160.  
  16161.  Related Information 
  16162.  
  16163.       The pDPIpacket() Function 
  16164.       The mkDPIset() Function 
  16165.       DPI SNMP Value Types 
  16166.       Value Representation 
  16167.       The snmp_dpi_hdr Structure 
  16168.  
  16169.  
  16170. ΓòÉΓòÉΓòÉ 11.5.8. The snmp_dpi_ureg_packet Structure ΓòÉΓòÉΓòÉ
  16171.  
  16172. Structure Definition 
  16173.  
  16174. struct dpi_ureg_packet {
  16175.   char                   reason_code;/* reason for unregister */
  16176.   char                  *group_p;    /* ptr to sub-tree(group)*/
  16177.   struct dpi_reg_packet *next_p;     /* ptr to next in chain  */
  16178. };
  16179. typedef struct dpi_ureg_packet       snmp_dpi_ureg_packet;
  16180. #define snmp_dpi_ureg_packet_NULL_p  ((snmp_dpi_ureg_packet *)0)
  16181.  
  16182. Structure Members 
  16183.  
  16184.  reason_code 
  16185.    The reason for the unregister. 
  16186.  
  16187.    See DPI UNREGISTER Reason Codes for a list of the currently defined reason 
  16188.    codes. 
  16189.  
  16190.  group_p 
  16191.    A pointer to a NULL terminated character string that represents the sub-tree 
  16192.    to be unregistered.  This sub-tree must have a trailing dot. 
  16193.  
  16194.  next_p 
  16195.    A pointer to a possible next snmp_dpi_ureg_packet structure.  If this next 
  16196.    field contains the NULL pointer, this is the end of the chain.  Currently we 
  16197.    do not support multiple unregister requests in one DPI packet, so this field 
  16198.    should always be zero. 
  16199.  
  16200.  Description 
  16201.  
  16202.  The snmp_dpi_ureg_packet structure represents a parse tree for a DPI 
  16203.  UNREGISTER request. 
  16204.  
  16205.  The snmp_dpi_ureg_packet structure is normally created as a result of a call 
  16206.  to pDPIpacket().  This is the case if the DPI packet is of type 
  16207.  SNMP_DPI_UNREGISTER.  The snmp_dpi_hdr structure then contains a pointer to a 
  16208.  snmp_dpi_ureg_packet structure. 
  16209.  
  16210.  The DPI programmer is advised to use the mkDPIunregister() function to create 
  16211.  a DPI UNREGISTER packet. 
  16212.  
  16213.  Related Information 
  16214.  
  16215.       The pDPIpacket() Function 
  16216.       The mkDPIunregister() Function 
  16217.       The snmp_dpi_hdr Structure 
  16218.  
  16219.  
  16220. ΓòÉΓòÉΓòÉ 11.5.9. The snmp_dpi_u64 Structure ΓòÉΓòÉΓòÉ
  16221.  
  16222. Structure Definition 
  16223.  
  16224. struct snmp_dpi_u64 {           /* for unsigned 64-bit int */
  16225.   unsigned long high;           /* - high order 32 bits    */
  16226.   unsigned long low;            /* - low order  32 bits    */
  16227. };
  16228. typedef struct snmp_dpi_u64     snmp_dpi_u64;
  16229.  
  16230. Note:  This structure is supported only in SNMP Version 2. 
  16231.  
  16232. Structure Members 
  16233.  
  16234.  high 
  16235.    The high order, most significant, 32 bits 
  16236.  
  16237.  low 
  16238.    The low order, least significant, 32 bits 
  16239.  
  16240.  Description 
  16241.  
  16242.  The snmp_dpi_u64 structure represents an unsigned 64-bit integer as need for 
  16243.  values with a type of SNMP_TYPE_Counter64. 
  16244.  
  16245.  The snmp_dpi_u64 structure may be created as a result of a call to 
  16246.  pDPIpacket().  This is the case if the DPI packet is of type SNMP_DPI_SET and 
  16247.  one of the values has a type of SNMP_TYPE_Counter64. The value_p pointer of 
  16248.  the snmp_dpi_set_packet structure will then point to an snmp_dpi_u64 
  16249.  structure. 
  16250.  
  16251.  The DPI programmer must also use an snmp_dpi_u64 structure as the parameter to 
  16252.  a mkDPIset() call if you want to create a value of type SNMP_TYPE_Counter64. 
  16253.  
  16254.  Related Information 
  16255.  
  16256.       The pDPIpacket() Function 
  16257.       The snmp_dpi_set_packet Structure 
  16258.       DPI SNMP Value Types 
  16259.       Value Representation 
  16260.  
  16261.  
  16262. ΓòÉΓòÉΓòÉ 11.6. Character Set Selection ΓòÉΓòÉΓòÉ
  16263.  
  16264. Based on the character set used on the platform where the agent and subagent 
  16265. are running, you will encounter one of the following three scenarios: 
  16266.  
  16267.      Both run on an ASCII based platform. 
  16268.  
  16269.       In reality a lot of platforms use the ASCII character set.  For those 
  16270.       platforms, just use the native character set.  In that case, the native 
  16271.       character set is ASCII. 
  16272.  
  16273.      Both run on the same non-ASCII based platform. 
  16274.  
  16275.       It is expected that the agent and the subagent normally run on the same 
  16276.       machine or at least on the same platform.  In that case, it is easiest to 
  16277.       use the native character set for data that is represented as strings.  If 
  16278.       such native character set is not the ASCII character set, the agent must 
  16279.       translate from ASCII to the native character set (and vice versa) as 
  16280.       needed. 
  16281.  
  16282.      One runs on ASCII based platform, the other on a non-ASCII based 
  16283.       platform. 
  16284.  
  16285.       If the agent and subagent each run on their own platform and those 
  16286.       platforms use different native character sets; for example, IBM OS/2 uses 
  16287.       ASCII and IBM MVS uses EBCDIC, you must select the ASCII character set, 
  16288.       so that you both know exactly how to represent string-based data that is 
  16289.       being send back and forth.  The entity that is not ASCII based must do 
  16290.       the translation from ASCII to the native character set (and vice versa) 
  16291.       as needed. 
  16292.  
  16293.  When the DPI subagent sends a DPI OPEN packet, it must specify the character 
  16294.  set that it wants to use.  The subagent here needs to know or determine in an 
  16295.  implementation dependent manner if the agent is running on a system with the 
  16296.  same character set as the subagent.  If you connect to the agent at loopback, 
  16297.  localhost, or your own machine, you might assume that you are using the same 
  16298.  character set.  As long as you are just using OS/2 on an Intel based 
  16299.  processor, it does not matter. Always use the native character set, which is 
  16300.  ASCII. 
  16301.  
  16302.  The subagent has two choices: 
  16303.  
  16304.  DPI_NATIVE_CSET       Specifies that you want to use the native character set 
  16305.                        of the platform on which the agent that you connect to 
  16306.                        is running. 
  16307.  
  16308.  DPI_ASCII_CSET        Specifies that you want to use the ASCII character set. 
  16309.                        The agent will translate between ASCII and the native 
  16310.                        character set as required. If the subagent is on a 
  16311.                        non-ASCII based platform, it may have to translate also. 
  16312.  
  16313.  The DPI packets have a number of fields that are represented as strings.  The 
  16314.  fields that must be represented in the selected character set are: 
  16315.  
  16316.      The null terminated string pointed to by the description_p, enterprise_p, 
  16317.       group_p, instance_p, and oid_p parameters in the various mkDPIxxxx(...) 
  16318.       functions. 
  16319.  
  16320.      The string pointed to by the value_p parameter in the mkDPIset(...) 
  16321.       function, that is if the value_type parameter specifies that the value is 
  16322.       an SNMP_TYPE_DisplayString or an SNMP_TYPE_OBJECT_IDENTIFIER. 
  16323.  
  16324.      The null terminated string pointed to by the description_p, enterprise_p, 
  16325.       group_p, instance_p, and oid_p pointers in the various 
  16326.       snmp_dpi_xxxx_packet structures. 
  16327.  
  16328.      The string pointed to by the value_p pointer in the snmp_dpi_set_packet 
  16329.       structure, that is if the value_type field specifies that the value is an 
  16330.       SNMP_TYPE_DisplayString or an SNMP_TYPE_OBJECT_IDENTIFIER. 
  16331.  
  16332.  Related Information 
  16333.  
  16334.       The mkDPIopen() Function 
  16335.  
  16336.  
  16337. ΓòÉΓòÉΓòÉ 11.7. Constants, Values, Return Codes, and Include File ΓòÉΓòÉΓòÉ
  16338.  
  16339. This section describes all the constants and names for values as they are 
  16340. defined in the snmp_dpi.h include file. 
  16341.  
  16342. Topics 
  16343.  
  16344.       DPI CLOSE Reason Codes 
  16345.       DPI Packet Types 
  16346.       DPI RESPONSE Error Codes 
  16347.       DPI UNREGISTER Reason Codes 
  16348.       DPI SNMP Value Types 
  16349.       Value Representation 
  16350.       Value Ranges and Limits 
  16351.       Return Codes from DPI Transport-Related Functions 
  16352.  
  16353.  
  16354. ΓòÉΓòÉΓòÉ 11.7.1. DPI CLOSE Reason Codes ΓòÉΓòÉΓòÉ
  16355.  
  16356. The currently defined DPI CLOSE reason codes as defined in the snmp_dpi.h 
  16357. include file are: 
  16358.  
  16359.   #define SNMP_CLOSE_otherReason                 1
  16360.   #define SNMP_CLOSE_goingDown                   2
  16361.   #define SNMP_CLOSE_unsupportedVersion          3
  16362.   #define SNMP_CLOSE_protocolError               4
  16363.   #define SNMP_CLOSE_authenticationFailure       5
  16364.   #define SNMP_CLOSE_byManager                   6
  16365.   #define SNMP_CLOSE_timeout                     7
  16366.   #define SNMP_CLOSE_openError                   8
  16367.  
  16368. These codes are used in the reason_code parameter for the mkDPIclose() function 
  16369. and in the reason_code field in the snmp_dpi_close_packet structure. 
  16370.  
  16371. Related Information 
  16372.  
  16373.       The snmp_dpi_close_packet Structure 
  16374.       The mkDPIclose() Function 
  16375.  
  16376.  
  16377. ΓòÉΓòÉΓòÉ 11.7.2. DPI Packet Types ΓòÉΓòÉΓòÉ
  16378.  
  16379. The currently defined DPI packet types as defined in the snmp_dpi.h include 
  16380. file are: 
  16381.  
  16382.   #define SNMP_DPI_GET             1
  16383.   #define SNMP_DPI_GET_NEXT        2  /* old DPI 1.x style */
  16384.   #define SNMP_DPI_GETNEXT         2
  16385.   #define SNMP_DPI_SET             3
  16386.   #define SNMP_DPI_TRAP            4
  16387.   #define SNMP_DPI_RESPONSE        5
  16388.   #define SNMP_DPI_REGISTER        6
  16389.   #define SNMP_DPI_UNREGISTER      7
  16390.   #define SNMP_DPI_OPEN            8
  16391.   #define SNMP_DPI_CLOSE           9
  16392.   #define SNMP_DPI_COMMIT         10
  16393.   #define SNMP_DPI_UNDO           11
  16394.   #define SNMP_DPI_GETBULK        12
  16395.   #define SNMP_DPI_TRAPV2         13  /* reserved, not ....    */
  16396.   #define SNMP_DPI_INFORM         14  /* reserved, implemented */
  16397.   #define SNMP_DPI_ARE_YOU_THERE  15
  16398.  
  16399. These packet types are used in the type parameter for the packet_type field in 
  16400. the snmp_dpi_hdr structure. 
  16401.  
  16402. Related Information 
  16403.  
  16404.       The snmp_dpi_hdr Structure 
  16405.  
  16406.  
  16407. ΓòÉΓòÉΓòÉ 11.7.3. DPI RESPONSE Error Codes ΓòÉΓòÉΓòÉ
  16408.  
  16409. In case of an error on an SNMP request like GET, GETNEXT, GETBULK, SET, COMMIT, 
  16410. or UNDO, the RESPONSE can have one of these currently defined error codes. 
  16411. They are defined in the snmp_dpi.h include file: 
  16412.  
  16413.   #define SNMP_ERROR_noError               0
  16414.   #define SNMP_ERROR_tooBig                1
  16415.   #define SNMP_ERROR_noSuchName            2
  16416.   #define SNMP_ERROR_badValue              3
  16417.   #define SNMP_ERROR_readOnly              4
  16418.   #define SNMP_ERROR_genErr                5
  16419.   #define SNMP_ERROR_noAccess              6
  16420.   #define SNMP_ERROR_wrongType             7
  16421.   #define SNMP_ERROR_wrongLength           8
  16422.   #define SNMP_ERROR_wrongEncoding         9
  16423.   #define SNMP_ERROR_wrongValue           10
  16424.   #define SNMP_ERROR_noCreation           11
  16425.   #define SNMP_ERROR_inconsistentValue    12
  16426.   #define SNMP_ERROR_resourceUnavailable  13
  16427.   #define SNMP_ERROR_commitFailed         14
  16428.   #define SNMP_ERROR_undoFailed           15
  16429.   #define SNMP_ERROR_authorizationError   16
  16430.   #define SNMP_ERROR_notWritable          17
  16431.   #define SNMP_ERROR_inconsistentName     18
  16432.  
  16433. In case of an error on a DPI only request (OPEN, REGISTER, UNREGISTER, 
  16434. ARE_YOU_THERE), the RESPONSE can have one of these currently defined error 
  16435. codes.  They are defined in the snmp_dpi.h include file: 
  16436.  
  16437.   #define SNMP_ERROR_DPI_noError                        0
  16438.   #define SNMP_ERROR_DPI_otherError                   101
  16439.   #define SNMP_ERROR_DPI_notFound                     102
  16440.   #define SNMP_ERROR_DPI_alreadyRegistered            103
  16441.   #define SNMP_ERROR_DPI_higherPriorityRegistered     104
  16442.   #define SNMP_ERROR_DPI_mustOpenFirst                105
  16443.   #define SNMP_ERROR_DPI_notAuthorized                106
  16444.   #define SNMP_ERROR_DPI_viewSelectionNotSupported    107
  16445.   #define SNMP_ERROR_DPI_getBulkSelectionNotSupported 108
  16446.   #define SNMP_ERROR_DPI_duplicateSubAgentIdentifier  109
  16447.   #define SNMP_ERROR_DPI_invalidDisplayString         110
  16448.   #define SNMP_ERROR_DPI_characterSetSelectionNotSupported  111
  16449.  
  16450. These codes are used in the error_code parameter for the mkDPIresponse() 
  16451. function and in the error_code field in the snmp_dpi_resp_packet structure. 
  16452.  
  16453. Related Information 
  16454.  
  16455.       The snmp_dpi_resp_packet Structure 
  16456.       The mkDPIresponse() Function 
  16457.  
  16458.  
  16459. ΓòÉΓòÉΓòÉ 11.7.4. DPI UNREGISTER Reason Codes ΓòÉΓòÉΓòÉ
  16460.  
  16461. These are the currently defined DPI UNREGISTER reason codes.  They are define 
  16462. in the snmp_dpi.h include file: 
  16463.  
  16464.   #define SNMP_UNREGISTER_otherReason               1
  16465.   #define SNMP_UNREGISTER_goingDown                 2
  16466.   #define SNMP_UNREGISTER_justUnregister            3
  16467.   #define SNMP_UNREGISTER_newRegistration           4
  16468.   #define SNMP_UNREGISTER_higherPriorityRegistered  5
  16469.   #define SNMP_UNREGISTER_byManager                 6
  16470.   #define SNMP_UNREGISTER_timeout                   7
  16471.  
  16472. These codes are used in the reason_code parameter for the mkDPIunregister() 
  16473. function and in the reason_code field in the snmp_dpi_ureg_packet structure. 
  16474.  
  16475. Related Information 
  16476.  
  16477.       The snmp_dpi_ureg_packet Structure 
  16478.       The mkDPIunregister() Function 
  16479.  
  16480.  
  16481. ΓòÉΓòÉΓòÉ 11.7.5. DPI SNMP Value Types ΓòÉΓòÉΓòÉ
  16482.  
  16483. These are the currently defined value types as defined in the snmp_dpi.h 
  16484. include file: 
  16485.  
  16486. #define SNMP_TYPE_MASK           0x7f  /* mask to isolate type*/
  16487. #define SNMP_TYPE_Integer32    (128|1) /* 32-bit INTEGER      */
  16488. #define SNMP_TYPE_OCTET_STRING      2  /* OCTET STRING        */
  16489. #define SNMP_TYPE_OBJECT_IDENTIFIER 3  /* OBJECT IDENTIFIER   */
  16490. #define SNMP_TYPE_NULL              4  /* NULL, no value      */
  16491. #define SNMP_TYPE_IpAddress         5  /* IMPLICIT OCTETSTRING*/
  16492. #define SNMP_TYPE_Counter32    (128|6) /* 32-bit Counter      */
  16493. #define SNMP_TYPE_Gauge32      (128|7) /* 32-bit Gauge        */
  16494. #define SNMP_TYPE_TimeTicks    (128|8) /* 32-bit TimeTicks in */
  16495.                                        /* hundredths of a sec */
  16496. #define SNMP_TYPE_DisplayString     9  /* DisplayString (TC)  */
  16497. #define SNMP_TYPE_BIT_STRING       10  /* BIT STRING          */
  16498. #define SNMP_TYPE_NsapAddress      11  /* IMPLICIT OCTETSTRING*/
  16499. #define SNMP_TYPE_UInteger32  (128|12) /* 32-bit INTEGER      */
  16500. #define SNMP_TYPE_Counter64        13  /* 64-bit Counter      */
  16501. #define SNMP_TYPE_Opaque           14  /* IMPLICIT OCTETSTRING*/
  16502. #define SNMP_TYPE_noSuchObject     15  /* IMPLICIT NULL       */
  16503. #define SNMP_TYPE_noSuchInstance   16  /* IMPLICIT NULL       */
  16504. #define SNMP_TYPE_endOfMibView     17  /* IMPLICIT NULL       */
  16505.  
  16506. These value types are used in the value_type parameter for the mkDPIset() 
  16507. function and in the value_type field in the snmp_dpi_set_packet structure. 
  16508.  
  16509. Related Information 
  16510.  
  16511.       The snmp_dpi_set_packet Structure 
  16512.       The mkDPIset() Function 
  16513.       Value Representation 
  16514.       Value Ranges and Limits 
  16515.  
  16516.  
  16517. ΓòÉΓòÉΓòÉ 11.7.6. Value Representation ΓòÉΓòÉΓòÉ
  16518.  
  16519. Values in the snmp_dpi_set_packet structure are represented as follows: 
  16520.  
  16521.      32-bit integers are defined as long int or unsigned long int.  We assume 
  16522.       that a long int is 4 bytes. 
  16523.  
  16524.      64-bit integers are represented as an snmp_dpi_u64. 
  16525.  
  16526.       We only deal with unsigned 64 bit integers in SNMP.  In a structure that 
  16527.       has two fields, the high order piece and the low order piece, each is of 
  16528.       type unsigned long int.  We assume these are 4-bytes. 
  16529.  
  16530.      Object Identifiers are NULL terminated strings in the selected character 
  16531.       set, representing the OID in ASN.1 dotted notation.  The length includes 
  16532.       the terminating NULL. 
  16533.  
  16534.       An ASCII example: 
  16535.  
  16536.             '312e332e362e312e322e312e312e312e3000'h
  16537.  
  16538.       represents "1.3.6.1.2.1.1.1.0" which is sysDescr.0. 
  16539.  
  16540.       An EBCDIC example: 
  16541.  
  16542.             'f14bf34bf64bf14bf24bf14bf14bf14bf000'h
  16543.  
  16544.       represents "1.3.6.1.2.1.1.1.0" which is sysDescr.0. 
  16545.  
  16546.      DisplayStrings are in the selected character set.  The length specifies 
  16547.       the length of the string. 
  16548.  
  16549.       An ASCII example: 
  16550.  
  16551.             '6162630d0a'h
  16552.  
  16553.       represents "abc\r\n", no NULL. 
  16554.  
  16555.       An EBCDIC example: 
  16556.  
  16557.             '8182830d25'h
  16558.  
  16559.       represents "abc\r\n", no NULL. 
  16560.  
  16561.      IpAddress, NsapAddress, and Opaque are implicit OCTET_STRING, so they are 
  16562.       a sequence of octets/bytes.  This means, for instance, that the IP 
  16563.       address is in network byte order. 
  16564.  
  16565.      NULL has a zero length for the value, no value data, so a NULL pointer in 
  16566.       the value_p field. 
  16567.  
  16568.      noSuchObject, noSuchInstance, and endOfMibView are implicit NULL and 
  16569.       represented as such. 
  16570.  
  16571.      BIT_STRING is an OCTET_STRING of the form uubbbb...bb, where the first 
  16572.       octet (uu) is 0x00-0x07 and indicates the number of unused bits in the 
  16573.       last octet (bb).  The bb octets represent the bit string itself, where 
  16574.       bit zero (0) comes first and so on. 
  16575.  
  16576.  Related Information 
  16577.  
  16578.       Value Ranges and Limits 
  16579.  
  16580.  
  16581. ΓòÉΓòÉΓòÉ 11.7.7. Value Ranges and Limits ΓòÉΓòÉΓòÉ
  16582.  
  16583. The following rules apply to object IDs in ASN.1 notation: 
  16584.  
  16585.      The object ID consists of 1 to 128 subIDs, which are separated by dots. 
  16586.  
  16587.      Each subID is a positive number.  No negative numbers are allowed. 
  16588.  
  16589.      The value of each number cannot exceed 4294967295 (4,294,967,295). This 
  16590.       value is 2 to the power of 32 minus 1. 
  16591.  
  16592.      The valid values of the first subID are: 0, 1, or 2. 
  16593.  
  16594.      If the first subID has a value of 0 or 1, the second subID can only have 
  16595.       a value of 0 through 39. 
  16596.  
  16597.  The following rules apply to DisplayString: 
  16598.  
  16599.      A DisplayString (Textual Convention) is basically an OCTET STRING in SNMP 
  16600.       terms. 
  16601.  
  16602.      The maximum size of a DisplayString is 255 octets/bytes. 
  16603.  
  16604.      The octets of a DisplayString must belong to the ASCII NVT character set. 
  16605.       This character set is not precisely defined, but commonly accepted to 
  16606.       consist of all ASCII characters with a value in the range of 0-127 
  16607.       inclusive. 
  16608.  
  16609.       A further limitation is that the CR (hex 13) must always be followed by 
  16610.       either a LF (hex 0A) or a  NUL (hex 00). 
  16611.  
  16612.  More information on the DPI SNMP value types can be found in the SNMP SMI 
  16613.  (Structure of Management Information) and SNMP TC (Textual Conventions) RFCs. 
  16614.  At the time of this publication, these two RFCs are RFC1442 and RFC1443. 
  16615.  
  16616.  
  16617. ΓòÉΓòÉΓòÉ 11.7.8. Return Codes from DPI Transport-Related Functions ΓòÉΓòÉΓòÉ
  16618.  
  16619. These are the currently defined values for the return codes from DPI 
  16620. transport-related functions.  They are defined in the snmp_dpi.h include file: 
  16621.  
  16622. #define DPI_RC_OK                0 /* all OK, no error         */
  16623. #define DPI_RC_NOK              -1 /* some other error         */
  16624. #define DPI_RC_NO_PORT          -2 /* can't determine DPIport  */
  16625. #define DPI_RC_NO_CONNECTION    -3 /* no connection to DPIagent*/
  16626. #define DPI_RC_EOF              -4 /* EOF receivd on connection*/
  16627. #define DPI_RC_IO_ERROR         -5 /* Some I/O error on connect*/
  16628. #define DPI_RC_INVALID_HANDLE   -6 /* unknown/invalid handle   */
  16629. #define DPI_RC_TIMEOUT          -7 /* timeout occurred         */
  16630. #define DPI_RC_PACKET_TOO_LARGE -8 /* packed too large, dropped*/
  16631.  
  16632. These values are used as return codes for the transport-related DPI functions. 
  16633.  
  16634. Related Information 
  16635.  
  16636.       The DPIconnect_to_agent_TCP() Function 
  16637.       The DPIconnect_to_agent_SHM() Function 
  16638.       The DPIawait_packet_from_agent() Function 
  16639.       The DPIsend_packet_to_agent() Function 
  16640.  
  16641.  
  16642. ΓòÉΓòÉΓòÉ 11.7.9. The snmp_dpi.h Include File ΓòÉΓòÉΓòÉ
  16643.  
  16644. Syntax 
  16645.  
  16646. #include <snmp_dpi.h>
  16647.  
  16648. Parameters 
  16649.  
  16650.    None. 
  16651.  
  16652.  Description 
  16653.  
  16654.  The snmp_dpi.h include file defines the SNMP DPI API to the DPI subagent 
  16655.  programmer.  It has all the function proto-type statements, and it also has 
  16656.  the definitions for the snmp_dpi structures. 
  16657.  
  16658.  The same include file is used at the agent side, so you will see some 
  16659.  definitions which are unique to the agent side.  Also there may be other 
  16660.  functions or prototypes of functions not implemented on OS/2. Therefore, you 
  16661.  should only use the API as far as it is documented in this information. 
  16662.  
  16663.  Related Information 
  16664.  
  16665.  Macros, functions, structures, constants and values defined in the snmp_dpi.h 
  16666.  include file are: 
  16667.  
  16668.       The DPIawait_packet_from_agent() Function 
  16669.       The DPIconnect_to_agent_TCP() Function 
  16670.       The DPIdebug() Function 
  16671.       The DPIdisconnect_from_agent() Function 
  16672.       The DPI_PACKET_LEN() Macro 
  16673.       The DPIsend_packet_to_agent() Function 
  16674.       The fDPIparse() Function 
  16675.       The fDPIset() Function 
  16676.       The mkDPIAreYouThere() Function 
  16677.       The mkDPIclose() Function 
  16678.       The mkDPIopen() Function 
  16679.       The mkDPIregister() Function 
  16680.       The mkDPIresponse() Function 
  16681.       The mkDPIset() Function 
  16682.       The mkDPItrap() Function 
  16683.       The mkDPIunregister() Function 
  16684.       The pDPIpacket() Function 
  16685.       The snmp_dpi_close_packet Structure 
  16686.       The snmp_dpi_get_packet Structure 
  16687.       The snmp_dpi_next_packet Structure 
  16688.       The snmp_dpi_bulk_packet Structure 
  16689.       The snmp_dpi_hdr Structure 
  16690.       The lookup_host() Function 
  16691.       The query_DPI_port() Function 
  16692.       The snmp_dpi_resp_packet Structure 
  16693.       The snmp_dpi_set_packet Structure 
  16694.       The snmp_dpi_ureg_packet Structure 
  16695.       DPI CLOSE Reason Codes 
  16696.       DPI Packet Types 
  16697.       DPI RESPONSE Error Codes 
  16698.       DPI UNREGISTER Reason Codes 
  16699.       DPI SNMP Value Types 
  16700.       Character Set Selection 
  16701.  
  16702.  
  16703. ΓòÉΓòÉΓòÉ 11.8. SNMP DPI API Version 1.1 Considerations ΓòÉΓòÉΓòÉ
  16704.  
  16705. The information presented in this section must be taken as guidelines and not 
  16706. exact procedures.  Your specific implementation will vary from the guidelines 
  16707. presented. 
  16708.  
  16709. You can keep your existing DPI 1.1 subagent and communicate with a DPI capable 
  16710. agent that supports DPI 1.1 in addition to DPI 2.0.  For example, the OS/2 
  16711. agent for TCP/IP provides support for multiple versions of DPI, namely Version 
  16712. 1.0, Version 1.1 and Version 2.0. 
  16713.  
  16714. Normally you would compile your DPI 1.1 subagent with the DPI 1.1 
  16715. <dpi\snmp_dpi.h> include file and link-edit it with the provided DPI 1.1 level 
  16716. DPI32DLL.LIB.  At run time, you then need access to the DPI32DLL.DLL.  You can 
  16717. continue to do this until you are ready to migrate to DPI Version 2.0. 
  16718.  
  16719. In the snmp_dpi.h include file for DPI 2.0, you may find references to DPI 1.1 
  16720. compatibility mode under control of compiler flags, such as: 
  16721.  
  16722.    /DSNMP_DPI_VERSION=1 /DSNMP_DPI_RELEASE=0
  16723.    /DSNMP_DPI_VERSION=1 /DSNMP_DPI_RELEASE=1
  16724.  
  16725. However, this compatibility mode is not provided with the TCP/IP product for 
  16726. OS/2.  If you want to convert to DPI 2.0, which prepares you also for SNMP 
  16727. Version 2, you must make changes to your code. 
  16728.  
  16729. Name Changes 
  16730.  
  16731. A number of field names in the snmp_dpi_xxxx_packet structures have changed so 
  16732. that the names are now more consistent throughout the DPI code. 
  16733.  
  16734. The new names indicate if the value is a pointer (_p) or a union (_u).  The 
  16735. names that have changed and that affect the subagent code are listed in the 
  16736. table below. 
  16737.  
  16738. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16739. ΓöéOld Name      ΓöéNew Name      ΓöéData Structure(XXXX)   Γöé
  16740. Γöé              Γöé              Γöé                       Γöé
  16741. Γöégroup_id      Γöégroup_p       Γöégetnext                Γöé
  16742. Γöé              Γöé              Γöé                       Γöé
  16743. Γöéobject_id     Γöéobject_p      Γöéget, getnext, set      Γöé
  16744. Γöé              Γöé              Γöé                       Γöé
  16745. Γöévalue         Γöévalue_p       Γöéset                    Γöé
  16746. Γöé              Γöé              Γöé                       Γöé
  16747. Γöétype          Γöévalue_type    Γöéset                    Γöé
  16748. Γöé              Γöé              Γöé                       Γöé
  16749. Γöénext          Γöénext_p        Γöéset                    Γöé
  16750. Γöé              Γöé              Γöé                       Γöé
  16751. Γöéenterprise    Γöéenterprise_p  Γöétrap                   Γöé
  16752. Γöé              Γöé              Γöé                       Γöé
  16753. Γöépacket_body   Γöédata_u        Γöédpi_hdr                Γöé
  16754. Γöé              Γöé              Γöé                       Γöé
  16755. Γöédpi_get       Γöéget_p         Γöéhdr (packet_body)      Γöé
  16756. Γöé              Γöé              Γöé                       Γöé
  16757. Γöédpi_getnext   Γöénext_p        Γöéhdr (packet_body)      Γöé
  16758. Γöé              Γöé              Γöé                       Γöé
  16759. Γöédpi_set       Γöéset_p         Γöéhdr (packet_body)      Γöé
  16760. Γöé              Γöé              Γöé                       Γöé
  16761. Γöédpi_trap      Γöétrap_p        Γöéhdr (packet_body)      Γöé
  16762. Γöé              Γöé              Γöé                       Γöé
  16763. Γöé              Γöé              Γöé                       Γöé
  16764. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16765.  
  16766. There is no clean approach to make this change transparent.  You probably will 
  16767. have to change the names in your code.  You may want to try a simple set of 
  16768. defines like: 
  16769.  
  16770. #define packet_body      data_u
  16771. #define dpi_get          get_p
  16772. #define dpi_set          set_p
  16773. #define dpi_next         next_p
  16774. #define dpi_response     resp_p
  16775. #define dpi_trap         trap_p
  16776. #define group_id         group_p
  16777. #define object_id        object_p
  16778. #define value            value_p
  16779. #define type             value_type
  16780. #define next             next_p
  16781. #define enterprise       enterprise_p
  16782.  
  16783. However, the names may conflict with other definitions that you have, in which 
  16784. case you must change your code. 
  16785.  
  16786. Related Information 
  16787.  
  16788.       Migrating Your SNMP DPI Subagent to Version 2.0 
  16789.  
  16790.  
  16791. ΓòÉΓòÉΓòÉ 11.9. Migrating Your SNMP DPI Subagent to Version 2.0 ΓòÉΓòÉΓòÉ
  16792.  
  16793. The information presented in this section must be taken as guidelines and not 
  16794. exact procedures.  Your specific implementation will vary from the guidelines 
  16795. presented. 
  16796.  
  16797. When you want to change your DPI 1.x based subagent code to the DPI Version 2.0 
  16798. level use these guidelines for the required actions and the recommended 
  16799. actions. 
  16800.  
  16801. Required Actions 
  16802.  
  16803.      Add a mkDPIopen() call and send the created packet to the agent. This 
  16804.       opens your "DPI connection" with the agent.  Wait for the response and 
  16805.       ensure that the open is accepted.  You need to pass a subagent ID (Object 
  16806.       Identifier) which must be a unique ASN.1 OID. 
  16807.  
  16808.       See The mkDPIopen() Function for more information. 
  16809.  
  16810.      Change your mkDPIregister() calls and pass the parameters according to 
  16811.       the new function prototype.  You must also expect a RESPONSE to the 
  16812.       REGISTER request. 
  16813.  
  16814.       See The mkDPIregister() Function for more information. 
  16815.  
  16816.      Change mkDPIset() and/or mkDPIlist() calls to the new mkDPIset() call. 
  16817.       Basically all mkDPIset() calls are now of the DPI 1.1 mkDPIlist() form. 
  16818.  
  16819.       See The mkDPIset() Function for more information. 
  16820.  
  16821.      Change mkDPItrap() and mkDPItrape() calls to the new mkDPItrap() call. 
  16822.       Basically all mkDPItrap() calls are now of the DPI 1.1 mkDPItrape() form. 
  16823.  
  16824.       See The mkDPItrap() Function for more information. 
  16825.  
  16826.      Add code to recognize DPI RESPONSE packets, which should be expected as a 
  16827.       result of OPEN, REGISTER, UNREGISTER requests. 
  16828.  
  16829.      Add code to expect and handle the DPI UNREGISTER packet from the agent. 
  16830.       It may send such packets if an error occurs or if a higher priority 
  16831.       subagent registers the same sub-tree as you have registered. 
  16832.  
  16833.      Add code to unregister your sub-tree(s) and close the "DPI connection" 
  16834.       when you want to terminate the subagent. 
  16835.  
  16836.       See The mkDPIunregister() Function and The mkDPIclose() Function for more 
  16837.       information. 
  16838.  
  16839.      Change your code to use the new SNMP Version 2 error codes as defined in 
  16840.       the snmp_dpi.h include file. 
  16841.  
  16842.      Change your code that handles a GET request.  It should return a varBind 
  16843.       with SNMP_TYPE_noSuchObject value or SNMP_TYPE_noSuchInstance value 
  16844.       instead of an error SNMP_ERROR_noSuchName if the object or the instance 
  16845.       do not exist.  This is not considered an error any more. Therefore, you 
  16846.       should return an SNMP_ERROR_noError with an error index of zero. 
  16847.  
  16848.      Change your code that handles a GETNEXT request.  It should return a 
  16849.       varBind with SNMP_TYPE_endOfMibView value instead of an error 
  16850.       SNMP_ERROR_noSuchName if you reach the end of your MIB or sub-tree. This 
  16851.       is not considered an error any more.  Therefore, you should return an 
  16852.       SNMP_ERROR_noError with an error index of zero. 
  16853.  
  16854.      Change your code that handles SET requests to follow the two phase 
  16855.       SET/COMMIT scheme as described in SET Processing. 
  16856.  
  16857.       See the sample handling of SET/COMMIT/UNDO in Processing a 
  16858.       SET/COMMIT/UNDO Request. 
  16859.  
  16860.  Recommended Actions 
  16861.  
  16862.      Do not reference the object ID pointer (object_p) in the 
  16863.       snmp_dpi_xxxx_packet structures anymore.  Instead start using the group_p 
  16864.       and instance_p pointers.  The object_p pointer may be removed in a future 
  16865.       version of the DPI API. 
  16866.  
  16867.      Check Transport-Related DPI API Functions to see if you want to use those 
  16868.       functions instead of using your own code for those functions. 
  16869.  
  16870.      Consider using more than 1 varBind per DPI packet.  You can specify this 
  16871.       on the REGISTER request.  You must then be prepared to handle multiple 
  16872.       varBinds per DPI packet.  The varBinds are chained via the various 
  16873.       snmp_dpi_xxxx_packet structures. 
  16874.  
  16875.       See The mkDPIregister() Function for more information. 
  16876.  
  16877.      Consider specifying a time out when you issue a DPI OPEN or DPI REGISTER. 
  16878.  
  16879.       See The mkDPIopen() Function and The mkDPIregister() Function for more 
  16880.       information. 
  16881.  
  16882.  
  16883. ΓòÉΓòÉΓòÉ 11.10. A DPI Subagent Example ΓòÉΓòÉΓòÉ
  16884.  
  16885. This is an example of a DPI subagent.  The code is in the "dpi_samp.c" file. 
  16886.  
  16887. Note:  The example code presented here was copied from the sample file at the 
  16888. time of the publication.  For the most up-to-date example code, please see the 
  16889. \TCPIP\SAMPLES\DPI20 directory.  There may be differences in the code presented 
  16890. and the code that is shipped with the product.  Always use the code provided in 
  16891. the \TCPIP\SAMPLES\DPI20 directory as the authoritative sample code. 
  16892.  
  16893. Topics 
  16894.  
  16895.       Overview of Subagent Processing 
  16896.       Connecting to the Agent 
  16897.       Registering a Sub-Tree with the Agent 
  16898.       Processing Requests from the Agent 
  16899.       Processing a GET Request 
  16900.       Processing a GETNEXT Request 
  16901.       Processing a SET/COMMIT/UNDO Request 
  16902.       Processing an UNREGISTER Request 
  16903.       Processing an CLOSE Request 
  16904.       Generating a TRAP 
  16905.  
  16906.  Related Information 
  16907.  
  16908.       Subagent Programming Concepts 
  16909.  
  16910.  
  16911. ΓòÉΓòÉΓòÉ 11.10.1. Overview of Subagent Processing ΓòÉΓòÉΓòÉ
  16912.  
  16913. This overview assumes that the subagent communicates with the agent over a TCP 
  16914. connection.  Other connection implementations are possible and, in that case, 
  16915. the processing approach may be a bit different. 
  16916.  
  16917. We also take a simplistic approach in the sense that we will request the agent 
  16918. to send us at most one varBind per DPI packet, so we do not need to loop 
  16919. through a list of varBinds.  Potentially, you may gain performance improvements 
  16920. if you allow for multiple varBinds per DPI packet on GET, GETNEXT, SET 
  16921. requests, but to do so, your code will have to loop through the varBind list 
  16922. and so it becomes somewhat more complicated.  We assume that the DPI subagent 
  16923. programmer can handle that once you understand the basics of the DPI API. 
  16924.  
  16925. Here is the dpiSimple MIB definition as it is implemented by the sample code, 
  16926. which follows: 
  16927.  
  16928. DPISimple-MIB DEFINITIONS ::= BEGIN
  16929.  
  16930.    IMPORTS
  16931.         MODULE-IDENTITY, OBJECT-TYPE, snmpModules, enterprises
  16932.                    FROM SNMPv2-SMI
  16933.         DisplayString
  16934.                    FROM SNMPv2-TC
  16935.  
  16936.    ibm      OBJECT IDENTIFIER ::= { enterprises 2 }
  16937.    ibmDPI   OBJECT IDENTIFIER ::= { ibm 2 }
  16938.    dpi20MIB OBJECT IDENTIFIER ::= { ibmDPI 1 }
  16939.  
  16940.  
  16941.    dpiSimpleMIB OBJECT IDENTIFIER ::= { dpi20MIB 5 }
  16942.  
  16943.    dpiSimpleInteger         OBJECT-TYPE
  16944.         SYNTAX  INTEGER
  16945.         ACCESS  read-only
  16946.         STATUS  mandatory
  16947.         DESCRIPTION
  16948.             "A sample integer32 value"
  16949.         ::= { dpiSimpleMIB 1 }
  16950.  
  16951.    dpiSimpleString          OBJECT-TYPE
  16952.         SYNTAX  DisplayString
  16953.         ACCESS  read-write
  16954.         STATUS  mandatory
  16955.         DESCRIPTION
  16956.             "A sample Display String"
  16957.         ::= { dpiSimpleMIB 2 }
  16958.  
  16959.    dpiSimpleCounter32       OBJECT-TYPE
  16960.         SYNTAX  Counter     -- Counter32 is SNMPv2
  16961.         ACCESS  read-only
  16962.         STATUS  mandatory
  16963.         DESCRIPTION
  16964.             "A sample 32-bit counter"
  16965.         ::= { dpiSimpleMIB 3 }
  16966.  
  16967.    dpiSimpleCounter64       OBJECT-TYPE
  16968.         SYNTAX  Counter64   -- Counter64 is SNMPv2,
  16969.                             -- Not supported by SNMPv1 agents
  16970.         ACCESS  read-only
  16971.         STATUS  mandatory
  16972.         DESCRIPTION
  16973.             "A sample 64-bit counter"
  16974.         ::= { dpiSimpleMIB 4 }
  16975. END
  16976.  
  16977. To make the code more readable, we have defined the following names in our 
  16978. dpi_samp.c source file. 
  16979.  
  16980. #define DPI_SIMPLE_SUBAGENT   "1.3.6.1.4.1.2.2.1.5"
  16981. #define DPI_SIMPLE_MIB        "1.3.6.1.4.1.2.2.1.5."
  16982. #define DPI_SIMPLE_INTEGER    "1.0"  /* dpiSimpleInteger.0   */
  16983. #define DPI_SIMPLE_STRING     "2.0"  /* dpiSimpleString.0    */
  16984. #define DPI_SIMPLE_COUNTER32  "3.0"  /* dpiSimpleCounter32.0 */
  16985. #define DPI_SIMPLE_COUNTER64  "4.0"  /* dpiSimpleCounter64.0 */
  16986.  
  16987. In addition, we have defined the following variables as global variable in our 
  16988. dpi_samp.c source file. 
  16989.  
  16990. static int handle;                        /* handle has global scope */
  16991. static long int      value1      = 5;
  16992. #define              value2_p      cur_val_p   /* writable object    */
  16993. #define              value2_len    cur_val_len /* writable object    */
  16994. static char         *cur_val_p   = (char *)0;
  16995. static char         *new_val_p   = (char *)0;
  16996. static char         *old_val_p   = (char *)0;
  16997. static unsigned long cur_val_len = 0;
  16998. static unsigned long new_val_len = 0;
  16999. static unsigned long old_val_len = 0;
  17000. static unsigned long value3      = 1;
  17001. static snmp_dpi_u64  value4      = {0x80000000,1L};
  17002.  
  17003.  
  17004. ΓòÉΓòÉΓòÉ 11.10.2. Connecting to the Agent ΓòÉΓòÉΓòÉ
  17005.  
  17006. Before a subagent can receive or send any DPI packets from/to the SNMP DPI 
  17007. capable agent, it must "connect" to the agent and identify itself to the agent. 
  17008.  
  17009. The following example code returns a response.  We assume that there are no 
  17010. errors in the request, but proper code should do the checking for that.  We do 
  17011. proper checking for lexicographic next object, but we do no checking for 
  17012. ULONG_MAX, or making sure that the instance ID is indeed valid (digits and 
  17013. dots).  If we get to the end of our dpiSimpleMIB, we must return an 
  17014. endOfMibView as defined by the SNMP Version 2 rules. 
  17015.  
  17016.      A host name or IP address in dot notation that specifies where the agent 
  17017.       is running.  Often the name "loopback" or "localhost" can be used if the 
  17018.       subagent runs on the same system as the agent. 
  17019.  
  17020.      A community name which is used to obtain the DPI TCP port from the agent. 
  17021.       Internally that is done by sending a regular SNMP GET request to the 
  17022.       agent.  In an open environment, we probably can use the well know 
  17023.       community name "public". 
  17024.  
  17025.  The function returns a negative error code if an error occurs.  If the 
  17026.  connection setup is successful, it returns a handle which represents the 
  17027.  connection and which we must use on subsequent calls to send or await DPI 
  17028.  packets. 
  17029.  
  17030.  The second step is to identify the subagent to the agent.  This is done by 
  17031.  making a DPI-OPEN packet, sending it to the agent, and then awaiting the 
  17032.  response from the agent.  The agent may accept or deny the OPEN request. 
  17033.  Making a DPI-OPEN packet is done by calling mkDPIopen() which expects the 
  17034.  following parameters: 
  17035.  
  17036.      A unique subagent identification (an Object Identifier). 
  17037.  
  17038.      A description which can be the NULL string (""). 
  17039.  
  17040.      Overall subagent timeout in seconds.  The agent uses this value as a 
  17041.       timeout value for a response when it sends a request to the subagent. 
  17042.       The agent may have a maximum value for this timeout that will be used if 
  17043.       you exceed it. 
  17044.  
  17045.      The maximum number of varBinds per DPI packet that the subagent is 
  17046.       willing or is able to handle. 
  17047.  
  17048.      The character set we want to use.  In most cases you want to use the 
  17049.       native character set. 
  17050.  
  17051.      Length of a password.  A zero means no password. 
  17052.  
  17053.      Pointer to the password or NULL if no password.  It depends on the agent 
  17054.       if subagents must specify a password to open up a connection. 
  17055.  
  17056.  The function returns a pointer to a static buffer holding the DPI packet if 
  17057.  successful.  If it fails, it returns a NULL pointer. 
  17058.  
  17059.  Once the DPI-OPEN packet has been created, you must send it to the agent.  You 
  17060.  can use the DPIsend_packet_to_agent() function which expects the following 
  17061.  parameters: 
  17062.  
  17063.      The handle of a connection from DPIconnect_to_agent_TCP. 
  17064.  
  17065.      A pointer to the DPI packet from mkDPIopen. 
  17066.  
  17067.      The length of the packet.  The snmp_dpi.h include file provides a macro 
  17068.       DPI_PACKET_LEN that calculates the packet length of a DPI packet. 
  17069.  
  17070.  This function returns DPI_RC_OK (value zero) if successful. Otherwise, an 
  17071.  appropriate DPI_RC_xxxx error code as defined in snmp_dpi.h is returned. 
  17072.  
  17073.  Now we must wait for a response to the DPI-OPEN.  To await such a response, 
  17074.  you call the DPIawait_packet_from_agent() function which expects the following 
  17075.  parameters: 
  17076.  
  17077.      The handle of a connection from DPIconnect_to_agent_TCP. 
  17078.  
  17079.      A timeout in seconds, which is the maximum time to wait for response. 
  17080.  
  17081.      A pointer to a pointer, which will receive a pointer to a static buffer 
  17082.       containing the awaited DPI packet.  If the system fails to receive a 
  17083.       packet, a NULL pointer is stored. 
  17084.  
  17085.      A pointer to a long integer (32-bit), which will receive the length of 
  17086.       the awaited packet.  If it fails, it will be set to zero. 
  17087.  
  17088.  This function returns DPI_RC_OK (value zero) if successful. Otherwise, an 
  17089.  appropriate DPI_RC_xxxx error code as defined in snmp_dpi.h is returned. 
  17090.  
  17091.  The last step is to ensure that we received a DPI-RESPONSE back from the 
  17092.  agent.  If we did, then we must ensure that the agent accepted us as a valid 
  17093.  subagent.  This will be shown by the error_code field in the DPI response 
  17094.  packet. 
  17095.  
  17096.  The following example code establishes a connection and "opens" it by 
  17097.  identifying yourself to the agent. 
  17098.  
  17099.   #include <snmp_dpi.h>              /* DPI 2.0 API definitions */
  17100.   static int handle;                 /* handle has global scope */
  17101.  
  17102.   static void do_connect_and_open(char *hostname_p, char *community_p) {
  17103.          unsigned char *packet_p;
  17104.          int            rc;
  17105.          unsigned long  length;
  17106.          snmp_dpi_hdr  *hdr_p;
  17107.          if (shared_mem) {           /* if shared memory wanted */
  17108.             handle =                 /* then (SHM) connect to   */
  17109.                DPIconnect_to_agent_SHM(1);
  17110.                                      /* always use 1 as queueID */
  17111.          } else {
  17112.             handle =
  17113.                   DPIconnect_to_agent_TCP(
  17114.                                      /* (TCP) connect to agent  */
  17115.                      hostname_p,     /* on this host            */
  17116.                      community_p);   /* snmp community name     */
  17117.          } /* endif */
  17118.          if (handle < 0) exit(1);    /* If it failed, exit      */
  17119.          packet_p = mkDPIopen(       /* Make DPI-OPEN packet    */
  17120.                       DPI_SIMPLE_SUBAGENT,
  17121.                                      /* Our identification      */
  17122.                      "Simple DPI subAgent",
  17123.                                      /* description             */
  17124.                       10L,           /* Our overall timeout     */
  17125.                       1L,            /* max varBinds/packet     */
  17126.                       DPI_NATIVE_CSET,
  17127.                                      /* native character set    */
  17128.                       0L,            /* password length         */
  17129.                       (unsigned char *)0);
  17130.                                      /* ptr to password         */
  17131.  
  17132.          if (!packet_p) exit(1);     /* If it failed, exit      */
  17133.          rc  = DPIsend_packet_to_agent(
  17134.                                      /* send OPEN packet        */
  17135.                   handle,            /* on this connection      */
  17136.                   packet_p,          /* this is the packet      */
  17137.                   DPI_PACKET_LEN(packet_p));
  17138.                                      /* and this is its length  */
  17139.          if (rc != DPI_RC_OK) exit(1);
  17140.                                      /* If it failed, exit      */
  17141.          rc  = DPIawait_packet_from_agent(
  17142.                                      /* wait for response       */
  17143.                   handle,            /* on this connection      */
  17144.                   10,                /* timeout in seconds      */
  17145.                   &packet_p,         /* receives ptr to packet  */
  17146.                   &length);          /* receives packet length  */
  17147.          if (rc != DPI_RC_OK) exit(1);
  17148.                                      /* If it failed, exit      */
  17149.          hdr_p = pDPIpacket(packet_p);
  17150.                                      /* parse DPI packet        */
  17151.          if (hdr_p == snmp_dpi_hdr_NULL_p)
  17152.                                      /* If we fail to parse it  */
  17153.             exit(1);                 /* then exit               */
  17154.          if (hdr_p->packet_type != SNMP_DPI_RESPONSE) exit(1);
  17155.          rc = hdr_p->data_u.
  17156.   resp_p->error_code;
  17157.          if (rc != SNMP_ERROR_DPI_noError) exit(1); }
  17158.   /* end of do_connect_and_open() */
  17159.  
  17160.  
  17161. ΓòÉΓòÉΓòÉ 11.10.3. Registering a Sub-Tree with the Agent ΓòÉΓòÉΓòÉ
  17162.  
  17163. After we have set up a connection to the agent and after we have identified 
  17164. ourselves, we must register one or more MIB sub-trees for which we want to be 
  17165. responsible to handle all SNMP requests. 
  17166.  
  17167. To do so, the subagent must create a DPI-REGISTER packet and send it to the 
  17168. agent.  The agent will then send a response to indicate success or failure of 
  17169. the register request. 
  17170.  
  17171. To create a DPI-REGISTER packet, the subagent uses a call to the 
  17172. mkDPIregister() function, which expects these parameters: 
  17173.  
  17174.      A timeout value in seconds for this sub-tree.  If you specify zero, your 
  17175.       overall timeout value that was specified in DPI-OPEN is used.  You can 
  17176.       specify a different value if you expect longer processing time for a 
  17177.       specific sub-tree. 
  17178.  
  17179.      A requested priority.  Multiple subagents may register the same sub-tree 
  17180.       at different priorities.  For example, 0 is better than 1 and so on.  The 
  17181.       agent considers the subagent with the best priority to be the active 
  17182.       subagent for the sub-tree.  If you specify -1, you are asking for the 
  17183.       best priority available.  If you specify 0, you are asking for a better 
  17184.       priority than any existing subagent may already have. 
  17185.  
  17186.      The MIB sub-tree which you want to control.  You must specify this 
  17187.       parameter with a trailing dot. 
  17188.  
  17189.      Your choice of GETBULK processing.  You can ask the agent to map a 
  17190.       GETBULK into multiple GETNEXT packets or to pass the GETBULK to you. 
  17191.  
  17192.  The function returns a pointer to a static buffer holding the DPI packet if 
  17193.  successful.  If it fails, it returns a NULL pointer. 
  17194.  
  17195.  Now we must send this DPI-REGISTER packet to the agent with the 
  17196.  DPIsend_packet_to_agent() function.  This is similar to sending the DPI_OPEN 
  17197.  packet.  We then wait for a response from the agent.  Again, we use the 
  17198.  DPIawait_packet_from_agent() function in the same way as we awaited a response 
  17199.  on the DPI-OPEN request.  Once we have received the response, we must check 
  17200.  the return code to ensure that registration was successful. 
  17201.  
  17202.  The following code example demonstrates how to register one MIB sub-tree with 
  17203.  the agent. 
  17204.  
  17205.   #include <snmp_dpi.h>             /* DPI 2.0 API definitions */
  17206.   static int handle;                /* handle has global scope */
  17207.  
  17208.   static void do_register(void)
  17209.   {
  17210.      unsigned char *packet_p;
  17211.      int            rc;
  17212.      unsigned long  length;
  17213.      snmp_dpi_hdr  *hdr_p;
  17214.  
  17215.      packet_p = mkDPIregister(          /* Make DPI register    */
  17216.                   3,                    /* timeout in seconds   */
  17217.                   0,                    /* requested priority   */
  17218.                   DPI_SIMPLE_MIB,       /* ptr to the sub-tree  */
  17219.                   DPI_BULK_NO);         /* GetBulk into GetNext */
  17220.  
  17221.      if (!packet_p) exit(1);            /* If it failed, exit   */
  17222.  
  17223.      rc  = DPIsend_packet_to_agent(     /* send REGISTER packet */
  17224.               handle,                   /* on this connection   */
  17225.               packet_p,                 /* this is the packet   */
  17226.               DPI_PACKET_LEN(packet_p));/* this is its length   */
  17227.  
  17228.      if (rc != DPI_RC_OK) exit(1);      /* If it failed, exit   */
  17229.  
  17230.      rc  = DPIawait_packet_from_agent(  /* wait for response    */
  17231.               handle,                   /* on this connection   */
  17232.               3,                        /* timeout in seconds   */
  17233.               &packet_p,                /* gets ptr to packet   */
  17234.               &length);                 /* gets packet length   */
  17235.  
  17236.      if (rc != DPI_RC_OK) exit(1);      /* If it failed, exit   */
  17237.  
  17238.      hdr_p = pDPIpacket(packet_p);      /* parse DPI packet     */
  17239.      if (hdr_p == snmp_dpi_hdr_NULL_p)  /* Failed to parse it   */
  17240.         exit(1);                        /* so exit              */
  17241.  
  17242.      if (hdr_p->packet_type != SNMP_DPI_RESPONSE) exit(1);
  17243.  
  17244.      rc = hdr_p->data_u.resp_p->error_code;
  17245.      if (rc != SNMP_ERROR_DPI_noError) exit(1);
  17246.   } /* end of do_register() */
  17247.  
  17248.  
  17249. ΓòÉΓòÉΓòÉ 11.10.4. Processing Requests from the Agent ΓòÉΓòÉΓòÉ
  17250.  
  17251. After we have registered our sample MIB sub-tree with the agent, we must expect 
  17252. that SNMP requests for that sub-tree will be passed for processing by us. 
  17253. Since the requests will arrive in the form of DPI packets on the connection 
  17254. that the we have established, we go into a while loop to await DPI packets from 
  17255. the agent. 
  17256.  
  17257. Since the subagent cannot know in advance which kind of packet arrives from the 
  17258. agent, we await a DPI packet (forever), then we parse the packet, check the 
  17259. packet type, and process the request based on the DPI packet type.  A call to 
  17260. pDPIpacket, which expects as parameter a pointer to the encoded/serialized DPI 
  17261. packet, returns a pointer to a DPI parse tree.  The pointer points to a 
  17262. snmp_dpi_hdr structure which looks as follows: 
  17263.  
  17264. struct snmp_dpi_hdr {
  17265.   unsigned char  proto_major;
  17266.   unsigned char  proto_version;
  17267.   unsigned char  proto_release;
  17268.   unsigned short packet_id;
  17269.   unsigned char  packet_type;
  17270.   union {
  17271.      snmp_dpi_reg_packet      *reg_p;
  17272.      snmp_dpi_ureg_packet     *ureg_p;
  17273.      snmp_dpi_get_packet      *get_p;
  17274.      snmp_dpi_next_packet     *next_p;
  17275.      snmp_dpi_next_packet     *bulk_p;
  17276.      snmp_dpi_set_packet      *set_p;
  17277.      snmp_dpi_resp_packet     *resp_p;
  17278.      snmp_dpi_trap_packet     *trap_p;
  17279.      snmp_dpi_open_packet     *open_p;
  17280.      snmp_dpi_close_packet    *close_p;
  17281.      unsigned char            *any_p;
  17282.   } data_u;
  17283. };
  17284. typedef struct snmp_dpi_hdr    snmp_dpi_hdr;
  17285. #define snmp_dpi_hdr_NULL_p    ((snmp_dpi_hdr *)0)
  17286.  
  17287. With the DPI parse tree, we decide how to process the DPI packet. The following 
  17288. code example demonstrates the high level process of a DPI subagent. 
  17289.  
  17290. #include <snmp_dpi.h>              /* DPI 2.0 API definitions */
  17291. static int handle;                 /* handle has global scope */
  17292.  
  17293. main(int argc, char *argv╤ìΓêÖ, char *envp╤ìΓêÖ)
  17294. {
  17295.   unsigned char *packet_p;
  17296.   int            rc = 0;
  17297.   unsigned long  length;
  17298.   snmp_dpi_hdr  *hdr_p;
  17299.  
  17300.   if (argc>1) {                     /* if use passed one parm */
  17301.      if (strcmp(argv╤ì1ΓêÖ,"-d")==0)   /* being -d, then we      */
  17302.          DPIdebug(2);               /* turn on DPI debugging  */
  17303.   } /* endif */                     /* which shows us things  */
  17304.  
  17305.   do_connect_and_open();            /* connect and DPI-OPEN   */
  17306.  
  17307.   do_register();                    /* register our sub-tree  */
  17308.  
  17309.   while (rc == 0) {                 /* do forever             */
  17310.    rc = DPIawait_packet_from_agent( /* wait for a DPI packet  */
  17311.            handle,                  /* on this connection     */
  17312.            -1,                      /* wait forever           */
  17313.            &packet_p,               /* receives ptr to packet */
  17314.            &length);                /* receives packet length */
  17315.  
  17316.    if (rc != DPI_RC_OK) exit(1);    /* If it failed, exit     */
  17317.  
  17318.    hdr_p = pDPIpacket(packet_p);    /* parse DPI packet       */
  17319.    if (hdr_p == snmp_dpi_hdr_NULL_p)/* If we fail to parse it */
  17320.       exit(1);                      /* then exit              */
  17321.  
  17322.    switch(hdr_p->packet_type) {     /* handle by DPI type     */
  17323.    case SNMP_DPI_GET:
  17324.      rc = do_get(hdr_p,
  17325.                  hdr_p->data_u.get_p);
  17326.      break;
  17327.    case SNMP_DPI_GETNEXT:
  17328.      rc = do_next(hdr_p,
  17329.                   hdr_p->data_u.next_p);
  17330.      break;
  17331.  
  17332.    case SNMP_DPI_SET:
  17333.    case SNMP_DPI_COMMIT:
  17334.    case SNMP_DPI_UNDO:
  17335.      rc = do_set(hdr_p,
  17336.                  hdr_p->data_u.set_p);
  17337.      break;
  17338.    case SNMP_DPI_CLOSE:
  17339.      rc = do_close(hdr_p,
  17340.                    hdr_p->data_u.close_p);
  17341.      break;
  17342.    case SNMP_DPI_UNREGISTER:
  17343.      rc = do_unreg(hdr_p,
  17344.                    hdr_p->data_u.ureg_p);
  17345.      break;
  17346.    default:
  17347.      printf("Unexpected DPI packet type %d\n",
  17348.             hdr_p->packet_type);
  17349.      rc = -1;
  17350.    } /* endswitch */
  17351.    if (rc) exit(1);
  17352.   } /* endwhile */
  17353.  
  17354.   return(0);
  17355. } /* end of main() */
  17356.  
  17357.  
  17358. ΓòÉΓòÉΓòÉ 11.10.5. Processing a GET Request ΓòÉΓòÉΓòÉ
  17359.  
  17360. When the DPI packet is parsed, the snmp_dpi_hdr structure will show in the 
  17361. packet_type that this is a SNMP_DPI_GET packet.  In that case, the packet_body 
  17362. contains a pointer to a GET-varBind, which is represented in an 
  17363. snmp_dpi_get_packet structure: 
  17364.  
  17365. struct dpi_get_packet {
  17366.   char                   *object_p;   /* ptr to OIDstring     */
  17367.   char                   *group_p;    /* ptr to sub-tree      */
  17368.   char                   *instance_p; /* ptr to rest of OID   */
  17369.   struct dpi_get_packet  *next_p;     /* ptr to next in chain */
  17370. };
  17371. typedef struct dpi_get_packet       snmp_dpi_get_packet;
  17372. #define snmp_dpi_get_packet_NULL_p  ((snmp_dpi_get_packet *)0)
  17373.  
  17374. Assuming we have registered example sub-tree 1.3.6.1.4.1.2.2.1.5 and a GET 
  17375. request comes in for one variable 1.3.6.1.4.1.2.2.1.5.1.0 so that it is object 
  17376. 1 instance 0 in our sub-tree, the fields in the snmp_dpi_get_packet would have 
  17377. pointers to: 
  17378.  
  17379.   object_p   ->  "1.3.6.1.4.1.2.2.1.5.1.0"
  17380.   group_p    ->  "1.3.6.1.4.1.2.2.1.5."
  17381.   instance_p ->  "1.0"
  17382.   next_p     ->  snmp_dpi_get_packet_NULL_p
  17383.  
  17384. If there are multiple varBinds in a GET request, each one is represented in a 
  17385. snmp_dpi_get_packet structure and all the snmp_dpi_get_packet structures are 
  17386. chained via the next pointer.  As long as the next pointer is not the 
  17387. snmp_dpi_get_packet_NULL_p pointer, there are more varBinds in the list. 
  17388.  
  17389. Now we can analyze the varBind structure for whatever checking we want to do. 
  17390. Once we are ready to make a response that contains the value of the variable, 
  17391. we prepare a SET-varBind which is represented in an snmp_dpi_set_packet 
  17392. structure: 
  17393.  
  17394. struct dpi_set_packet {
  17395.   char                   *object_p;   /* ptr to OIDstring     */
  17396.   char                   *group_p;    /* ptr to sub-tree      */
  17397.   char                   *instance_p; /* ptr to rest of OID   */
  17398.   unsigned char           value_type; /* SNMP_TYPE_xxxx       */
  17399.   unsigned short          value_len;  /* value length         */
  17400.   char                   *value_p;    /* ptr to value itself  */
  17401.   struct dpi_set_packet  *next_p;     /* ptr to next in chain */
  17402. };
  17403. typedef struct dpi_set_packet       snmp_dpi_set_packet;
  17404. #define snmp_dpi_set_packet_NULL_p  ((snmp_dpi_set_packet *)0)
  17405.  
  17406. We can use the mkDPIset() function to prepare such a structure. This function 
  17407. expects the following parameters: 
  17408.  
  17409.      A pointer to an existing snmp_dpi_set_packet structure if the new varBind 
  17410.       must be added to an existing chain of varBinds.  If this is the first or 
  17411.       the only varBind in the chain, pass the snmp_dpi_set_packet_NULL_p 
  17412.       pointer to indicate this. 
  17413.  
  17414.      A pointer to the sub-tree that we registered. 
  17415.  
  17416.      A pointer to the rest of the OID; in other words, the piece that follows 
  17417.       the sub-tree. 
  17418.  
  17419.      The value type of the value to be bound to the variable name.  This is 
  17420.       must be one of the SNMP_TYPE_xxxx values as defined in the snmp_dpi.h 
  17421.       include file. 
  17422.  
  17423.      The length of the value for integer type values.  This must be a length 
  17424.       of 4.  So we always work with 32-bit signed or unsigned integers except 
  17425.       for the Counter64 type.  For the Counter64 type, we must point to a 
  17426.       snmp_dpi_u64 structure and pass the length of that structure. 
  17427.  
  17428.      A pointer to the value. 
  17429.  
  17430.  Memory for the varBind is dynamically allocated and the data itself is copied. 
  17431.  So upon return we can dispose of our own pointers and allocated memory as we 
  17432.  please.  If the call is successful, a pointer is returned as follows: 
  17433.  
  17434.      To a new snmp_dpi_set_packet if it is the first or only varBind. 
  17435.  
  17436.      To the existing snmp_dpi_set_packet that we passed on the call.  In this 
  17437.       case, the new packed has been chained to the end of the varBind list. 
  17438.  
  17439.  If the mkDPIset() call fails, a NULL pointer is returned. 
  17440.  
  17441.  Once we have prepared the SET-varBind data, we can create a DPI RESPONSE 
  17442.  packet using the mkDPIresponse() function which expects these parameters: 
  17443.  
  17444.      A pointer to an snmp_dpi_hdr.  We should use the header of the parsed 
  17445.       incoming packet.  It is used to copy the packet_id from the request into 
  17446.       the response, such that the agent can correlate the response to a 
  17447.       request. 
  17448.  
  17449.      A return code which is an SNMP error code.  If successful, this should be 
  17450.       SNMP_ERROR_noError (value zero).  If failure, it must be one of the 
  17451.       SNMP_ERROR_xxxx values as defined in the snmp_dpi.h include file. 
  17452.  
  17453.       A request for a non-existing object or instance is not considered an 
  17454.       error.  Instead, we must pass a value type of SNMP_TYPE_noSuchObject or 
  17455.       SNMP_TYPE_noSuchInstance respectively.  These two value types have an 
  17456.       implicit value of NULL, so we can pass a zero length and a NULL pointer 
  17457.       for the value in this case. 
  17458.  
  17459.      The index of the varBind in error starts counting at 1.  Pass zero if no 
  17460.       error occurred, or pass the proper index of the first varBind for which 
  17461.       an error was detected. 
  17462.  
  17463.      A pointer to a chain of snmp_dpi_set_packets (varBinds) to be returned as 
  17464.       response to the GET request.  If an error was detected, an 
  17465.       snmp_dpi_set_packet_NULL_p pointer may be passed. 
  17466.  
  17467.  The following code example returns a response.  We assume that there are no 
  17468.  errors in the request, but proper code should do the checking for that.  For 
  17469.  instance, we return a noSuchInstance if the instance is not exactly what we 
  17470.  expect and a noSuchObject if the object instance_ID is greater than 3, for 
  17471.  example 4.0.  However, there might be no instance_ID at all and we should 
  17472.  check for that too. 
  17473.  
  17474.   static int do_get(snmp_dpi_hdr *hdr_p,
  17475.                     snmp_dpi_get_packet *pack_p)
  17476.   {
  17477.     unsigned char       *packet_p;
  17478.     int                  rc;
  17479.     snmp_dpi_set_packet *varBind_p;
  17480.  
  17481.     varBind_p =                        /* init the varBind chain*/
  17482.        snmp_dpi_set_packet_NULL_p;     /* to a NULL pointer     */
  17483.  
  17484.     if (pack_p->instance_p &&
  17485.         (strcmp(pack_p->instance_p,"1.0") == 0))
  17486.     {
  17487.       varBind_p = mkDPIset(            /* Make DPI set packet   */
  17488.                   varBind_p,           /* ptr to varBind chain  */
  17489.                   pack_p->group_p,     /* ptr to sub-tree       */
  17490.                   pack_p->instance_p,  /* ptr to rest of OID    */
  17491.                   SNMP_TYPE_Integer32, /* value type Integer 32 */
  17492.                   sizeof(value1),      /* length of value       */
  17493.                   &value1);            /* ptr to value          */
  17494.     } else if (pack_p->instance_p &&
  17495.         (strcmp(pack_p->instance_p,"2.0") == 0))
  17496.     {
  17497.       varBind_p = mkDPIset(               /* Make DPI set packet*/
  17498.                   varBind_p,              /* ptr to varBindchain*/
  17499.                   pack_p->group_p,        /* ptr to sub-tree    */
  17500.                   pack_p->instance_p,     /* ptr to rest of OID */
  17501.                   SNMP_TYPE_DisplayString,/* value type         */
  17502.                   strlen(value2_p),       /* length of value    */
  17503.                   value2_p);              /* ptr to value       */
  17504.     } else if (pack_p->instance_p &&
  17505.         (strcmp(pack_p->instance_p,"3.0") == 0))
  17506.     {
  17507.       varBind_p = mkDPIset(               /* Make DPI set packet*/
  17508.                   varBind_p,              /* ptr to varBindchain*/
  17509.                   pack_p->group_p,        /* ptr to sub-tree    */
  17510.                   pack_p->instance_p,     /* ptr to rest of OID */
  17511.                   SNMP_TYPE_Counter32,    /* value type         */
  17512.                   sizeof(value3),         /* length of value    */
  17513.                   &value3);               /* ptr to value       */
  17514.     } else if (pack_p->instance_p &&
  17515.         (strcmp(pack_p->instance_p,"3")>0))
  17516.     {
  17517.       varBind_p = mkDPIset(               /* Make DPI set packet*/
  17518.                  varBind_p,               /* ptr to varBindchain*/
  17519.                  pack_p->group_p,         /* ptr to sub-tree    */
  17520.                  pack_p->instance_p,      /* ptr to rest of OID */
  17521.                  SNMP_TYPE_noSuchObject,  /* value type         */
  17522.                  0L,                      /* length of value    */
  17523.                  (unsigned char *)0);     /* ptr to value       */
  17524.     } else {
  17525.       varBind_p = mkDPIset(               /* Make DPI set packet*/
  17526.                  varBind_p,               /* ptr to varBindchain*/
  17527.                  pack_p->group_p,         /* ptr to sub-tree    */
  17528.                  pack_p->instance_p,      /* ptr to rest of OID */
  17529.                  SNMP_TYPE_noSuchInstance,/* value type         */
  17530.                  0L,                      /* length of value    */
  17531.                  (unsigned char *)0);     /* ptr to value       */
  17532.     } /* endif */
  17533.  
  17534.     if (!varBind_p) return(-1);        /* If it failed, return  */
  17535.  
  17536.     packet_p = mkDPIresponse(          /* Make DPIresponse pack */
  17537.                  hdr_p,                /* ptr parsed request    */
  17538.                  SNMP_ERROR_noError,   /* all is OK, no error   */
  17539.                  0L,                   /* index zero, no error  */
  17540.                  varBind_p);           /* varBind response data */
  17541.  
  17542.     if (!packet_p) return(-1);         /* If it failed, return  */
  17543.  
  17544.     rc  = DPIsend_packet_to_agent(     /* send RESPONSE packet  */
  17545.              handle,                   /* on this connection    */
  17546.              packet_p,                 /* this is the packet    */
  17547.              DPI_PACKET_LEN(packet_p));/* and this is its length*/
  17548.  
  17549.     return(rc);                        /* return retcode        */
  17550.   } /* end of do_get() */
  17551.  
  17552.  
  17553. ΓòÉΓòÉΓòÉ 11.10.6. Processing a GETNEXT Request ΓòÉΓòÉΓòÉ
  17554.  
  17555. When a DPI packet is parsed, the snmp_dpi_hdr structure shows in the 
  17556. packet_type that this is a SNMP_DPI_GETNEXT packet, and so the packet_body 
  17557. contains a pointer to a GETNEXT-varBind, which is represented in an 
  17558. snmp_dpi_next_packet structure: 
  17559.  
  17560. struct dpi_next_packet {
  17561.   char                   *object_p;    /* ptr to OIDstring    */
  17562.   char                   *group_p;     /* ptr to sub-tree     */
  17563.   char                   *instance_p;  /* ptr to rest of OID  */
  17564.   struct dpi_next_packet *next_p;      /* ptr to next in chain*/
  17565. };
  17566. typedef struct dpi_next_packet      snmp_dpi_next_packet;
  17567. #define snmp_dpi_next_packet_NULL_p ((snmp_dpi_next_packet *)0)
  17568.  
  17569. In the interest of simplicity and easier understanding we will discuss the 
  17570. GETNEXT for a scalar object, which only has one instance. For columnar objects, 
  17571. which may have multiple instances, the process is more complex. However, the 
  17572. DPI subagent programmer should be able to handle that once the basics of 
  17573. GETNEXT processing in a DPI subagent is understood. 
  17574.  
  17575. Assuming we have registered example sub-tree dpiSimpleMIB and a GETNEXT arrives 
  17576. for one variable, dpiSimpleInteger.0, so that is object 1 instance 0 in our 
  17577. sub-tree, the fields in the snmp_dpi_get_packet structure would have pointers 
  17578. to: 
  17579.  
  17580. object_p    ->  "1.3.6.1.4.1.2.2.1.5.1.0"
  17581. group_p     ->  "1.3.6.1.4.1.2.2.1.5."
  17582. instance_p  ->  "1.0"
  17583. next_p      ->  snmp_dpi_next_packet_NULL_p
  17584.  
  17585. If there are multiple varBinds in a GETNEXT request, each one is represented in 
  17586. a snmp_dpi_get_packet structure and all the snmp_dpi_get_packet structures are 
  17587. chained via the next pointer.  As long as the next pointer is not the 
  17588. snmp_dpi_next_packet_NULL_p pointer, there are more varBinds in the list. 
  17589.  
  17590. Now we can analyze the varBind structure for whatever checking we want to do. 
  17591. We must find out which OID is the one that lexicographically follows the one in 
  17592. the request.  It is that OID with its value that we must return as a response. 
  17593. Therefore, we must now also set the proper OID in the response.  Once we are 
  17594. ready to make a response that contains the new OID and the value of that 
  17595. variable, we must prepare a SET-varBind which is represented in an 
  17596. snmp_dpi_set_packet: 
  17597.  
  17598. struct dpi_set_packet {
  17599.   char                   *object_p;   /* ptr to OIDstring     */
  17600.   char                   *group_p;    /* ptr to sub-tree      */
  17601.   char                   *instance_p; /* ptr to rest of OID   */
  17602.   unsigned char           value_type; /* SNMP_TYPE_xxxx       */
  17603.   unsigned short          value_len;  /* value length         */
  17604.   char                   *value_p;    /* ptr to value itself  */
  17605.   struct dpi_set_packet  *next_p;     /* ptr to next in chain */
  17606. };
  17607. typedef struct dpi_set_packet        snmp_dpi_set_packet;
  17608. #define snmp_dpi_set_packet_NULL_p   ((snmp_dpi_set_packet *)0)
  17609.  
  17610. We can use the mkDPIset() function to prepare such a structure. This function 
  17611. expects the following parameters: 
  17612.  
  17613.      A pointer to an existing snmp_dpi_set_packet structure if the new varBind 
  17614.       must be added to an existing chain of varBinds.  If this is the first or 
  17615.       only varBind in the chain, we pass the snmp_dpi_set_packet_NULL_p pointer 
  17616.       to indicate this. 
  17617.  
  17618.      A pointer to the sub-tree that we registered. 
  17619.  
  17620.      A pointer to the rest of the OID, in other words the piece that follows 
  17621.       the sub-tree. 
  17622.  
  17623.      The value type of the value to be bound to the variable name.  This is 
  17624.       must be one of the SNMP_TYPE_xxxx values as defined in the snmp_dpi.h 
  17625.       include file. 
  17626.  
  17627.      The length of the value for integer type values.  This must be a length 
  17628.       of 4.  So we always work with 32-bit signed or unsigned integers except 
  17629.       for the Counter64 type.  For Counter 64 type, we must point to a 
  17630.       snmp_dpi_u64 structure and pass the length of that structure. 
  17631.  
  17632.      A pointer to the value. 
  17633.  
  17634.  Memory for the varBind is dynamically allocated and the data itself is copied. 
  17635.  Upon return, we can dispose of our own pointers and allocated memory as we 
  17636.  please.  If the call is successful, a pointer is returned as follows: 
  17637.  
  17638.      A new snmp_dpi_set_packet if it is the first or only varBind. 
  17639.  
  17640.      The existing snmp_dpi_set_packet that we passed on the call.  In this 
  17641.       case, the new packed has been chained to the end of the varBind list. 
  17642.  
  17643.  If the mkDPIset() call fails, a NULL pointer is returned. 
  17644.  
  17645.  Once we have prepared the SET-varBind data, we can create a DPI RESPONSE 
  17646.  packet using the mkDPIresponse() function, which expects these parameters: 
  17647.  
  17648.      A pointer to an snmp_dpi_hdr.  We should use the header of the parsed 
  17649.       incoming packet.  It is used to copy the packet_id from the request into 
  17650.       the response, such that the agent can correlate the response to a 
  17651.       request. 
  17652.  
  17653.      A return code which is an SNMP error code.  If successful, this should be 
  17654.       SNMP_ERROR_noError (value zero).  If failure, it must be one of the 
  17655.       SNMP_ERROR_xxxx values as defined in the snmp_dpi.h include file. 
  17656.  
  17657.       A request for a non-existing object or instance is not considered an 
  17658.       error.  Instead, we must pass the OID and value of the first OID that 
  17659.       lexicographically follows the non-existing object and/or instance. 
  17660.  
  17661.       Reaching the end of our sub-tree is not considered an error.  For 
  17662.       example, if there is no NEXT OID, this is not an error.  In this 
  17663.       situation we must return the original OID as received in the request and 
  17664.       a value_type of SNMP_TYPE_endOfMibView.  This value_type has an implicit 
  17665.       value of NULL, so we can pass a zero length and a NULL pointer for the 
  17666.       value. 
  17667.  
  17668.      The index of the first varBind in error starts counting at 1.  Pass zero 
  17669.       if no error occurred, or pass the proper index of the first varBind for 
  17670.       which an error was detected. 
  17671.  
  17672.      A pointer to a chain of snmp_dpi_set_packet(s) (varBinds) to be returned 
  17673.       as response to the GETNEXT request.  If an error was detected, an 
  17674.       snmp_dpi_set_packet_NULL_p pointer may be passed. 
  17675.  
  17676.  The following code example returns a response.  We assume that there are no 
  17677.  errors in the request, but proper code should do the checking for that.  We do 
  17678.  proper checking for lexicographic next object, but we do no checking for 
  17679.  ULONG_MAX, or making sure that the instance ID is indeed valid (digits and 
  17680.  dots).  If we get to the end of our dpiSimpleMIB, we must return an 
  17681.  endOfMibView as defined by the SNMP Version 2 rules. 
  17682.  
  17683.   static int do_next(snmp_dpi_hdr *hdr_p,
  17684.                      snmp_dpi_next_packet *pack_p)
  17685.   {
  17686.     unsigned char       *packet_p;
  17687.     int                  rc;
  17688.     unsigned long        subid;        /* subid is unsigned     */
  17689.     unsigned long        instance;     /* same with instance    */
  17690.     char                *cp;
  17691.     snmp_dpi_set_packet *varBind_p;
  17692.  
  17693.     varBind_p =                        /* init the varBind chain*/
  17694.        snmp_dpi_set_packet_NULL_p;     /* to a NULL pointer     */
  17695.  
  17696.     if (pack_p->instance_p) {          /* we have an instance ID*/
  17697.        cp = pack_p->instance_p;        /* pick up ptr           */
  17698.        subid = strtoul(cp, &cp, 10);   /* convert subid (object)*/
  17699.        if (*cp == '.') {               /* followed by a dot ?   */
  17700.           cp++;                        /* point after it if yes */
  17701.           instance=strtoul(cp,&cp,10); /* convert real instance */
  17702.                                        /* not that we need it,we*/
  17703.           subid++;                     /* only have instance 0, */
  17704.                                        /* so NEXT is next object*/
  17705.           instance = 0;                /* and always instance 0 */
  17706.        } else {                        /* no real instance      */
  17707.           instance = 0;                /* passed, so we use 0   */
  17708.           if (subid == 0) subid++;     /* if object 0, subid 1  */
  17709.        } /* endif */
  17710.     } else {                           /* no instance ID passed */
  17711.        subid = 1;                      /* so do first object    */
  17712.        instance = 0;                   /* 0 is all we have      */
  17713.     } /* endif */
  17714.  
  17715.     /* we have set subid and instance such that we can basically*/
  17716.     /* process the request as a GET now. Actually, we don't even*/
  17717.     /* need instance, because all out object instances are zero.*/
  17718.  
  17719.     if (instance != 0) printf("Strange instance: %lu\n",instance);
  17720.  
  17721.     switch (subid) {
  17722.     case 1:
  17723.       varBind_p = mkDPIset(            /* Make DPI set packet   */
  17724.                   varBind_p,           /* ptr to varBind chain  */
  17725.                   pack_p->group_p,     /* ptr to sub-tree       */
  17726.                   DPI_SIMPLE_INTEGER,  /* ptr to rest of OID    */
  17727.                   SNMP_TYPE_Integer32, /* value type Integer 32 */
  17728.                   sizeof(value1),      /* length of value       */
  17729.                   &value1);            /* ptr to value          */
  17730.       break;
  17731.     case 2:
  17732.       varBind_p = mkDPIset(               /* Make DPI set packet*/
  17733.                   varBind_p,              /* ptr to varBindchain*/
  17734.                   pack_p->group_p,        /* ptr to sub-tree    */
  17735.                   DPI_SIMPLE_STRING,      /* ptr to rest of OID */
  17736.                   SNMP_TYPE_DisplayString,/* value type         */
  17737.                   strlen(value2_p),       /* length of value    */
  17738.                   value2_p);              /* ptr to value       */
  17739.       break;
  17740.     case 3:
  17741.       varBind_p = mkDPIset(               /* Make DPI set packet*/
  17742.                   varBind_p,              /* ptr to varBindchain*/
  17743.                   pack_p->group_p,        /* ptr to sub-tree    */
  17744.                   DPI_SIMPLE_COUNTER32,   /* ptr to rest of OID */
  17745.                   SNMP_TYPE_Counter32,    /* value type         */
  17746.                   sizeof(value3),         /* length of value    */
  17747.                   &value3);               /* ptr to value       */
  17748.       break;
  17749.     case 4:                               /*                *Apr23*/
  17750.       varBind_p = mkDPIset(               /* Make DPI set packet  */
  17751.                   varBind_p,              /* ptr to varBind chain */
  17752.                   pack_p->group_p,        /* ptr to sub-tree      */
  17753.                   DPI_SIMPLE_COUNTER64,   /* ptr to rest of OID   */
  17754.                   SNMP_TYPE_Counter64,    /* value type           */
  17755.                   sizeof(value4),         /* length of value      */
  17756.                   &value4);               /* ptr to value         */
  17757.       break;                              /*                *Apr23*/
  17758.     default:
  17759.       varBind_p = mkDPIset(               /* Make DPI set packet*/
  17760.                   varBind_p,              /* ptr to varBindchain*/
  17761.                   pack_p->group_p,        /* ptr to sub-tree    */
  17762.                   pack_p->instance_p,     /* ptr to rest of OID */
  17763.                   SNMP_TYPE_endOfMibView, /* value type         */
  17764.                   0L,                     /* length of value    */
  17765.                   (unsigned char *)0);    /* ptr to value       */
  17766.       break;
  17767.     } /* endswitch */
  17768.  
  17769.     if (!varBind_p) return(-1);        /* If it failed, return  */
  17770.  
  17771.     packet_p = mkDPIresponse(          /* Make DPIresponse pack */
  17772.                  hdr_p,                /* ptr parsed request    */
  17773.                  SNMP_ERROR_noError,   /* all is OK, no error   */
  17774.                  0L,                   /* index zero, no error  */
  17775.                  varBind_p);           /* varBind response data */
  17776.  
  17777.     if (!packet_p) return(-1);         /* If it failed, return  */
  17778.  
  17779.     rc  = DPIsend_packet_to_agent(     /* send RESPONSE packet  */
  17780.              handle,                   /* on this connection    */
  17781.              packet_p,                 /* this is the packet    */
  17782.              DPI_PACKET_LEN(packet_p));/* and this is its length*/
  17783.  
  17784.     return(rc);                        /* return retcode        */
  17785.   } /* end of do_next() */
  17786.  
  17787.  
  17788. ΓòÉΓòÉΓòÉ 11.10.7. Processing a SET/COMMIT/UNDO Request ΓòÉΓòÉΓòÉ
  17789.  
  17790. These three requests can come in one of these sequences: 
  17791.  
  17792.      SET, COMMIT 
  17793.      SET, UNDO 
  17794.      SET, COMMIT, UNDO 
  17795.  
  17796.  The normal sequence is SET and then COMMIT.  When we receive a SET request, we 
  17797.  must make preparations to accept the new value.  For example, check that it is 
  17798.  for an existing object and instance, check the value type and contents to be 
  17799.  valid, allocate memory, but we must not yet make the change. 
  17800.  
  17801.  If there are no SET errors, the next request we receive will be a COMMIT 
  17802.  request.  It is then that we must make the change, but we must also keep 
  17803.  enough information such that we can UNDO the change later if we get a 
  17804.  subsequent UNDO request.  The latter may happen if the agent discovers any 
  17805.  errors with other subagents while processing requests that belong to the same 
  17806.  original SNMP SET packet.  All the varBinds in the same SNMP request PDU must 
  17807.  be processed "as if atomic". 
  17808.  
  17809.  When the DPI packet is parsed, the snmp_dpi_hdr structure shows in the 
  17810.  packet_type that this is an SNMP_DPI_SET, SNMP_DPI_COMMIT, or SNMP_DPI_UNDO 
  17811.  packet.  In that case, the packet_body contains a pointer to a SET-varBind, 
  17812.  represented in an snmp_dpi_get_packet structure.  COMMIT and UNDO have same 
  17813.  varBind data as SET upon which they follow: 
  17814.  
  17815.   struct dpi_set_packet {
  17816.     char                   *object_p;   /* ptr to OIDstring     */
  17817.     char                   *group_p;    /* ptr to sub-tree      */
  17818.     char                   *instance_p; /* ptr to rest of OID   */
  17819.     unsigned char           value_type; /* SNMP_TYPE_xxxx       */
  17820.     unsigned short          value_len;  /* value length         */
  17821.     char                   *value_p;    /* ptr to value itself  */
  17822.     struct dpi_set_packet  *next_p;     /* ptr to next in chain */
  17823.   };
  17824.   typedef struct dpi_set_packet        snmp_dpi_set_packet;
  17825.   #define snmp_dpi_set_packet_NULL_p   ((snmp_dpi_set_packet *)0)
  17826.  
  17827.  Assuming we have registered example sub-tree dpiSimpleMIB and a GET request 
  17828.  comes in for one variable dpiSimpleString.0 so that is object 1 instance 0 in 
  17829.  our sub-tree, and also assuming that the agent knows about our compiled 
  17830.  dpiSimpleMIB so that it knows this is a DisplayString as opposed to just an 
  17831.  arbitrary OCTET_STRING, the pointers in the snmp_dpi_set_packet structure 
  17832.  would have pointers and values like: 
  17833.  
  17834.   object_p    ->  "1.3.6.1.4.1.2.2.1.5.2.0"
  17835.   group_p     ->  "1.3.6.1.4.1.2.2.1.5."
  17836.   instance_p  ->  "2.0"
  17837.   value_type  ->  SNMP_TYPE_DisplayString
  17838.   value_len   ->  8
  17839.   value_p     ->  pointer to the value to be set
  17840.   next_p      ->  snmp_dpi_get_packet_NULL_p
  17841.  
  17842.  If there are multiple varBinds in a SET request, each one is represented in a 
  17843.  snmp_dpi_set_packet structure and all the snmp_dpi_set_packet structures are 
  17844.  chained via the next pointer.  As long as the next pointer is not the 
  17845.  snmp_dpi_set_packet_NULL_p pointer, there are more varBinds in the list. 
  17846.  
  17847.  Now we can analyze the varBind structure for whatever checking we want to do. 
  17848.  Once we are ready to make a response that contains the value of the variable, 
  17849.  we may prepare a new SET-varBind.  However, by definition, the response to a 
  17850.  successful SET is exactly the same as the SET request.  So there is no need to 
  17851.  return any varBinds. A response with SNMP_ERROR_noError and an index of zero 
  17852.  will do.  If there is an error, a response with the SNMP_ERROR_xxxx error code 
  17853.  and an index pointing to the varBind in error (counting starts at 1) will do. 
  17854.  
  17855.  The following code example returns a response.  We assume that there are no 
  17856.  errors in the request, but proper code should do the checking for that.  We 
  17857.  also do not check if the varBind in the COMMIT and/or UNDO is the same as that 
  17858.  in the SET request.  A proper agent would make sure that is the case, but a 
  17859.  proper subagent may want to verify that for itself.  We only do one check that 
  17860.  this is dpiSimpleString.0, and if it is not, we return a noCreation.  This may 
  17861.  not be correct, the mainline does not even return a response. 
  17862.  
  17863.   static int do_set(snmp_dpi_hdr *hdr_p, snmp_dpi_set_packet *pack_p)
  17864.   {
  17865.          unsigned char       *packet_p;
  17866.          int                  rc;
  17867.          int                  index       = 0;
  17868.          int                  error       = SNMP_ERROR_noError;
  17869.          snmp_dpi_set_packet *varBind_p;
  17870.  
  17871.          varBind_p =                        /* init the varBind chain  */
  17872.             snmp_dpi_set_packet_NULL_p;     /* to a NULL pointer       */
  17873.  
  17874.          if (!pack_p->instance_p ||
  17875.              (strcmp(pack_p->instance_p,"2.0") != 0))
  17876.          {
  17877.  
  17878.             if (pack_p->instance_p &&
  17879.                (strncmp(pack_p->instance_p,"1.",2) == 0))
  17880.             {
  17881.                error = SNMP_ERROR_notWritable;
  17882.             } else if (pack_p->instance_p &&
  17883.                (strncmp(pack_p->instance_p,"2.",2) == 0))
  17884.             {
  17885.                error = SNMP_ERROR_noCreation;
  17886.             } else if (pack_p->instance_p &&
  17887.                (strncmp(pack_p->instance_p,"3.",2) == 0))
  17888.             {
  17889.                error = SNMP_ERROR_notWritable;
  17890.             } else {
  17891.                error = SNMP_ERROR_noCreation;
  17892.             } /* endif */
  17893.  
  17894.             packet_p = mkDPIresponse(       /* Make DPIresponse packet */
  17895.                       hdr_p,                /* ptr parsed request      */
  17896.                       error,                /* all is OK, no error     */
  17897.                       1,                    /* index is 1, 1st varBind */
  17898.                       varBind_p);           /* varBind response data   */
  17899.  
  17900.             if (!packet_p) return(-1);      /* If it failed, return    */
  17901.  
  17902.             rc  = DPIsend_packet_to_agent(  /* send RESPONSE packet    */
  17903.                   handle,                   /* on this connection      */
  17904.                   packet_p,                 /* this is the packet      */
  17905.                   DPI_PACKET_LEN(packet_p));/* and this is its length  */
  17906.  
  17907.             return(rc);                     /* return retcode          */
  17908.          }
  17909.  
  17910.          switch (hdr_p->packet_type) {
  17911.          case SNMP_DPI_SET:
  17912.            if ((pack_p->value_type != SNMP_TYPE_DisplayString) &&
  17913.                (pack_p->value_type != SNMP_TYPE_OCTET_STRING))
  17914.            {  /* check octet string in case agent has no compiled MIB  */
  17915.               error = SNMP_ERROR_wrongType;
  17916.               break;                        /* from switch             */
  17917.            } /* endif */
  17918.            if (new_val_p) free(new_val_p);  /* free these memory areas */
  17919.            if (old_val_p) free(old_val_p);  /* if we allocated any     */
  17920.            new_val_p   = (char *)0;
  17921.            old_val_p   = (char *)0;
  17922.            new_val_len = 0;
  17923.            old_val_len = 0;
  17924.  
  17925.            new_val_p =                      /* allocate memory for     */
  17926.                malloc(pack_p->value_len);   /* new value to set        */
  17927.            if (new_val_p) {                 /* If success, then also   */
  17928.               memcpy(new_val_p,             /* copy new value to our   */
  17929.                      pack_p->value_p,       /* own and newly allocated */
  17930.                      pack_p->value_len);    /* memory area.            */
  17931.               new_val_len = pack_p->value_len;
  17932.            } else {                         /* Else failed to malloc,  */
  17933.               error = SNMP_ERROR_genErr;    /* so that is a genErr     */
  17934.               index = 1;                    /* at first varBind        */
  17935.            } /* endif */
  17936.            break;
  17937.          case SNMP_DPI_COMMIT:
  17938.            old_val_p = cur_val_p;           /* save old value for undo */
  17939.            cur_val_p = new_val_p;           /* make new value current  */
  17940.            new_val_p = (char *)0;           /* keep only 1 ptr around  */
  17941.            old_val_len = cur_val_len;       /* and keep lengths correct*/
  17942.            cur_val_len = new_val_len;
  17943.            new_val_len = 0;
  17944.            /* may need to convert from ASCII to native if OCTET_STRING */
  17945.            break;
  17946.          case SNMP_DPI_UNDO:
  17947.            if (new_val_p) {                 /* free allocated memory   */
  17948.               free(new_val_p);
  17949.               new_val_p   = (char *)0;
  17950.               new_val_len = 0;
  17951.            } /* endif */
  17952.            if (old_val_p) {
  17953.               if (cur_val_p) free(cur_val_p);
  17954.               cur_val_p   = old_val_p;      /* reset to old value      */
  17955.               cur_val_len = old_val_len;
  17956.               old_val_p   = (char *)0;
  17957.               old_val_len = 0;
  17958.            } /* endif */
  17959.            break;
  17960.          } /* endswitch */
  17961.  
  17962.          packet_p = mkDPIresponse(          /* Make DPIresponse packet */
  17963.                       hdr_p,                /* ptr parsed request      */
  17964.                       error,                /* all is OK, no error     */
  17965.                       index,                /* index is zero, no error */
  17966.                       varBind_p);           /* varBind response data   */
  17967.  
  17968.          if (!packet_p) return(-1);         /* If it failed, return    */
  17969.  
  17970.          rc  = DPIsend_packet_to_agent(     /* send RESPONSE packet    */
  17971.                   handle,                   /* on this connection      */
  17972.                   packet_p,                 /* this is the packet      */
  17973.                   DPI_PACKET_LEN(packet_p));/* and this is its length  */
  17974.  
  17975.          return(rc);                        /* return retcode          */
  17976.   } /* end of do_set() */
  17977.  
  17978.  
  17979. ΓòÉΓòÉΓòÉ 11.10.8. Processing an UNREGISTER Request ΓòÉΓòÉΓòÉ
  17980.  
  17981. An agent can send an UNREGISTER packet if some other subagent does a register 
  17982. for the same sub-tree at a higher priority.  An agent can also send an 
  17983. UNREGISTER if, for example, an SNMP manager tells it to "invalidate" the 
  17984. subagent connection or the registered sub-tree. 
  17985.  
  17986. Here is an example of how to handle such a packet. 
  17987.  
  17988. #include <snmp_dpi.h>          /* DPI 2.0 API definitions */
  17989.  
  17990. static int do_unreg(snmp_dpi_hdr *hdr_p,
  17991.                     snmp_dpi_ureg_packet *pack_p)
  17992. {
  17993.   printf("DPI UNREGISTER received from agent, reason=%d\n",
  17994.           pack_p->reason_code);
  17995.   printf("    sub-tree=%s\n",pack_p->group_p);
  17996.   DPIdisconnect_from_agent(handle);
  17997.   return(-1); /* causes exit in main loop */
  17998. } /* end of do_unreg() */
  17999.  
  18000.  
  18001. ΓòÉΓòÉΓòÉ 11.10.9. Processing a CLOSE Request ΓòÉΓòÉΓòÉ
  18002.  
  18003. An agent can send a CLOSE packet if it encounters an error or for some other 
  18004. reason.  It can also do so if an SNMP MANAGER tells it to "invalidate" the 
  18005. subagent connection. 
  18006.  
  18007. Here is an example of how to handle such a packet. 
  18008.  
  18009. #include <snmp_dpi.h>           /* DPI 2.0 API definitions */
  18010.  
  18011. static int do_close(snmp_dpi_hdr *hdr_p,
  18012.                     snmp_dpi_close_packet *pack_p)
  18013. {
  18014.   printf("DPI CLOSE received from agent, reason=%d\n",
  18015.          pack_p->reason_code);
  18016.  
  18017.   DPIdisconnect_from_agent(handle);
  18018.   return(-1); /* causes exit in main loop */
  18019. } /* end of do_close() */
  18020.  
  18021.  
  18022. ΓòÉΓòÉΓòÉ 11.10.10. Generating a TRAP ΓòÉΓòÉΓòÉ
  18023.  
  18024. A trap can be issued at any time after a DPI OPEN was successful. To do so, you 
  18025. must create a trap packet and send it to the agent.  With the TRAP, you can 
  18026. pass all sorts of varBinds if you want.  In this example, we pass two varBinds 
  18027. one with integer data and one with an octet string.  You can also pass an 
  18028. Enterprise ID, but with DPI 2.0, the agent will use your subagent ID as the 
  18029. enterprise ID if you do not pass one with the trap.  In most cases that will 
  18030. probably be fine. 
  18031.  
  18032. We must first prepare a varBind list chain that contains the two variables that 
  18033. we want to pass along with the trap.  To do so we must prepare a chain of two 
  18034. snmp_dpi_set_packet structures, which looks like: 
  18035.  
  18036. struct dpi_set_packet {
  18037.   char                   *object_p;   /* ptr to OIDstring     */
  18038.   char                   *group_p;    /* ptr to sub-tree      */
  18039.   char                   *instance_p; /* ptr to rest of OID   */
  18040.   unsigned char           value_type; /* SNMP_TYPE_xxxx       */
  18041.   unsigned short          value_len;  /* value length         */
  18042.   char                   *value_p;    /* ptr to value itself  */
  18043.   struct dpi_set_packet  *next_p;     /* ptr to next in chain */
  18044. };
  18045. typedef struct dpi_set_packet        snmp_dpi_set_packet;
  18046. #define snmp_dpi_set_packet_NULL_p   ((snmp_dpi_set_packet *)0)
  18047.  
  18048. We can use the mkDPIset() function to prepare such a structure. This function 
  18049. expects the following parameters: 
  18050.  
  18051.      A pointer to an existing snmp_dpi_set_packet structure if the new varBind 
  18052.       must be added to an existing chain of varBinds.  If this is the first or 
  18053.       the only varBind in the chain, pass the snmp_dpi_set_packet_NULL_p 
  18054.       pointer to indicate this. 
  18055.  
  18056.      A pointer to the sub-tree that we registered. 
  18057.  
  18058.      A pointer to the rest of the OID, in other words, the piece that follows 
  18059.       the sub-tree. 
  18060.  
  18061.      The value type of the value to be bound to the variable name.  This is 
  18062.       must be one of the SNMP_TYPE_xxxx values as defined in the snmp_dpi.h 
  18063.       include file. 
  18064.  
  18065.      The length of the value.  For integer type values, this must be a length 
  18066.       of 4.  We always work with 32-bit signed or unsigned integers except for 
  18067.       the Counter64 type.  For the Counter64 type, we must point to a 
  18068.       snmp_dpi_u64 structure and pass the length of that structure. 
  18069.  
  18070.      A pointer to the value. 
  18071.  
  18072.  Memory for the varBind is dynamically allocated and the data itself is copied. 
  18073.  Upon return, we can dispose of our own pointers and allocated memory as we 
  18074.  please.  If the call is successful, a pointer is returned as follows: 
  18075.  
  18076.      To a new snmp_dpi_set_packet if it is the first or only varBind. 
  18077.  
  18078.      To the existing snmp_dpi_set_packet that we passed on the call.  In this 
  18079.       case, the new packed has been chained to the end of the varBind list. 
  18080.  
  18081.  If the mkDPIset() call fails, a NULL pointer is returned. 
  18082.  
  18083.  Once we have prepared the SET-varBind data, we can create a DPI TRAP packet. 
  18084.  To do so we can use the mkDPItrap() function which expects these parameters: 
  18085.  
  18086.      The generic trap code.  Use 6 for enterprise specific trap type. 
  18087.  
  18088.      The specific trap type.  This is a type that is defined by the MIB which 
  18089.       we are implementing.  In our example we just use a 1. 
  18090.  
  18091.      A pointer to a chain of varBinds or the NULL pointer if no varBinds need 
  18092.       to be passed with the trap. 
  18093.  
  18094.      A pointer to the enterprise OID if we want to use a different enterprise 
  18095.       ID than the OID we used to identify ourselves as a subagent at DPI-OPEN 
  18096.       time. 
  18097.  
  18098.  The following code creates an enterprise specific trap with specific type 1 
  18099.  and passes two varBinds.  The first varBind with our object 1, instance 0, 
  18100.  Integer32 value; the second varBind with our object 2, instance 0, Octet 
  18101.  String.  We pass no enterprise ID. 
  18102.  
  18103.   static int do_trap(void)
  18104.   {
  18105.     unsigned char       *packet_p;
  18106.     int                  rc;
  18107.     snmp_dpi_set_packet *varBind_p;
  18108.  
  18109.     varBind_p =                        /* init the varBindchain */
  18110.        snmp_dpi_set_packet_NULL_p,     /* to a NULL pointer     */
  18111.  
  18112.     varBind_p = mkDPIset(              /* Make DPI set packet   */
  18113.                   varBind_p,           /* ptr to varBind chain  */
  18114.                   DPI_SIMPLE_MIB,      /* ptr to sub-tree       */
  18115.                   DPI_SIMPLE_INTEGER,  /* ptr to rest of OID    */
  18116.                   SNMP_TYPE_Integer32, /* value type Integer 32 */
  18117.                   sizeof(value1),      /* length of value       */
  18118.                   &value1);            /* ptr to value          */
  18119.  
  18120.     if (!varBind_p) return(-1);        /* If it failed, return  */
  18121.  
  18122.     varBind_p = mkDPIset(                 /* Make DPI set packet*/
  18123.                   varBind_p,              /* ptr to varBindchain*/
  18124.                   DPI_SIMPLE_MIB,         /* ptr to sub-tree    */
  18125.                   DPI_SIMPLE_STRING,      /* ptr to rest of OID */
  18126.                   SNMP_TYPE_DisplayString,/* value type         */
  18127.                   strlen(value2_p),       /* length of value    */
  18128.                   value2_p);              /* ptr to value       */
  18129.  
  18130.     if (!varBind_p) return(-1);        /* If it failed, return  */
  18131.  
  18132.  
  18133.     varBind_p = mkDPIset(                 /* Make DPI set packet*/
  18134.                   varBind_p,              /* ptr to varBindchain*/
  18135.                   DPI_SIMPLE_MIB,         /* ptr to sub-tree    */
  18136.                   DPI_SIMPLE_COUNTER32,   /* ptr to rest of OID */
  18137.                   SNMP_TYPE_Counter32,    /* value type         */
  18138.                   sizeof(value3),         /* length of value    */
  18139.                   &value3);               /* ptr to value       */
  18140.  
  18141.     if (!varBind_p) return(-1);        /* If it failed, return  */
  18142.  
  18143.     packet_p = mkDPItrap(              /* Make DPItrap packet   */
  18144.                  6,                    /* enterpriseSpecific    */
  18145.                  1,                    /* specific type = 1     */
  18146.                  varBind_p,            /* varBind data, and use */
  18147.                  (char *)0);           /* default enterpriseID  */
  18148.  
  18149.     if (!packet_p) return(-1);         /* If it failed, return  */
  18150.  
  18151.     rc  = DPIsend_packet_to_agent(     /* send TRAP packet      */
  18152.              handle,                   /* on this connection    */
  18153.              packet_p,                 /* this is the packet    */
  18154.              DPI_PACKET_LEN(packet_p));/* and this is its length*/
  18155.  
  18156.     return(rc);                        /* return retcode        */
  18157.   } /* end of do_trap() */
  18158.  
  18159.  
  18160. ΓòÉΓòÉΓòÉ 12. NETWORKS File Structure ΓòÉΓòÉΓòÉ
  18161.  
  18162. The NETWORKS file contains the network name, number, and alias or aliases of 
  18163. known networks. The NETWORKS file must reside in the directory specified by the 
  18164. ETC environment variable. The NETWORKS file is used only by the following 
  18165. socket calls: 
  18166.  
  18167.      endnetent() 
  18168.      getnetbyaddr() 
  18169.      getnetbyname() 
  18170.      getnetent() 
  18171.      setnetent() 
  18172.  
  18173.  Name Structures of Known Networks lists examples of network names contained in 
  18174.  the NETWORKS file. 
  18175.  
  18176.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18177.   Γöé Table 18. Name Structures of Known Networks                       Γöé
  18178.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18179.   Γöé NAME   Γöé                         Γöé               Γöé
  18180.   Γöé OF FILE  Γöé CONTENTS OF FILE                Γöé SAMPLE FILE ENTRIES     Γöé
  18181.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18182.   Γöé NETWORKS Γöé official_network_name network_number alias   Γöé ne-region 128.1 classb.net1Γöé
  18183.   Γöé      Γöé                         Γöé at1-region 128.2 classb.netΓöé
  18184.   Γöé      Γöé                         Γöé lab-net 192.5.1 classc.net5Γöé
  18185.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18186.  
  18187.  
  18188. ΓòÉΓòÉΓòÉ 13. Socket Error Constants ΓòÉΓòÉΓòÉ
  18189.  
  18190. The following table provides the error constants set by socket calls. This 
  18191. table can be found in the <NERRNO.H> header file. 
  18192.  
  18193.  
  18194. /*
  18195.  * The redefinition of error constants is necessary to avoid conflict with
  18196.  * standard compiler error constants.
  18197.  *
  18198.  * All OS/2 SOCKETS API error constants are biased by SOCBASEERR from the "normal"
  18199.  *
  18200.  */
  18201.  
  18202. #define SOCBASEERR              10000
  18203.  
  18204. /*
  18205.  * OS/2 SOCKETS  API definitions of regular Microsoft C 6.0 error constants
  18206.  */
  18207.  
  18208. #define SOCEPERM           (SOCBASEERR+1)   /*Not owner*/
  18209. #define SOCESRCH           (SOCBASEERR+3)   /*No such process*/
  18210. #define SOCEINTR           (SOCBASEERR+4)   /*Interrupted system call*/
  18211. #define SOCENXIO           (SOCBASEERR+6)   /*No such device or address*/
  18212. #define SOCEBADF           (SOCBASEERR+9)   /*Bad file number*/
  18213. #define SOCEACCES          (SOCBASEERR+13)  /*Permission denied*/
  18214. #define SOCEFAULT          (SOCBASEERR+14)  /*Bad address*/
  18215. #define SOCEINVAL          (SOCBASEERR+22)  /*Invalid argument*/
  18216. #define SOCEMFILE          (SOCBASEERR+24)  /*Too many open files*/
  18217. #define SOCEPIPE           (SOCBASEERR+32)  /*Broken pipe*/
  18218.  
  18219. #define SOCEOS2ERR         (SOCBASEERR+100) /*OS/2 Error*/
  18220.  
  18221. /*
  18222.  * OS/2 SOCKETS API definitions of regular BSD error constants
  18223.  */
  18224.  
  18225. #define SOCEWOULDBLOCK     (SOCBASEERR+35)  /*Operation would block*/
  18226. #define SOCEINPROGRESS     (SOCBASEERR+36)  /*Operation now in progress*/
  18227. #define SOCEALREADY        (SOCBASEERR+37)  /*Operation already in progress*/
  18228. #define SOCENOTSOCK        (SOCBASEERR+38)  /*Socket operation on non-socket*/
  18229. #define SOCEDESTADDRREQ    (SOCBASEERR+39)  /*Destination address required*/
  18230. #define SOCEMSGSIZE        (SOCBASEERR+40)  /*Message too long*/
  18231. #define SOCEPROTOTYPE      (SOCBASEERR+41)  /*Protocol wrong type for socket*/
  18232. #define SOCENOPROTOOPT     (SOCBASEERR+42)  /*Protocol not available*/
  18233. #define SOCEPROTONOSUPPORT (SOCBASEERR+43)  /*Protocol not supported*/
  18234. #define SOCESOCKTNOSUPPORT (SOCBASEERR+44)  /*Socket type not supported*/
  18235. #define SOCEOPNOTSUPP      (SOCBASEERR+45)  /*Operation not supported on socket*/
  18236. #define SOCEPFNOSUPPORT    (SOCBASEERR+46)  /*Protocol family not supported*/
  18237. #define SOCEAFNOSUPPORT    (SOCBASEERR+47)  /*Address family not supported by protocol family*/
  18238. #define SOCEADDRINUSE      (SOCBASEERR+48)  /*Address already in use*/
  18239. #define SOCEADDRNOTAVAIL   (SOCBASEERR+49)  /*Can't assign requested address*/
  18240. #define SOCENETDOWN        (SOCBASEERR+50)  /*Network is down*/
  18241. #define SOCENETUNREACH     (SOCBASEERR+51)  /*Network is unreachable*/
  18242. #define SOCENETRESET       (SOCBASEERR+52)  /*Network dropped connection on reset*/
  18243. #define SOCECONNABORTED    (SOCBASEERR+53)  /*Software caused connection abort*/
  18244. #define SOCECONNRESET      (SOCBASEERR+54)  /*Connection reset by peer*/
  18245. #define SOCENOBUFS         (SOCBASEERR+55)  /*No buffer space available*/
  18246. #define SOCEISCONN         (SOCBASEERR+56)  /*Socket is already connected*/
  18247. #define SOCENOTCONN        (SOCBASEERR+57)  /*Socket is not connected*/
  18248. #define SOCESHUTDOWN       (SOCBASEERR+58)  /*Can't send after socket shutdown*/
  18249. #define SOCETOOMANYREFS    (SOCBASEERR+59)  /*Too many references: can't splice*/
  18250. #define SOCETIMEDOUT       (SOCBASEERR+60)  /*Connection timed out*/
  18251. #define SOCECONNREFUSED    (SOCBASEERR+61)  /*Connection refused*/
  18252. #define SOCELOOP           (SOCBASEERR+62)  /*Too many levels of symbolic links*/
  18253. #define SOCENAMETOOLONG    (SOCBASEERR+63)  /*File name too long*/
  18254. #define SOCEHOSTDOWN       (SOCBASEERR+64)  /*Host is down*/
  18255. #define SOCEHOSTUNREACH    (SOCBASEERR+65)  /*No route to host*/
  18256. #define SOCENOTEMPTY       (SOCBASEERR+66)  /*Directory not empty*/
  18257.  
  18258. /*
  18259.  * OS/2 SOCKETS API errors redefined as regular BSD error constants
  18260.  */
  18261.  
  18262. #define EWOULDBLOCK         SOCEWOULDBLOCK
  18263. #define EINPROGRESS         SOCEINPROGRESS
  18264. #define EALREADY            SOCEALREADY
  18265. #define ENOTSOCK            SOCENOTSOCK
  18266. #define EDESTADDRREQ        SOCEDESTADDRREQ
  18267. #define EMSGSIZE            SOCEMSGSIZE
  18268. #define EPROTOTYPE          SOCEPROTOTYPE
  18269. #define ENOPROTOOPT         SOCENOPROTOOPT
  18270. #define EPROTONOSUPPORT     SOCEPROTONOSUPPORT
  18271. #define ESOCKTNOSUPPORT     SOCESOCKTNOSUPPORT
  18272. #define EOPNOTSUPP          SOCEOPNOTSUPP
  18273. #define EPFNOSUPPORT        SOCEPFNOSUPPORT
  18274. #define EAFNOSUPPORT        SOCEAFNOSUPPORT
  18275. #define EADDRINUSE          SOCEADDRINUSE
  18276. #define EADDRNOTAVAIL       SOCEADDRNOTAVAIL
  18277. #define ENETDOWN            SOCENETDOWN
  18278. #define ENETUNREACH         SOCENETUNREACH
  18279. #define ENETRESET           SOCENETRESET
  18280. #define ECONNABORTED        SOCECONNABORTED
  18281. #define ECONNRESET          SOCECONNRESET
  18282. #define ENOBUFS             SOCENOBUFS
  18283. #define EISCONN             SOCEISCONN
  18284. #define ENOTCONN            SOCENOTCONN
  18285. #define ESHUTDOWN           SOCESHUTDOWN
  18286. #define ETOOMANYREFS        SOCETOOMANYREFS
  18287. #define ETIMEDOUT           SOCETIMEDOUT
  18288. #define ECONNREFUSED        SOCECONNREFUSED
  18289. #define ELOOP               SOCELOOP
  18290. #define ENAMETOOLONG        SOCENAMETOOLONG
  18291. #define EHOSTDOWN           SOCEHOSTDOWN
  18292. #define EHOSTUNREACH        SOCEHOSTUNREACH
  18293. #define ENOTEMPTY           SOCENOTEMPTY
  18294.  
  18295.  
  18296. ΓòÉΓòÉΓòÉ 14. Well-Known Port Assignments ΓòÉΓòÉΓòÉ
  18297.  
  18298. The following table is a list of the common well-known ports supported by 
  18299. TCP/IP. It provides the port number, keyword, and a description of the reserved 
  18300. port assignment. Port numbers of less than 1024 are reserved for system 
  18301. applications. You can also find a complete list of well-known port numbers in 
  18302. the ETC\SERVICES file. 
  18303.  
  18304. TCP Well-Known Port Assignments 
  18305.  
  18306. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18307. Γöé Table 19. TCP Well-Known Port Assignments                                       Γöé
  18308. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18309. Γöé PORT NUMBER   Γöé KEYWORD   Γöé RESERVED FOR           Γöé SERVICES DESCRIPTION                Γöé
  18310. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18311. Γöé 0        Γöé       Γöé reserved             Γöé                           Γöé
  18312. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18313. Γöé 5        Γöé RJE     Γöé remote job entry         Γöé remote job entry                  Γöé
  18314. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18315. Γöé 7        Γöé ECHO    Γöé echo               Γöé echo                        Γöé
  18316. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18317. Γöé 9        Γöé DISCARD   Γöé discard              Γöé sink null                      Γöé
  18318. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18319. Γöé 11        Γöé SYSTAT   Γöé active users           Γöé active users                    Γöé
  18320. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18321. Γöé 13        Γöé DAYTIME   Γöé daytime              Γöé daytime                       Γöé
  18322. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18323. Γöé 15        Γöé NETSTAT   Γöé Netstat              Γöé who is up or Netstat                Γöé
  18324. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18325. Γöé 19        Γöé CHARGEN   Γöé ttytst source           Γöé character generator                 Γöé
  18326. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18327. Γöé 21        Γöé FTP     Γöé FTP                Γöé File Transfer Protocol               Γöé
  18328. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18329. Γöé 23        Γöé TELNET   Γöé Telnet              Γöé Telnet                       Γöé
  18330. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18331. Γöé 25        Γöé SMTP    Γöé mail               Γöé Simple Mail Transfer Protocol            Γöé
  18332. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18333. Γöé 37        Γöé TIME    Γöé timeserver            Γöé timeserver                     Γöé
  18334. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18335. Γöé 39        Γöé RLP     Γöé resource             Γöé Resource Location Protocol             Γöé
  18336. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18337. Γöé 42        Γöé NAMESERVER Γöé name               Γöé host name server                  Γöé
  18338. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18339. Γöé 43        Γöé NICNAME   Γöé who is              Γöé who is                       Γöé
  18340. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18341. Γöé 53        Γöé DOMAIN   Γöé name server            Γöé domain name server                 Γöé
  18342. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18343. Γöé 57        Γöé MTP     Γöé private terminal access      Γöé private terminal access               Γöé
  18344. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18345. Γöé 67        Γöé BOOTPS   Γöé bootps dhcps           Γöé bootp server                    Γöé
  18346. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18347. Γöé 68        Γöé BOOTPC   Γöé bootpc dhcpc           Γöé bootp client                    Γöé
  18348. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18349. Γöé 69        Γöé TFTP    Γöé TFTP               Γöé Trivial File Transfer Protocol           Γöé
  18350. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18351. Γöé 70        Γöé GOPHER   Γöé gopher              Γöé Gopher                       Γöé
  18352. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18353. Γöé 77        Γöé       Γöé netrjs              Γöé any private RJE service               Γöé
  18354. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18355. Γöé 79        Γöé FINGER   Γöé finger              Γöé finger                       Γöé
  18356. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18357. Γöé 80        Γöé WWW-HTTP  Γöé www-http             Γöé World Wide Web HTTP                 Γöé
  18358. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18359. Γöé 87        Γöé LINK    Γöé ttylink              Γöé any private terminal link              Γöé
  18360. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18361. Γöé 95        Γöé SUPDUP   Γöé supdup              Γöé SUPDUP Protocol                   Γöé
  18362. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18363. Γöé 101       Γöé HOSTNAME  Γöé hostname             Γöé nic hostname server, usually from SRI-NIC      Γöé
  18364. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18365. Γöé 109       Γöé POP     Γöé postoffice            Γöé Post Office Protocol                Γöé
  18366. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18367. Γöé 111       Γöé SUNRPC   Γöé sunrpc              Γöé Sun remote procedure call              Γöé
  18368. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18369. Γöé 113       Γöé AUTH    Γöé authentication          Γöé authentication service               Γöé
  18370. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18371. Γöé 115       Γöé SFTP    Γöé sftp               Γöé Simple File Transfer Protocol            Γöé
  18372. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18373. Γöé 117       Γöé UUCP-PATH  Γöé UUCP path service         Γöé UUCP path service                  Γöé
  18374. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18375. Γöé 119       Γöé UNTP    Γöé readnews untp           Γöé USENET News Transfer Protocol            Γöé
  18376. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18377. Γöé 123       Γöé NTP     Γöé NTP                Γöé Network Time Protocol                Γöé
  18378. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18379. Γöé 160       Γöé       Γöé reserved             Γöé                           Γöé
  18380. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18381. Γöé 161       Γöé SNMP    Γöé SNMP Agent            Γöé SNMP Agent receives packets             Γöé
  18382. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18383. Γöé 162       Γöé SNMPTRAP  Γöé SNMP Client            Γöé SNMP Client receives SNMP TRAPs           Γöé
  18384. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18385. Γöé 163-223     Γöé       Γöé reserved             Γöé                           Γöé
  18386. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18387. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18388. Γöé Table 19. TCP Well-Known Port Assignments                                       Γöé
  18389. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18390. Γöé PORT NUMBER   Γöé KEYWORD   Γöé RESERVED FOR           Γöé SERVICES DESCRIPTION                Γöé
  18391. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18392. Γöé 449       Γöé AS-SVRMAP  Γöé mapper function for AS/400    Γöé servers for signon, central management, network   Γöé
  18393. Γöé         Γöé       Γöé servers              Γöé print, database, stream file, data queue, and    Γöé
  18394. Γöé         Γöé       Γöé                  Γöé remote command and distributed program calls.    Γöé
  18395. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18396. Γöé 712       Γöé VEXEC    Γöé vice-exec             Γöé Andrew File System authenticated service      Γöé
  18397. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18398. Γöé 713       Γöé VLOGIN   Γöé vice-login            Γöé Andrew File System authenticated service      Γöé
  18399. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18400. Γöé 714       Γöé VSHELL   Γöé vice-shell            Γöé Andrew File System authenticated service      Γöé
  18401. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18402. Γöé 2001       Γöé FILESRV   Γöé                  Γöé Andrew File System service             Γöé
  18403. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18404. Γöé 2106       Γöé VENUS.ITC  Γöé                  Γöé Andrew File System service, for the Venus process  Γöé
  18405. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18406.  
  18407. UDP Well-Known Port Assignments 
  18408.  
  18409. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18410. Γöé Table 20. UDP Well-Known Port Assignments                                       Γöé
  18411. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18412. Γöé PORT NUMBER   Γöé KEYWORD   Γöé RESERVED FOR           Γöé SERVICES DESCRIPTION                Γöé
  18413. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18414. Γöé 0        Γöé       Γöé reserved             Γöé                           Γöé
  18415. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18416. Γöé 5        Γöé RJE     Γöé remote job entry         Γöé remote job entry                  Γöé
  18417. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18418. Γöé 7        Γöé ECHO    Γöé echo               Γöé echo                        Γöé
  18419. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18420. Γöé 9        Γöé DISCARD   Γöé discard              Γöé sink null                      Γöé
  18421. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18422. Γöé 11        Γöé USERS    Γöé active users           Γöé active users                    Γöé
  18423. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18424. Γöé 13        Γöé DAYTIME   Γöé daytime              Γöé daytime                       Γöé
  18425. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18426. Γöé 15        Γöé NETSTAT   Γöé Netstat              Γöé Netstat                       Γöé
  18427. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18428. Γöé 19        Γöé CHARGEN   Γöé ttytst source           Γöé character generator                 Γöé
  18429. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18430. Γöé 37        Γöé TIME    Γöé timeserver            Γöé timeserver                     Γöé
  18431. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18432. Γöé 39        Γöé RLP     Γöé resource             Γöé Resource Location Protocol             Γöé
  18433. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18434. Γöé 42        Γöé NAMESERVER Γöé name               Γöé host name server                  Γöé
  18435. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18436. Γöé 43        Γöé NICNAME   Γöé who is              Γöé who is                       Γöé
  18437. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18438. Γöé 53        Γöé DOMAIN   Γöé name server            Γöé domain name server                 Γöé
  18439. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18440. Γöé 67        Γöé BOOTPS   Γöé bootps dhcps           Γöé bootp server                    Γöé
  18441. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18442. Γöé 68        Γöé BOOTPC   Γöé bootpc dhcpc           Γöé bootp client                    Γöé
  18443. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18444. Γöé 69        Γöé TFTP    Γöé TFTP               Γöé Trivial File Transfer Protocol           Γöé
  18445. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18446. Γöé 70        Γöé GOPHER   Γöé gopher              Γöé Gopher                       Γöé
  18447. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18448. Γöé 75        Γöé       Γöé                  Γöé any private dial out service            Γöé
  18449. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18450. Γöé 77        Γöé       Γöé netrjs              Γöé any private RJE service               Γöé
  18451. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18452. Γöé 79        Γöé FINGER   Γöé finger              Γöé finger                       Γöé
  18453. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18454. Γöé 80        Γöé WWW-HTTP  Γöé www-http             Γöé World Wide Web HTTP                 Γöé
  18455. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18456. Γöé 111       Γöé SUNRPC   Γöé sunrpc              Γöé Sun remote procedure call              Γöé
  18457. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18458. Γöé 123       Γöé NTP     Γöé NTP                Γöé Network Time Protocol                Γöé
  18459. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18460. Γöé 135       Γöé LLBD    Γöé NCS LLBD             Γöé NCS local location broker daemon          Γöé
  18461. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18462. Γöé 160-223     Γöé       Γöé reserved             Γöé                           Γöé
  18463. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18464. Γöé 531       Γöé RVD-CONTROLΓöé                  Γöé rvd control port                  Γöé
  18465. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18466. Γöé 2001       Γöé RAUTH2   Γöé                  Γöé Andrew File System service, for the Venus process  Γöé
  18467. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18468. Γöé 2002       Γöé RFILEBULK  Γöé                  Γöé Andrew File System service, for the Venus process  Γöé
  18469. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18470. Γöé 2003       Γöé RFILESRV  Γöé                  Γöé Andrew File System service, for the Venus process  Γöé
  18471. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18472. Γöé 2018       Γöé CONSOLE   Γöé                  Γöé Andrew File System service             Γöé
  18473. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18474. Γöé 2115       Γöé ROPCONS   Γöé                  Γöé Andrew File System service, for the Venus process  Γöé
  18475. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18476. Γöé 2131       Γöé RUPDSRV   Γöé                  Γöé assigned in pairs; bulk must be SRV +1       Γöé
  18477. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18478. Γöé 2132       Γöé RUPDBULK  Γöé                  Γöé assigned in pairs; bulk must be SRV +1       Γöé
  18479. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18480. Γöé 2133       Γöé RUPDSRV1  Γöé                  Γöé assigned in pairs; bulk must be SRV +1       Γöé
  18481. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18482. Γöé 2134       Γöé RUPDBULK1  Γöé                  Γöé assigned in pairs; bulk must be SRV +1       Γöé
  18483. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18484.  
  18485.  
  18486. ΓòÉΓòÉΓòÉ 15. Notices ΓòÉΓòÉΓòÉ
  18487.  
  18488. First Edition (December 1995) 
  18489.  
  18490. The following paragraph does not apply to the United Kingdom or any country 
  18491. where such provisions are inconsistent with local law:  INTERNATIONAL BUSINESS 
  18492. MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY 
  18493. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  18494. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states 
  18495. do not allow disclaimer of express or implied warranties in certain 
  18496. transactions, therefore, this statement may not apply to you. 
  18497.  
  18498. This publication could include technical inaccuracies or typographical errors. 
  18499. Changes are periodically made to the information herein; these changes will be 
  18500. incorporated in new editions of the publication. IBM may make improvements 
  18501. and/or changes in the product(s) and/or the program(s) described in this 
  18502. publication at any time. 
  18503.  
  18504. It is possible that this publication may contain reference to, or information 
  18505. about, IBM products (machines and programs), programming, or services that are 
  18506. not announced in your country.  Such references or information must not be 
  18507. construed to mean that IBM intends to announce such IBM products, programming, 
  18508. or services in your country. 
  18509.  
  18510. Requests for technical information about IBM products should be made to your 
  18511. IBM reseller or IBM marketing representative. 
  18512.  
  18513.  
  18514. ΓòÉΓòÉΓòÉ 15.1. Copyright Notices ΓòÉΓòÉΓòÉ
  18515.  
  18516. COPYRIGHT LICENSE: This publication contains printed sample application 
  18517. programs in source language, which illustrate OS/2 programming techniques. You 
  18518. may copy, modify, and distribute these sample programs in any form without 
  18519. payment to IBM, for the purposes of developing, using, marketing or 
  18520. distributing application programs conforming to the OS/2 application 
  18521. programming interface. 
  18522.  
  18523. (C)Copyright International Business Machines Corporation 1995.  All rights 
  18524. reserved. 
  18525. Note to U.S. Government Users - Documentation related to restricted rights - 
  18526. Use, duplication or disclosure is subject to restrictions set forth in GSA ADP 
  18527. Schedule Contract with IBM Corp. 
  18528.  
  18529. IBM is required to include the following statements in order to distribute 
  18530. portions of this document and the software described herein. 
  18531.  
  18532. Sun RPC is a product of Sun Microsystems, Inc. and is provided for unrestricted 
  18533. use provided that this legend is included on all tape media and as a part of 
  18534. the software program in whole or part.  Users may copy or modify Sun RPC 
  18535. without charge, but are not authorized to license or distribute it to anyone 
  18536. else except as part of a product or program developed by the user. 
  18537.  
  18538. SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 
  18539. WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, OR 
  18540. ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 
  18541.  
  18542. Sun RPC is provided with no support and without any obligation on the part of 
  18543. Sun Microsystems, Inc. to assist in its use, correction, modification or 
  18544. enhancement. 
  18545.  
  18546. SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT 
  18547. OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC OR ANY PART THEREOF. 
  18548.  
  18549. In no event will Sun Microsystems, Inc. be liable for any lost revenue or 
  18550. profits or other special, indirect and consequential damages, even if Sun has 
  18551. been advised of the possibility of such damages. 
  18552.  
  18553. Copyright (c) 1989 The Regents of the University of California. All rights 
  18554. reserved. 
  18555.  
  18556. Redistribution and use in source and binary forms, with or without 
  18557. modification, are permitted provided that the following conditions are met: 
  18558.  
  18559.      Redistributions of source code must retain the above copyright notice, 
  18560.       this list of conditions and the following disclaimer. 
  18561.      Redistributions in binary form must reproduce the above copyright notice, 
  18562.       this list of conditions and the following disclaimer in the documentation 
  18563.       and/or other materials provided with the distribution. 
  18564.      All advertising materials mentioning features or use of this software 
  18565.       must display the following acknowledgement: This product includes 
  18566.       software developed by the University of California, Berkeley and its 
  18567.       contributors. 
  18568.      Neither the name of the University nor the names of its contributors may 
  18569.       be used to endorse or promote products derived from this software without 
  18570.       specific prior written permission. 
  18571.  
  18572.  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY 
  18573.  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  18574.  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
  18575.  DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 
  18576.  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
  18577.  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
  18578.  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  18579.  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
  18580.  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
  18581.  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  18582.  
  18583.  Some portions of this publication relating to X Window System are Copyright 
  18584.  (c) 1987, 1988 by the Massachusetts Institute of Technology, Cambridge, 
  18585.  Massachusetts; by Digital Equipment Corporation, Maynard, Massachusetts; and 
  18586.  by Hewlett-Packard Corporation. All Rights Reserved. 
  18587.  
  18588.  Permission to use, copy, modify, and distribute the M.I.T., Digital Equipment 
  18589.  Corporation, and Hewlett-Packard Corporation portions of this software and its 
  18590.  documentation for any purpose without fee is hereby granted, provided that the 
  18591.  above copyright notice appears in all copies and that both that copyright 
  18592.  notice and this permission notice appear in supporting documentation, and that 
  18593.  the names of M.I.T., Digital, and Hewlett-Packard not be used in advertising 
  18594.  or publicity pertaining to distribution of the software without specific, 
  18595.  written prior permission. M.I.T., Digital, and Hewlett-Packard make no 
  18596.  representation about the suitability of this software for any purpose. It is 
  18597.  provided "as is" without express or implied warranty. 
  18598.  
  18599.  
  18600. ΓòÉΓòÉΓòÉ 15.2. Disclaimers ΓòÉΓòÉΓòÉ
  18601.  
  18602. References in this publication to IBM products, programs, or services do not 
  18603. imply that IBM intends to make these available in all countries in which IBM 
  18604. operates. Any reference to an IBM product, program or service is not intended 
  18605. to state or imply that only IBM's product, program, or service may be used. 
  18606. Subject to IBM's valid intellectual property or other legally protectable 
  18607. rights, any functionally equivalent product, program, or service may be used 
  18608. instead of the IBM product, program, or service. Evaluation and verification of 
  18609. operation in conjunction with other products, programs, or services, except 
  18610. those expressly designated by IBM, are the user's responsibility. 
  18611.  
  18612. IBM may have patents or pending patent applications covering subject matter in 
  18613. this document. The furnishing of this document does not give you any license to 
  18614. these patents. You can send license inquiries, in writing, to the IBM Director 
  18615. of Licensing, IBM Corporation, 500 Columbus Avenue, Thornwood, NY 10594, U.S.A. 
  18616.  
  18617. Licensees of this program who wish to have information about it for the purpose 
  18618. of enabling:  (i) the exchange of information between independently created 
  18619. programs and other programs (including this one) and (ii) the mutual use of the 
  18620. information which has been exchanged, should contact IBM Corporation, 
  18621. Department RM1A, 1000 N.W. 51st Street, Boca Raton, FL 33431, U.S.A.  Such 
  18622. information may be available, subject to appropriate terms and conditions, 
  18623. including in some cases, payment of a fee. 
  18624.  
  18625.  
  18626. ΓòÉΓòÉΓòÉ 15.3. Trademarks ΓòÉΓòÉΓòÉ
  18627.  
  18628. The following terms are trademarks of the IBM Corporation in the United States 
  18629. or other countries or both: 
  18630.  
  18631.       AS/400 
  18632.       C Set++ 
  18633.       IBM 
  18634.       OS/2 
  18635.       Operating System/2 
  18636.       VisualAge 
  18637.  
  18638.  The following terms are trademarks of other companies: 
  18639.  
  18640.  UNIX is a trademark of UNIX System Laboratories, Inc. 
  18641.  
  18642.  Other company, product, and service names, which may be denoted by a double 
  18643.  asterisk (**), may be trademarks or service marks of others.