home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcppr41.zip / tcppr.inf (.txt)
OS/2 Help File  |  1997-09-09  |  567KB  |  21,009 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. About This Information ΓòÉΓòÉΓòÉ
  3.  
  4. This IBM TCP/IP for OS/2 Warp Programming Reference describes the routines for 
  5. application programming in the TCP/IP for OS/2 Warp environment on a 
  6. workstation. 
  7.  
  8. This edition applies to the IBM TCP/IP Version 4.1 for OS/2 Warp licensed 
  9. program. 
  10.  
  11. This section describes: 
  12.  
  13.      Primary users of this information 
  14.  
  15.      Content of each major information division 
  16.  
  17.      Conventions used in this information 
  18.  
  19.      New functions in this information 
  20.  
  21.      Where to find more information 
  22.  
  23.  
  24. ΓòÉΓòÉΓòÉ 1.1. Who Should Use This Information ΓòÉΓòÉΓòÉ
  25.  
  26. This information is intended for application and system programmers with 
  27. experience in writing application programs on a workstation. You should also be 
  28. familiar with the OS/2 operating system and know multitasking operating system 
  29. concepts.  It is important that you also know the C programming language. 
  30.  
  31. If you are not familiar with TCP/IP concepts, see Internetworking With TCP/IP 
  32. Volume I:  Principles, Protocols, and Architecture , and Internetworking With 
  33. TCP/IP Volume II:  Implementation and Internals. 
  34.  
  35.  
  36. ΓòÉΓòÉΓòÉ 1.2. What This Information Describes ΓòÉΓòÉΓòÉ
  37.  
  38. This document contains guidance and reference information about the following 
  39. topics. 
  40.  
  41. Guidance Information 
  42.  
  43.      Sockets General Programming Information 
  44.  
  45.       Describes the TCP/IP socket interface and how to use the socket routines 
  46.       in a user-written application. 
  47.  
  48.      Sockets in the Internet Domain 
  49.  
  50.       Describes TCP/IP network protocols, getting started with sockets in the 
  51.       Internet domain, Internet address formats, and TCP/IP-specific network 
  52.       utility routines. 
  53.  
  54.      Sockets over Local IPC 
  55.  
  56.       Describes how programmers can communicate on the same machine using the 
  57.       sockets API, and the local IPC address format. 
  58.  
  59.      Sockets over NetBIOS 
  60.  
  61.       Describes how programmers can communicate with NetBIOS using the sockets 
  62.       API, and the NetBIOS address format. 
  63.  
  64.      Windows Sockets Version 1.1 for OS/2 
  65.  
  66.       Presents information for implementing the Winsock 1.1 API for OS/2 
  67.       applications. 
  68.  
  69.      Remote Procedure Calls 
  70.  
  71.       Describes the remote procedure calls and how to use them in a 
  72.       user-written application. 
  73.  
  74.      File Transfer Protocol 
  75.  
  76.       Describes the file transfer protocol routines and how to use them in a 
  77.       user-written application. 
  78.  
  79.      Resource ReSerVation Protocol 
  80.  
  81.       Describes the resource reservation protocol routines and how to use them 
  82.       in a user-written application. 
  83.  
  84.  Reference Information 
  85.  
  86.      Protocol-Independent C Sockets API 
  87.  
  88.       Describes the protocol-independent socket calls supported by networking 
  89.       services. This information includes call syntax, usage, and related 
  90.       information. 
  91.  
  92.      TCP/IP Network Utility Routines API 
  93.  
  94.       Describes the sockets utility and Sockets Secure Support (SOCKS) function 
  95.       calls supported by networking services. This information includes call 
  96.       syntax, usage, and related information. 
  97.  
  98.      Remote Procedure and eXternal Data Representation API 
  99.  
  100.       Describes the remote procedure and XDR function calls along with their 
  101.       syntax, usage, and related information. 
  102.  
  103.      File Transfer Protocol API 
  104.  
  105.       Describes the file transfer protocol function calls along with their 
  106.       syntax, usage, and related information. 
  107.  
  108.      Resource ReSerVation Protocol API 
  109.  
  110.       Describes the resource reservation protocol function calls along with 
  111.       their syntax, usage, and related information. 
  112.  
  113.  Appendixes 
  114.  
  115.      NETWORKS File Structure 
  116.  
  117.       Provides examples of network names contained in the TCPIP\ETC\NETWORKS 
  118.       file. 
  119.  
  120.      Socket Error Constants 
  121.  
  122.       Provides the socket error codes and descriptions. 
  123.  
  124.      Well-Known Port Assignments 
  125.  
  126.       Provides a list of the well-known ports supported by TCP/IP. 
  127.  
  128.      Notices 
  129.  
  130.       Contains copyright notices, disclaimers, and trademarks relating to 
  131.       TCP/IP for OS/2 Warp. 
  132.  
  133.  This information also includes index and search functions, which are available 
  134.  using the push buttons at the bottom of the information window. 
  135.  
  136.  
  137. ΓòÉΓòÉΓòÉ 1.3. Conventions Used in This Information ΓòÉΓòÉΓòÉ
  138.  
  139. How the Term "Internet" Is Used 
  140.  
  141. An internet is a logical collection of networks supported by gateways, routers, 
  142. bridges, hosts, and various layers of protocols that permit the network to 
  143. function as a large, virtual network. 
  144.  
  145. The term internet is used as a generic term for a TCP/IP network and should not 
  146. be confused with the Internet (note capital I), which consists of large 
  147. national backbone networks (such as MILNET, NSFNet, and CREN) and myriad 
  148. regional and local campus networks all over the world. 
  149.  
  150.  
  151. ΓòÉΓòÉΓòÉ 1.4. What Is New in This Information ΓòÉΓòÉΓòÉ
  152.  
  153. Changes have been made for two versions of TCP/IP for OS/2 
  154.  
  155.      If you have upgraded from TCP/IP for OS/2 Warp Server or OS/2 Warp Server 
  156.       SMP, read Changes in Version 4 (Merlin) plus Changes in Version 4.1. 
  157.  
  158.      If you have upgraded from TCP/IP for OS/2 Version 4 (Merlin), read 
  159.       Changes in Version 4.1. 
  160.  
  161.  
  162. ΓòÉΓòÉΓòÉ 1.4.1. Changes in Version 4.1 ΓòÉΓòÉΓòÉ
  163.  
  164. Descriptions of TCP Extensions for Transactions (T/TCP), TCP Extensions for 
  165. High Performance, and High Performance Send (HPS) have been added to Sockets 
  166. General Programming Information. 
  167.  
  168. The Resource ReSerVation Protocol (RSVP) has been added. See: 
  169.  
  170.       Resource ReSerVation Protocol 
  171.       Resource ReSerVation Protocol API 
  172.  
  173.  Support for Berkley Software Distribution (BSD) Version 4.4 is added. 
  174.  
  175.       In Protocol-Independent C Sockets API, changes have been made to 
  176.       getsockopt() and setsockopt(). sysctl() has been added. The ioctl() call 
  177.       has been split into os2_ioctl() for OS/2 and ioctl() for BSD, and the 
  178.       select() call has been split into os2_select() for OS/2 and select() for 
  179.       BSD. The sock_init() call has been removed. 
  180.  
  181.       In TCP/IP Network Utility Routines API, the bswap(), lswap() and 
  182.       tcp_h_errno() calls have been removed. 
  183.  
  184.  In File Transfer Protocol API, additions have been made to the host parameter 
  185.  to allow you to specify the port number used by the FTP server. 
  186.  
  187.  
  188. ΓòÉΓòÉΓòÉ 1.4.2. Changes in Version 4 (Merlin) ΓòÉΓòÉΓòÉ
  189.  
  190. This edition reorganizes the information from the previous edition into 
  191. guidance and reference sections, adds substantially to the sockets guidance 
  192. material in Sockets General Programming Information and Sockets in the Internet 
  193. Domain, and also adds the following function calls: 
  194.  
  195. In Protocol-Independent C Sockets API: 
  196.  
  197.       addsockettolist() 
  198.       removesocketfromlist() 
  199.  
  200.  In TCP/IP Network Utility Routines API: 
  201.  
  202.       dn_find() 
  203.       dn_skipname() 
  204.       _getlong() 
  205.       _getshort() 
  206.       h_errno 
  207.       putlong() 
  208.       putshort() 
  209.       Raccept() 
  210.       Rbind() 
  211.       Rconnect() 
  212.       res_query() 
  213.       res_querydomain() 
  214.       res_search() 
  215.       rexec() 
  216.       Rgethostbyname() 
  217.       Rgetsockname() 
  218.       Rlisten() 
  219.  
  220.  In addition, the os2_connect() and os2_gethostbyname() calls have been 
  221.  removed; see connect() and gethostbyname() instead. 
  222.  
  223.  
  224. ΓòÉΓòÉΓòÉ 1.5. For More Information ΓòÉΓòÉΓòÉ
  225.  
  226. You may purchase this information in printed form by ordering IBM publication 
  227. number SC31-8407. U.S. customers can order by calling IBM Software 
  228. Manufacturing Solutions at 1-800-879-2755.  Outside the U.S., customers should 
  229. contact the IBM branch office serving their locality. 
  230.  
  231.  
  232. ΓòÉΓòÉΓòÉ 2. Guidance Information ΓòÉΓòÉΓòÉ
  233.  
  234. This section describes: 
  235.  
  236.      Sockets General Programming Information 
  237.  
  238.       Describes the TCP/IP socket interface and how to use the socket routines 
  239.       in a user-written application. 
  240.  
  241.      Sockets in the Internet Domain 
  242.  
  243.       Describes TCP/IP network protocols, getting started with sockets in the 
  244.       Internet domain, Internet address formats, and TCP/IP-specific network 
  245.       utility routines. 
  246.  
  247.      Sockets over Local IPC 
  248.  
  249.       Describes how programmers can communicate on the same machine using the 
  250.       sockets API, and the local IPC address format. 
  251.  
  252.      Sockets over NetBIOS 
  253.  
  254.       Describes how programmers can communicate with NetBIOS using the sockets 
  255.       API, and the NetBIOS address format. 
  256.  
  257.      Windows Sockets Version 1.1 for OS/2 
  258.  
  259.       Presents information for implementing the Winsock 1.1 API for OS/2 
  260.       applications. 
  261.  
  262.      Remote Procedure Calls 
  263.  
  264.       Describes the remote procedure calls and how to use them in a 
  265.       user-written application. 
  266.  
  267.      File Transfer Protocol 
  268.  
  269.       Describes the file transfer protocol routines and how to use them in a 
  270.       user-written application. 
  271.  
  272.      Resource ReSerVation Protocol 
  273.  
  274.       Describes the resource reservation protocol routines and how to use them 
  275.       to ensure that some quality of service can be reserved for sending and 
  276.       receiving on the network. 
  277.  
  278.  
  279. ΓòÉΓòÉΓòÉ 3. Sockets General Programming Information ΓòÉΓòÉΓòÉ
  280.  
  281. This section contains technical information for planning, designing, and 
  282. writing application programs that use the sockets application programming 
  283. interface (API) in a TCP/IP Version 4.1 for OS/2 Warp environment. 
  284.  
  285. Topics 
  286.  
  287.       Introduction to Networking Services 
  288.       Sockets Overview 
  289.       Socket Protocol Families 
  290.       Socket Addresses 
  291.       Socket Types 
  292.       Socket Creation 
  293.       Binding Names to Sockets 
  294.       Socket Connections 
  295.       Obtaining Socket Addresses 
  296.       Server Connections 
  297.       Connectionless Datagram Services 
  298.       Socket Options 
  299.       Socket Data Transfer 
  300.       Socket Shutdown 
  301.       Typical Socket Session Diagram 
  302.       TCP Extensions for Transactions (T/TCP) 
  303.       TCP Extensions for High Performance (RFC 1323) 
  304.       High Performance Send 
  305.       Passing Sockets Between Processes 
  306.       Multithreading Considerations 
  307.       Accessing a TCP/IP API DLL from an Intermediate DLL 
  308.       Differences between OS/2 and Standard BSD Sockets 
  309.       Compiling and Linking a Sockets API Application 
  310.       Sample Programs 
  311.  
  312.  
  313. ΓòÉΓòÉΓòÉ 3.1. Introduction to Networking Services ΓòÉΓòÉΓòÉ
  314.  
  315. OS/2 Warp has integrated networking services that provide a 32-bit sockets API 
  316. for the: 
  317.  
  318.      Internet (TCP/IP) domain 
  319.      NetBIOS communication domain 
  320.      Local interprocess communication (Local IPC) domain 
  321.  The sockets API lets you write distributed or client/server applications using 
  322.  TCP/IP or NetBIOS to communicate across networks. The API also allows 
  323.  interprocess communication within a single workstation. OS/2 Warp's sockets 
  324.  API is based on the Berkeley Software Distribution (BSD) Version 4.4 sockets 
  325.  implementation. 
  326.  
  327.  The OS/2 Warp operating system's networking services consists of three layers: 
  328.  
  329.      The sockets layer 
  330.      The protocol layer 
  331.      The device layer 
  332.  The sockets layer supplies the interface between the calls and lower layers, 
  333.  the protocol layer contains the protocol stacks used for communication, and 
  334.  the device layer contains the device drivers that control the network devices. 
  335.  The following figure illustrates the relationship between the layers: 
  336.  
  337.  
  338.   Client/Server Model
  339.  
  340.  Processes communicate using the client/server model. In this model, a server 
  341.  process acting as one endpoint of a two-way communication path listens to a 
  342.  socket. At the other end a client process communicates to the server process 
  343.  through another socket. The client process can be on the same machine or on a 
  344.  different machine from the server process. The protocol stack(s) on the 
  345.  machine(s) maintains internal connections, and routes data between the client 
  346.  and server. 
  347.  
  348.  The following figure describes the OS/2 Warp kernel and internal structure of 
  349.  TCP/IP Version 4.1 for OS/2 Warp. 
  350.  
  351.  
  352.   Internal Structure of TCP/IP
  353.  
  354.  The major components of the OS/2 TCP/IP stack are: 
  355.  
  356.  Control Program 
  357.  
  358.  CNTRL.EXE provides threads to run the TCP/IP stack.  It provides a thread for 
  359.  each of the following: 
  360.  
  361.      TCP fast timeout processing 
  362.      TCP slow timeout processing 
  363.      Debug thread for IP 
  364.      ARP timeout processing 
  365.      Watchdog thread for the adapter status 
  366.      Loopback IP packets processing 
  367.  
  368.  CNTRL.EXE is normally started from CONFIG.SYS with a RUN = statement.  It 
  369.  should be the first program to begin executing when TCP/IP is started. 
  370.  
  371.  Sockets Layer The sockets layer comprises the dynamic link libraries for the 
  372.  different categories of applications, and the device drivers. 
  373.  
  374.      DLLs: 
  375.  
  376.       TCPIP32.DLL exports the 32-bit BSD Version 4.4 sockets API to 
  377.       applications. TCP32DLL.DLL and SO32DLL.DLL together export the 32-bit BSD 
  378.       Version 4.3 socket APIs to applications. These three DLLs are 
  379.       thread-reentrant. TCPIPDLL.DLL provides the sockets APIs for 16-bit 
  380.       applications. 
  381.  
  382.      Device driver: 
  383.  
  384.       SOCKETS.SYS provides the common sockets layer for the protocol stacks. 
  385.       Calls made to the socket APIs first pass through SOCKETS.SYS, which 
  386.       routes the call to the correct protocol stack.  The socket address 
  387.       families supported are AF_OS2 (or equivalently, AF_UNIX), AF_INET, and 
  388.       AF_NETBIOS (or equivalently, AF_NB). 
  389.  
  390.  Protocol Layer The protocol layer holds the device drivers. 
  391.  
  392.  AFOS2.SYS is the  Local Interprocess Communication (LIPC) device driver.  This 
  393.  driver supports AF_OS2 and AF_UNIX socket types. These socket types can be 
  394.  used by applications within one OS/2 machine to communicate with each other. 
  395.  
  396.  AFNB.SYS device driver provides support for sockets over NetBIOS.  This driver 
  397.  supports applications written using the AF_NETBIOS or AF_NB socket type. 
  398.  
  399.  AFINET.SYS is the transport protocol device driver for the AF_INET socket 
  400.  type. AFINET.SYS is essentially TCP/IP code. It is compliant with NDIS version 
  401.  2.0.1; any MAC driver written to that specification should work with the 
  402.  stack. SLIP, PPP, X25, and SNAlink use a special interface in this driver to 
  403.  their respective hardware. 
  404.  
  405.  
  406. ΓòÉΓòÉΓòÉ 3.2. Sockets Overview ΓòÉΓòÉΓòÉ
  407.  
  408. This section provides some background information about the OS/2 Warp sockets 
  409. API, defines it in more detail, and describes its basic functions. 
  410.  
  411. Topics 
  412.  
  413.       Sockets Background 
  414.       What Is a Socket? 
  415.       Socket Facilities 
  416.  
  417.  
  418. ΓòÉΓòÉΓòÉ 3.2.1. Sockets Background ΓòÉΓòÉΓòÉ
  419.  
  420. The sockets API was developed in response to the need for sophisticated 
  421. interprocess communication facilities to meet the following goals: 
  422.  
  423.      Provide access to communications networks such as an internet 
  424.  
  425.      Enable communication between unrelated processes, which can either reside 
  426.       locally on the same host computer or on multiple host machines 
  427.  
  428.  The sockets API provides a generic interface that allows networking 
  429.  applications to use any protocol stack. After you pick the protocol stack, you 
  430.  can choose the type of socket that you want, based on the communication 
  431.  characteristics that you desire.  For example, stream sockets offer a reliable 
  432.  method of data transmission without message boundaries, whereas datagram 
  433.  sockets offer message boundaries but do not guarantee reliability. 
  434.  
  435.  
  436. ΓòÉΓòÉΓòÉ 3.2.2. What Is a Socket? ΓòÉΓòÉΓòÉ
  437.  
  438. A socket is a communication channel abstraction that enables unrelated 
  439. processes to exchange data locally and across networks. A single socket is one 
  440. endpoint of a full-duplex (two-way) communication channel. This means that data 
  441. can be transmitted and received simultaneously. From an application program 
  442. perspective, a socket is a resource allocated by the operating system, similar 
  443. to a file handle. It is represented by an unsigned integer called a socket 
  444. descriptor. A pair of sockets is used to communicate between processes on a 
  445. single workstation or different workstations. Each socket of the pair is used 
  446. by its own process to send and receive data with the other socket. 
  447.  
  448. When a socket is created, it is associated with a particular protocol stack 
  449. (called the protocol family) and socket type within that family. Communication 
  450. can occur only between sockets that use the same socket type within the same 
  451. protocol family. 
  452.  
  453.  
  454. ΓòÉΓòÉΓòÉ 3.2.3. Socket Facilities ΓòÉΓòÉΓòÉ
  455.  
  456. Socket calls and network library calls provide the building blocks for IPC. An 
  457. application program must perform the basic functions, described in the 
  458. following sections, to conduct IPC through the sockets layer. 
  459.  
  460. Topics 
  461.  
  462.       Creating and Binding Sockets 
  463.       Accepting and Initiating Socket Connections 
  464.       Sending and Receiving Data 
  465.       Shutting Down Socket Operations 
  466.       Translating Network Addresses 
  467.  
  468.  
  469. ΓòÉΓòÉΓòÉ 3.2.3.1. Creating and Binding Sockets ΓòÉΓòÉΓòÉ
  470.  
  471. A socket is created with the socket() call. This call creates a socket of a 
  472. specified: 
  473.  
  474.      protocol family 
  475.      socket type 
  476.      protocol 
  477.  Sockets have different qualities depending on these specifications. The 
  478.  protocol family specifies the protocol stack to be used with the created 
  479.  socket. The socket type defines its communication properties such as 
  480.  reliability, ordering, and prevention of duplication of messages (see Socket 
  481.  Types). The protocol specifies which network protocol to use within the 
  482.  domain. The protocol must support the characteristics requested by the socket 
  483.  type. 
  484.  
  485.  An application can use the bind() call to associate a local name (usually a 
  486.  network address) with a socket. The form and meaning of socket addresses are 
  487.  dependent on the protocol family in which the socket is created. The socket 
  488.  name is specified by a sockaddr structure. 
  489.  
  490.  The bind() call is optional under some circumstances: the connect() call and 
  491.  any of the data transmission calls (for example,  send()) will automatically 
  492.  associate the local name to the socket if bind() hasn't been called. 
  493.  
  494.  
  495. ΓòÉΓòÉΓòÉ 3.2.3.2. Accepting and Initiating Socket Connections ΓòÉΓòÉΓòÉ
  496.  
  497. Sockets can be connected or unconnected. Unconnected sockets are produced by 
  498. the socket() call. An unconnected socket can become a connected socket by: 
  499.  
  500.      Client application: Actively connecting to another socket, using the 
  501.       connect() call 
  502.  
  503.      Server application: Binding a name to the socket, and then listening for 
  504.       and accepting a connection from another socket, using the listen() and 
  505.       accept() calls. 
  506.  
  507.  Stream sockets require a connection before you can transfer data. Other types 
  508.  of sockets, such as datagram sockets, need not establish connections before 
  509.  use. 
  510.  
  511.  
  512. ΓòÉΓòÉΓòÉ 3.2.3.3. Sending and Receiving Data ΓòÉΓòÉΓòÉ
  513.  
  514. The sockets API includes a variety of calls for transferring data. They all 
  515. operate similarly, but take different parameters to support different levels of 
  516. functionality. Some socket calls support scatter-gather communication. Some 
  517. support only connected sockets while others will work on any socket. Some calls 
  518. support additional flags to control how data is sent or received. See Data 
  519. Transfer Calls for a summary of which calls support which options. 
  520.  
  521.  
  522. ΓòÉΓòÉΓòÉ 3.2.3.4. Shutting Down Socket Operations ΓòÉΓòÉΓòÉ
  523.  
  524. Once sockets are no longer of use they can be shut down or closed using the 
  525. shutdown() or soclose() call. Typically, the shutdown() call is used if you 
  526. want to shut down data transfer in one direction while keeping the other 
  527. direction open.  The soclose() call shuts down data transfer in both directions 
  528. and then releases the resources associated with the socket. 
  529.  
  530.  
  531. ΓòÉΓòÉΓòÉ 3.2.3.5. Translating Network Addresses ΓòÉΓòÉΓòÉ
  532.  
  533. Application programs need to translate human-readable addresses into the 
  534. low-level form used by the protocol. The sockets API includes calls to: 
  535.  
  536.      Map host names to IP addresses and back 
  537.      Map network names to numbers and back 
  538.      Map service and protocol names to numbers and back 
  539.      Convert numbers from network-byte order (big-endian) to host-byte order 
  540.       (which is little-endian on OS/2 machines) and back 
  541.  
  542.  
  543. ΓòÉΓòÉΓòÉ 3.3. Socket Protocol Families ΓòÉΓòÉΓòÉ
  544.  
  545. Sockets that share common communication properties, such as naming conventions 
  546. and address formats, are grouped into protocol families. 
  547.  
  548. A protocol family includes the following: 
  549.  
  550.      Rules for manipulating and interpreting network addresses 
  551.      A collection of related address formats that comprise an address family 
  552.      A set of network protocols 
  553.  
  554.  Topics 
  555.  
  556.       Supported Protocol Families 
  557.       TCP/IP Properties 
  558.       Local IPC Properties 
  559.       NetBIOS Domain Properties 
  560.       Routing Domain Properties 
  561.  
  562.  
  563. ΓòÉΓòÉΓòÉ 3.3.1. Supported Protocol Families ΓòÉΓòÉΓòÉ
  564.  
  565. The supported domains' protocol families are defined in the <SYS\SOCKET.H> 
  566. header file and are listed in the following table: 
  567.  
  568. Protocol Families Supported 
  569.  
  570. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  571. ΓöéProtocol       #define in        Supported         Supported SocketΓöé
  572. ΓöéFamily         <SYS\SOCKET.H>    Protocols         Types           Γöé
  573. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  574. ΓöéTCP/IP         PF_INET           ICMP, IP, TCP,    Datagram, raw,  Γöé
  575. Γöé                                 UDP               stream          Γöé
  576. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  577. ΓöéLocal IPC      PF_OS2 or PF_UNIX Local IPC         Datagram, streamΓöé
  578. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  579. ΓöéNetBIOS        PF_NETBIOS or     NetBIOS           Datagram,       Γöé
  580. Γöé               PF_NB                               sequenced packetΓöé
  581. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  582. ΓöéRouting        PF_ROUTE          Routing messages  Raw             Γöé
  583. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  584.  
  585.  As the table indicates, some socket types can be used in more than one 
  586. protocol family. 
  587.  
  588.  
  589. ΓòÉΓòÉΓòÉ 3.3.2. TCP/IP Properties ΓòÉΓòÉΓòÉ
  590.  
  591. Provides socket communication between a local process and a process running on 
  592. a remote host. The SOCK_STREAM socket type is supported by TCP (Transmission 
  593. Control Protocol); the SOCK_DGRAM socket type is supported by UDP (User 
  594. Datagram Protocol). Each is layered on top of the transport-level Internet 
  595. Protocol (IP). ICMP (Internet Control Message Protocol) is implemented on top 
  596. of IP and is accessible through a raw socket. The raw socket interface, 
  597. SOCK_RAW sockets, allows access to the raw facilities of IP. Each raw socket is 
  598. associated with one IP protocol number and receives all traffic for that 
  599. protocol. This allows administrative and debugging functions to occur and 
  600. enables user-level implementations of special-purpose protocols such as 
  601. inter-gateway routing protocols. 
  602.  
  603.  
  604. ΓòÉΓòÉΓòÉ 3.3.3. Local IPC Properties ΓòÉΓòÉΓòÉ
  605.  
  606. Provides socket communication between processes running on the same machine. 
  607. The SOCK_STREAM socket type provides pipe-like facilities, while the SOCK_DGRAM 
  608. socket type provides reliable message-style communications. 
  609.  
  610.  
  611. ΓòÉΓòÉΓòÉ 3.3.4. NetBIOS Domain Properties ΓòÉΓòÉΓòÉ
  612.  
  613. Provides connection-oriented, reliable, full-duplex service to an application. 
  614. SOCK_SEQPACKET provides reliable message-style communications, while SOCK_DGRAM 
  615. provides a connectionless mode of communications. 
  616.  
  617.  
  618. ΓòÉΓòÉΓòÉ 3.3.5. Routing Domain Properties ΓòÉΓòÉΓòÉ
  619.  
  620. The PF_ROUTE domain supports communications between a process and the routing 
  621. facilities in the kernel. 
  622.  
  623.  
  624. ΓòÉΓòÉΓòÉ 3.4. Socket Addresses ΓòÉΓòÉΓòÉ
  625.  
  626. Sockets can be named with an address so that processes can connect to them. The 
  627. sockets layer treats an address as an opaque object. Applications supply and 
  628. receive addresses as tagged, variable-length byte strings. A sockaddr data 
  629. structure can be used as a template for referring to the identifying tag of 
  630. each socket address. 
  631.  
  632. Topics 
  633.  
  634.       Socket Address Data Structures 
  635.       Socket Addresses in TCP/IP 
  636.       Connection Modes 
  637.  
  638.  
  639. ΓòÉΓòÉΓòÉ 3.4.1. Socket Address Data Structures ΓòÉΓòÉΓòÉ
  640.  
  641. The sockaddr data structure is used to provide a generic name for a socket. The 
  642. following figure illustrates this data structure: 
  643.  
  644.  
  645. sockaddr Structure
  646.  
  647. The <SYS\SOCKET.H> file contains this data structure. The sa_len field 
  648. specifies how long the address is; this field is only used with routing 
  649. sockets. The family (sa_family) identifies which protocol family this address 
  650. corresponds to. The contents of the socket address data (sa_data) field depend 
  651. on the protocol in use. 
  652.  
  653. Additional data structures are defined that correspond to a particular protocol 
  654. family and overlay the sockaddr structure. The types of socket address data 
  655. structures are as follows: 
  656.  
  657. Socket Address Data Structures 
  658.  
  659. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  660. ΓöéData Structure        sa_family Value  Protocol     Header File     Γöé
  661. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  662. Γöéstruct sockaddr_in    AF_INET          TCP/IP       <NETINET\IN.H>  Γöé
  663. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  664. Γöéstruct sockaddr_un    AF_OS2 or        Local IPC    <SYS\UN.H>      Γöé
  665. Γöé                      AF_UNIX                                       Γöé
  666. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  667. Γöéstruct sockaddr_nb    AF_NETBIOS or    NetBIOS      <NETNB\NB.H>    Γöé
  668. Γöé                      AF_NB                                         Γöé
  669. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  670.  
  671. The contents of the various socket addresses are as follows: 
  672.  
  673.  Internet 
  674.    A socket name in the internet domain is an internet address, made up of a 
  675.    32-bit IP address and a 16-bit port number. The 32-bit address is composed 
  676.    of network and host parts; the network part is variable in size. The host 
  677.    part can be interpreted optionally as a subnet field plus the host on a 
  678.    subnet; this is enabled by setting a network address mask. 
  679.  
  680.  OS/2 or UNIX 
  681.    A socket name in the OS/2 or UNIX domain is a unique listing of ASCII 
  682.    characters of up to 108 bytes. 
  683.  
  684.  NetBIOS 
  685.    A socket name in the NetBIOS domain is made up of a 16-byte NetBIOS name and 
  686.    is used as is. 
  687.  
  688.  
  689. ΓòÉΓòÉΓòÉ 3.4.2. Socket Addresses in TCP/IP ΓòÉΓòÉΓòÉ
  690.  
  691. TCP/IP provides a set of 16-bit port numbers within each host. Because each 
  692. host assigns port numbers independently, it is possible for sockets on 
  693. different hosts to have the same port number. 
  694.  
  695. To ensure that socket addresses are unique within a network, TCP/IP 
  696. concatenates the internet address of the LAN interface with the port number to 
  697. devise the internet socket address. Since a host's internet address is always 
  698. unique within a network, the socket address for a particular socket on a 
  699. particular host is unique. Additionally, since each connection is fully 
  700. specified by the pair of sockets it joins, every connection between internet 
  701. hosts is also uniquely identified. 
  702.  
  703. The port numbers from 0 to 1023 are reserved for official internet services. 
  704. Port numbers in the range of 1024-49151 are reserved for other registered 
  705. services that are common on internet networks. These port numbers are listed in 
  706. the ETC\SERVICES file. When a client process needs one of these well-known 
  707. services at a particular host, the client process sends a service request to 
  708. the socket address for the well-known port at the server. 
  709.  
  710. The port numbers from 49152 to 65535 are generally used by client processes 
  711. which need a port, but don't care which one they get. These port numbers are 
  712. usually assigned by the TCP/IP stack when a connect() or sendto() is performed 
  713. without having done a previous bind(). 
  714.  
  715.  
  716. ΓòÉΓòÉΓòÉ 3.4.3. Connection Modes ΓòÉΓòÉΓòÉ
  717.  
  718. A connection mode refers to an established logical channel for the transmission 
  719. of data between two application programs. 
  720.  
  721. The sockets API supports two connection modes: 
  722.  
  723.      Connection-oriented 
  724.      Connectionless 
  725.  
  726.  In the connectionless mode, sockets are not tied to a destination address. 
  727.  Applications sending messages can specify a different destination address for 
  728.  each datagram, if necessary, or they can tie the socket to a specific 
  729.  destination address for the duration of the connection. 
  730.  
  731.  The connection-oriented mode requires a logical connection to be established 
  732.  between two applications before data transfer or communication can occur. 
  733.  Applications encounter some overhead during the connection establishment phase 
  734.  as the applications negotiate the connection request. This mode is useful for 
  735.  applications that use long datastream transmissions or require reliable 
  736.  transmissions of data. 
  737.  
  738.  The connectionless mode does not require a logical connection to allow 
  739.  communication between applications. Rather, individual messages are 
  740.  transmitted independently from one application to another application. Each 
  741.  message must contain the data and all information required for delivery of the 
  742.  message to its destination. Normally, datagram and raw socket types use the 
  743.  connectionless mode. 
  744.  
  745.  The term connected refers to two endpoints that have an established logical 
  746.  connection between them. Stream and sequenced packet socket types use the 
  747.  connection-oriented mode. For information on how datagram and raw socket types 
  748.  can be connected, see Datagram or Raw Sockets. 
  749.  
  750.  
  751. ΓòÉΓòÉΓòÉ 3.5. Socket Types ΓòÉΓòÉΓòÉ
  752.  
  753. Sockets are classified according to communication properties. Processes usually 
  754. communicate between sockets of the same type. However, if the underlying 
  755. communication protocols support the communication, sockets of different types 
  756. can communicate. 
  757.  
  758. Each socket has an associated type, which describes the semantics of 
  759. communications using that socket. The socket type determines the socket 
  760. communication properties such as reliability, ordering, and prevention of 
  761. duplication of messages. The basic set of socket types is defined in the 
  762. <SYS\SOCKET.H> file: 
  763.  
  764. /*Standard socket types */
  765.  
  766. #define  SOCK_STREAM            1 /*virtual circuit*/
  767.  
  768. #define  SOCK_DGRAM             2 /*datagram*/
  769.  
  770. #define  SOCK_RAW               3 /*raw socket*/
  771.  
  772. #define  SOCK_SEQPACKET         5 /*sequenced packet stream*/
  773.  
  774. Other socket types can be defined. 
  775.  
  776. OS/2 supports the basic set of sockets: 
  777.  
  778.  SOCK_DGRAM 
  779.    Provides datagrams, which are connectionless messages of a fixed maximum 
  780.    length. This type of socket is generally used for short messages, such as a 
  781.    name server or time server, since the order and reliability of message 
  782.    delivery is not guaranteed. 
  783.  
  784.    A datagram socket supports the bidirectional flow of data which is not 
  785.    sequenced, reliable, or unduplicated. A process receiving messages on a 
  786.    datagram socket may find messages duplicated or in an order different from 
  787.    the order sent. Record boundaries in data are, however, preserved. Datagram 
  788.    sockets closely model the facilities found in many contemporary 
  789.    packet-switched networks. 
  790.  
  791.    An application can use the sendto() and recvfrom() calls or the sendmsg() 
  792.    and recvmsg() calls to exchange data over a datagram socket. If an 
  793.    application is using datagram sockets and calls connect() fully specifying 
  794.    the destination address, the socket will be considered connected. The 
  795.    application program can then use the other data transfer calls send() and 
  796.    recv() or writev() and readv(). The connected or unconnected method of data 
  797.    transfer stays in effect until connect() is called again with a different 
  798.    destination address. 
  799.  
  800.    Datagram sockets may be used to send broadcast messages over TCP/IP and 
  801.    NetBIOS. For TCP/IP, the constant INADDR_BROADCAST, defined in 
  802.    <NETINET\IN.H>, can be used to send a broadcast datagram. For NetBIOS, the 
  803.    address format has a type field that specifies whether the address is 
  804.    unique, multicast, or broadcast. 
  805.  
  806.  SOCK_STREAM 
  807.    Provides sequenced, two-way byte streams with a transmission mechanism for 
  808.    stream data. This socket type transmits data reliably (in order, not 
  809.    duplicated, and retransmitted if necessary) without record boundaries, and 
  810.    with out-of-band capabilities. 
  811.  
  812.    There is no guarantee for a one-to-one correspondence of send and receive 
  813.    calls.  It is possible for data sent by one send() call to be received by 
  814.    more than one different receive call, or the other way around. 
  815.  
  816.    Stream sockets  are either active or passive. Active sockets are used by 
  817.    clients who actively initiate connection requests with connect(). Passive 
  818.    sockets are used by servers to passively wait for and accept connection 
  819.    requests with the listen() and accept() calls. A passive socket that has 
  820.    indicated its willingness to accept connections with the listen() call 
  821.    cannot be used to initiate connection requests. 
  822.  
  823.    After a connection has been established between stream sockets, any of the 
  824.    data transfer calls can be used: 
  825.  
  826.        send() and recv() 
  827.        sendto() and recvfrom() 
  828.        sendmsg() and recvmsg() 
  829.        writev() and readv() 
  830.  
  831.    Usually, a send()-recv() pair is used for sending data on stream sockets. 
  832.  
  833.  SOCK_RAW 
  834.    Provides access to internal network protocols and interfaces. A raw socket 
  835.    allows an application direct access to lower-level communication protocols, 
  836.    such as IP and ICMP. Raw sockets are intended for advanced users who wish to 
  837.    take advantage of some protocol feature not directly accessible through a 
  838.    normal interface, or who wish to build new protocols atop existing low-level 
  839.    protocols. 
  840.  
  841.    Raw sockets are normally datagram-oriented, though their exact 
  842.    characteristics are dependent upon the interface provided by the protocol. 
  843.    However, raw sockets can be connected if connect() is called to specify the 
  844.    destination address. 
  845.  
  846.  SOCK_SEQPACKET 
  847.    Provides sequenced, reliable, and unduplicated flow of information. Every 
  848.    sequenced packet is sent and received as a complete record. 
  849.  
  850.    After a connection has been established between sequenced packet sockets, 
  851.    any of the data transfer calls can be used: 
  852.  
  853.        send() and recv() 
  854.        sendto() and recvfrom() 
  855.        sendmsg() and recvmsg() 
  856.        writev() and readv() 
  857.  
  858.    Usually, a send()-recv() pair is used for sending data on sequenced packet 
  859.    sockets. 
  860.  
  861.  Topics 
  862.  
  863.       Socket Types Summary 
  864.       Guidelines for Using Socket Types 
  865.  
  866.  
  867. ΓòÉΓòÉΓòÉ 3.5.1. Socket Types Summary ΓòÉΓòÉΓòÉ
  868.  
  869. The following table summarizes many of the attributes and features of supported 
  870. socket types: 
  871.  
  872. Socket Types 
  873.  
  874. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  875. ΓöéSocket Type #define in      Protocols     Connection   Primary SocketΓöé
  876. Γöé            <SYS\SOCKET.H>                Oriented?    Calls         Γöé
  877. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  878. ΓöéStream      SOCK_STREAM     TCP/IP, Local yes          send() or     Γöé
  879. Γöé                            IPC                        recv()        Γöé
  880. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  881. ΓöéSequenced   SOCK_SEQPACKET  NetBIOS       yes          send() or     Γöé
  882. Γöépacket                                                 recv()        Γöé
  883. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  884. ΓöéDatagram    SOCK_DGRAM      TCP/IP, Local no*          sendto() or   Γöé
  885. Γöé                            IPC, NetBIOS               recvfrom()*   Γöé
  886. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  887. ΓöéRaw         SOCK_RAW        TCP/IP        no*          sendto() or   Γöé
  888. Γöé                                                       recvfrom()*   Γöé
  889. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  890.  
  891. Table Note  (*) Datagram sockets and raw sockets are connectionless, unless the 
  892.             application has called connect() for the socket. In this case, the 
  893.             socket is connected. Refer to Connection Modes for additional 
  894.             information. 
  895.  
  896.  
  897. ΓòÉΓòÉΓòÉ 3.5.2. Guidelines for Using Socket Types ΓòÉΓòÉΓòÉ
  898.  
  899. If you are communicating with an existing application, you must use the same 
  900. socket type and the same protocol as the existing application. 
  901.  
  902. Raw sockets have a special purpose of interfacing directly to the underlying 
  903. protocol layer. If you are writing a new protocol on top of Internet Protocol 
  904. (IP) or wish to use the Internet Control Message Protocol (ICMP), then you must 
  905. use raw sockets. 
  906.  
  907. You should consider the following factors in choosing a socket type for new 
  908. applications: 
  909.  
  910.      Reliability:  Stream and sequenced packet sockets provide the most 
  911.       reliable connection. Connectionless datagram and raw sockets are 
  912.       unreliable because packets can be discarded, duplicated, or received out 
  913.       of order. This may be acceptable if the application does not require 
  914.       reliability, or if the application implements the reliability on top of 
  915.       the sockets API. 
  916.  
  917.      Performance:  The overhead associated with reliability, flow control, 
  918.       packet reassembly, and connection maintenance degrades the performance of 
  919.       stream and sequenced packet sockets so that these socket types do not 
  920.       perform as well as datagram sockets acting in a connectionless mode. 
  921.  
  922.      Amount of data to be transferred:  Datagram and sequenced packet sockets 
  923.       impose a limit on the amount of data transferred in each packet. 
  924.  
  925.  
  926. ΓòÉΓòÉΓòÉ 3.6. Socket Creation ΓòÉΓòÉΓòÉ
  927.  
  928. The basis for communication between processes centers on the socket mechanism. 
  929. A socket is comparable to an OS/2 file handle. Application programs request the 
  930. operating system to create a socket through the use of the socket() call. When 
  931. an application program requests the creation of a new socket, the operating 
  932. system returns an integer that the application program uses to reference the 
  933. newly created socket. 
  934.  
  935. To create a socket with the socket() call, the application program must include 
  936. a protocol family and a socket type. It can also include a specific 
  937. communication protocol within the specified protocol family. 
  938.  
  939. An example of an application using the socket() call is: 
  940.  
  941.  
  942. An Application Using the socket() Call
  943.  
  944. int s;
  945. ...
  946. s = socket(PF_INET, SOCK_STREAM, 0);
  947.  
  948. In this example, the socket() call allocates a socket descriptor s in the 
  949. internet protocol family (PF_INET). The type parameter is a constant that 
  950. specifies the type of socket.  For the internet communication domain, this can 
  951. be SOCK_STREAM, SOCK_DGRAM, or SOCK_RAW. The protocol parameter is a constant 
  952. that specifies which protocol to use. Passing 0 chooses the default protocol 
  953. for the specified socket type. Supported Protocol Families includes information 
  954. on default protocols. If successful, socket() returns a non-negative integer 
  955. socket descriptor. 
  956.  
  957. See Socket Connections for more about creating sockets. 
  958.  
  959.  
  960. ΓòÉΓòÉΓòÉ 3.7. Binding Names to Sockets ΓòÉΓòÉΓòÉ
  961.  
  962. The socket() call creates a socket without a name. An unnamed socket is one 
  963. without any association to a local address. Until a name is bound to a socket, 
  964. no messages can be received on it. 
  965.  
  966. Communicating processes are bound by an association. The bind() call allows a 
  967. process to specify half of an association: local address and local port 
  968. (TCP/IP), or local path name (NetBIOS and local IPC). The connect() and 
  969. accept() calls are used to complete a socket's association. 
  970.  
  971. An application program may not care about the local address it uses and may 
  972. allow the protocol software to select one. This is not true for server 
  973. processes. Server processes that operate at a well-known port need to be able 
  974. to specify that port to the system. 
  975.  
  976. In most domains, associations must be unique. Internet domain associations must 
  977. never include duplicate protocol, local address, local port, foreign address, 
  978. or foreign port tuples. 
  979.  
  980. Wildcard addressing is provided to aid local address binding in the Internet 
  981. domain. When an address is specified as INADDR_ANY (a constant defined in the 
  982. <NETINET\IN.H> file), the system interprets the address as any valid address. 
  983.  
  984. Sockets with wildcard local addresses may receive messages directed to the 
  985. specified port number and sent to any of the possible addresses assigned to a 
  986. host. If a server process wished to connect only hosts on a given network, it 
  987. would bind the address of the hosts on the appropriate network. 
  988.  
  989. A local port can be specified or left unspecified (denoted by 0), in which case 
  990. the system selects an appropriate port number for it. 
  991.  
  992. The bind() call accepts the s, name, and namelen parameters. The s parameter is 
  993. the integer descriptor of the socket to be bound. The name parameter specifies 
  994. the local address, and the namelen parameter indicates the length of address in 
  995. bytes. The local address is defined by a data structure termed sockaddr. 
  996.  
  997. In the internet  domain, a process does not have to bind an address and port 
  998. number to a socket, because the connect() and send() calls automatically bind 
  999. an appropriate address if they are used with an unbound socket. 
  1000.  
  1001. The bound name is a variable-length byte string that is interpreted by the 
  1002. supporting protocols. Its interpretation can vary from protocol family to 
  1003. protocol family (this is one of the properties of the protocol family). 
  1004.  
  1005. An example of an application using the bind() call is: 
  1006.  
  1007.  
  1008. An Application Using the bind() Call
  1009.  
  1010. int rc;
  1011. int s;
  1012. struct sockaddr_in myname;
  1013.  
  1014. /* clear the structure */
  1015. memset(&myname, 0, sizeof(myname));
  1016. myname.sin_len = sizeof(myname);
  1017. myname.sin_family = AF_INET;
  1018. myname.sin_addr.s_addr = inet_addr("129.5.24.1"); /* specific interface */
  1019. myname.sin_port = htons(1024);
  1020. ...
  1021. rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  1022.  
  1023. For a server in the internet domain to be able to listen for connections on a 
  1024. stream socket or issue recvfrom() on a datagram socket, the server must first 
  1025. bind the socket to a specific address family, local address, and local port. 
  1026. This example binds myname to socket s. Note that the sockaddr_in structure 
  1027. should be zeroed before calling bind(). For a more detailed description, see 
  1028. bind(). For information on the sockaddr_in structure, see Internet Address 
  1029. Formats. 
  1030.  
  1031. The unique name myname specifies that the application uses an internet address 
  1032. family (AF_INET) at internet address 129.5.24.1, and is bound to port 1024. The 
  1033. preceding example shows two useful network utility routines. 
  1034.  
  1035.      inet_addr()  takes an internet address in dotted-decimal form and returns 
  1036.       it in network-byte order. For a more detailed description, see 
  1037.       inet_addr(). 
  1038.  
  1039.      htons()  takes a port number in host-byte order and returns the port in 
  1040.       network-byte order.  For a more detailed description, see htons(). 
  1041.  
  1042.  The next figure shows how the bind() call on the server side uses the network 
  1043.  utility routine getservbyname() to find a well-known port number for a 
  1044.  specified service from the ETC\SERVICES file (for more information on 
  1045.  well-known ports, see Ports). The figure also shows the use of the internet 
  1046.  address wildcard value INADDR_ANY.  This is the value generally used on a 
  1047.  socket bind() call. It binds the socket to all internet addresses available on 
  1048.  the local machine, without requiring the program to know the local internet 
  1049.  address. (The code fragment in the preceding figure will run successfully only 
  1050.  on the machine with internet address 192.5.24.1.) If a host has more than one 
  1051.  internet address (that is, if it is multihomed host), messages sent to any of 
  1052.  the addresses will be deliverable to a socket bound to INADDR_ANY. 
  1053.  
  1054.  
  1055.   A bind() Call Using the getservbyname() Call
  1056.  
  1057.   int rc;
  1058.   int s;
  1059.   struct sockaddr_in myname;
  1060.   struct servent *sp;
  1061.   ...
  1062.   sp = getservbyname("login","tcp");  /* get application specific */
  1063.   /* well-known port          */
  1064.   ...
  1065.   /* clear the structure */
  1066.   memset(&myname, 0, sizeof(myname));
  1067.   myname.sin_len = sizeof(myname);
  1068.   myname.sin_family = AF_INET;
  1069.   myname.sin_addr.s_addr = INADDR_ANY;  /* any interface */
  1070.   myname.sin_port = sp->s_port;
  1071.   ...
  1072.   rc = bind(s,(struct sockaddr *)&myname,sizeof(myname));
  1073.  
  1074.  See bind() for more on this call. 
  1075.  
  1076.  
  1077. ΓòÉΓòÉΓòÉ 3.8. Socket Connections ΓòÉΓòÉΓòÉ
  1078.  
  1079. Initially, a socket is created in the unconnected state, meaning the socket is 
  1080. not associated with any foreign destination. The connect() call binds a 
  1081. permanent destination to a socket, placing it in the connected state. An 
  1082. application program must call connect() to establish a connection before it can 
  1083. transfer data through a reliable stream socket. Sockets used with 
  1084. connectionless datagram services need not be connected before they are used, 
  1085. but connecting sockets makes it possible to transfer data without specifying 
  1086. the destination each time. 
  1087.  
  1088. The semantics of the connect() call depend on the underlying protocols. In the 
  1089. case of TCP, the connect() call builds a TCP connection with the destination, 
  1090. or returns an error if it cannot. In the case of connectionless services, the 
  1091. connect() call does nothing more than store the destination address locally. 
  1092.  
  1093. Connections are established between a client process and a server process. In a 
  1094. connection-oriented network environment, a client process initiates a 
  1095. connection and a server process receives, or responds to, a connection. The 
  1096. client and server interactions occur as follows: 
  1097.  
  1098.      The server, when willing to offer its advertised services, binds a socket 
  1099.       to a well-known address associated with the service. 
  1100.  
  1101.      The server process socket is then marked to indicate incoming connections 
  1102.       are to be accepted on it. It is then possible for an unrelated process to 
  1103.       rendezvous with the server. 
  1104.  
  1105.      The client requests services from the server by initiating a connection 
  1106.       to the server's socket. The client process uses a connect() call to 
  1107.       initiate a socket connection. 
  1108.  
  1109.      If the client process' socket is unbound at the time of the connect() 
  1110.       call, the system automatically selects and binds a name to the socket if 
  1111.       necessary. This is the usual way that local addresses are bound to a 
  1112.       socket. 
  1113.  
  1114.      If the connection to the server fails, the client's connect() call fails 
  1115.       (any name automatically bound by the system, however, remains). 
  1116.       Otherwise, the socket is associated with the server and data transfer can 
  1117.       begin. 
  1118.  
  1119.  An example of a client application using the connect() call to request a 
  1120.  connection is: 
  1121.  
  1122.  
  1123.   An Application Using the connect() Call
  1124.  
  1125.   int s;
  1126.   struct sockaddr_in servername;
  1127.   int rc;
  1128.   ...
  1129.   memset(&servername, 0, sizeof(servname));
  1130.   servname.sin_len = sizeof(servname);
  1131.   servername.sin_family = AF_INET;
  1132.   servername.sin_addr.s_addr = inet_addr("129.5.24.1");
  1133.   servername.sin_port = htons(1024);
  1134.   ...
  1135.   rc = connect(s, (struct sockaddr *) &servername, sizeof(servername));
  1136.  
  1137.  The connect() call attempts to connect socket s to the server with name 
  1138.  supplied in servername. This could be the server that was used in the previous 
  1139.  bind() example. With TCP stream sockets the caller blocks until the connection 
  1140.  is accepted by the server.  On successful return from connect(), the socket s 
  1141.  is associated with the connection to the server. See ioctl() for additional 
  1142.  information about determining blocking and nonblocking behavior. Note that the 
  1143.  sockaddr_in structure should be cleared before calling connect(). For a more 
  1144.  detailed description, see connect(). 
  1145.  
  1146.  The following figure shows an example of using the gethostbyname() network 
  1147.  utility routine to find out the internet address of serverhost from the name 
  1148.  server or the ETC\HOSTS file: 
  1149.  
  1150.  
  1151.   An Application Using the gethostbyname() Call
  1152.  
  1153.   int s;
  1154.   struct sockaddr_in servername;
  1155.   char *hostname = "serverhost";
  1156.   int rc;
  1157.   int connect(int s, struct sockaddr *name, int namelen);  /* extracted from sys\socket.h */
  1158.   struct hostent *hp;
  1159.   ...
  1160.  
  1161.   hp = gethostbyname(hostname);
  1162.  
  1163.   /* clear the structure */
  1164.   memset(&servername, 0, sizeof(servname));
  1165.   servername.sin_len = sizeof(servername);
  1166.   servername.sin_family = AF_INET;
  1167.   servername.sin_addr.s_addr = *((u_long *)hp->h_addr);
  1168.   servername.sin_port = htons(1024);
  1169.   ...
  1170.   rc = connect(s,(struct sockaddr *)&servername,sizeof(servername));
  1171.  
  1172.  
  1173. ΓòÉΓòÉΓòÉ 3.9. Obtaining Socket Addresses ΓòÉΓòÉΓòÉ
  1174.  
  1175. The sockets API includes calls that allow an application to obtain the address 
  1176. of the destination to which a socket connects and the local address of a 
  1177. socket. The socket calls that allow a program to retrieve socket addresses are: 
  1178.  
  1179.      getsockname() 
  1180.      getpeername() 
  1181.  
  1182.  For additional information that you may need before binding or obtaining 
  1183.  socket addresses, see: 
  1184.  
  1185.      Socket Addresses 
  1186.      Socket Connections 
  1187.  
  1188.  
  1189. ΓòÉΓòÉΓòÉ 3.10. Server Connections ΓòÉΓòÉΓòÉ
  1190.  
  1191. In the internet domain, the server process creates a socket, binds it to a 
  1192. well-known protocol port, and waits for requests. The listen() call allows 
  1193. server processes to prepare a socket for incoming connections. In terms of 
  1194. underlying protocols, the listen() call puts the socket in a passive mode ready 
  1195. to accept connections. When the server process starts the listen() call, it 
  1196. also informs the operating system that the protocol software should queue 
  1197. multiple simultaneous connection requests that arrive at a socket. The listen() 
  1198. call includes a parameter that allows a process to specify the length of the 
  1199. connection queue for that socket. If the queue is full when a connection 
  1200. request arrives, the operating system refuses the connection. The listen() call 
  1201. applies only to sockets that have selected reliable stream delivery or 
  1202. connection-oriented datagram service. An example of a server application using 
  1203. the listen() call is: 
  1204.  
  1205.  
  1206. An Application Using the listen() Call
  1207.  
  1208. int s;
  1209. int backlog;
  1210. int rc;
  1211. ...
  1212. rc = listen(s, 5);
  1213.  
  1214. The listen() call is used to indicate that the server is ready to begin 
  1215. accepting connections. In this example, a maximum of five connection requests 
  1216. can be queued for the server. Additional requests are ignored.  For a more 
  1217. detailed description, see listen(). 
  1218.  
  1219. Once a socket has been set up, the server process needs to wait for a 
  1220. connection. The server process waits for a connection by using the accept() 
  1221. call. A call to the accept() call blocks until a connection request arrives. 
  1222. When a request arrives, the operating system returns the address of the client 
  1223. process that has placed the request. The operating system also creates a new 
  1224. socket that has its destination connected to the requesting client process and 
  1225. returns the new socket descriptor to the calling server process. The original 
  1226. socket still has a wildcard foreign destination which remains open. 
  1227.  
  1228. When a connection arrives, the call to accept() returns. The server process can 
  1229. either handle requests interactively or concurrently. In the interactive 
  1230. approach, the thread that did the accept() handles the request itself, closes 
  1231. the new socket, and then starts the accept() call to obtain the next connection 
  1232. request. In the concurrent approach, after the call to accept() returns, the 
  1233. server process creates a new thread to handle the request. The new thread 
  1234. proceeds to service the request, and then exits. The original thread invokes 
  1235. the accept() call to obtain the next connection request. 
  1236.  
  1237. An example of a server application for accepting a connection request by using 
  1238. the accept() call is: 
  1239.  
  1240.  
  1241. An Application Using the accept() Call
  1242.  
  1243. int clientsocket;
  1244. int s;
  1245. struct sockaddr clientaddress;
  1246. int addrlen;
  1247. ...
  1248. addrlen = sizeof(clientaddress);
  1249. ...
  1250. clientsocket = accept(s, &clientaddress, &addrlen);
  1251.  
  1252.  
  1253. ΓòÉΓòÉΓòÉ 3.11. Handling Multiple Sockets ΓòÉΓòÉΓòÉ
  1254.  
  1255. Applications can handle multiple sockets. In such situations, you can use the 
  1256. select() call to determine the sockets that have data to be read, those that 
  1257. are ready for data to be written, and the sockets that have pending exception 
  1258. conditions. If the timeout parameter is positive, select() waits up to the 
  1259. amount of time indicated for at least one socket to become ready on the 
  1260. indicated conditions. This is useful for applications servicing multiple 
  1261. connections that cannot afford to block waiting for data on one connection. 
  1262.  
  1263. There are two versions of the select() call: a TCP/IP Version 4.1 for OS/2 Warp 
  1264. version and a version modeled after the BSD select() call. An example of how 
  1265. the TCP/IP Version 4.1 for OS/2 Warp select() call is used is shown in the next 
  1266. figure. For information on using the BSD version of the select() call, see 
  1267. select(). 
  1268.  
  1269.  
  1270. An Application Using the select() Call
  1271.  
  1272. ...
  1273. int socks[3];    /* array of sockets */
  1274. long timeout = MAX_TIMEOUT;
  1275. int s1, s2, s3;
  1276. int number_ready;
  1277. ...
  1278. /* put sockets to check in socks[] */
  1279. socks[0] = s1;     /* read socket number */
  1280. socks[1] = s2;     /* write socket number */
  1281. socks[2] = s3;     /* second write socket number */
  1282.  
  1283. /* check for READ on s1, WRITE on s2 and s3 */
  1284. number_ready = os2_select(socks, 1, 2, 0, timeout);
  1285.  
  1286. In this example, the application indicates the sockets to be checked for 
  1287. readability or readiness for writing. 
  1288.  
  1289.  
  1290. ΓòÉΓòÉΓòÉ 3.12. Connectionless Datagram Services ΓòÉΓòÉΓòÉ
  1291.  
  1292. The operating system provides support for connectionless interactions typical 
  1293. of the datagram facilities found in packet-switched networks. A datagram socket 
  1294. provides a symmetric interface for data exchange. While processes are still 
  1295. likely to be client and server, there is no requirement for connection 
  1296. establishment. Instead, each message includes the destination address. 
  1297.  
  1298. An application program can create datagram sockets using the socket() call. In 
  1299. the internet domain, if a particular local address is needed, a bind() call 
  1300. must precede the first data transmission. Otherwise, the operating system sets 
  1301. the local address or port when data is first sent. The application program uses 
  1302. the sendto() and recvfrom() calls to transmit data; these calls include 
  1303. parameters that allow the client process to specify the address of the intended 
  1304. recipient of the data. 
  1305.  
  1306. In addition to the sendto() and recvfrom() calls, datagram sockets can also use 
  1307. the connect() call to associate a socket with a specific destination address. 
  1308. In this case, any data sent on the socket is automatically addressed to the 
  1309. connected peer socket, and only data received from that peer is delivered to 
  1310. the client process. Only one connected address is permitted for each socket at 
  1311. one time; a second connect() call changes the destination address. 
  1312.  
  1313. A connect() call request on a datagram socket results in the operating system 
  1314. recording the peer socket's address (as compared to a stream socket, where a 
  1315. connect request initiates establishment of an end-to-end connection). The 
  1316. accept() and listen() calls are not used with datagram sockets. 
  1317.  
  1318. While a datagram socket is connected, errors from recent send() calls can be 
  1319. returned asynchronously. These errors can be reported on subsequent operations 
  1320. on the socket, or a special socket option, SO_ERROR. This option, when used 
  1321. with the getsockopt() call, can be used to interrogate the error status. A 
  1322. select() call for reading or writing returns true when a process receives an 
  1323. error indication. The next operation returns the error, and the error status is 
  1324. cleared. 
  1325.  
  1326. See Socket Types for more information that you may need before connecting 
  1327. sockets. 
  1328.  
  1329.  
  1330. ΓòÉΓòÉΓòÉ 3.13. Socket Options ΓòÉΓòÉΓòÉ
  1331.  
  1332. In addition to binding a socket to a local address or connecting it to a 
  1333. destination address, application programs need a method to control the behavior 
  1334. of a socket. For example, when using protocols that use timeout and 
  1335. retransmission, the application program may want to obtain or set the timeout 
  1336. parameters. An application program may also want to control the allocation of 
  1337. buffer space, determine if the socket allows transmission of broadcast, or 
  1338. control processing of out-of-band data. The ioctl-style getsockopt() and 
  1339. setsockopt() calls provide the means to control socket operations. The 
  1340. getsockopt() call allows an application program to request information about 
  1341. socket options. The setsockopt() call allows an application program to set a 
  1342. socket option using the same set of values obtained with the getsockopt() call. 
  1343. Not all socket options apply to all sockets. The options that can be set depend 
  1344. on the current state of the socket and the underlying protocol being used. 
  1345.  
  1346.  
  1347. ΓòÉΓòÉΓòÉ 3.14. Socket Data Transfer ΓòÉΓòÉΓòÉ
  1348.  
  1349. Most of the work performed by the sockets layer is in sending and receiving 
  1350. data. The sockets layer itself does not impose any structure on data 
  1351. transmitted or received through sockets. Any data interpretation or structuring 
  1352. is logically isolated in the implementation of the protocol family. 
  1353.  
  1354. Once a connection is established between sockets, an application program can 
  1355. send and receive data. 
  1356.  
  1357. Topics 
  1358.  
  1359.       Sending and Receiving Data 
  1360.       Out-of-Band Data 
  1361.       Socket I/O Modes 
  1362.  
  1363.  
  1364. ΓòÉΓòÉΓòÉ 3.14.1. Sending and Receiving Data ΓòÉΓòÉΓòÉ
  1365.  
  1366. Sending and receiving data can be done with any one of several calls. The calls 
  1367. vary according to the amount of information to be transmitted and received and 
  1368. the state of the socket being used to perform the operation. 
  1369.  
  1370.      The writev() call can be used with a socket that is in a connected state, 
  1371.       as the destination of the data is implicitly specified by the connection. 
  1372.  
  1373.      The sendto() and sendmsg() calls allow the process to specify the 
  1374.       destination for a message explicitly. 
  1375.  
  1376.      The recv() call allows a process to receive data on a connected socket 
  1377.       without receiving the sender's address. 
  1378.  
  1379.      The recvfrom() and recvmsg() calls allow the process to retrieve the 
  1380.       incoming message and the sender's address. 
  1381.  
  1382.  While the send() and recv() calls are virtually identical to the readv() and 
  1383.  writev() calls, the extra flags argument in the send() and recv() calls is 
  1384.  important. The flags, defined in the <SYS\SOCKET.H> file, can be defined as a 
  1385.  nonzero value if the application program requires one or more of the 
  1386.  following: 
  1387.  
  1388.  MSG_OOB             Sends or receives out-of-band data. 
  1389.  MSG_PEEK            Looks at data without reading. 
  1390.  MSG_DONTROUTE       Sends data without routing packets. 
  1391.  
  1392.  Out-of-band data is specific to stream sockets. The option to have data sent 
  1393.  without routing applied to the outgoing packets is currently used only by the 
  1394.  routing table management process, and is unlikely to be of interest to the 
  1395.  casual user. The ability to preview data is, however, of general interest. 
  1396.  When the MSG_PEEK flag is specified with a recv() call, any data present is 
  1397.  returned to the user, but treated as still unread. That is, the next readv() 
  1398.  or recv() call applied to the socket returns the data previously previewed. 
  1399.  
  1400.  The following example shows an application sending data on a connected socket 
  1401.  and receiving data in response. The flags field can be used to specify 
  1402.  additional options to send() or recv(), such as sending out-of-band data. For 
  1403.  additional information, see send() and recv(). 
  1404.  
  1405.  
  1406.   An Application Using the send() and recv() Calls
  1407.  
  1408.   int bytes_sent;
  1409.   int bytes_received;
  1410.   char data_sent[256] = "data to be sent on connected socket";
  1411.   char data_received[256];
  1412.   int s;
  1413.   ...
  1414.   bytes_sent = send(s, data_sent, sizeof(data_sent), 0);
  1415.   ...
  1416.   bytes_received = recv(s, data_received, sizeof(data_received), 0);
  1417.  
  1418.  An example of an application sending from a connected socket and receiving 
  1419.  data in response is: 
  1420.  
  1421.  
  1422.   An Application Using the sendto() and recvfrom() Call
  1423.  
  1424.   int bytes_sent;
  1425.   int bytes_received;
  1426.   char data_sent[256] = "data to be sent using sendto()";
  1427.   char data_received[256];
  1428.   struct sockaddr_in to;
  1429.   struct sockaddr from;
  1430.   int addrlen;
  1431.   int s;
  1432.   ...
  1433.   memset(&to, 0, sizeof(to));
  1434.   to.sin_len = sizeof(to);
  1435.   to.sin_family = AF_INET;
  1436.   to.sin_addr.s_addr   = inet_addr("129.5.24.1");
  1437.   to.sin_port   = htons(1024);
  1438.   ...
  1439.   bytes_sent = sendto(s, data_sent, sizeof(data_sent), 0, (struct sockaddr *) &to, sizeof(to));
  1440.   ...
  1441.   addrlen = sizeof(from); /* must be initialized */
  1442.   bytes_received = recvfrom(s, data_received, sizeof(data_received), 0, &from, &addrlen);
  1443.  
  1444.  The sendto() and recvfrom() calls take additional parameters that allow the 
  1445.  caller to specify the recipient of the data or to be notified of the sender of 
  1446.  the data. See recvfrom(), and sendto(), for more information about these 
  1447.  additional parameters. 
  1448.  
  1449.  A list of the data transfer calls and a summary of some of their 
  1450.  characteristics follows: 
  1451.  
  1452.  Data Transfer Calls 
  1453.  
  1454.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1455.   ΓöéData Transfer Buffers      Option Flags? Sockets Used  Server       Γöé
  1456.   ΓöéCall                                     With          Address      Γöé
  1457.   Γöé                                                       Required?    Γöé
  1458.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1459.   Γöésend()        Single       Yes           Connected     No           Γöé
  1460.   Γöé                                         only                       Γöé
  1461.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1462.   Γöérecv()        Single       Yes           Connected     No           Γöé
  1463.   Γöé                                         only                       Γöé
  1464.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1465.   Γöésendto()      Single       Yes           Any socket    Yes          Γöé
  1466.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1467.   Γöérecvfrom()    Single       Yes           Any socket    Yes          Γöé
  1468.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1469.   Γöéwritev()      Multiple     No            Connected     No           Γöé
  1470.   Γöé                                         only                       Γöé
  1471.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1472.   Γöéreadv()       Multiple     No            Connected     No           Γöé
  1473.   Γöé                                         only                       Γöé
  1474.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1475.   Γöésendmsg()     Multiple     Yes           Any socket    Yes          Γöé
  1476.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1477.   Γöérecvmsg()     Multiple     Yes           Any socket    Yes          Γöé
  1478.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1479.  
  1480.  For additional information that you may need when obtaining or setting socket 
  1481.  options, see: 
  1482.  
  1483.      Socket Types 
  1484.      Out-of-Band Data 
  1485.      IP Multicasting 
  1486.  
  1487.  
  1488. ΓòÉΓòÉΓòÉ 3.14.2. Out-of-Band Data ΓòÉΓòÉΓòÉ
  1489.  
  1490. The stream socket abstraction includes the concept of out-of-band data. 
  1491. Out-of-band data is a logically independent transmission channel associated 
  1492. with each pair of connected stream sockets. Out-of-band data can be delivered 
  1493. to the socket independently of the normal receive queue or within the receive 
  1494. queue depending upon the status of the SO_OOBINLINE socket-level option. The 
  1495. abstraction defines that the out-of-band data facilities must support the 
  1496. reliable delivery of at least one out-of-band message at a time. This message 
  1497. must contain at least one byte of data, and at least one message can be pending 
  1498. delivery to the user at any one time. 
  1499.  
  1500. For communication protocols that support only in-band signaling (that is, the 
  1501. urgent data is delivered in sequence with the normal data), the operating 
  1502. system normally extracts the data from the normal data stream and stores it 
  1503. separately. This allows users to choose between receiving the urgent data in 
  1504. order and receiving it out of sequence without having to buffer all the 
  1505. intervening data. 
  1506.  
  1507. If multiple sockets have out-of-band data awaiting delivery, an application 
  1508. program can use a select() call for exceptional conditions to determine those 
  1509. sockets with such data pending. The select() call does not indicate the actual 
  1510. arrival of the out-of-band data, but only notification that it is pending. 
  1511.  
  1512. In addition to the information passed, a logical mark is placed in the data 
  1513. stream to indicate the point at which the out-of-band data was sent. When a 
  1514. signal flushes any pending output, all data up to the mark in the data stream 
  1515. is discarded. 
  1516.  
  1517. To send an out-of-band message, the MSG_OOB flag is supplied to a send() or 
  1518. sendto() call. To receive out-of-band data, an application program must set the 
  1519. MSG_OOB flag when performing a recvfrom() or recv() call. 
  1520.  
  1521. An application program can determine if the read pointer is currently pointing 
  1522. at the logical mark in the data stream, by using the SIOCATMARK ioctl() call. 
  1523.  
  1524. A process can also read or peek at the out-of-band data without first reading 
  1525. up to the logical mark. This is more difficult when the underlying protocol 
  1526. delivers the urgent data in-band with the normal data, and only sends 
  1527. notification of its presence ahead of time (that is, the TCP protocol used to 
  1528. implement streams in the internet domain). With such protocols, the out-of-band 
  1529. byte may not have arrived when a recv() call is performed with the MSG_OOB 
  1530. flag. In that case, the call will return an SOCEWOULDBLOCK error code. There 
  1531. may be enough in-band data in the input buffer for normal flow control to 
  1532. prevent the peer from sending the urgent data until the buffer is cleared. The 
  1533. process must then read enough of the queued data so that the urgent data can be 
  1534. delivered. 
  1535.  
  1536. Certain programs that use multiple bytes of urgent data, and that must handle 
  1537. multiple urgent signals, need to retain the position of urgent data within the 
  1538. stream. The socket-level option, SO_OOBINLINE provides the capability. With 
  1539. this option, the position of the urgent data (the logical mark) is retained. 
  1540. The urgent data immediately follows the mark within the normal data stream that 
  1541. is returned without the MSG_OOB flag. Reception of multiple urgent indications 
  1542. causes the mark to move, but no out-of-band data is lost. 
  1543.  
  1544.  
  1545. ΓòÉΓòÉΓòÉ 3.14.3. Socket I/O Modes ΓòÉΓòÉΓòÉ
  1546.  
  1547. Sockets can be set to either blocking or nonblocking I/O mode. The FIONBIO 
  1548. ioctl operation is used to determine this mode. When the FIONBIO ioctl is set, 
  1549. the socket is marked nonblocking. If a read is tried and the desired data is 
  1550. not available, the socket does not wait for the data to become available, but 
  1551. returns immediately with the SOCEWOULDBLOCK error code. 
  1552.  
  1553. When the FIONBIO ioctl is not set, the socket is in blocking mode. In this 
  1554. mode, if a read is tried and the desired data is not available, the calling 
  1555. process waits for the data. Similarly, when writing, if FIONBIO is set and the 
  1556. output queue is full, an attempt to write causes the process to return 
  1557. immediately with an error code of SOCEWOULDBLOCK. 
  1558.  
  1559. An example of using the ioctl() call to help perform asynchronous (nonblocking) 
  1560. socket operations is: 
  1561.  
  1562.  
  1563. An Application Using the ioctl() Call
  1564.  
  1565. int s;
  1566. int bytes_received;
  1567. int dontblock;
  1568. char buf[256];
  1569. int rc;
  1570. ...
  1571. dontblock = 1;
  1572. ...
  1573. rc = ioctl(s, FIONBIO, (char *) &dontblock);
  1574. ...
  1575. bytes_received = recv(s, buf, sizeof(buf), 0);
  1576. if (bytes_received == -1)
  1577. {
  1578. if (sock_errno() == SOCEWOULDBLOCK)
  1579. /* data is not present */
  1580. else
  1581. /* error occurred */
  1582. }
  1583. else
  1584. /* bytes_ received indicates amount of data received in buf */
  1585.  
  1586. This example causes the socket s to be placed in nonblocking mode.  When this 
  1587. socket is passed as a parameter to calls that would block, such as recv() when 
  1588. data is not present, it causes the call to return with an error code, and sets 
  1589. the error value to SOCEWOULDBLOCK.  Setting the mode of the socket to be 
  1590. nonblocking allows an application to continue processing without becoming 
  1591. blocked. For a more detailed description, see ioctl(). 
  1592.  
  1593. When performing nonblocking I/O on sockets, a program must check for the 
  1594. SOCEWOULDBLOCK error code. This occurs when an operation would normally block, 
  1595. but the socket it was performed on is marked as nonblocking. The following 
  1596. socket calls return a SOCEWOULDBLOCK error code: 
  1597.  
  1598.      accept() 
  1599.      send() 
  1600.      recv() 
  1601.      readv() 
  1602.      writev() 
  1603.  
  1604.  Processes using these calls should be prepared to deal with the SOCEWOULDBLOCK 
  1605.  error code. For a nonblocking socket, the connect() call returns an 
  1606.  SOCEINPROGRESS error code if the connection cannot be completed immediately. 
  1607.  
  1608.  If an operation such as a send operation cannot be done completely, but 
  1609.  partial writes are permissible (for example when using a stream socket), the 
  1610.  data that can be sent immediately is processed, and the return value indicates 
  1611.  the amount actually sent. 
  1612.  
  1613.  
  1614. ΓòÉΓòÉΓòÉ 3.15. Socket Shutdown ΓòÉΓòÉΓòÉ
  1615.  
  1616. Once a socket is no longer required, the calling program can discard the socket 
  1617. by applying a soclose() call to the socket descriptor. If a reliable delivery 
  1618. socket has data associated with it when a close takes place, the system 
  1619. continues to attempt data transfer. However, if the data is still not 
  1620. delivered, the system discards the data. Should the application program have no 
  1621. use for any pending data, it can use the shutdown() call on the socket prior to 
  1622. closing it. 
  1623.  
  1624. Topics 
  1625.  
  1626.       Closing Sockets 
  1627.  
  1628.  
  1629. ΓòÉΓòÉΓòÉ 3.15.1. Closing Sockets ΓòÉΓòÉΓòÉ
  1630.  
  1631. Closing a socket and reclaiming its resources is not always a straightforward 
  1632. operation. In certain situations, such as when a process exits, a soclose() 
  1633. call is expected to be successful. However, when a socket promising reliable 
  1634. delivery of data is closed with data still queued for transmission or awaiting 
  1635. acknowledgment of reception, the socket must attempt to transmit the data. If 
  1636. the socket discards the queued data to allow the soclose() call to complete 
  1637. successfully, it violates its promise to deliver data reliably. Discarding data 
  1638. can cause naive processes, which depend upon the implicit semantics of the 
  1639. soclose() call, to work unreliably in a network environment. However, if 
  1640. sockets block until all data has been transmitted successfully, in some 
  1641. communication domains a soclose() call may never complete. 
  1642.  
  1643. The sockets layer compromises in an effort to address this problem and maintain 
  1644. the semantics of the soclose() call. In normal operation, closing a socket 
  1645. causes any queued but unaccepted connections to be discarded. If the socket is 
  1646. in a connected state, a disconnect is initiated. When the disconnect request 
  1647. completes, the network support notifies the sockets layer, and the socket 
  1648. resources are reclaimed. The network layer may then attempt to transmit any 
  1649. data queued in the socket's send buffer, although this is not guaranteed. 
  1650.  
  1651. Alternatively, a socket may be marked explicitly to force the application 
  1652. program to linger when closing until pending data are flushed and the 
  1653. connection has shut down. This option is marked in the socket data structure 
  1654. using the setsockopt() call with the SO_LINGER option. The setsockopt() call, 
  1655. using the linger option, takes a linger structure. When an application program 
  1656. indicates that a socket is to linger, it also specifies a duration for the 
  1657. lingering period. If the lingering period expires before the disconnect is 
  1658. completed, the socket layer forcibly shuts down the socket, discarding any data 
  1659. still pending. 
  1660.  
  1661. An example of deallocating the socket descriptor s using the soclose() call is: 
  1662.  
  1663.  
  1664. An Application Using the soclose() Call
  1665.  
  1666. ...
  1667. /* close the socket */
  1668. soclose(s);
  1669. ...
  1670.  
  1671.  
  1672. ΓòÉΓòÉΓòÉ 3.16. Typical Socket Session Diagram ΓòÉΓòÉΓòÉ
  1673.  
  1674. The following figure shows a graphical representation for the general sequence 
  1675. of socket calls needed to provide communication between applications for 
  1676. supported socket types. For stream or sequenced packet socket types, and for 
  1677. datagram socket types, see the following figure. This basic sequence is the 
  1678. same for each supported protocol family for all supported socket types. This 
  1679. means that a programmer can modify the protocol family selection and the 
  1680. networking addressing parameters of an existing sockets program, recompile and 
  1681. relink, and the program can be run with another protocol. This also allows 
  1682. programs that use sockets with multiple protocols to be easily constructed. 
  1683.  
  1684.  
  1685. A Typical Stream or Sequenced Packet Socket Session
  1686.  
  1687.  
  1688. ΓòÉΓòÉΓòÉ 3.17. TCP Extensions for Transactions (T/TCP) ΓòÉΓòÉΓòÉ
  1689.  
  1690. A client-server transaction is a client request to a server followed by the 
  1691. server's reply. TCP Extensions for Transactions (T/TCP) is an extension to TCP 
  1692. designed to make client-server transactions more efficient. For typical 
  1693. transaction processing, a reliable delivery of data is needed, with no explicit 
  1694. connection setup or tear down, and with minimal idle state at both ends.  UDP 
  1695. is faster but not reliable. Standard TCP provides the reliability but with the 
  1696. overhead of connection setup and time wait delay. T/TCP addresses these needs. 
  1697. T/TCP can match UDP performance, and adds reliability. 
  1698.  
  1699. The goal of T/TCP is to allow each transaction (request and response sequence) 
  1700. to be efficiently performed as a single incarnation of a TCP connection. 
  1701. Standard TCP imposes two performance problems for transaction-oriented 
  1702. communication.  First, a TCP connection is opened with a three-way handshake 
  1703. which must complete successfully before any data can be transferred. This 
  1704. handshake adds an extra round-trip time to transaction latency. Second, closing 
  1705. a TCP connection leaves one or both ends in time wait state (2 maximum segment 
  1706. lifetime periods (2 MSL)), which limits the rate of successive transactions 
  1707. between the same host-port pair, since a new incarnation cannot be reopened 
  1708. until the time wait delay expires.  (The default value for the time wait delay 
  1709. can be checked by using the INETCFG.EXE utility.) 
  1710.  
  1711. T/TCP addresses the handshake issue by using TCP Accelerated Open (TAO), which 
  1712. is based on using a new incarnation number called 'connection count (CC)'. 
  1713. T/TCP uses the monotonic property of CC values to bypass the handshake. A T/TCP 
  1714. server host keeps a cache containing the last valid CC value that it has 
  1715. received from each different client host. If an initial SYN segment (connection 
  1716. request) from a particular client host carries a CC value larger than the 
  1717. cached value, then the incoming segment is ensured to be new and the connection 
  1718. can be accepted immediately. The use of CC also truncates the time wait delay. 
  1719. Apart from rate of transactions, reduction in the time wait delay also saves 
  1720. locked-up resources from the hosts. 
  1721.  
  1722. T/TCP introduces three new TCP options; namely, CC, CCnew and CCecho, and adds 
  1723. seven new states to the existing ten finite TCP states. To invoke T/TCP, both 
  1724. client and server ends of the transaction must support T/TCP. The CC value is 
  1725. sent by the client in the SYN segment (for active open) indicating a 
  1726. willingness to use T/TCP. The server sends back CCecho in the SYN-ACK segment, 
  1727. declaring that it understands T/TCP. The client can still optionally disable 
  1728. T/TCP and force a handshake by sending a CCNew segment. If any of the ends do 
  1729. not support T/TCP, the connection procedure reverts to the normal TCP 
  1730. connection setup procedure. 
  1731.  
  1732. To take advantage of T/TCP, the socket calls sequence on a typical T/TCP client 
  1733. application is different from the client shown in  A Typical Stream or 
  1734. Sequenced Packet Socket Session.  On a typical T/TCP client application, after 
  1735. opening a Stream socket the client does not call connect(). Instead, it calls 
  1736. sendto() with the flag of MSG_EOF. This will send the request to the server, 
  1737. establish the connection, and cause a FIN to be sent from the client to the 
  1738. server. This single sendto() call combines the functionality of connect(), 
  1739. write(), and shutdown() of a normal TCP session. The typical T/TCP transaction 
  1740. server application is the same as a typical TCP server, except the MSG_EOF flag 
  1741. can be indicated on the send() call to cause a FIN to be sent at the end of the 
  1742. transaction data. 
  1743.  
  1744. T/TCP can be turned on for a system-wide effect through the INET configuration 
  1745. utility command 'inetcfg -set CC 1'. You can use getsockopt() and setsockopt() 
  1746. for each socket through the TCP_CC socket option.  By default the T/TCP option 
  1747. is turned off. 
  1748.  
  1749. To assure that T/TCP is being invoked, IP tracing function can be turned on 
  1750. through 'iptrace -i', and the trace file IPTRACE.DMP can be formatted with the 
  1751. IPFORMAT utility, which can explicitly show the three CC option values in the 
  1752. formatted dump. 
  1753.  
  1754. For more details on T/TCP functional specification, refer to RFC 1644 T/TCP 
  1755. -TCP Extensions for Transactions Functional Specification. 
  1756.  
  1757.  
  1758. ΓòÉΓòÉΓòÉ 3.18. TCP Extensions for High Performance (RFC 1323) ΓòÉΓòÉΓòÉ
  1759.  
  1760. Request For Comments 1323 suggested some TCP extensions for performance 
  1761. improvement over very high speed links. Two TCP options are introduced by RFC 
  1762. 1323: Window Scale and TCP Timestamps. 
  1763.  
  1764. The Window Scale option allows the TCP receive window size to be larger than 
  1765. the present limit of 64K bytes, by defining an implicit scale factor, which is 
  1766. used to multiply the window size value found in the TCP header to obtain the 
  1767. true window size. The Window Scale option is carried in SYN segments during the 
  1768. connection setup phase. 
  1769.  
  1770. If the TCP Timestamp option is enabled, the sender places a time stamp in every 
  1771. TCP segment, and then the receiver sends the time stamp back in the 
  1772. acknowledgment, allowing the sender to calculate the Round Trip Time (RTT) for 
  1773. each acknowledgment. This RTT estimation helps TCP to discard received 
  1774. duplicate segments, to calculate the retransmission timer, and to decide 
  1775. whether to start the slow-start process. The presence of the TCP Timestamp 
  1776. option also allows TCP to perform Protection Against Wrapped Sequences (PAWS). 
  1777. PAWS assumes that every received TCP segment contains a TCP time stamp whose 
  1778. values are monotonically non-decreasing in time. A segment can be discarded as 
  1779. an old duplicate if it is received with a time stamp less than a time stamp 
  1780. recently received on this connection. 
  1781.  
  1782. The TCP Timestamp option can be enabled for a system-wide effect through the 
  1783. INET configuration utility 'inetcfg -set timestmp 1'. It can also be retrieved 
  1784. and set for each socket through the TCP_TIMESTMP socket option. Similarly, the 
  1785. Window Scale option can be enabled system-wide through 'inetcfg -set winscale 
  1786. 1,' and can also be retrieved and set for each socket through the TCP_WINSCALE 
  1787. socket option. 
  1788.  
  1789. By default, the system-wide Window Scaling option is enabled and the 
  1790. system-wide TCP Timestamp option is disabled. Both options, if set, can be 
  1791. traced through the IPTRACE utility and can be displayed in the IPFORMAT dump. 
  1792.  
  1793. For more details on these two TCP extensions, refer to RFC 1323 TCP Extensions 
  1794. for High Performance. 
  1795.  
  1796.  
  1797. ΓòÉΓòÉΓòÉ 3.19. High Performance Send ΓòÉΓòÉΓòÉ
  1798.  
  1799. High Performance Send is a new feature of TCP/IP 4.1 that allows an application 
  1800. to send data over sockets without incurring a memory copy.  To use it, special 
  1801. memory is first allocated to the application from the TCP/IP stack with the 
  1802. sysctl() call. Then the application calls  send(), sendto(), or sendmsg() with 
  1803. the MSG_MAPIO flag. The application must wait for notification from the stack 
  1804. that the stack has finished using the memory passed on the previous send-type 
  1805. call. Only then should the application reuse the memory to send more data. 
  1806.  
  1807. There are two ways to determine if the stack has finished using the memory: 
  1808. event semaphores and polling. These are described in Determining if HPS Memory 
  1809. is Available for Reuse. 
  1810.  
  1811. A complete example of using HPS appears in the samples directory of the 
  1812. toolkit. 
  1813.  
  1814. Topics 
  1815.  
  1816.       Allocating HPS Memory 
  1817.       Using HPS Memory with Send Calls 
  1818.       Determining if HPS Memory is Available for Reuse 
  1819.       Freeing HPS Memory 
  1820.  
  1821.  
  1822. ΓòÉΓòÉΓòÉ 3.19.1. Allocating HPS Memory ΓòÉΓòÉΓòÉ
  1823.  
  1824. To allocate HPS memory, the application calls sysctl() as follows: 
  1825.  
  1826.            int mib[4];
  1827.            unsigned long ptrs[15];
  1828.            size_t ptrslen;
  1829.            int ret;
  1830.            mib[0] = CTL_OS2;
  1831.            mib[1] = PF_INET;
  1832.            mib[2] = IPPROTO_IP;
  1833.            mib[3] = OS2_MEMMAPIO;
  1834.  
  1835.            memset(ptr, 0, sizeof(ptrs));
  1836.            ptrslen = sizeof(ptrs);
  1837.            ret = sysctl(mib, sizeof(mib) / sizeof(mib[0]), ptrs,
  1838.                         &ptrslen, NULL, 0);
  1839.  
  1840. The TCP/IP stack will allocate 60K bytes of memory and return 15 pointers to 4K 
  1841. byte blocks.  These must be passed on subsequent send calls with the MSG_MAPIO 
  1842. flag. 
  1843.  
  1844. To allocate memory and attach a shared-event semaphore to each block as well, 
  1845. the application should initialize the ptrs array with the shared-event 
  1846. semaphore handles before calling sysctl(): 
  1847.  
  1848.            int mib[4];
  1849.            unsigned long ptrs[15];
  1850.            size_t ptrslen;
  1851.            int i;
  1852.            APIRET rc;
  1853.            int ret;
  1854.  
  1855.            mib[0] = CTL_OS2;
  1856.            mib[1] = PF_INET;
  1857.            mib[2] = IPPROTO_IP;
  1858.            mib[3] = OS2_MEMMAPIO;
  1859.  
  1860.            for (i = 0; i < sizeof(ptrs) / sizeof(ptrs[0]); i++) {
  1861.                rc = DosCreateEventSemaphore(NULL, &ptrs[i], DC_SEM_SHARED, FALSE);
  1862.                if (rc != NO_ERROR)
  1863.                   exit(1);
  1864.            }
  1865.            ptrslen = sizeof(ptrs);
  1866.            ret = sysctl(mib, sizeof(mib) / sizeof(mib[0]), ptrs, &ptrslen, NULL, 0);
  1867.  
  1868.  
  1869. ΓòÉΓòÉΓòÉ 3.19.2. Using HPS Memory with Send Calls ΓòÉΓòÉΓòÉ
  1870.  
  1871. To send data using HPS, the user passes one or more of the pointers received 
  1872. from an HPS allocation call to one of the send-type calls along with the 
  1873. MSG_MAPIO flag: 
  1874.  
  1875.           int ret, sock;
  1876.           unsigned long ptrs[15];
  1877.           struct msghdr hdr;
  1878.           struct iovec iovec[2];
  1879.  
  1880.           ret = send(sock, ptrs[0], 4096, MSG_MAPIO);
  1881.  
  1882.           hdr.msg_name = NULL;
  1883.           hdr.msg_namelen = 0;
  1884.           hdr.msg_iov = iovec;
  1885.           hdr.msg_iovlen = 2;
  1886.           iovec[0].iov_base = ptrs[0];
  1887.           iovec[0].iov_len = 4096;
  1888.           iovec[1].iov_base = ptrs[1];
  1889.           iovec[1].iov_len = 96;
  1890.           hdr.msg_control = NULL;
  1891.           hdr.msg_controllen = 0;
  1892.           hdr.msg_flags = 0;
  1893.           ret = sendmsg(sock, &hdr, MSG_MAPIO);
  1894.  
  1895. Notes: 
  1896.  
  1897.    1. On the send() and sendto() calls, only one pointer and up to 4096 bytes 
  1898.       may be sent per call. 
  1899.  
  1900.    2. The pointers passed to the any of the send-type calls must be exactly as 
  1901.       returned from the allocation call; they may not be altered in any way. 
  1902.  
  1903.  
  1904. ΓòÉΓòÉΓòÉ 3.19.3. Determining if HPS Memory is Available for Reuse ΓòÉΓòÉΓòÉ
  1905.  
  1906. After a successful send-type call using HPS memory, the user must wait until 
  1907. the stack is finished with it before reusing it.  There are two ways to 
  1908. determine if HPS memory is available for reuse: event semaphores and polling. 
  1909.  
  1910. To use the event semaphores method, the application must allocate 15 shared 
  1911. event sempahores and pass them on the sysctl() call used to allocate the HPS 
  1912. memory (see the second example under Allocating HPS Memory).  When the stack is 
  1913. finished using the HPS memory, it will post any event semaphores corresponding 
  1914. to the 4K blocks that are now free. 
  1915.  
  1916. To use the polling method, the application calls sysctl() with an array of 
  1917. pointers.  The stack will check each pointer, and if the block is in use, will 
  1918. zero the pointer in the array.  The polling method may be used even if event 
  1919. semaphores were also allocated for the memory. Following is an example of the 
  1920. polling method: 
  1921.  
  1922.          long arrayofptrs[15];
  1923.          int mib[4];
  1924.          unsigned int needed;
  1925.  
  1926.          mib[0] = CTL_OS2;
  1927.          mib[1] = AF_INET;
  1928.          mib[2] = 0;
  1929.          mib[3] = OS2_QUERY_MEMMAPIO;
  1930.          needed = sizeof(arrayofptrs);
  1931.  
  1932.          if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), arrayofptrs,
  1933.              &needed, NULL, 0) < 0) {
  1934.              psock_errno("sysctl(QUERY_MEMMAPIO)");
  1935.              exit(1);
  1936.          }
  1937.          for (i = 0; i < 15; i++) {
  1938.             if (arrayofptrs[i] == 0) {
  1939.                /* pointer is in use */
  1940.             }
  1941.          }
  1942.  
  1943.  
  1944. ΓòÉΓòÉΓòÉ 3.19.4. Freeing HPS Memory ΓòÉΓòÉΓòÉ
  1945.  
  1946. To free HPS memory, the application calls sysctl() as follows: 
  1947.  
  1948.          int mib[4];
  1949.          unsigned long ptrs[15];
  1950.          int ret;
  1951.  
  1952.          mib[0] = CTL_OS2;
  1953.          mib[1] = PF_INET;
  1954.          mib[2] = IPPROTO_IP;
  1955.          mib[3] = OS2_MEMMAPIO;
  1956.  
  1957.          ret = sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL,
  1958.                       0, ptrs, sizeof(ptrs));
  1959.  
  1960. The ptrs parameter is the list of array of pointers returned on the allocation 
  1961. call. 
  1962.  
  1963.  
  1964. ΓòÉΓòÉΓòÉ 3.20. Passing Sockets Between Processes ΓòÉΓòÉΓòÉ
  1965.  
  1966. Because sockets are not file handles on OS/2, sockets are not automatically 
  1967. passed from a parent process to a child process. Instead, sockets are global to 
  1968. the system and unsecure, so that any process may access any valid socket. To 
  1969. ensure sockets are always properly closed when a process terminates, 
  1970. TCPIP32.DLL installs an exit list handler (with an order code of 0x99) that 
  1971. closes all remaining sockets that were opened by that process. If a process 
  1972. attempts to pass a socket to a child process, both the parent and child need to 
  1973. notify TCPIP32.DLL that a change in ownership occurred so that the exit list 
  1974. handler for the two processes close the correct sockets when the processes 
  1975. terminate. 
  1976.  
  1977. To pass ownership from parent to child, the parent process needs to issue 
  1978. removesocketfromlist() with the socket number that is being transferred to the 
  1979. child. The child process needs to issue addsockettolist() with the same socket 
  1980. number to assume ownership of it. After these two calls are completed, the 
  1981. child process's exit list handler will automatically close the socket that was 
  1982. passed once the child terminates (unless the child application closes the 
  1983. socket itself before it terminates.) See addsockettolist() and 
  1984. removesocketfromlist() for additional details. 
  1985.  
  1986.  
  1987. ΓòÉΓòÉΓòÉ 3.21. Multithreading Considerations ΓòÉΓòÉΓòÉ
  1988.  
  1989. The sockets and network utility routines are completely reentrant. Multiple 
  1990. threads of an application can perform any socket call. 
  1991.  
  1992. Note:  Each thread that makes sockets calls has memory automatically allocated 
  1993.        for it by TCPIP32.DLL to store per-thread information (such as the error 
  1994.        code for the last sockets call made on that thread).  If a thread only 
  1995.        makes protocol-independent calls, the amount of memory allocated will be 
  1996.        small (on the order of 100 bytes).  If a thread issues any of the TCP/IP 
  1997.        network utility calls, however, a 4K block will also be allocated for 
  1998.        that thread.  None of the memory that is allocated will be deallocated 
  1999.        until the process terminates.  It will be reused however, if a thread 
  2000.        terminates and another thread is created. 
  2001.  
  2002.  
  2003. ΓòÉΓòÉΓòÉ 3.22. Accessing a TCP/IP API DLL from an Intermediate DLL ΓòÉΓòÉΓòÉ
  2004.  
  2005. A TCP/IP API DLL can be accessed both directly from an application and through 
  2006. an intermediate DLL. An example of an intermediate DLL is a virtual network API 
  2007. layer that supports generalized network functionality for applications and uses 
  2008. the TCP/IP API. 
  2009.  
  2010. The OS/2 Warp Toolkit contains a sample program to build a DLL.  You can find 
  2011. the program in the SAMPLES\TCPIPTK\SAMPDLL directory. 
  2012.  
  2013. For more information about DLLs, refer to the OS/2 Warp Technical Library, 
  2014. Control Programming Guide 
  2015.  
  2016.  
  2017. ΓòÉΓòÉΓòÉ 3.23. Differences between OS/2 and Standard BSD Sockets ΓòÉΓòÉΓòÉ
  2018.  
  2019. Networking services sockets is based on the Berkeley Software Distribution 
  2020. version 4.4 sockets implementation. 
  2021.  
  2022. The IBM OS/2 socket implementation differs from the Berkeley socket 
  2023. implementation as follows: 
  2024.  
  2025.      Sockets are not OS/2 files or devices.  Socket numbers have no 
  2026.       relationship to OS/2 file handles.  Therefore, the read(), write(), and 
  2027.       close() calls do not work for sockets: using them gives incorrect 
  2028.       results.  Use the recv(), send(), and soclose() calls instead. 
  2029.  
  2030.      Error codes set by the OS/2 TCP/IP sockets implementation are not made 
  2031.       available via the global errno variable.  Instead, error codes are 
  2032.       accessed by using the sock_errno() call (see sock_errno()). Use the 
  2033.       psock_errno() call, instead of the perror() call, to write a short error 
  2034.       message to the standard error device describing the last error 
  2035.       encountered during a call to a socket library function.  To access system 
  2036.       return values, use the errno.h include statement supplied with the 
  2037.       compiler. 
  2038.  
  2039.       This is intended to obtain per-thread error codes in a multithreaded 
  2040.       application environment and to avoid conflict with standard ANSI C error 
  2041.       constants. 
  2042.  
  2043.       BSD-style error checking is as follows: 
  2044.  
  2045.         - 
  2046.  
  2047.                       rt = recv(s, buf, sizeof(buf), 0);
  2048.                       if (rt == -1 && errno == EWOULDBLOCK)
  2049.                       {...}
  2050.  
  2051.         - 
  2052.  
  2053.                       if (recv(s, buf, sizeof(buf), 0) < 0) {
  2054.                       perror("Recv()");
  2055.                       exit(1);
  2056.                       }
  2057.  
  2058.       The preferred OS/2-style error checking is as follows: 
  2059.  
  2060.         - 
  2061.  
  2062.                       rt = recv(s, buf, sizeof(buf), 0);
  2063.                       if (rt == -1 && sock_errno() == SOCEWOULDBLOCK)
  2064.                       {...}
  2065.  
  2066.         - 
  2067.  
  2068.                       if (recv(s, buf, sizeof(buf), 0) < 0)
  2069.                       {
  2070.                       psock_errno("Recv()");
  2071.                       exit(1);
  2072.                       }
  2073.  
  2074.       Error constants consistent with BSD sockets are provided for 
  2075.       compatibility purposes; your application can use the error constant 
  2076.       EWOULDBLOCK, instead of SOCEWOULDBLOCK.  See Socket Error Constants, or 
  2077.       the <NERRNO.H> file for definitions of error constants. 
  2078.  
  2079.      Unlike the Berkeley select() call, you cannot use the OS/2 select() call 
  2080.       to wait for activity on devices other than sockets.  See select() for 
  2081.       more information. 
  2082.  
  2083.      The ioctl(), getsockopt(), setsockopt(), and sysctl() calls don't support 
  2084.       all of the options supported by BSD and add some options not supported by 
  2085.       BSD. See ioctl(), getsockopt(), setsockopt(), and sysctl() for more 
  2086.       information. 
  2087.  
  2088.  
  2089. ΓòÉΓòÉΓòÉ 3.24. Compiling and Linking a Sockets API Application ΓòÉΓòÉΓòÉ
  2090.  
  2091. Follow these steps to compile and link a sockets API application using the IBM 
  2092. VisualAge C++ compiler: 
  2093.  
  2094.    1. To compile your program, enter: 
  2095.  
  2096.             icc /Gm /c myprog.c
  2097.  
  2098.    2. To create an executable program, you can enter: 
  2099.  
  2100.       For VisualAge C++ 
  2101.  
  2102.             ilink /NOFREEFORMAT myprog,myprog.exe /STACK:0x4000
  2103.  
  2104.  Note:  For more information about the compile and link options, multithreaded 
  2105.         libraries, and dynamic link libraries, refer to the User's Guide 
  2106.         provided with your compiler. 
  2107.  
  2108.  
  2109. ΓòÉΓòÉΓòÉ 3.25. Sample Programs ΓòÉΓòÉΓòÉ
  2110.  
  2111. The following sample programs are included in the TCP/IP toolkit: 
  2112.  
  2113.  SOCKET    These samples consist of several C socket client-server programs. 
  2114.  
  2115.  SAMPDLL   These samples demonstrate building and using a DLL that uses TCP/IP. 
  2116.  
  2117.  HPS       These samples demonstrate using High Performance Send. 
  2118.  
  2119.  RPC       These samples provide examples of Remote Procedure Call (RPC) 
  2120.            client, server, and raw data stream programs. 
  2121.  
  2122.  RPCGEN    The samples define remote procedure characteristics and demonstrate 
  2123.            an RPC client and server program. 
  2124.  
  2125.  
  2126. ΓòÉΓòÉΓòÉ 4. Sockets in the Internet Domain ΓòÉΓòÉΓòÉ
  2127.  
  2128. This section describes the use of sockets in the internet domain. 
  2129.  
  2130. Topics 
  2131.  
  2132.       Protocols Used in the Internet Domain 
  2133.       Getting Started with Sockets in the Internet Domain 
  2134.       Network-Byte Order 
  2135.       Internet Address Formats 
  2136.       TCP/IP-Specific Network Utility Routines 
  2137.       The _res Data Structure 
  2138.       Ports 
  2139.       IP Multicasting 
  2140.       Socket Secure Support 
  2141.  
  2142.  
  2143. ΓòÉΓòÉΓòÉ 4.1. Protocols Used in the Internet Domain ΓòÉΓòÉΓòÉ
  2144.  
  2145. This section describes the network protocols in TCP/IP. The internet domain is 
  2146. supported only by the TCP/IP protocol suite. Networking protocols like TCP/IP 
  2147. are layered as shown in the following figure. For more information on the 
  2148. internet domain and the TCP/IP protocol suite, refer to TCP/IP Illustrated, 
  2149. Volume 1: The Protocols, W. Richard Stevens, Addison-Wesley Publishing Co., 
  2150. 1994. 
  2151.  
  2152.  
  2153. The Internet Layered Architecture
  2154.  
  2155. Topics 
  2156.  
  2157.       Transmission Control Protocol (TCP) 
  2158.       User Datagram Protocol (UDP) 
  2159.       Internet Protocol (IP) 
  2160.       Internet Control Message Protocol (ICMP) 
  2161.       Address Resolution Protocol (ARP) 
  2162.       Internet Group Management Protocol (IGMP) 
  2163.  
  2164.  
  2165. ΓòÉΓòÉΓòÉ 4.1.1. Transmission Control Protocol (TCP) ΓòÉΓòÉΓòÉ
  2166.  
  2167. TCP is a transport protocol that provides a reliable mechanism for delivering 
  2168. packets between hosts on an internet. TCP takes a stream of data, breaks it 
  2169. into datagrams, sends each one individually using Internet Protocol (IP), and 
  2170. reassembles the datagrams at the destination node. If any datagrams are lost or 
  2171. damaged during transmission, TCP detects this and resends the missing 
  2172. datagrams. The received data stream is a reliable copy of the transmitted data 
  2173. stream. 
  2174.  
  2175. Note:  The PUSH flag is a notification from the sender to the receiver for the 
  2176.        receiver to pass all the data that it has to the receiving process. 
  2177.        This data consists of whatever is in the segment with the PUSH flag, 
  2178.        along with any other data the receiving TCP has collected for the 
  2179.        receiving process. Our TCP implementation automatically sets the PUSH 
  2180.        flag if the data in the segment being sent empties the send buffer. In 
  2181.        addition, our implementation ignores a received PUSH flag because we 
  2182.        don't delay the delivery of the received data to the application. 
  2183.  
  2184.  You can use TCP sockets for both passive (server) and active (client) 
  2185.  applications. While some calls are necessary for both types, some are 
  2186.  role-specific. TCP is the default protocol for stream sockets in the internet 
  2187.  domain. For sample C socket communication client and server programs, see the 
  2188.  TCP/IP samples included in the OS/2 Warp Toolkit. 
  2189.  
  2190.  TCP is a connection-oriented protocol.  It is used to communicate between 
  2191.  pairs of applications. After you make a connection, it exists until you close 
  2192.  the socket. During the connection, data is either delivered or an error code 
  2193.  is returned by networking services. 
  2194.  
  2195.  
  2196. ΓòÉΓòÉΓòÉ 4.1.2. User Datagram Protocol (UDP) ΓòÉΓòÉΓòÉ
  2197.  
  2198. UDP is a transport-layer datagram protocol that sends and receives whole 
  2199. packets across the network. UDP is used for application-to-application programs 
  2200. between TCP/IP hosts. UDP does not offer a guarantee of datagram delivery or 
  2201. duplication protection.  UDP does provide checksums for both the header and 
  2202. data portions of a datagram. However, applications that require reliable 
  2203. delivery of streams of data should use TCP. UDP is the default protocol for 
  2204. datagram sockets in the internet domain. 
  2205.  
  2206. Unlike applications using TCP, UDP applications are usually connectionless.  A 
  2207. UDP socket application can become connected by calling the connect() API. An 
  2208. unconnected socket can be used to communicate with many hosts; but a connected 
  2209. socket, because it has a dedicated destination, can exchange data with only one 
  2210. host at a time. 
  2211.  
  2212. UDP is considered an unreliable protocol because it sends its data over the 
  2213. network without verification. Consequently, after a packet has been accepted by 
  2214. the UDP interface, neither the arrival of the packet nor the arrival order of 
  2215. the packet at the destination can be guaranteed. 
  2216.  
  2217.  
  2218. ΓòÉΓòÉΓòÉ 4.1.3. Internet Protocol (IP) ΓòÉΓòÉΓòÉ
  2219.  
  2220. The IP network layer provides the interface from the transport layer 
  2221. (host-to-host) protocols to the link-level protocols. IP is the basic transport 
  2222. mechanism for routing IP packets to the next gateway, router, or destination 
  2223. host. 
  2224.  
  2225. IP provides the means to transmit packets of data from sources to destinations. 
  2226. Sources and destinations are hosts identified by 32-bit IP addresses, which are 
  2227. assigned independent of the underlying physical network. Outgoing packets 
  2228. automatically have an IP header prepended to them, and incoming packets have 
  2229. their IP header removed before being passed to the higher-level protocols. This 
  2230. protocol ensures the unique addressing of hosts in an internet network. 
  2231.  
  2232. IP does not ensure a reliable communication, because it does not require 
  2233. acknowledgments from the sending host, the receiving host, or intermediate 
  2234. hosts. IP does not provide error control for data; it provides only a header 
  2235. checksum. IP treats each packet as an independent entity, unrelated to any 
  2236. other packet. IP does not perform retransmissions or flow control. A 
  2237. higher-level protocol like TCP (Transmission Control Protocol) that uses IP 
  2238. must implement its own reliability procedures. 
  2239.  
  2240. Applications do not typically access IP directly, but rather use TCP or UDP 
  2241. which, in turn, use IP. Raw sockets can use IP. 
  2242.  
  2243.  
  2244. ΓòÉΓòÉΓòÉ 4.1.4. Internet Control Message Protocol (ICMP) ΓòÉΓòÉΓòÉ
  2245.  
  2246. ICMP is used to pass control information between hosts. For example, the 
  2247. information can be sent in any of the following situations: 
  2248.  
  2249.      When a host checks to see if another host is available (PING) 
  2250.      When a packet cannot reach its destination 
  2251.      When a gateway or router can direct a host to send traffic on a shorter 
  2252.       route 
  2253.      When a gateway or router does not have the buffering capacity to forward 
  2254.       a packet 
  2255.  
  2256.  ICMP provides feedback about problems in the communication environment; it 
  2257.  does not make IP reliable. The use of ICMP does not guarantee that an IP 
  2258.  packet will be delivered reliably or that an ICMP message will be returned to 
  2259.  the source host when an IP packet is not delivered or is incorrectly 
  2260.  delivered. 
  2261.  
  2262.  Raw sockets can use ICMP and, like IP, ICMP is not typically used by 
  2263.  application programs directly. 
  2264.  
  2265.  
  2266. ΓòÉΓòÉΓòÉ 4.1.5. Address Resolution Protocol (ARP) ΓòÉΓòÉΓòÉ
  2267.  
  2268. ARP maps IP addresses to hardware addresses. TCP/IP uses ARP to collect and 
  2269. distribute the information for mapping tables. 
  2270.  
  2271. ARP is not directly available to users or applications. When an application 
  2272. sends an internet packet, IP requests the appropriate address mapping. If the 
  2273. mapping is not in the mapping table, an ARP broadcast packet is sent to all the 
  2274. hosts on the local network requesting the physical hardware address for the 
  2275. host. 
  2276.  
  2277. Proxy ARP allows an assigned substitute ARP agent (typically a router) to 
  2278. respond to ARP requests on behalf of certain hosts which reside on the outside 
  2279. of a network. A proxy ARP agent must be defined beforehand for the ARP hosts 
  2280. which will have their -P (Public) flag set. 
  2281.  
  2282.  
  2283. ΓòÉΓòÉΓòÉ 4.1.6. Internet Group Management Protocol (IGMP) ΓòÉΓòÉΓòÉ
  2284.  
  2285. RFC 1112 defines IGMP, which describes interactions between IP multicast hosts 
  2286. and multicast routers. A multicast router needs to know the current membership 
  2287. of host groups in all attached local networks in order to forward multicast 
  2288. datagrams to hosts on local networks.  IP multicast datagrams will not be 
  2289. forwarded to local networks if there are no members of the destination host 
  2290. group. 
  2291.  
  2292. There are two types of IGMP messages transmitted on local networks. Both types 
  2293. of messages are transmitted by multicasting to reduce network load.  A 
  2294. multicast router periodically sends IGMP membership queries to hosts on the 
  2295. same network.  An IGMP membership query is sent to the all-hosts group 
  2296. (224.0.0.1). 
  2297.  
  2298. Upon receiving a membership query from a multicast router, a multicast host 
  2299. starts a random timer for each host group joined on the interface that receives 
  2300. IGMP membership queries. A host sends IGMP membership reports when timers 
  2301. expire. Membership reports are sent to the host group being reported. 
  2302.  
  2303. If other hosts on the same network are to receive an IGMP membership report on 
  2304. the same host group, these hosts should cancel the timer before it expires. 
  2305. This prevents duplicated IGMP membership reports from flooding a local network. 
  2306. An IGMP membership report is also sent when a host joins a new host group. 
  2307.  
  2308. When a multicast router receives an IGMP membership report of one host group, 
  2309. the router updates its knowledge of the current membership on a particular 
  2310. network.  If no reports are received on a particular host group after several 
  2311. queries, a multicast router assumes that there are no local members on that 
  2312. host group and stops forwarding any multicast datagrams with that destination 
  2313. host group. 
  2314.  
  2315.  
  2316. ΓòÉΓòÉΓòÉ 4.2. Getting Started with Sockets in the Internet Domain ΓòÉΓòÉΓòÉ
  2317.  
  2318. This section provides some basic information for getting started with sockets 
  2319. in the internet domain: 
  2320.  
  2321.      Use the socket() call to create a socket in the internet domain 
  2322.       specifying PF_INET for the domain parameter. 
  2323.  
  2324.      Use AF_INET for the address family. 
  2325.  
  2326.      The following socket types are supported for the internet domain: 
  2327.  
  2328.         -  Datagram (SOCK_DGRAM) 
  2329.         -  Raw (SOCK_RAW) 
  2330.         -  Stream (SOCK_STREAM) 
  2331.  
  2332.       The socket type is passed as a parameter to the socket() call. For 
  2333.       additional information, see Socket Types and general socket programming 
  2334.       concepts in Sockets General Programming Information. 
  2335.  
  2336.      Datagram sockets use the UDP protocol, stream sockets use the TCP 
  2337.       protocol, and raw sockets can use the raw, ICMP, or IGMP protocols. 
  2338.  
  2339.      Use the network utility routines to get addresses with a given name (see 
  2340.       TCP/IP-Specific Network Utility Routines for additional information). 
  2341.  
  2342.  
  2343. ΓòÉΓòÉΓòÉ 4.3. Network-Byte Order ΓòÉΓòÉΓòÉ
  2344.  
  2345. Ports and addresses are specified to sockets API calls by using the 
  2346. network-byte ordering convention. Network-byte order is also known as big 
  2347. endian byte ordering, which has the high-order byte at the starting address. By 
  2348. contrast, little endian has the low-order byte at the starting address. Using 
  2349. network-byte ordering for data exchanged between hosts allows hosts using 
  2350. different underlying byte ordering conventions to exchange address information. 
  2351. There is a set of network utility functions for translating addresses from 
  2352. host-byte to network-byte order and from network-byte to host-byte order. For 
  2353. more information about network-byte order and address translation, see: 
  2354.  
  2355.      bind() 
  2356.      htonl() 
  2357.      htons() 
  2358.      ntohl() 
  2359.      ntohs() 
  2360.  
  2361.  Note:  The socket interface does not handle application data byte ordering 
  2362.         differences. Application writers must handle data buffer byte order 
  2363.         differences themselves. 
  2364.  
  2365.  
  2366. ΓòÉΓòÉΓòÉ 4.4. Internet Address Formats ΓòÉΓòÉΓòÉ
  2367.  
  2368. This section describes the address formats used in the internet domain. 
  2369.  
  2370. internet addresses (IP) are 32-bit values that represent a network interface. 
  2371. Every internet address within an administered internet (AF_INET) communication 
  2372. domain must be unique. A host can have as many internet addresses as it has 
  2373. network interfaces. For more information about internet address formats, see 
  2374. Internetworking with TCP/IP Volume I:  Principles, Protocols, and Architectures 
  2375. , and Volume II:  Implementation and Internals , Douglas E. Comer, Prentice 
  2376. Hall, 1991. 
  2377.  
  2378. Each internet host is assigned at least one unique internet address. This 
  2379. address is used by IP and other higher-level protocols. When a host is a 
  2380. gateway, it has more than one IP address.  Gateway hosts connect two or more 
  2381. physical networks and have one IP address per connected physical network. 
  2382.  
  2383. Addresses within an internet consist of a network number and a local address. 
  2384. All physical host IP addresses share the same network number and are logically 
  2385. part of the same network even if that network is connected with various 
  2386. physical media. 
  2387.  
  2388. Hosts on disjoint physical networks might also have the same network number, 
  2389. but are not part of the same internet network. Hosts that are part of the same 
  2390. internet network can exchange packets directly without going through 
  2391. intermediate routers. An internet network can be subdivided logically using a 
  2392. subnet mask. All host interfaces to the same physical network are given the 
  2393. same subnetwork number. An internet domain can provide standards for assigning 
  2394. addresses to networks, broadcasts, and subnetworks. 
  2395.  
  2396. Dotted-Decimal Notation: A commonly used notation for internet host addresses 
  2397. is the dotted-decimal format, which divides the 32-bit address into four 8-bit 
  2398. fields. The value of each field is specified as a decimal number, and the 
  2399. fields are separated by periods (for example, 10.2.0.52). 
  2400.  
  2401. Address examples in this document use dotted-decimal notation in the following 
  2402. forms: 
  2403.  
  2404.      nnn.lll.lll.lll 
  2405.      nnn.nnn.lll.lll 
  2406.      nnn.nnn.nnn.lll 
  2407.  
  2408.  where: 
  2409.  
  2410.  nnn     represents part or all of a network number. 
  2411.  lll     represents part or all of a local address. 
  2412.  
  2413.  Note:  Additional details about internet network address format class A, B, C, 
  2414.         and D addresses, subnetwork address format, and broadcast address 
  2415.         formats can be found in the TCP/IP Guide 
  2416.  
  2417.  Addressing within an Internet Domain: A socket address in an internet 
  2418.  communication domain is composed of five fields in the following sockaddr_in 
  2419.  structure: length, address family, port, internet address, and a .*  reserved 
  2420.  field. The sockaddr_in structure should be cleared before use. The structure 
  2421.  is located in the <NETINET\IN.H> header file: 
  2422.  
  2423.   struct in_addr {
  2424.           u_long s_addr;
  2425.   };
  2426.  
  2427.   struct sockaddr_in {
  2428.           u_char sin_len;            /* sizeof (struct sockaddr_in) = 16 */
  2429.           u_char sin_family;         /* AFINET */
  2430.           u_short sin_port;          /* port id */
  2431.           struct  in_addr sin_addr;  /* address */
  2432.           char    sin_zero[8];       /* not used */
  2433.   };
  2434.  
  2435.  The sin_len field is set to 16 as the size of the sockaddr_in structure. 
  2436.  
  2437.  The sin_family field is set to AF_INET. 
  2438.  
  2439.  The sin_port field is set to the port number in network-byte order. If you are 
  2440.  specifying your workstation address in sin_addr and you set sin_port to 0 
  2441.  using the bind() call, the system assigns an available port. If you specify a 
  2442.  different workstation address in sin_addr, you must specify the port. For more 
  2443.  information on ports, see Ports. 
  2444.  
  2445.  The sin_addr field is set to the internet address represented in network-byte 
  2446.  order. When specified as a parameter to bind(), sin_addr is usually set to the 
  2447.  constant INADDR_ANY, as defined in <NETINET\IN.H>. This binds the socket to 
  2448.  any and all local internet addresses. By using INADDR_ANY, an application can 
  2449.  bind a socket without specifying the local internet address. The constant 
  2450.  INADDR_ANY also allows an application running on a host with multiple 
  2451.  interfaces (called a multihomed host) to receive UDP datagrams and TCP 
  2452.  connection requests arriving at any interface on a single socket. (The 
  2453.  application is not required to have one socket per interface, with each 
  2454.  interface bound to a specific internet address). 
  2455.  
  2456.  To specify your workstation address, you can leave sin_addr unspecified.  If 
  2457.  you are specifying a different workstation address, you must specify a valid 
  2458.  internet address for that workstation. 
  2459.  
  2460.  The sin_zero field is not used, and it should be set to 0 by the application 
  2461.  before passing the address structure to any sockets call. 
  2462.  
  2463.  
  2464. ΓòÉΓòÉΓòÉ 4.5. TCP/IP-Specific Network Utility Routines ΓòÉΓòÉΓòÉ
  2465.  
  2466. This section describes the library of network utility routines. 
  2467.  
  2468. Network utility routines are described in the following sections. 
  2469.  
  2470. Topics 
  2471.  
  2472.       Host Names Information 
  2473.       Network Names Information 
  2474.       Protocol Names Information 
  2475.       Service Names Information 
  2476.       Network Address Translation 
  2477.       Network-Byte Order Translation 
  2478.       Internet Address Manipulation 
  2479.       Domain Name Resolution 
  2480.  
  2481.  
  2482. ΓòÉΓòÉΓòÉ 4.5.1. Host Names Information ΓòÉΓòÉΓòÉ
  2483.  
  2484. The following is a list of host-related calls: 
  2485.  
  2486.      gethostbyname() 
  2487.      gethostbyaddr() 
  2488.      sethostent() 
  2489.      gethostent() 
  2490.      endhostent() 
  2491.      gethostname() 
  2492.      gethostid() 
  2493.  
  2494.  The gethostbyname() call takes an internet host name and returns a hostent 
  2495.  structure, which contains the name of the host, aliases, host address family 
  2496.  and host address. The hostent structure is defined in the <NETDB.H> header 
  2497.  file. The gethostbyaddr() call maps the internet host address into a hostent 
  2498.  structure. 
  2499.  
  2500.  The database for these calls is provided by the name server or the ETC\HOSTS 
  2501.  file if a name server is not present or is unable to resolve the host name. 
  2502.  
  2503.  The sethostent(), gethostent(), and endhostent() calls open, provide 
  2504.  sequential access to, and close the ETC\HOSTS file. 
  2505.  
  2506.  The gethostname() call gets the name for the local host machine. 
  2507.  
  2508.  The gethostid() call returns an integer that identifies the host machine. Host 
  2509.  IDs fall under the category of internet network addressing because, by 
  2510.  convention, the 32-bit internet address is used. 
  2511.  
  2512.  
  2513. ΓòÉΓòÉΓòÉ 4.5.2. Network Names Information ΓòÉΓòÉΓòÉ
  2514.  
  2515. The following is a list of network-related calls: 
  2516.  
  2517.      getnetbyname() 
  2518.      getnetbyaddr() 
  2519.      setnetent() 
  2520.      getnetent() 
  2521.      endnetent() 
  2522.  
  2523.  The getnetbyname() call takes a network name and returns a netent structure, 
  2524.  which contains the name of the network, aliases, network address family, and 
  2525.  network number.  The netent structure is defined in the <NETDB.H> header file. 
  2526.  The getnetbyaddr() call maps the network number into a netent structure. 
  2527.  
  2528.  The database for these calls is provided by the ETC\NETWORKS file. 
  2529.  
  2530.  The setnetent(), getnetent(), and endnetent() calls open, provide sequential 
  2531.  access to, and close the ETC\NETWORKS file. 
  2532.  
  2533.  
  2534. ΓòÉΓòÉΓòÉ 4.5.3. Protocol Names Information ΓòÉΓòÉΓòÉ
  2535.  
  2536. The following is a list of protocol related calls: 
  2537.  
  2538.      getprotobyname() 
  2539.      getprotobynumber() 
  2540.      setprotoent() 
  2541.      getprotoent() 
  2542.      endprotoent() 
  2543.  
  2544.  The getprotobyname() call takes the protocol name and returns a protoent 
  2545.  structure, which contains the name of the protocol, aliases, and protocol 
  2546.  number.  The protoent structure is defined in the <NETDB.H> header file.  The 
  2547.  getprotobynumber() call maps the protocol number into a protoent structure. 
  2548.  
  2549.  The database for these calls is provided by the ETC\PROTOCOL file. 
  2550.  
  2551.  The setprotoent(), getprotoent(), and endprotoent() calls open, provide 
  2552.  sequential access to, and close the ETC\PROTOCOL file. 
  2553.  
  2554.  
  2555. ΓòÉΓòÉΓòÉ 4.5.4. Service Names Information ΓòÉΓòÉΓòÉ
  2556.  
  2557. The following is a list of service related calls: 
  2558.  
  2559.      getservbyname() 
  2560.      getservbyport() 
  2561.      setservent() 
  2562.      getservent() 
  2563.      endservent() 
  2564.  
  2565.  The getservbyname() call takes the service name and protocol, and returns a 
  2566.  servent structure that contains the name of the service, aliases, port number, 
  2567.  and protocol.  The servent structure is defined in the <NETDB.H> header file. 
  2568.  The getservbyport() call maps the port number and protocol into a servent 
  2569.  structure. 
  2570.  
  2571.  The database for these calls is provided by the ETC\SERVICES file. 
  2572.  
  2573.  The setservent(), getservent(), and endservent() calls open, provide 
  2574.  sequential access to, and close the ETC\SERVICES file. 
  2575.  
  2576.  
  2577. ΓòÉΓòÉΓòÉ 4.5.5. Network Address Translation ΓòÉΓòÉΓòÉ
  2578.  
  2579. Network library calls enable an application program to locate and construct 
  2580. network addresses while using interprocess communication facilities in a 
  2581. distributed environment. 
  2582.  
  2583. Locating a service on a remote host requires many levels of mapping before 
  2584. client and server can communicate. A network service is assigned a name that is 
  2585. intended to be understandable for a user. This name and the name of the peer 
  2586. host must then be translated into network addresses. Finally, the address must 
  2587. then be used to determine a physical location and route to the service. 
  2588.  
  2589. Network library calls map: 
  2590.  
  2591.      Host names to network addresses 
  2592.      Network names to network numbers 
  2593.      Protocol names to protocol numbers 
  2594.      Service names to port numbers 
  2595.  
  2596.  Additional network library calls exist to simplify the manipulation of names 
  2597.  and addresses. 
  2598.  
  2599.  An application program must include the <NETDB.H> file when using any of the 
  2600.  network library calls. 
  2601.  
  2602.  Note:  All networking services return values in standard network byte order. 
  2603.  
  2604.  
  2605. ΓòÉΓòÉΓòÉ 4.5.6. Network-Byte Order Translation ΓòÉΓòÉΓòÉ
  2606.  
  2607. Internet domain ports and addresses are usually specified to calls using the 
  2608. network-byte ordering convention.  The following calls translate integers from 
  2609. host- to network-byte order and from network- to host-byte order. 
  2610.  
  2611.  htonl()     Translates host to network, long integer (32-bit) 
  2612.  htons()     Translates host to network, short integer (16-bit) 
  2613.  ntohl()     Translates network to host, long integer (32-bit) 
  2614.  ntohs()     Translates network to host, short integer (16-bit) 
  2615.  
  2616.  
  2617. ΓòÉΓòÉΓòÉ 4.5.7. Internet Address Manipulation ΓòÉΓòÉΓòÉ
  2618.  
  2619. The following calls convert internet addresses and decimal notation, and 
  2620. manipulate the network number and local network address portions of an internet 
  2621. address: 
  2622.  
  2623.  inet_addr()         Translates dotted-decimal notation to a 32-bit internet 
  2624.                      address (network-byte order). 
  2625.  
  2626.  inet_network()      Translates dotted-decimal notation to a network number 
  2627.                      (host-byte order), and zeros in the host part. 
  2628.  
  2629.  inet_ntoa()         Translates 32-bit internet address (network-byte order) to 
  2630.                      dotted-decimal notation. 
  2631.  
  2632.  inet_netof()        Extracts network number (host-byte order) from 32-bit 
  2633.                      internet address (network-byte order). 
  2634.  
  2635.  inet_lnaof()        Extracts local network address (host-byte order) from 
  2636.                      32-bit internet address (network-byte order). 
  2637.  
  2638.  inet_makeaddr()     Constructs internet address (network-byte order) from 
  2639.                      network number and local network address. 
  2640.  
  2641.  
  2642. ΓòÉΓòÉΓòÉ 4.5.8. Domain Name Resolution ΓòÉΓòÉΓòÉ
  2643.  
  2644. In TCP/IP, communication is based on internet addresses. When a TCP/IP 
  2645. application receives a symbolic host name, it calls a host name resolver 
  2646. routine to resolve the symbolic name into an internet address. The host name 
  2647. resolver routine queries a domain name server or a local HOSTS file, or both, 
  2648. to perform the name resolution. 
  2649.  
  2650. If a RESOLV2 file or RESOLV file exists in the ETC subdirectory, the host name 
  2651. resolver routine first tries to resolve the name by querying the name servers 
  2652. specified in that file. 
  2653.  
  2654. If resolution through a name server fails or if a RESOLV2 or RESOLV file does 
  2655. not exist, the host name resolver routine tries to resolve the name locally by 
  2656. searching the HOSTS file in the ETC subdirectory for a match of the symbolic 
  2657. host name. 
  2658.  
  2659. The above search order can be reversed by setting the OS/2 environment variable 
  2660. USE_HOST_FIRST to any nonzero value. If this variable is set, the host name 
  2661. resolver routine searches the local HOSTS file first before querying a domain 
  2662. name server. 
  2663.  
  2664. If a match is found, the routine returns the corresponding internet address. If 
  2665. a match is not found, the routine displays a message stating that the host is 
  2666. unknown. 
  2667.  
  2668. RESOLV and RESOLV2 files 
  2669.  
  2670. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2671. ΓöéNETWORK       RESOLV FILE                RESOLV2 FILE              Γöé
  2672. ΓöéCONNECTION                                                         Γöé
  2673. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2674. ΓöéLAN only                                 X                         Γöé
  2675. Γöéconnection                                                         Γöé
  2676. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2677. ΓöéSLIP only     X                                                    Γöé
  2678. Γöéconnection                                                         Γöé
  2679. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2680. ΓöéLAN and SLIP  X                          X (used for domain name   Γöé
  2681. Γöéconnections                              resolution)               Γöé
  2682. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2683.  
  2684. The following resolver calls are used to make, send, and interpret packets for 
  2685. name servers in the internet domain: 
  2686.  
  2687.      res_query() 
  2688.      res_querydomain() 
  2689.      res_mkquery() 
  2690.      res_send() 
  2691.      res_search() 
  2692.      res_init() 
  2693.      dn_comp() 
  2694.      dn_expand() 
  2695.      dn_find() 
  2696.      dn_skipname() 
  2697.      _getshort() 
  2698.      _getlong() 
  2699.      putlong() 
  2700.      putshort() 
  2701.  
  2702.  
  2703. ΓòÉΓòÉΓòÉ 4.6. The _res Data Structure ΓòÉΓòÉΓòÉ
  2704.  
  2705. Global information used by these resolver calls is kept in the _res data 
  2706. structure. This structure is defined in the <RESOLV.H> file and contains the 
  2707. following members: 
  2708.  
  2709. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2710. ΓöéType                  Member                Contents             Γöé
  2711. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2712. Γöéint                   retrans               Retransmission time  Γöé
  2713. Γöé                                            interval             Γöé
  2714. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2715. Γöéint                   retry                 Number of times to   Γöé
  2716. Γöé                                            retransmit           Γöé
  2717. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2718. Γöélong                  options               Option flags         Γöé
  2719. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2720. Γöéint                   nscount               Number of name       Γöé
  2721. Γöé                                            servers              Γöé
  2722. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2723. Γöéstruct                nsaddr_list           Address of name      Γöé
  2724. Γöésockaddr_in[MAXNS]                          server               Γöé
  2725. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2726. Γöéunsigned short        id                    Current packet id    Γöé
  2727. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2728. Γöéchar[MAXDNAME]        defdname              Default domain       Γöé
  2729. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2730. Γöéchar*[MAXDNSRCH+1]    dnsrch                Components of domain Γöé
  2731. Γöé                                            to search            Γöé
  2732. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2733.  
  2734. The options field of the _res data structure is constructed by logically ORing 
  2735. the following values: 
  2736.  
  2737.  RES_INIT 
  2738.    Indicates whether the initial name server and default domain name have been 
  2739.    initialized (that is, whether the res_init() call has been called). 
  2740.  
  2741.  RES_DEBUG 
  2742.    Prints debugging messages. 
  2743.  
  2744.  RES_USEVC 
  2745.    Uses Transmission Control Protocol/Internet Protocol (TCP/IP) connections 
  2746.    for queries instead of User Datagram Protocol/Internet Protocol (UDP/IP). 
  2747.  
  2748.  RES_STAYOPEN 
  2749.    Used with the RES_USEVC value, keeps the TCP/IP connection open between 
  2750.    queries. While UDP/IP is the mode normally used, TCP/IP mode and this option 
  2751.    are useful for programs that regularly perform many queries. 
  2752.  
  2753.  RES_RECURSE 
  2754.    Sets the Recursion Desired bit for queries. This is the default. 
  2755.  
  2756.  RES_DEFNAMES 
  2757.    Appends the default domain name to single-label queries. This is the 
  2758.    default. 
  2759.  
  2760.  These environment variables affect values related to the _res data structure: 
  2761.  
  2762.  LOCALDOMAIN 
  2763.    Overrides the default local domain, which is read from the ETC\RESOLV.conf 
  2764.    file and stored in the defdname field of the _res data structure. 
  2765.  
  2766.  RES_TIMEOUT 
  2767.    Overrides the default value of the retrans field of the _res data structure, 
  2768.    which is the value of the RES_TIMEOUT constant defined in the <RESOLV.H> 
  2769.    file. This value is the base timeout period in seconds between queries to 
  2770.    the name servers. After each failed attempt, the timeout period is doubled. 
  2771.    The timeout period is divided by the number of name servers defined. The 
  2772.    minimum timeout period is 1 second. 
  2773.  
  2774.  RES_RETRY 
  2775.    Overrides the default value for the retry field of the _res data structure, 
  2776.    which is 4. This value is the number of times the resolver tries to query 
  2777.    the name servers before giving up. Setting RES_RETRY to 0 prevents the 
  2778.    resolver from querying the name servers. 
  2779.  
  2780.  The res_send() call does not perform interactive queries and expects the name 
  2781.  server to handle recursion. 
  2782.  
  2783.  
  2784. ΓòÉΓòÉΓòÉ 4.7. Ports ΓòÉΓòÉΓòÉ
  2785.  
  2786. A port is used to differentiate between multiple applications on a host using 
  2787. the same protocol (TCP or UDP).  It is an additional qualifier used by the 
  2788. system software to get data to the correct application. Physically, a port is a 
  2789. 16-bit integer.  Some ports are reserved for particular applications and are 
  2790. called well-known ports. Well-Known Port Assignments contains the well-known 
  2791. port assignments list. 
  2792.  
  2793.  
  2794. ΓòÉΓòÉΓòÉ 4.8. IP Multicasting ΓòÉΓòÉΓòÉ
  2795.  
  2796. This section presents general concepts as well as technical implementation 
  2797. details about IP multicasting. 
  2798.  
  2799. Multicasting enables a message to be transmitted to a group of hosts, instead 
  2800. of having to address and send the message to each group member individually. 
  2801. This reduces the traffic impact on networks with, for example, audio/video 
  2802. applications involving more than two participants. internet addressing provides 
  2803. for Class D addressing that is used for multicasting. 
  2804.  
  2805. Topics 
  2806.  
  2807.       Multicasting and the setsockopt() Call 
  2808.       A Socket Program Example 
  2809.  
  2810.  
  2811. ΓòÉΓòÉΓòÉ 4.8.1. Multicasting and the setsockopt() Call ΓòÉΓòÉΓòÉ
  2812.  
  2813. When a datagram socket is defined, the setsockopt() call can be used to modify 
  2814. it. In order to join or leave a multicast group, use the setsockopt() call with 
  2815. the IP_ADD_MEMBERSHIP or IP_DROP_MEMBERSHIP flags. The interface that is used 
  2816. and the group used are specified in an ip_mreq structure that contains the 
  2817. following fields: 
  2818.  
  2819. struct ip_mreq{
  2820.    struct in_addr imr_multiaddr;
  2821.    struct in_addr imr_interface;
  2822. }
  2823.  
  2824. The in_addr structure is defined as: 
  2825.  
  2826. struct in_addr{
  2827.    ulong s_addr;
  2828. }
  2829.  
  2830. A host group consists of zero or more IP hosts.  An IP datagram designated to a 
  2831. host group address will be delivered to all the current members of that group. 
  2832. A host group does not have a fixed membership.  Any IP multicast-capable hosts 
  2833. can join or leave a host group dynamically. 
  2834.  
  2835. To join or leave a host group, an application needs to specify a host group 
  2836. address, ranging from 224.0.0.2 to 239.255.255.255, and a network interface 
  2837. address.  (Note that 224.0.0.0 is reserved and 224.0.0.1 is permanently 
  2838. assigned to the all hosts group, which includes all hosts and routers 
  2839. participating in IP multicast.) It is possible to join the same host group on 
  2840. more than one network interface.  It is also possible for more than one 
  2841. application to join the same host group.  A host's IP module discards an 
  2842. incoming multicast datagram designated for a host group not joined on that 
  2843. incoming network interface, even though the same host group is joined on 
  2844. another network interface. 
  2845.  
  2846. In order to send to a multicasting group it is not necessary to join the 
  2847. groups. For receiving transmissions sent to a multicasting group membership is 
  2848. required. For multicast sending use an IP_MULTICAST_IF flag with the 
  2849. setsockopt() call. This specifies the interface to be used. 
  2850.  
  2851. An application can specify the time-to-live value of outgoing multicast 
  2852. datagrams.  The default value is one for all IP multicast datagrams.  An 
  2853. application can also specify whether a copy of the multicast datagram is looped 
  2854. back in the case where the host itself is a member of the destination host 
  2855. group.  By default, a copy of the multicast datagram is looped back. 
  2856.  
  2857. It may be necessary to call the setsockopt() call with the IP_MULTICAST_LOOP 
  2858. flag in order to control the loopback of multicast packets. By default, packets 
  2859. are delivered to all members of the multicast group including the sender, if it 
  2860. is a member. However, this can be disabled with the setsockopt() call using the 
  2861. IP_MULTICAST_LOOP flag. 
  2862.  
  2863. For hosts that attach to more than one network, an application can choose which 
  2864. interface is used for the initial transmission. Only one interface can be used 
  2865. for the initial transmission.  Further transmission to other networks is the 
  2866. responsibility of multicast routers.  Do not be confused by the interface where 
  2867. a host group joins the outgoing interface for multicast transmission.  The 
  2868. interface specified when joining or leaving a host group is mainly for 
  2869. receiving incoming multicast datagrams. An application can join one host group 
  2870. on one network interface but transmit data to the same host group by way of 
  2871. another interface. 
  2872.  
  2873. Currently multicast is supported only on UDP, so datagram sockets should be 
  2874. used to do multicast operations. One thing to consider is that using aliasing 
  2875. and multicasting together (with multiple processes) may give unexpected 
  2876. results, and the following limitations apply. 
  2877.  
  2878.      More than one socket can bind on Class D IP address (or mcast address) 
  2879.       and a common port; for example, two clients that want to receive the same 
  2880.       mcast packet. 
  2881.  
  2882.      These sockets must also set a socket option, SO_REUSEADDR. 
  2883.  
  2884.  The setsockopt() call flags that are required for multicast communication and 
  2885.  used with the IPPROTO_IP protocol level follow: 
  2886.  
  2887.  IP_ADD_MEMBERSHIP 
  2888.    Joins a multicast group as specified in the optval parameter of type struct 
  2889.    ip_mreq. A maximum of 20 groups may be joined per socket. 
  2890.  
  2891.  IP_DROP_MEMBERSHIP 
  2892.    Leaves a multicast group as specified in the optval parameter of type struct 
  2893.    ip_mreq. Only allowable for processes with UID=0. 
  2894.  
  2895.  IP_MULTICAST_IF 
  2896.    Permits sending of multicast messages on an interface as specified in the 
  2897.    optval parameter of type struct in_addr. An address of INADDR_ANY 
  2898.    (0x000000000) removes the previous selection of an interface in the 
  2899.    multicast options. If no interface is specified then the interface leading 
  2900.    to the default route is used. 
  2901.  
  2902.  IP_MULTICAST_LOOP 
  2903.    Sets multicast loopback, determining whether or not transmitted messages are 
  2904.    delivered to the sending host. An optval parameter of type uchar is used to 
  2905.    control loopback being on or off. 
  2906.  
  2907.  IP_MULTICAST_TTL 
  2908.    Sets the time-to-live for multicast packets. An optval parameter of type 
  2909.    uchar is used to set this value between 0 and 255. 
  2910.  
  2911.  The getsockopt() function can also be used with the multicast flags to obtain 
  2912.  information about a particular socket: 
  2913.  
  2914.  IP_MULTICAST_IF 
  2915.    Retrieves the interface's IP address. 
  2916.  
  2917.  IP_MULTICAST_LOOP 
  2918.    Retrieves the specified looping mode from the multicast options. 
  2919.  
  2920.  IP_MULTICAST_TTL 
  2921.    Retrieves the time-to-live in the multicast options. 
  2922.  
  2923.  The following examples demonstrate the use of the setsockopt() call with the 
  2924.  protocol level set to the Internet Protocol (IPPROTO_IP). 
  2925.  
  2926.  To mark a socket for sending to a multicast group on a particular interface: 
  2927.  
  2928.   struct ip_mreq imr;
  2929.   setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &imr.imr_interface,
  2930.   sizeof(struct
  2931.   in_addr));
  2932.  
  2933.  To disable the loopback on a socket: 
  2934.  
  2935.   char loop = 0;
  2936.   setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(uchar));
  2937.  
  2938.  To allow address reuse for binding multiple multicast applications to the same 
  2939.  IP group address: 
  2940.  
  2941.   int on = 1;
  2942.   setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int));
  2943.  
  2944.  To join a multicast group for receiving: 
  2945.  
  2946.   struct ip_mreq imr;
  2947.   setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(struct
  2948.   ip_mreq));
  2949.  
  2950.  To leave a multicast group: 
  2951.  
  2952.   struct ip_mreq imr;
  2953.   setsockopt(s, IPPROTO_IP, IP_DROP_MEMBERSHIP, &imr, sizeof(struct
  2954.   ip_mreq));
  2955.  
  2956.  
  2957. ΓòÉΓòÉΓòÉ 4.8.2. A Socket Program Example ΓòÉΓòÉΓòÉ
  2958.  
  2959. Following is an example of a socket application using IP multicasting. 
  2960.  
  2961. struct sockaddr_in *to = (struct sockaddr_in *)&group;  /* group address     */
  2962. struct sockaddr_in listen_addr;
  2963. struct ip_mreq imr;                          /* multicast request structure  */
  2964. struct in_addr ifaddr;                       /* multicast outgoing interface */
  2965. short  loop = 0;                             /* don't loop back              */
  2966. short  ttl = 16;                             /* multicast time-to-live       */
  2967.  
  2968.        sock_init();
  2969.  
  2970.        /* init */
  2971.        imr.imr_multiaddr.s_addr = 0xe0010101;     /* 224.1.1.1 */
  2972.        imr.imr_multiaddr.s_addr = htonl(imr.imr_multiaddr.s_addr);
  2973.        imr.imr_interface.s_addr = INADDR_ANY;
  2974.        imr.imr_interface.s_addr = htonl(imr.imr_interface.s_addr);
  2975.        ifaddr.s_addr = INADDR_ANY;
  2976.        ifaddr.s_addr = htonl(ifaddr.s_addr);
  2977.  
  2978.        bzero( (char *)&group, sizeof(struct sockaddr_in) );
  2979.        to->sin_len = sizeof(to);
  2980.        to->sin_family = AF_INET;
  2981.        to->sin_port = 1201;                     /* some port number */
  2982.        to->sin_port = htons(to->sin_port);
  2983.        to->sin_addr.s_addr = imr.imr_multiaddr.s_addr;
  2984.        listen_addr = (*to);
  2985.  
  2986.        sock = socket(AF_INET, SOCK_DGRAM, 0);
  2987.  
  2988.        if (sock <= 0)  {
  2989.        psock_errno("Bad socket");
  2990.        exit(1);
  2991.        }
  2992.  
  2993.        /* join group */
  2994.        if( setsockopt( sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
  2995.        &imr, sizeof(struct ip_mreq) ) == -1 )  {
  2996.        psock_errno( "can't join group" );
  2997.        exit(1);
  2998.        }
  2999.  
  3000.        /* set multicast options */
  3001.        if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF,
  3002.        &ifaddr, sizeof(ifaddr)) == -1) {
  3003.        perror ("can't set multicast source interface");
  3004.        exit(1);
  3005.        }
  3006.        if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, 1) == -1)) {
  3007.        psock_errno ("can't disable multicast loopback");
  3008.        exit(1);
  3009.        }
  3010.        if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 1) == -1)) {
  3011.        psock_errno ("can't set multicast ttl");
  3012.        exit(1);
  3013.        }
  3014.  
  3015.        /* bind to a group address */
  3016.        if (bind(sock, &listen_addr, sizeof(struct sockaddr_in)) != 0) {
  3017.        psock_errno("Binding multicast socket");
  3018.        exit(1);
  3019.        }
  3020.  
  3021.        .
  3022.        .
  3023.        .
  3024.  
  3025.        /* leave group */
  3026.        if( setsockopt( sock, IPPROTO_IP, IP_DROP_MEMBERSHIP,
  3027.        &imr, sizeof(struct ip_mreq) ) == -1 )  {
  3028.        psock_errno( "can't leave group" );
  3029.        exit(1);
  3030.        }
  3031.        .
  3032.        .
  3033.        .
  3034.  
  3035.  
  3036. ΓòÉΓòÉΓòÉ 4.9. Socket Secure Support ΓòÉΓòÉΓòÉ
  3037.  
  3038. OS/2 supports Socket Secure Support (SOCKS) Version 4. This section presents 
  3039. information about OS/2 SOCKSification. 
  3040.  
  3041. Topics 
  3042.  
  3043.       The SOCKS Server 
  3044.       The SOCKS Library 
  3045.  
  3046.  
  3047. ΓòÉΓòÉΓòÉ 4.9.1. The SOCKS Server ΓòÉΓòÉΓòÉ
  3048.  
  3049. A SOCKS server is a type of firewall that protects computers in a network from 
  3050. access by users outside that network. A SOCKS server is similar to a proxy 
  3051. gateway in that they both work as proxy agents but their approaches are 
  3052. different. 
  3053.  
  3054. OS/2 SOCKS support for TCP/IP applications allows client applications to 
  3055. interact with a SOCKS server. OS/2 SOCKSified DLLs get the necessary 
  3056. information from socks.cfg. The DLL checks to determine if the connection 
  3057. should go through SOCKS. If socks_flag is on in socks.env and socks.cfg 
  3058. indicates that the connection should go through socks, then the connection goes 
  3059. through SOCKS.  Otherwise, the connection does not go through SOCKS.  The 
  3060. following figure illustrates how a typical write() to a socket would appear. 
  3061.  
  3062.  
  3063. A Typical Write() to a SOCKS Server
  3064.  
  3065. With SOCKS support, client applications connect to the SOCKS server and then 
  3066. the SOCKS server connects to an external network. The SOCKS server verifies 
  3067. that a host name and user ID are allowed to access an internet. 
  3068.  
  3069. If you are using a SOCKS server, connect() will call Rconnect(). See connect() 
  3070. for information about the connect() call.  The following figure illustrates 
  3071. connect(). 
  3072.  
  3073.  
  3074. connect() Request
  3075.  
  3076. From the user's point of view (behind the firewall host within the local area 
  3077. network), there is no difference between running SOCKS and the regular client 
  3078. software on a host.  All connections at the application level appear to work 
  3079. the same, with the hidden difference that all traffic is passing through sockd 
  3080. on the firewall host.  This transparency is achieved through the Socks library 
  3081. routines. 
  3082.  
  3083. Connect requests are originated by a call to Rconnect() on the internal host. 
  3084. This causes sockd to establish a connection to the remote host and return a 
  3085. success or fail response.  At this point, the application can read and write to 
  3086. the socket connection to the firewall and sockd acts as a bridge between the 
  3087. local and external socket connections. 
  3088.  
  3089.  
  3090. ΓòÉΓòÉΓòÉ 4.9.2. The SOCKS Library ΓòÉΓòÉΓòÉ
  3091.  
  3092. The SOCKS library calls establish connections to sockd on the firewall and 
  3093. transmit information.  The sockd daemon performs the operation as if it were 
  3094. originating the request. Any data sockd receives from the external connection 
  3095. is then passed on to the original requestor.  To the internal host everything 
  3096. appears as usual, but to the external host sockd appears to be the originator 
  3097. of the communication. 
  3098.  
  3099. The SOCKS library routines pass all network connections to sockd, which is 
  3100. running on the firewall.  The functions that are provided are designated by the 
  3101. letter R preceding the name of the regular C library socket calls that they are 
  3102. replacing. The SOCKS routines take the same parameters as the original 
  3103. functions, with the exception of Rbind(). Rbind() has an additional parameter: 
  3104. the address of the remote host from which the connection is established. 
  3105.  
  3106. The following routines are supported: 
  3107.  
  3108.   Routine            Parameters
  3109.  
  3110.  Raccept            (int socket, struct sockaddr*addr, int addrlen) 
  3111.  
  3112.  Rbind              (int socket, struct sockaddr*name, int namelen, struct 
  3113.                     sockaddr*remote) 
  3114.  
  3115.  Rconnect           (int socket, struct sockaddr*name, int namelen) 
  3116.  
  3117.  Rgethostbyname     (char *host) 
  3118.  
  3119.  Rgetsockname       (int socket, struct sockaddr*name, int namelen) 
  3120.  
  3121.  Rlisten            (int socket, int backlog) 
  3122.  
  3123.  See the information for the regular calls in Protocol-Independent C Sockets 
  3124.  API. 
  3125.  
  3126.  The following figure shows how a gethostbyname() call works. 
  3127.  
  3128.  
  3129.   gethostbyname
  3130.  
  3131.  The following figure shows how an Rbind() request works. 
  3132.  
  3133.  
  3134.   Rbind() Request
  3135.  
  3136.  
  3137. ΓòÉΓòÉΓòÉ 5. Sockets over Local IPC ΓòÉΓòÉΓòÉ
  3138.  
  3139. This section describes how sockets over Local Inter-Processor Communication 
  3140. (IPC) allow the programmer to communicate between applications on the same 
  3141. machine using the sockets API. Local IPC sockets are not bound to a network 
  3142. protocol but rather use the underlying host facilities to provide 
  3143. high-performance IPC. 
  3144.  
  3145. Topics 
  3146.  
  3147.       Getting Started with Sockets Over Local IPC 
  3148.       Local IPC Address Format 
  3149.  
  3150.  
  3151. ΓòÉΓòÉΓòÉ 5.1. Getting Started with Sockets Over Local IPC ΓòÉΓòÉΓòÉ
  3152.  
  3153. This section provides some basic information for getting started with sockets 
  3154. over Local IPC: 
  3155.  
  3156.      Use PF_OS2, or PF_UNIX for the protocol family 
  3157.  
  3158.      Use AF_OS2, or AF_UNIX for the address family 
  3159.  
  3160.      The following socket types are supported for the Local IPC domain: 
  3161.  
  3162.         -  Datagram (SOCK_DGRAM) 
  3163.         -  Stream (SOCK_STREAM) 
  3164.  
  3165.       The socket type is passed as a parameter to the socket() call. For 
  3166.       additional information, see Socket Types. 
  3167.  
  3168.      A unique text string is used as a name.  See Local IPC Address Format for 
  3169.       details. 
  3170.  
  3171.      If a connect() socket call is received without an explicit bind() call, 
  3172.       an implicit bind is automatically performed.  The application can use any 
  3173.       name, and a unique Local IPC name is generated by networking services. 
  3174.       You can retrieve the Local IPC name by using the getsockname() call. 
  3175.  
  3176.  
  3177. ΓòÉΓòÉΓòÉ 5.2. Local IPC Address Format ΓòÉΓòÉΓòÉ
  3178.  
  3179. A socket address in a local system is composed of three fields in the following 
  3180. sockaddr_un structure: length, address family, and path name. The structure is 
  3181. located in the <SYS\UN.H> header file: 
  3182.  
  3183. struct sockaddr_un {
  3184.     u_char  sun_len;             /* sockaddr len including null */
  3185.     u_char  sun_family;          /* AF_OS2 or AF_UNIX */
  3186.     char    sun_path[108];       /* path name */
  3187. };
  3188. struct sockaddr_un un;
  3189.  
  3190. The sun_family field is set to AF_OS2 or AF_UNIX. 
  3191.  
  3192. The sun_path field is the OS/2 Warp file and path name to be used as the 
  3193. address of the Local IPC socket. If the address is NULL, the bind call binds a 
  3194. unique local address to the socket descriptor s. Each address is a combination 
  3195. of address family (sun_family) and a character string (sun_path) no longer than 
  3196. 108 characters. 
  3197.  
  3198. Each socket must use a unique character string as its local name to bind a name 
  3199. to a socket. The name in sun_path should begin with "\socket\". 
  3200.  
  3201. For example, 
  3202.  
  3203. struct sockaddr_un un;
  3204. int sd;
  3205. sd = socket(PF_OS2, SOCK_STREAM, 0);
  3206. memset(&un, 0, sizeof(un);
  3207.  
  3208. un.sun_len = sizeof(un);
  3209. un.sun_family = AF_OS2;
  3210. strcpy(un.sun_path, "\socket\XYZ", 12);
  3211. bind(sd, (struct sockaddr *)&un, sizeof(un));
  3212.  
  3213.  
  3214. ΓòÉΓòÉΓòÉ 6. Sockets over NetBIOS ΓòÉΓòÉΓòÉ
  3215.  
  3216. This section describes the use of sockets with NetBIOS. Each application 
  3217. assigns itself one or more NetBIOS names for each adapter.  The NetBIOS 
  3218. protocol maintains a table of the names that a node is known by on the network. 
  3219. NetBIOS supports two types of names: unique and group. When the name is unique, 
  3220. the application binds the name and NetBIOS checks the network to ensure that 
  3221. the name is not already being used as a unique name. NetBIOS supports multicast 
  3222. by allowing applications to bind to a group name and communicate. 
  3223.  
  3224. Topics 
  3225.  
  3226.       Getting Started with Sockets Over NetBIOS 
  3227.       NetBIOS Address Format 
  3228.  
  3229.  
  3230. ΓòÉΓòÉΓòÉ 6.1. Getting Started with Sockets Over NetBIOS ΓòÉΓòÉΓòÉ
  3231.  
  3232. This section provides some basic information for getting started with sockets 
  3233. over NetBIOS: 
  3234.  
  3235.      Use PF_NETBIOS or PF_NB for the protocol family. 
  3236.  
  3237.      Use AF_NETBIOS or AF_NB for the address family. 
  3238.  
  3239.      The following socket types are supported for the NetBIOS domain: 
  3240.  
  3241.         -  Datagram (SOCK_DGRAM) 
  3242.         -  Sequenced packet (SOCK_SEQPACKET) 
  3243.  
  3244.        The socket type is passed as a parameter to the socket() call. For 
  3245.       additional information see Socket Types. 
  3246.  
  3247.      If a connect() socket call is received without an explicit bind() call, 
  3248.       an implicit bind is automatically performed.  In this case, the 
  3249.       application does not care about its own name, and a unique NetBIOS name 
  3250.       is generated by networking services. You can retrieve the NetBIOS name by 
  3251.       using the getsockname() call. 
  3252.  
  3253.      Applications using the NetBIOS communication domain can use sockets in 
  3254.       both a connection-oriented (sequenced packet) and connectionless 
  3255.       (datagram) mode. 
  3256.  
  3257.      A NetBIOS application on one workstation can use sockets to communicate 
  3258.       with an NCB NetBIOS application on a different workstation. 
  3259.  
  3260.  
  3261. ΓòÉΓòÉΓòÉ 6.2. NetBIOS Address Format ΓòÉΓòÉΓòÉ
  3262.  
  3263. A socket address in a NetBIOS address family is composed of the six fields in 
  3264. the following sockaddr_nb structure: length, address family, address type, a 
  3265. reserved field, adapter number, and NetBIOS name. This structure is located in 
  3266. the <NETNB\NB.H> header file: 
  3267.  
  3268. struct       sockaddr_nb {
  3269.     u_char   snb_len;                  /* sizeof(struct sockaddr_nb) */
  3270.     u_char   snb_family;               /* AF_NETBIOS */
  3271.     short    snb_type;                 /* 0:unique or 1:group */
  3272.     char     snb_nbnetid[NB_NETIDLEN]; /* NetBIOS netid */
  3273.     char     snb_name[NAMELEN];        /* NetBIOS name */
  3274. }
  3275.  
  3276. The length field (snb_len) is set to sizeof(struct sockaddr_nb). 
  3277.  
  3278. The family field (snb_family) is set to AF_NETBIOS or AF_NB. 
  3279.  
  3280. The address type field (snb_type) is used to specify the name as either a 
  3281. unique (NB_UNIQUE) or a group (NB_GROUP) name. 
  3282.  
  3283. The network identifier field (sub_netid) is used by the protocol stack to 
  3284. contain the NetBIOS netid, which is the logical adapter number that the name is 
  3285. associated with. 
  3286.  
  3287. The name field (snb_name) contains the 16-byte NetBIOS name, and is used as is. 
  3288.  
  3289. If a connect() socket call is received without an explicit bind() call, an 
  3290. implicit bind is automatically performed.  The application can use any name, 
  3291. and a unique NetBIOS name is generated by the system. A NetBIOS name is 
  3292. generated for this socket by converting the 6-byte MAC address to an ASCII hex 
  3293. string, and postpended with a 2-byte number that increments after each use. You 
  3294. can retrieve the NetBIOS name by using the getsockname() call. 
  3295.  
  3296. Note that for the NetBIOS domain, more than one socket can be bound to the same 
  3297. local address to establish multiple connections to one or more remote 
  3298. destinations. To enable this feature, the socket option SO_REUSEADDR must be 
  3299. set (see setsockopt()). In addition, you can bind more than one address to the 
  3300. same adapter. 
  3301.  
  3302.  
  3303. ΓòÉΓòÉΓòÉ 7. Windows Sockets Version 1.1 for OS/2 ΓòÉΓòÉΓòÉ
  3304.  
  3305. This section presents information for implementing OS/2 applications that use 
  3306. the Windows Sockets, or Winsock, API.  OS/2 supports two varieties of the 
  3307. Winsock API: one for use by 32-bit Developer API Extensions (Open32) 
  3308. applications, and another for use by 32-bit PM applications and 32-bit Command 
  3309. Line (VIO) applications. Except for the specific differences listed in this 
  3310. section, these implementations comply with the Windows Sockets Version 1.1 
  3311. specification, and corrections or amplifications as described in the draft 
  3312. Windows Sockets Version 2.0 specification. 
  3313.  
  3314. Topics 
  3315.  
  3316.       Overview 
  3317.       Blocking Hook Support 
  3318.       Asynchronous Functions 
  3319.       Differences between OS/2 WInsock and the Winsock 1.1 Specification 
  3320.       Using the Winsock 1.1 for OS/2 Trace Command and Trace Formatter 
  3321.       Where to Find Winsock Reference Information 
  3322.  
  3323.  
  3324. ΓòÉΓòÉΓòÉ 7.1. Overview ΓòÉΓòÉΓòÉ
  3325.  
  3326. Winsock for OS/2 consists of two DLLs: 
  3327.  
  3328.  PMWSOCK.DLL for the 32-bit PM and 32-bit VIO environments 
  3329.  DAPWSOCK.DLL for the Open32 environment 
  3330.  
  3331.  Two header files, <PMWSOCK.H> and <WINSOCK.H>, which are tailored to the PM 
  3332.  and Open32 environments respectively, are included. <PMWSOCK.H> is similar to 
  3333.  <WINSOCK.H> but has changes to data types and function prototypes to 
  3334.  accommodate PM.  <PMWSOCK.H> is also used by VIO applications. 
  3335.  
  3336.  
  3337. ΓòÉΓòÉΓòÉ 7.2. Blocking Hook Support ΓòÉΓòÉΓòÉ
  3338.  
  3339. Blocking hooks were introduced in Winsock to support Windows 3.x's 
  3340. non-preemptive multitasking.  When an application issues a blocking sockets 
  3341. call, Winsock starts processing the call and then enters a loop where it 
  3342. alternates between calling a blocking hook and checking to see if the socket 
  3343. call has completed or been cancelled. The blocking hook is responsible for 
  3344. dispatching messages to keep the system responsive while the socket call is 
  3345. processing. Blocking hooks are installed on a per-thread basis. 
  3346.  
  3347. In Win32 systems, blocking hooks aren't necessary because Win32 systems support 
  3348. preemptive multitasking.  Consequently, Win32 versions of Winsock do not 
  3349. provide a default blocking hook, and using blocking hooks is discouraged. 
  3350. Nonetheless, an application programmer can call WSASetBlockingHook to install 
  3351. one. 
  3352.  
  3353. In the OS/2 implementation of Winsock, when a call is made to a Winsock 
  3354. function that blocks and a blocking hook has been installed in that thread, a 
  3355. new thread is started to issue the socket call.  The original thread then 
  3356. starts spinning in a loop, alternating between calling the user's blocking-hook 
  3357. function and checking to see if the socket call has completed or has been 
  3358. cancelled.  A half-second sleep is inserted between each iteration of the loop 
  3359. to avoid consuming large amounts of CPU time.  When the socket call completes, 
  3360. or is cancelled, the new thread passes the results of the socket call to the 
  3361. original thread and then ends. 
  3362.  
  3363. When a call is made to a Winsock function that blocks and a blocking hook has 
  3364. not been installed for that thread, the socket call is issued directly and no 
  3365. threads are started. 
  3366.  
  3367.  
  3368. ΓòÉΓòÉΓòÉ 7.3. Asynchronous Functions ΓòÉΓòÉΓòÉ
  3369.  
  3370. Asynchronous functions were added to Winsock to make sockets friendlier to the 
  3371. GUI programmer. When an application issues an asynchronous Winsock call, 
  3372. Winsock starts processing the call and immediately returns to the caller. When 
  3373. the call completes, Winsock posts a message to the application's message queue 
  3374. to inform the application of the results of the function. 
  3375.  
  3376. For the OS/2 implementation of Winsock, asynchronous calls are handled 
  3377. similarly to the way blocking hooks are handled. Each call to an asynchronous 
  3378. Winsock function causes a secondary thread to issue the socket call.  The 
  3379. original thread then returns to the application. When the socket call returns, 
  3380. the secondary thread posts a message to the appropriate message queue. 
  3381.  
  3382. To avoid creating and terminating many threads, the asynchronous calls maintain 
  3383. a small pool of threads that are dedicated to servicing asynchronous calls. 
  3384. The threads are created as needed and are not terminated until the application 
  3385. ends.  When the application issues an asynchronous call, Winsock determines if 
  3386. there is a free thread in the pool.  If a free thread exists, Winsock uses it 
  3387. to service the call. If there is not a free thread in the pool, Winsock checks 
  3388. to see if the maximum number of threads that can fit in the pool has been 
  3389. started. If the maximum number of threads has not been started, Winsock starts 
  3390. a new thread, adds it to the pool, and has the new thread service the socket 
  3391. call. 
  3392.  
  3393. If no free threads are in the pool and the pool is filled to capacity, Winsock 
  3394. starts a new thread to service the call. After the call completes and the 
  3395. message has been posted, the new thread terminates. 
  3396.  
  3397.  
  3398. ΓòÉΓòÉΓòÉ 7.4. Differences between OS/2 WInsock and the Winsock 1.1 Specification ΓòÉΓòÉΓòÉ
  3399.  
  3400. This section describes the differences between the TCP/IP for OS/2 
  3401. implementation of Winsock and the Winsock 1.1 specification. 
  3402.  
  3403. WSASetLastError and WSAGetLastError APIs 
  3404.  
  3405. The Winsock specification states that on Win32 systems, WSAGetLastError and 
  3406. WSASetLastError will simply call the Win32 GetLastError and SetLastError 
  3407. functions.  For reasons of efficiency, the Open32 version of OS/2 Winsock 
  3408. implements these two calls internally and does not call GetLastError or 
  3409. SetLastError. Also because PM does not have a function that is equivalent to 
  3410. SetLastError, the PM version of Winsock also implements these calls internally. 
  3411.  
  3412. BSD Compatibility Files 
  3413.  
  3414. The Winsock 1.1 specification states that the standard <BSD NETDB.H>, 
  3415. <ARPA/INET.H>, <SYS/TIME.H>, <SYS/SOCKET.H>, and <NETINET/IN.H> header files 
  3416. should be supplied by Winsock implementations and should just include 
  3417. <WINSOCK.H>.  Because TCP/IP for OS/2 also supplies a BSD socket library, it 
  3418. does not comply with the specification in this regard.  If a developer includes 
  3419. any of those header files, the developer will get the BSD version of those 
  3420. header files, not the Winsock version. 
  3421.  
  3422. Calling Conventions 
  3423.  
  3424. In the Winsock 1.1 specification, Winsock calls are defined to use the PASCAL 
  3425. calling convention (the standard calling convention on Windows systems).  OS/2 
  3426. also has the PASCAL calling convention, but instead it uses APIENTRY as the 
  3427. standard calling convention. Because of this, OS/2 Winsock uses the APIENTRY 
  3428. convention for all of its Winsock calls. 
  3429.  
  3430. In the Open32 environment, PASCAL is defined (with #define) to be APIENTRY by 
  3431. <OS2WDEF.H>, which is part of Open32, so no changes are needed to <WINSOCK.H> 
  3432. to accommodate APIENTRY. 
  3433.  
  3434. In the PM and VIO environments, PASCAL and APIENTRY are two different calling 
  3435. conventions, so the Winsock function prototypes in <PMWSOCK.H> have been 
  3436. modified by replacing all occurrences of PASCAL with APIENTRY. 
  3437.  
  3438. Topics 
  3439.  
  3440.       Differences between <PMWSOCK.H> and Standard <WINSOCK.H> Header Files 
  3441.       Differences between IBM Open32 <WINSOCK.H> and Standard <WINSOCK.H> 
  3442.       Header Files 
  3443.  
  3444.  
  3445. ΓòÉΓòÉΓòÉ 7.4.1. Differences between <PMWSOCK.H> and Standard <WINSOCK.H> Header Files ΓòÉΓòÉΓòÉ
  3446.  
  3447. Following are the differences between <PMWSOCK.H> and standard <WINSOCK.H> 
  3448. header files: 
  3449.  
  3450.      <PMWSOCK.H> does not include (with #include) any header files. 
  3451.  
  3452.      The keyword FAR has been removed from all functions and pointers. 
  3453.  
  3454.      The keyword PASCAL has been removed from all of the prototypes and 
  3455.       replaced with APIENTRY. 
  3456.  
  3457.      The FARPROC type in the WSASetBlockingHook prototype has been replaced 
  3458.       with PFN. 
  3459.  
  3460.      The hostent, netent, servent, and protoent structures had several entries 
  3461.       that were defined as "short;" these have been widened to "int." The two 
  3462.       fields of the linger structure have been widened from "u_short" to "int." 
  3463.       These changes were made to comply with the definitions in the BSD header 
  3464.       files. 
  3465.  
  3466.      A bug in the IN_CLASSC macro has been corrected. 
  3467.  
  3468.      The CONST keyword for the buf parameter of the prototype for 
  3469.       WSAAsyncGetHostByAddr has been removed (it was an error). 
  3470.  
  3471.  
  3472. ΓòÉΓòÉΓòÉ 7.4.2. Differences between IBM Open32 <WINSOCK.H> and Standard <WINSOCK.H> Header Files ΓòÉΓòÉΓòÉ
  3473.  
  3474. Following are the differences between IBM Open32 and <WINSOCK.H>: 
  3475.  
  3476.      <WINSOCK.H> includes <OS2WIN.H> instead of <WINDOWS.H>. 
  3477.  
  3478.      The keyword FAR has been removed from all functions and pointers. 
  3479.  
  3480.      The hostent, netent, servent, and protoent structures had several entries 
  3481.       that were defined as "short."  These have been widened to "int." The two 
  3482.       fields of the linger structure have been widened from "u_short" to "int." 
  3483.       These changes were made to comply with the definitions in the BSD header 
  3484.       files. 
  3485.  
  3486.      A bug in the IN_CLASSC macro has been corrected. 
  3487.  
  3488.      The CONST keyword for the buf parameter of the prototype for 
  3489.       WSAAsyncGetHostByAddr has been removed (it was an error). 
  3490.  
  3491.  
  3492. ΓòÉΓòÉΓòÉ 7.5. Using the Winsock 1.1 for OS/2 Trace Command and Trace Formatter ΓòÉΓòÉΓòÉ
  3493.  
  3494. Winsock 1.1 for OS/2 includes tracing capability to aid Winsock developers in 
  3495. isolating problems related to one of the following: 
  3496.  
  3497.      The client application 
  3498.      The Winsock 1.1 DLL 
  3499.  
  3500.  Topics 
  3501.  
  3502.       Sample Winsock Trace Output 
  3503.       WSTRACE Command 
  3504.       WSFORMAT Command 
  3505.  
  3506.  
  3507. ΓòÉΓòÉΓòÉ 7.5.1. Sample Winsock Trace Output ΓòÉΓòÉΓòÉ
  3508.  
  3509. Using the trace capability, developers can trace Winsock procedure calls and 
  3510. exits, parameter values, and return values.  Following is a sample of formatted 
  3511. Winsock trace output: 
  3512.  
  3513. Winsock Trace - Version 1   Trace Date 05/07/1996   Trace Time 14:04:51.28
  3514. Thread  TimeStamp  Winsock Function  (Parameters)
  3515. -------------------------------------------------------------------------------
  3516.  
  3517. 00001 14:04:51.35 WSAISBLOCKING Entry  ()
  3518. 00001 14:04:51.35 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3519. 00001 14:04:51.35 WSASTARTUP Exit  (wVersionRequired=101, lpWSADATA=4B00C Return=0)
  3520. 00001 14:04:51.35 GETHOSTNAME Entry ()
  3521. 00001 14:04:51.35 WSAISBLOCKING Entry  ()
  3522. 00001 14:04:51.35 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3523. 00001 14:04:51.35 GETHOSTNAME Exit (Return=0, Hostname=screamin)
  3524. 00001 14:04:51.38 INET_NTOA Entry  (in_addr=4263781641)
  3525. 00001 14:04:51.38 INET_NTOA Exit  (in_addr=4263781641, Return=9.37.36.254)
  3526. 00001 14:04:57.25 SOCKET Entry  (address family=2[af_inet], type=1[sock_stream], protocol=0[ip])
  3527. 00001 14:04:57.25 WSAISBLOCKING Entry  ()
  3528. 00001 14:04:57.25 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3529. 00001 14:04:57.25 SOCKET Exit  (address family=2[af_inet], type=1[sock_stream], protocol=0[ip] Return=187)
  3530. 00001 14:05:05.88 GETHOSTNAME Entry ()
  3531. 00001 14:05:05.88 WSAISBLOCKING Entry  ()
  3532. 00001 14:05:05.88 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3533. 00001 14:05:05.88 GETHOSTNAME Exit (Return=0, Hostname=screamin)
  3534. 00001 14:05:11.03 HTONS Entry  (host=0)
  3535. 00001 14:05:11.03 HTONS Exit  (host=0, Return=0)
  3536. 00001 14:05:11.03 BIND Entry  (socket=187, sockaddr struct[family=2 (af_inet), port=0, s_addr=9.37.36.254])
  3537. 00001 14:05:11.03 WSAISBLOCKING Entry  ()
  3538. 00001 14:05:11.03 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3539. 00001 14:05:11.03 BIND Exit  (socket=187, sockaddr struct[family=2 (af_inet), port=0, s_addr=9.37.36.254] Return=0)
  3540. 00001 14:05:19.31 CLOSESOCKET Entry  (Socket=187)
  3541. 00001 14:05:19.31 WSAISBLOCKING Entry  ()
  3542. 00001 14:05:19.31 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3543. 00001 14:05:19.31 CLOSESOCKET Exit  (Socket=187, Return=0)
  3544. 00001 14:05:28.91 WSACLEANUP Entry ()
  3545. 00001 14:05:28.91 WSAISBLOCKING Entry  ()
  3546. 00001 14:05:28.91 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3547.  
  3548. The following sections provide details for using the Winsock 1.1 for OS/2 trace 
  3549. command and trace formatter. 
  3550.  
  3551.  
  3552. ΓòÉΓòÉΓòÉ 7.5.2. WSTRACE Command ΓòÉΓòÉΓòÉ
  3553.  
  3554. The WSTRACE command enables and disables Winsock tracing in an OS/2 session. 
  3555.  
  3556. Syntax 
  3557.  
  3558.              ΓöîΓöÇonΓöÇΓöÇΓöÉ                      ΓöîΓöÇ64ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3559. ΓöÇWSTRACEΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇ
  3560.              ΓööΓöÇoffΓöÇΓöÿ Γö£ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ ΓööΓöÇ -b buffsizeΓöÇΓöÿ
  3561.                      Γöé Γö£ΓöÇfilenameΓöÇΓöñ     Γöé
  3562.                      Γöé Γö£ΓöÇCOM1ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ     Γöé
  3563.                      Γöé Γö£ΓöÇCOM2ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ     Γöé
  3564.                      Γöé Γö£ΓöÇCOM3ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ     Γöé
  3565.                      Γöé ΓööΓöÇCOM4ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     Γöé
  3566.                      Γöé      ΓöîΓöÇWSTRACEΓöÇΓöÇΓöÉΓöé
  3567.                      ΓööΓöÇ -p ΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝Γöÿ
  3568.                             ΓööΓöÇpipenameΓöÇΓöÿ
  3569.  
  3570. Parameters 
  3571.  
  3572.  on 
  3573.    Turns tracing on.  This is the default. 
  3574.  
  3575.  off 
  3576.    Turns tracing off. 
  3577.  
  3578.  filename 
  3579.    Specifies the file name of the file that the trace output will be written 
  3580.    to.  COM1, COM2, COM3, and COM4 may be used to direct the trace to a serial 
  3581.    port. 
  3582.  
  3583.  -p pipename 
  3584.    Specifies the pipe name of an OS/2 pipe that the trace output will be 
  3585.    written to. Pipe names do not have to include a \PIPE\ prefix. If pipename 
  3586.    is not specified with the -p parameter, the pipe name defaults to WSTRACE. 
  3587.  
  3588.  -b buffsize 
  3589.    Specifies the size of the global trace buffer. If the -b parameter is not 
  3590.    specified, the buffer size defaults to 64 KB. 
  3591.  
  3592.  Notes: 
  3593.  
  3594.    1. When neither filename nor pipename is specified, trace output is written 
  3595.       by default to the file WSTRACE.DMP in the local directory. 
  3596.  
  3597.    2. When a pipe or COM port is specified as the destination for tracing 
  3598.       information, start the WSFORMAT command in an OS/2 session on the 
  3599.       destination device before running the Winsock application to be traced. 
  3600.  
  3601.    3. When specifying a serial port as the Winsock trace device, be sure that 
  3602.       the serial port settings match on both ends of the line. The OS/2 MODE 
  3603.       command lets you set the serial port settings. For more information about 
  3604.       the MODE command, see the OS/2 Command Reference or enter: 
  3605.  
  3606.             help mode
  3607.       in an OS/2 session. 
  3608.  
  3609.  
  3610. ΓòÉΓòÉΓòÉ 7.5.3. WSFORMAT Command ΓòÉΓòÉΓòÉ
  3611.  
  3612. The WSFORMAT command is the Winsock trace formatter.  The WSFORMAT command 
  3613. accepts the binary trace input from a serial port, file, or OS/2 pipe, and 
  3614. converts the input into a readable format that can then be displayed on-screen 
  3615. or written to a file, serial port, or OS/2 pipe. 
  3616.  
  3617. Syntax 
  3618.  
  3619. ΓöÇWSFORMATΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3620.               Γö£ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3621.               Γöé Γö£ΓöÇinput_filenameΓöÇΓöñ     Γöé
  3622.               Γöé Γö£ΓöÇCOM1ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ     Γöé
  3623.               Γöé Γö£ΓöÇCOM2ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ     Γöé
  3624.               Γöé Γö£ΓöÇCOM3ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ     Γöé
  3625.               Γöé ΓööΓöÇCOM4ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     Γöé
  3626.               Γöé      ΓöîΓöÇWSTRACEΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉΓöé
  3627.               ΓööΓöÇ -p ΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝Γöÿ
  3628.                      ΓööΓöÇinput_pipenameΓöÇΓöÿ
  3629.  
  3630.    ΓöîΓöÇWSFORMAT.DMPΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3631. ΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3632.    ΓööΓöÇ -f formatted_output_filenameΓöÇΓöÿ
  3633.  
  3634.    ΓöîΓöÇWSTRACE.DMPΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3635. ΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3636.    ΓööΓöÇ -b binary_output_filenameΓöÇΓöÿ
  3637.  
  3638. Parameters 
  3639.  
  3640.  input_filename 
  3641.    Specifies the file name of the input file containing the trace information 
  3642.    to format.  COM1, COM2, COM3, and COM4 may be used to accept trace data from 
  3643.    a serial port. 
  3644.  
  3645.  -p input_pipename 
  3646.    Specifies the pipe name of the OS/2 pipe that contains the trace data to 
  3647.    format. Pipe names do not have to include a \PIPE\ prefix. If input_pipename 
  3648.    is not specified with the -p parameter, the pipe name defaults to WSTRACE. 
  3649.  
  3650.  -f formatted_output_file 
  3651.    Specifies the file name of the file that the formatted trace output will be 
  3652.    written to. If formatted_output_file is not specified with the -f parameter, 
  3653.    the file name defaults to WSFORMAT.DMP in the current directory. 
  3654.  
  3655.  -b binary_output_file 
  3656.    Specifies the file name of the file that will receive a copy of the binary 
  3657.    information being formatted.  This can be used to save a copy of the trace 
  3658.    information coming from a serial port or pipe. If binary_output_file is not 
  3659.    specified with the -b parameter, the output file name defaults to 
  3660.    WSTRACE.DMP in the local directory. 
  3661.  
  3662.  Notes: 
  3663.  
  3664.    1. If the -f option is not specified, the formatted trace output is written 
  3665.       to the screen. 
  3666.  
  3667.    2. When specifying a serial port as the Winsock trace device, be sure that 
  3668.       the serial port settings match on both ends of the line. The OS/2 MODE 
  3669.       command lets you set the serial port settings. For more information about 
  3670.       the MODE command, see the OS/2 Command Reference or enter: 
  3671.  
  3672.             help mode
  3673.       in an OS/2 session. 
  3674.  
  3675.  
  3676. ΓòÉΓòÉΓòÉ 7.6. Where to Find Winsock Reference Information ΓòÉΓòÉΓòÉ
  3677.  
  3678. To obtain Winsock reference information, including socket and database routines 
  3679. and Microsoft Windows-specific extensions, consult the Windows Sockets 
  3680. specification. This specification is documented by authors from a number of 
  3681. corporations and is available from many places, including: 
  3682.  
  3683.      The IBM TCP/IP for OS/2 Programmer's Development Toolkit on the IBM 
  3684.       Developer's Connection CD-ROM ( Windows Sockets Version 1.1 only) 
  3685.  
  3686.      The Internet, at URL http://www.stardust.com ( Windows Sockets Version 
  3687.       1.1 only) 
  3688.  
  3689.      Directory /pub/winsock on host microdyne.com by way of anonymous ftp 
  3690.  
  3691.  To be added to the Windows Sockets mailing list, address your request to 
  3692.  winsock-request@microdyne.com. 
  3693.  
  3694.  
  3695. ΓòÉΓòÉΓòÉ 8. Remote Procedure Calls ΓòÉΓòÉΓòÉ
  3696.  
  3697. This section describes the high-level remote procedure calls (RPCs) implemented 
  3698. in TCP/IP for OS/2, including the RPC programming interface to the C language 
  3699. and communication between processes. 
  3700.  
  3701. Topics 
  3702.  
  3703.       The RPC Protocol 
  3704.       The RPC Interface 
  3705.       Remote Programs and Procedures 
  3706.       Portmapper 
  3707.       eXternal Data Representation (XDR) 
  3708.       The RPC Intermediate Layer 
  3709.       The RPC Lowest Layer 
  3710.       rpcgen Command 
  3711.       rpcinfo Command 
  3712.       The enum clnt_stat Structure 
  3713.       The Remote Procedure Call Library 
  3714.       Differences between OS/2 and Sun Microsystems RPCs 
  3715.       Compiling an RPC API Application 
  3716.  
  3717.  
  3718. ΓòÉΓòÉΓòÉ 8.1. The RPC Protocol ΓòÉΓòÉΓòÉ
  3719.  
  3720. The RPC protocol enables remote execution of subroutines across a TCP/IP 
  3721. network. RPC, together with the eXternal Data Representation (XDR) protocol, 
  3722. defines a standard for representing data that is independent of internal 
  3723. protocols or formatting. RPCs can communicate between processes on the same or 
  3724. different hosts. 
  3725.  
  3726. The RPC protocol enables users to work with remote procedures as if the 
  3727. procedures were local. The remote procedure calls are defined through routines 
  3728. contained in the RPC protocol.  Each call message is matched with a reply 
  3729. message. The RPC protocol is a message-passing protocol that implements other 
  3730. non-RPC protocols, such as batching and broadcasting remote calls.  The RPC 
  3731. protocol also supports callback procedures and the select subroutine on the 
  3732. server side. 
  3733.  
  3734. RPC provides an authentication process that identifies the server and client to 
  3735. each other.  RPC includes a slot for the authentication parameters on every 
  3736. remote procedure call so that the caller can identify itself to the server. The 
  3737. client package generates and returns authentication parameters. RPC supports 
  3738. various types of authentication, such as the UNIX systems. 
  3739.  
  3740. In RPC, each server supplies a program that is a set of procedures. The 
  3741. combination of a host address, a program number, and a procedure number 
  3742. specifies one remote service procedure. In the RPC model, the client makes a 
  3743. procedure call to send a data packet to the server. When the packet arrives, 
  3744. the server calls a dispatch routine, performs whatever service is requested, 
  3745. and sends a reply back to the client.  The procedure call then returns to the 
  3746. client. 
  3747.  
  3748. RPC is divided into two layers:  intermediate and lowest. Generally, you use 
  3749. the RPC interface to communicate between processes on different workstations in 
  3750. a network. However, RPC works just as well for communication between different 
  3751. processes on the same workstation. 
  3752.  
  3753. The Portmapper program maps RPC program and version numbers to a 
  3754. transport-specific port number. The Portmapper program makes dynamic binding of 
  3755. remote programs possible. 
  3756.  
  3757. To write network applications using RPC, programmers need a working knowledge 
  3758. of network theory and C programming language. For most applications, 
  3759. understanding the RPC mechanisms usually hidden by the RPCGEN protocol compiler 
  3760. is also helpful. However, RPCGEN makes understanding the details of RPC 
  3761. unnecessary. The figures in The RPC Interface give an overview of the 
  3762. high-level RPC client and server processes from initialization through cleanup. 
  3763. See the SAMPLES\RPC directory for sample RPC client, server, and raw data 
  3764. stream programs. RPCGEN samples are in the SAMPLES\RPCGEN directory. 
  3765.  
  3766. For more information about the RPC and XDR protocols, see the Sun Microsystems 
  3767. publication, Networking on the Sun Workstation: Remote Procedure Call 
  3768. Programming Guide , RFC 1057 and RFC 1014. 
  3769.  
  3770.  
  3771. ΓòÉΓòÉΓòÉ 8.2. The RPC Interface ΓòÉΓòÉΓòÉ
  3772.  
  3773. The RPC model is similar to the local procedure call model. In the local model, 
  3774. the caller places the argument to a procedure in a specified location such as a 
  3775. result register. Then, the caller transfers control to the procedure. The 
  3776. caller eventually regains control, extracts the results of the procedure, and 
  3777. continues the execution. 
  3778.  
  3779. RPC works in the same way: One thread of control winds logically through the 
  3780. caller and server processes as follows: 
  3781.  
  3782.    1. The caller process sends a call message that includes the procedure 
  3783.       parameters to the server process and then waits for a reply message 
  3784.       (blocks). 
  3785.  
  3786.    2. A process on the server side, which is dormant until the arrival of the 
  3787.       call message, extracts the procedure parameters, computes the results, 
  3788.       and sends a reply message.  Then the server waits for the next call 
  3789.       message. 
  3790.  
  3791.    3. A process on the caller side receives the reply message and extracts the 
  3792.       results of the procedure. The caller then resumes the execution. 
  3793.  
  3794.  See the following figures for an illustration of the RPC model: 
  3795.  
  3796.  
  3797.   Remote Procedure Call (Client)
  3798.  
  3799.  
  3800.   Remote Procedure Call (Server)
  3801.  
  3802.  
  3803. ΓòÉΓòÉΓòÉ 8.3. Remote Programs and Procedures ΓòÉΓòÉΓòÉ
  3804.  
  3805. The RPC call message has three unsigned fields: 
  3806.  
  3807.      Remote program number 
  3808.      Remote program version number 
  3809.      Remote procedure number 
  3810.  
  3811.  The three fields uniquely identify the procedure to be called. The program 
  3812.  number defines a group of related remote procedures, each of which has a 
  3813.  different procedure number. Each program also has a version number. 
  3814.  
  3815.  The central system authority administers the program number. A remote program 
  3816.  number is assigned by groups of 0x20000000, as shown in the following list: 
  3817.  
  3818.  Program Number          Description
  3819.  
  3820.  0-1xxxxxxx              Is predefined and administered by the OS/2 TCP/IP 
  3821.                          system. 
  3822.  
  3823.  20000000-3xxxxxxx       Represents the user defined numbers 
  3824.  
  3825.  40000000-5xxxxxxx       Represents transient numbers 
  3826.  
  3827.  60000000-7xxxxxxx       Reserved 
  3828.  
  3829.  80000000-9xxxxxxx       Reserved 
  3830.  
  3831.  a0000000-bxxxxxxx       Reserved 
  3832.  
  3833.  c0000000-dxxxxxxx       Reserved 
  3834.  
  3835.  e0000000-fxxxxxxx       Reserved 
  3836.  
  3837.  
  3838. ΓòÉΓòÉΓòÉ 8.4. Portmapper ΓòÉΓòÉΓòÉ
  3839.  
  3840. This section describes the Portmapper service and its uses. 
  3841.  
  3842. Topics 
  3843.  
  3844.       Portmapper Protocol 
  3845.       Registering and Unregistering a Port with Portmapper 
  3846.       Contacting Portmapper 
  3847.       Portmapper Procedures 
  3848.  
  3849.  
  3850. ΓòÉΓòÉΓòÉ 8.4.1. Portmapper Protocol ΓòÉΓòÉΓòÉ
  3851.  
  3852. The Portmapper protocol defines a network service that clients use to look up 
  3853. the port number of any remote program supported by the server. The client 
  3854. programs must find the port numbers of the server programs that they intend to 
  3855. use. 
  3856.  
  3857. The Portmapper program: 
  3858.  
  3859.      Maps RPC program and version numbers to transport specific port numbers. 
  3860.  
  3861.      Enables dynamic binding of remote programs. This is desirable because the 
  3862.       range of reserved port numbers is small, and the number of potential 
  3863.       remote programs is large. When running only the Portmapper program on a 
  3864.       reserved port, you can determine the port numbers of other remote 
  3865.       programs by querying Portmapper. 
  3866.  
  3867.      Supports both the UDP and TCP protocols. 
  3868.  The RPC client contacts Portmapper on port number 111 on either of these 
  3869.  protocols. 
  3870.  
  3871.  
  3872. ΓòÉΓòÉΓòÉ 8.4.2. Registering and Unregistering a Port with Portmapper ΓòÉΓòÉΓòÉ
  3873.  
  3874. Portmapper is the only network service that must have a dedicated port (111). 
  3875. Other RPC network services can be assigned port numbers statically or 
  3876. dynamically, if the services register their ports with the host's local 
  3877. Portmapper. The RPC server can register or unregister their services by using 
  3878. the following calls: 
  3879.  
  3880.  svc_register()        Associates a program with the service dispatch routine 
  3881.  
  3882.  svc_unregister()      Removes all local mappings to dispatch routines and port 
  3883.                        numbers 
  3884.  
  3885.  registerrpc()         Registers a procedure with the local Portmapper and 
  3886.                        creates a control structure to remember the server 
  3887.                        procedure and its XDR routine 
  3888.  
  3889.  
  3890. ΓòÉΓòÉΓòÉ 8.4.3. Contacting Portmapper ΓòÉΓòÉΓòÉ
  3891.  
  3892. To find the port of a remote program, the client sends an RPC request to 
  3893. well-known port 111 of the server's host. If Portmapper has a port number entry 
  3894. for the remote program, Portmapper provides the port number in the RPC reply. 
  3895. The client then requests the remote program by sending an RPC request to the 
  3896. port number provided by Portmapper. 
  3897.  
  3898. Clients can save port numbers of recently called remote programs to avoid 
  3899. having to contact Portmapper for each request to a server. 
  3900.  
  3901. RPC also provides the following calls for interfacing with Portmapper: 
  3902.  
  3903.   Call                  Description
  3904.  
  3905.  pmap_getmaps()        Returns a list of current program-to-port mappings on 
  3906.                        the foreign host 
  3907.  
  3908.  pmap_getport()        Returns the port number associated with the remove 
  3909.                        program, version, and transport protocol 
  3910.  
  3911.  pmap_rmtcall()        Instructs Portmapper to make an RPC call to a procedure 
  3912.                        on the host 
  3913.  
  3914.  pmap_set()            Sets the mapping of a program to a port on the local 
  3915.                        machine 
  3916.  
  3917.  pmap_unset()          Removes mappings associated with the program and version 
  3918.                        number on the local machine 
  3919.  
  3920.  xdr_pmap()            Translates an RPC procedure identification 
  3921.  
  3922.  xdr_pmaplist()        Translates a variable number of RPC procedure 
  3923.                        identifications 
  3924.  
  3925.  
  3926. ΓòÉΓòÉΓòÉ 8.4.4. Portmapper Procedures ΓòÉΓòÉΓòÉ
  3927.  
  3928. The Portmapper program supports the following procedures: 
  3929.  
  3930.   Procedure               Description
  3931.  
  3932.  PMAPPROC_NULL           Has no parameters. A caller can use the return code to 
  3933.                          determine if Portmapper is running. 
  3934.  
  3935.  PMAPPROC_SET            Registers itself with the Portmapper program on the 
  3936.                          same machine. It passes the: 
  3937.  
  3938.                              Program number 
  3939.                              Program version number 
  3940.                              Transport protocol number 
  3941.                              Port number 
  3942.  
  3943.                          The procedure has successfully established the mapping 
  3944.                          if the return value is TRUE. The procedure does not 
  3945.                          establish a mapping if one already exists. 
  3946.  
  3947.  PMAPPROC_UNSET          Unregisters the program and version numbers with 
  3948.                          Portmapper on the same machine. 
  3949.  
  3950.  PMAPPROC_GETPORT        Returns the port number when given a program number, 
  3951.                          version number, and transport protocol number. A port 
  3952.                          value of 0 indicates the program has not been 
  3953.                          registered. 
  3954.  
  3955.  PMAPPROC_DUMP           Takes no input, but returns a list of program, 
  3956.                          version, protocol, and port numbers. 
  3957.  
  3958.  PMAPPROC_CALLIT         Allows a caller to call another remote procedure on 
  3959.                          the same machine without knowing the remote 
  3960.                          procedure's port number. The PMAPPROC_CALLIT procedure 
  3961.                          sends a response only if the procedure is successfully 
  3962.                          run. 
  3963.  
  3964.  
  3965. ΓòÉΓòÉΓòÉ 8.5. eXternal Data Representation (XDR) ΓòÉΓòÉΓòÉ
  3966.  
  3967. This section describes the eXternal Data Representation (XDR) standard and its 
  3968. use. 
  3969.  
  3970. Topics 
  3971.  
  3972.       The XDR Standard 
  3973.       Basic Block Size 
  3974.       The XDR Subroutine Format 
  3975.       XDR Data Types and their Filter Primitives 
  3976.       XDR Filter Primitives 
  3977.       XDR Nonfilter Primitives 
  3978.  
  3979.  
  3980. ΓòÉΓòÉΓòÉ 8.5.1. The XDR Standard ΓòÉΓòÉΓòÉ
  3981.  
  3982. An eXternal Data Representation (XDR) is a data representation standard that is 
  3983. independent of languages, operating systems, manufacturers, and hardware 
  3984. architecture. This standard enables networked computers to share data 
  3985. regardless of the machine on which the data is produced or consumed. The XDR 
  3986. language permits transfer of data between diverse computer architectures. 
  3987.  
  3988. An XDR approach to standardizing data representations is canonical. That is, 
  3989. XDR defines a single byte (big endian), a single floating-point representation 
  3990. (IEEE), and so on. Any program running on any machine can use XDR to create 
  3991. portable data by translating its local representation to the XDR standards. 
  3992. Similarly, any program running on any machine can read portable data by 
  3993. translating the XDR standard representations to its local equivalents. 
  3994.  
  3995. The XDR standard is the backbone of the RPC, because data for remote procedure 
  3996. calls is sent using the XDR standard. 
  3997.  
  3998. To use XDR routines, C programs must include the <RPC\XDR.H> header file, which 
  3999. is automatically included by the <RPC\RPC.H> header file. 
  4000.  
  4001.  
  4002. ΓòÉΓòÉΓòÉ 8.5.2. Basic Block Size ΓòÉΓòÉΓòÉ
  4003.  
  4004. The XDR language is based on the assumption that bytes (an octet) can be ported 
  4005. to, and encoded on, media that preserve the meaning of the bytes across the 
  4006. hardware boundaries of data. XDR does not represent bit fields or bit maps; it 
  4007. represents data in blocks of multiples of 4 bytes (32 bits). If the bytes 
  4008. needed to contain the data are not a multiple of four, enough (1 to 3) bytes to 
  4009. make the total byte count a multiple of four follow the n bytes. The bytes are 
  4010. read from, or written to, a byte stream in order. The order dictates that byte 
  4011. m precedes m+1. Bytes are ported and encoded from low order to high order in 
  4012. local area networks (LANs). Representing data in standardized formats resolves 
  4013. situations that occur when different byte-ordering formats exist on networked 
  4014. machines. This also enables machines with different structure-alignment 
  4015. algorithms to communicate with each other. 
  4016.  
  4017.  
  4018. ΓòÉΓòÉΓòÉ 8.5.3. The XDR Subroutine Format ΓòÉΓòÉΓòÉ
  4019.  
  4020. An XDR routine is associated with each data type. XDR routines have the 
  4021. following format: 
  4022.  
  4023. xdr_xxx(xdrs,dp)
  4024.           XDR *xdrs;
  4025.           xxx *dp;
  4026. {
  4027. }
  4028.  
  4029. The routine has the following parameters: 
  4030.  
  4031.  xxx 
  4032.    XDR data type. 
  4033.  
  4034.  xdrs 
  4035.    Opaque handle that points to an XDR stream. The system passes the opaque 
  4036.    handle pointer to the primitive XDR routines. 
  4037.  
  4038.  dp 
  4039.    Address of the data value that is to be encoded or decoded. 
  4040.  
  4041.  If they succeed, the XDR routines return a value of 1; if they do not succeed, 
  4042.  they return a value of 0. 
  4043.  
  4044.  
  4045. ΓòÉΓòÉΓòÉ 8.5.4. XDR Data Types and their Filter Primitives ΓòÉΓòÉΓòÉ
  4046.  
  4047. The XDR standard defines basic and constructed data types. The XDR filter 
  4048. primitives are routines that define the basic and constructed data types. The 
  4049. XDR language provides RPC programmers with a specification for uniform 
  4050. representation that includes filter primitives for basic and constructed data 
  4051. types. 
  4052.  
  4053. The basic data types include: 
  4054.  
  4055.      Integers 
  4056.      Enumeration 
  4057.      Booleans 
  4058.      Floating point decimals 
  4059.      Void 
  4060.      Constants 
  4061.      Typedef 
  4062.      Optional data 
  4063.  
  4064.  The constructed data types include: 
  4065.  
  4066.      Arrays 
  4067.      Opaque data 
  4068.      Strings 
  4069.      Byte arrays 
  4070.      Structures 
  4071.      Discriminated unions 
  4072.      Pointers 
  4073.  
  4074.  
  4075. ΓòÉΓòÉΓòÉ 8.5.5. XDR Filter Primitives ΓòÉΓòÉΓòÉ
  4076.  
  4077. The XDR standard translates both basic and constructed data types. For basic 
  4078. data types such as integer, XDR provides basic filter primitives that: 
  4079.  
  4080.      Serialize information from the local host's representation to XDR 
  4081.       representation 
  4082.  
  4083.      Deserialize information from the XDR representation to the local host's 
  4084.       representation 
  4085.  
  4086.  For constructed data types, XDR provides constructed filter primitives that 
  4087.  allow the use of basic data types (such as integers and floating-point 
  4088.  numbers) to create more complex constructs (such as arrays and discriminated 
  4089.  unions). 
  4090.  
  4091.  Topics 
  4092.  
  4093.       Integer Filter Primitives 
  4094.       Enumeration Filter Primitives 
  4095.       Floating-Point Filter Primitives 
  4096.       Opaque Data Filter Primitive 
  4097.       Array Filter Primitives 
  4098.       String Filter Primitives 
  4099.       Primitive for Pointers to Structures 
  4100.       Primitive for Discriminated Unions 
  4101.       Passing Routines without Data 
  4102.  
  4103.  
  4104. ΓòÉΓòÉΓòÉ 8.5.5.1. Integer Filter Primitives ΓòÉΓòÉΓòÉ
  4105.  
  4106. The XDR filters cover signed and unsigned integers, as well as signed and 
  4107. unsigned short and long integers. 
  4108.  
  4109. The routines for XDR integer filters are: 
  4110.  
  4111.   Routine          Description
  4112.  
  4113.  xdr_int()        Translates between C integers and their external 
  4114.                   representations 
  4115.  
  4116.  xdr_u_int()      Translates between C unsigned integers and their external 
  4117.                   representations 
  4118.  
  4119.  xdr_long()       Translates between C long integers and their external 
  4120.                   representations 
  4121.  
  4122.  xdr_u_long()     Translates between C unsigned long integers and their 
  4123.                   external representations 
  4124.  
  4125.  xdr_short()      Translates between C short integers and their external 
  4126.                   representations 
  4127.  
  4128.  xdr_u_short()    Translates between C unsigned short integers and their 
  4129.                   external representations 
  4130.  
  4131.  
  4132. ΓòÉΓòÉΓòÉ 8.5.5.2. Enumeration Filter Primitives ΓòÉΓòÉΓòÉ
  4133.  
  4134. The XDR library provides a primitive for generic enumerations based on the 
  4135. assumption that a C enumeration value (enum) has the same representation. A 
  4136. special enumeration in XDR, known as the Boolean, provides a value of 0 or 1 
  4137. represented internally in a binary notation. 
  4138.  
  4139. The routines for the XDR library enumeration filters are: 
  4140.  
  4141.   Routine         Description
  4142.  
  4143.  xdr_enum()      Translates between C language enums and their external 
  4144.                  representations 
  4145.  
  4146.  xdr_bool()      Translates between Booleans and their external representations 
  4147.  
  4148.  
  4149. ΓòÉΓòÉΓòÉ 8.5.5.3. Floating-Point Filter Primitives ΓòÉΓòÉΓòÉ
  4150.  
  4151. The XDR library provides primitives that translate between floating-point data 
  4152. and their external representations. Floating-point data encodes an integer with 
  4153. an exponent. Floats and double-precision numbers compose floating-point data. 
  4154.  
  4155. Note:  Numbers are represented as Institute of Electrical and Electronics 
  4156.        Engineers (IEEE) standard floating points. Routines might fail when 
  4157.        decoding IEEE representations into machine specific representations. 
  4158.  
  4159.  The routines for the XDR floating-point filters are: 
  4160.  
  4161.   Routine         Description
  4162.  
  4163.  xdr_float()     Translates between C language floats and their external 
  4164.                  representations 
  4165.  
  4166.  xdr_double()    Translates between C language double-precision numbers and 
  4167.                  their external representations 
  4168.  
  4169.  
  4170. ΓòÉΓòÉΓòÉ 8.5.5.4. Opaque Data Filter Primitive ΓòÉΓòÉΓòÉ
  4171.  
  4172. Opaque data is composed of bytes of a fixed size that are not interpreted as 
  4173. they pass through the data streams. Opaque data bytes, such as handles, are 
  4174. passed between server and client without being inspected by the client. The 
  4175. client uses the data as it is and then returns it to the server. By definition, 
  4176. the actual data contained in the opaque object is not portable between 
  4177. computers. 
  4178.  
  4179. The XDR library includes the following routine for opaque data: 
  4180.  
  4181.   Routine         Description
  4182.  xdr_opaque()    Translates between opaque data and its external representation 
  4183.  
  4184.  
  4185. ΓòÉΓòÉΓòÉ 8.5.5.5. Array Filter Primitives ΓòÉΓòÉΓòÉ
  4186.  
  4187. Arrays are constructed filter primitives that can be generic arrays or byte 
  4188. arrays. The XDR library provides filter primitives for handling both types of 
  4189. arrays. 
  4190.  
  4191.  
  4192. ΓòÉΓòÉΓòÉ 8.5.5.5.1. Generic Arrays ΓòÉΓòÉΓòÉ
  4193.  
  4194. These consist of arbitrary elements. You use them in much the same way as byte 
  4195. arrays. The primitive for generic arrays requires an additional parameter to 
  4196. define the size of the element in the array and to call an XDR routine to 
  4197. encode or decode each element in the array. 
  4198.  
  4199. The XDR library includes the following routines for generic arrays: 
  4200.  
  4201.   Routine         Description
  4202.  
  4203.  xdr_array()     Translates between variable-length arrays and their 
  4204.                  corresponding external representations 
  4205.  
  4206.  xdr_vector()    Translates between fixed-length arrays and their corresponding 
  4207.                  external representations 
  4208.  
  4209.  
  4210. ΓòÉΓòÉΓòÉ 8.5.5.5.2. Byte Arrays ΓòÉΓòÉΓòÉ
  4211.  
  4212. These differ from strings by having a byte count. That is, the length of the 
  4213. array is set to an unsigned integer. They also differ in that byte arrays do 
  4214. not end with a null character. The XDR library provides a primitive for byte 
  4215. arrays. External and internal representations of byte arrays are the same. 
  4216.  
  4217. The XDR library includes the following routine for byte arrays: 
  4218.  
  4219.   Routine         Description
  4220.  xdr_bytes()     Translates between counted byte string arrays and their 
  4221.                  external representations 
  4222.  
  4223.  
  4224. ΓòÉΓòÉΓòÉ 8.5.5.6. String Filter Primitives ΓòÉΓòÉΓòÉ
  4225.  
  4226. A string is a constructed filter primitive that consists of a sequence of bytes 
  4227. terminated by a null byte. The null byte does not figure into the length of the 
  4228. string. Externally, strings are represented by a sequence of American Standard 
  4229. Code Information Interchange (ASCII) characters. Internally, XDR represents 
  4230. them as pointers to characters with the designation char *. 
  4231.  
  4232. The XDR library includes primitives for the following string routines: 
  4233.  
  4234.   Routine             Description
  4235.  
  4236.  xdr_string()        Translates between C language strings and their external 
  4237.                      representations 
  4238.  
  4239.  xdr_wrapstring()    Calls the xdr_string subroutine 
  4240.  
  4241.  
  4242. ΓòÉΓòÉΓòÉ 8.5.5.7. Primitive for Pointers to Structures ΓòÉΓòÉΓòÉ
  4243.  
  4244. The XDR library provides the primitive for pointers so that structures 
  4245. referenced within other structures can be easily serialized, deserialized, and 
  4246. released. 
  4247.  
  4248. The XDR library includes the following routine for pointers to structures: 
  4249.  
  4250.   Routine             Description
  4251.  
  4252.  xdr_reference()     Provides pointer chasing within structures 
  4253.  
  4254.  
  4255. ΓòÉΓòÉΓòÉ 8.5.5.8. Primitive for Discriminated Unions ΓòÉΓòÉΓòÉ
  4256.  
  4257. A discriminated union is a C language union, which is an object that holds 
  4258. several data types.  One arm of the union contains an enumeration value 
  4259. (enum_t), or discriminant, that holds a specific object to be processed over 
  4260. the system first. 
  4261.  
  4262. The XDR library includes the following routine for discriminated unions: 
  4263.  
  4264.   Routine         Description
  4265.  xdr_union()     Translates between discriminated unions and their external 
  4266.                  representations 
  4267.  
  4268.  
  4269. ΓòÉΓòÉΓòÉ 8.5.5.9. Passing Routines without Data ΓòÉΓòÉΓòÉ
  4270.  
  4271. Sometimes an XDR routine must be supplied to the RPC system, but no data is 
  4272. required or passed. The XDR library provides the following primitive for this 
  4273. function: 
  4274.  
  4275.   Routine         Description
  4276.  xdr_void()      Supplies an XDR subroutine to the RPC system without sending 
  4277.                  data 
  4278.  
  4279.  
  4280. ΓòÉΓòÉΓòÉ 8.5.6. XDR Nonfilter Primitives ΓòÉΓòÉΓòÉ
  4281.  
  4282. Use the XDR nonfilter primitives to create, manipulate, implement, and destroy 
  4283. XDR data streams. These primitives allow you to: 
  4284.  
  4285.      Describe the data stream position 
  4286.      Change the data stream position 
  4287.      Destroy a data stream 
  4288.  
  4289.  Topics 
  4290.  
  4291.       Creating and Using XDR Data Streams 
  4292.       Manipulating an XDR Data Stream 
  4293.       Implementing an XDR Data Stream 
  4294.       Destroying an XDR Data Stream 
  4295.  
  4296.  
  4297. ΓòÉΓòÉΓòÉ 8.5.6.1. Creating and Using XDR Data Streams ΓòÉΓòÉΓòÉ
  4298.  
  4299. You get XDR data streams by calling creation routines that take arguments 
  4300. specifically designed for the properties of the stream. There are existing XDR 
  4301. data streams for serializing or deserializing data in standard input and output 
  4302. streams, memory streams, and record streams. 
  4303.  
  4304. Note:  RPC clients do not have to create XDR streams, because the RPC system 
  4305.        creates and passes these streams to the client. 
  4306.  
  4307.  The types of data streams include: 
  4308.  
  4309.      Standard I/O streams 
  4310.      Memory streams 
  4311.      Record streams 
  4312.  
  4313.  
  4314. ΓòÉΓòÉΓòÉ 8.5.6.1.1. Standard I/O Streams ΓòÉΓòÉΓòÉ
  4315.  
  4316. XDR data streams serialize and deserialize standard input/output( I/O) by 
  4317. calling the standard I/O creation routine to initialize the XDR data stream 
  4318. pointed to by the xdrs parameter. 
  4319.  
  4320. The XDR library includes the following routine for standard I/O data streams: 
  4321.  
  4322.   Routine                 Description
  4323.  xdrstdio_create()       Initializes the XDR data stream pointed to by the xdrs 
  4324.                          parameter 
  4325.  
  4326.  
  4327. ΓòÉΓòÉΓòÉ 8.5.6.1.2. Memory Streams ΓòÉΓòÉΓòÉ
  4328.  
  4329. XDR data streams serialize and deserialize data from memory by calling the XDR 
  4330. memory creation routine to initialize, in local memory, the XDR stream pointed 
  4331. at by the xdrs parameter. In RPC, the UDP/IP implementation of remote procedure 
  4332. calls uses this routine to build entire call and reply messages in memory 
  4333. before sending the message to the recipient. 
  4334.  
  4335. The XDR library includes the following routine for memory data streams: 
  4336.  
  4337.   Routine                 Description
  4338.  xdrmem_create()         Initializes, in local memory, the XDR stream pointed 
  4339.                          to by the xdrs parameter 
  4340.  
  4341.  
  4342. ΓòÉΓòÉΓòÉ 8.5.6.1.3. Record Streams ΓòÉΓòÉΓòÉ
  4343.  
  4344. Record streams are XDR streams built on top of record fragments, which are 
  4345. built on TCP/IP streams. TCP/IP is a connection protocol for transporting large 
  4346. streams of data at one time rather than transporting a single data packet at a 
  4347. time. 
  4348.  
  4349. The primary use of a record stream is to interface remote procedure calls to 
  4350. TCP connections.  It can also be used to stream data into or out of normal 
  4351. files. 
  4352.  
  4353. XDR provides the following routines for use with record streams: 
  4354.  
  4355.   Routine                       Description
  4356.  
  4357.  xdrrec_create()               Provides an XDR stream that can contain long 
  4358.                                sequences of records 
  4359.  
  4360.  xdrrec_endofrecord()          Causes the current outgoing data to be marked as 
  4361.                                a record 
  4362.  
  4363.  xdrrec_skiprecord()           Causes the position of an input stream to move 
  4364.                                to the beginning of the next record 
  4365.  
  4366.  xdrrec_eof()                  Checks the buffer for an input stream that 
  4367.                                identifies the end of file (EOF) 
  4368.  
  4369.  
  4370. ΓòÉΓòÉΓòÉ 8.5.6.2. Manipulating an XDR Data Stream ΓòÉΓòÉΓòÉ
  4371.  
  4372. XDR provides the following routines for describing the data stream position and 
  4373. changing the data stream position: 
  4374.  
  4375.   Routine             Description
  4376.  
  4377.  xdr_getpos()        Returns an unsigned integer that describes the current 
  4378.                      position in the data stream 
  4379.  
  4380.  xdr_setpos()        Changes the current position in the XDR stream 
  4381.  
  4382.  
  4383. ΓòÉΓòÉΓòÉ 8.5.6.3. Implementing an XDR Data Stream ΓòÉΓòÉΓòÉ
  4384.  
  4385. You can create and implement XDR data streams. The following example shows the 
  4386. abstract data types (XDR handle) required for you to implement your own XDR 
  4387. streams. They contain operations applied to the stream (an operation vector for 
  4388. the particular implementation) and two private fields for using that 
  4389. implementation. 
  4390.  
  4391. enum xdr_op  { XDR_ENCODE=0, XDR_DECODE=1, XDR_FREE=2 };
  4392. typedef struct xdr {
  4393.         enum xdr_op  x_op;
  4394.         struct xdr_ops {
  4395.                bool_t  (*x_getlong)(struct xdr *, long *);
  4396.                bool_t  (*x_putlong)(struct xdr *, long *);
  4397.                bool_t  (*x_getbytes)(struct xdr *, caddr_t, u_int);
  4398.         /* get some bytes from " */
  4399.                bool_t  (*x_putbytes)(struct xdr *, caddr_t, u_int);
  4400.         /* put some bytes to " */
  4401.                u_int   (*x_getpostn)(struct xdr *);
  4402.                bool_t  (*x_setpostn)(struct xdr *,u_int);
  4403.                long *  (*x_inline)(struct xdr *,u_int);
  4404.                void    (*x_destroy)(struct xdr *);
  4405.         } *x_ops;
  4406.         caddr_t         x_public;
  4407.         caddr_t         x_private;
  4408.         caddr_t         x_base;
  4409.         int             x_handy;
  4410. } XDR;
  4411.  
  4412. The following parameters are pointers to XDR stream manipulation routines: 
  4413.  
  4414.   Parameter           Description
  4415.  x_getlong           Gets long integer values from the data stream. 
  4416.  x_putlong           Puts long integer values into the data stream. 
  4417.  x_getbytes          Gets bytes from the data streams. 
  4418.  x_putbytes          Puts bytes into the data streams. 
  4419.  x_getpostn          Returns the stream offset. 
  4420.  x_setpostn          Repositions the offset. 
  4421.  x_inline            Points to an internal data buffer, used for any purpose. 
  4422.  x_destroy           Frees the private data structure. 
  4423.  x_ops               Specifies the current operation being performed on the 
  4424.                      stream. This field is important to the XDR primitives, but 
  4425.                      the stream's implementation does not depend on the value 
  4426.                      of this parameter. 
  4427.  
  4428.  The following fields are specific to a stream's implementation: 
  4429.  
  4430.   Field           Description
  4431.  
  4432.  x_public        Specific user data that is private to the stream's 
  4433.                  implementation and that is not used by the XDR primitive 
  4434.  
  4435.  x_private       Points to the private data 
  4436.  
  4437.  x_base          Contains the position information in the data stream that is 
  4438.                  private to the user implementation 
  4439.  
  4440.  x_handy         Data can contain extra information as necessary 
  4441.  
  4442.  
  4443. ΓòÉΓòÉΓòÉ 8.5.6.4. Destroying an XDR Data Stream ΓòÉΓòÉΓòÉ
  4444.  
  4445. XDR provides a routine that destroys the XDR stream pointed to by the xdrs 
  4446. parameter and frees the private data structures allocated to the stream. 
  4447.  
  4448.   Routine             Description
  4449.  xdr_destroy()       Destroys the XDR stream pointed to by the xdrs parameter 
  4450.  
  4451.  The use of the XDR stream handle is undefined after it is destroyed. 
  4452.  
  4453.  
  4454. ΓòÉΓòÉΓòÉ 8.6. The RPC Intermediate Layer ΓòÉΓòÉΓòÉ
  4455.  
  4456. The calls of the RPC intermediate layer are: 
  4457.  
  4458.   Routine             Description
  4459.  registerrpc()       Registers a procedure with the local Portmapper 
  4460.  callrpc()           Calls a remote procedure on the specified system 
  4461.  svc_run()           Accepts RPC requests and calls the appropriate service 
  4462.                      using svc_getreq() 
  4463.  
  4464.  The transport mechanism is the User Datagram Protocol (UDP). The UDP transport 
  4465.  mechanism handles only arguments and results that are less than 8K bytes in 
  4466.  length. At this level, RPC does not allow timeout specifications, choice of 
  4467.  transport, or process control, in case of errors. If you need this kind of 
  4468.  control, consider the lowest layer of RPC. 
  4469.  
  4470.  With only these three RPC calls, you can write a powerful RPC-based network 
  4471.  application.  The sequence of events follows: 
  4472.  
  4473.    1. Use the registerrpc() call to register your remote program with the local 
  4474.       Portmapper. See Portmapper for more information. The following is an 
  4475.       example of an RPC server: 
  4476.  
  4477.  
  4478.             /* define remote program number and version */
  4479.  
  4480.             #define RMTPROGNUM (u_long)0x3fffffffL
  4481.             #define RMTPROGVER (u_long)0x1
  4482.             #define RMTPROCNUM (u_long)0x1
  4483.  
  4484.             #include <stdio.h>
  4485.             #include <rpc\rpc.h>
  4486.  
  4487.  
  4488.             main()
  4489.             {
  4490.              int *rmtprog();
  4491.  
  4492.              /* register remote program with Portmapper */
  4493.              registerrpc(RMTPROGNUM, RMTPROGVER, RMTPROCNUM, rmtprog,
  4494.              xdr_int, xdr_int);
  4495.              /* infinite loop, waits for RPC request from client */
  4496.              svc_run();
  4497.              printf("Error: svc_run should never reach this point \n");
  4498.              exit(1);
  4499.             }
  4500.  
  4501.             int *
  4502.             rmtprog(inproc)          /* remote program */
  4503.             int *inproc;
  4504.  
  4505.             {
  4506.             int *outproc;
  4507.             ...
  4508.              /* Process request */
  4509.             ...
  4510.              return (outproc);
  4511.             }
  4512.  
  4513.       The registerrpc() call registers a C procedure rmtprog, which corresponds 
  4514.       to a given RPC procedure number. 
  4515.  
  4516.       The registerrpc() call has six parameters: 
  4517.  
  4518.           The first three parameters are the program, version, and procedure 
  4519.            numbers of the remote procedure to be registered. 
  4520.  
  4521.           The fourth parameter, rmtprog, is the name of the local procedure 
  4522.            that implements the remote procedure. 
  4523.  
  4524.           The last two parameters, xdr_int, are the XDR filters for the remote 
  4525.            procedure's arguments and results. 
  4526.  
  4527.       After registering a procedure, the RPC server goes into an infinite loop 
  4528.       waiting for a client request to service. 
  4529.  
  4530.    2. The RPC client uses callrpc() to make a service request to the RPC 
  4531.       server. The following is an example of an RPC client using the callrpc() 
  4532.       call: 
  4533.  
  4534.             /* define remote program number and version */
  4535.  
  4536.             #define RMTPROGNUM (u_long)0x3fffffffL
  4537.             #define RMTPROGVER (u_long)0x1
  4538.             #define RMTPROCNUM (u_long)0x1
  4539.  
  4540.             #include <stdio.h>
  4541.             #include <rpc\rpc.h>
  4542.  
  4543.             main()
  4544.             {
  4545.               int inproc=100, outproc, rstat;
  4546.  
  4547.             ...
  4548.  
  4549.               /* service request to host RPCSERVER_HOST */
  4550.               if (rstat = callrpc("RPCSERVER_HOST", RMTPROGNUM,
  4551.                           RMTPROGVER, RMTPROCNUM, xdr_int, (char *)&inproc,
  4552.                           xdr_int, (char *)&outproc)!= 0)
  4553.                  {
  4554.                   clnt_perrno(rstat);   /* Why  callrpc() failed ? */
  4555.                   exit(1);
  4556.                  }
  4557.             ...
  4558.  
  4559.               }
  4560.  
  4561.       The callrpc() call has eight parameters: 
  4562.  
  4563.           The first is the name of the remote server machine. 
  4564.  
  4565.           The next three parameters are the program, version, and procedure 
  4566.            numbers. 
  4567.  
  4568.           The fifth and sixth parameters are an XDR filter, and an argument to 
  4569.            be encoded and passed to the remote procedure. 
  4570.  
  4571.           The final two parameters are a filter for decoding the results 
  4572.            returned by the remote procedure, and a pointer to the place where 
  4573.            the procedure's results are to be stored. 
  4574.  
  4575.       You handle multiple arguments and results by embedding them in 
  4576.       structures. The callrpc() call returns 0 if it succeeds, otherwise 
  4577.       nonzero. The exact meaning of the returned code is in the <RPC\CLNT.H> 
  4578.       header file and is an enum clnt_stat structure cast into an integer. 
  4579.  
  4580.  
  4581. ΓòÉΓòÉΓòÉ 8.7. The RPC Lowest Layer ΓòÉΓòÉΓòÉ
  4582.  
  4583. This section describes the lowest layer of RPC and when to use it. 
  4584.  
  4585. Topics 
  4586.  
  4587.       When to Use the RPC Lowest Layer 
  4588.       Server Side Program 
  4589.       Client Side Program 
  4590.  
  4591.  
  4592. ΓòÉΓòÉΓòÉ 8.7.1. When to Use the RPC Lowest Layer ΓòÉΓòÉΓòÉ
  4593.  
  4594. Use the lowest layer of RPC in the following situations: 
  4595.  
  4596.      You need to use TCP. The intermediate layer uses UDP, which restricts RPC 
  4597.       calls to 8K bytes of data.  TCP permits calls to send long streams of 
  4598.       data. 
  4599.  
  4600.      You want to allocate and free memory while serializing or deserializing 
  4601.       messages with XDR routines. No RPC call at the intermediate level 
  4602.       explicitly permits freeing memory. XDR routines are used for memory 
  4603.       allocation as well as for serializing and deserializing. 
  4604.  
  4605.      You need to perform authentication on the client side or the server side 
  4606.       by supplying credentials or verifying them. 
  4607.  
  4608.  
  4609. ΓòÉΓòÉΓòÉ 8.7.2. Server Side Program ΓòÉΓòÉΓòÉ
  4610.  
  4611. The following is an example of the lowest layer of RPC on the server side 
  4612. program: 
  4613.  
  4614. #define RMTPROGNUM   (u_long)0x3fffffffL
  4615. #define RMTPROGVER   (u_long)0x1L
  4616. #define LONGPROC   1
  4617. #define STRINGPROC 2
  4618.  
  4619. #define MAXLEN 100
  4620.  
  4621. #include <stdio.h>
  4622. #include <rpc\rpc.h>
  4623. #include <sys\socket.h>
  4624.  
  4625. main(argc, argv)
  4626. int argc;
  4627. char *argv[ ];
  4628.  
  4629. {
  4630.      int rmtprog();
  4631.      SVCXPRT *transp;
  4632.  
  4633. ...
  4634.  
  4635. /* create TCP transport handle */
  4636.      transp = svctcp_create(RPC_ANYSOCK, 1024*10, 1024*10);
  4637. /* or create UDP transport handle */
  4638. /*   transp = svcudp_create(RPC_ANYSOCK);  */
  4639.      if (transp == NULL)   /* check transport handle creation */
  4640.       {
  4641.         fprintf(stderr, "can't create an RPC server transport\n");
  4642.         exit(-1);
  4643.       }
  4644.  
  4645. /* If exists, remove the mapping of remote program and port */
  4646.      pmap_unset(RMTPROGNUM, RMTPROGVER);
  4647.  
  4648. /* register remote program (TCP transport) with local Portmapper */
  4649.      if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog,
  4650.                          IPPROTO_TCP))
  4651. /* or register remote program (UDP transport) with local Portmapper */
  4652. /*   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog,*/
  4653.                       /* IPPROTO_UDP)) */
  4654.       {
  4655.        fprintf(stderr, "can't register rmtprog() service\n");
  4656.        exit(-1);
  4657.       }
  4658.  
  4659.      svc_run();
  4660.      printf("Error:svc_run should never reaches this point \n");
  4661.      exit(1);
  4662.  
  4663. }
  4664.  
  4665. rmtprog(rqstp, transp)           /* code for remote program */
  4666. struct svc_req *rqstp;
  4667. SVCXPRT *transp;
  4668. {
  4669.    long in_long,out_long;
  4670.    char buf[100], *in_string=buf, *out_string=buf;
  4671. ...
  4672.    switch((int)rqstp->rq_proc)   /* Which procedure ? */
  4673.    {
  4674.     case NULLPROC:
  4675.          if (!svc_sendreply(transp,xdr_void, 0))
  4676.           {
  4677.            fprintf(stderr,"can't reply to RPC call\n");
  4678.            exit(-1);
  4679.           }
  4680.          return;
  4681.  
  4682.     case LONGPROC:
  4683. ...
  4684.          /* Process the request */
  4685.          if (!svc_sendreply(transp,xdr_long,&out_long))
  4686.           {
  4687.            fprintf(stderr,"can't reply to RPC call\n");
  4688.            exit(-1);
  4689.           }
  4690.          return;
  4691.  
  4692.     case STRINGPROC:   /* send received "Hello" message back */
  4693.                                  /* to client */
  4694.          svc_getargs(transp,xdr_wrapstring,(char *)&in_string);
  4695.          strcpy(out_string,in_string);
  4696.  
  4697.          /* send a reply back to a RPC client */
  4698.          if (!svc_sendreply(transp,xdr_wrapstring,
  4699.                                           (char *)&out_string))
  4700.           {
  4701.            fprintf(stderr,"can't reply to RPC call\n");
  4702.            exit(-1);
  4703.           }
  4704.          return;
  4705.     case ... :
  4706. ...
  4707.        /* Any Remote procedure in RMTPROGNUM program */
  4708. ...
  4709.     default:
  4710.        /* Requested procedure not found */
  4711.        svcerr_noproc(transp);
  4712.        return;
  4713.     }
  4714. }
  4715.  
  4716. The following steps describe the lowest layer of RPC on the server side 
  4717. program: 
  4718.  
  4719.    1. Service the transport handle. 
  4720.  
  4721.       The svctcp_create() and svcudp_create() calls create TCP and UDP 
  4722.       transport handles (SVCXPRT) respectively, used for receiving and replying 
  4723.       to RPC messages. The SVCXPRT transport handle structure is defined in the 
  4724.       <RPC\SVC.H> header file. 
  4725.  
  4726.       If the argument of the svctcp_create() call is RPC_ANYSOCK, the RPC 
  4727.       library creates a socket on which to receive and reply to remote 
  4728.       procedure calls. The svctcp_create() and clnttcp_create() calls cause the 
  4729.       RPC library calls to bind the appropriate socket, if it is not already 
  4730.       bound. 
  4731.  
  4732.       If the argument of the svctcp_create() call is not RPC_ANYSOCK, the 
  4733.       svctcp_create() call expects its argument to be a valid socket number. 
  4734.       If you specify your own socket, it can be bound or unbound.  If it is 
  4735.       bound to a port by you, the port numbers of the svctcp_create() and 
  4736.       clnttcp_create() calls must match. 
  4737.  
  4738.       If the send and receive buffer size parameter of svctcp_create() is 0, 
  4739.       the system selects a reasonable default. 
  4740.  
  4741.    2. Register the rmtprog service with Portmapper. 
  4742.  
  4743.       If the rmtprog service terminated abnormally the last time it was used, 
  4744.       the pmap_unset() call erases any trace of it before restarting. The 
  4745.       pmap_unset() call erases the entry for RMTPROGNUM from the Portmapper's 
  4746.       table. 
  4747.  
  4748.       A service can register its port number with the local Portmapper service 
  4749.       by specifying a nonzero protocol number in the svc_register() call. A 
  4750.       programmer at the client machine can determine the server port number by 
  4751.       consulting Portmapper at the server machine. You can do this 
  4752.       automatically by specifying 0 as the port number in the clntudp_create() 
  4753.       or clnttcp_create() calls. 
  4754.  
  4755.       Finally, the program and version number are associated with the rmtprog 
  4756.       procedure. The final argument to the svc_register() call is the protocol 
  4757.       being used, which in this case is IPPROTO_TCP. Register at the program 
  4758.       level, not at the procedure level. 
  4759.  
  4760.    3. Run the remote program RMTPROG. 
  4761.  
  4762.       The rmtprog service routine must call and dispatch the appropriate XDR 
  4763.       calls based on the procedure number. Unlike the registerrpc() call, which 
  4764.       performs them automatically, the rmtprog routine requires two tasks: 
  4765.  
  4766.           When the NULLPROC procedure (currently 0) returns with no results, 
  4767.            use it as a simple test for detecting whether a remote program is 
  4768.            running. 
  4769.  
  4770.           Check for incorrect procedure numbers. If you detect one, call the 
  4771.            svcerr_noproc() call to handle the error. 
  4772.  
  4773.       As an example, the procedure STRINGPROC has an argument for a character 
  4774.       string and returns the character string back to the client. The 
  4775.       svc_getargs() call takes an SVCXPRT handle, the xdr_wrapstring() call, 
  4776.       and a pointer that indicates where to place the input. 
  4777.  
  4778.       The user service (rmtprog) serializes the results and returns them to the 
  4779.       RPC caller through the svc_sendreply() call. 
  4780.  
  4781.       Parameters of the svc_sendreply() call include the: 
  4782.  
  4783.           SVCXPRT handle 
  4784.           XDR routine, which indicates return data type 
  4785.           Pointer to the data to be returned 
  4786.  
  4787.  
  4788. ΓòÉΓòÉΓòÉ 8.7.3. Client Side Program ΓòÉΓòÉΓòÉ
  4789.  
  4790. The following is an example of the lowest layer of RPC on the client side 
  4791. program: 
  4792.  
  4793. #define RMTPROGNUM  (u_long)0x3fffffffL
  4794. #define RMTPROGVER  (u_long)0x1L
  4795. #define STRINGPROC  (u_long)2
  4796.  
  4797. #include <stdio.h>
  4798. #include <rpc\rpc.h>
  4799. #include <sys\socket.h>
  4800. #include <netdb.h>
  4801.  
  4802. main(argc, argv)
  4803. int argc;
  4804. char *argv[ ];
  4805. {
  4806.    struct hostent *hp;
  4807.    struct timeval pertry_timeout, total_timeout;
  4808.    struct sockaddr_in server_addr;
  4809.    int sock = RPC_ANYSOCK;
  4810.    static char buf[100], *strc_in= "Hello", *strc_out=buf;
  4811.    char *parrc_in, *parrc_out;
  4812.    register CLIENT *clnt;
  4813.    enum clnt_stat cs;
  4814. ...
  4815.    /* get the Internet address of RPC server host */
  4816.    if ((hp = gethostbyname("RPCSERVER_HOST")) == NULL)
  4817.     {
  4818.      fprintf(stderr,"Can't get address for %s\n","RPCSERVER_HOST");
  4819.      exit (-1);
  4820.     }
  4821.  
  4822.    pertry_timeout.tv_sec = 3;
  4823.    pertry_timeout.tv_usec = 0;
  4824.  
  4825.    /* set sockaddr_in structure */
  4826.    bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr,
  4827.                               hp->h_length);
  4828.    server_addr.sin_family = AF_INET;
  4829.    server_addr.sin_port = 0;
  4830.  
  4831.    /* create clnt TCP handle */
  4832.    if ((clnt = clnttcp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  4833.                              &sock, 1024*10, 1024*10)) == NULL)
  4834.     {
  4835.      clnt_pcreateerror("clnttcp_create fail"); /* Why failed ? */
  4836.      exit(-1);
  4837.     }
  4838.  
  4839. /*
  4840.  *  create clnt UDP handle
  4841.  *  if ((clnt = clntudp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  4842.  *                             pertry_timeout, &sock)) == NULL)
  4843.  *   {
  4844.  *     clnt_pcreateerror("clntudp_create fail");
  4845.  *     exit(-1);
  4846.  *   }
  4847.  */
  4848.    total_timeout.tv_sec = 10;
  4849.    total_timeout.tv_usec = 0;
  4850. ...
  4851.  
  4852.    /*call the remote procedure STRINGPROC associated with */
  4853.    /*client handle (clnt) */
  4854.    cs=clnt_call(clnt, STRINGPROC,xdr_wrapstring,
  4855.    (char *)&strc_in[j],
  4856.                     xdr_wrapstring, (char *)&strc_out,total_timeout);
  4857.          if (cs != RPC_SUCCESS)
  4858.                printf("*Error* clnt_call fail :\n");
  4859.  
  4860.    clnt_destroy(clnt);  /* deallocate any memory associated  */
  4861.                         /* with clnt handle                  */
  4862. ...
  4863. }
  4864.  
  4865. The following steps describe the lowest layer of RPC on the client side 
  4866. program: 
  4867.  
  4868.    1. Determine the internet address of the RPC server host. 
  4869.  
  4870.       Use the gethostbyname() call to determine the internet address of the 
  4871.       host, which is running the RPC server. Initialize the socaddr_in 
  4872.       structure, found in the <NETINET\IN.H> header file. 
  4873.  
  4874.       If you are not familiar with socket calls, see Sockets General 
  4875.       Programming Information. 
  4876.  
  4877.    2. Use the client RPC handle. 
  4878.  
  4879.       The clnttcp_create() and clntudp_create() calls create TCP and UDP client 
  4880.       RPC handles (CLIENT), respectively. The CLIENT structure is defined in 
  4881.       the <RPC\CLNT.H> header file. 
  4882.  
  4883.       There are six parameters for the clnttcp_create() call: 
  4884.  
  4885.           Server address 
  4886.           Program number 
  4887.           Version number 
  4888.           Pointer to a valid socket descriptor 
  4889.           Send buffer size 
  4890.           Receive buffer size 
  4891.  
  4892.       Use the same parameters for the clntudp_create() call, except for the 
  4893.       send and receive buffer size. Instead, specify a timeout value (between 
  4894.       tries). 
  4895.  
  4896.    3. Call the remote procedure. 
  4897.  
  4898.       The low-level version of the callrpc() call is the clnt_call(), which has 
  4899.       seven parameters: 
  4900.  
  4901.           CLIENT pointer 
  4902.           Remote procedure number (STRINGPROC) 
  4903.           XDR call for serializing the argument 
  4904.           Pointer to the argument 
  4905.           XDR call for deserializing the return value from the RPC server 
  4906.           Pointer to where the return value is to be placed 
  4907.           Total time in seconds to wait for a reply 
  4908.  
  4909.       For UDP transport, the number of tries is the clnt_call() timeout divided 
  4910.       by the clntudp_create() timeout. 
  4911.  
  4912.       The return code RPC_SUCCESS indicates a successful call; otherwise, an 
  4913.       error has occurred. You find the RPC error code in the <RPC\CLNT.H> 
  4914.       header file. 
  4915.  
  4916.       The clnt_destroy() call always deallocates the space associated with the 
  4917.       client handle. If the RPC library opened the socket associated with the 
  4918.       client handle, the clnt_destroy() call closes it. If you open the socket, 
  4919.       it stays open. 
  4920.  
  4921.  
  4922. ΓòÉΓòÉΓòÉ 8.8. rpcgen Command ΓòÉΓòÉΓòÉ
  4923.  
  4924. Use the rpcgen command to generate C code to implement an RPC protocol. The 
  4925. input to RPCGEN is a language similar to C, known as RPC language. 
  4926.  
  4927. You normally use rpcgen infile to generate the following four output files. For 
  4928. example, if the infile is named PROTO.X, rpcgen generates: 
  4929.  
  4930.      A header file called PROTO.H 
  4931.      XDR routines called PROTOX.C 
  4932.      Server-side stubs called PROTOS.C 
  4933.      Client-side stubs called PROTOC.C 
  4934.  
  4935.  For more information on the rpcgen command, see the Sun Microsystems 
  4936.  publication, Networking on the Sun Workstation:  Remote Procedure Call 
  4937.  Programming Guide. 
  4938.  
  4939.  Syntax 
  4940.  
  4941.   ΓöÇrpcgenΓöÇΓöÇ infileΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4942.  
  4943.   ΓöÇrpcgenΓöÇΓöÇΓöÇΓö¼ΓöÇ -cΓöÇΓö¼ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4944.               Γö£ΓöÇ -hΓöÇΓöñ ΓööΓöÇ -o outfileΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÿ
  4945.               Γö£ΓöÇ -lΓöÇΓöñ              ΓööΓöÇ infileΓöÇΓöÿ
  4946.               ΓööΓöÇ -mΓöÇΓöÿ
  4947.  
  4948.   ΓöÇrpcgenΓöÇΓöÇΓöÇ -s transportΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4949.                              ΓööΓöÇ -o outfileΓöÇΓöÿ  ΓööΓöÇ infileΓöÇΓöÇΓöÿ
  4950.  
  4951.  Parameters 
  4952.  
  4953.  -c Compiles into XDR routines. 
  4954.  
  4955.  -h Compiles into C data definitions (a header file). 
  4956.  
  4957.  -l Compiles into client-side stubs. 
  4958.  
  4959.  -m Compiles into server-side stubs without generating a main routine. 
  4960.  
  4961.  -o outfile Specifies the name of the output file. If none is specified, 
  4962.    standard output is used for -c, -h, -l, -m, and -s modes. 
  4963.  
  4964.  infile Specifies the name of the input file written in the RPC language. 
  4965.  
  4966.  -s transport Compiles into server-side stubs, using the given transport. 
  4967.  
  4968.  
  4969. ΓòÉΓòÉΓòÉ 8.9. rpcinfo Command ΓòÉΓòÉΓòÉ
  4970.  
  4971. The rpcinfo command makes an RPC call to the RPC server and reports the status 
  4972. of the server, which is registered and operational with Portmapper. 
  4973.  
  4974. Syntax 
  4975.  
  4976. rpcinfo for a Host 
  4977.  
  4978.                   ΓöîΓöÇ local_hostΓöÇΓöÉ
  4979. ΓöÇrpcinfoΓöÇΓöÇ -pΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4980.                   ΓööΓöÇ hostΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇ > filenameΓöÇΓöÿ
  4981.  
  4982.  Using UDP to send rpcinfo for a Host 
  4983.  
  4984. ΓöÇrpcinfoΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ -u host prognumΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4985.              ΓööΓöÇ -n portnumΓöÇΓöÿ                  ΓööΓöÇ versnumΓöÇΓöÿ
  4986.  
  4987. ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4988.    ΓööΓöÇ > filenameΓöÇΓöÿ
  4989.  
  4990. Using TCP to send rpcinfo for a Host 
  4991.  
  4992. ΓöÇrpcinfoΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ -t host prognumΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4993.              ΓööΓöÇ -n portnumΓöÇΓöÿ                  ΓööΓöÇ versnumΓöÇΓöÿ
  4994.  
  4995. ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4996.    ΓööΓöÇ > filenameΓöÇΓöÿ
  4997.  
  4998. Using UDP to send rpcinfo Broadcast to Hosts 
  4999.  
  5000. ΓöÇrpcinfoΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ prognumΓöÇΓöÇ versnumΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  5001.            ΓööΓöÇ -bΓöÇΓöÿ                        ΓööΓöÇ > filenameΓöÇΓöÿ
  5002.  
  5003. Parameters 
  5004.  
  5005.  -p host 
  5006.    Queries the Portmapper about the specified host and prints a list of all 
  5007.    registered RPC programs. If the host is not specified, the system defaults 
  5008.    to the local host name. 
  5009.  
  5010.  > filename 
  5011.    Specifies a file to which the list of registered RPC programs is redirected. 
  5012.  
  5013.  -n portnum 
  5014.    Specifies the port number to be used for the -t and -u parameters. This 
  5015.    value replaces the port number that is given by the Portmapper. 
  5016.  
  5017.  -u host prognum versnum 
  5018.    Uses UDP to send an RPC call to procedure 0 of prognum and versnum on the 
  5019.    specified host, and reports whether a response is received. 
  5020.  
  5021.  -t host prognum versnum 
  5022.    Uses TCP to send an RPC call to procedure 0 of prognum and versnum on the 
  5023.    specified host and reports whether a response is received. 
  5024.  
  5025.  -b prognum versnum 
  5026.    Uses UDP to sends an RPC broadcast to procedure 0 of the specified prognum 
  5027.    and versnum and reports all hosts that respond. 
  5028.  
  5029.  The prognum argument can be either a name or a number. If you specify a 
  5030.  versnum, the rpcinfo command tries to call that version of the specified 
  5031.  program. Otherwise, it tries to find all the registered version numbers for 
  5032.  the program you specify by calling version 0; then it tries to call each 
  5033.  registered version. 
  5034.  
  5035.  The TCPIP\ETC\RPC file is associated with the rpcinfo command. This file 
  5036.  contains a list of server names and their corresponding RPC program numbers 
  5037.  and aliases. 
  5038.  
  5039.  Examples 
  5040.  
  5041.  Use the rpcinfo command as follows to display RPC services registered on the 
  5042.  local host: 
  5043.  
  5044.   rpcinfo -p
  5045.  
  5046.  Examples 
  5047.  
  5048.  Use the rpcinfo command as follows to display RPC services registered on a 
  5049.  remote host named charm: 
  5050.  
  5051.   rpcinfo -p charm
  5052.  
  5053.  Examples 
  5054.  
  5055.  Use the rpcinfo command as follows to display the status of a particular RPC 
  5056.  program on the remote host named charm: 
  5057.  
  5058.   rpcinfo -u charm 100003 2
  5059.  
  5060.  or 
  5061.  
  5062.   rpcinfo -u charm nfs 2
  5063.  
  5064.  In the previous examples, the rpcinfo command shows one of the following: 
  5065.  
  5066.   Program 100003 Version 2 ready and waiting
  5067.  
  5068.  or 
  5069.  
  5070.   Program 100003 Version 2 is not available
  5071.  
  5072.  Examples 
  5073.  
  5074.  Use the rpcinfo command as follows to display all hosts on the local network 
  5075.  that are running a certain version of a specific RPC server: 
  5076.  
  5077.   rpcinfo -b 100003 2
  5078.  
  5079.  or 
  5080.  
  5081.   rpcinfo -b nfsprog 2
  5082.  
  5083.  In these examples, the rpcinfo command lists all hosts that are running 
  5084.  Version 2 of the NFS daemon. 
  5085.  
  5086.  Note:  The version number is required for the -b parameter. 
  5087.  
  5088.  
  5089. ΓòÉΓòÉΓòÉ 8.10. The enum clnt_stat Structure ΓòÉΓòÉΓòÉ
  5090.  
  5091. The enum clnt_stat structure is defined in the <RPC\CLNT.H> file. RPCs 
  5092. frequently return enum clnt_stat information. The format of the enum clnt_stat 
  5093. structure follows: 
  5094.  
  5095. enum clnt_stat  {
  5096. RPC_SUCCESS=0,            /* call succeeded */
  5097. /*
  5098.  * local errors
  5099.  */
  5100. RPC_CANTENCODEARGS=1,     /* can't encode arguments */
  5101. RPC_CANTDECODERES=2,      /* can't decode results */
  5102. RPC_CANTSEND=3,           /* failure in sending call */
  5103. RPC_CANTRECV=4,           /* failure in receiving result */
  5104. RPC_TIMEDOUT=5,           /* call timed out */
  5105. /*
  5106.  * remote errors
  5107.  */
  5108. RPC_VERSMISMATCH=6,       /* RPC versions not compatible */
  5109. RPC_AUTHERROR=7,          /* authentication error */
  5110. RPC_PROGUNAVAIL=8,        /* program not available */
  5111. RPC_PROGVERSMISMATCH=9,   /* program version mismatched */
  5112. RPC_PROCUNAVAIL=10,       /* procedure unavailable */
  5113. RPC_CANTDECODEARGS=11,    /* decode arguments error */
  5114. RPC_SYSTEMERROR=12,       /* generic "other problem" */
  5115. /*
  5116.  * callrpc errors
  5117.  */
  5118. RPC_UNKNOWNHOST=13,       /* unknown host name */
  5119. /*
  5120.  * create errors
  5121.  */
  5122. RPC_PMAPFAILURE=14,        /* the pmapper failed in its call */
  5123. RPC_PROGNOTREGISTERED=15,  /* remote program is not registered */
  5124. /*
  5125.  * unspecified error
  5126.  */
  5127. RPC_FAILED=16
  5128.             };
  5129.  
  5130.  
  5131. ΓòÉΓòÉΓòÉ 8.11. The Remote Procedure Call Library ΓòÉΓòÉΓòÉ
  5132.  
  5133. To use the RPCs described in this section, you must have the following header 
  5134. files in your H\INCLUDE directory: 
  5135.  
  5136.  RPC Header File       What It Contains 
  5137.  
  5138.  RPC\AUTH.H            Authentication interface 
  5139.  
  5140.  RPC\AUTH_UNI.H        Protocol for UNIX-style authentication parameters for 
  5141.                        RPC 
  5142.  
  5143.  RPC\CLNT.H            Client-side remote procedure call interface 
  5144.  
  5145.  RPC\PMAP_CLN.H        Supplies C routines to get to PORTMAP services 
  5146.  
  5147.  RPC\PMAP_PRO.H        Protocol for the local binder service, or pmap 
  5148.  
  5149.  RPC\RPC.H             Includes the RPC header files necessary to do remote 
  5150.                        procedure calling 
  5151.  
  5152.  RPC\RPC_MSG.H         Message definitions 
  5153.  
  5154.  RPC\RPCNETDB.H        Data definitions for network utility calls 
  5155.  
  5156.  RPC\RPCTYPES.H        RPC additions to <TYPES.H> 
  5157.  
  5158.  RPC\SVC.H             Server-side remote procedure call interface 
  5159.  
  5160.  RPC\SVC_AUTH.H        Service side of RPC authentication 
  5161.  
  5162.  RPC\XDR.H             eXternal Data Representation serialization routines 
  5163.  
  5164.  The RPC routines are in the RPC32DLL.LIB file in the LIB directory. 
  5165.  
  5166.  Put the following statement at the beginning of any file using RPC code: 
  5167.  
  5168.   #include <rpc\rpc.h>
  5169.  
  5170.  
  5171. ΓòÉΓòÉΓòÉ 8.12. Differences between OS/2 and Sun Microsystems RPCs ΓòÉΓòÉΓòÉ
  5172.  
  5173. The IBM OS/2 RPC implementation differs from the Sun Microsystems RPC 
  5174. implementation as follows: 
  5175.  
  5176.      The global variables svc_socks[ ] and noregistered are used in place of 
  5177.       the svc_fds global variable. See svc_socks[ ] for the use of these 
  5178.       variables. 
  5179.  
  5180.      Functions that rely on file descriptor structures are not supported. 
  5181.  
  5182.      The svc_getreq() call supports the socks and noavail global variables. In 
  5183.       the Sun Microsystems implementation, the svc_getreq() call supports the 
  5184.       rdfds global variable. 
  5185.  
  5186.      TYPES.H for RPC has been renamed to RPCTYPES.H. 
  5187.  
  5188.  
  5189. ΓòÉΓòÉΓòÉ 8.13. Compiling an RPC API Application ΓòÉΓòÉΓòÉ
  5190.  
  5191. Follow these steps to compile and link the RPC API application using an IBM 
  5192. 32-bit compiler for OS/2: 
  5193.  
  5194.    1. To compile your program, enter: 
  5195.  
  5196.             icc /C myprog.c
  5197.  
  5198.    2. To create an executable program, you can enter: 
  5199.  
  5200.       For VisualAge C++ 
  5201.  
  5202.             ilink /NOFREEFORMAT myprog,myprog.exe,NULL, rpc32dll.lib
  5203.  
  5204.  Notes: 
  5205.  
  5206.    1. The RPC API is not re-entrant.  If you are using a multithreaded program, 
  5207.       you must serialize the access to the APIs. 
  5208.  
  5209.    2. For more information about the compile and link options, and dynamic link 
  5210.       libraries, see the User's Guide provided with your compiler. 
  5211.  
  5212.  
  5213. ΓòÉΓòÉΓòÉ 9. File Transfer Protocol ΓòÉΓòÉΓòÉ
  5214.  
  5215. The File Transfer Protocol (FTP) API allows applications to have a client 
  5216. interface for file transfer. Applications written to this interface can 
  5217. communicate with multiple FTP servers at the same time. The interface supports 
  5218. a maximum of 256 simultaneous connections and enables third-party proxy 
  5219. transfers between pairs of FTP servers. Consecutive third-party transfers are 
  5220. allowed between any sequence of pairs of FTP servers. 
  5221.  
  5222. The FTP API tracks the servers to which an application is currently connected. 
  5223. When a new request for FTP service is requested, the API checks whether a 
  5224. connection to the server exists and establishes one if it does not exist.  If 
  5225. the server has dropped the connection since last use, the API re-establishes 
  5226. it. 
  5227.  
  5228. Note:  The FTP API is not re-entrant. If you are using a multithreaded program, 
  5229.        you must serialize the access to the APIs. For example, without 
  5230.        serialization, the program may fail if it has two threads running 
  5231.        concurrently and each thread has its own connection to a server. 
  5232.  
  5233.  Topics 
  5234.  
  5235.       FTP API Call Library 
  5236.       Compiling and Linking an FTP API Application 
  5237.  
  5238.  
  5239. ΓòÉΓòÉΓòÉ 9.1. FTP API Call Library ΓòÉΓòÉΓòÉ
  5240.  
  5241. To use the FTP API, you must have the <FTPAPI.H> header file in your 
  5242. TCPIP\INCLUDE directory. The FTP API routines are in the FTPAPI.LIB file in the 
  5243. LIB directory. 
  5244.  
  5245. Put the following statement at the top of any file using FTP API code: 
  5246.  
  5247. #include <ftpapi.h>
  5248.  
  5249.  
  5250. ΓòÉΓòÉΓòÉ 9.2. Compiling and Linking an FTP API Application ΓòÉΓòÉΓòÉ
  5251.  
  5252. Follow these steps to compile and link the FTP API application using an IBM 
  5253. 32-bit compiler for OS/2: 
  5254.  
  5255.    1. To compile your program, enter: 
  5256.  
  5257.             icc /C myprog.c
  5258.  
  5259.    2. To create an executable program, you can enter: 
  5260.  
  5261.       For VisualAge C++ 
  5262.  
  5263.             ilink /NOFREEFORMAT myprog,myprog.exe,NULL,
  5264.             ftpapi.lib
  5265.  
  5266.  Notes: 
  5267.  
  5268.    1. The FTP API is not re-entrant.  If you are using a multithreaded program, 
  5269.       you must serialize the access to the APIs. 
  5270.  
  5271.    2. For more information about the compile and link options, and dynamic link 
  5272.       libraries, see the User's Guide provided with your compiler. 
  5273.  
  5274.    3. The FTP API can connect to an FTP server using a specific port rather 
  5275.       than the well-known port. Code the port number as part of the host name 
  5276.       specification, such as ftpget ("server1 1234", ...) to connect to server1 
  5277.       by port 1234. 
  5278.  
  5279.  
  5280. ΓòÉΓòÉΓòÉ 10. Resource ReSerVation Protocol ΓòÉΓòÉΓòÉ
  5281.  
  5282. The sender and receiver of a data stream use the RSVP (Resource ReSerVation 
  5283. Protocol) to ensure that some quality of service can be reserved on the 
  5284. network.  This is in contrast to the usual "best effort" service that is 
  5285. provided, where packets are handled "first come first served." 
  5286.  
  5287. This section describes the resource reservation protocol implemented in TCP/IP 
  5288. for OS/2. 
  5289.  
  5290. Topics 
  5291.  
  5292.       RSVP Introduction 
  5293.       Consequences of Partial RSVP Deployment on a Network 
  5294.       Using the RSVP API 
  5295.       Reservation Styles 
  5296.       Tspecs and Flowspecs 
  5297.       Adspecs 
  5298.       Controlled Load Reservations 
  5299.       Guaranteed Reservations 
  5300.  
  5301.  
  5302. ΓòÉΓòÉΓòÉ 10.1. RSVP Introduction ΓòÉΓòÉΓòÉ
  5303.  
  5304. RSVP is a Quality of Service (QoS) setup protocol. Quality of Service is a set 
  5305. of communication characteristics required by an application. RSVP does not send 
  5306. or receive data.  Other protocols do the actual transmitting and receiving of 
  5307. data.  A 5-tuple (protocol, destination address, destination port, sender 
  5308. address, sender port) defines the data flow for a QoS. RSVP sets up QoS for 
  5309. flow in a single direction.  If two programs will be both sending and receiving 
  5310. and need QoS for each direction, QoS for each flow must be reserved 
  5311. independently.  Initial implementations of RSVP have been mainly concerned with 
  5312. UDP unicast or UDP multicast, or other IP protocols, such as TCP. 
  5313.  
  5314. The RSVPD.EXE daemon implements the RSVP protocol. Applications use an API 
  5315. interface (LIBRSVP.DLL) to communicate with the daemon. The associated toolkit 
  5316. contains a header file (RSVPRAPI.H) and the library stub for the DLL 
  5317. (LIBRSVP.LIB). 
  5318.  
  5319. The sender initiates a session and causes RSVP path messages to go to the 
  5320. receiver.  The path messages indicate what flow the sender is willing to send. 
  5321. RSVP daemons between the sender and receiver can also add information about 
  5322. what flows they can support.  A reservation is set up when the  receiver sends 
  5323. a reservation to the sender of a path message.  The receiver can ask for 
  5324. confirmation that the reservation was set up. 
  5325.  
  5326. Once a flow is established, the daemons along that flow maintain it 
  5327. automatically by periodically resending path packets from the sender daemon and 
  5328. resending reservation packets in the reverse direction from the receiver's 
  5329. daemon. 
  5330.  
  5331. There are two types of QoS specification: a controlled load flowspec and a 
  5332. guaranteed flowspec. 
  5333.  
  5334. Generally, requesting a Quality of Service means at least that a specific 
  5335. bandwidth (number of bytes per second) is requested.  There are five parameters 
  5336. in a controlled load flowspec.  There are implications in these parameters 
  5337. about how much the packets can get "bunched up."  For example, if you send a 
  5338. 100K burst of packets once every two seconds, the average data rate is 50K per 
  5339. second.  This data flow could be unacceptable, because the sender or receiver 
  5340. (or intervening routers) might only be able to handle 10K bursts every 0.2 
  5341. seconds, for a much more even flow of data.  In the part of the TCP/IP stack 
  5342. that performs QoS processing on the local machine, setting up for a particular 
  5343. reservation usually involves at least two major actions: 
  5344.  
  5345.      prioritizing packets as they wait to leave the machine onto the network 
  5346.       (or to applications running on the machine) 
  5347.  
  5348.      preallocation of buffers so that space resources will be adequate for the 
  5349.       QoS. 
  5350.  
  5351.  Some applications, like audio data for a conversation, where excessive delay 
  5352.  can easily become intolerable, require packets to be delivered within a 
  5353.  specified time. Such applications should use the guaranteed flowspec. Besides 
  5354.  the five parameters of the controlled load flowspec, two other parameters, 
  5355.  guaranteed rate and slack term, specify the delay through the network. 
  5356.  
  5357.  
  5358. ΓòÉΓòÉΓòÉ 10.2. Consequences of Partial RSVP Deployment on a Network ΓòÉΓòÉΓòÉ
  5359.  
  5360. RSVP works in a network where not every node along a data flow path has RSVP 
  5361. implemented.  The QoS of transmission through sections of the network can be 
  5362. unpredictable where RSVP is not implemented.  The setup process will still be 
  5363. done where the flow passes through RSVP-capable nodes. 
  5364.  
  5365.  
  5366. ΓòÉΓòÉΓòÉ 10.3. Using the RSVP API ΓòÉΓòÉΓòÉ
  5367.  
  5368. This section outlines typical sender and receiver scenarios for using the RSVP 
  5369. API calls. 
  5370.  
  5371. An RSVP sender session might have these steps: 
  5372.  
  5373.    1. Determine the sender and destination addresses and ports. 
  5374.  
  5375.    2. Start a session with rapi_session(), and provide it with the name of your 
  5376.       callback function. 
  5377.  
  5378.    3. Call rapi_getfd() to obtain an alert socket. 
  5379.  
  5380.    4. Call rapi_sender() to establish the program as a sender. 
  5381.  
  5382.    5. Call select() to wait for a read on the alert socket. 
  5383.  
  5384.    6. When data is ready to be read on the alert socket, call rapi_dispatch() 
  5385.       to read it. 
  5386.  
  5387.    7. Your callback routine is called as needed by rapi_dispatch(). 
  5388.  
  5389.    8. When your callback sees a reservation message from a receiver, go to the 
  5390.       next step, otherwise go back to step 5. 
  5391.  
  5392.    9. Process the flowspec information to determine packet size, and so on, and 
  5393.       start sending data on a data socket. 
  5394.  
  5395.   10. The select() call on the alert socket should continue to be used to watch 
  5396.       for asynchronous error conditions. 
  5397.  
  5398.   11. When you are finished sending the data, call rapi_release() to end the 
  5399.       RSVP session. 
  5400.  
  5401.  An RSVP receiver session might have these steps: 
  5402.  
  5403.    1. Determine the sender and destination addresses and ports, and if the 
  5404.       destination is a multicast group, join it. 
  5405.  
  5406.    2. Call rapi_session() to start a session, and provide it with your callback 
  5407.       function. 
  5408.  
  5409.    3. Call rapi_getfd() to get the alert socket. 
  5410.  
  5411.    4. Use select() to wait for a read on the alert socket. 
  5412.  
  5413.    5. When data is ready to be read on the alert socket, call rapi_dispatch() 
  5414.       to read it. 
  5415.  
  5416.    6. Call rapi_dispatch() as needed to call your callback routine. 
  5417.  
  5418.    7. When your callback sees a path message from a sender, go to the next 
  5419.       step, otherwise go back to step 4. 
  5420.  
  5421.    8. Process the adspec information in the path message to determine what the 
  5422.       reservation should be, and call rapi_reserve() to let the sender(s) see 
  5423.       reservation messages. 
  5424.  
  5425.    9. Call select() to begin listening for the data stream on a data socket. 
  5426.       Continue to call select() on the alert socket as well, to watch for 
  5427.       asynchronous error conditions. 
  5428.  
  5429.   10. When you are finished receiving the data, use rapi_release() to end the 
  5430.       RSVP session. 
  5431.  
  5432.  Topics 
  5433.  
  5434.       Determining Addresses and Ports 
  5435.       Starting a Session 
  5436.       Getting an Alert Socket 
  5437.       Establishing the Program as a Sender 
  5438.       Using Select() with the Alert Socket 
  5439.       Callback Function Example 
  5440.       Making a QoS Reservation 
  5441.       Receiving a Reservation Message 
  5442.       Watching for Asynchronous RSVP Events 
  5443.       Closing the RSVP Session 
  5444.  
  5445.  
  5446. ΓòÉΓòÉΓòÉ 10.3.1. Determining Addresses and Ports ΓòÉΓòÉΓòÉ
  5447.  
  5448. The destination address and port are a specific IP address and port if the data 
  5449. flow is unicast.  If the data flow is by way of a multicast group, the 
  5450. destination address and port are for a multicast group.  Generally, address and 
  5451. port determination depends upon the protocol to be used to send and receive the 
  5452. data stream. 
  5453.  
  5454. If the data flow is for the TCP protocol, the usual listen() - connect() - 
  5455. accept() sequence can be done by server and client.  Then the IP address and 
  5456. port for each end of the connection are available using the getsockname() and 
  5457. getpeername() calls. 
  5458.  
  5459. If the data flow is for UDP unicast or multicast, agreement about IP addresses 
  5460. and ports may have to be done externally to the RSVP protocol or the UDP 
  5461. protocol.  This would depend upon the application.  For example, it might be 
  5462. necessary ahead of time to agree upon a multicast address and port to use for a 
  5463. video broadcast. 
  5464.  
  5465. When joining a multicast group as a receiver, it is possible to see path 
  5466. messages to that group which are coming from senders.  Then a receiver can make 
  5467. reservations for data flows from the senders.  A path message includes the IP 
  5468. address and port of the sender. 
  5469.  
  5470. RSVP is designed to use a variety of network address types. Thus the API uses 
  5471. the more general sockaddr structure. To operate with Internet Protocol 
  5472. addresses,  the sockaddr structure must be cast to sockaddr_in. 
  5473.  
  5474.  
  5475. ΓòÉΓòÉΓòÉ 10.3.2. Starting a Session ΓòÉΓòÉΓòÉ
  5476.  
  5477. The sender and receiver start sessions in the same way, by issuing a 
  5478. rapi_session() call.  This call requires a sockaddr structure, which defines a 
  5479. destination address and port, a protocol number, an optional callback function 
  5480. that you provide, and some other parameters. If the session is multicast, then 
  5481. the address is for a multicast group to which the senders send data.  The port 
  5482. can be considered an extension of the multicast address.  The address and port 
  5483. must agree for all users of that multicast group.  The rapi_session() call 
  5484. returns a session ID that is used in subsequent calls to the RSVP API. 
  5485.  
  5486. This example assumes that the destination is a multicast group. 
  5487.  
  5488.  
  5489. #include
  5490.     int retcode;
  5491.     rapi_sid_t sessID;          /* RSVP session ID */
  5492.     int proto = IPPROTO_UDP;    /* protocol (UDP) */
  5493.     struct sockaddr_in mulAddr; /* multicast address, port, protocol */
  5494.     int alertSoc;               /* alert socket for asynchronous events */
  5495.     int ttl;                    /* multicast time to live value */
  5496.  
  5497.     mulAddr.sin_family = AF_INET;
  5498.     mulAddr.sin_addr.s_addr = inet_addr("224.1.1.1");
  5499.     mulAddr.sin_port = htons(1201);
  5500.  
  5501.     /* Do multicast group setup at this point. Code omitted here. */
  5502.  
  5503.     sessID = rapi_session((struct sockaddr *)&mulAddr, proto, 0, callback,
  5504.                           NULL, &retcode);
  5505.     if (! sessID)
  5506.         {
  5507.         printf("Session did not start! rapi_session() error code %d\n",
  5508.                retcode);
  5509.         exit(1);
  5510.         }
  5511.     else
  5512.         {
  5513.         alertSoc = rapi_getfd(sessID);
  5514.         printf("Session %d started, alert socket is %d\n",
  5515.                sessID, alertSoc);
  5516.         }
  5517.     if (alertSoc <= 0)
  5518.         {
  5519.         printf("Error, rapi_getfd() could not provide an alert socket!\n");
  5520.         exit(1);
  5521.         }
  5522.  
  5523.  
  5524. ΓòÉΓòÉΓòÉ 10.3.3. Getting an Alert Socket ΓòÉΓòÉΓòÉ
  5525.  
  5526. The sender and receiver both would issue a rapi_getfd() call at this point. The 
  5527. call returns an alert socket.  The socket is used to send data to the RSVP API. 
  5528. The program should issue a select() call on the socket as a read socket in 
  5529. order to know when asynchronous events are available. The program should not 
  5530. read the socket. 
  5531.  
  5532. If the program is going to receive data, this is a good point to use select() 
  5533. to wait for path messages that indicate that one or more senders are available. 
  5534. There is an example of this in a later section. 
  5535.  
  5536. If the program is going to send data, this is a good time to tell the RSVP API 
  5537. that the program will be a sender. 
  5538.  
  5539.  
  5540. ΓòÉΓòÉΓòÉ 10.3.4. Establishing the Program as a Sender ΓòÉΓòÉΓòÉ
  5541.  
  5542. The rapi_sender() call tells RSVP that the program will be a sender.  This call 
  5543. establishes the sender address and port for the data flow, and it specifies the 
  5544. characteristics of the data stream in RSVP terms, with a tspec (transmission 
  5545. specification).  This information will go to the destination in an RSVP path 
  5546. message.  The RSVP API will take care of repeating the message as needed 
  5547. according to the RSVP protocol. 
  5548.  
  5549. This example shows the use of rapi_sender(): 
  5550.  
  5551. int retcode;
  5552.     struct sockaddr_in senderAddr; /* sender address, port, protocol */
  5553.     rapi_tspec_t sndTSpec;
  5554.  
  5555.     /* set up senderAddr and sndTSpec */
  5556.  
  5557.     senderAddr.sin_family = AF_INET;
  5558.     senderAddr.sin_addr.s_addr = inet_addr("129.5.24.1");
  5559.     senderAddr.sin_port = htons(1024);
  5560.  
  5561.  
  5562. /* set the object size and form in the object header */
  5563. sndTSpec.len = sizeof(sndTSpec);
  5564. sndTSpec.form = RAPI_FORMAT_IS_GEN;
  5565. /* fill in the body of the Tspec object */
  5566.     sndTSpec.tspec_r = 100000;
  5567.     sndTSpec.tspec_b = 2600;
  5568.     sndTSpec.tspec_p = 100000;
  5569.     sndTSpec.tspec_m = 1300;
  5570.     sndTSpec.tspec_M = 1300;
  5571.  
  5572.     retcode = rapi_sender(
  5573.             sessID,           /* Session ID                              */
  5574.             0,                /* Flags - not defined                     */
  5575.             (struct sockaddr *)&senderAddr,
  5576.                               /* Local host: (Src addr, port), net order */
  5577.             NULL,             /* Sender template - not supported         */
  5578.             &sndTSpec,        /* Sender tspec                            */
  5579.             NULL,             /* Sender adspec - not supported           */
  5580.             NULL,             /* Sender policy data - not supported      */
  5581.             ttl               /* TTL of multicast session (if multicast) */
  5582.             );
  5583.     if (retcode)
  5584.         printf("rapi_sender() error %d\n", retcode);
  5585.  
  5586.  
  5587. ΓòÉΓòÉΓòÉ 10.3.5. Using Select() with the Alert Socket ΓòÉΓòÉΓòÉ
  5588.  
  5589. The alert socket is used to communicate messages from the RSVP daemon to the 
  5590. API.  These messages generally turn into events for the program. The select() 
  5591. call is used to wait for read data on the alert socket.  Once there is read 
  5592. data available, the program must call rapi_dispatch() so that the RSVP API can 
  5593. read the data and handle it properly.  Typically, rapi_dispatch() will, in 
  5594. turn, call your callback function, possibly more than once. 
  5595.  
  5596. In the <RSVPRAPI.H> header file, the data type rapi_event_rtn_t is declared to 
  5597. be a pointer to a callback function.  The arguments of the function are also 
  5598. declared there, so that you can see how to declare your callback function 
  5599. arguments. 
  5600.  
  5601. This example shows a loop with a select() call waiting on the alert socket 
  5602. until a path message is received and handled by a callback function: 
  5603.  
  5604. fd_set readSockets;
  5605.     int rc, rapi_rc;
  5606.     int receivedPathEvent = 0; /* set to 1 by the callback routine */
  5607.  
  5608.     while (! receivedPathEvent)
  5609.         {
  5610.         FD_ZERO(&readSockets);
  5611.         FD_SET(alertSoc, &readSockets);
  5612.         if ((rc = select(FD_SETSIZE, &readSockets, NULL, NULL, &timeout)) < 0)
  5613.             {
  5614.             psock_errno("select() on alert socket");
  5615.             exit(1);
  5616.             }
  5617.         if (rc > 0 && FD_ISSET(alertSoc, &readSockets))
  5618.             {
  5619.             rapi_rc = rapi_dispatch();
  5620.             if (rapi_rc == RAPI_ERR_NORSVP)
  5621.                 {
  5622.                 printf("Warning! RSVP has gone away.\n");
  5623.                 exit(1);
  5624.                 }
  5625.             }
  5626.         } /* end while */
  5627.  
  5628. Waiting for a reservation message would be handled similarly. 
  5629.  
  5630.  
  5631. ΓòÉΓòÉΓòÉ 10.3.6. Callback Function Example ΓòÉΓòÉΓòÉ
  5632.  
  5633. This example mainly shows the code that works with the previous example, which 
  5634. looks for a path message.  This example also prints all the event information, 
  5635. using the format routines of the RSVP API where appropriate: 
  5636.  
  5637. struct sockaddr_in sndAddr; /* remember the sender IP addr:port here */
  5638.  
  5639.     int _System callback(
  5640.         rapi_sid_t         sid,          /* Which sid generated event    */
  5641.         rapi_eventinfo_t   eventType,    /* Event type                   */
  5642.         rapi_styleid_t     styleID,      /* Style ID                     */
  5643.         int                errorCode,    /* Error code                   */
  5644.         int                errorValue,   /* Error value                  */
  5645.         struct sockaddr   *pNodeAddr,    /* Error node address           */
  5646.         u_char             errorFlags,   /* Error flags                  */
  5647.         int                nFilterSpecs, /* Number of filterspecs/sender*/
  5648.                                          /*      templates in list       */
  5649.         rapi_filter_t     *pFilterSpec,  /* Filterspec/sender templ list*/
  5650.         int                nFlowSpecs,   /* Number of flowspecs/Tspecs   */
  5651.         rapi_flowspec_t   *pFlowSpec,    /* Flowspec/tspec list          */
  5652.         int                nAdSpecs,     /* Number of adspecs            */
  5653.         rapi_adspec_t     *pAdSpec,      /* Adspec list                  */
  5654.         void *             pClientArg    /* Client supplied arg          */
  5655.         )
  5656.     {
  5657.     int i;
  5658.     #define FMT_BUF_SIZE 600
  5659.     char buf[FMT_BUF_SIZE];
  5660.     printf("callback() sid %d, eventType %d, styleID %d\n",
  5661.            sid, eventType, styleID);
  5662.  
  5663.     /* if we received the path event then tell the select loop */
  5664.     if (eventType == RAPI_PATH_EVENT)
  5665.         {
  5666.         receivedPathEvent = 1;
  5667.         /* get the sender address from pFilterSpec */
  5668.         if (nFilterSpec && (pFilterSpec->form == RAPI_FILTERFORM_BASE))
  5669.            sndAddr = pFilterSpec->filter.base.sender;
  5670.         /* else it is another address form... */
  5671.         }
  5672.  
  5673.  
  5674. In a realistic program, the adspec information would be processed to determine 
  5675. what services are supported by network elements that support RSVP. Information 
  5676. on data rate, bandwidth, packet MTU, and so on, normally would be available.  A 
  5677. receiver would determine what reservation flowspec would be suitable for the 
  5678. data stream that the sender could send. 
  5679.  
  5680. If a reservation event is being processed by a sender, the adspec information 
  5681. normally would provide the upper limit on packet size, and other useful 
  5682. information, and the sender could adjust its data flow accordingly. 
  5683.  
  5684. To print all the event information: 
  5685.  
  5686.     if (errorCode == RAPI_ERR_OK)
  5687.         printf("errorCode %d\n", errorCode);
  5688.     else
  5689.         printf("errorCode %d, errorValue %d, nodeAddr %s:%d, errorFlags %d\n",
  5690.                errorCode, errorValue,
  5691.                inet_ntoa(((struct sockaddr_in*)pNodeAddr->sin_addr),
  5692.                ((struct sockaddr_in*)pNodeAddr->sin_port, errorFlags);
  5693.     if (nFilterSpecs)
  5694.         for (i = 0; i < nFilterSpecs; ++i)
  5695.             {
  5696.             rapi_fmt_filtspec(pFilterSpec + i, buf, FMT_BUF_SIZE);
  5697.             printf("filterspec %d, %s\n", i, buf);
  5698.             }
  5699.     else
  5700.         printf("No filter specs\n");
  5701.     if (nFlowSpecs)
  5702.         for (i = 0; i < nFlowSpecs; ++i)
  5703.             {
  5704.             rapi_fmt_flowspec(pFlowSpec + i, buf, FMT_BUF_SIZE);
  5705.             printf("flowspec %d, %s\n", i, buf);
  5706.             }
  5707.     else
  5708.         printf("No flowspecs\n");
  5709.     if (nAdSpecs)
  5710.         for (i = 0; i < nAdSpecs; ++i)
  5711.             {
  5712.             rapi_fmt_adspec(pAdSpec + i, buf, FMT_BUF_SIZE);
  5713.             printf("adspec %d, %s\n", i, buf);
  5714.             }
  5715.     else
  5716.         printf("No adspecs\n");
  5717.     /* the function must return a value, but the API does nothing to it */
  5718.     return 0;
  5719.     } /* end callback */
  5720.  
  5721.  
  5722. ΓòÉΓòÉΓòÉ 10.3.7. Making a QoS Reservation ΓòÉΓòÉΓòÉ
  5723.  
  5724. The rapi_reserve() call is used by the receiver to make a reservation or change 
  5725. a reservation.  The call specifies a reservation style, filterspecs (data 
  5726. senders), and flowspecs (QoS specifications). 
  5727.  
  5728. This example shows how a receiver makes or changes a reservation: 
  5729.  
  5730. #define MAX_RSVP_SENDERS 10
  5731.     int retcode;
  5732.     rapi_styleid_t rapiStyle = RAPI_RSTYLE_FIXED; /* fixed reservation */
  5733.     int filterSpecCount;
  5734.     rapi_filter_t filterSpec[MAX_RSVP_SENDERS];
  5735.     int flowSpecCount;
  5736.     rapi_flowspec_t flowSpec[MAX_RSVP_SENDERS];
  5737.  
  5738.     filterSpecCount = 1;   /* one specified sender this time */
  5739.     /* set the object size and form in the object header */
  5740.     filterSpec[0].len = sizeof(rapi_hdr_t) + sizeof(rapi_filter_base_t);
  5741.     filterSpec[0].form = RAPI_FILTERFORM_BASE;
  5742.     /* fill in the body of the filterspec object */
  5743.     filterSpec[0].filter.base.sender = sndAddr; /* copied from path event */
  5744.  
  5745.     flowSpecCount = 1;     /* one flowspec this time */
  5746.     /* set the object size and form in the object header */
  5747.     flowSpec[0].len = sizeof(rapi_hdr_t) + sizeof(CL_flowspec_t);
  5748.     flowSpec[0].form = RAPI_FORMAT_IS_CL;
  5749.     /* fill in the body of the flowspec object */
  5750.     flowSpec[0].cl_tspec_r = 100000;
  5751.     flowSpec[0].cl_tspec_b = 2600;
  5752.     flowSpec[0].cl_tspec_p = 100000;
  5753.     flowSpec[0].cl_tspec_m = 1300;
  5754.     flowSpec[0].cl_tspec_M = 1300;
  5755.  
  5756.     retcode = rapi_reserve(
  5757.             sessID,  /* session id */
  5758.             RAPI_REQ_CONFIRM,    /* flags */
  5759.             NULL,    /* rcv host addr (optional, sessID has destination) */
  5760.             rapiStyle,    /* style ID */
  5761.             NULL,    /* style extension, not supported */
  5762.             NULL,    /* receiver policy, not supported */
  5763.             filterSpecCount,
  5764.             filterSpec,   /* array of filterspecs */
  5765.             flowSpecCount,
  5766.             flowSpec      /* array of flowspecs */
  5767.             );
  5768.     if (retcode)
  5769.         printf("rapi_reserve() error %d\n", retcode);
  5770.  
  5771. The rapi_reserve() call above has the optional RAPI_REQ_CONFIRM flag, that asks 
  5772. for a confirmation message to be sent if the reservation is made. Such an event 
  5773. indicates that the reservation had a very high probability of succeeding. 
  5774.  
  5775. After making the reservation, the receiver should start listening for the data 
  5776. stream on a data socket. 
  5777.  
  5778.  
  5779. ΓòÉΓòÉΓòÉ 10.3.8. Receiving a Reservation Message ΓòÉΓòÉΓòÉ
  5780.  
  5781. After a sender's callback function receives a reservation message, the sender 
  5782. can start sending data to the destination.  The RSVP data flow has been set up 
  5783. with the reserved Quality of Service. 
  5784.  
  5785. Start listening for the data stream on a data socket. 
  5786.  
  5787.  
  5788. ΓòÉΓòÉΓòÉ 10.3.9. Watching for Asynchronous RSVP Events ΓòÉΓòÉΓòÉ
  5789.  
  5790. Both a sender and a receiver should continue to use a select() call on the 
  5791. alert socket to watch for asynchronous error conditions.  The select() call can 
  5792. be in separate thread, or it can be a select() call that is used in sending or 
  5793. receiving the data stream. 
  5794.  
  5795.  
  5796. ΓòÉΓòÉΓòÉ 10.3.10. Closing the RSVP Session ΓòÉΓòÉΓòÉ
  5797.  
  5798. Use the rapi_release() call to close an RSVP session.  When the program ends, 
  5799. the RSVP API will also close any sessions that the program has open. 
  5800.  
  5801.  
  5802. ΓòÉΓòÉΓòÉ 10.4. Reservation Styles ΓòÉΓòÉΓòÉ
  5803.  
  5804. Bandwidth reservation relates to the way the bandwidth is to be allocated (the 
  5805. reservation type), and the technique used to select senders (the sender 
  5806. selection). The reservation type may be distinct for individual data flows, or 
  5807. may be shared among multiple data flows. The selection of the senders may be 
  5808. explicit (meaning that individual senders are identified individually), or it 
  5809. may be a wildcard selection that implicitly selects all the senders to a 
  5810. session.  This table shows the reservation styles that are defined for the 
  5811. various Sender Selection-Reservation Type combinations: 
  5812.  
  5813. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5814. ΓöéSender Selection      Reservation Type      Reservation Style    Γöé
  5815. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5816. Γöéexplicit              distinct              Fixed-Filter (FF)    Γöé
  5817. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5818. Γöéexplicit              shared                Shared-Explicit (SE) Γöé
  5819. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5820. Γöéwildcard              distinct              (none defined)       Γöé
  5821. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5822. Γöéwildcard              shared                Wildcard-Filter (WF) Γöé
  5823. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5824.  
  5825. The fixed filter (FF) style specifies a distinct flow for each sender. The 
  5826. bandwidth reservations are made separately for each flow.  Parameters in the 
  5827. reservation specify each sender explicitly. 
  5828.  
  5829. With the shared explicit (SE) style, each of the senders is specified 
  5830. explicitly in the reservation message, but the reserved bandwidth is shared by 
  5831. all the senders wherever they can be merged upstream from the receiver. 
  5832.  
  5833. The wildcard filter (WF) style specifies a single reservation of bandwidth 
  5834. which is to be shared by all the senders.  This type of reservation is 
  5835. propagated upstream to all senders as they become senders in the RSVP session. 
  5836. Besides there being a single bandwidth reservation for all the senders to the 
  5837. receiver that makes the reservation, the other receivers in the same multicast 
  5838. group will have their bandwidth reservations merged as well.  The "largest" 
  5839. such reservation for the session at any point in the multicast tree determines 
  5840. how much bandwidth is reserved at that point in the tree. 
  5841.  
  5842. The wildcard and shared explicit styles are primarily useful for multicast 
  5843. applications where the data sources are unlikely to transmit simultaneously. 
  5844.  
  5845.  
  5846. ΓòÉΓòÉΓòÉ 10.5. Tspecs and Flowspecs ΓòÉΓòÉΓòÉ
  5847.  
  5848. The sender tspec contains a structure with five fields that define the flow. 
  5849. The two receiver flowspecs also contain this structure. 
  5850.  
  5851.     typedef struct {
  5852.        float32_t  IS_Tspec_r; /* Token bucket rate (IP packet bytes/sec) */
  5853.        float32_t  IS_Tspec_b; /* Token bucket depth (bytes) */
  5854.        float32_t  IS_Tspec_p; /* Peak data rate (IP packet bytes/sec) */
  5855.        u_int32_t  IS_Tspec_m; /* Min Policed Unit (bytes) */
  5856.        u_int32_t  IS_Tspec_M; /* Max packet size (bytes) */
  5857.     }   IS_Tspec_t;
  5858.  
  5859. The token bucket rate (r) is in bytes of IP datagrams per second.  That is, the 
  5860. packets must include the IP packet header (20 bytes) and either the UDP header 
  5861. (8 bytes) or the TCP header (20 bytes), as well as the data in the packet, when 
  5862. computing packet sizes.  The valid value of r may range from 1 byte per second 
  5863. to 40 terabytes per second.  The bucket depth (b) may range from 1 byte to 250 
  5864. gigabytes. 
  5865.  
  5866. The maximum packet size (M) should be no bigger than the maximum transmission 
  5867. unit (MTU) of the path between sender and receiver. The value of m must be no 
  5868. bigger than M. 
  5869.  
  5870. In a tspec the sender indicates, for any arbitrary time period of T seconds, 
  5871. that the amount of data sent in that period will not be greater than r*T+b. 
  5872. When computing this, any packet that is less than the minimum policed unit (m) 
  5873. in size should be counted as m bytes. 
  5874.  
  5875. The token bucket model is a way of viewing the transmission of data. The sender 
  5876. has a stream of data that comes from some source, and the sender expects to 
  5877. send it using RSVP.  The sender may need to send at a specified rate dictated 
  5878. by the data stream source, for example an audio or video data stream.  The 
  5879. receiver may need to output the data in a timely fashion after receiving it as 
  5880. well.  The token bucket rate is the rate at which the sender will send. 
  5881. Imagine bytes (tokens) filling the token bucket.  When enough accumulate so 
  5882. that the above formula is not violated, a packet is built and sent.  The bucket 
  5883. is reduced by the amount that was sent. 
  5884.  
  5885. The peak data rate (p) is mainly used in guaranteed flowspecs. It can be set 
  5886. the same as r, for controlled load flowspecs.  In guaranteed flowspecs, it is 
  5887. required that for any time period T, that the amount of data sent in that 
  5888. period cannot exceed M+p*T. 
  5889.  
  5890. A Guaranteed flowspec has a tspec and an rspec. An rspec is shown below. 
  5891.  
  5892.     typedef struct {
  5893.        float32_t  Guar_Rspec_R; /* Guaranteed Rate (IP packet bytes/sec) */
  5894.        u_int32_t  Guar_Rspec_S; /* Slack term (microseconds) */
  5895.     }   Guar_Rspec_t;
  5896.  
  5897. The guaranteed rate (R) and slack term (S) are computed by the receiver based 
  5898. upon the values in the adspec in the path message.  They are explained in a 
  5899. later section. 
  5900.  
  5901. A sender and receiver in an RSVP session negotiate reasonable values of packet 
  5902. size, and so forth, by using information in the path and reservation messages. 
  5903. Typically, a sender specifies the largest packet it is willing to send.  This 
  5904. value will be in the path message tspec.  When the path message is seen by a 
  5905. receiver, the packet size (in the adspec) will be the maximum that can be 
  5906. handled by all the RSVP-enabled nodes that the message passed through. (If one 
  5907. or more nodes was not RSVP-enabled, then that fact is also indicated in the 
  5908. adspec.  In that case, the reservation that is made should be considered 
  5909. unreliable.) Once the receiver makes a reservation, if the reservation is 
  5910. subsequently merged with other reservations then a similar process can happen 
  5911. as the reservation message goes toward the sender.  Thus the sender can see 
  5912. what the maximum packet size should be for the packets to be sent reliably to 
  5913. all receivers.  If a packet is larger than that size, it will be sent by "best 
  5914. effort" technique rather than according to the reservation that was made. 
  5915.  
  5916. A similar process occurs for delay through the network, so that the receiver 
  5917. has an estimate of what sort of service it can expect and request. 
  5918.  
  5919.  
  5920. ΓòÉΓòÉΓòÉ 10.6. Adspecs ΓòÉΓòÉΓòÉ
  5921.  
  5922. Adspecs are a part of path events.  Adspecs carry information about the RSVP 
  5923. support that is possible in the network for a specified flow. 
  5924.  
  5925. An adspec is created by the RSVP daemon when a sender calls rapi_sender(). The 
  5926. path message traverses the network to the receiver, and accumulates changes to 
  5927. the adspec when passing through each RSVP enabled network node. The receiver 
  5928. callback function is called with a path event.  The path event has the original 
  5929. sender tspec, and the adspec that indicates the support that is possible 
  5930. through the network for that tspec.  The receiver then calls rapi_reserve() to 
  5931. make a reservation based upon the information in the tspec and adspec.  Then 
  5932. the reservation message traverses the network to the sender.  The QoS 
  5933. reservation is set up in each RSVP node until the reservation message reaches 
  5934. the sender.  The sender callback function is called with a reserve event.  The 
  5935. sender then may adjust packet size or other factors in order to use the 
  5936. reservation effectively, based upon the reservation information. 
  5937.  
  5938. When the application callback function is passed a non-NULL pointer for the 
  5939. adspec, then the pointer points to an IS_adspec_t data type: 
  5940.  
  5941.     typedef struct {
  5942.             Gen_adspec_t    Gen_Adspec;
  5943.             rbool_t         CL_present;
  5944.             CL_adspec_t     CL_Adspec;
  5945.             rbool_t         Guar_present;
  5946.             Guar_adspec_t   Guar_Adspec;
  5947.     } IS_adspec_t;
  5948.  
  5949. The IS_adspec_t data type has several fields.  The Gen_Adspec field is always 
  5950. present.  If CL_present is true, then CL_Adspec contains a CL_adspec_t data 
  5951. type, which is a composite of the controlled flow support for the path. If 
  5952. Guar_present is true, then Guar_Adspec contains a Guar_adspec_t data type, 
  5953. which is a composite of the guaranteed flow support for the path. 
  5954.  
  5955. The Gen_Adspec_t data type is shown below. 
  5956.  
  5957.     typedef struct {
  5958.             rbool_t    servBreak;    /* break in service */
  5959.             u_int16_t  ISHops;       /* num Int-serv aware hops */
  5960.             float32_t  pathBW;       /* min path band width (bytes/sec) */
  5961.             u_int32_t  pathLatency;  /* min path latency (microseconds) */
  5962.             u_int16_t  composedMTU;  /* composed path MTU */
  5963.     } Gen_adspec_t;
  5964.  
  5965. If servBreak is true, then there is at least one hop on the path that does not 
  5966. have QoS support and QoS must be considered unreliable. ISHops specifies the 
  5967. number of hops that do have QoS support of some sort (controlled load or 
  5968. guaranteed).  There are estimates for minimum path bandwidth and minimum delay 
  5969. through the path.  The composedMTU is the maximum transmission unit that can be 
  5970. sent on the path without fragmentation of the packet.  The composedMTU includes 
  5971. the IP packet header and whatever protocol headers (UDP, TCP, and so on) will 
  5972. be in the packet.  Note that a particular type of service might have a 
  5973. different value for the composedMTU, due to implementation differences for 
  5974. various types of QoS. 
  5975.  
  5976. The CL_adspec_t data type provides information specifically for controlled load 
  5977. flows on the path.  Note that it is possible for there to be a break in service 
  5978. for controlled load even if QoS is supported at every node.  Some nodes may 
  5979. only implement QoS for guaranteed flows. 
  5980.  
  5981.     typedef struct {
  5982.             rbool_t    servBreak;    /* break in service */
  5983.             u_int16_t  ISHops;       /* num Int-serv aware hops */
  5984.             float32_t  pathBW;       /* min path band width (bytes/sec) */
  5985.             u_int32_t  pathLatency;  /* min path latency (microseconds) */
  5986.             u_int16_t  composedMTU;  /* composed path MTU */
  5987.     } CL_adspec_t;
  5988.  
  5989. The fields have the same significance as for Gen_adspec_t but refer  only to 
  5990. path hops for which controlled load is supported. 
  5991.  
  5992. The Guar_adspec_t data type provides information specifically for guaranteed 
  5993. flows on the path.  Note that it is possible for there to be a break in service 
  5994. for guaranteed flows even if QoS is supported at every node. Some nodes may 
  5995. only implement controlled load QoS. 
  5996.  
  5997.     typedef struct {
  5998.             rbool_t    servBreak;    /* break in service */
  5999.             u_int16_t  ISHops;       /* num Int-serv aware hops */
  6000.             float32_t  pathBW;       /* min path band width (bytes/sec) */
  6001.             u_int32_t  pathLatency;  /* min path latency (microseconds) */
  6002.             u_int16_t  composedMTU;  /* composed path MTU (bytes) */
  6003.             u_int32_t  Ctot;         /* total rate dep. err (bytes) */
  6004.             u_int32_t  Dtot;         /* total rate indep. err (microseconds) */
  6005.             u_int32_t  Csum;         /* reshaped rate dep. err (bytes) */
  6006.             u_int32_t  Dsum;         /* reshaped rate indep. err (microseconds) */
  6007.     } Guar_adspec_t;
  6008.  
  6009. The first five fields have the same significance as for Gen_adspec_t but refer 
  6010. only to path hops for which guaranteed flow is supported. The remaining fields 
  6011. are unique to guaranteed flows. 
  6012.  
  6013.  
  6014. ΓòÉΓòÉΓòÉ 10.7. Controlled Load Reservations ΓòÉΓòÉΓòÉ
  6015.  
  6016. The controlled load reservation requests a reservation for a guaranteed data 
  6017. rate.  The receiver is asking for an IP packet byte rate that is no greater 
  6018. than r*T+b bytes for any arbitrary time of T seconds.  The receiver expects to 
  6019. not need more than b bytes of packet space for arriving packets in the TCP/IP 
  6020. stack, while it is busy processing previously received packets.  The receiver 
  6021. should request a maximum packet size M no bigger than the composedMTU from the 
  6022. controlled load adspec.  When computing r*T+b, packets smaller than m should be 
  6023. treated as if they were size m. The peak rate p in the reservation is checked 
  6024. for validity but usually is ignored. 
  6025.  
  6026. For more information, refer to Internet RFC 1633, Integrated Services in the 
  6027. Internet Architecture: an Overview, and Internet Draft 
  6028. draft-ietf-intserv-ctrl-load-svc-07. 
  6029.  
  6030.  
  6031. ΓòÉΓòÉΓòÉ 10.8. Guaranteed Reservations ΓòÉΓòÉΓòÉ
  6032.  
  6033. Guaranteed reservations are more complex than controlled load because 
  6034. guaranteed flow provides a way to reserve a specified maximum delay through the 
  6035. network, as well as a specified data rate.  Guaranteed service does not control 
  6036. the average or minimum packet delay. Guaranteed service also does not control 
  6037. jitter, the difference between minimum and maximum packet delays. 
  6038.  
  6039. The guaranteed flow model of the network assumes that there are two sources of 
  6040. delay in the network, the delay (D) that is independent of rate of flow, and 
  6041. the delay (C) that is proportional to rate of flow. Delay for a rate r would be 
  6042. C*r+D in an ideal situation.  In practice, the RSVP-enabled network elements 
  6043. provide an upper bound for their contribution to C and D, and a lower bound for 
  6044. D. The lower bound for C is 0. The receiver chooses a reservation that takes 
  6045. these bounds into consideration. 
  6046.  
  6047. The pathLatency field of the adspec for guaranteed service is an estimate of 
  6048. the minimum delay through the network for that type of service.  It can be 
  6049. estimated from many diverse factors such as speed of light through fiber cables 
  6050. or minimum path length of routing code. Each RSVP-enabled node adds its own 
  6051. estimate of this value to the adspec. 
  6052.  
  6053. The delay that is based on the data rate can include many factors, such as time 
  6054. to queue a packet, and maximum time to wait for the current packet to be sent 
  6055. before the next one can be sent from an interface. 
  6056.  
  6057. When a path message arrives at the receiver, the guaranteed flow adspec will 
  6058. contain Ctot and Dtot, which are accumulations of the C and D delay factors on 
  6059. the path through the network.  The terms Csum and Dsum are used by intermediate 
  6060. nodes along with the slack term that the guaranteed flow will provide.  These 
  6061. terms are used by nodes that will "reshape" the data flow to make it conform to 
  6062. the flow parameters. 
  6063.  
  6064. These are the formula variables and their sources, for determining the 
  6065. Guaranteed flowspec. 
  6066.  
  6067. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6068. ΓöéVar    Spec            Spec Field          Description             Γöé
  6069. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6070. ΓöéBmin   Guar_adspec_t   pathBW              Minimum path bandwidth  Γöé
  6071. Γöé                                           (IP packet bytes per    Γöé
  6072. Γöé                                           second)                 Γöé
  6073. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6074. ΓöéMTU    Guar_adspec_t   composedMTU         Composed path MTU       Γöé
  6075. Γöé                                           (bytes)                 Γöé
  6076. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6077. ΓöéCtot   Guar_adspec_t   Ctot                Total rate-dependent    Γöé
  6078. Γöé                                           error (bytes)           Γöé
  6079. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6080. ΓöéDtot   Guar_adspec_t   Dtot                Total rate-independent  Γöé
  6081. Γöé                                           error (microseconds)    Γöé
  6082. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6083. Γöér      IS_Tspec_t      IS_Tspec_r          Token bucket rate (IP   Γöé
  6084. Γöé                                           packet bytes per second)Γöé
  6085. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6086. Γöéb      IS_Tspec_t      IS_Tspec_b          Token bucket depth      Γöé
  6087. Γöé                                           (bytes)                 Γöé
  6088. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6089. Γöép      IS_Tspec_t      IS_Tspec_p          Peak data rate (IP      Γöé
  6090. Γöé                                           packet bytes per second)Γöé
  6091. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6092. Γöém      IS_Tspec_t      IS_Tspec_m          Minimum Policed Unit    Γöé
  6093. Γöé                                           (bytes)                 Γöé
  6094. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6095. ΓöéM      IS_Tspec_t      IS_Tspec_M          Maximum packet size     Γöé
  6096. Γöé                                           (bytes)                 Γöé
  6097. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6098. ΓöéR      Guar_Rspec_t    Guar_Rspec_R        Guaranteed rate (IP     Γöé
  6099. Γöé                                           packet bytes per second)Γöé
  6100. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6101. ΓöéS      Guar_Rspec_t    Guar_Rspec_S        Slack term              Γöé
  6102. Γöé                                           (microseconds)          Γöé
  6103. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6104.  
  6105. Values for r, b, p, m, M, R, and S are to be computed for the guaranteed 
  6106. reservation.  Assume that the reservation r, b, p, and m are chosen based on 
  6107. the original tspec values in the path message.  If Bmin is greater than r or p, 
  6108. they should be increased at least to Bmin. Assume that the reservation M is set 
  6109. to a reasonable value for the application that is not greater than MTU.  Assume 
  6110. that the minimum delay is not greater than the maximum that the application can 
  6111. tolerate.  Note that all computation described below should be floating point , 
  6112. especially the division by 1000000 that converts between microseconds and 
  6113. seconds. 
  6114.  
  6115. If r <= p <= R then the upper bound on end-to-end requested delay (Dreq) in 
  6116. seconds is: 
  6117.  
  6118. Dreq = (M+Ctot)/R + Dtot/1000000
  6119.  
  6120. If r <= R < p then the upper bound on Dreq in seconds is 
  6121.  
  6122.  
  6123. Dreq = [(b-M)/R*(p-R)/(p-r)] + (M+Ctot)/R + Dtot/1000000
  6124.  
  6125. The higher the value of R is, the lower Dreq will be.  The application will 
  6126. choose an R value that is sufficiently high that the maximum delay is 
  6127. sufficient for what the sender and receiver need to do.  Note that studies have 
  6128. shown that packets will often arrive much more quickly than the maximum delay, 
  6129. and therefore the application must be prepared to buffer them. 
  6130.  
  6131. If the peak rate p is unknown or unspecified, it should be set to infinity. 
  6132. Infinity is represented in IEEE floating point with an exponent of all one bits 
  6133. (255), and a sign and mantissa of all zero bits.  In that case the upper bound 
  6134. on end-to-end delay in seconds simplifies to: 
  6135.  
  6136. Dreq = b/R + Ctot/R + Dtot/1000000
  6137.  
  6138. The slack term S is the difference between the requested maximum delay and the 
  6139. desired delay, and must be a non-negative number.  A typical desired delay is 
  6140. when R is set to r, in the ideal fluid model of flow. The delay in that model 
  6141. is 
  6142.  
  6143. Dideal = b/r + Ctot/r + Dtot/1000000
  6144.  
  6145. The slack term can then be: 
  6146.  
  6147. S = Dreq - Dideal.
  6148.  
  6149. If the application chooses an S greater than zero, then RSVP-enabled nodes on 
  6150. the path can use it and the Csum and Dsum values to adjust their local 
  6151. reservations to lower the amount of resources allocated to the flow. 
  6152.  
  6153. Note that a guaranteed reservation may have its values R and S adjusted by 
  6154. intervening nodes, so that the reservation seen by the sender in the 
  6155. reservation message may be different from what the receiver provided with 
  6156. rapi_reserve() call. 
  6157.  
  6158. For more information, refer to Internet RFC 1633, Integrated Services in the 
  6159. Internet Architecture: an Overview, and Internet Draft 
  6160. draft-ietf-intserv-ctrl-load-svc-07. 
  6161.  
  6162.  
  6163. ΓòÉΓòÉΓòÉ 11. Reference Information ΓòÉΓòÉΓòÉ
  6164.  
  6165. This section describes: 
  6166.  
  6167.      Protocol-Independent C Sockets API 
  6168.  
  6169.       Describes the protocol-independent socket calls supported by networking 
  6170.       services. This information includes call syntax, usage, and related 
  6171.       information. 
  6172.  
  6173.      TCP/IP Network Utility Routines API 
  6174.  
  6175.       Describes the sockets utility and Sockets Secure Support (SOCKS) function 
  6176.       calls supported by networking services. This information includes call 
  6177.       syntax, usage, and related information. 
  6178.  
  6179.      Remote Procedure and eXternal Data Representation API 
  6180.  
  6181.       Describes the remote procedure and XDR function calls along with their 
  6182.       syntax, usage, and related information. 
  6183.  
  6184.      File Transfer Protocol API 
  6185.  
  6186.       Describes the file transfer protocol function calls along with their 
  6187.       syntax, usage, and related information. 
  6188.  
  6189.      Resource ReSerVation Protocol API 
  6190.  
  6191.       Describes the resource reservation protocol function calls along with 
  6192.       their syntax, usage, and related information. 
  6193.  
  6194.  
  6195. ΓòÉΓòÉΓòÉ 12. Protocol-Independent C Sockets API ΓòÉΓòÉΓòÉ
  6196.  
  6197. The following table briefly describes each protocol-independent socket call 
  6198. supported by networking services and identifies where you can find the syntax, 
  6199. parameters, and other appropriate information. The socket calls described in 
  6200. this section can be used to access services for all protocols. 
  6201.  
  6202. Note:  If you are using the internet communications domain (PF_INET protocol 
  6203.        family), you can use all APIs in the following table and those in TCP/IP 
  6204.        Network Utility Routines API. 
  6205.  
  6206.  Protocol-Independent Sockets API Quick Reference 
  6207.  
  6208.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6209.   ΓöéSocket Call                    Description                        Γöé
  6210.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6211.   Γöéaccept()                       Accepts a connection request from aΓöé
  6212.   Γöé                               remote host                        Γöé
  6213.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6214.   Γöéaddsockettolist()              Adds a socket to the list of owned Γöé
  6215.   Γöé                               sockets for the calling process    Γöé
  6216.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6217.   Γöébind()                         Binds a local name to the socket   Γöé
  6218.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6219.   Γöéconnect()                      Requests a connection to a remote  Γöé
  6220.   Γöé                               host                               Γöé
  6221.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6222.   Γöégetpeername()                  Gets the name of the peer connectedΓöé
  6223.   Γöé                               to socket                          Γöé
  6224.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6225.   Γöégetsockname()                  Gets the local socket name         Γöé
  6226.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6227.   Γöégetsockopt()                   Gets the socket options associated Γöé
  6228.   Γöé                               with a socket                      Γöé
  6229.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6230.   Γöéioctl()                        Performs special operations on     Γöé
  6231.   Γöé                               sockets                            Γöé
  6232.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6233.   Γöélisten()                       Completes the binding necessary forΓöé
  6234.   Γöé                               a socket to accept connections and Γöé
  6235.   Γöé                               creates a connection request queue Γöé
  6236.   Γöé                               for incoming requests              Γöé
  6237.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6238.   Γöéos2_ioctl()                    Performs special operations on     Γöé
  6239.   Γöé                               sockets; in particular, operations Γöé
  6240.   Γöé                               related to returning status from   Γöé
  6241.   Γöé                               kernel                             Γöé
  6242.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6243.   Γöéos2_select()                   Gets read, write, and exception    Γöé
  6244.   Γöé                               status on a group of sockets (OS/2 Γöé
  6245.   Γöé                               version)                           Γöé
  6246.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6247.   Γöépsock_errno()                  Writes a short error message to theΓöé
  6248.   Γöé                               standard error device              Γöé
  6249.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6250.   Γöéreadv()                        Receives data on a socket into a   Γöé
  6251.   Γöé                               set of buffers                     Γöé
  6252.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6253.   Γöérecv()                         Receives data on a connected socketΓöé
  6254.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6255.   Γöérecvfrom()                     Receives data on a socket          Γöé
  6256.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6257.   Γöérecvmsg()                      Receives data and control          Γöé
  6258.   Γöé                               information on a socket            Γöé
  6259.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6260.   Γöéremovesocketfromlist()         Removes a socket from the list of  Γöé
  6261.   Γöé                               owned sockets for the calling      Γöé
  6262.   Γöé                               process                            Γöé
  6263.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6264.   Γöéselect()                       Gets read, write, and exception    Γöé
  6265.   Γöé                               status on a group of sockets (BSD  Γöé
  6266.   Γöé                               version)                           Γöé
  6267.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6268.   Γöésend()                         Sends data on a connected socket   Γöé
  6269.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6270.   Γöésendmsg()                      Sends data and control information Γöé
  6271.   Γöé                               on a socket                        Γöé
  6272.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6273.   Γöésendto()                       Sends data on a socket             Γöé
  6274.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6275.   Γöésetsockopt()                   Sets options associated with a     Γöé
  6276.   Γöé                               socket                             Γöé
  6277.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6278.   Γöéshutdown()                     Shuts down all or part of a full   Γöé
  6279.   Γöé                               duplex connection                  Γöé
  6280.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6281.   Γöéso_cancel()                    Cancels a pending blocking sockets Γöé
  6282.   Γöé                               API call on a socket               Γöé
  6283.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6284.   Γöésock_errno()                   Returns error code set by a socket Γöé
  6285.   Γöé                               call                               Γöé
  6286.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6287.   Γöésocket()                       Creates an endpoint for            Γöé
  6288.   Γöé                               communication and returns a socket Γöé
  6289.   Γöé                               descriptor representing the        Γöé
  6290.   Γöé                               endpoint                           Γöé
  6291.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6292.   Γöésoclose()                      Shuts down a socket and frees      Γöé
  6293.   Γöé                               resources allocated to the socket  Γöé
  6294.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6295.   Γöésysctl()                       Performs special operations on the Γöé
  6296.   Γöé                               TCP/IP stack kernel                Γöé
  6297.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6298.   Γöéwritev()                       Writes data from a set of specifiedΓöé
  6299.   Γöé                               buffers on a socket                Γöé
  6300.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6301.  
  6302.  
  6303. ΓòÉΓòÉΓòÉ 12.1. accept() ΓòÉΓòÉΓòÉ
  6304.  
  6305. The accept() socket call accepts a connection request from a remote host. 
  6306. Raccept() accepts a connection request from a SOCKS server. See Socket Secure 
  6307. Support for information about SOCKS. 
  6308.  
  6309. Syntax 
  6310.  
  6311. #include <types.h>
  6312. #include <sys\socket.h>
  6313. #include <netinet\in.h>
  6314. #include <netnb\nb.h>
  6315. #include <sys\un.h>
  6316. int accept(s, name, namelen)
  6317. int s;
  6318. sockaddr *name;
  6319. int *namelen;
  6320.  
  6321. Parameters 
  6322.  
  6323.  s 
  6324.    Socket descriptor. 
  6325.  
  6326.  name 
  6327.    Pointer to a sockaddr structure that contains the socket address of the 
  6328.    connection client when the accept() call returns. The format of name is 
  6329.    determined by the communications domain where the client resides. This 
  6330.    parameter can be NULL if the caller is not interested in the client address. 
  6331.  
  6332.  namelen 
  6333.    Must initially point to an integer that contains the size in bytes of the 
  6334.    storage pointed to by name.  On return, that integer contains the size of 
  6335.    the data returned in the storage pointed to by name. If name is NULL, 
  6336.    namelen is ignored and can be NULL. 
  6337.  
  6338.  Description 
  6339.  
  6340.  This call is used by a server acting in a connection-oriented mode to accept a 
  6341.  connection request from a client.  The call accepts the first connection on 
  6342.  its queue of pending connection requests. The accept() call creates a new 
  6343.  socket descriptor with the same properties as s and returns it to the caller. 
  6344.  The new socket descriptor cannot be used to accept new connections. The 
  6345.  original socket, s, remains available to accept more connection requests. 
  6346.  
  6347.  If the queue has no pending connection requests, accept() blocks the caller 
  6348.  unless s is in nonblocking mode.  If no connection requests are queued and s 
  6349.  is in nonblocking mode, accept() returns a value of -1 and sets the return 
  6350.  code to SOCEWOULDBLOCK. 
  6351.  
  6352.  The s parameter must be a socket descriptor created with the socket() call. 
  6353.  It is usually bound to an address with the bind() call and must be made 
  6354.  capable of accepting connections with the listen() call.  The listen() call 
  6355.  marks the socket as one that accepts connections and allocates a queue to hold 
  6356.  pending connection requests. The listen() call allows the caller to place an 
  6357.  upper boundary on the size of the queue. 
  6358.  
  6359.  The name parameter is a pointer to a buffer where the connection requester 
  6360.  address is placed. The name parameter is optional and can be set to be the 
  6361.  NULL pointer.  If set to NULL, the requester address is not copied into the 
  6362.  buffer.  The exact format of name depends on the communications domain where 
  6363.  the communication request originated. For example, if the connection request 
  6364.  originated in the internet domain, name points to a sockaddr_in structure as 
  6365.  defined in the header file <NETINET\IN.H>. 
  6366.  
  6367.  The namelen parameter is used only if name is not NULL. Before calling 
  6368.  accept(), you must set the integer pointed to by namelen to the size, in 
  6369.  bytes, of the buffer pointed to by name. On successful return, the integer 
  6370.  pointed to by namelen contains the actual number of bytes copied into the 
  6371.  buffer. If the buffer is not large enough to hold the address, up to namelen 
  6372.  bytes of the requester address are copied. 
  6373.  
  6374.  This call is used only with SOCK_STREAM or SOCK_SEQPACKET sockets. You cannot 
  6375.  screen requesters without calling accept().  The application cannot tell the 
  6376.  system the requesters it will accept connections from.  The caller can, 
  6377.  however, choose to close a connection immediately after discovering the 
  6378.  identity of the requester. 
  6379.  
  6380.  The select() call can be used to check the socket for incoming connection 
  6381.  requests. 
  6382.  
  6383.  Return Values 
  6384.  
  6385.  A non-negative socket descriptor indicates success; the value -1 indicates an 
  6386.  error. You can get the specific error code by calling sock_errno() or 
  6387.  psock_errno(). 
  6388.  
  6389.  Error Code             Description
  6390.  
  6391.  SOCENOTSOCK            The s parameter is not a valid socket descriptor. 
  6392.  
  6393.  SOCEFAULT              Using name and namelen would result in an attempt to 
  6394.                         copy the address into a portion of the caller address 
  6395.                         space into which information cannot be written. 
  6396.  
  6397.  SOCEINTR               Interrupted system call. 
  6398.  
  6399.  SOCEINVAL              Listen() was not called for socket s. 
  6400.  
  6401.  SOCENOBUFS             Insufficient buffer space available to create the new 
  6402.                         socket. 
  6403.  
  6404.  SOCEOPNOTSUPP          The s parameter is not connection-oriented. 
  6405.  
  6406.  SOCEWOULDBLOCK         The s parameter is in nonblocking mode and no 
  6407.                         connections are on the queue. 
  6408.  
  6409.  SOCECONNABORTED        The software caused a connection close. 
  6410.  
  6411.  Examples 
  6412.  
  6413.  The following are two examples of the accept() call.  In the first, the caller 
  6414.  wants to have the requester address returned. In the second, the caller does 
  6415.  not want to have the requester address returned. 
  6416.  
  6417.   int clientsocket;
  6418.   int s;
  6419.   struct sockaddr clientaddress;
  6420.   int addrlen;
  6421.   int accept(int s, struct sockaddr *addr, int *addrlen); /* extracted from sys/socket.h */
  6422.   /* socket(), bind(), and listen() have been called */
  6423.   /* EXAMPLE 1: I want the address now */
  6424.   addrlen = sizeof(clientaddress);
  6425.   clientsocket = accept(s, &clientaddress, &addrlen);
  6426.   /* EXAMPLE 2: I can get the address later using getpeername() */
  6427.   clientsocket = accept(s, (struct sockaddr *) 0, (int *) 0);
  6428.  
  6429.  Related Calls 
  6430.  
  6431.       bind() 
  6432.       connect() 
  6433.       getpeername() 
  6434.       getsockname() 
  6435.       listen() 
  6436.       sock_errno() 
  6437.       socket() 
  6438.  
  6439.  
  6440. ΓòÉΓòÉΓòÉ 12.2. addsockettolist() ΓòÉΓòÉΓòÉ
  6441.  
  6442. The addsockettolist() call adds a socket to the list of owned sockets for the 
  6443. calling process. 
  6444.  
  6445. Syntax 
  6446.  
  6447. #include <types.h>
  6448. #include <sys\socket.h>
  6449. void addsockettolist(s)
  6450. int s;
  6451.  
  6452. Parameters 
  6453.  
  6454.  s 
  6455.    Socket descriptor. 
  6456.  
  6457.  Description 
  6458.  
  6459.  When a process ends, the sockets library automatically cleans up sockets by 
  6460.  registering an exit list handler.  This exit routine closes all open sockets 
  6461.  that are maintained in a process's socket list. When a process is initiated 
  6462.  the list is empty, and whenever a socket(), accept(), or soclose() call is 
  6463.  made the list is updated.  The addsockettolist() call provides a mechanism to 
  6464.  transfer socket ownership to another process. The addsockettolist() call adds 
  6465.  the socket indicated by the s parameter to the calling process's socket 
  6466.  ownership list. 
  6467.  
  6468.  Return Values 
  6469.  
  6470.  The value 1 indicates success; the value 0 indicates an error. 
  6471.  
  6472.  Related Calls 
  6473.  
  6474.       removesocketfromlist() 
  6475.  
  6476.  
  6477. ΓòÉΓòÉΓòÉ 12.3. bind() ΓòÉΓòÉΓòÉ
  6478.  
  6479. The bind() socket call binds a local name to the socket. Rbind() binds a SOCKS 
  6480. local name to the socket. See Socket Secure Support for information about 
  6481. SOCKS. 
  6482.  
  6483. Syntax 
  6484.  
  6485. #include <types.h>
  6486. #include <sys\socket.h>
  6487. int bind(s, name, namelen)
  6488. int s;
  6489. struct sockaddr *name;
  6490. int namelen;
  6491.  
  6492. Parameters 
  6493.  
  6494.  s 
  6495.    Socket descriptor returned by a previous call to socket(). 
  6496.  
  6497.  name 
  6498.    Pointer to a sockaddr structure containing the name that is to be bound to 
  6499.    s. 
  6500.  
  6501.  namelen 
  6502.    Size in bytes of the sockaddr structure pointed to by name. 
  6503.  
  6504.  Description 
  6505.  
  6506.  The bind() call binds a unique local name to the socket with descriptor s. 
  6507.  After calling socket(), a descriptor does not have a name associated with it. 
  6508.  However, it does belong to a particular addressing family as specified when 
  6509.  socket() is called.  The exact format of a name depends on the addressing 
  6510.  family.  The bind() procedure also allows servers to specify from which 
  6511.  network interfaces they wish to receive UDP packets and TCP connection 
  6512.  requests. 
  6513.  
  6514.  If s was created in the AF_INET domain, the format of the name buffer is 
  6515.  expected to be sockaddr_in as defined in the header file <NETINET\IN.H>: 
  6516.  
  6517.   struct in_addr
  6518.   {
  6519.           u_long s_addr;
  6520.   };
  6521.   struct sockaddr_in
  6522.   {
  6523.           u_char  sin_len;
  6524.           u_char  sin_family;
  6525.           u_short sin_port;
  6526.           struct  in_addr sin_addr;
  6527.           char    sin_zero[8];
  6528.   };
  6529.  
  6530.  The sin_len field is ignored. The sin_family field must be set to AF_INET. 
  6531.  The sin_port field is set to the port that the application must bind to.  It 
  6532.  must be specified in network byte order.  If sin_port is set to 0, the caller 
  6533.  leaves it to the system to assign an available port.  The application can call 
  6534.  getsockname() to discover the port number assigned.  The sin_addr field is set 
  6535.  to the internet address and must be specified in network byte order.  On hosts 
  6536.  with more than one network interface (called multihomed hosts), a caller can 
  6537.  select the interface that the host will bind to. 
  6538.  
  6539.  Subsequently, only UDP packets or TCP connection requests which match the 
  6540.  bound name from this interface are routed to the socket.  If sin_addr is set 
  6541.  to the constant INADDR_ANY, as defined in <NETINET\IN.H>, the caller is 
  6542.  requesting that the socket be bound to all network interfaces on the host. 
  6543.  After this, UDP packets or TCP connections which match the bound name from all 
  6544.  interfaces are routed to the socket.  This becomes important when a server 
  6545.  offers a service to multiple networks.  By leaving the address unspecified, 
  6546.  the server can accept all UDP packets or TCP connection requests made for its 
  6547.  port, regardless of the network interface on which the requests arrived.  The 
  6548.  sin_zero field is not used and must be set to all zeros. 
  6549.  
  6550.  In the NetBIOS (AF_NET) domain, set all 16 characters in snb_name in the 
  6551.  sockaddr_nb structure to binary zeros (null). The system will generate a name 
  6552.  for the socket. 
  6553.  
  6554.  Return Values 
  6555.  
  6556.  The value 0 indicates success; the value -1 indicates an error. You can get 
  6557.  the specific error code by calling sock_errno() or psock_errno(). 
  6558.  
  6559.  Error Code              Description
  6560.  
  6561.  SOCEADDRINUSE           The address is already in use.  See the SO_REUSEADDR 
  6562.                          option described under getsockopt() and the 
  6563.                          SO_REUSEADDR option described under setsockopt(). 
  6564.  
  6565.  SOCEADDRNOTAVAIL        The address specified is not valid on this host.  For 
  6566.                          example, the internet address does not specify a valid 
  6567.                          network interface. 
  6568.  
  6569.  SOCEAFNOSUPPORT         The address family is not supported. 
  6570.  
  6571.  SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  6572.  
  6573.  SOCEFAULT               Using name and namelen would result in an attempt to 
  6574.                          copy the address into a non-writable portion of the 
  6575.                          caller's address space. 
  6576.  
  6577.  SOCEINVAL               The socket is already bound to an address, or namelen 
  6578.                          is not the expected length. 
  6579.  
  6580.  SOCENOBUFS              No buffer space is available. 
  6581.  
  6582.  Examples 
  6583.  
  6584.  Note the following about the bind() call examples: 
  6585.  
  6586.      For the internet examples, put the internet address and port in 
  6587.       network-byte order. To put the port into network-byte order, use the 
  6588.       htons() utility routine to convert a short integer from host-byte order 
  6589.       to network-byte order. 
  6590.  
  6591.      For the internet examples, set the address field using the inet_addr() 
  6592.       utility routine, which takes a character string representing the 
  6593.       dotted-decimal address of an interface and returns the binary internet 
  6594.       address representation in network-byte order. 
  6595.  
  6596.      Zero the structure before using it to ensure that the name requested does 
  6597.       not set any reserved fields. 
  6598.  
  6599.  See connect() for examples of how a client might connect to servers. 
  6600.  
  6601.   int rc;
  6602.   int s;
  6603.   struct sockaddr_in myname;
  6604.   int bind(int s, struct sockaddr *name, int namelen); /* extracted from sys/socket.h */
  6605.   /* Bind to a specific interface in the internet domain */
  6606.   /* clear the structure */
  6607.   memset(&myname, 0, sizeof(myname));
  6608.   myname.sin_len = sizeof(myname);
  6609.   myname.sin_family = AF_INET;
  6610.   myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  6611.   myname.sin_port = htons(1024);
  6612.   ...
  6613.   rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  6614.  
  6615.   /* Bind to all internet network interfaces on the system */
  6616.   /* clear the structure */
  6617.   memset(&myname, 0, sizeof(myname));
  6618.   myname.sin_len = sizeof(myname);
  6619.   myname.sin_family = AF_INET;
  6620.   myname.sin_addr.s_addr = INADDR_ANY; /* all interfaces */
  6621.   myname.sin_port = htons(1024);
  6622.   ...
  6623.   rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  6624.  
  6625.   /* Bind to a specific interface in the internet domain.
  6626.   Let the system choose a port                        */
  6627.   /* clear the structure */
  6628.   memset(&myname, 0, sizeof(myname));
  6629.   myname.sin_len = sizeof(myname);
  6630.   myname.sin_family = AF_INET;
  6631.   myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  6632.   myname.sin_port = 0;
  6633.   ...
  6634.   rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  6635.  
  6636.   /* Bind to a unique NetBIOS name on adapter 0 */
  6637.   struct sockaddr_nb nbname;
  6638.   memset(&nbname, 0, sizeof(nbname));
  6639.   nbname.sin_len = sizeof(nbname);
  6640.   nbname.snb_family = AF_NB;
  6641.   nbname.snb_type = NB_UNIQUE;
  6642.   nbname.snb_adapter = 0;
  6643.   strcpy(nbname.snb_name, "NBSERVER"); /* Note that a NetBIOS name is
  6644.                                           16 bytes long.  In this example,
  6645.                                           the last 8 bytes are filled
  6646.                                           with zeros.                    */
  6647.  
  6648.   ...
  6649.   rc = bind(s, (struct sockaddr *) &nbname, sizeof(nbname));
  6650.  
  6651.  Related Calls 
  6652.  
  6653.       connect() 
  6654.       gethostbyname() 
  6655.       getsockname() 
  6656.       htons() 
  6657.       inet_addr() 
  6658.       listen() 
  6659.       sock_errno() 
  6660.       socket() 
  6661.  
  6662.  
  6663. ΓòÉΓòÉΓòÉ 12.4. connect() ΓòÉΓòÉΓòÉ
  6664.  
  6665. The connect() socket call requests a connection to a remote host. 
  6666.  
  6667. Syntax 
  6668.  
  6669. #include <types.h>
  6670. #include <sys\socket.h>
  6671. int connect(s, name, namelen)
  6672. int s;
  6673. struct sockaddr *name;
  6674. int namelen;
  6675.  
  6676. Parameters 
  6677.  
  6678.  s 
  6679.    Socket descriptor used to originate the connection request. 
  6680.  
  6681.  name 
  6682.    Pointer to a sockaddr structure containing the address of the socket to 
  6683.    which a connection will be attempted. 
  6684.  
  6685.  namelen 
  6686.    Size in bytes of the sockaddr structure pointed to by name. 
  6687.  
  6688.  Description 
  6689.  
  6690.  The following diagram illustrates connect() processing: 
  6691.  
  6692.  
  6693.   connect() Processing
  6694.  
  6695.  If you are using a SOCKS server, connect() calls Rconnect(). See Socket Secure 
  6696.  Support for information about SOCKS. 
  6697.  
  6698.  Stream or sequenced packet sockets: The connect() call performs two tasks when 
  6699.  called for a stream or sequenced packet socket: 
  6700.  
  6701.    1. Completes the binding if necessary for a socket 
  6702.    2. Attempts to create a connection between two sockets. 
  6703.  
  6704.  This call is used by the client side of socket-based applications to establish 
  6705.  a connection with a server. The remote server must have a passive open 
  6706.  pending. This means the server must successfully call bind() and listen(); 
  6707.  otherwise, connect() returns a value of -1 and the error value is set to 
  6708.  SOCECONNREFUSED. If you are using a SOCKS server and the connection is 
  6709.  rejected by the SOCKS server, the return code will be SOCECONNREFUSED. 
  6710.  
  6711.  In the internet communication domain, a timeout occurs if a connection to the 
  6712.  remote host is not successful within 75 seconds (1 minute and 15 seconds). 
  6713.  There is no timeout for Local IPC. In the NetBIOS communication domain, a 
  6714.  timeout occurs if a connection to the host is not successful within the time 
  6715.  defined by the NetBIOS protocol parameters Transmit Timer multiplied by 
  6716.  Transmit Retry. 
  6717.  
  6718.  If s is in blocking mode, the connect() call blocks the caller until the 
  6719.  connection is established or until an error is received.  If the socket is in 
  6720.  nonblocking mode, and the connection was successfully initiated, connect() 
  6721.  returns a value of -1 and sets the error value to SOCEINPROGRESS. The caller 
  6722.  can test the completion of the connection setup by calling: 
  6723.  
  6724.      select(), to test for the ability to write to the socket 
  6725.      getsockopt(), with option SO_ERROR, to test if the connection succeeded 
  6726.  Stream or sequenced packet sockets can call connect() only once.
  6727.  
  6728.  Datagram or raw sockets: The connect() call specifies the destination peer 
  6729.  address when called for a datagram or raw socket. Normally, datagram and raw 
  6730.  sockets use connectionless data transfer calls such as sendto() and 
  6731.  recvfrom().  However, applications can call connect() to specify and store the 
  6732.  destination peer address for this socket.  The system will then know which 
  6733.  address to send data to on this socket. This method of communication allows 
  6734.  datagram and raw sockets to be connected. However, data is still not 
  6735.  guaranteed to be delivered. Thus the normal features of connectionless mode 
  6736.  sockets are maintained. The address is remembered until another connect() call 
  6737.  is made. This permits the use of readv(), recv(), send(), and writev(), which 
  6738.  are usually reserved for connection-oriented sockets. The application can 
  6739.  still use sendto(), recvfrom(), sendmsg(), and recvmsg().  The advantage of 
  6740.  calling connect() and being connected is that the destination peer address 
  6741.  does not have to be specified for all datagrams sent. 
  6742.  
  6743.  Datagram and raw sockets can call connect() multiple times. The application 
  6744.  can reset their destination address by specifying a new address on the 
  6745.  connect() call. In addition, the socket can be returned to operate in a 
  6746.  connectionless mode by calling connect() with a null destination address. The 
  6747.  null address is created by zeroing the sockaddr structure and only setting the 
  6748.  address family field. The call to connect will return a value of -1, 
  6749.  indicating that the connection to the null address cannot be established. 
  6750.  Calling sock_errno() will return SOCEADDRNOTAVAIL. For more information on 
  6751.  connecting datagram sockets, see Description for sendto(). 
  6752.  
  6753.  Return Values 
  6754.  
  6755.  The value 0 indicates success; the value -1 indicates an error. You can get 
  6756.  the specific error code by calling sock_errno() or psock_errno(). If you are 
  6757.  using a SOCKS server and the SOCKS server rejects the connection, the return 
  6758.  code will be SOCECONNREFUSED. 
  6759.  
  6760.  Error Code              Description
  6761.  
  6762.  SOCEADDRNOTAVAIL        The calling host cannot reach the specified 
  6763.                          destination. 
  6764.  
  6765.  SOCEAFNOSUPPORT         The address family is not supported. 
  6766.  
  6767.  SOCEALREADY             The socket s is marked nonblocking, and a previous 
  6768.                          connection attempt has not completed. 
  6769.  
  6770.  SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  6771.  
  6772.  SOCECONNREFUSED         The connection request was rejected by the destination 
  6773.                          host. If you are using a SOCKS server and the SOCKS 
  6774.                          server rejects the connection, the return code will be 
  6775.                          SOCECONNREFUSED. 
  6776.  
  6777.  SOCEFAULT               Using name and namelen would result in an attempt to 
  6778.                          copy the address into a portion of the caller's 
  6779.                          address space to which data cannot be written. 
  6780.  
  6781.  SOCEINPROGRESS          The socket s is marked nonblocking, and the connection 
  6782.                          cannot be completed immediately. The SOCEINPROGRESS 
  6783.                          value does not indicate an error condition. 
  6784.  
  6785.  SOCEINTR                Interrupted system call. 
  6786.  
  6787.  SOCEINVAL               The namelen parameter is not a valid length. 
  6788.  
  6789.  SOCEISCONN              The socket s is already connected. 
  6790.  
  6791.  SOCENETUNREACH          The network cannot be reached from this host. 
  6792.  
  6793.  SOCETIMEDOUT            The connection establishment timed out before a 
  6794.                          connection was made. 
  6795.  
  6796.  SOCENOBUFS              No buffer space is available. 
  6797.  
  6798.  SOCEOPNOTSUPP           The operation is not supported on socket s. 
  6799.  
  6800.  Examples 
  6801.  
  6802.  Note the following about these connect() call examples: 
  6803.  
  6804.      For the internet examples, put the internet address and port in 
  6805.       network-byte order.  To put the port into network-byte order, use the 
  6806.       htons() utility routine to convert a short integer from host-byte order 
  6807.       to network-byte order. 
  6808.  
  6809.      For the internet examples, set the address field using the inet_addr() 
  6810.       utility routine, which takes a character string representing the 
  6811.       dotted-decimal address of an interface and returns the binary internet 
  6812.       address representation in network-byte order. 
  6813.  
  6814.      To ensure that the name requested does not set any reserved fields, zero 
  6815.       the structure before using it. 
  6816.  
  6817.  These examples could be used to connect to the servers shown in the examples 
  6818.  listed for bind(). 
  6819.  
  6820.   int s;
  6821.   struct sockaddr_in servername;
  6822.   int rc;
  6823.   int connect(int s, struct sockaddr *name, int namelen); /* extracted from sys/socket.h */
  6824.   /* Connect to server bound to a specific interface in the internet domain */
  6825.   /* clear the structure */
  6826.   memset(&servername, 0, sizeof(servername));
  6827.   servername.sin_len = sizeof(servername);
  6828.   servername.sin_family = AF_INET;
  6829.   servername.sin_addr.s_addr = inet_addr("129.5.24.1"); /* specific interface */
  6830.   servername.sin_port = htons(1024); /* set to the port to which */
  6831.                                              /* the server is bound */
  6832.   ...
  6833.   rc = connect(s, (struct sockaddr *) &servername, sizeof(servername));
  6834.  
  6835.   /* Connect to a NetBIOS server */
  6836.   struct sockaddr_nb nbservername;
  6837.   memset(&nbservername, 0, sizeof(nbservername));
  6838.   nbservername.snb_len = sizeof(nbservername);
  6839.   nbservername.snb_family = AF_NB;
  6840.   nbservername.snb_type = NB_UNIQUE;
  6841.   nbservername.snb_adapter = 0;
  6842.   strcpy(nbservername.snb_name, "NBSERVER");
  6843.   ...
  6844.   rc = connect(s, (struct sockaddr *) &nbservername, sizeof(nbservername));
  6845.  
  6846.  Related Calls 
  6847.  
  6848.       accept() 
  6849.       bind() 
  6850.       getsockname() 
  6851.       htons() 
  6852.       inet_addr() 
  6853.       listen() 
  6854.       Rconnect() 
  6855.       select() 
  6856.       send() 
  6857.       sock_errno() 
  6858.       socket() 
  6859.  
  6860.  
  6861. ΓòÉΓòÉΓòÉ 12.5. getpeername() ΓòÉΓòÉΓòÉ
  6862.  
  6863. The getpeername() socket call gets the name of the peer connected to socket. 
  6864.  
  6865. Syntax 
  6866.  
  6867. #include <types.h>
  6868. #include <sys\socket.h>
  6869. int getpeername(s, name, namelen)
  6870. int s;
  6871. struct sockaddr *name;
  6872. int *namelen;
  6873.  
  6874. Parameters 
  6875.  
  6876.  s 
  6877.    Socket descriptor. 
  6878.  
  6879.  name 
  6880.    Pointer to a sockaddr structure.  The name of the peer connected to socket s 
  6881.    is returned. The exact format of name is determined by the domain where 
  6882.    communication occurs. 
  6883.  
  6884.  namelen 
  6885.    Pointer to the size in bytes of the sockaddr structure pointed to by name. 
  6886.  
  6887.  Description 
  6888.  
  6889.  This call returns the name of the peer connected to socket s. The namelen 
  6890.  parameter must be initialized to indicate the size of the space pointed to by 
  6891.  name. On return, namelen is set to the size of the peer name copied. If the 
  6892.  buffer is too small, the peer name is truncated. 
  6893.  
  6894.  The getpeername() call operates only on connected sockets. If the connection 
  6895.  is through a SOCKS server, the address returned will be that of the SOCKS 
  6896.  server. 
  6897.  
  6898.  A process can use the getsockname() call to retrieve the local address of a 
  6899.  socket. 
  6900.  
  6901.  Return Values 
  6902.  
  6903.  The value 0 indicates success; the value -1 indicates an error. You can get 
  6904.  the specific error code by calling sock_errno() or psock_errno(). 
  6905.  
  6906.  Error Code          Description
  6907.  
  6908.  SOCENOTSOCK         The s parameter is not a valid socket descriptor. 
  6909.  
  6910.  SOCEFAULT           Using the name and namelen parameters as specified would 
  6911.                      result in an attempt to access storage outside of the 
  6912.                      address space of the caller. 
  6913.  
  6914.  SOCENOTCONN         The socket is not connected. 
  6915.  
  6916.  SOCENOBUFS          No buffer space is available. 
  6917.  
  6918.  Related Calls 
  6919.  
  6920.       accept() 
  6921.       bind() 
  6922.       connect() 
  6923.       getsockname() 
  6924.       Rgetsockname() 
  6925.       sock_errno() 
  6926.       socket() 
  6927.  
  6928.  
  6929. ΓòÉΓòÉΓòÉ 12.6. getsockname() ΓòÉΓòÉΓòÉ
  6930.  
  6931. The getsockname() socket call gets the local socket name.  If you are using a 
  6932. SOCKS server, see Socket Secure Support for information about SOCKS. 
  6933.  
  6934. Syntax 
  6935.  
  6936. #include <types.h>
  6937. #include <sys\socket.h>
  6938. int getsockname(s, name, namelen)
  6939. int s;
  6940. struct sockaddr *name;
  6941. int *namelen;
  6942.  
  6943. Parameters 
  6944.  
  6945.  s 
  6946.    Socket descriptor. 
  6947.  
  6948.  name 
  6949.    Pointer to a sockaddr structure. The name of s is returned. 
  6950.  
  6951.  namelen 
  6952.    Pointer to the size in bytes of the buffer pointed to by name. 
  6953.  
  6954.  Description 
  6955.  
  6956.  This call returns the name for the socket specified by the s parameter in the 
  6957.  structure pointed to by the name parameter.  It returns the address to the 
  6958.  socket that has been bound.  If the socket is not bound to an address, the 
  6959.  call returns with the family set and the rest of the structure is set to zero. 
  6960.  For example, an unbound socket in the internet domain would cause the name to 
  6961.  point to a sockaddr_in structure with the sin_family field set to AF_INET and 
  6962.  all other fields zeroed. 
  6963.  
  6964.  The namelen parameter must be initialized to indicate the size of the space 
  6965.  pointed to by name and is set to the size of the local name copied. If the 
  6966.  buffer is too small, the local name is truncated. 
  6967.  
  6968.  Sockets are explicitly assigned a name after a successful call to bind(). 
  6969.  Stream and sequenced packet sockets are implicitly assigned a name after a 
  6970.  successful call to connect() or accept() if bind() was not called. 
  6971.  
  6972.  If the socket is connected through a SOCKS server, this call returns the IP 
  6973.  address and port of the local machine that is being used to communicate with 
  6974.  the SOCKS server. 
  6975.  
  6976.  The getsockname() call is often used to discover the port assigned to a socket 
  6977.  after the socket has been implicitly bound to a port.  For example, an 
  6978.  application can call connect() without previously calling bind(). In this 
  6979.  case, the connect() call completes the binding necessary by assigning a port 
  6980.  to the socket. 
  6981.  
  6982.  A process can use the getpeername() call to determine the address of a 
  6983.  destination socket in a socket connection. 
  6984.  
  6985.  Return Values 
  6986.  
  6987.  The value 0 indicates success; the value -1 indicates an error. You can get 
  6988.  the specific error code by calling sock_errno() or psock_errno(). 
  6989.  
  6990.  Error Code        Description
  6991.  
  6992.  SOCENOTSOCK       The s parameter is not a valid socket descriptor. 
  6993.  
  6994.  SOCEFAULT         Using the name and namelen parameters as specified would 
  6995.                    result in an attempt to access storage outside of the 
  6996.                    address space of the caller. 
  6997.  
  6998.  SOCENOBUFS        No buffer space available. 
  6999.  
  7000.  Related Calls 
  7001.  
  7002.       accept() 
  7003.       bind() 
  7004.       connect() 
  7005.       getpeername() 
  7006.       Rgetsockname() 
  7007.       sock_errno() 
  7008.       socket() 
  7009.  
  7010.  
  7011. ΓòÉΓòÉΓòÉ 12.7. getsockopt() ΓòÉΓòÉΓòÉ
  7012.  
  7013. The getsockopt() socket call gets the socket options associated with a socket. 
  7014.  
  7015. Syntax 
  7016.  
  7017. #include <types.h>
  7018. #include <sys\socket.h>
  7019. int getsockopt(s, level, optname, optval, optlen)
  7020. int s;
  7021. int level;
  7022. int optname;
  7023. char *optval;
  7024. int *optlen;
  7025.  
  7026. Parameters 
  7027.  
  7028.  s 
  7029.    Socket descriptor. 
  7030.  
  7031.  level 
  7032.    Specifies which option level is being queried for the specified optname. 
  7033.  
  7034.  optname 
  7035.    Name of a specified socket option. Only one option can be specified on a 
  7036.    call. 
  7037.  
  7038.  optval 
  7039.    Pointer to buffer to receive the option data requested. 
  7040.  
  7041.  optlen 
  7042.    Pointer to the size of the buffer. 
  7043.  
  7044.  Description 
  7045.  
  7046.  This call returns the value of a socket option at the socket or protocol 
  7047.  level. It can be called for sockets of all domain types. Some options are 
  7048.  supported only for specific socket types. You must specify the level of the 
  7049.  option and the name of the option to retrieve option values. The following 
  7050.  table lists the supported levels. 
  7051.  
  7052.  Supported Levels 
  7053.  
  7054.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7055.   ΓöéSupported Level               #define in                         Γöé
  7056.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7057.   ΓöéSOL_SOCKET                    <SYS\SOCKET.H>                     Γöé
  7058.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7059.   ΓöéIPPROTO_IP                    <NETINET\IN.H>                     Γöé
  7060.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7061.   ΓöéIPPROTO_TCP                   <NETINET\IN.H>                     Γöé
  7062.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7063.   ΓöéNBPROTO_NB                    <NETNB\NB.H>                       Γöé
  7064.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7065.  
  7066.  The optval parameter is a pointer to the buffer where the option values are 
  7067.  returned. The optlen parameter must be initially set to the size of the buffer 
  7068.  before calling getsockopt().  On return, the optlen parameter is set to the 
  7069.  actual size of the data returned. For socket options that are Boolean, the 
  7070.  option is enabled if optval is nonzero and disabled if optval is 0. 
  7071.  
  7072.  The following tables list the supported options for getsockopt() at each level 
  7073.  (SOL_SOCKET, IPPROTO_IP, IPPROTO_TCP). Detailed descriptions of the options 
  7074.  follow each table. 
  7075.  
  7076.  Supported getsockopt() Socket Options for SOL_SOCKET 
  7077.  
  7078.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7079.   ΓöéOption Name     Description             Domains(*) Data     Boolean Γöé
  7080.   Γöé                                                   Type     or ValueΓöé
  7081.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7082.   ΓöéSO_ACCEPTCONN   Listen status           I, L       int      Boolean Γöé
  7083.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7084.   ΓöéSO_BROADCAST    Allow sending of        I, N       int      Boolean Γöé
  7085.   Γöé                broadcast messages                                  Γöé
  7086.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7087.   ΓöéSO_DEBUG        Turn on recording of    I, L       int      Boolean Γöé
  7088.   Γöé                debugging information                               Γöé
  7089.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7090.   ΓöéSO_DONTROUTE    Bypass routing tables   I, L       int      Boolean Γöé
  7091.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7092.   ΓöéSO_ERROR        Return any pending      I, L       int      Value   Γöé
  7093.   Γöé                error and clear                                     Γöé
  7094.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7095.   ΓöéSO_KEEPALIVE    Keep connections alive  I          int      Boolean Γöé
  7096.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7097.   ΓöéSO_LINGER       Linger on close if data I          struct   Value   Γöé
  7098.   Γöé                present                            linger           Γöé
  7099.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7100.   ΓöéSO_L_BROADCAST  Limited broadcast sent  I          int      Boolean Γöé
  7101.   Γöé                on all interfaces                                   Γöé
  7102.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7103.   ΓöéSO_OPTIONS      Retrieve socket options I          int      Flags   Γöé
  7104.   Γöé                (flags)                                             Γöé
  7105.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7106.   ΓöéSO_OOBINLINE    Leave received OOB data I          int      Boolean Γöé
  7107.   Γöé                in-line                                             Γöé
  7108.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7109.   ΓöéSO_RCVBUF       Receive buffer size     I, L, N    int      Value   Γöé
  7110.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7111.   ΓöéSO_RCV_SHUTDOWN If shutdown called for  I, L       int      Boolean Γöé
  7112.   Γöé                receive                                             Γöé
  7113.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7114.   ΓöéSO_RCVLOWAT     Receive low watermark   I, L       int      Value   Γöé
  7115.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7116.   ΓöéSO_RCVTIMEO     Receive timeout         I, L       struct   Value   Γöé
  7117.   Γöé                                                   timeval          Γöé
  7118.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7119.   ΓöéSO_REUSEADDR    Allow local address     I, N       int      Boolean Γöé
  7120.   Γöé                reuse                                               Γöé
  7121.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7122.   ΓöéSO_REUSEPORT    Allow local port reuse  I          int      Boolean Γöé
  7123.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7124.   ΓöéSO_SNDBUF       Send buffer size        I, L, N    int      Value   Γöé
  7125.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7126.   ΓöéSO_SND_SHUTDOWN If shutdown called for  I, L       int      Boolean Γöé
  7127.   Γöé                send                                                Γöé
  7128.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7129.   ΓöéSO_SNDLOWAT     Send low watermark      I, L       int      Value   Γöé
  7130.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7131.   ΓöéSO_SNDTIMEO     Send timeout            I, L       struct   Value   Γöé
  7132.   Γöé                                                   timeval          Γöé
  7133.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7134.   ΓöéSO_TYPE         Socket type             I, L, N    int      Value   Γöé
  7135.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7136.   ΓöéSO_USELOOPBACK  Bypass hardware when    I, L       int      Boolean Γöé
  7137.   Γöé                possible                                            Γöé
  7138.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7139.  
  7140.  Table Note  (*) This column specifies the communication domains to which this 
  7141.              option applies: I for internet, L for local IPC, and N for 
  7142.              NetBIOS. 
  7143.  
  7144.  The following options are recognized for SOL_SOCKET: 
  7145.  
  7146.   Option                Description
  7147.  
  7148.  SO_ACCEPTCONN         Returns true if the socket is in the listen state. 
  7149.  
  7150.  SO_BROADCAST          (Datagram sockets only.) Retrieves the current status of 
  7151.                        the SO_BROADCAST option. When this option is enabled, 
  7152.                        the application can send broadcast messages over s, if 
  7153.                        the interface specified in the destination supports 
  7154.                        broadcasting of packets. 
  7155.  
  7156.  SO_DEBUG              Retrieves the current status of the SO_DEBUG option. 
  7157.  
  7158.  SO_DONTROUTE          Retrieves the current status of the SO_DONTROUTE option. 
  7159.                        When this option is enabled, it causes outgoing messages 
  7160.                        to bypass the standard routing algorithm and be directed 
  7161.                        to the appropriate network interface, according to the 
  7162.                        network portion of the destination address. When 
  7163.                        enabled, packets can be sent only to directly connected 
  7164.                        networks (networks for which this host has an 
  7165.                        interface). 
  7166.  
  7167.  SO_ERROR              Returns any pending error on the socket and clears the 
  7168.                        error status.  It can be used to check for asynchronous 
  7169.                        errors on connected datagram sockets or for other 
  7170.                        asynchronous errors (errors that are not returned 
  7171.                        explicitly by one of the socket calls). 
  7172.  
  7173.  SO_KEEPALIVE          (Stream sockets only.) Retrieves the current status of 
  7174.                        the SO_KEEPALIVE option. TCP uses a timer called the 
  7175.                        keepalive timer.  This timer is used to monitor idle 
  7176.                        connections that might have been disconnected because of 
  7177.                        a peer crash or timeout. When this option is enabled, a 
  7178.                        keepalive packet is periodically sent to the peer.  This 
  7179.                        is mainly used to allow servers to close connections 
  7180.                        that are no longer active as a result of clients going 
  7181.                        away without properly closing connections. 
  7182.  
  7183.  SO_LINGER             (Stream sockets only.) Retrieves the current status of 
  7184.                        the SO_LINGER option.  When this option is enabled and 
  7185.                        there is unsent data present when soclose() is called, 
  7186.                        the calling application is blocked during the soclose() 
  7187.                        call until the data is transmitted or the connection has 
  7188.                        timed out. When this option is disabled, the soclose() 
  7189.                        call returns without blocking the caller, and TCP waits 
  7190.                        to try to send the data. Although the data transfer is 
  7191.                        usually successful, it cannot be guaranteed, because TCP 
  7192.                        waits only a finite amount of time to send the data. 
  7193.  
  7194.                        The optval parameter points to a linger structure, 
  7195.                        defined in <SYS\SOCKET.H>: 
  7196.  
  7197.                                                    Field          Description
  7198.                        l_onoff             Option on/off 
  7199.                        l_linger            Linger time 
  7200.  
  7201.                        The l_onoff field is set to zero if the SO_LINGER option 
  7202.                        is being disabled. A nonzero value enables the option. 
  7203.  
  7204.                        The l_linger field specifies the amount of time in 
  7205.                        seconds to linger on close. A value of zero will cause 
  7206.                        soclose() to wait until the disconnect completes. 
  7207.  
  7208.  SO_L_BROADCAST        Gets limited broadcast sent on all interfaces. 
  7209.  
  7210.  SO_OPTIONS            Gets the current socket options from the stack. The 
  7211.                        socket option flags are returned as a 32-bit variable. 
  7212.                        The so_xxx socket option flags are defined in 
  7213.                        <SYS\SOCKET.H>. 
  7214.  
  7215.  SO_OOBINLINE          (Stream sockets only.) Retrieves the current status of 
  7216.                        the SO_OOBINLINE option. When this option is enabled, it 
  7217.                        causes out-of-band data to be placed in the normal data 
  7218.                        input queue as it is received, making it available to 
  7219.                        recv(), and recvfrom() without having to specify the 
  7220.                        MSG_OOB flag in those calls.  When this option is 
  7221.                        disabled, it causes out-of-band data to be placed in the 
  7222.                        priority data input queue as it is received, making it 
  7223.                        available to recv() and recvfrom() only by specifying 
  7224.                        the MSG_OOB flag in those calls. 
  7225.  
  7226.  SO_RCVBUF             Retrieves buffer size for input. This value tailors the 
  7227.                        receive buffer size for specific application needs, such 
  7228.                        as increasing the buffer size for high-volume 
  7229.                        connections. 
  7230.  
  7231.  SO_RCV_SHUTDOWN       Returns true if shutdown was called for receive. 
  7232.  
  7233.  SO_RCVLOWAT           Retrieves the receive low watermark. 
  7234.  
  7235.  SO_RCVTIMEO           Retrieves the receive timeout. The optval parameter is a 
  7236.                        pointer to a timeval structure, which is defined in 
  7237.                        <SYS\TIME.H>. 
  7238.  
  7239.  SO_REUSEADDR          (Stream and datagram sockets only.) Retrieves the 
  7240.                        current status of the SO_REUSEADDR option. When this 
  7241.                        option is enabled,  local addresses that are already in 
  7242.                        use can be bound. This alters the normal algorithm used 
  7243.                        in the bind() call. At connect time, the system checks 
  7244.                        to be sure that no local address and port have the same 
  7245.                        foreign address and port. The error SOCEADDRINUSE is 
  7246.                        returned if the association already exists. 
  7247.  
  7248.  SO_REUSEPORT          (Stream and datagram sockets only.) Retrieves the 
  7249.                        current status of the SO_REUSEPORT option. This option 
  7250.                        specifies that the rules used in validating ports 
  7251.                        supplied by a subroutine of the bind() call should 
  7252.                        allow reuse of a local port/address combination.  Each 
  7253.                        binding of the port/address combination must specify the 
  7254.                        socket option.  This option enables or disables the 
  7255.                        reuse of local port/address combinations. 
  7256.  
  7257.  SO_SNDBUF             Retrieves the send buffer size. This value tailors the 
  7258.                        send buffer size for specific application needs, such as 
  7259.                        increasing the buffer size for high-volume connections. 
  7260.  
  7261.  SO_SND_SHUTDOWN       Returns true if the shutdown function was called as part 
  7262.                        of the send() call. 
  7263.  
  7264.  SO_SNDLOWAT           Retrieves the send low watermark. 
  7265.  
  7266.  SO_SNDTIMEO           Retrieves the send timeout. optval is a pointer to a 
  7267.                        timeval structure, which is defined in <SYS\TIME.H>. 
  7268.  
  7269.  SO_TYPE               Retrieves the socket type.  On return, the integer 
  7270.                        pointed to by optval is set to one of the following: 
  7271.                        SOCK_STREAM, SOCK_DGRAM, or SOCK_RAW. 
  7272.  
  7273.  SO_USELOOPBACK        Bypasses hardware when possible. 
  7274.  
  7275.  Supported getsockopt() Socket Options for IPPROTO_IP 
  7276.  
  7277.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7278.   ΓöéOption Name         Description              Data Type     Boolean Γöé
  7279.   Γöé                                                           or ValueΓöé
  7280.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7281.   ΓöéIP_HDRINCL          Header is included with  int           Boolean Γöé
  7282.   Γöé                    data                                           Γöé
  7283.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7284.   ΓöéIP_MULTICAST_IF     Default interface for    struct        Value   Γöé
  7285.   Γöé                    outgoing multicasts      in_addr               Γöé
  7286.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7287.   ΓöéIP_MULTICAST_LOOP   Loopback of outgoing     uchar         Boolean Γöé
  7288.   Γöé                    multicast                                      Γöé
  7289.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7290.   ΓöéIP_MULTICAST_TTL    Default TTL for outgoing uchar         Value   Γöé
  7291.   Γöé                    multicast                                      Γöé
  7292.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7293.   ΓöéIP_OPTIONS          IP options               char *        Value   Γöé
  7294.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7295.   ΓöéIP_RECVDSTADDR      Queueing IP destination  int           Boolean Γöé
  7296.   Γöé                    address                                        Γöé
  7297.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7298.   ΓöéIP_RECVTRRI         Queueing token ring      int           Boolean Γöé
  7299.   Γöé                    routing information                            Γöé
  7300.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7301.   ΓöéIP_RETOPTS          IP options               char *        Value   Γöé
  7302.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7303.   ΓöéIP_TOS              IP type of service for   int           Value   Γöé
  7304.   Γöé                    outgoing datagrams                             Γöé
  7305.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7306.   ΓöéIP_TTL              IP time to live for      int           Value   Γöé
  7307.   Γöé                    outgoing datagrams                             Γöé
  7308.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7309.  
  7310.  The following options are recognized for IPPROTO_IP: 
  7311.  
  7312.   Option                   Description
  7313.  
  7314.  IP_HDRINCL               (Raw sockets only.) Specifies whether the IP header 
  7315.                           is included with data. 
  7316.  
  7317.  IP_MULTICAST_IF          Retrieves the default interface for outgoing 
  7318.                           multicasts. 
  7319.  
  7320.  IP_MULTICAST_LOOP        Retrieves the value of the loopback setting for 
  7321.                           outgoing multicast. 
  7322.  
  7323.  IP_MULTICAST_TTL         Retrieves the default time to live for outgoing 
  7324.                           multicast packets. 
  7325.  
  7326.  IP_OPTIONS               Retrieves IP options. Same as IP_RETOPTS. 
  7327.  
  7328.                           The data type is char * ip_retopts[4], such as 
  7329.  
  7330.                                                     ip_retopts[0]=IPOPT_OPTVAL
  7331.                                                     ip_retopts[1]=IPOPT_OLEN
  7332.                                                     ip_retopts[2]=IPOPT_OFFSET
  7333.                                                     ip_retopts[3]=IPOPT_MINOFF
  7334.                           For an example that uses IP_RETOPTS, see Example of 
  7335.                           IP_RETOPTS Socket Call. 
  7336.  
  7337.  IP_RECVDSTADDR           (UDP only.) Retrieves queueing IP destination 
  7338.                           address. This option must get this information 
  7339.                           through a recvmsg() call. For more information, see 
  7340.                           Example of recvmsg() Call. 
  7341.  
  7342.  IP_RECVTRRI              (UDP packets on token ring only.) Retrieves the flag 
  7343.                           that indicates whether queueing of token ring routing 
  7344.                           information is enabled. This TTRI information must be 
  7345.                           received as control data through a recvmsg() call. 
  7346.                           For more information , see Example of recvmsg() Call. 
  7347.  
  7348.  IP_RETOPTS               Retrieves IP options to be included in outgoing 
  7349.                           datagrams. 
  7350.  
  7351.                           The data type is char * ip_retopts[4], such as 
  7352.  
  7353.                                                     ip_retopts[0]=IPOPT_OPTVAL
  7354.                                                     ip_retopts[1]=IPOPT_OLEN
  7355.                                                     ip_retopts[2]=IPOPT_OFFSET
  7356.                                                     ip_retopts[3]=IPOPT_MINOFF
  7357.  
  7358.                           For an example that uses IP_RETOPTS, see Example of 
  7359.                           IP_RETOPTS Socket Call. 
  7360.  
  7361.  IP_TOS                   Retrieves IP type of service for outgoing datagrams. 
  7362.  
  7363.  IP_TTL                   Retrieves IP time to live value for outgoing 
  7364.                           datagrams. 
  7365.  
  7366.  Supported getsockopt() Socket Options for IPPROTO_TCP 
  7367.  
  7368.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7369.   ΓöéOption Name       Description               Data Type     Boolean  Γöé
  7370.   Γöé                                                          or Value Γöé
  7371.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7372.   ΓöéTCP_CC            Connection count function int           Boolean  Γöé
  7373.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7374.   ΓöéTCP_MAXSEG        Maximum segment size      int           Value    Γöé
  7375.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7376.   ΓöéTCP_MSL           TCP MSL value             int           Value    Γöé
  7377.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7378.   ΓöéTCP_NODELAY       Don't delay send to       int           Boolean  Γöé
  7379.   Γöé                  coalesce packets                                 Γöé
  7380.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7381.   ΓöéTCP_TIMESTMP      Time stamp function       int           Boolean  Γöé
  7382.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7383.   ΓöéTCP_WINSCALE      Window scale function     int           Boolean  Γöé
  7384.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7385.  
  7386.  The following options are recognized for IPPROTO_TCP: 
  7387.  
  7388.   Option                Description
  7389.  
  7390.  TCP_CC                (T/TCP only.) Retrieves the connection count function 
  7391.                        enabled/disabled status flag (RFC 1644). For more 
  7392.                        information about T/TCP, see TCP Extensions for 
  7393.                        Transactions (T/TCP). 
  7394.  
  7395.  TCP_MAXSEG            Retrieves the maximum segment size. 
  7396.  
  7397.  TCP_MSL               Retrieves the TCP Maximum Segment Lifetime (MSL) value. 
  7398.  
  7399.  TCP_NODELAY           (Stream sockets only.) Retrieves the current status of 
  7400.                        the TCP_NODELAY option. Disables the buffering algorithm 
  7401.                        so that the client's TCP sends small packets as soon as 
  7402.                        possible.  This often has no performance effects on 
  7403.                        LANs, but can degrade performance on WANs. 
  7404.  
  7405.  TCP_TIMESTMP          (T/TCP only.) Retrieves the TCP timestamp function 
  7406.                        enabled/disabled status flag (RFC 1323). For more 
  7407.                        information about high performance, see TCP Extensions 
  7408.                        for High Performance (RFC 1323). 
  7409.  
  7410.  TCP_WINSCALE          (T/TCP only) Retrieves the window scale function 
  7411.                        enabled/disabled status flag (RFC 1323). For more 
  7412.                        information about high performance, see TCP Extensions 
  7413.                        for High Performance (RFC 1323). 
  7414.  
  7415.  Supported getsockopt() Socket Options for NBPROTO_NB 
  7416.  
  7417.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7418.   ΓöéOption Name       Description               Data Type     Boolean  Γöé
  7419.   Γöé                                                          or Value Γöé
  7420.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7421.   ΓöéNB_DGRAM_TYPE     Type of datagrams to      int           Value    Γöé
  7422.   Γöé                  receive                                          Γöé
  7423.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7424.  
  7425.  The following option is recognized for NBPROTO_NB: 
  7426.  
  7427.   Option                Description
  7428.  
  7429.  NB_DGRAM_TYPE         (Datagram sockets only.) Retrieves the type of datagrams 
  7430.                        to be received on the socket.  The possible values are: 
  7431.  
  7432.                        NB_DGRAM               The socket is to receive normal 
  7433.                                               (unicast) datagrams only. 
  7434.  
  7435.                        NB_BROADCAST           The socket is to receive 
  7436.                                               broadcast datagrams only. 
  7437.  
  7438.                        NB_DGRAM_ANY           The socket can receive both 
  7439.                                               normal or broadcast datagrams. 
  7440.  
  7441.  Return Values 
  7442.  
  7443.  The value 0 indicates success; the value -1 indicates an error. You can get 
  7444.  the specific error code by calling sock_errno() or psock_errno(). 
  7445.  
  7446.  sock_errno() Value       Description
  7447.  
  7448.  SOCEADDRINUSE            The address is already in use. 
  7449.  
  7450.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  7451.  
  7452.  SOCEFAULT                Using optval and optlen parameters would result in an 
  7453.                           attempt to access memory outside the caller's address 
  7454.                           space. 
  7455.  
  7456.  SOCENOPROTOOPT           The optname parameter or level parameter is not 
  7457.                           recognized. 
  7458.  
  7459.  Examples 
  7460.  
  7461.  The following are examples of the getsockopt() call. See setsockopt() for 
  7462.  examples of how the options are set. 
  7463.  
  7464.   int rc;
  7465.   int s;
  7466.   int optval;
  7467.   int optlen;
  7468.   struct linger lstruct;
  7469.   int getsockopt(int s, int level, int optname, char *optval, int *optlen);
  7470.   /* extracted from sys/socket.h */
  7471.   ...
  7472.   /* Is out of band data in the normal input queue? */
  7473.   optlen = sizeof(int);
  7474.   rc = getsockopt( s, SOL_SOCKET, SO_OOBINLINE, (char *) &optval, &optlen);
  7475.   if (rc == 0)
  7476.   {
  7477.       if (optlen == sizeof(int))
  7478.       {
  7479.            if (optval)
  7480.               /* yes it is in the normal queue */
  7481.            else
  7482.               /* no it is not                  */
  7483.       }
  7484.   }
  7485.   ...
  7486.   /* Do I linger on close? */
  7487.   optlen = sizeof(lstruct);
  7488.   rc = getsockopt( s, SOL_SOCKET, SO_LINGER, (char *) &lstruct, &optlen);
  7489.   if (rc == 0)
  7490.   {
  7491.       if (optlen == sizeof(lstruct))
  7492.       {
  7493.           if (lstruct.l_onoff)
  7494.              /* yes I linger */
  7495.           else
  7496.              /* no I do not  */
  7497.       }
  7498.   }
  7499.  
  7500.  The following is an example of the ip_retopts socket option. 
  7501.  
  7502.  
  7503.   Example of IP_RETOPTS Socket Call
  7504.  
  7505.   /* [0]:IPOPT_OPTVAL, [1]:IPOPT_OLEN, [2]:IPOPT_OFFSET, [3]:IPOPT_MINOFF */
  7506.   char ip_retopts[8];
  7507.  
  7508.   main()
  7509.   {
  7510.       int optlen, sraw, i;
  7511.  
  7512.  
  7513.       if ((sraw = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
  7514.           psock_errno("Socket()");
  7515.  
  7516.       printf("IP_RETOPTS or OP_OPTIONS will get/set the IP options \n");
  7517.       ip_retopts[IPOPT_OPTVAL] = IPOPT_TS ;    /* TimeStamp IP options to set */
  7518.       ip_retopts[IPOPT_OLEN]   = 8;
  7519.       ip_retopts[IPOPT_OFFSET] = 4;
  7520.       ip_retopts[IPOPT_MINOFF] = 4;
  7521.  
  7522.       printf("Setting the IP_RETOPTS to TimeStamp option (%d) \n",
  7523.                             ip_retopts[IPOPT_OPTVAL]);
  7524.       if (setsockopt(sraw,IPPROTO_IP,IP_RETOPTS,(char *)&ip_retopts[0] ,
  7525.                             sizeof(ip_retopts)) < 0)
  7526.           psock_errno("setsockopt() IP_RETOPTS");
  7527.  
  7528.       /* NOTE ::: when the getsockopt returns it will stick in the first hop    */
  7529.       /*          destination in the first 4 bytes by shifting all data right.  */
  7530.       memset(ip_retopts, 0, sizeof(ip_retopts));
  7531.       printf("Get the ip_retopts value set for this socket\n");
  7532.       optlen = sizeof(ip_retopts);
  7533.       if (getsockopt(sraw,IPPROTO_IP,IP_OPTIONS,(char *)ip_retopts,&optlen) < 0) {
  7534.           psock_errno("getsockopt() IP_RETOPTS ");
  7535.       }
  7536.       else {
  7537.          if  (ip_retopts[4+IPOPT_OPTVAL] == IPOPT_TS)
  7538.            printf ("IP_RETOPTS now set to TimeStamp option(%d) \n",
  7539.                       ip_retopts[4+IPOPT_OPTVAL]);
  7540.          else
  7541.            printf ("IP_RETOPTS now set to ??? (%d) \n",
  7542.                       ip_retopts[4+IPOPT_OPTVAL]);
  7543.       }
  7544.  
  7545.       soclose(sraw);
  7546.   }
  7547.  
  7548.  Related Calls 
  7549.  
  7550.       bind() 
  7551.       endprotoent() 
  7552.       getprotobyname() 
  7553.       getprotobynumber() 
  7554.       getprotoent() 
  7555.       setprotoent() 
  7556.       setsockopt() 
  7557.       sock_errno() 
  7558.       socket() 
  7559.  
  7560.  
  7561. ΓòÉΓòÉΓòÉ 12.8. ioctl() ΓòÉΓòÉΓòÉ
  7562.  
  7563. The ioctl() socket call performs special operations on sockets. 
  7564.  
  7565. Syntax 
  7566.  
  7567. #include <types.h>
  7568. #include <sys\socket.h>
  7569. #include <sys\ioctl.h>
  7570. #include <net\route.h>
  7571. #include <net\if.h>
  7572. #include <net\if_arp.h>
  7573. int ioctl(s, cmd, data)
  7574. int s;
  7575. int cmd;
  7576. caddr_t data;
  7577.  
  7578. Parameters 
  7579.  
  7580.  s 
  7581.    Socket descriptor. 
  7582.  
  7583.  cmd 
  7584.    Command to perform. 
  7585.  
  7586.  data 
  7587.    Pointer to the data associated with cmd. 
  7588.  
  7589.  Description 
  7590.  
  7591.  This call controls the operating characteristics of sockets. The data 
  7592.  parameter is a pointer to data associated with the particular command, and its 
  7593.  format depends on the command that is requested. 
  7594.  
  7595.   Option             Description
  7596.  
  7597.  FIOASYNC           This option has no effect. 
  7598.  
  7599.  FIONBIO            Sets or clears nonblocking input/output for a socket. When 
  7600.                     this option is set, input/output calls will not block until 
  7601.                     the call is completed. The data parameter is a pointer to 
  7602.                     an integer. If the integer is 0, nonblocking input/output 
  7603.                     on the socket is cleared. Otherwise, the socket is set for 
  7604.                     nonblocking input/output. 
  7605.  
  7606.  FIONREAD           Gets the number of immediately readable bytes for the 
  7607.                     socket. The data parameter is a pointer to an integer. Sets 
  7608.                     the value of the integer to the number of immediately 
  7609.                     readable characters for the socket. 
  7610.  
  7611.  Internet: The following ioctl commands are supported for the internet domain: 
  7612.  
  7613.   Option             Description
  7614.  
  7615.  OSIOCGIFADDR       Provided for compatibility with releases of TCP/IP prior to 
  7616.                     4.1. The data parameter is a pointer to an ifreq structure. 
  7617.                     The interface address is returned in the old sockaddr 
  7618.                     format in the argument. 
  7619.  
  7620.  OSIOCGIFDSTADDR    Provided for compatibility with releases of TCP/IP prior to 
  7621.                     4.1. The data parameter is a pointer to an ifreq structure. 
  7622.                     The destination address is returned in the old sockaddr 
  7623.                     format in the argument. 
  7624.  
  7625.  OSIOCGIFBRDADDR    Provided for compatibility with releases of TCP/IP prior to 
  7626.                     4.1. The data parameter is a pointer to an ifreq structure. 
  7627.                     The broadcast address is returned in the old sockaddr 
  7628.                     format in the argument. 
  7629.  
  7630.  OSIOCGIFCONF       Provided for compatibility with releases of TCP/IP prior to 
  7631.                     4.1. The data parameter is a pointer to an ifreq structure. 
  7632.                     The interface configuration is returned in the old sockaddr 
  7633.                     format in the argument. 
  7634.  
  7635.  OSIOCGIFNETMASK    Provided for compatibility with releases of TCP/IP prior to 
  7636.                     4.1. The data parameter is a pointer to an ifreq structure. 
  7637.                     The interface netmask is returned in the old sockaddr 
  7638.                     format in the argument. 
  7639.  
  7640.  SIOCADDMULTI       Adds a 48-bit physical multicast address.  This works only 
  7641.                     for Ethernet. The data parameter is a pointer to an ifreq 
  7642.                     structure. 
  7643.  
  7644.  SIOCADDRT          Adds a routing table entry.  The data parameter is a 
  7645.                     pointer to an rtentry structure, as defined in 
  7646.                     <NET\ROUTE.H>. The routing table entry, passed as an 
  7647.                     argument, is added to the routing tables. 
  7648.  
  7649.  SIOCAIFADDR        Adds an IP address for an interface. The data parameter is 
  7650.                     a pointer to an ifaliasreq structure, which is defined in 
  7651.                     <NET\IF.H> 
  7652.  
  7653.  SIOCARP            Sends an ARP request to all interfaces for a given IP 
  7654.                     address. The data parameter is a pointer to the IP address 
  7655.                     in the type of an unsigned long integer. 
  7656.  
  7657.  SIOCATMARK         Queries whether the current location in the data input is 
  7658.                     pointing to out-of-band data. The data parameter is a 
  7659.                     pointer to an integer. Sets the argument to 1 if the socket 
  7660.                     points to a mark in the data stream for out-of-band data. 
  7661.                     Otherwise, sets the argument to 0. 
  7662.  
  7663.  SIOCDARP           Deletes an arp table entry. The data parameter is a pointer 
  7664.                     to an arpreq as defined in <NET\IF_ARP.H>.  The arp table 
  7665.                     entry passed as an argument is deleted from the arp tables, 
  7666.                     if it exists. 
  7667.  
  7668.  SIOCDELMULTI       (Ethernet only.) Deletes a 48-bit physical multicast 
  7669.                     address.  The data parameter is a pointer to an ifreq 
  7670.                     structure, which is defined in <NET\IF.H>. 
  7671.  
  7672.  SIOCDELRT          Deletes a routing table entry. The data parameter is a 
  7673.                     pointer to a rtentry structure, as defined in 
  7674.                     <NET\ROUTE.H>. If it exists, the routing table entry passed 
  7675.                     as an argument is deleted from the routing tables. 
  7676.  
  7677.  SIOCDIFADDR        Deletes an IP address for an interface. The data parameter 
  7678.                     is a pointer to an ifreq structure, defined in <NET\IF.H>. 
  7679.  
  7680.  SIOCGARP           Gets the arp table entries. The data parameter is a pointer 
  7681.                     to an arpreq structure, as defined in <NET\IF_ARP.H>. The 
  7682.                     arp table entry passed as an argument is returned from the 
  7683.                     arp tables if it exists. 
  7684.  
  7685.  SIOCGARP_TR        Gets the token-ring arp table entries with routing 
  7686.                     information field. The data parameter is a pointer to an 
  7687.                     arpreq_tr structure, as defined in <NET\IF_ARP.H>. The arp 
  7688.                     table entry from the arp table is returned if it exists. 
  7689.  
  7690.  SIOCGIFADDR        Gets the network interface address. The data parameter is a 
  7691.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7692.                     The interface address is returned in the argument. 
  7693.  
  7694.  SIOCGIFBOUND       Checks the number of Medium Access Control (MAC) drivers 
  7695.                     that will be bound or have been bound. The data parameter 
  7696.                     is a pointer to a bndreq structure, defined in 
  7697.                     <SYS\IOCTLOS2.H>. The bindinds variable in the structure 
  7698.                     will return the number of MAC drivers that the INET 
  7699.                     protocol will bind to, and the bound variable will return 
  7700.                     the number of MAC drivers that have been bound. 
  7701.  
  7702.  SIOCGIFBRDADDR     Gets the network interface broadcast address. The data 
  7703.                     parameter is a pointer to an ifreq structure, as defined in 
  7704.                     <NET\IF.H>. The interface broadcast address is returned in 
  7705.                     the argument. 
  7706.  
  7707.  SIOCGIFCONF        Gets the network interface configuration. The data 
  7708.                     parameter is a pointer to an ifconf structure, as defined 
  7709.                     in <NET\IF.H>.  The interface configuration is returned in 
  7710.                     the argument. It is important to note that the ifconf 
  7711.                     structure changed in TCP/IP 4.1. 
  7712.  
  7713.  SIOCGIFDSTADDR     Gets the network interface destination address. The data 
  7714.                     parameter is a pointer to an ifreq structure, as defined in 
  7715.                     <NET\IF.H>. The interface destination (point-to-point) 
  7716.                     address is returned in the argument. 
  7717.  
  7718.  SIOCGIFEFLAGS      Gets extended flags for the interface. The data parameter 
  7719.                     is a pointer to an ifreq structure, as defined in 
  7720.                     <NET\IF.H>. The interface extended flags are returned in 
  7721.                     the ifr_eflags field. 
  7722.  
  7723.  SIOCGIFFLAGS       Gets the network interface flags. The data parameter is a 
  7724.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7725.                     The interface flags are returned in the ifr_flags field. 
  7726.  
  7727.  SIOCGIFMETRIC      Gets the network interface routing metric. The data 
  7728.                     parameter is a pointer to an ifreq structure, as defined in 
  7729.                     <NET\IF.H>.  The interface routing metric is returned in 
  7730.                     the ifr_metric field. 
  7731.  
  7732.  SIOCGIFMTU         Gets the interface MTU value. The data parameter is a 
  7733.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7734.                     The interface MTU is returned in the ifr_metric field. 
  7735.  
  7736.  SIOCGIFNETMASK     Gets the network interface network mask. The data parameter 
  7737.                     is a pointer to an ifreq structure, as defined in 
  7738.                     <NET\IF.H>. The interface network mask is returned in the 
  7739.                     ifr_dstaddr field. 
  7740.  
  7741.  SIOCGIFTRACE       Gets data from the interface input/output tracing buffer. 
  7742.                     The data parameter is a pointer to an ifreq structure, as 
  7743.                     defined in <NET\IF.H>. The ifr_data field should point to 
  7744.                     the pkt_trace_hdr structure as defined in <NET\IF.H>. 
  7745.  
  7746.  SIOCGIFVALID       Checks if the interface is valid. The data parameter is a 
  7747.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7748.  
  7749.  SIOCGMCAST         Gets the joined multicast addresses for the interface. The 
  7750.                     data parameter is a pointer to an addrreq structure, as 
  7751.                     defined in <NET\IF.H>. 
  7752.  
  7753.  SIOCGMSL           Gets the TCP Maximum Segment Lifetime (MSL) value, in 
  7754.                     seconds. 
  7755.  
  7756.  SIOCGSTAT          Gets the serial link interface statistics. The data 
  7757.                     parameter is a pointer to an ifreq structure, as defined in 
  7758.                     <NET\IF.H>. The ifr_data field should point to an ifstat 
  7759.                     structure, as defined in <NET\IF.H>. 
  7760.  
  7761.  SIOCGUNIT          Gets the interface unit number. 
  7762.  
  7763.  SIOCMULTISBC       Use broadcast for physical transmission of IP multicast 
  7764.                     datagrams (RFC 1469). 
  7765.  
  7766.  SIOCMULTISFA       Use functional address for physical transmission of IP 
  7767.                     multicast datagrams (RFC 1469). 
  7768.  
  7769.  SIOCSARP            Sets an arp table entry. The data parameter is a pointer 
  7770.                     to an arpreq as defined in <NET\IF_ARP.H>.  The arp table 
  7771.                     entry passed as an argument is added to the arp tables. 
  7772.  
  7773.  SIOCSARP_TR        Sets a token-ring arp table entry with routing information. 
  7774.                     The data parameter is a pointer to an arp_req structure, as 
  7775.                     defined in <NET\IF_ARP.H>. 
  7776.  
  7777.  SIOCSHOSTID        Sets the IP address of the host that will be displayed by 
  7778.                     the HOSTID.EXE utility. The data parameter is a pointer to 
  7779.                     the IP address of the type of unsigned long. 
  7780.  
  7781.  SIOCSIF802_3       Sets the interface to send packets in 802.3 format. The 
  7782.                     data parameter is a pointer to an ifreq structure, as 
  7783.                     defined in <NET\IF.H>. 
  7784.  
  7785.  SIOCSIFADDR        Sets the network interface address. The data parameter is a 
  7786.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7787.                     Sets the interface address to the value passed in the 
  7788.                     argument. 
  7789.  
  7790.  SIOCSIFALLRTB      Sets the interface to use all-route broadcast, for token 
  7791.                     ring only. The data parameter is a pointer to an ifreq 
  7792.                     structure, as defined in <NET\IF.H>. 
  7793.  
  7794.  SIOCSIFBRD         Sets the interface to use single route broadcast, for token 
  7795.                     ring only. The data parameter is a pointer to an ifreq 
  7796.                     structure, as defined in <NET\IF.H>. 
  7797.  
  7798.  SIOCSIFBRDADDR     Sets the network interface broadcast address. The data 
  7799.                     parameter is a pointer to an ifreq structure, as defined in 
  7800.                     <NET\IF.H>. Sets the interface broadcast address to the 
  7801.                     value passed in the argument. 
  7802.  
  7803.  SIOCSIFDSTADDR     Sets the network interface destination address. The data 
  7804.                     parameter is a pointer to an ifreq structure, as defined in 
  7805.                     <NET\IF.H>. Sets the interface destination (point-to-point) 
  7806.                     address to the value passed in the argument. 
  7807.  
  7808.  SIOCSIFEFLAGS      Sets extended flags for the interface. The data parameter 
  7809.                     is a pointer to an ifreq structure, as defined in 
  7810.                     <NET\IF.H>. The extended flags should be passed in the 
  7811.                     ifr_eflags field. 
  7812.  
  7813.  SIOCSIFFDDI        Sets the token-ring interface to use canonical format of 
  7814.                     ARP. The data parameter is a pointer to an ifreq structure, 
  7815.                     as defined in <NET\IF.H>. 
  7816.  
  7817.  SIOCSIFFLAGS       Sets the network interface flags. The data parameter is a 
  7818.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7819.                     Sets the interface flags to the values passed in the 
  7820.                     ifr_flags field. 
  7821.  
  7822.  SIOCSIFMETRIC      Sets the network interface routing metric. The data 
  7823.                     parameter is a pointer to an ifreq structure, as defined in 
  7824.                     <NET\IF.H>.  Sets the interface routing metric to the value 
  7825.                     passed in the ifr_metric field. 
  7826.  
  7827.  SIOCSIFMTU         Sets the interface MTU value. The data parameter is a 
  7828.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7829.                     Sets the interface MTU to the value passed in the 
  7830.                     ifr_metric field. 
  7831.  
  7832.  SIOCSIFNETMASK     Sets the network interface network mask. The data parameter 
  7833.                     is a pointer to an ifreq structure, as defined in 
  7834.                     <NET\IF.H>. Sets the interface network mask to the value 
  7835.                     passed in the argument. 
  7836.  
  7837.  SIOCSIFNO802_3     Sets the interface to send packets with Ethernet header 
  7838.                     frame format. The data parameter is a pointer to an ifreq 
  7839.                     structure, as defined in <NET\IF.H>. 
  7840.  
  7841.  SIOCSIFNOFDDI      Sets the token-ring interface to use noncanonical format 
  7842.                     for ARP. 
  7843.  
  7844.  SIOCSIFNOREDIR     Disable ICMP redirect function for an interface. The data 
  7845.                     parameter is a pointer to an ifreq structure, as defined in 
  7846.                     <NET\IF.H>. 
  7847.  
  7848.  SIOCSIFRUNNINGBLK  (Token ring only.) Blocks the calling thread until the 
  7849.                     interface is back in running state. The data parameter is a 
  7850.                     pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7851.                     This is typically useful when the network cable needs to be 
  7852.                     disconnected temporarily. 
  7853.  
  7854.  SIOCSIFTRACE       Creates an interface input/output tracing packet. The data 
  7855.                     parameter is a pointer to an ifreq structure, as defined in 
  7856.                     <NET\IF.H>. The trace packet should be placed in the 
  7857.                     pkt_trace_hdr structure, as defined in <NET\IF.H>, which 
  7858.                     should be pointed to by the ifr_data field. 
  7859.  
  7860.  SIOCSIFYESREDIR    Enables ICMP redirect function for an interface. The data 
  7861.                     parameter is a pointer to an ifreq structure, as defined in 
  7862.                     <NET\IF.H>. 
  7863.  
  7864.  SIOCSMSL           Sets the TCP Maximum Segment Lifetime (MSL) value in 
  7865.                     seconds. 
  7866.  
  7867.  SIOCSRDBRD         Enables loopback for broadcast packets. 
  7868.  
  7869.  SIOCSSTAT          Sets the serial link interface statistics. The data 
  7870.                     parameter is a pointer to an ifreq structure, as defined in 
  7871.                     <NET\IF.H>. The statistics are returned in an ifstat 
  7872.                     structure pointed to by the ifr_data field. 
  7873.  
  7874.  SIOCSSYN           Sets the SYN attack prevention function flag on or off. The 
  7875.                     data parameter should point to an integer that contains 
  7876.                     zero for off and nonzero for on. The function is off by 
  7877.                     default. 
  7878.  
  7879.  SIOFLUSHRT         Flushes the entire routing table, including all routes to 
  7880.                     all interfaces. 
  7881.  
  7882.  SIOFLUSHRTIFP      Flushes all routes for the specified interface only. The 
  7883.                     data parameter is a pointer to an interface name, such as 
  7884.                     lan0. 
  7885.  
  7886.  SIOSTATCNTAT       Gets the count of ARP entries. 
  7887.  
  7888.  SIOSTATCNTRT       Gets the count of entries in the routing table. 
  7889.  
  7890.  SIOSTATICMP        Gets ICMP statistics. The data parameter is a pointer to an 
  7891.                     icmpstat structure, as defined in <NETINET\ICMP_VAR.H>. 
  7892.  
  7893.  SIOSTATICMPZ       Clears ICMP statistics. The data parameter is a pointer to 
  7894.                     an icmpstat structure, as defined in <NETINET\ICMP_VAR.H>. 
  7895.  
  7896.  SIOSTATIGMP        Gets IGMP statistics. The data parameter is a pointer to an 
  7897.                     igmpstat structure, as defined in <NETINET\IGMP_VAR.H>. 
  7898.  
  7899.  SIOSTATIGMPZ       Clears IGMP statistics. The data parameter is a pointer to 
  7900.                     an igmpstat structure, as defined in <NETINET\IGMP_VAR.H>. 
  7901.  
  7902.  SIOSTATIP          Gets IP statistics. The data parameter is a pointer to an 
  7903.                     ipstat structure, as defined in <NETINET\IP_VAR.H>. 
  7904.  
  7905.  SIOSTATIPZ         Clears IP statistics. The data parameter is a pointer to an 
  7906.                     ipstat structure, as defined in <NETINET\IP_VAR.H>. 
  7907.  
  7908.  SIOSTATMBUF        Gets memory usage status. The data parameter is a pointer 
  7909.                     to an mbstat structure, as defined in <SYS\MBUF.H>. 
  7910.  
  7911.  SIOSTATTCP         Gets TCP statistics. The data parameter is a pointer to a 
  7912.                     tcpstat structure, as defined in <NETINET\TCP_VAR.H>. 
  7913.  
  7914.  SIOSTATTCPZ        Clears TCP statistics. The data parameter is a pointer to a 
  7915.                     tcpstat structure, as defined in <NETINET\TCP_VAR.H>. 
  7916.  
  7917.  SIOSTATUDP         Gets UDP statistics. The data parameter is a pointer to a 
  7918.                     udpstat structure, as defined in <NETINET\UDP_VAR.H>. 
  7919.  
  7920.  SIOSTATUDPZ        Clears UDP statistics. The data parameter is a pointer to a 
  7921.                     udpstat structure, as defined in <NETINET\UDP_VAR.H>. 
  7922.  
  7923.  NetBIOS: The following ioctl() calls are supported for the NetBIOS domain: 
  7924.  
  7925.   Option             Description
  7926.  
  7927.  SIOCGNBNAME        Gets the NetBIOS host name. The data parameter is a pointer 
  7928.                     to a socaddr_nb structure, which is defined in 
  7929.                     <NETNB\NB.H>. 
  7930.  
  7931.  SIOCGNCBFN         Issues ncb.find.name. The data parameter is a pointer to a 
  7932.                     socaddr_nb structure, which is defined in <NETNB\NB.H>. 
  7933.  
  7934.  SIOCSNBNAME        Sets the NetBIOS host name. The data parameter is a pointer 
  7935.                     to a socaddr_nb structure, which is defined in 
  7936.                     <NETNB\NB.H>. 
  7937.  
  7938.  Return Values 
  7939.  
  7940.  The value 0 indicates success; the value -1 indicates an error. You can get 
  7941.  the specific error code by calling sock_errno() or psock_errno(). 
  7942.  
  7943.  sock_errno() Value       Description
  7944.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  7945.  SOCEINVAL                The request is not valid or not supported. 
  7946.  SOCEOPNOTSUPP            The operation is not supported on the socket. 
  7947.  SOCEFAULT                Using data would result in an attempt to access 
  7948.                           memory outside the caller address space. 
  7949.  
  7950.  Examples 
  7951.  
  7952.  The following is an example of the ioctl() call. 
  7953.  
  7954.   int s;
  7955.   int dontblock;
  7956.   int rc;
  7957.   int ioctl(int s, int cmd, caddr_t data);  /* extracted from sys\socket.h */
  7958.   ...
  7959.   /* Place the socket into nonblocking mode */
  7960.   dontblock = 1;
  7961.   rc = ioctl(s, FIONBIO, (char *) &dontblock);
  7962.   ...
  7963.  
  7964.  Related Calls 
  7965.  
  7966.       os2_ioctl() 
  7967.       sock_errno() 
  7968.  
  7969.  
  7970. ΓòÉΓòÉΓòÉ 12.9. listen() ΓòÉΓòÉΓòÉ
  7971.  
  7972. The listen() socket call completes the binding necessary for a socket to accept 
  7973. connections and creates a connection request queue for incoming requests. 
  7974.  
  7975. Syntax 
  7976.  
  7977. #include <types.h>
  7978. #include <sys\socket.h>
  7979. #include <netinet\in.h>
  7980. int listen(s, backlog)
  7981. int s;
  7982. int backlog;
  7983.  
  7984. Parameters 
  7985.  
  7986.  s 
  7987.    Socket descriptor. 
  7988.  
  7989.  backlog 
  7990.    Controls the maximum queue length for pending connections. 
  7991.  
  7992.  Description 
  7993.  
  7994.  The listen() call performs two tasks: 
  7995.  
  7996.    1. Completes the binding necessary for a socket s, if bind() has not been 
  7997.       called for s 
  7998.  
  7999.    2. Creates a connection request queue of length backlog, to queue incoming 
  8000.       connection requests. 
  8001.  When the queue is full, additional connection requests are ignored.
  8002.  
  8003.  The listen() call indicates a readiness to accept client connection requests. 
  8004.  It transforms an active socket into a passive socket.  After listen() is 
  8005.  called, s can never be used as an active socket to initiate connection 
  8006.  requests. listen() is called after allocating a socket with socket() and after 
  8007.  binding a name to s with bind().  listen() must be called before calling 
  8008.  accept(). 
  8009.  
  8010.  listen() can only be called on connection-oriented sockets. 
  8011.  
  8012.  If the backlog parameter is less than 0, then listen() interprets backlog as 
  8013.  0. If the backlog parameter is greater than SOMAXCONN, as defined in 
  8014.  <SYS\SOCKET.H>, then listen() interprets backlog as SOMAXCONN. 
  8015.  
  8016.  Return Values 
  8017.  
  8018.  The value 0 indicates success, the value -1 indicates an error. You can get 
  8019.  the specific error code by calling sock_errno() or psock_errno(). 
  8020.  
  8021.  Error Code           Description
  8022.  SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  8023.  SOCEOPNOTSUPP        The s parameter is not a socket descriptor that supports 
  8024.                       the listen() call. 
  8025.  
  8026.  Related Calls 
  8027.  
  8028.       accept() 
  8029.       bind() 
  8030.       connect() 
  8031.       sock_errno() 
  8032.       socket() 
  8033.  
  8034.  
  8035. ΓòÉΓòÉΓòÉ 12.10. os2_ioctl() ΓòÉΓòÉΓòÉ
  8036.  
  8037. The os2_ioctl() socket call performs special operations on sockets; in 
  8038. particular, operations related to returning status from kernel. 
  8039.  
  8040. Syntax 
  8041.  
  8042. #include <types.h>
  8043. #include <sys\socket.h>
  8044. #include <sys\ioctl.h>
  8045. #include <net\route.h>
  8046. #include <net\if.h>
  8047. #include <net\if_arp.h>
  8048. int os2_ioctl(s, cmd, data, lendata)
  8049. int s;
  8050. int cmd;
  8051. caddr_t data;
  8052. int lendata;
  8053.  
  8054. Parameters 
  8055.  
  8056.  s 
  8057.    Socket descriptor. 
  8058.  
  8059.  cmd 
  8060.    Command to perform. 
  8061.  
  8062.  data 
  8063.    Pointer to the data buffer associated with cmd where returned data is 
  8064.    placed. 
  8065.  
  8066.  lendata 
  8067.    Length (in bytes) of the data to be returned in the buffer. 
  8068.  
  8069.  Description 
  8070.  
  8071.  The following os2_ioctl() commands are supported for the internet domain. The 
  8072.  data parameter is a pointer to data associated with the particular command, 
  8073.  and its format depends on the command that is requested. 
  8074.  
  8075.   Option             Description
  8076.  
  8077.  SIOSTATARP         Gets the ARP table. The data parameter is a pointer to an 
  8078.                     oarptab structure as defined in <NETINET\IF_ETHER.H>. 
  8079.  
  8080.  SIOSTATAT          Gets all interface addresses. The data parameter is a 
  8081.                     pointer to the buffer for receiving returned data. At 
  8082.                     return, the first two bytes of the buffer contain the 
  8083.                     number of returned addresses, followed by the address 
  8084.                     information for each interface address. For each address, 
  8085.                     the buffer contains: 
  8086.  
  8087.                         The IP address, of type unsigned long 
  8088.                         An interface index, of type unsigned short 
  8089.                         A netmask, of type unsigned long 
  8090.                         The broadcast address, of type unsigned long 
  8091.  
  8092.  SIOSTATIF          Gets interface statistics. The data parameter is a pointer 
  8093.                     to an ifmib structure as defined in <NET\IF.H>. 
  8094.  
  8095.  SIOSTATIF42        Gets interface statistics for all interfaces (maximum of 
  8096.                     42). The data parameter is a pointer to sequential 
  8097.                     instances of an ifmib structure as defined in <NET\IF.H>. 
  8098.  
  8099.  SIOSTATRT          Gets routing entries from the routing table. The data 
  8100.                     parameter is a pointer to an rtentries structure as defined 
  8101.                     in <NET\ROUTE.H>. 
  8102.  
  8103.  SIOSTATSO          Gets sockets' statistics. The data parameter is a pointer 
  8104.                     to sequential instances of a sostats structure as defined 
  8105.                     in <SYS\SOCKET.H>. 
  8106.  
  8107.  Return Values 
  8108.  
  8109.  The value 0 indicates success; the value -1 indicates an error. You can get 
  8110.  the specific error code by calling sock_errno() or psock_errno(). 
  8111.  
  8112.  sock_errno() Value       Description
  8113.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  8114.  SOCEINVAL                The request is not valid or not supported. 
  8115.  SOCEOPNOTSUPP            The operation is not supported on the socket. 
  8116.  SOCEFAULT                Using data and lendata would result in an attempt to 
  8117.                           access memory outside the caller address space. 
  8118.  
  8119.  Examples 
  8120.  
  8121.  The following is an example of the os2_ioctl() call. 
  8122.  
  8123.   int s;
  8124.   char buf [1024];
  8125.   int rc;
  8126.   int os2_ioctl(int s, int cmd, caddr_t data, int lendata);  /* extracted from sys\socket.h */
  8127.   ...
  8128.   rc = os2_ioctl(s, SIOSTATAT, (char *) buf, sizeof(buf));
  8129.   ...
  8130.  
  8131.  Related Calls 
  8132.  
  8133.       sock_errno() 
  8134.       ioctl() 
  8135.  
  8136.  
  8137. ΓòÉΓòÉΓòÉ 12.11. os2_select() ΓòÉΓòÉΓòÉ
  8138.  
  8139. The socket call gets read, write, and exception status on a group of sockets. 
  8140.  
  8141. With the os2_select() call, the socket numbers are specified as an array of 
  8142. integers, in which the read socket numbers are followed by write socket 
  8143. numbers, followed by the exception socket numbers. TCP/IP for OS/2 Warp 
  8144. monitors the activity on a socket by specifying the number of sockets to be 
  8145. checked for readability, readiness for writing, and exception-pending 
  8146. conditions. 
  8147.  
  8148. Syntax 
  8149.  
  8150. #include <types.h>
  8151. #include <unistd.h>
  8152. int os2_select(s, noreads, nowrites, noexcepts, timeout)
  8153. int *s;
  8154. int noreads;
  8155. int nowrites;
  8156. int noexcepts;
  8157. long timeout;
  8158.  
  8159. Parameters 
  8160.  
  8161.  s 
  8162.    Pointer to an array of socket numbers where the read socket numbers are 
  8163.    followed by the write socket numbers, and then followed by the exception 
  8164.    socket numbers. 
  8165.  
  8166.  noreads 
  8167.    Number of sockets to be checked for readability. 
  8168.  
  8169.  nowrites 
  8170.    Number of sockets to be checked for readiness for writing. 
  8171.  
  8172.  noexcepts 
  8173.    Number of sockets to be checked for exception-pending conditions. The only 
  8174.    exception-pending condition is out-of-band data in the receive buffer. 
  8175.  
  8176.  timeout 
  8177.    Maximum interval, in milliseconds, to wait for the selection to complete. 
  8178.  
  8179.  Description 
  8180.  
  8181.  This call monitors activity on a set of different sockets until a timeout 
  8182.  expires, to see if any sockets are ready for reading or writing, or if any 
  8183.  exceptional conditions are pending. 
  8184.  
  8185.  If the timeout value is 0, select() does not wait before returning. If the 
  8186.  timeout value is -1, select() does not time out, but returns when a socket 
  8187.  becomes ready. If the timeout value is a number of milliseconds, select() 
  8188.  waits for the specified interval before returning. The select() call checks 
  8189.  all indicated sockets at the same time and returns when any of them is ready. 
  8190.  
  8191.  Reinitializing the socket array every time select() is called is required. 
  8192.  
  8193.  Return Values 
  8194.  
  8195.  The number of ready sockets is returned. The value -1 indicates an error. The 
  8196.  value 0 indicates an expired time limit. If the return value is greater than 
  8197.  0, the socket numbers in s that were not ready are set to -1. You can get the 
  8198.  specific error code by calling sock_errno() or psock_errno(). 
  8199.  
  8200.  Error Code         Description
  8201.  SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  8202.  SOCEFAULT          The address is not valid. 
  8203.  SOCEINVAL          Invalid argument. 
  8204.  SOCEINTR           Interrupted system call. 
  8205.  
  8206.  Examples 
  8207.  
  8208.  The following is an example of the os2_select() call. 
  8209.  
  8210.   #define MAX_TIMEOUT  1000
  8211.   /* input_ready(insock)- Check to see if there is available input on
  8212.    * socket insock.
  8213.    * Returns 1 if input is available.
  8214.    *         0 if input is not available.
  8215.    *        -1 on error.
  8216.    */
  8217.  
  8218.   int input_ready(insock)
  8219.   int insock;                 /* input socket descriptor */
  8220.  
  8221.   {
  8222.     int socks[1];    /* array of sockets */
  8223.     long timeout = MAX_TIMEOUT;
  8224.  
  8225.     /* put socket to check in socks[] */
  8226.     socks[0] = insock;
  8227.  
  8228.     /* check for READ availability on this socket */
  8229.     return os2_select(socks, 1, 0, 0, timeout);
  8230.   }
  8231.  
  8232.  Related Calls 
  8233.  
  8234.       accept() 
  8235.       connect() 
  8236.       recv() 
  8237.       select() 
  8238.       send() 
  8239.       sock_errno() 
  8240.       socket() 
  8241.  
  8242.  
  8243. ΓòÉΓòÉΓòÉ 12.12. psock_errno() ΓòÉΓòÉΓòÉ
  8244.  
  8245. The psock_errno() socket call writes a short error message to the standard 
  8246. error device. 
  8247.  
  8248. Syntax 
  8249.  
  8250. #include <sys/socket.h>
  8251. void psock_errno(s)
  8252. char *s;
  8253.  
  8254. Parameters 
  8255.  
  8256.  s 
  8257.    Pointer to a buffer. 
  8258.  
  8259.  Description 
  8260.  
  8261.  This call writes a short error message to the standard error display 
  8262.  describing the last error encountered during a call to a socket library 
  8263.  function. If s is not a NULL pointer and does not point to a null string, the 
  8264.  string it points to is printed, followed by a colon, followed by a space, 
  8265.  followed by the message.  If s is a NULL pointer or points to a null string, 
  8266.  only the message is printed. 
  8267.  
  8268.  The error code is acquired by calling sock_errno().  The error code is set 
  8269.  when errors occur.  Subsequent socket calls do not clear the error code. 
  8270.  
  8271.  Related Calls 
  8272.  
  8273.       sock_errno() 
  8274.  
  8275.  
  8276. ΓòÉΓòÉΓòÉ 12.13. readv() ΓòÉΓòÉΓòÉ
  8277.  
  8278. The readv() socket call receives data on a socket into a set of buffers. 
  8279.  
  8280. Syntax 
  8281.  
  8282. #include <types.h>
  8283. #include <sys/uio.h>
  8284. int readv(s, iov, iovcnt)
  8285. int s;
  8286. struct iovec *iov;
  8287. int iovcnt;
  8288.  
  8289. Parameters 
  8290.  
  8291.  s 
  8292.    Socket descriptor. 
  8293.  
  8294.  iov 
  8295.    Pointer to an array of iovec structures. 
  8296.  
  8297.  iovcnt 
  8298.    Number of iovec structures pointed to by the iov parameter. The maximum 
  8299.    number of iovec structures is 1024. 
  8300.  
  8301.  Description 
  8302.  
  8303.  This call reads data on a socket with descriptor s and stores it in a set of 
  8304.  buffers. The data is scattered into the buffers specified by 
  8305.  iov[0]...iov[iovcnt-1]. The iovec structure is defined in <SYS/UIO.H> and 
  8306.  contains the following fields: 
  8307.  
  8308.   Field          Description
  8309.  iov_base       Points to the buffer 
  8310.  iov_len        Length of the buffer 
  8311.  
  8312.  The readv() call applies only to connected sockets. For information on how to 
  8313.  use readv() with datagram and raw sockets, see Datagram or Raw Sockets. 
  8314.  
  8315.  TCP/IP alters iov_base and iov_len for each element in the input struct iovec 
  8316.  array. iov_base will point to the next character of the processed (sent or 
  8317.  received) data on the original buffer, and iov_len will become (input value - 
  8318.  processed length). Thus if only partial data has been sent or received and the 
  8319.  application expects more data to send or receive, it can pass the same iovec 
  8320.  structure back in a subsequent call. 
  8321.  
  8322.  This call returns up to the number of bytes in the buffers pointed to by the 
  8323.  iov parameter.  This number is the sum of all iov_len fields. If less than the 
  8324.  number of bytes requested is available, the call returns the number currently 
  8325.  available. If data is not available at the socket with descriptor s, the 
  8326.  readv() call waits for data to arrive and blocks the caller, unless the socket 
  8327.  is in nonblocking mode. See ioctl() for a description of how to set 
  8328.  nonblocking mode. The UDP sockets can send and receive datagrams as large as 
  8329.  32739 bytes (32 * 1024 -1 - IP header (20 bytes) - UDP header (8 bytes)). 
  8330.  
  8331.  Return Values 
  8332.  
  8333.  When successful, the number of bytes of data received into the buffer is 
  8334.  returned. The value -1 indicates an error. You can get the specific error code 
  8335.  by calling sock_errno() or psock_errno(). 
  8336.  
  8337.  sock_errno() Value       Description
  8338.  
  8339.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  8340.  
  8341.  SOCEFAULT                Using iov and iovcnt would result in an attempt to 
  8342.                           access memory outside the caller's address space. 
  8343.  
  8344.  SOCEINTR                 Interrupted system call. 
  8345.  
  8346.  SOCEINVAL                iovcnt was not valid, or one of the fields in the iov 
  8347.                           array was not valid. 
  8348.  
  8349.  SOCEWOULDBLOCK           The s parameter is in nonblocking mode and no data is 
  8350.                           available to read, or the SO_RCVTIMEO option has been 
  8351.                           set for socket s and the timeout expired before any 
  8352.                           data arrived to read. 
  8353.  
  8354.  Related Calls 
  8355.  
  8356.       accept() 
  8357.       connect() 
  8358.       getsockopt() 
  8359.       ioctl() 
  8360.       recv() 
  8361.       recvfrom() 
  8362.       recvmsg() 
  8363.       select() 
  8364.       send() 
  8365.       sendto() 
  8366.       setsockopt() 
  8367.       so_cancel() 
  8368.       sock_errno() 
  8369.       socket() 
  8370.       writev() 
  8371.  
  8372.  
  8373. ΓòÉΓòÉΓòÉ 12.14. recv() ΓòÉΓòÉΓòÉ
  8374.  
  8375. The socket call receives data on a connected socket. 
  8376.  
  8377. Syntax 
  8378.  
  8379. #include <types.h>
  8380. #include <sys\socket.h>
  8381. int recv(s, buf, len, flags)
  8382. int s;
  8383. char *buf;
  8384. int len;
  8385. int flags;
  8386.  
  8387. Parameters 
  8388.  
  8389.  s 
  8390.    Socket descriptor. 
  8391.  
  8392.  buf 
  8393.    Pointer to the buffer that receives the data. 
  8394.  
  8395.  len 
  8396.    Length of the buffer in bytes pointed to by the buf parameter. 
  8397.  
  8398.  flags 
  8399.    Permits the call to exercise control over the reception of messages. Set 
  8400.    this parameter by specifying one or more of the following flags. If you 
  8401.    specify more than one flag, use the logical OR operator (|) to separate 
  8402.    them. Setting this parameter is supported only for sockets in the internet 
  8403.    domain. 
  8404.  
  8405.    MSG_DONTWAIT      Do not wait for resources or data during this call. 
  8406.  
  8407.    MSG_OOB           Reads any out-of-band data on the socket. 
  8408.  
  8409.    MSG_PEEK          Peeks at the data present on the socket; the data is 
  8410.                      returned but not consumed, so that a subsequent receive 
  8411.                      operation sees the same data. 
  8412.  
  8413.    MSG_WAITALL       Wait for data to fill all buffers before returning. 
  8414.  
  8415.  Description 
  8416.  
  8417.  This call receives data on a socket with descriptor s and stores it in the 
  8418.  buffer pointed to by buf. The recv() call applies only to connected sockets. 
  8419.  For information on how to use recv() with datagram and raw sockets, see 
  8420.  Datagram or Raw Sockets. 
  8421.  
  8422.  The recv() call returns the length of the incoming data. If a datagram or 
  8423.  sequenced packet is too long to fit in the buffer, the excess is discarded. No 
  8424.  data is discarded for stream or sequenced packet sockets. If data is not 
  8425.  available at the socket with descriptor s, the recv() call waits for data to 
  8426.  arrive and blocks the caller, unless the socket is in nonblocking mode. See 
  8427.  ioctl() for a description of how to set nonblocking mode. 
  8428.  
  8429.  Use the select() call to determine when more data arrives. 
  8430.  
  8431.  Return Values 
  8432.  
  8433.  When successful, the number of bytes of data received into the buffer is 
  8434.  returned.  The value 0 indicates that the connection is closed. The value -1 
  8435.  indicates an error. You can get the specific error code by calling 
  8436.  sock_errno() or psock_errno(). 
  8437.  
  8438.  Error Code           Description
  8439.  
  8440.  SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  8441.  
  8442.  SOCEFAULT            Using the buf and len parameters would result in an 
  8443.                       attempt to access memory outside the caller's address 
  8444.                       space. 
  8445.  
  8446.  SOCEINTR             Interrupted system call. 
  8447.  
  8448.  SOCEINVAL            Invalid argument. 
  8449.  
  8450.  SOCEWOULDBLOCK       The s parameter is in nonblocking mode and no data is 
  8451.                       available to receive, or the SO_RCVTIMEO option has been 
  8452.                       set for socket s and the timeout expired before any data 
  8453.                       arrived to receive. 
  8454.  
  8455.  Related Calls 
  8456.  
  8457.       connect() 
  8458.       getsockopt() 
  8459.       ioctl() 
  8460.       readv() 
  8461.       recvfrom() 
  8462.       recvmsg() 
  8463.       select() 
  8464.       send() 
  8465.       sendmsg() 
  8466.       sendto() 
  8467.       setsockopt() 
  8468.       shutdown() 
  8469.       sock_errno() 
  8470.       socket() 
  8471.       writev() 
  8472.  
  8473.  
  8474. ΓòÉΓòÉΓòÉ 12.15. recvfrom() ΓòÉΓòÉΓòÉ
  8475.  
  8476. The socket call receives data on a socket. 
  8477.  
  8478. Syntax 
  8479.  
  8480. #include <types.h>
  8481. #include <sys\socket.h>
  8482. int recvfrom(s, buf, len, flags, name, namelen)
  8483. int s;
  8484. char *buf;
  8485. int len;
  8486. int flags;
  8487. struct sockaddr *name;
  8488. int *namelen;
  8489.  
  8490. Parameters 
  8491.  
  8492.  s 
  8493.    Socket descriptor. 
  8494.  
  8495.  buf 
  8496.    Pointer to the buffer that receives the data. 
  8497.  
  8498.  len 
  8499.    Length of the buffer in bytes pointed to by the buf parameter. 
  8500.  
  8501.  flags 
  8502.    Permits the call to exercise control over the reception of messages. Set 
  8503.    this parameter by specifying one or more of the following flags. If you 
  8504.    specify more than one flag, use the logical OR operator (|) to separate 
  8505.    them. Setting this parameter is supported only for sockets in the internet 
  8506.    domain. 
  8507.  
  8508.    MSG_DONTWAIT        Do not wait for resources or data during this call. 
  8509.  
  8510.    MSG_OOB             Reads any out-of-band data on the socket. 
  8511.  
  8512.    MSG_PEEK            Peeks at the data present on the socket; the data is 
  8513.                        returned but not consumed, so that a subsequent receive 
  8514.                        operation sees the same data. 
  8515.  
  8516.    MSG_WAITALL         Wait for data to fill all buffers before returning. 
  8517.  
  8518.  name 
  8519.    Pointer to a sockaddr structure (buffer) that data is received from. If name 
  8520.    is a nonzero value, the source address is returned. 
  8521.  
  8522.  namelen 
  8523.    Pointer to the size in bytes of the buffer pointed to by name. 
  8524.  
  8525.  Description 
  8526.  
  8527.  The recvfrom() call receives data on a socket with descriptor s and stores it 
  8528.  in a buffer. The recvfrom() call applies to any socket type, whether connected 
  8529.  or not. 
  8530.  
  8531.  If name is nonzero, the address of the data sender is returned. The namelen 
  8532.  parameter is first initialized to the size of the buffer associated with name; 
  8533.  on return, it is modified to indicate the actual number of bytes stored there. 
  8534.  
  8535.  The recvfrom() call returns the length of the incoming message or data. If a 
  8536.  datagram or sequenced packet is too long to fit in the supplied buffer, the 
  8537.  excess is discarded. No data is discarded for stream or sequenced packet 
  8538.  sockets. If data is not available at the socket with descriptor s, the 
  8539.  recvfrom() call waits for data to arrive and blocks the caller, unless the 
  8540.  socket is in nonblocking mode.  See ioctl() for a description of how to set 
  8541.  nonblocking mode. 
  8542.  
  8543.  Return Values 
  8544.  
  8545.  When successful, the number of bytes of data received into the buffer is 
  8546.  returned. The value -1 indicates an error. You can get the specific error code 
  8547.  by calling sock_errno() or psock_errno(). 
  8548.  
  8549.  Error Code            Description
  8550.  
  8551.  SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  8552.  
  8553.  SOCEFAULT             Using the buf and len parameters would result in an 
  8554.                        attempt to access memory outside the caller's address 
  8555.                        space. 
  8556.  
  8557.  SOCEWOULDBLOCK        The s parameter is in nonblocking mode and no data is 
  8558.                        available to receive, or the SO_RCVTIMEO option has been 
  8559.                        set for socket s and the timeout expired before any data 
  8560.                        arrived to receive. 
  8561.  
  8562.  SOCEINVAL             Invalid argument. 
  8563.  
  8564.  Related Calls 
  8565.  
  8566.       ioctl() 
  8567.       readv() 
  8568.       recv() 
  8569.       recvmsg() 
  8570.       select() 
  8571.       send() 
  8572.       sendmsg() 
  8573.       sendto() 
  8574.       setsockopt() 
  8575.       shutdown() 
  8576.       sock_errno() 
  8577.       socket() 
  8578.       writev() 
  8579.  
  8580.  
  8581. ΓòÉΓòÉΓòÉ 12.16. recvmsg() ΓòÉΓòÉΓòÉ
  8582.  
  8583. The socket call receives data and control information on a specified socket. 
  8584.  
  8585. Syntax 
  8586.  
  8587. #include <types.h>
  8588. #include <sys\socket.h>
  8589. int recvmsg(s, msg, flags)
  8590. int s;
  8591. struct msghdr *msg;
  8592. int flags;
  8593.  
  8594. Parameters 
  8595.  
  8596.  s 
  8597.    Socket descriptor. 
  8598.  
  8599.  msg 
  8600.    Pointer to a message header that receives the message. 
  8601.  
  8602.  flags 
  8603.    Permits the call to exercise control over the reception of messages. Set 
  8604.    this parameter by specifying one or more of the following flags. If you 
  8605.    specify more than one flag, use the logical OR operator (|) to separate 
  8606.    them. Setting this parameter is supported only for sockets in the internet 
  8607.    domain. 
  8608.  
  8609.    MSG_DONTWAIT      Do not wait for resources or data during this call. 
  8610.  
  8611.    MSG_OOB           Reads any out-of-band data on the socket. 
  8612.  
  8613.    MSG_PEEK          Peeks at the data present on the socket; the data is 
  8614.                      returned but not consumed, so that a subsequent receive 
  8615.                      operation will see the same data. 
  8616.  
  8617.    MSG_WAITALL       Wait for data to fill all buffers before returning. 
  8618.  
  8619.  Description 
  8620.  
  8621.  This call receives a message on a socket with descriptor s. 
  8622.  
  8623.  Networking services supports the following msghdr structure. 
  8624.  
  8625.  Note:  The fields msg_control and msg_controllen are ignored for the NetBIOS 
  8626.         and Local IPC domains. 
  8627.  
  8628.                 struct msghdr {
  8629.                        caddr_t msg_name;             /* optional pointer to destination address buffer */
  8630.                        int     msg_namelen;          /* size of address buffer */
  8631.                        struct  iovec  *msg_iov;      /* scatter/gather array */
  8632.                        int     msg_iovlen;           /* number of elements in msg_iov, maximum 1024 */
  8633.                        caddr_t msg_control;          /* ancillary data */
  8634.                        u_int   msg_controllen;       /* ancillary data length */
  8635.                        int     msg_flags;            /* flags on receive message */
  8636.                 };
  8637.  
  8638.  msg_iov is a scatter/gather array of iovec structures. The iovec structure is 
  8639.  defined in <SYS/UIO.H> and contains the following fields: 
  8640.  
  8641.   Field          Description
  8642.  iov_base       Pointer to the buffer 
  8643.  iov_len        Length of the buffer 
  8644.  
  8645.  TCP/IP alters iov_base and iov_len for each element in the input struct iovec 
  8646.  array. iov_base will point to the next character of the processed (sent or 
  8647.  received) data on the original buffer, and iov_len will become (input value - 
  8648.  processed length). Thus if only partial data has been sent or received and the 
  8649.  application expects more data to send or receive, it can pass the same iovec 
  8650.  structure back in a subsequent call. 
  8651.  
  8652.  The recvmsg() call applies to connection-oriented or connectionless sockets. 
  8653.  
  8654.  This call returns the length of the data received. If a datagram or sequenced 
  8655.  packet is too long to fit in the supplied buffer, the excess is discarded.  No 
  8656.  data is discarded for stream sockets. If data is not available at the socket 
  8657.  with descriptor s, the recvmsg() call waits for a message to arrive and blocks 
  8658.  the caller, unless the socket is in nonblocking mode. See ioctl() for a 
  8659.  description of how to set nonblocking mode. 
  8660.  
  8661.  Return Values 
  8662.  
  8663.  When successful, the number of bytes of data received into the buffer is 
  8664.  returned. The value 0 indicates the connection is closed; the value -1 
  8665.  indicates an error. You can get the specific error code by calling 
  8666.  sock_errno() or psock_errno(). 
  8667.  
  8668.  Error Code           Description
  8669.  
  8670.  SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  8671.  
  8672.  SOCEFAULT            Using msg would result in an attempt to access memory 
  8673.                       outside the caller's address space. 
  8674.  
  8675.  SOCEINTR             Interrupted system call. 
  8676.  
  8677.  SOCENOTCONN          The socket is not connected. 
  8678.  
  8679.  SOCEWOULDBLOCK       The s parameter is in nonblocking mode, and no data is 
  8680.                       available to receive. 
  8681.  
  8682.  Examples 
  8683.  
  8684.  The following is an example of using recvmsg() call to receive token ring 
  8685.  routing information in the msg_control buffers: 
  8686.  
  8687.  
  8688.   Example of recvmsg() Call
  8689.  
  8690.   char buf[50], control_buf[100];
  8691.   main(int argc, char *argv[])
  8692.   {
  8693.       struct sockaddr_in  server;
  8694.       int optlen, smsg, byterecv,rv,i, ip_recvtrri;
  8695.       struct msghdr msg;
  8696.       struct cmsghdr *cmsg;
  8697.       struct iovec iov;
  8698.       struct timeval tv;
  8699.  
  8700.       if ((smsg = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
  8701.           psock_errno("Socket()");
  8702.  
  8703.       server.sin_len    = sizeof(struct sockaddr);
  8704.       server.sin_family = AF_INET;
  8705.       server.sin_port   = htons(atoi(argv[1]));         /* port number */
  8706.       server.sin_addr.s_addr = INADDR_ANY;
  8707.  
  8708.       if (bind(smsg, (struct sockaddr *)&server , sizeof(server)) < 0)
  8709.          psock_errno("bind()");
  8710.  
  8711.       iov.iov_base = buf;
  8712.       iov.iov_len  = sizeof(buf)-1;
  8713.  
  8714.       msg.msg_name       = NULL;
  8715.       msg.msg_namelen    = sizeof(struct sockaddr);
  8716.       msg.msg_iov        = &iov
  8717.       msg.msg_iovlen     = 1;
  8718.       msg.msg_control    = control_buf;
  8719.       msg.msg_controllen = sizeof(struct cmsghdr)+4+18;/*4 byte ipaddr + 18 TRRI*/
  8720.  
  8721.       ip_recvtrri  = 1;
  8722.       if (setsockopt(smsg,IPPROTO_IP,IP_RECVTRRI,(char *)&ip_recvtrri ,
  8723.                 sizeof(ip_recvtrri)) < 0)
  8724.           psock_errno("setsockopt() IP_RECVTRRI");
  8725.  
  8726.       /* Set another IP socket options for timeout so we do not block waiting */
  8727.       tv.tv_sec  = 10;  /* Wait for max 10 sec on recvmsg */
  8728.       tv.tv_usec = 0;
  8729.       rv = setsockopt(smsg, SOL_SOCKET, SO_RCVTIMEO, (char *) &tv,
  8730.                sizeof(struct timeval));
  8731.       if (rv < 0) psock_errno("Set SO_RCVTIMEO");
  8732.  
  8733.       if((byterecv=recvmsg(smsg, &msg, 0))<0)
  8734.          psock_errno("recvmsg()");
  8735.       else {
  8736.         cmsg = (struct cmsghdr *) msg.msg_control;
  8737.  
  8738.         printf(" IP_RECV TR RI (data in network byte order): ");
  8739.         for (i=sizeof(struct cmsghdr); i < cmsg->cmsg_len;i++)
  8740.            printf(" %x",msg.msg_control[i]);
  8741.       }
  8742.  
  8743.       soclose(smsg);
  8744.   }
  8745.  
  8746.  Related Calls 
  8747.  
  8748.       connect() 
  8749.       getsockopt() 
  8750.       ioctl() 
  8751.       os2_ioctl() 
  8752.       recv() 
  8753.       recvfrom() 
  8754.       select() 
  8755.       send() 
  8756.       sendmsg() 
  8757.       sendto() 
  8758.       shutdown() 
  8759.       sock_errno() 
  8760.       socket() 
  8761.  
  8762.  
  8763. ΓòÉΓòÉΓòÉ 12.17. removesocketfromlist() ΓòÉΓòÉΓòÉ
  8764.  
  8765. The removesocketfromlist() call removes a socket from the list of owned sockets 
  8766. for the calling process. 
  8767.  
  8768. Syntax 
  8769.  
  8770. #include <types.h>
  8771. #include <sys\socket.h>
  8772. int removesockettolist(s)
  8773. int s;
  8774.  
  8775. Parameters 
  8776.  
  8777.  s 
  8778.    Socket descriptor. 
  8779.  
  8780.  Description 
  8781.  
  8782.  When a process ends, the sockets library automatically cleans up sockets by 
  8783.  registering an exit list handler.  This exit routine closes all open sockets 
  8784.  that are maintained in a process's socket list. When a process is initiated 
  8785.  the list is empty, and whenever a socket() or soclose() call is made the list 
  8786.  is updated.  The removesocketfromlist() call provides a mechanism to transfer 
  8787.  socket ownership to another process: it removes the socket indicated by the s 
  8788.  parameter from the calling process's socket ownership list. 
  8789.  
  8790.  Return Values 
  8791.  
  8792.  The value 1 indicates success; the value 0 indicates that the socket could not 
  8793.  be found in the list. 
  8794.  
  8795.  Related Calls 
  8796.  
  8797.       addsockettolist() 
  8798.  
  8799.  
  8800. ΓòÉΓòÉΓòÉ 12.18. select() ΓòÉΓòÉΓòÉ
  8801.  
  8802. The socket call gets read, write, and exception status on a group of sockets. 
  8803.  
  8804. The BSD version monitors the activity on sockets by specifying an array 
  8805. (fd_set) of socket numbers for which the caller wants to read the data, write 
  8806. the data, and check exception-pending conditions. The BSD version provides 
  8807. FD_SET, FD_CLR, FD_ISSET, and FD_ZERO macros to add or delete socket numbers 
  8808. from the array. 
  8809.  
  8810. Syntax 
  8811.  
  8812. #include <types.h>
  8813. #include <unistd.h>
  8814. #include <sys\time.h>
  8815. int select(nfds, readfds, writefds, exceptfds, timeout)
  8816. int nfds;
  8817. fd_set *readfds;
  8818. fd_set *writefds;
  8819. fd_set *exceptfds;
  8820. struct timeval *timeout;
  8821.  
  8822. Parameters 
  8823.  
  8824.  nfds 
  8825.    This parameter is unused; it is maintained for compatibility with BSD. 
  8826.  
  8827.  readfds 
  8828.    Pointer to a list of descriptors to be checked for reading. 
  8829.  
  8830.  writefds 
  8831.    Pointer to a list of descriptors to be checked for writing. 
  8832.  
  8833.  exceptfds 
  8834.    Pointer to a list of descriptors to be checked for exception-pending 
  8835.    conditions. For networking services sockets, the only exception-pending 
  8836.    condition is out-of-band data in the receive buffer. 
  8837.  
  8838.  timeout 
  8839.    Pointer to the time to wait for the select() call to complete. 
  8840.  
  8841.  Description 
  8842.  
  8843.  This call monitors activity on a set of different sockets until a timeout 
  8844.  expires, to see if any sockets are ready for reading or writing, or if any 
  8845.  exception-pending conditions are pending. 
  8846.  
  8847.  Reinitializing readfds, writefds, and exceptfds every time select() is called 
  8848.  is required. 
  8849.  
  8850.  If timeout is a NULL pointer, the call blocks indefinitely until one of the 
  8851.  requested conditions is satisfied. If timeout is non-NULL, it specifies the 
  8852.  maximum time to wait for the call to complete. To poll a set of sockets, the 
  8853.  timeout pointer should point to a zeroed timeval structure. The timeval 
  8854.  structure is defined in the <SYS\TIME.H> header file and contains the 
  8855.  following fields: 
  8856.  
  8857.   struct timeval {
  8858.          long tv_sec;  /* Number of seconds */
  8859.          long tv_usec; /* Number of microseconds */
  8860.   }
  8861.  
  8862.  An fd_set is made up of an array of integers. Macros are provided to 
  8863.  manipulate the array. 
  8864.  
  8865.   Macro                                   Description
  8866.  
  8867.  FD_SET(socket, array_address)           Adds the socket to the list pointed to 
  8868.                                          by array_address. 
  8869.  
  8870.  FD_CLR(socket, array_address)           Removes the socket from the list. 
  8871.  
  8872.  FD_ISSET(socket, array_address)         Returns true if the descriptor is part 
  8873.                                          of the array; otherwise, returns 
  8874.                                          false. 
  8875.  
  8876.  FD_ZERO(socket, array_address)          Clears the entire array for all socket 
  8877.                                          descriptors. 
  8878.  
  8879.  Note:  For macros FD_SET, FD_CLR, FD_ISSET, and FD_ZERO, define the parameters 
  8880.         socket and array_address in the following manner: 
  8881.  
  8882.                 int socket;
  8883.                 struct fd_set *array_address;
  8884.  
  8885.  Setting any of the descriptor pointers to zero indicates that no checks are to 
  8886.  be made for the conditions. For example, setting exceptfds to be a NULL 
  8887.  pointer causes the select call to check for only read and write conditions. 
  8888.  
  8889.  Return Values 
  8890.  
  8891.  The total number of ready sockets (in all arrays) is returned. The value -1 
  8892.  indicates an error. The value 0 indicates an expired time limit. If the return 
  8893.  value is greater than 0, the socket descriptors in each array that are not 
  8894.  ready are removed from the array and fd_array is rearranged so that the ready 
  8895.  sockets are at the top. The fd_count parameter is adjusted accordingly and 
  8896.  returned. You can get the specific error code by calling sock_errno() or 
  8897.  psock_errno(). 
  8898.  
  8899.  sock_errno() Value       Description
  8900.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  8901.  SOCEFAULT                The address is not valid. 
  8902.  SOCEINVAL                Invalid argument. 
  8903.  
  8904.  Examples 
  8905.  
  8906.  Following is an example of the select() call. 
  8907.  
  8908.   ...
  8909.   fd_set readsocks;
  8910.   fd_set writesocks;
  8911.   fd_set exceptsocks;
  8912.   struct timeval timeout;
  8913.   int number_found;
  8914.   ...
  8915.   /* add socket to read/write/except arrays.  To add descriptor s use
  8916.    *   FD_SET (s, &readsocks);
  8917.    *
  8918.    */
  8919.   ...
  8920.   number_found = select(0,&readsocks, &writesocks,
  8921.                         &exceptsocks, &timeout);
  8922.  
  8923.  Related Calls 
  8924.  
  8925.       accept() 
  8926.       connect() 
  8927.       os2_select() 
  8928.       recv() 
  8929.       send() 
  8930.       sock_errno() 
  8931.       socket() 
  8932.  
  8933.  
  8934. ΓòÉΓòÉΓòÉ 12.19. send() ΓòÉΓòÉΓòÉ
  8935.  
  8936. The socket call sends data on a connected socket. 
  8937.  
  8938. Syntax 
  8939.  
  8940. #include <types.h>
  8941. #include <sys\socket.h>
  8942. int send(s, msg, len, flags)
  8943. int s;
  8944. char *msg;
  8945. int len;
  8946. int flags;
  8947.  
  8948. Parameters 
  8949.  
  8950.  s 
  8951.    Socket descriptor. 
  8952.  
  8953.  msg 
  8954.    Pointer to a buffer containing the message to transmit. 
  8955.  
  8956.  len 
  8957.    Length of the message pointed to by the msg parameter. 
  8958.  
  8959.  flags 
  8960.    Allows the sender to control the transmission of the message. Set this 
  8961.    parameter by specifying one or more of the following flags. If you specify 
  8962.    more than one flag, use the logical OR operator (|) to separate them. 
  8963.    Setting this parameter is supported only for sockets in the internet domain. 
  8964.  
  8965.    MSG_DONTROUTE           The SO_DONTROUTE socket option is turned on for the 
  8966.                            duration of the operation.  This is usually used 
  8967.                            only by diagnostic or routing programs. 
  8968.  
  8969.    MSG_DONTWAIT            Do not wait for resources during this call. 
  8970.  
  8971.    MSG_EOF                 Indicates that the sending of data on the connection 
  8972.                            is complete. This flag is effective on T/TCP 
  8973.                            connections only. 
  8974.  
  8975.    MSG_OOB                 Sends out-of-band data on sockets that support 
  8976.                            SOCK_STREAM communication. 
  8977.  
  8978.  Description 
  8979.  
  8980.  This call sends data on the socket with descriptor s. The send() call applies 
  8981.  to connected sockets. For information on how to use send() with datagram and 
  8982.  raw sockets, see Datagram or Raw Sockets. The sendto() and sendmsg() calls can 
  8983.  be used with unconnected or connected sockets. 
  8984.  
  8985.  To broadcast on a socket, first issue a setsockopt() call using the 
  8986.  SO_BROADCAST option to gain broadcast permission. 
  8987.  
  8988.  Specify the length of the message with the len parameter. If the message is 
  8989.  too long to pass through the underlying protocol, the system returns an error 
  8990.  and does not transmit the message. 
  8991.  
  8992.  No indication of failure to deliver is implied in a send() call. A return 
  8993.  value of -1 indicates some locally detected errors. 
  8994.  
  8995.  If buffer space is not available at the socket to hold the message to be sent, 
  8996.  the send() call normally blocks, unless the socket is placed in nonblocking 
  8997.  mode. See ioctl() for a description of how to set nonblocking mode. Use the 
  8998.  select() call to determine when it is possible to send more data. 
  8999.  
  9000.  Return Values 
  9001.  
  9002.  When successful, the number of bytes of the socket with descriptor s that is 
  9003.  added to the send buffer is returned. This may be less than the number of 
  9004.  bytes specified in the length parameter. Successful completion does not imply 
  9005.  that the data has already been delivered to the receiver. The return value -1 
  9006.  indicates an error was detected on the sending side of the connection. You can 
  9007.  get the specific error code by calling sock_errno() or psock_errno(). 
  9008.  
  9009.  Error Code            Description
  9010.  
  9011.  SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  9012.  
  9013.  SOCEFAULT             Using the msg and len parameters would result in an 
  9014.                        attempt to access memory outside the caller's address 
  9015.                        space. 
  9016.  
  9017.  SOCEINTR              Interrupted system call. 
  9018.  
  9019.  SOCEINVAL             Invalid argument. 
  9020.  
  9021.  SOCENOBUFS            No buffer space is available to send the message. 
  9022.  
  9023.  SOCEWOULDBLOCK        The s parameter is in nonblocking mode and the data 
  9024.                        cannot be sent without blocking, or the SO_SNDTIMEO 
  9025.                        option has been set for socket s and the timeout expired 
  9026.                        before any data was sent. 
  9027.  
  9028.  Related Calls 
  9029.  
  9030.       connect() 
  9031.       getsockopt() 
  9032.       ioctl() 
  9033.       readv() 
  9034.       recv() 
  9035.       recvfrom() 
  9036.       recvmsg() 
  9037.       select() 
  9038.       sendmsg() 
  9039.       sendto() 
  9040.       setsockopt() 
  9041.       shutdown() 
  9042.       sock_errno() 
  9043.       socket() 
  9044.       writev() 
  9045.  
  9046.  
  9047. ΓòÉΓòÉΓòÉ 12.20. sendmsg() ΓòÉΓòÉΓòÉ
  9048.  
  9049. The socket call sends data and control information on a specified socket. 
  9050.  
  9051. Syntax 
  9052.  
  9053. #include <types.h>
  9054. #include <sys\socket.h>
  9055. int sendmsg(s, msg, flags)
  9056. int s;
  9057. struct msghdr *msg;
  9058. int flags;
  9059.  
  9060. Parameters 
  9061.  
  9062.  s 
  9063.    Socket descriptor. 
  9064.  
  9065.  msg 
  9066.    Pointer to a message header containing a message to be sent. 
  9067.  
  9068.  flags 
  9069.    Allows the sender to control the message transmission. Set this parameter by 
  9070.    specifying one or more of the following flags. If you specify more than one 
  9071.    flag, use the logical OR operator (|) to separate them. Setting this 
  9072.    parameter is supported only for sockets in the internet domain. 
  9073.  
  9074.    MSG_DONTROUTE              The SO_DONTROUTE socket option is turned on for 
  9075.                               the duration of the operation.  This is usually 
  9076.                               used only by diagnostic or routing programs. 
  9077.  
  9078.    MSG_DONTWAIT               Do not wait for resources during this call. 
  9079.  
  9080.    MSG_EOF                    Indicates that the sending of data on the 
  9081.                               connection is complete. This flag is effective on 
  9082.                               T/TCP connections only. 
  9083.  
  9084.    MSG_OOB                    Sends out-of-band data on the socket. 
  9085.  
  9086.  Description 
  9087.  
  9088.  This call sends a msghdr structure on a socket with descriptor s. 
  9089.  
  9090.  Networking services supports the following msghdr structure. 
  9091.  
  9092.  Note:  The fields msg_control and msg_controllen are ignored for the NetBIOS 
  9093.         and Local IPC domains. 
  9094.  
  9095.                 struct msghdr {
  9096.                        caddr_t msg_name;             /* optional pointer to destination address buffer */
  9097.                        int     msg_namelen;          /* size of address buffer */
  9098.                        struct iovec  *msg_iov;       /* scatter/gather array */
  9099.                        int     msg_iovlen;           /* number of elements in msg_iov, maximum 1024 */
  9100.                        caddr_t msg_control;          /* ancillary data */
  9101.                        u_int   msg_controllen;       /* ancillary data length */
  9102.                        int     msg_flags;            /* flags on received message */
  9103.                 };
  9104.  
  9105.  To broadcast on a socket, the application program must first issue a 
  9106.  setsockopt() call using the SO_BROADCAST option, to gain broadcast permission. 
  9107.  
  9108.  The sendmsg() call applies to connection-oriented and connectionless sockets. 
  9109.  
  9110.  msg_iov is a scatter/gather array of iovec structures. The iovec structure is 
  9111.  defined in <SYS/UIO.H> and contains the following fields: 
  9112.  
  9113.   Field          Description
  9114.  iov_base       Pointer to the buffer 
  9115.  iov_len        Length of the buffer 
  9116.  
  9117.  TCP/IP alters iov_base and iov_len for each element in the input struct iovec 
  9118.  array. iov_base will point to the next character of the processed (sent or 
  9119.  received) data on the original buffer, and iov_len will become (input value - 
  9120.  processed length). Thus if only partial data has been sent or received and the 
  9121.  application expects more data to send or receive, it can pass the same iovec 
  9122.  structure back in a subsequent call. 
  9123.  
  9124.  This call returns the length of the data sent. If the socket with descriptor s 
  9125.  is not ready for sending data, the sendmsg() call waits unless the socket is 
  9126.  in nonblocking mode. See ioctl() for a description of how to set nonblocking 
  9127.  mode. 
  9128.  
  9129.  Return Values 
  9130.  
  9131.  When successful, the number of bytes of data sent is returned.  Successful 
  9132.  completion does not guarantee delivery of the data to the receiver. The return 
  9133.  value -1 indicates an error was detected on the sending side of the 
  9134.  connection. You can get the specific error code by calling sock_errno() or 
  9135.  psock_errno(). 
  9136.  
  9137.  Error Code            Description
  9138.  
  9139.  SOCEDESTADDRREQ       The msghdr msg_name parameter is set to NULL and a 
  9140.                        destination address is required. 
  9141.  
  9142.  SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  9143.  
  9144.  SOCEFAULT             Using msg would result in an attempt to access memory 
  9145.                        outside the caller's address space. 
  9146.  
  9147.  SOCEINTR              Interrupted system call. 
  9148.  
  9149.  SOCEINVAL             msg_namelen is not the size of a valid address for the 
  9150.                        specified address family. 
  9151.  
  9152.  SOCEMSGSIZE           The message was too big to be sent as a single datagram. 
  9153.  
  9154.  SOCENOBUFS            No buffer space is available to send the message. 
  9155.  
  9156.  SOCENOTCONN           The socket is not connected. 
  9157.  
  9158.  SOCEWOULDBLOCK        The s parameter is in nonblocking mode and the data 
  9159.                        cannot be sent without blocking. 
  9160.  
  9161.  Related Calls 
  9162.  
  9163.       getsockopt() 
  9164.       ioctl() 
  9165.       readv() 
  9166.       recv() 
  9167.       recvfrom() 
  9168.       recvmsg() 
  9169.       select() 
  9170.       send() 
  9171.       sendto() 
  9172.       setsockopt() 
  9173.       shutdown() 
  9174.       sock_errno() 
  9175.       socket() 
  9176.       writev() 
  9177.  
  9178.  
  9179. ΓòÉΓòÉΓòÉ 12.21. sendto() ΓòÉΓòÉΓòÉ
  9180.  
  9181. The socket call sends data on a socket. 
  9182.  
  9183. Syntax 
  9184.  
  9185. #include <types.h>
  9186. #include <sys\socket.h>
  9187. int sendto(s, msg, len, flags, to, tolen)
  9188. int s;
  9189. char *msg;
  9190. int len;
  9191. int flags;
  9192. struct sockaddr *to;
  9193. int tolen;
  9194.  
  9195. Parameters 
  9196.  
  9197.  s 
  9198.    Socket descriptor. 
  9199.  
  9200.  msg 
  9201.    Pointer to the buffer containing the message to transmit. 
  9202.  
  9203.  len 
  9204.    Length of the message in the buffer pointed to by the msg parameter. 
  9205.  
  9206.  flags 
  9207.    Allows the sender to control the message transmission. Set this parameter to 
  9208.    0, or to one or more of the following flags. If you specify more than one 
  9209.    flag, use the logical OR operator (|) to separate them. Setting this 
  9210.    parameter is supported only for sockets in the internet domain. 
  9211.  
  9212.    MSG_DONTROUTE            The SO_DONTROUTE socket option is turned on for the 
  9213.                             duration of the operation. This is usually used 
  9214.                             only by diagnostic or routing programs. 
  9215.  
  9216.    MSG_DONTWAIT             Do not wait for resources during this call. 
  9217.  
  9218.    MSG_EOF                  Indicates that the sending of data on the 
  9219.                             connection is complete. This flag is effective on 
  9220.                             T/TCP connections only. 
  9221.  
  9222.    MSG_OOB                  Sends out-of-band data on the socket. 
  9223.  
  9224.  to 
  9225.    Pointer to a sockaddr structure (buffer) containing the destination address. 
  9226.  
  9227.  tolen 
  9228.    Size in bytes of the buffer pointed to by the to parameter. 
  9229.  
  9230.  Description 
  9231.  
  9232.  This call sends data on the socket with descriptor s. The sendto() call 
  9233.  applies to connected or unconnected sockets. For unconnected datagram and raw 
  9234.  sockets, the sendto() call sends data to the specified destination address. 
  9235.  For stream and sequenced packet sockets the destination address is ignored. 
  9236.  
  9237.  To broadcast on a socket, first issue a setsockopt() call using the 
  9238.  SO_BROADCAST option to gain broadcast permissions. 
  9239.  
  9240.  Provide the address of the target using the to parameter. Specify the length 
  9241.  of the message with the tolen parameter. If the message is too long to pass 
  9242.  through the underlying protocol, the error SOCEMSGSIZE is returned and the 
  9243.  message is not transmitted. 
  9244.  
  9245.  If the sending socket has no space to hold the message to be transmitted, the 
  9246.  sendto() call blocks the message, unless the socket is in a nonblocking I/O 
  9247.  mode. 
  9248.  
  9249.  Use the select() call to determine when it is possible to send more data. 
  9250.  
  9251.  Datagram sockets are connected by calling connect().  This identifies the peer 
  9252.  to send/receive the datagram.  Once a datagram socket is connected to a peer, 
  9253.  you may still use the sendto() call but a destination address cannot be 
  9254.  included. 
  9255.  
  9256.  To change the peer address when using connected datagram sockets, issue a 
  9257.  connect() call with a null address.  Specifying a null address on a connected 
  9258.  datagram socket removes the peer address specification.  You can then either 
  9259.  issue a sendto() call specifying a different destination address or issue a 
  9260.  connect() call to connect to a different peer. For more information on 
  9261.  connecting datagram sockets and specifying null addresses, see Datagram or Raw 
  9262.  Sockets. 
  9263.  
  9264.  If the to parameter is specified and this sendto() call was preceded by a 
  9265.  connect() call, the dst parameter must be NULL. If not NULL, the error 
  9266.  SOCEISCONN is returned and the message is not sent. If the to parameter is 
  9267.  specified and this sendto() call was not preceded by a connect() call, this 
  9268.  sendto() call results in socket s being connected to dst, the message being 
  9269.  sent, and socket s being disconnected from dst. 
  9270.  
  9271.  Return Values 
  9272.  
  9273.  When successful, the number of bytes of data sent is returned.  Successful 
  9274.  completion does not guarantee delivery of the data to the receiver. The return 
  9275.  value -1 indicates an error was detected on the sending side. You can get the 
  9276.  specific error code by calling sock_errno() or psock_errno(). 
  9277.  
  9278.  Error Code              Description
  9279.  
  9280.  SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  9281.  
  9282.  SOCEFAULT               Using the msg and len parameters would result in an 
  9283.                          attempt to access memory outside the caller's address 
  9284.                          space. 
  9285.  
  9286.  SOCEINVAL               The tolen parameter is not the size of a valid address 
  9287.                          for the specified address family. 
  9288.  
  9289.  SOCEISCONN              This call was preceded by a connect() call, the to 
  9290.                          parameter of this call is specified, but the dst 
  9291.                          parameter is not NULL. 
  9292.  
  9293.  SOCEMSGSIZE             The message was too big to be sent as a single 
  9294.                          datagram. 
  9295.  
  9296.  SOCENOBUFS              No buffer space is available to send the message. 
  9297.  
  9298.  SOCEWOULDBLOCK          The s parameter is in nonblocking mode and the data 
  9299.                          cannot be sent without blocking, or the SO_SNDTIMEO 
  9300.                          option has been set for socket s and the timeout 
  9301.                          expired before any data was sent. 
  9302.  
  9303.  SOCENOTCONN             The socket is not connected. 
  9304.  
  9305.  SOCEDESTADDRREQ         Destination address required. 
  9306.  
  9307.  Related Calls 
  9308.  
  9309.       getsockopt() 
  9310.       readv() 
  9311.       recv() 
  9312.       recvfrom() 
  9313.       recvmsg() 
  9314.       select() 
  9315.       send() 
  9316.       sendmsg() 
  9317.       setsockopt() 
  9318.       shutdown() 
  9319.       sock_errno() 
  9320.       socket() 
  9321.       writev() 
  9322.  
  9323.  
  9324. ΓòÉΓòÉΓòÉ 12.22. setsockopt() ΓòÉΓòÉΓòÉ
  9325.  
  9326. The socket call sets options associated with a socket. 
  9327.  
  9328. Syntax 
  9329.  
  9330. #include <types.h>
  9331. #include <sys\socket.h>
  9332. int setsockopt(s, level, optname, optval, optlen)
  9333. int s;
  9334. int level;
  9335. int optname;
  9336. char *optval;
  9337. int optlen;
  9338.  
  9339. Parameters 
  9340.  
  9341.  s 
  9342.    Socket descriptor. 
  9343.  
  9344.  level 
  9345.    Specifies which option level is being set. 
  9346.  
  9347.  optname 
  9348.    Name of a specified socket option. 
  9349.  
  9350.  optval 
  9351.    Pointer to the option data. 
  9352.  
  9353.  optlen 
  9354.    Length of the option data. 
  9355.  
  9356.  Description 
  9357.  
  9358.  This call provides an application program with the means to control a socket 
  9359.  communication. The setsockopt() call can be used to set options associated 
  9360.  with a socket, such as enabling debugging at the socket or protocol level, 
  9361.  controlling timeouts, or permitting socket data broadcasts. Options can exist 
  9362.  at the socket or the protocol level; options are always present at the highest 
  9363.  socket level. When setting socket options, the level of the option and the 
  9364.  name of the option must be specified. The following table lists the supported 
  9365.  levels: 
  9366.  
  9367.  Supported Levels 
  9368.  
  9369.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9370.   ΓöéSupported Level               #define in                         Γöé
  9371.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9372.   ΓöéSOL_SOCKET                    <SYS\SOCKET.H>                     Γöé
  9373.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9374.   ΓöéIPPROTO_IP                    <NETINET\IN.H>                     Γöé
  9375.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9376.   ΓöéIPPROTO_TCP                   <NETINET\IN.H>                     Γöé
  9377.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9378.   ΓöéNBPROTO_NB                    <NETNB\NB.H>                       Γöé
  9379.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9380.  
  9381.  The optval and optlen parameters are used to pass data used by the particular 
  9382.  set command. The optval parameter points to a buffer containing the data 
  9383.  needed by the set command. The optval parameter is optional and if data is not 
  9384.  needed by the command, can be set to the NULL pointer. The optlen parameter 
  9385.  must be set to the size of the data or data type pointed to by optval. For 
  9386.  socket options that are toggles, the option is enabled if optval is nonzero 
  9387.  and disabled if optval is 0. 
  9388.  
  9389.  The following tables list the supported options for setsockopt() at each level 
  9390.  (SOL_SOCKET, IPPROTO_IP, IPPROTO_TCP). Detailed descriptions of the options 
  9391.  follow each table. 
  9392.  
  9393.  Supported setsockopt() Socket Options for SOL_SOCKET 
  9394.  
  9395.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9396.   ΓöéOption Name     Description             Domains(*)  Data     Boolean Γöé
  9397.   Γöé                                                    Type     or ValueΓöé
  9398.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9399.   ΓöéSO_BROADCAST    Allow sending of        I, N        int      Boolean Γöé
  9400.   Γöé                broadcast messages                                   Γöé
  9401.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9402.   ΓöéSO_DEBUG        Turn on recording of    I, L        int      Boolean Γöé
  9403.   Γöé                debugging information                                Γöé
  9404.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9405.   ΓöéSO_DONTROUTE    Bypass routing tables   I           int      Boolean Γöé
  9406.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9407.   ΓöéSO_KEEPALIVE    Keep connections alive  I           int      Boolean Γöé
  9408.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9409.   ΓöéSO_LINGER       Linger on close if data I           struct   Value   Γöé
  9410.   Γöé                present                             linger           Γöé
  9411.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9412.   ΓöéSO_L_BROADCAST  Limited broadcast sent  I           int      Boolean Γöé
  9413.   Γöé                on all interfaces                                    Γöé
  9414.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9415.   ΓöéSO_OOBINLINE    Leave received OOB data I           int      Boolean Γöé
  9416.   Γöé                in-line                                              Γöé
  9417.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9418.   ΓöéSO_RCVBUF       Receive buffer size     I, L, N     int      Value   Γöé
  9419.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9420.   ΓöéSO_RCVLOWAT     Receive low watermark   I, L        int      Value   Γöé
  9421.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9422.   ΓöéSO_RCVTIMEO     Receive timeout         I, L        struct   Value   Γöé
  9423.   Γöé                                                    timeval          Γöé
  9424.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9425.   ΓöéSO_REUSEADDR    Allow local address     I, N        int      Boolean Γöé
  9426.   Γöé                reuse                                                Γöé
  9427.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9428.   ΓöéSO_REUSEPORT    Allow local address and I           int      Boolean Γöé
  9429.   Γöé                port reuse                                           Γöé
  9430.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9431.   ΓöéSO_SNDBUF       Send buffer size        I, L, N     int      Value   Γöé
  9432.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9433.   ΓöéSO_SNDLOWAT     Send low watermark      I, L        int      Value   Γöé
  9434.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9435.   ΓöéSO_SNDTIMEO     Send timeout            I, L        struct   Value   Γöé
  9436.   Γöé                                                    timeval          Γöé
  9437.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9438.   ΓöéSO_USELOOPBACK  Bypass hardware when    I           int      Value   Γöé
  9439.   Γöé                possible                                             Γöé
  9440.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9441.  
  9442.  Table Note  (*) This column specifies the communication domains to which this 
  9443.              option applies: I for internet, L for Local IPC, and N for 
  9444.              NetBIOS. 
  9445.  
  9446.  The following options are recognized for SOL_SOCKET: 
  9447.  
  9448.   Option                 Description
  9449.  
  9450.  SO_BROADCAST           (Datagram sockets only.) Enables broadcasting of 
  9451.                         messages. When this option is enabled, the application 
  9452.                         can send broadcast messages over s, if the interface 
  9453.                         specified in the destination supports broadcasting of 
  9454.                         packets. 
  9455.  
  9456.  SO_DEBUG               Enables recording of debug information for a socket. 
  9457.                         This options is a prerequisite for tracing TCP debug 
  9458.                         information through the inetdbg utility. For more 
  9459.                         information enter inetcfg -?. 
  9460.  
  9461.  SO_DONTROUTE           Enables the socket to bypass the routing of outgoing 
  9462.                         messages. When this option is enabled, it causes 
  9463.                         outgoing messages to bypass the standard routing 
  9464.                         algorithm and be directed to the appropriate network 
  9465.                         interface according to the network portion of the 
  9466.                         destination address. When this option is enabled, 
  9467.                         packets can be sent only to directly connected networks 
  9468.                         (networks for which this host has an interface). 
  9469.  
  9470.  SO_KEEPALIVE           (Stream sockets only.) Enables the socket to send 
  9471.                         keepalive packets that will keep the connection alive. 
  9472.                         TCP uses a timer called the keepalive timer. This timer 
  9473.                         is used to monitor idle connections that might have 
  9474.                         been disconnected because of a peer crash or timeout. 
  9475.                         When this option is enabled, a keepalive packet is 
  9476.                         periodically sent to the peer. This is mainly used to 
  9477.                         allow servers to close connections that are no longer 
  9478.                         active as a result of clients going away without 
  9479.                         properly closing connections. 
  9480.  
  9481.  SO_LINGER              (Stream sockets only.) Enables the socket to linger on 
  9482.                         close if data is present. When this option is enabled 
  9483.                         and there is unsent data present when soclose() is 
  9484.                         called, the calling application is blocked during the 
  9485.                         soclose() call until the data is transmitted or the 
  9486.                         connection has timed out. When this option is disabled, 
  9487.                         the soclose() call returns without blocking the caller, 
  9488.                         and TCP waits to try to send the data. Although the 
  9489.                         data transfer is usually successful, it cannot be 
  9490.                         guaranteed because TCP waits only a finite amount of 
  9491.                         time to send the data. 
  9492.  
  9493.                         The optval parameter points to a linger structure, 
  9494.                         defined in <SYS\SOCKET.H>: 
  9495.  
  9496.                                                      Field          Description
  9497.                         l_onoff             Option on/off 
  9498.                         l_linger            Linger time 
  9499.  
  9500.                         The l_onoff field is set to zero if the SO_LINGER 
  9501.                         option is being disabled. A nonzero value enables the 
  9502.                         option. 
  9503.  
  9504.                         The l_linger field specifies the amount of time in 
  9505.                         seconds to linger on close. A value of zero will cause 
  9506.                         soclose() to wait until the disconnect completes. 
  9507.  
  9508.  SO_L_BROADCAST         Sets limited broadcast sent on all interfaces. 
  9509.  
  9510.  SO_OOBINLINE           (Stream sockets only.) Enables the socket to receive 
  9511.                         out-of-band data. Out-of-band data is a logically 
  9512.                         separate data path using the same connection as the 
  9513.                         normal data path. 
  9514.  
  9515.                         When this option is enabled, it causes out-of-band data 
  9516.                         to be placed in the normal data input queue as it is 
  9517.                         received, making it available to recv(), and 
  9518.                         recvfrom(), without having to specify the MSG_OOB flag 
  9519.                         in those calls. When this option is disabled, it causes 
  9520.                         out-of-band data to be placed in the priority data 
  9521.                         input queue as it is received, making it available to 
  9522.                         recv() and recvfrom() only by specifying the MSG_OOB 
  9523.                         flag in those calls. 
  9524.  
  9525.  SO_RCVBUF              Sets buffer size for input. This option sets the size 
  9526.                         of the receive buffer to the value contained in the 
  9527.                         buffer pointed to by optval. This allows the buffer 
  9528.                         size to be tailored for specific application needs, 
  9529.                         such as increasing the buffer size for high-volume 
  9530.                         connections. 
  9531.  
  9532.                         Use inetcfg -g tcprwinsize to see the default and 
  9533.                         maximum receive socket buffer sizes for stream (TCP) 
  9534.                         sockets or raw sockets. Use inetcfg -g udprwinsize to 
  9535.                         see the default and maximum receive socket buffer sizes 
  9536.                         for UDP sockets. 
  9537.  
  9538.  SO_RCVLOWAT            Sets the receive low watemark. 
  9539.  
  9540.  SO_RCVTIMEO            Sets the receive timeout. The optval parameter is a 
  9541.                         pointer to a timeval structure, which is defined in 
  9542.                         <SYS\TIME.H>. See Example of recvmsg() Call for an 
  9543.                         example of setting the socket timeout option. 
  9544.  
  9545.  SO_REUSEADDR           (Stream and datagram sockets only.) Enables a socket to 
  9546.                         reuse a local address. When this option is enabled, 
  9547.                         local addresses that are already in use can be bound. 
  9548.                         This alters the normal algorithm used in the bind() 
  9549.                         call. The system checks at connect time to be sure that 
  9550.                         no local address and port have the same foreign address 
  9551.                         and port. The error SOCEADDRINUSE is returned if the 
  9552.                         association already exists. 
  9553.  
  9554.                         Multicast applications must set this socket option if 
  9555.                         they want to join the same Class D IP address and port 
  9556.                         for sending and receiving multicast packets. 
  9557.  
  9558.  SO_REUSEPORT           Specifies that the rules used in validating addresses 
  9559.                         supplied by a  bind subroutine should allow reuse of a 
  9560.                         local port/address combination.  Each binding of the 
  9561.                         port/address combination must specify the SO_REUSEPORT 
  9562.                         socket option 
  9563.  
  9564.  SO_SNDBUF              Sets the send buffer size. This option sets the size of 
  9565.                         the send buffer to the value contained in the buffer 
  9566.                         pointed to by optval.  This allows the send buffer size 
  9567.                         to be tailored for specific application needs, such as 
  9568.                         increasing the buffer size for high-volume connections. 
  9569.  
  9570.                         Use inetcfg -g tcpswinsize to see the default and 
  9571.                         maximum send socket buffer sizes for stream (TCP) 
  9572.                         sockets or raw sockets. Use inetcfg -g udpswinsize to 
  9573.                         see the default and maximum send socket buffer sizes 
  9574.                         for UDP sockets. 
  9575.  
  9576.  SO_SNDLOWAT            Sets the send low watermark. 
  9577.  
  9578.  SO_SNDTIMEO            Sets the send timeout. The optval parameter is a 
  9579.                         pointer to a timeval structure, which is defined in 
  9580.                         <SYS\TIME.H>. See Example of recvmsg() Call for an 
  9581.                         example of setting the socket timeout option. 
  9582.  
  9583.  SO_USELOOPBACK         Bypasses hardware when possible. 
  9584.  
  9585.  Supported setsockopt() Socket Options for IPPROTO_IP 
  9586.  
  9587.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9588.   ΓöéOption Name         Description              Data Type     Boolean Γöé
  9589.   Γöé                                                           or ValueΓöé
  9590.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9591.   ΓöéIP_ADD_MEMBERSHIP   Join a multicast group   struct        Value   Γöé
  9592.   Γöé                                             ip_mreq               Γöé
  9593.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9594.   ΓöéIP_DROP_MEMBERSHIP  Leave a multicast group  struct        Value   Γöé
  9595.   Γöé                                             ip_mreq               Γöé
  9596.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9597.   ΓöéIP_HDRINCL          Header is included with  int           Boolean Γöé
  9598.   Γöé                    data                                           Γöé
  9599.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9600.   ΓöéIP_MULTICAST_IF     Default interface for    struct        Value   Γöé
  9601.   Γöé                    outgoing multicasts      in_addr               Γöé
  9602.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9603.   ΓöéIP_MULTICAST_LOOP   Loopback of outgoing     uchar         Boolean Γöé
  9604.   Γöé                    multicast                                      Γöé
  9605.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9606.   ΓöéIP_MULTICAST_TTL    Default TTL for outgoing uchar         Value   Γöé
  9607.   Γöé                    multicast                                      Γöé
  9608.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9609.   ΓöéIP_OPTIONS          IP options               char *        Value   Γöé
  9610.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9611.   ΓöéIP_RECVDSTADDR      Queueing IP destination  int           Boolean Γöé
  9612.   Γöé                    address                                        Γöé
  9613.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9614.   ΓöéIP_RECVTRRI         Queueing token ring      int           Boolean Γöé
  9615.   Γöé                    routing information                            Γöé
  9616.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9617.   ΓöéIP_RETOPTS          IP options to be         char *        Value   Γöé
  9618.   Γöé                    included in outgoing                           Γöé
  9619.   Γöé                    datagrams                                      Γöé
  9620.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9621.   ΓöéIP_TOS              IP type of service for   int           Value   Γöé
  9622.   Γöé                    outgoing datagrams                             Γöé
  9623.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9624.   ΓöéIP_TTL              IP time to live for      int           Value   Γöé
  9625.   Γöé                    outgoing datagrams                             Γöé
  9626.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9627.  
  9628.  The following options are recognized for IPPROTO_IP: 
  9629.  
  9630.   Option                   Description
  9631.  
  9632.  IP_ADD_MEMBERSHIP        Used to join a multicast group.  There can be 20 
  9633.                           groups per socket, and the maximum number of groups 
  9634.                           for the entire OS/2 TCP/IP system is 320. A multicast 
  9635.                           packet is delivered to a socket if it has joined the 
  9636.                           same group on the same interface on which the packet 
  9637.                           arrived.  More than one socket can bind() on a 
  9638.                           multicast (Class D IP) address and a common port, 
  9639.                           such as when two clients want to receive the same 
  9640.                           multicast packet.  These sockets must set the 
  9641.                           SO_REUSEADDR socket option. 
  9642.  
  9643.  IP_DROP_MEMBERSHIP       Used to leave a multicast group. 
  9644.  
  9645.  IP_HDRINCL               (Raw sockets only.) When set, the IP header is 
  9646.                           included with the data received on the socket. 
  9647.  
  9648.  IP_MULTICAST_IF          Sets the default interface for outgoing multicasts. 
  9649.  
  9650.  IP_MULTICAST_LOOP        This option is used for sending multicast packets. It 
  9651.                           enables or disables loopback of outgoing multicast 
  9652.                           packets and is enabled by default.  If loopback is 
  9653.                           disabled, outgoing multicast packets will not 
  9654.                           loopback in this system; this means that other 
  9655.                           applications running in this system will not receive 
  9656.                           outgoing multicast packets even if they have joined 
  9657.                           the same multicast group. 
  9658.  
  9659.  IP_MULTICAST_TTL         Sets the default TTL for outgoing multicast packets. 
  9660.  
  9661.  IP_OPTIONS               Sets IP options.  Same as IP_RETOPTS. See Example of 
  9662.                           IP_RETOPTS Socket Call for how to use IP_RETOPS. 
  9663.  
  9664.  IP_RECVDSTADDR           (UDP only) Sets the queueing IP destination address. 
  9665.                           See Example of recvmsg() Call for the way to get this 
  9666.                           information through recvmsg() call. 
  9667.  
  9668.  IP_RECVTRRI              (UDP packets on token ring only.) Sets queueing token 
  9669.                           ring routing information. See Example of recvmsg() 
  9670.                           Call for the way to get this information through 
  9671.                           recvmsg() call. 
  9672.  
  9673.  IP_RETOPTS               Sets the IP options to be included in outgoing 
  9674.                           datagrams. See Example of IP_RETOPTS Socket Call for 
  9675.                           how to use IP_RETOPS. 
  9676.  
  9677.  IP_TOS                   Sets the IP type of service for outgoing datagrams. 
  9678.  
  9679.  IP_TTL                   Sets the IP time to live value for outgoing 
  9680.                           datagrams. 
  9681.  
  9682.  Supported setsockopt() Socket Options for IPPROTO_TCP 
  9683.  
  9684.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9685.   ΓöéOption Name       Description               Data Type     Boolean  Γöé
  9686.   Γöé                                                          or Value Γöé
  9687.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9688.   ΓöéTCP_CC            Connection count flag     int           Boolean  Γöé
  9689.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9690.   ΓöéTCP_MAXSEG        Maximum segment size      int           Value    Γöé
  9691.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9692.   ΓöéTCP_MSL           TCP MSL value             int           Value    Γöé
  9693.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9694.   ΓöéTCP_NODELAY       Do not delay sending to   int           Boolean  Γöé
  9695.   Γöé                  coalesce packets                                 Γöé
  9696.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9697.   ΓöéTCP_TIMESTMP      TCP timestamp flag        int           Boolean  Γöé
  9698.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9699.   ΓöéTCP_WINSCALE      Window scale flag         int           Boolean  Γöé
  9700.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9701.  
  9702.  The following options are recognized for IPPROTO_TCP: 
  9703.  
  9704.   Option                 Description
  9705.  
  9706.  TCP_CC                 (T/TCP only.) Enables or disables the connection count 
  9707.                         function status flag (RFC 1644). 
  9708.  
  9709.  TCP_MAXSEG             Sets the maximum segment size. 
  9710.  
  9711.  TCP_MSL                Sets the TCP Maximum Segment Lifetime (MSL) value. 
  9712.  
  9713.  TCP_NODELAY            (Stream sockets only.) Setting on disables the 
  9714.                         buffering algorithm so that the client's TCP sends 
  9715.                         small packets as soon as possible.  This often has no 
  9716.                         performance effects on LANs, but can degrade 
  9717.                         performance on WANs. 
  9718.  
  9719.  TCP_TIMESTMP           (T/TCP only.) Enables or disables the timestamp 
  9720.                         function status flag (RFC 1323). For more information 
  9721.                         about high performance, see TCP Extensions for High 
  9722.                         Performance (RFC 1323). 
  9723.  
  9724.  TCP_WINSCALE           (T/TCP only.) Enables or disables the window scale 
  9725.                         function status flag (RFC 1323). For more information 
  9726.                         about high performance, see TCP Extensions for High 
  9727.                         Performance (RFC 1323). 
  9728.  
  9729.  Supported setsockopt() Socket Options for NBPROTO_NB 
  9730.  
  9731.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9732.   ΓöéOption Name       Description               Data Type     Boolean  Γöé
  9733.   Γöé                                                          or Value Γöé
  9734.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9735.   ΓöéNB_DGRAM_TYPE     Type of datagrams to      int           Value    Γöé
  9736.   Γöé                  receive                                          Γöé
  9737.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9738.  
  9739.  The following option is recognized for NBPROTO_NB: 
  9740.  
  9741.   Option                 Description
  9742.  
  9743.  NB_DGRAM_TYPE          (Datagram sockets only.) Sets type of datagrams to be 
  9744.                         received on the socket.  The possible values are: 
  9745.  
  9746.                         NB_DGRAM               The socket is to receive normal 
  9747.                                                (unicast) datagrams only. 
  9748.  
  9749.                         NB_BROADCAST           The socket is to receive 
  9750.                                                broadcast datagrams only. 
  9751.  
  9752.                         NB_DGRAM_ANY           The socket can receive both 
  9753.                                                normal or broadcast datagrams. 
  9754.  
  9755.                         This option can be changed at any time. 
  9756.  
  9757.  Return Values 
  9758.  
  9759.  The value 0 indicates success; the value -1 indicates an error. You can get 
  9760.  the specific error code by calling sock_errno() or psock_errno(). 
  9761.  
  9762.  sock_errno() Value       Description
  9763.  
  9764.  SOCEADDRINUSE            The address is already in use. 
  9765.  
  9766.  SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  9767.  
  9768.  SOCEFAULT                Using optval and optlen parameters would result in an 
  9769.                           attempt to access memory outside the caller's address 
  9770.                           space. 
  9771.  
  9772.  SOCENOPROTOOPT           The optname parameter is unrecognized. 
  9773.  
  9774.  SOCEINVAL                Invalid argument. 
  9775.  
  9776.  SOCENOBUFS               No buffer space is available. 
  9777.  
  9778.  Examples 
  9779.  
  9780.  The following are examples of the setsockopt() call. See getsockopt() for 
  9781.  examples of how the options are queried. 
  9782.  
  9783.   int rc;
  9784.   int s;
  9785.   int optval;
  9786.   struct linger lstruct;
  9787.   /* extracted from sys/socket.h */
  9788.   int setsockopt(int s, int level, int optname, char *optval, int optlen);
  9789.   ...
  9790.   /* I want out of band data in the normal input queue */
  9791.   optval = 1;
  9792.   rc = setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *) &optval, sizeof(int));
  9793.   ...
  9794.   /* I want to linger on close */
  9795.   lstruct.l_onoff  = 1;
  9796.   lstruct.l_linger = 100;
  9797.   rc = setsockopt(s, SOL_SOCKET, SO_LINGER, (char *) &lstruct, sizeof(lstruct));
  9798.  
  9799.  Related Calls 
  9800.  
  9801.       bind() 
  9802.       endprotoent() 
  9803.       getprotobyname() 
  9804.       getprotobynumber() 
  9805.       getprotoent() 
  9806.       getsockopt() 
  9807.       ioctl() 
  9808.       setprotoent() 
  9809.       sock_errno() 
  9810.       socket() 
  9811.  
  9812.  
  9813. ΓòÉΓòÉΓòÉ 12.23. shutdown() ΓòÉΓòÉΓòÉ
  9814.  
  9815. The socket call shuts down all or part of a full-duplex connection. 
  9816.  
  9817. Syntax 
  9818.  
  9819. #include <sys\socket.h>
  9820. int shutdown(s, howto)
  9821. int s;
  9822. int howto;
  9823.  
  9824. Parameters 
  9825.  
  9826.  s 
  9827.    Socket descriptor. 
  9828.  
  9829.  howto 
  9830.    Condition of the shutdown. 
  9831.  
  9832.  Description 
  9833.  
  9834.  This call shuts down all or part of a full-duplex connection. Since data flows 
  9835.  in one direction are independent of data flows in the other direction, the 
  9836.  shutdown call allows you to independently stop data flow in either direction 
  9837.  or all data flows with one API call. For example, you may want to stop the 
  9838.  sender(s) from sending data to you, but you still want to send data. 
  9839.  
  9840.  Using the shutdown() call is optional. 
  9841.  
  9842.  The howto parameter sets the condition for shutting down the connection to 
  9843.  socket s. It can be set to one of the following: 
  9844.  
  9845.      0 - no more data can be received on socket s. 
  9846.      1 - no more output to be allowed on the socket s. 
  9847.      2 - no more data can be sent or received on socket s. 
  9848.  
  9849.  Note:  In the NetBIOS domain, the shutdown() call has no effect.  When called, 
  9850.         shutdown() will return a successful return code, but no shutdown 
  9851.         occurs. 
  9852.  
  9853.  Return Values 
  9854.  
  9855.  The value 0 indicates success; the value -1 indicates an error. You can get 
  9856.  the specific error code by calling sock_errno() or psock_errno(). 
  9857.  
  9858.  Error Code         Description
  9859.  SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  9860.  SOCEINVAL          The howto parameter was not set to one of the valid values. 
  9861.  
  9862.  Related Calls 
  9863.  
  9864.       accept() 
  9865.       connect() 
  9866.       getsockopt() 
  9867.       readv() 
  9868.       recv() 
  9869.       recvfrom() 
  9870.       recvmsg() 
  9871.       select() 
  9872.       send() 
  9873.       sendto() 
  9874.       setsockopt() 
  9875.       sock_errno() 
  9876.       soclose() 
  9877.       socket() 
  9878.       writev() 
  9879.  
  9880.  
  9881. ΓòÉΓòÉΓòÉ 12.24. so_cancel() ΓòÉΓòÉΓòÉ
  9882.  
  9883. The socket call cancels a pending blocking sockets API call on a socket. 
  9884.  
  9885. Syntax 
  9886.  
  9887. #include <types.h>
  9888. #include <sys\socket.h>
  9889. int so_cancel (s)
  9890. int s;
  9891.  
  9892. Parameters 
  9893.  
  9894.  s 
  9895.    Socket descriptor. 
  9896.  
  9897.  Description 
  9898.  
  9899.  The so_cancel() call is used in multithreaded applications where one thread 
  9900.  needs to 'wake up' another thread which is blocked in a sockets API call. 
  9901.  
  9902.  The thread that has been 'awakened' will return a value of -1 from the sockets 
  9903.  API call, and the error will be set to SOCEINTR.  If multiple threads are 
  9904.  blocked on the same socket and so_cancel() is issued for that socket, only one 
  9905.  of the threads will be 'awakened.' 
  9906.  
  9907.  When a socket is in blocking mode, if no threads are blocking on the socket 
  9908.  when so_cancel() is issued, the next sockets API call to be issued on that 
  9909.  socket will return SOCEINTR.  When a socket is in nonblocking mode and no 
  9910.  threads are blocking on the socket when so_cancel() is issued, the next call 
  9911.  to select() that includes the socket will return SOCEINTR. 
  9912.  
  9913.  Return Values 
  9914.  
  9915.  The value 0 indicates success; the value -1 indicates an error. You can get 
  9916.  the specific error code by calling sock_errno() or psock_errno(). 
  9917.  
  9918.  Error Code         Description
  9919.  SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  9920.  
  9921.  
  9922. ΓòÉΓòÉΓòÉ 12.25. sock_errno() ΓòÉΓòÉΓòÉ
  9923.  
  9924. The socket call returns error code set by a socket call. 
  9925.  
  9926. Syntax 
  9927.  
  9928. #include <sys/socket.h>
  9929. int sock_errno()
  9930.  
  9931. Description 
  9932.  
  9933. The sock_errno() call returns the last error code set by a socket call in the 
  9934. current thread. Subsequent socket API calls do not reset this error code. 
  9935.  
  9936. Related Calls 
  9937.  
  9938.       ioctl() 
  9939.       os2_ioctl() 
  9940.       psock_errno() 
  9941.  
  9942.  
  9943. ΓòÉΓòÉΓòÉ 12.26. socket() ΓòÉΓòÉΓòÉ
  9944.  
  9945. The socket call creates an endpoint for communication and returns a socket 
  9946. descriptor representing the endpoint. 
  9947.  
  9948. Syntax 
  9949.  
  9950. #include <types.h>
  9951. #include <sys\socket.h>
  9952. int socket(domain, type, protocol)
  9953. int domain;
  9954. int type;
  9955. int protocol;
  9956.  
  9957. Parameters 
  9958.  
  9959.  domain 
  9960.    Communication domain requested. 
  9961.  
  9962.  type 
  9963.    Type of socket created. 
  9964.  
  9965.  protocol 
  9966.    Protocol requested. 
  9967.  
  9968.  Description 
  9969.  
  9970.  This call creates an endpoint for communication and returns a socket 
  9971.  descriptor representing the endpoint. Each socket type provides a different 
  9972.  communication service. 
  9973.  
  9974.  Sockets are deallocated with the soclose() call. 
  9975.  
  9976.  The domain parameter specifies a communications domain where communication is 
  9977.  to take place. This parameter specifies the protocol family which is used. 
  9978.  
  9979.  Protocol Family          Description
  9980.  
  9981.  PF_OS2 or PF_UNIX        Use addresses in the Local IPC format which take the 
  9982.                           form of OS/2 Warp file and path names. 
  9983.  
  9984.  PF_INET                  Use addresses in the internet address format. 
  9985.  
  9986.  PF_NETBIOS or PF_NB      Use addresses in the NetBIOS address format. 
  9987.  
  9988.  PF_ROUTE                 A routing socket can be created with PF_ROUTE as the 
  9989.                           domain name and SOCK_RAW as the type. A process can 
  9990.                           use a routing socket to send and receive routing 
  9991.                           messages. 
  9992.  
  9993.  The type parameter specifies the type of socket created.  These socket type 
  9994.  constants are defined in the <SYS\SOCKET.H> header file. See Socket Types for 
  9995.  additional details. The types supported are: 
  9996.  
  9997.   Type                Description
  9998.  
  9999.  SOCK_STREAM         Provides sequenced, two-way byte streams that are reliable 
  10000.                      and connection-oriented. It supports a mechanism for 
  10001.                      out-of-band data. 
  10002.  
  10003.                      Stream sockets are supported by the internet (PF_INET) 
  10004.                      communication domain and local IPC (PF_OS2, PF_UNIX, or 
  10005.                      PF_LOCAL). 
  10006.  
  10007.  SOCK_DGRAM          Provides datagrams, which are connectionless messages of a 
  10008.                      fixed length whose reliability is not guaranteed. 
  10009.                      Datagrams can be received out of order, lost, or delivered 
  10010.                      multiple times. 
  10011.  
  10012.                      Datagram sockets are supported by the internet (PF_INET), 
  10013.                      local IPC (PF_OS2, PF_UNIX, or PF_LOCAL), and NetBIOS 
  10014.                      (PF_NETBIOS or PF_NB) communication domains. 
  10015.  
  10016.  SOCK_RAW            Provides the interface to internal protocols (such as IP 
  10017.                      and ICMP).  Raw sockets are supported by the internet 
  10018.                      (PF_INET) communication domain. 
  10019.  
  10020.  SOCK_SEQPACKET      Provides sequenced byte streams that are reliable and 
  10021.                      connection-oriented.  Data is sent without error or 
  10022.                      duplication and is received in the same order as it was 
  10023.                      sent. Sequenced packet sockets are supported by the 
  10024.                      NetBIOS (PF_NETBIOS or PF_NB) communication domain. 
  10025.  
  10026.  The protocol parameter specifies a particular protocol to be used with the 
  10027.  socket. If the protocol field is set to 0 (default), the system selects the 
  10028.  default protocol number for the domain and socket type requested. Default and 
  10029.  valid protocol number-protocol family combinations are in the section Socket 
  10030.  Protocol Families. The getprotobyname() call can be used to get the protocol 
  10031.  number for a protocol with a well-known name. 
  10032.  
  10033.  Return Values 
  10034.  
  10035.  A non-negative socket descriptor return value indicates success. The return 
  10036.  value -1 indicates an error. You can get the specific error code by calling 
  10037.  sock_errno() or psock_errno(). 
  10038.  
  10039.  sock_errno() Value              Description
  10040.  
  10041.  SOCEMFILE                       The maximum number of sockets are currently in 
  10042.                                  use. 
  10043.  
  10044.  SOCEPROTONOSUPPORT              The protocol is not supported in the specified 
  10045.                                  domain or the protocol is not supported for 
  10046.                                  the specified socket type. 
  10047.  
  10048.  SOCEPFNOSUPPORT                 The protocol family is not supported. 
  10049.  
  10050.  SOCESOCKTNOSUPPORT              The socket type is not supported. 
  10051.  
  10052.  Examples 
  10053.  
  10054.  Following are examples of the socket() call. 
  10055.  
  10056.   int s;
  10057.   struct protoent *p;
  10058.   struct protoent *getprotobyname(char *name);
  10059.   int socket(int domain, int type, int protocol); /* extracted from sys/socket.h */
  10060.   ...
  10061.   /* Get stream socket in internet domain with default protocol */
  10062.   s = socket(PF_INET, SOCK_STREAM, 0);
  10063.   ...
  10064.   /* Get raw socket in internet domain for ICMP protocol */
  10065.   p = getprotobyname("icmp");
  10066.   s = socket(PF_INET, SOCK_RAW, p->p_proto);
  10067.  
  10068.  Related Calls 
  10069.  
  10070.       accept() 
  10071.       bind() 
  10072.       connect() 
  10073.       getsockname() 
  10074.       getsockopt() 
  10075.       ioctl() 
  10076.       listen() 
  10077.       os2_ioctl() 
  10078.       os2_select() 
  10079.       readv() 
  10080.       recv() 
  10081.       recvfrom() 
  10082.       recvmsg() 
  10083.       select() 
  10084.       send() 
  10085.       sendmsg() 
  10086.       sendto() 
  10087.       setsockopt() 
  10088.       shutdown() 
  10089.       sock_errno() 
  10090.       soclose() 
  10091.       writev() 
  10092.  
  10093.  
  10094. ΓòÉΓòÉΓòÉ 12.27. soclose() ΓòÉΓòÉΓòÉ
  10095.  
  10096. The socket call shuts down a socket and frees resources allocated to the 
  10097. socket. 
  10098.  
  10099. Syntax 
  10100.  
  10101. #include <types.h>
  10102. #include <unistd.h>
  10103. int soclose(s)
  10104. int s;
  10105.  
  10106. Parameters 
  10107.  
  10108.  s 
  10109.    Socket descriptor. 
  10110.  
  10111.  Description 
  10112.  
  10113.  This call shuts down the socket associated with the socket descriptor s, and 
  10114.  frees resources allocated to the socket.  If s refers to a connected socket, 
  10115.  the connection is closed. 
  10116.  
  10117.  If the SO_LINGER socket option is enabled (see setsockopt() for additional 
  10118.  information), then the task will try to send any queued data. If the SO_LINGER 
  10119.  socket option is disabled, then the task will flush any data queued to be 
  10120.  sent. 
  10121.  
  10122.  Return Values 
  10123.  
  10124.  The value 0 indicates success; the value -1 indicates an error. You can get 
  10125.  the specific error code by calling sock_errno() or psock_errno(). 
  10126.  
  10127.  Error Code         Description
  10128.  SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  10129.  SOCEALREADY        The socket s is marked nonblocking, and a previous 
  10130.                     connection attempt has not completed. 
  10131.  
  10132.  Related Calls 
  10133.  
  10134.       accept() 
  10135.       getsockopt() 
  10136.       setsockopt() 
  10137.       sock_errno() 
  10138.       socket() 
  10139.  
  10140.  
  10141. ΓòÉΓòÉΓòÉ 12.28. sysctl() ΓòÉΓòÉΓòÉ
  10142.  
  10143. The sysctl() call performs special operations on the TCP/IP stack. Unlike 
  10144. getsockopt() or setsockopt(), sysctl() accesses and modifies systemwide 
  10145. parameter values for the entire TCP/IP stack. 
  10146.  
  10147. Syntax 
  10148.  
  10149. #include <types.h>
  10150. #include <netinet\in.h>
  10151. #include <netinet\ip_var.h>
  10152. #include <sys\socket.h>
  10153. #include <sys\sysctl.h>
  10154. int sysctl(mib, namelen, oldp, oldenp, newp, newlen)
  10155. int *mib;
  10156. u_int namelen;
  10157. void *oldp;
  10158. size_t newlen;
  10159. size_t *oldlenp;
  10160. void   *newp;
  10161.  
  10162. Parameters 
  10163.  
  10164.  mib 
  10165.    Array of integers consisting of command, protocol, and control functions. 
  10166.  
  10167.  namelen 
  10168.    Length of mib array. 
  10169.  
  10170.  oldp 
  10171.    Data pointer or xxx_ctl structure pointer pointing to data to be sent. 
  10172.  
  10173.  oldenp 
  10174.    Pointer to length of oldp. 
  10175.  
  10176.  newp 
  10177.    Data pointer or xxx_ctl structure pointer pointing to location where data is 
  10178.    to be received. 
  10179.  
  10180.  newlen 
  10181.    Length of newp. 
  10182.  
  10183.  Description 
  10184.  
  10185.  The sysctl() call is functionally similar to the ioctl() call but does not 
  10186.  need a socket to carry the options to and from the stack. 
  10187.  
  10188.  The sysctl() function retrieves stack parameters and allows them to be set. 
  10189.  The information available from sysctl() consists of integers, strings, and 
  10190.  tables. Unless explicitly noted below, sysctl() returns a consistent snapshot 
  10191.  of the data requested. Consistency is achieved by locking the destination 
  10192.  buffer into memory so that the data may be copied without blocking. 
  10193.  
  10194.  Calls to sysctl() are serialized to avoid deadlock. The state is described 
  10195.  using a Management Information Base (MIB) style name, listed below, which is a 
  10196.  namelen length array of integers. The information is copied into the buffer 
  10197.  specified by oldp. The size of the buffer is given by the location specified 
  10198.  by oldlenp before the call, and that location gives the amount of data copied 
  10199.  after a successful call. If the amount of data available is greater than the 
  10200.  size of the buffer supplied, the call supplies as much data as fits in the 
  10201.  buffer provided and returns with the error code SOCENOMEM. 
  10202.  
  10203.  If the old value is not desired, oldp and oldlenp should be set to NULL. The 
  10204.  size of the available data can be determined by calling sysctl() with a NULL 
  10205.  parameter for oldp. 
  10206.  
  10207.  The size of the available data will be returned in the location pointed to by 
  10208.  oldenp. For some operations, the amount of space may change often. For these 
  10209.  operations, the system attempts to round up so that the returned size is large 
  10210.  enough for a call to return the data shortly thereafter. 
  10211.  
  10212.  To set a new value, newp is set to point to a buffer of length newlen from 
  10213.  which the requested value is to be taken. If a new value is not to be set, 
  10214.  newp should be set to NULL and newlen set to 0. 
  10215.  
  10216.  An Inetcfg sysctl needs a fifth mib argument, mib[4], to specify the actual 
  10217.  inet configuration command. 
  10218.  
  10219.  All route sysctl() calls use another additional argument to be carried in 
  10220.  mib[5] for rt_flags.   The old newp may be pointing to a single integer or 
  10221.  char buffer. Also, there are two special control structures (inetver_ctl and 
  10222.  intecfg_ctl) used as oldp/newp structures. Similarly, for statistics the 
  10223.  xxxstat structures should be used. 
  10224.  
  10225.  An application uses the OS2_MEMMAPIO sysctl() call to request the TCP/IP stack 
  10226.  to provide kernel memory for performing High Performance Send (HPS). One such 
  10227.  call can return up to 60K (as 15 4K buffers) of memory. The calling 
  10228.  application provides an array named oldp of up to 15 pointers (to char). On 
  10229.  return from this call, these pointers point to the 4K buffers. The memory 
  10230.  acquired in this way is now owned by the application, and it resides in the 
  10231.  address space of this application. As a result, the application is now 
  10232.  responsible for the management of this memory from a reusability point of 
  10233.  view. Applications can use either semaphores or the OS2_QUERY_MEMMAPIO 
  10234.  sysctl() call for this purpose. Typically, before calling the next high 
  10235.  performance send (which may use one of these buffers), the application needs 
  10236.  to verify that the buffers are free to be reused. Sysctl() supports a maximum 
  10237.  of 64 such calls. Thus, the kernel can provide up to 64 times 60K of high 
  10238.  speed send memory to an application. An ENOMEM error code is returned to any 
  10239.  sysctl() call beyond this limit. A sample of usage of this call for supporting 
  10240.  HPS is contained in High Performance Send. 
  10241.  
  10242.  An application uses the OS2_QUERY_MEMMAPIO sysctl() call to verify the 
  10243.  reusability of the buffers provided by the kernel through the OS2_MEMMAPIO 
  10244.  sysctl() call. This call sends the oldp array of pointers which were filled in 
  10245.  by the kernel during the OS2_MEMMAPIO sysctl() call. oldenp is used to pass 
  10246.  the number of 4K buffers referred to in the oldp array. If a particular 
  10247.  pointer in the oldp array is left unchanged on return from this call, that 
  10248.  buffer has been freed for reuse. Conversely, if a particular pointer in this 
  10249.  array is returned as NULL, this buffer is not yet freed and may not be reused. 
  10250.  It is the responsibility of the application to make these checks. 
  10251.  Alternatively, an application may use semaphores to manage the reusability of 
  10252.  these buffers. The oldp array can be passed with any number of HPS buffers in 
  10253.  a single call and this number of buffers (oldenp) need not be an integer 
  10254.  multiple of 15. The HPS buffers in oldp need not be arranged in the same order 
  10255.  in which they were obtained. Applications should save a copy of the obtained 
  10256.  HPS buffer pointers before calling OS2_QUERY_MEMMAPIO, so that the pointers 
  10257.  are not lost if the buffers are not available. 
  10258.  
  10259.  Values 
  10260.  
  10261.  The values that are supported for different categories of mib values are 
  10262.  listed in the following tables. 
  10263.  
  10264.  The generic mib array has the following structure 
  10265.  
  10266.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10267.   Γöémib Index        Description                                      Γöé
  10268.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10269.   Γöé0                Top Level identifier                             Γöé
  10270.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10271.   Γöé1                Protocol Family                                  Γöé
  10272.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10273.   Γöé2                Protocol                                         Γöé
  10274.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10275.   Γöé3                Address Family or Control Command                Γöé
  10276.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10277.   Γöé4                Control Command                                  Γöé
  10278.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10279.   Γöé5                Flags, etc.                                      Γöé
  10280.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10281.  
  10282.  The mib[0] Top Level values are: 
  10283.  
  10284.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10285.   ΓöéValue                            Description                     Γöé
  10286.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10287.   ΓöéCTL_KERN                         Sockets (kernel) domain.        Γöé
  10288.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10289.   ΓöéCTL_NET                          Routing domain.                 Γöé
  10290.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10291.   ΓöéCTL_OS2                          Local Interprocess CommunicationΓöé
  10292.   Γöé                                 (afos2) domain.                 Γöé
  10293.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10294.  
  10295.  The mib[1] Protocol Family values are: 
  10296.  
  10297.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10298.   ΓöéValue                            Description                     Γöé
  10299.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10300.   ΓöéPF_INET                          Internet protocol family.       Γöé
  10301.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10302.   ΓöéPF_OS2                           LIPC (afos2) protocol family.   Γöé
  10303.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10304.   ΓöéPF_ROUTE                         Route protocol family.          Γöé
  10305.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10306.   ΓöéKERN_HOSTID                                                      Γöé
  10307.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10308.  
  10309.  The mib[2] Protocols values are: 
  10310.  
  10311.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10312.   ΓöéValue                            Description                     Γöé
  10313.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10314.   ΓöéIPPROTO_IP                       Internet Protocol.              Γöé
  10315.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10316.   ΓöéIPPROTO_TCP                      Transmission Control Protocol.  Γöé
  10317.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10318.   ΓöéIPPROTO_UDP                      User Datagram Protocol.         Γöé
  10319.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10320.  
  10321.  The mib[3] Control Command values for inetcfg are: 
  10322.  
  10323.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10324.   ΓöéValue                            Description                     Γöé
  10325.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10326.   ΓöéIPCTL_INETCFG                    IP inet configuration.          Γöé
  10327.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10328.   ΓöéTCPCTL_INETCFG                   TCP inet configuration.         Γöé
  10329.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10330.   ΓöéUDPCTL_INETCFG                   UDP inet configuration.         Γöé
  10331.   Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10332.   ΓöéLIPCCTL_INETCFG                  LIPC inet configuration.        Γöé
  10333.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10334.  
  10335.  The following table is an overview of the sysctl() calls structure, with links 
  10336.  to the descriptions of the mib values. The table is the calling tree to get to 
  10337.  individual leaves, which are the supported mib values. You read the table by 
  10338.  looking on the right-hand side for the leaf for the value you are seeking, 
  10339.  then taking the link to the table that defines that value and describes the 
  10340.  function of the value. For example, the first leaf, KERNCTL_INETVER, will get 
  10341.  you to the table for mib[0]=CTL_KERN, mib[1]=KERN_HOSTID, and 
  10342.  mib[2]=IPPROTO_IP. 
  10343.  
  10344.          mib numbers
  10345.   [0] [1] [2] [3] [4] [5]
  10346.   CTL_KERN
  10347.   ....KERN_HOSTID
  10348.   ........IPPROTO_IP
  10349.   ............KERNCTL_INETVER
  10350.   CTL_OS2
  10351.   ....PF_OS2
  10352.   ........IPPROTO_IP
  10353.   ............LIPCCTL_INETVER
  10354.   ............LIPCCTL_INETCFG
  10355.   ................LIPCCTL_DG_RECVSPACE
  10356.   ................LIPCCTL_DG_SENDSPACE
  10357.   ................LIPCCTL_ST_RECVSPACE
  10358.   ................LIPCCTL_ST_SENDSPACE
  10359.   ....PF_INET
  10360.   ........IPPROTO_IP
  10361.   ............OS2_MEMMAPIO
  10362.   ............OS2_QUERY_MEMMAPIO
  10363.   CTL_NET
  10364.   ....PF_INET
  10365.   ........IPPROTO_TCP
  10366.   ............TCPCTL_INETCFG
  10367.   ................TCPCTL_CC
  10368.   ................TCPCTL_KEEPCNT
  10369.   ................TCPCTL_LINGERTIME
  10370.   ................TCPCTL_MSL
  10371.   ................TCPCTL_MTU
  10372.   ................TCPCTL_REALSLOW
  10373.   ................TCPCTL_TCPRWIN
  10374.   ................TCPCTL_TCPSWIN
  10375.   ................TCPCTL_TIMESTMP
  10376.   ................TCPCTL_TTL
  10377.   ................TCPCTL_WINSCALE
  10378.   ............TCPCTL_MSSDFLT
  10379.   ............TCPCTL_RTTDFLT
  10380.   ............TCPCTL_STATS
  10381.   ........IPPROTO_UDP
  10382.   ............UDPCTL_INETCFG
  10383.   ................UDPCTL_TTL
  10384.   ................UDPCTL_UDPRWIN
  10385.   ................UDPCTL_UDPSWIN
  10386.   ............UDPCTL_CHECKSUM
  10387.   ............UDPCTL_STATS
  10388.   ........IPPROTO_IP
  10389.   ............IPCTL_INETVER
  10390.   ............IPCTL_FORWARDING
  10391.   ............IPCTL_SENDREDIRECTS
  10392.   ............IPCTL_INETCFG
  10393.   ................FRAGCTL_TTL
  10394.   ................ICMPCTL_TTL
  10395.   ................IPCTL_ARPTKILLC
  10396.   ................IPCTL_ARPTKILLI
  10397.   ................IPCTL_FIREWALL
  10398.   ................IPCTL_FORWARD
  10399.   ................IPCTL_MULTIDEFROUTES
  10400.   ................IPCTL_SYNATTACK
  10401.   ........IPPROTO_ICMP
  10402.   ............ICMPCTL_ECHOREPL
  10403.   ............ICMPCTL_MASKREPL
  10404.   ............ICMPCTL_STATS
  10405.   ....PF_ROUTE
  10406.   ........0 (wildcard)
  10407.   ............0 (wildcard)
  10408.   ................NET_RT_DUMP
  10409.   ....................NET_RT_LLINFO
  10410.   ................NET_RT_FLAGS
  10411.   ................NET_RT_IFLIST
  10412.   [0] [1] [2] [3] [4] [5]
  10413.          mib numbers
  10414.  
  10415.  Return Values 
  10416.  
  10417.  The requested values are returned in the newp parameter. The sysctl() call 
  10418.  itself returns the number of bytes copied, if the call is successful. 
  10419.  Otherwise, -1 is returned and the errno value is set appropriately. 
  10420.  
  10421.  Error Code               Description
  10422.  SOCENOPROTOOPT           The protocol specified in mib[1] is not valid. 
  10423.  SOCENOTDIR               The length specified in namelen is not valid. 
  10424.  SOCEOPNOTSUPP            The option specified in mib[3] is not supported. 
  10425.  SOCEINVAL                Insufficient mib parameters were supplied. 
  10426.  SOCENOMEM                Memory allocation failed. This error value is 
  10427.                           returned by High Performance Send (HPS) sysctl 
  10428.                           (OS2_MEMMAPIO). 
  10429.  SOCEPERM                 This parameter cannot be set, it can only be 
  10430.                           retrieved. Therefore, newp must be set to NULL. 
  10431.  
  10432.  Related Calls 
  10433.  
  10434.       ioctl() 
  10435.       os2_ioctl() 
  10436.  
  10437.  
  10438. ΓòÉΓòÉΓòÉ 12.28.1. mibs for INET Version (sockets.sys) ΓòÉΓòÉΓòÉ
  10439.  
  10440. This table shows the mib[3] values supported for 
  10441.  
  10442. mib[0]=CTL_KERN
  10443. mib[1]=KERN_HOSTID
  10444. mib[2]=0
  10445.  
  10446. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10447. Γöémib[3] Values       Data Type     Description                     Γöé
  10448. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10449. ΓöéKERNCTL_INETVER     struct        Get (no set) the SOCKETS.SYS    Γöé
  10450. Γöé                    inetver_ctl   version number.                 Γöé
  10451. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10452.  
  10453.  
  10454. ΓòÉΓòÉΓòÉ 12.28.2. mibs for INET Version (afos2.sys) ΓòÉΓòÉΓòÉ
  10455.  
  10456. This table shows the mib[3] values supported for 
  10457.  
  10458. mib[0]=CTL_OS2
  10459. mib[1]=PF_OS2
  10460. mib[2]=0
  10461.  
  10462. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10463. Γöémib[3] Values       Data Type     Description                     Γöé
  10464. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10465. ΓöéLIPCCTL_INETVER     struct        Get (no set) the AFOS2.SYS      Γöé
  10466. Γöé                    inetvers_ctl  (LIPC) version number.          Γöé
  10467. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10468.  
  10469.  
  10470. ΓòÉΓòÉΓòÉ 12.28.3. mibs for afos2 inetconfig ΓòÉΓòÉΓòÉ
  10471.  
  10472. This table shows the mib[4] values supported for 
  10473.  
  10474. mib[0]=CTL_OS2
  10475. mib[1]=PF_OS2
  10476. mib[2]=0
  10477. mib[3]=LIPCCTL_INETCFG
  10478.  
  10479. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10480. Γöémib[4] Values           Data Type    Description                  Γöé
  10481. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10482. ΓöéLIPCCTL_DG_RECVSPACE    int          Get or set the datagram      Γöé
  10483. Γöé                                     recieve space.               Γöé
  10484. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10485. ΓöéLIPCCTL_DG_SENDSPACE    int          Get or set the datagram send Γöé
  10486. Γöé                                     space.                       Γöé
  10487. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10488. ΓöéLIPCCTL_ST_RECVSPACE    int          Get or set the stream receiveΓöé
  10489. Γöé                                     space.                       Γöé
  10490. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10491. ΓöéLIPCCTL_ST_SENDSPACE    int          Get or set the stream send   Γöé
  10492. Γöé                                     space.                       Γöé
  10493. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10494.  
  10495.  
  10496. ΓòÉΓòÉΓòÉ 12.28.4. mibs for High Performance Memory ΓòÉΓòÉΓòÉ
  10497.  
  10498. This table shows the mib[3] values supported for 
  10499.  
  10500. mib[0]=CTL_OS2
  10501. mib[1]=PF_INET
  10502. mib[2]=0
  10503.  
  10504. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10505. Γöémib[3] Values       Data Type     Description                     Γöé
  10506. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10507. ΓöéOS2_MEMMAPIO        long *        Get (no set) high performance   Γöé
  10508. Γöé                                  memory.                         Γöé
  10509. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10510. ΓöéOS2_QUERY_MEMMAPIO  long *        Get (no set) high performance   Γöé
  10511. Γöé                                  memory reusability status.      Γöé
  10512. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10513.  
  10514.  
  10515. ΓòÉΓòÉΓòÉ 12.28.5. mibs for TCPCTL inetconfig ΓòÉΓòÉΓòÉ
  10516.  
  10517. This table shows the mib[4] values supported for 
  10518.  
  10519. mib[0]=CTL_NET
  10520. mib[1]=PF_INET
  10521. mib[2]=IPPROTO_TCP
  10522. mib[3]=TCPCTL_INETCFG
  10523.  
  10524. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10525. Γöémib[4] Values       Data Type     Description                     Γöé
  10526. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10527. ΓöéTCPCTL_CC           int           Get or set the CC, CCnew and    Γöé
  10528. Γöé                                  echo flag on or off.            Γöé
  10529. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10530. ΓöéTCPCTL_KEEPCNT      int           Get or set the number of        Γöé
  10531. Γöé                                  keepalive probes.               Γöé
  10532. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10533. ΓöéTCPCTL_LINGERTIME   int           Get or set the linger on close  Γöé
  10534. Γöé                                  time.                           Γöé
  10535. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10536. ΓöéTCPCTL_MSL          int           Get or set the TCP maximum      Γöé
  10537. Γöé                                  segment lifetime value.         Γöé
  10538. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10539. ΓöéTCPCTL_MTU          int           Get or set the path maximum     Γöé
  10540. Γöé                                  transmission unit (MTU)         Γöé
  10541. Γöé                                  discovery flag on or off.       Γöé
  10542. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10543. ΓöéTCPCTL_REALSLOW     int           Get or set the real slow timer  Γöé
  10544. Γöé                                  value for the time wait queue.  Γöé
  10545. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10546. ΓöéTCPCTL_TCPRWIN      int           Get or set the TCP receive      Γöé
  10547. Γöé                                  window size.                    Γöé
  10548. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10549. ΓöéTCPCTL_TCPSWIN      int           Get or set the TCP send window  Γöé
  10550. Γöé                                  size.                           Γöé
  10551. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10552. ΓöéTCPCTL_TIMESTMP     int           Get or set the TCP timestamp    Γöé
  10553. Γöé                                  flag on or off.                 Γöé
  10554. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10555. ΓöéTCPCTL_TTL          int           Get or set the time to live     Γöé
  10556. Γöé                                  (TTL) for TCP packets.          Γöé
  10557. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10558. ΓöéTCPCTL_WINSCALE     int           Get or set the window scale (fatΓöé
  10559. Γöé                                  pipe) flag on or off.           Γöé
  10560. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10561.  
  10562.  
  10563. ΓòÉΓòÉΓòÉ 12.28.6. mibs for TCPCTL ΓòÉΓòÉΓòÉ
  10564.  
  10565. This table shows the mib[3] values supported for 
  10566.  
  10567. mib[0]=CTL_NET
  10568. mib[1]=PF_INET
  10569. mib[2]=IPPROTO_TCP
  10570.  
  10571. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10572. Γöémib[3] Values         Data Type   Description                     Γöé
  10573. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10574. ΓöéTCPCTL_MSSDFLT        int         Get or set the TCP maximum      Γöé
  10575. Γöé                                  segment size (MSS) default.     Γöé
  10576. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10577. ΓöéTCPCTL_RTTDFLT        int         Get or set the round trip time  Γöé
  10578. Γöé                                  (RTT) default.                  Γöé
  10579. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10580. ΓöéTCPCTL_STATS          struct      Get (no set) the TCP statistics.Γöé
  10581. Γöé                      tcpstat                                     Γöé
  10582. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10583.  
  10584.  
  10585. ΓòÉΓòÉΓòÉ 12.28.7. mibs for UDPCTL inetconfig ΓòÉΓòÉΓòÉ
  10586.  
  10587. This table shows the mib[4] values supported for 
  10588.  
  10589. mib[0]=CTL_NET
  10590. mib[1]=PF_INET
  10591. mib[2]=IPPROTO_UDP
  10592. mib[3]=UDPCTL_INETCFG
  10593.  
  10594. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10595. Γöémib[4] Values       Data Type     Description                     Γöé
  10596. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10597. ΓöéUDPCTL_TTL          int           Get or set the time to live     Γöé
  10598. Γöé                                  (TTL) for UDP packets.          Γöé
  10599. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10600. ΓöéUDPCTL_UDPRWIN      int           Get or set the UDP receive      Γöé
  10601. Γöé                                  window size.                    Γöé
  10602. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10603. ΓöéUDPCTL_UDPSWIN      int           Get or set the UDP send window  Γöé
  10604. Γöé                                  size.                           Γöé
  10605. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10606.  
  10607.  
  10608. ΓòÉΓòÉΓòÉ 12.28.8. mibs for UDPCTL ΓòÉΓòÉΓòÉ
  10609.  
  10610. This table shows the mib[3] values supported for 
  10611.  
  10612. mib[0]=CTL_NET
  10613. mib[1]=PF_INET
  10614. mib[2]=IPPROTO_UDP
  10615.  
  10616. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10617. Γöémib[3] Values         Data Type   Description                     Γöé
  10618. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10619. ΓöéUDPCTL_CHECKSUM       int         Get or set the UDP checksum     Γöé
  10620. Γöé                                  computing on or off.            Γöé
  10621. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10622. ΓöéUDPCTL_STATS          struct      Get (no set) the UDP statistics.Γöé
  10623. Γöé                      udpstat                                     Γöé
  10624. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10625.  
  10626.  
  10627. ΓòÉΓòÉΓòÉ 12.28.9. mibs for IPCTL ΓòÉΓòÉΓòÉ
  10628.  
  10629. This table shows the mib[3] values supported for 
  10630.  
  10631. mib[0]=CTL_NET
  10632. mib[1]=PF_INET
  10633. mib[2]=IPPROTO_IP
  10634.  
  10635. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10636. Γöémib[3] Values       Data Type     Description                     Γöé
  10637. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10638. ΓöéIPCTL_INETVER       struct        Get (no set) the AFINET.SYS     Γöé
  10639. Γöé                    inetvers_ctl  version number.                 Γöé
  10640. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10641. ΓöéIPCTL_FORWARDING    int           Get or set  the IP forwarding   Γöé
  10642. Γöé                                  flag on or off.                 Γöé
  10643. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10644. ΓöéIPCTL_SENDREDIRECTS int           Get set the Send Redirects flag Γöé
  10645. Γöé                                  on or off.                      Γöé
  10646. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10647.  
  10648.  
  10649. ΓòÉΓòÉΓòÉ 12.28.10. mibs for IPCTL inetconfig ΓòÉΓòÉΓòÉ
  10650.  
  10651. This table shows the mib[4] values supported for 
  10652.  
  10653. mib[0]=CTL_NET
  10654. mib[1]=PF_INET
  10655. mib[2]=IPPROTO_IP
  10656. mib[3]=IPCTL_INETCFG
  10657.  
  10658. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10659. Γöémib[4] Values         Data Type   Description                     Γöé
  10660. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10661. ΓöéFRAGCTL_TTL           int         Get or set the fragment time to Γöé
  10662. Γöé                                  live (TTL).                     Γöé
  10663. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10664. ΓöéICMPCTL_TTL           int         Get or set the ICMP packet time Γöé
  10665. Γöé                                  to live (TTL).                  Γöé
  10666. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10667. ΓöéIPCTL_ARPTKILLC       int         Get or set the ARP cache        Γöé
  10668. Γöé                                  completed entry timeout.        Γöé
  10669. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10670. ΓöéIPCTL_ARPTKILLI       int         Get or set the ARP cache        Γöé
  10671. Γöé                                  incompleted entry timeout.      Γöé
  10672. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10673. ΓöéIPCTL_FIREWALL        int         Get or set the IP firewall flag Γöé
  10674. Γöé                                  on or off.                      Γöé
  10675. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10676. ΓöéIPCTL_FORWARD         int         Get or set the IP forwarding    Γöé
  10677. Γöé                                  flag on or off.                 Γöé
  10678. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10679. ΓöéIPCTL_MULTIDEFROUTES  int         Get or set the multiple default Γöé
  10680. Γöé                                  routes function on or off.      Γöé
  10681. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10682. ΓöéIPCTL_SYNATTACK       int         Get or set the SYN attack flag  Γöé
  10683. Γöé                                  on or off.                      Γöé
  10684. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10685.  
  10686.  
  10687. ΓòÉΓòÉΓòÉ 12.28.11. mibs for ICMPCTL ΓòÉΓòÉΓòÉ
  10688.  
  10689. This table shows the mib[3] values supported for 
  10690.  
  10691. mib[0]=CTL_NET
  10692. mib[1]=PF_INET
  10693. mib[2]=IPPROTO_ICMP
  10694.  
  10695. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10696. Γöémib[3] Values         Data Type   Description                     Γöé
  10697. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10698. ΓöéICMPCTL_ECHOREPL      int         Get or set the ICMP echo flag onΓöé
  10699. Γöé                                  or off.                         Γöé
  10700. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10701. ΓöéICMPCTL_MASKREPL      int         Get or set the flag to check if Γöé
  10702. Γöé                                  the system should respond to    Γöé
  10703. Γöé                                  ICMP address mask requests on orΓöé
  10704. Γöé                                  off.                            Γöé
  10705. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10706. ΓöéICMPCTL_STATS         struct      Get (no set) the ICMP           Γöé
  10707. Γöé                      icmpstat    statistics.                     Γöé
  10708. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10709.  
  10710.  
  10711. ΓòÉΓòÉΓòÉ 12.28.12. mibs for ROUTE ΓòÉΓòÉΓòÉ
  10712.  
  10713. This table shows the mib[4] values supported for 
  10714.  
  10715. mib[0]=CTL_NET
  10716. mib[1]=PF_ROUTE
  10717. mib[2]=0
  10718. mib[3]=any valid address family or 0
  10719.  
  10720. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10721. Γöémib[4] Values         Data Type   Description                     Γöé
  10722. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10723. ΓöéNET_RT_DUMP           char *      Dump the routing table entries  Γöé
  10724. Γöé                                  corresponding to the address    Γöé
  10725. Γöé                                  family specified in mib[5]. If  Γöé
  10726. Γöé                                  the address family is zero, thenΓöé
  10727. Γöé                                  all routing tables are returned.Γöé
  10728. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10729. ΓöéNET_RT_FLAGS          char *      Dump the routing table entries  Γöé
  10730. Γöé                                  corresponding to the routing    Γöé
  10731. Γöé                                  flag RTF_xxx specified in       Γöé
  10732. Γöé                                  mib[5].                         Γöé
  10733. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10734. ΓöéNET_RT_IFLIST         char *      Return information for all      Γöé
  10735. Γöé                                  configured interfaces if mib[5] Γöé
  10736. Γöé                                  is zero. A nonzero mib[5] value Γöé
  10737. Γöé                                  specifies the index for a       Γöé
  10738. Γöé                                  particular interface, and       Γöé
  10739. Γöé                                  interface information for only  Γöé
  10740. Γöé                                  that interface is returned.     Γöé
  10741. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10742.  
  10743.  
  10744. ΓòÉΓòÉΓòÉ 12.28.13. mibs for ROUTE with Flags ΓòÉΓòÉΓòÉ
  10745.  
  10746. This table shows the mib[5] values supported for 
  10747.  
  10748. mib[0]=CTL_NET
  10749. mib[1]=PF_ROUTE
  10750. mib[2]=0
  10751. mib[3]=any valid address family of 0
  10752. mib[4]=NET_RT_DUMP
  10753.  
  10754. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10755. Γöémib[5] Values         Data Type   Description                     Γöé
  10756. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10757. ΓöéNET_RT_LLINFO         int         Dump the routing table          Γöé
  10758. Γöé                                  corresponding to the address    Γöé
  10759. Γöé                                  family specified in mib[3]. If  Γöé
  10760. Γöé                                  the address family is zero,     Γöé
  10761. Γöé                                  return all route tables. It     Γöé
  10762. Γöé                                  carries the RFT_xxx flags or    Γöé
  10763. Γöé                                  interface index.                Γöé
  10764. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10765.  
  10766.  
  10767. ΓòÉΓòÉΓòÉ 12.28.14. Examples ΓòÉΓòÉΓòÉ
  10768.  
  10769. The following examples illustrate the sysctl() call. 
  10770.  
  10771. This example uses the sysctl() call to get the protocol driver version. 
  10772.  
  10773. # include  < stdio . h >
  10774. # include  < types . h >
  10775. # include  < netinet \ in . h >
  10776. # include  < sys \ socket . h >
  10777. # include  < netinet \ ip _ var . h >
  10778. # include  < sys \ sysctl . h >
  10779.  
  10780. int  main ( void )
  10781. {
  10782.         int  mib [ 4 ] , i ;
  10783.         unsigned  int   oldenp = 0 ,  newlen = 0 ;
  10784.         struct  inetvers _ ctl   uap _ old ,  * uap _ new ;
  10785.  
  10786.         mib [ 0 ] =  CTL _ KERN ;         / *  cmd              * /
  10787.         mib [ 1 ] =  KERN _ HOSTID ;      / *  Protocol  Family . * /
  10788.         mib [ 2 ] =  IPPROTO _ IP ;       / *  Protocol         * /
  10789.         mib [ 3 ] =  KERNCTL _ INETVER ;  / *  Control  command  for  sysctl  * /
  10790.  
  10791.  
  10792.         uap _ new  =  NULL ;
  10793.         oldenp   =  sizeof ( struct  inetvers _ ctl ) ;
  10794.  
  10795.         if  ( sysctl ( mib , 4 , ( void  * ) & uap _ old , & oldenp , ( void  * ) uap _ new , newlen )  >  0 )
  10796.            printf  ( "    SOCKETS . SYS :  % s \ n " , uap _ old . versionstr ) ;
  10797.  
  10798. }
  10799.  
  10800. The next example shows an inetcfg sysctl() call that uses a fifth mib argument 
  10801. to specify the actual inet config command. This example sets then gets the 
  10802. value. 
  10803.  
  10804. # include  < stdio . h >
  10805. # include  < types . h >
  10806. # include  < sys / socket . h >
  10807. # include  < netinet / in . h >
  10808. # include  < netinet / tcp _ var . h >
  10809. # include  < sys / sysctl . h >
  10810. void   main ( void )
  10811. {
  10812.         int  mib [ 5 ] ;
  10813.         unsigned  int   oldenp = 0 ,  newlen ;
  10814.         struct  inetcfg _ ctl  uap _ old ,  uap _ new ;
  10815.  
  10816.         mib [ 0 ] =  CTL _ NET ;          / *  Top  level  idetifier  * /
  10817.         mib [ 1 ] =  PF _ INET ;          / *  Protocol  Family  * /
  10818.         mib [ 2 ] =  IPPROTO _ TCP ;      / *  Protocol  * /
  10819.         mib [ 3 ] =  TCPCTL _ INETCFG ;   / *  Control  command  for  tcp _ sysctl  * /
  10820.         mib [ 4 ] =  TCPCTL _ KEEPCNT ;   / *  Particular  Inetcfg  cmd  for  sysctl _ inetcfg  * /
  10821.  
  10822.         / *  Set  the  Value  in  stack  * /
  10823.         uap _ new . var _ cur _ val  =  4 ;   / *  Send  4  Keepalive  probes ,  rather  than  8  * /
  10824.         newlen   =  sizeof ( struct  inetcfg _ ctl ) ;
  10825.         if  ( sysctl ( mib , 5 , ( void  * ) NULL ,  & oldenp ,  ( void  * ) & uap _ new ,  newlen )  <  0 )
  10826.             printf ( " sysctl  failed  for  requested  parameter \ n " ) ;
  10827.  
  10828.         / *  Get  the  Value  from  stack  * /
  10829.         oldenp   =  sizeof ( struct  inetcfg _ ctl ) ;
  10830.         if  ( sysctl ( mib , 5 , ( void  * ) & uap _ old ,  & oldenp ,  ( void  * ) NULL ,  0 )  <  0 )
  10831.             printf ( " sysctl  failed  for  requested  parameter \ n " ) ;
  10832.         else
  10833.             printf ( " Current  stack  parameter  value  is  % d \ n " , uap _ old . var _ cur _ val ) ;
  10834. }
  10835.  
  10836. This example illustrates a sysctl() call that uses the route mib. 
  10837.  
  10838. # include  < stdio . h >
  10839. # include  < string . h >
  10840. # include  < types . h >
  10841. # include  < netinet \ in . h >
  10842. # include  < sys \ socket . h >
  10843. # include  < netinet \ ip _ var . h >
  10844. # include  < sys \ sysctl . h >
  10845. # include  < net \ route . h >
  10846. # include  < net \ if . h >
  10847.  
  10848. void  main ( void )
  10849. {
  10850.         size _ t    needed ;
  10851.         int       mib [ 6 ] ;
  10852.         char      * buf ,  * next ,  * lim ;
  10853.         struct    rt _ msghdr  * rtm ;
  10854.  
  10855.         mib [ 0 ]  =  CTL _ NET ;
  10856.         mib [ 1 ]  =  PF _ ROUTE ;
  10857.         mib [ 2 ]  =  0 ;             / *  Wildcard  Protocol  * /
  10858.         mib [ 3 ]  =  0 ;             / *  Wildcard  Address  Family  * /
  10859.         mib [ 4 ]  =  NET _ RT _ IFLIST ;
  10860.         mib [ 5 ]  =  0 ;             / *  All  interfaces  * /
  10861.  
  10862.         if  ( sysctl ( mib ,  6 ,  NULL ,  & needed ,  NULL ,  0 )  <  0 )
  10863.                  psock _ errno ( " route - sysctl - estimate " ) ;
  10864.  
  10865.         if  ( needed  = =  0 )  {
  10866.             printf ( " no  routes  defined \ n " ) ;
  10867.             return  0 ;
  10868.         }
  10869.  
  10870.         buf  =  malloc ( needed ) ;
  10871.         if  ( sysctl ( mib ,  6 ,  buf ,  & needed ,  NULL ,  0 )  <  0 )
  10872.                 psock _ errno ( " sysctl  if  table " ) ;
  10873.         lim   =  buf  +  needed ;
  10874.         for  ( next  =  buf ;  next  <  lim ;  next  + =  rtm - > rtm _ msglen )  {
  10875.            rtm  =  ( struct  rt _ msghdr  * ) next ;
  10876.            switch ( rtm - > rtm _ type ) {
  10877.               case  RTM _ IFINFO :
  10878.                 {  struct  if _ msghdr  * ifm  =  ( struct  if _ msghdr  * )  rtm ;
  10879.                   printf ( " if #   % d  , flags  0x % x \ n " , ifm - > ifm _ index , ifm - > ifm _ flags ) ;
  10880.                 }
  10881.                   break ;
  10882.               case  RTM _ NEWADDR :
  10883.                   / *  Add  code  for  this  and  for  RTM _ DELADDR  etc . . . . . * /
  10884.                   break ;
  10885.            }  / *  switch  * /
  10886.         }  / *  for  * /
  10887. }
  10888.  
  10889.  
  10890. ΓòÉΓòÉΓòÉ 12.29. writev() ΓòÉΓòÉΓòÉ
  10891.  
  10892. The socket call writes data from a set of specified buffers on a socket. 
  10893.  
  10894. Syntax 
  10895.  
  10896. #include <types.h>
  10897. #include <sys/uio.h>
  10898. int writev(s, iov, iovcnt)
  10899. int s;
  10900. struc iovec *iov;
  10901. int iovcnt;
  10902.  
  10903. Parameters 
  10904.  
  10905.  s 
  10906.    Socket descriptor. 
  10907.  
  10908.  iov 
  10909.    Pointer to an array of iovec structures. 
  10910.  
  10911.  iovcnt 
  10912.    Number of iovec structures pointed to by the iov parameter. The maximum 
  10913.    value is 1024. 
  10914.  
  10915.  Description 
  10916.  
  10917.  This call writes data on a socket with descriptor s. The data is gathered from 
  10918.  the buffers specified by iov[0]...iov[iovcnt-1]. The iovec structure is 
  10919.  defined in <SYS/UIO.H> and contains the following fields: 
  10920.  
  10921.   Field          Description
  10922.  iov_base       Pointer to the buffer 
  10923.  iov_len        Length of the buffer 
  10924.  
  10925.  This call writes iov_len bytes of data. If there is not enough available 
  10926.  buffer space to hold the socket data to be transmitted and the socket is in 
  10927.  blocking mode, writev() blocks the caller until additional buffer space 
  10928.  becomes available. If the socket is in a nonblocking mode, writev() returns -1 
  10929.  and sets return code to SOCEWOULDBLOCK. See ioctl() for a description of how 
  10930.  to set nonblocking mode. 
  10931.  
  10932.  TCP/IP alters iov_base and iov_len for each element in the input struct iovec 
  10933.  array. iov_base will point to the next character of the processed (sent or 
  10934.  received) data on the original buffer, and iov_len will become (input value - 
  10935.  processed length). Thus if only partial data has been sent or received and the 
  10936.  application expects more data to send or receive, it can pass the same iovec 
  10937.  back in a subsequent call. 
  10938.  
  10939.  For datagram sockets, this call sends the entire datagram, provided the 
  10940.  datagram fits into the protocol buffers.  Stream sockets act like streams of 
  10941.  information with no boundaries separating data.  For example, if an 
  10942.  application sends 1000 bytes, each call to this function can send 1 byte, 10 
  10943.  bytes, or the entire 1000 bytes. For a stream socket, an application can place 
  10944.  this call in a loop, calling this function until all data has been sent. 
  10945.  
  10946.  Return Values 
  10947.  
  10948.  When successful, the number of bytes of data written is returned. Successful 
  10949.  completion does not guarantee the data is written. The return value -1 
  10950.  indicates an error was detected on the sending side of the connection. You can 
  10951.  get the specific error code by calling sock_errno() or psock_errno(). 
  10952.  
  10953.  sock_errno() Value       Description
  10954.  
  10955.  SOCENOTSOCK              s is not a valid socket descriptor. 
  10956.  
  10957.  SOCEFAULT                Using the iov and iovcnt parameters would result in 
  10958.                           an attempt to access memory outside the caller's 
  10959.                           address space. 
  10960.  
  10961.  SOCEINTR                 Interrupted system call. 
  10962.  
  10963.  SOCEINVAL                Invalid argument. 
  10964.  
  10965.  SOCENOBUFS               Buffer space is not available to send the message. 
  10966.  
  10967.  SOCEWOULDBLOCK           The s parameter is in nonblocking mode and the data 
  10968.                           cannot be written without blocking, or the 
  10969.                           SO_SNDTIMEO option has been set for socket s and the 
  10970.                           timeout expired before any data was sent. 
  10971.  
  10972.  SOCEMSGSIZE              The message was too big to be sent as a single 
  10973.                           datagram. 
  10974.  
  10975.  SOCEDESTADDRREQ          A destination address is required. 
  10976.  
  10977.  Related Calls 
  10978.  
  10979.       connect() 
  10980.       getsockopt() 
  10981.       ioctl() 
  10982.       readv() 
  10983.       recv() 
  10984.       recvfrom() 
  10985.       recvmsg() 
  10986.       select() 
  10987.       send() 
  10988.       sendmsg() 
  10989.       sendto() 
  10990.       setsockopt() 
  10991.       sock_errno() 
  10992.       socket() 
  10993.  
  10994.  
  10995. ΓòÉΓòÉΓòÉ 13. TCP/IP Network Utility Routines API ΓòÉΓòÉΓòÉ
  10996.  
  10997. The following table briefly describes each sockets utility function call 
  10998. supported by networking services and identifies where you can find the syntax, 
  10999. parameters, and other appropriate information. The network utility calls 
  11000. described in this section can be used to access services only for the internet 
  11001. communication domain. 
  11002.  
  11003. TCP/IP Network Utility Routines Quick Reference 
  11004.  
  11005. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11006. ΓöéSocket Call               Description                             Γöé
  11007. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11008. Γöédn_comp()                 Compresses the expanded domain name     Γöé
  11009. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11010. Γöédn_expand()               Expands a compressed domain name to a   Γöé
  11011. Γöé                          full domain name                        Γöé
  11012. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11013. Γöédn_find()                 Searches for an expanded name from a    Γöé
  11014. Γöé                          list of previously compressed names     Γöé
  11015. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11016. Γöédn_skipname()             Skips over a compressed domain name     Γöé
  11017. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11018. Γöéendhostent()              Closes the ETC\HOSTS file               Γöé
  11019. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11020. Γöéendnetent()               Closes the ETC\NETWORKS file            Γöé
  11021. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11022. Γöéendprotoent()             Closes the ETC\PROTOCOL file, which     Γöé
  11023. Γöé                          contains information about known        Γöé
  11024. Γöé                          protocols                               Γöé
  11025. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11026. Γöéendservent()              Closes the ETC\SERVICES file            Γöé
  11027. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11028. Γöégethostbyaddr()           Returns a pointer to information about aΓöé
  11029. Γöé                          host specified by an Internet address   Γöé
  11030. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11031. Γöégethostbyname()           Returns a pointer to information about aΓöé
  11032. Γöé                          host specified by a host name           Γöé
  11033. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11034. Γöégethostent()              Returns a pointer to the next entry in  Γöé
  11035. Γöé                          the ETC\HOSTS file                      Γöé
  11036. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11037. Γöégethostid()               Returns the unique identifier of the    Γöé
  11038. Γöé                          current host                            Γöé
  11039. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11040. Γöégethostname()             Gets the standard host name for the     Γöé
  11041. Γöé                          local host machine                      Γöé
  11042. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11043. Γöé_getlong()                Retrieves long byte quantities          Γöé
  11044. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11045. Γöégetnetbyaddr()            Returns a pointer to the ETC\NETWORKS   Γöé
  11046. Γöé                          file entry that contains the specified  Γöé
  11047. Γöé                          network address                         Γöé
  11048. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11049. Γöégetnetbyname()            Returns a pointer to the ETC\NETWORKS   Γöé
  11050. Γöé                          file entry that contains the specified  Γöé
  11051. Γöé                          network name                            Γöé
  11052. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11053. Γöégetnetent()               Returns a pointer to the next entry in  Γöé
  11054. Γöé                          the ETC\NETWORKS file                   Γöé
  11055. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11056. Γöégetprotobyname()          Returns a pointer to the ETC\PROTOCOL   Γöé
  11057. Γöé                          file entry specified by a protocol name Γöé
  11058. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11059. Γöégetprotobynumber()        Returns a pointer to the ETC\PROTOCOL   Γöé
  11060. Γöé                          file entry specified by a protocol      Γöé
  11061. Γöé                          number                                  Γöé
  11062. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11063. Γöégetprotoent()             Returns a pointer to the next entry in  Γöé
  11064. Γöé                          the ETC\PROTOCOL file                   Γöé
  11065. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11066. Γöégetservbyname()           Returns a pointer to the ETC\SERVICES   Γöé
  11067. Γöé                          file entry specified by a service name  Γöé
  11068. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11069. Γöégetservbyport()           Returns a pointer to the ETC\SERVICES   Γöé
  11070. Γöé                          file entry specified by a port number   Γöé
  11071. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11072. Γöégetservent()              Returns a pointer to the next entry in  Γöé
  11073. Γöé                          the ETC\SERVICES file                   Γöé
  11074. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11075. Γöé_getshort()               Retrieves short byte quantities         Γöé
  11076. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11077. Γöéh_errno                   Returns the TCP/IP error code           Γöé
  11078. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11079. Γöéhtonl()                   Translates byte order from host to      Γöé
  11080. Γöé                          network for a long integer              Γöé
  11081. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11082. Γöéhtons()                   Translates byte order from host to      Γöé
  11083. Γöé                          network for a short integer             Γöé
  11084. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11085. Γöéinet_addr()               Constructs an internet address from     Γöé
  11086. Γöé                          character strings representing numbers  Γöé
  11087. Γöé                          expressed in standard dotted-decimal    Γöé
  11088. Γöé                          notation                                Γöé
  11089. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11090. Γöéinet_lnaof()              Returns the local network portion of an Γöé
  11091. Γöé                          internet address                        Γöé
  11092. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11093. Γöéinet_makeaddr()           Constructs an internet address from a   Γöé
  11094. Γöé                          network number and a local address      Γöé
  11095. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11096. Γöéinet_netof()              Returns the network portion of the      Γöé
  11097. Γöé                          internet address in network-byte order  Γöé
  11098. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11099. Γöéinet_network()            Constructs a network number from        Γöé
  11100. Γöé                          character strings representing numbers  Γöé
  11101. Γöé                          expressed in standard dotted-decimal    Γöé
  11102. Γöé                          notation                                Γöé
  11103. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11104. Γöéinet_ntoa()               Returns a pointer to a string in        Γöé
  11105. Γöé                          dotted-decimal notation                 Γöé
  11106. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11107. Γöéntohl()                   Translates byte order from network to   Γöé
  11108. Γöé                          host for a long integer                 Γöé
  11109. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11110. Γöéntohs()                   Translates byte order from network to   Γöé
  11111. Γöé                          host for a short integer                Γöé
  11112. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11113. Γöéputlong()                 Places long byte quantities into the    Γöé
  11114. Γöé                          byte stream                             Γöé
  11115. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11116. Γöéputshort()                Places short byte quantities into the   Γöé
  11117. Γöé                          byte stream                             Γöé
  11118. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11119. ΓöéRaccept()                 Accepts a connection request from a     Γöé
  11120. Γöé                          SOCKS server                            Γöé
  11121. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11122. ΓöéRbind()                   Binds a local name to the socket        Γöé
  11123. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11124. ΓöéRconnect()                Requests a connection to a remote host  Γöé
  11125. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11126. Γöéres_init()                Reads the RESOLV file for the default   Γöé
  11127. Γöé                          domain name                             Γöé
  11128. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11129. Γöéres_mkquery()             Makes a query message for the name      Γöé
  11130. Γöé                          servers in the internet domain          Γöé
  11131. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11132. Γöéres_query()               Provides an interface to the server     Γöé
  11133. Γöé                          query mechanism                         Γöé
  11134. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11135. Γöéres_querydomain()         Queries the concatenation of name and   Γöé
  11136. Γöé                          domain                                  Γöé
  11137. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11138. Γöéres_search()              Makes a query and awaits a response     Γöé
  11139. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11140. Γöéres_send()                Sends a query to a local name server    Γöé
  11141. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11142. Γöérexec()                   Allows command processing on a remote   Γöé
  11143. Γöé                          host                                    Γöé
  11144. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11145. ΓöéRgethostbyname()          Returns a pointer to information about aΓöé
  11146. Γöé                          host specified by a host name           Γöé
  11147. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11148. ΓöéRgetsockname()            Gets the socket name from the SOCKS     Γöé
  11149. Γöé                          server                                  Γöé
  11150. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11151. ΓöéRlisten()                 Completes the binding necessary for a   Γöé
  11152. Γöé                          socket to accept connections and createsΓöé
  11153. Γöé                          a connection request queue for incoming Γöé
  11154. Γöé                          requests                                Γöé
  11155. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11156. Γöésethostent()              Opens and rewinds the ETC\HOSTS file    Γöé
  11157. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11158. Γöésetnetent()               Opens and rewinds the ETC\NETWORKS file Γöé
  11159. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11160. Γöésetprotoent()             Opens and rewinds the ETC\PROTOCOL file Γöé
  11161. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11162. Γöésetservent()              Opens and rewinds the ETC\SERVICES file Γöé
  11163. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11164.  
  11165.  
  11166. ΓòÉΓòÉΓòÉ 13.1. dn_comp() ΓòÉΓòÉΓòÉ
  11167.  
  11168. The dn_comp() call compresses the expanded domain name. 
  11169.  
  11170. Syntax 
  11171.  
  11172. #include <types.h>
  11173. #include <netinet\in.h>
  11174. #include <arpa\nameser.h>
  11175. #include <resolv.h>
  11176. int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
  11177. u_char *exp_dn;
  11178. u_char *comp_dn;
  11179. int length;
  11180. u_char **dnptrs;
  11181. u_char **lastdnptr;
  11182.  
  11183. Parameters 
  11184.  
  11185.  exp_dn 
  11186.    Pointer to the location of an expanded domain name. 
  11187.  
  11188.  comp_dn 
  11189.    Pointer to an array containing the compressed domain name. 
  11190.  
  11191.  length 
  11192.    Length of the array in bytes pointed to by the comp_dn parameter. 
  11193.  
  11194.  dnptrs 
  11195.    Pointer to a list of pointers to previously compressed names in the current 
  11196.    message. 
  11197.  
  11198.  lastdnptr 
  11199.    Pointer to the end of the array pointed to by dnptrs. 
  11200.  
  11201.  Description 
  11202.  
  11203.  The dn_comp() call compresses a domain name to conserve space. When 
  11204.  compressing names, the client process must keep a record of suffixes that have 
  11205.  appeared previously. The dn_comp() call compresses a full domain name by 
  11206.  comparing suffixes to a list of previously used suffixes and removing the 
  11207.  longest possible suffix. 
  11208.  
  11209.  The dn_comp() call compresses the domain name pointed to by the exp_dn 
  11210.  parameter and stores it in the area pointed to by the comp_dn parameter. The 
  11211.  dn_comp() call inserts labels into the message as the name is compressed. The 
  11212.  dn_comp() call also maintains a list of pointers to the message labels and 
  11213.  updates the list of label pointers. 
  11214.  
  11215.      If the value of the dnptrs parameter is null, the dn_comp() call does not 
  11216.       compress any names. The dn_comp() call translates a domain name from 
  11217.       ASCII to internal format without removing suffixes (compressing). 
  11218.       Otherwise, the dnptrs parameter is the address of pointers to previously 
  11219.       compressed suffixes. 
  11220.  
  11221.      If the lastdnptr parameter is null, the dn_comp() call does not update 
  11222.       the list of label pointers. 
  11223.  
  11224.  The dn_comp() call is one of a group of calls that form the resolver. The 
  11225.  resolver is a set of functions that perform a translation between domain names 
  11226.  and network addresses. Global information used by the resolver calls resides 
  11227.  in the _res data structure. The <RESOLV.H> file contains the _res data 
  11228.  structure definition. (See The _res Data Structure for more on the _res data 
  11229.  structure.) 
  11230.  
  11231.  Return Values 
  11232.  
  11233.  When successful, the dn_comp() call returns the size of the compressed domain 
  11234.  name. When unsuccessful, the call returns a value of -1. 
  11235.  
  11236.  Related Calls 
  11237.  
  11238.       dn_expand() 
  11239.       dn_find() 
  11240.       dn_skipname() 
  11241.       _getlong() 
  11242.       _getshort() 
  11243.       putlong() 
  11244.       putshort() 
  11245.       res_init() 
  11246.       res_mkquery() 
  11247.       res_query() 
  11248.       res_search() 
  11249.       res_send() 
  11250.  
  11251.  
  11252. ΓòÉΓòÉΓòÉ 13.2. dn_expand() ΓòÉΓòÉΓòÉ
  11253.  
  11254. The dn_expand() call expands a compressed domain name to a full domain name. 
  11255.  
  11256. Syntax 
  11257.  
  11258. #include <types.h>
  11259. #include <netinet\in.h>
  11260. #include <arpa\nameser.h>
  11261. #include <resolv.h>
  11262. int dn_expand(msg, eomorig, comp_dn, exp_dn, length)
  11263. u_char *msg;
  11264. u_char *eomorig;
  11265. u_char *comp_dn;
  11266. u_char *exp_dn;
  11267. int length;
  11268.  
  11269. Parameters 
  11270.  
  11271.  msg 
  11272.    Pointer to the beginning of a message. 
  11273.  
  11274.  eomorig 
  11275.    Pointer to the end of the original message that contains the compressed 
  11276.    domain name. 
  11277.  
  11278.  comp_dn 
  11279.    Pointer to the compressed domain name. 
  11280.  
  11281.  exp_dn 
  11282.    Pointer to a buffer that holds the resulting expanded domain name. 
  11283.  
  11284.  length 
  11285.    Length of the buffer in bytes pointed to by the exp_dn parameter. 
  11286.  
  11287.  Description 
  11288.  
  11289.  The dn_expand() call expands a compressed domain name to a full domain name, 
  11290.  converting the expanded names to all uppercase letters. A client process 
  11291.  compresses domain names to conserve space. Compression consists of removing 
  11292.  the longest possible previously occurring suffixes. The dn_expand() call 
  11293.  restores a domain name compressed by the dn_comp() call to its full size. 
  11294.  
  11295.  The dn_expand() call is one of a set of calls that form the resolver. The 
  11296.  resolver is a group of functions that perform a translation between domain 
  11297.  names and network addresses. Global information used by the resolver calls 
  11298.  resides in the _res data structure. The <RESOLV.H> file contains the _res data 
  11299.  structure definition. (See The _res Data Structure for more on the _res data 
  11300.  structure.) 
  11301.  
  11302.  Return Values 
  11303.  
  11304.  When successful, the dn_expand() call returns the size of the expanded domain 
  11305.  name. When unsuccessful, the call returns a value of -1. 
  11306.  
  11307.  Related Calls 
  11308.  
  11309.       dn_comp() 
  11310.       dn_find() 
  11311.       dn_skipname() 
  11312.       _getlong() 
  11313.       _getshort() 
  11314.       putlong() 
  11315.       putshort() 
  11316.       res_init() 
  11317.       res_mkquery() 
  11318.       res_query() 
  11319.       res_search() 
  11320.       res_send() 
  11321.  
  11322.  
  11323. ΓòÉΓòÉΓòÉ 13.3. dn_find() ΓòÉΓòÉΓòÉ
  11324.  
  11325. The dn_find() call searches for an expanded name from a list of previously 
  11326. compressed names. 
  11327.  
  11328. Syntax 
  11329.  
  11330. #include <types.h>
  11331. #include <netinet\in.h>
  11332. #include <arpa\nameser.h>
  11333. #include <resolv.h>
  11334. int dn_find(exp_dn, msg, dnptrs, lastdnptr)
  11335. u_char *exp_dn;
  11336. u_char *msg;
  11337. u_char **dnptrs;
  11338. u_char **lastdnptr;
  11339.  
  11340. Parameters 
  11341.  
  11342.  exp_dn 
  11343.    Pointer to the expanded name to search for. 
  11344.  
  11345.  msg 
  11346.    Pointer to the start of a messag.e 
  11347.  
  11348.  dnptrs 
  11349.    Pointer to the location of the first name on the list to search, not the 
  11350.    pointer to the start of the message. 
  11351.  
  11352.  lastdnptr 
  11353.    Pointer to the end of the array pointed to by dnptrs. 
  11354.  
  11355.  Description 
  11356.  
  11357.  The dn_find() call is one of a group of calls that form the resolver. The 
  11358.  resolver is a set of functions that perform a translation between domain names 
  11359.  and network addresses. Global information used by the resolver calls resides 
  11360.  in the _res data structure. The <RESOLV.H> file contains the _res data 
  11361.  structure definition. (See The _res Data Structure for more on the _res data 
  11362.  structure.) 
  11363.  
  11364.  Return Values 
  11365.  
  11366.  When successful, the dn_find() call returns the offset from msg. When 
  11367.  unsuccessful, the call returns a value of -1. 
  11368.  
  11369.  Related Calls 
  11370.  
  11371.       dn_comp() 
  11372.       dn_expand() 
  11373.       dn_skipname() 
  11374.       _getlong() 
  11375.       _getshort() 
  11376.       putlong() 
  11377.       putshort() 
  11378.       res_init() 
  11379.       res_mkquery() 
  11380.       res_query() 
  11381.       res_search() 
  11382.       res_send() 
  11383.  
  11384.  
  11385. ΓòÉΓòÉΓòÉ 13.4. dn_skipname() ΓòÉΓòÉΓòÉ
  11386.  
  11387. The dn_skipname() call skips over the compressed domain name pointed to by the 
  11388. comp_dn parameter. 
  11389.  
  11390. Syntax 
  11391.  
  11392. #include <types.h>
  11393. #include <netinet\in.h>
  11394. #include <arpa\nameser.h>
  11395. #include <resolv.h>
  11396. int dn_skipname(comp_dn, eom)
  11397. u_char *comp_dn;
  11398. u_char *eom;
  11399.  
  11400. Parameters 
  11401.  
  11402.  comp_dn 
  11403.    Pointer to the compressed domain name. 
  11404.  
  11405.  eom 
  11406.    Pointer to the end of the original message that contains the compressed 
  11407.    domain name. 
  11408.  
  11409.  Return Values 
  11410.  
  11411.  When successful, the dn_skipname() call returns the size of the compressed 
  11412.  name. When unsuccessful, the call returns a value of -1. 
  11413.  
  11414.  Related Calls 
  11415.  
  11416.       dn_comp() 
  11417.       dn_expand() 
  11418.       dn_find() 
  11419.       _getlong() 
  11420.       _getshort() 
  11421.       putlong() 
  11422.       putshort() 
  11423.       res_init() 
  11424.       res_mkquery() 
  11425.       res_query() 
  11426.       res_search() 
  11427.       res_send() 
  11428.  
  11429.  
  11430. ΓòÉΓòÉΓòÉ 13.5. endhostent() ΓòÉΓòÉΓòÉ
  11431.  
  11432. The endhostent() call closes the ETC\HOSTS file, which contains information 
  11433. about known hosts. 
  11434.  
  11435. Syntax 
  11436.  
  11437. #include <netdb.h>
  11438. void endhostent()
  11439.  
  11440. Description 
  11441.  
  11442. The endhostent() call closes the ETC\HOSTS file. 
  11443.  
  11444. When using the endhostent() call in DNS/BIND name service resolution, 
  11445. endhostent() closes the TCP connection which the sethostent() call set up. 
  11446.  
  11447. Related Calls 
  11448.  
  11449.       gethostbyaddr() 
  11450.       gethostbyname() 
  11451.       gethostent() 
  11452.       sethostent() 
  11453.  
  11454.  
  11455. ΓòÉΓòÉΓòÉ 13.6. endnetent() ΓòÉΓòÉΓòÉ
  11456.  
  11457. The endnetent() call closes the ETC\NETWORKS file, which contains information 
  11458. about known networks. 
  11459.  
  11460. Note:  Calls made to the getnetent(), getnetbyaddr(), or getnetbyname() call 
  11461.        open the ETC\NETWORKS file. 
  11462.  
  11463.  Syntax 
  11464.  
  11465.   #include <netdb.h>
  11466.   void endnetent()
  11467.  
  11468.  Related Calls 
  11469.  
  11470.       getnetbyaddr() 
  11471.       getnetbyname() 
  11472.       getnetent() 
  11473.       setnetent() 
  11474.  
  11475.  
  11476. ΓòÉΓòÉΓòÉ 13.7. endprotoent() ΓòÉΓòÉΓòÉ
  11477.  
  11478. The endprotoent() call closes the ETC\PROTOCOL file, which contains information 
  11479. about known protocols. 
  11480.  
  11481. Note:  Calls made to the getprotoent(), getprotobyname(), or getnetbynumber() 
  11482.        call open the ETC\PROTOCOL file. 
  11483.  
  11484.  Syntax 
  11485.  
  11486.   #include <netdb.h>
  11487.   void endprotoent()
  11488.  
  11489.  Related Calls 
  11490.  
  11491.       getprotobyname() 
  11492.       getprotobynumber() 
  11493.       getprotoent() 
  11494.       setprotoent() 
  11495.  
  11496.  
  11497. ΓòÉΓòÉΓòÉ 13.8. endservent() ΓòÉΓòÉΓòÉ
  11498.  
  11499. The endservent() call closes the ETC\SERVICES file, which contains information 
  11500. about known services. 
  11501.  
  11502. Note:  Calls made to the getservent(), getservbyname(), or getservbyport() call 
  11503.        open the ETC\SERVICES file. 
  11504.  
  11505.  Syntax 
  11506.  
  11507.   #include <netdb.h>
  11508.   void endservent()
  11509.  
  11510.  Related Calls 
  11511.  
  11512.       endprotoent() 
  11513.       getprotobyname() 
  11514.       getprotobynumber() 
  11515.       getprotoent() 
  11516.       getservbyname() 
  11517.       getservbyport() 
  11518.       getservent() 
  11519.       setprotoent() 
  11520.       setservent() 
  11521.  
  11522.  
  11523. ΓòÉΓòÉΓòÉ 13.9. gethostbyaddr() ΓòÉΓòÉΓòÉ
  11524.  
  11525. The gethostbyaddr() call returns a pointer to information about a host 
  11526. specified by an internet address. 
  11527.  
  11528. Syntax 
  11529.  
  11530. #include <netdb.h>
  11531. struct hostent *gethostbyaddr(addr, addrlen, addrfam)
  11532. char *addr;
  11533. int addrlen;
  11534. int addrfam;
  11535.  
  11536. Parameters 
  11537.  
  11538.  addr 
  11539.    Pointer to a 32-bit internet address in network-byte order. 
  11540.  
  11541.  addrlen 
  11542.    Size of addr in bytes. 
  11543.  
  11544.  addrfam 
  11545.    Address family supported (AF_INET). 
  11546.  
  11547.  Description 
  11548.  
  11549.  This call resolves the host name through a name server, if one is present. If 
  11550.  a name server is not present or cannot resolve the host name, gethostbyaddr() 
  11551.  uses the default name services ordering: first it queries DNS/BIND, then it 
  11552.  searches the ETC\HOSTS file in sequence until a matching host address is found 
  11553.  or an end-of-file (EOF) marker is reached. This search order can be reversed 
  11554.  by adding the following statement in your CONFIG.SYS file: 
  11555.  
  11556.   SET USE_HOSTS_FIRST=1
  11557.  
  11558.  When using DNS/BIND name service resolution, if the ETC\RESOLV file exists the 
  11559.  gethostbyaddr() call queries the domain name server. The gethostbyaddr() call 
  11560.  recognizes domain name servers as described in RFC 883. 
  11561.  
  11562.  The gethostbyaddr() call also searches the local ETC\HOSTS file when indicated 
  11563.  to do so. 
  11564.  
  11565.  The gethostbyaddr() call returns a pointer to a hostent structure, which 
  11566.  contains information obtained from one of the name resolutions services. The 
  11567.  hostent structure is defined in the <NETDB.H> file. 
  11568.  
  11569.  Return Values 
  11570.  
  11571.  The return value points to static data that subsequent API calls can modify. 
  11572.  This call returns a pointer to a hostent structure for the host address 
  11573.  specified on the call and indicates success. A NULL pointer indicates an 
  11574.  error. 
  11575.  
  11576.  The <NETDB.H> header file defines the hostent structure and contains the 
  11577.  following elements: 
  11578.  
  11579.   Element        Description
  11580.  h_name         Official name of the host 
  11581.  h_aliases      Zero-terminated array of alternative names for the host 
  11582.  h_addrtype     The address family of the network address being returned, 
  11583.                 always set to AF_INET 
  11584.  h_length       Length of the address in bytes 
  11585.  h_addr         Pointer to the network address of the host 
  11586.  
  11587.  The value of h_errno indicates the specific error. 
  11588.  
  11589.  
  11590.    h_errno Value   Code  Description
  11591.  
  11592.    NETDB_INTERNAL   -1   Generic error value. Call sock_errno() or
  11593.                          psock_errno() to get a more detailed error
  11594.                          code (or error message).
  11595.  
  11596.    HOST_NOT_FOUND   1    The host specified by the addr parameter is
  11597.                          not found.
  11598.  
  11599.    TRY_AGAIN        2    The local server does not receive a response
  11600.                          from an authorized server. Try again later.
  11601.  
  11602.    NO_RECOVERY      3    This error code indicates an unrecoverable
  11603.                          error.
  11604.  
  11605.    NO_DATA          4    The requested addr is valid, but does not
  11606.                          have an Internet address at the name server.
  11607.  
  11608.    NO_ADDRESS       4    The requested addr is valid, but does not
  11609.                          have an Internet address at the name server.
  11610.  
  11611.  Related Calls 
  11612.  
  11613.       endhostent() 
  11614.       gethostbyname() 
  11615.       gethostent() 
  11616.       inet_addr() 
  11617.       sethostent() 
  11618.  
  11619.  
  11620. ΓòÉΓòÉΓòÉ 13.10. gethostbyname() ΓòÉΓòÉΓòÉ
  11621.  
  11622. The gethostbyname() call returns a pointer to information about a host 
  11623. specified by a host name. 
  11624.  
  11625. Syntax 
  11626.  
  11627. #include <netdb.h>
  11628. struct hostent *gethostbyname(name)
  11629. char *name;
  11630.  
  11631. Parameters 
  11632.  
  11633.  name 
  11634.    Pointer to the name of the host being queried. 
  11635.  
  11636.  Description: 
  11637.  
  11638.  The following diagram illustrates gethostbyname() processing: 
  11639.  
  11640.  
  11641.   gethostbyname() Processing
  11642.  
  11643.  If you are using a SOCKS server, gethostbyname() calls Rgethostbyname(). To 
  11644.  avoid having to change your applications should there be changes in SOCKS 
  11645.  support, it is recommended you use gethostbyname() rather than 
  11646.  Rgethostbyname(). 
  11647.  
  11648.  See Socket Secure Support for information about SOCKS. 
  11649.  
  11650.  The gethostbyname() call resolves the host name through a name server, if one 
  11651.  is present. If a name server is not present or is unable to resolve the host 
  11652.  name, gethostbyname() searches the ETC\HOSTS file in sequence until a matching 
  11653.  host name is found or an EOF marker is reached. This search order can be 
  11654.  reversed by the following statement in your CONFIG.SYS file: 
  11655.  
  11656.   SET USE_HOSTS_FIRST=1
  11657.  
  11658.  Return Values 
  11659.  
  11660.  The return value points to static data that subsequent API calls can modify. 
  11661.  This call returns a pointer to a hostent structure for the host address 
  11662.  specified on the call and indicates success. A NULL pointer indicates an 
  11663.  error. 
  11664.  
  11665.  The <NETDB.H> header file defines the hostent structure and contains the 
  11666.  following elements: 
  11667.  
  11668.   Element        Description
  11669.  h_name         Official name of the host 
  11670.  h_aliases      Zero-terminated array of alternative names for the host 
  11671.  h_addrtype     The address family of the network address being returned, 
  11672.                 always set to AF_INET 
  11673.  h_length       Length of the address in bytes 
  11674.  h_addr         Pointer to the network address of the host 
  11675.  
  11676.  The value of h_errno indicates the specific error. 
  11677.  
  11678.  
  11679.    h_errno Value   Code  Description
  11680.  
  11681.    NETDB_INTERNAL   -1   Generic error value. Call sock_errno() or
  11682.                          psock_errno()  to get a more detailed error
  11683.                          code (or error message).
  11684.  
  11685.    HOST_NOT_FOUND   1    The host specified by the name parameter is
  11686.                          not found.
  11687.  
  11688.    TRY_AGAIN        2    The local server does not receive a response
  11689.                          from an authorized server. Try again later.
  11690.  
  11691.    NO_RECOVERY      3    This error code indicates an unrecoverable
  11692.                          error.
  11693.  
  11694.    NO_DATA          4    The requested name is valid, but does not
  11695.                          have an Internet address at the name server.
  11696.  
  11697.    NO_ADDRESS       4    The requested name is valid, but does not
  11698.                          have an Internet address at the name server.
  11699.  
  11700.  Related Calls 
  11701.  
  11702.       endhostent() 
  11703.       gethostbyaddr() 
  11704.       gethostent() 
  11705.       inet_addr() 
  11706.       sethostent() 
  11707.  
  11708.  
  11709. ΓòÉΓòÉΓòÉ 13.11. gethostent() ΓòÉΓòÉΓòÉ
  11710.  
  11711. The gethostent() call returns a pointer to the next entry in the ETC\HOSTS 
  11712. file. 
  11713.  
  11714. Syntax 
  11715.  
  11716. #include <netdb.h>
  11717. struct hostent *gethostent()
  11718.  
  11719. Description 
  11720.  
  11721. This call returns a pointer to a hostent structure, which contains the 
  11722. equivalent fields for a host description line in the ETC\HOSTS file. The 
  11723. hostent structure is defined in the <NETDB.H> file. 
  11724.  
  11725. Return Values 
  11726.  
  11727. The return value points to static data that subsequent API calls can modify. 
  11728. This call returns a pointer to a hostent structure for the host address 
  11729. specified on the call and indicates success. A NULL pointer indicates an error 
  11730. or EOF. 
  11731.  
  11732. The <NETDB.H> header file defines the hostent structure and contains the 
  11733. following elements: 
  11734.  
  11735.   Element        Description
  11736.  h_name         Official name of the host 
  11737.  h_aliases      Zero-terminated array of alternative names for the host 
  11738.  h_addrtype     The address family of the network address being returned, 
  11739.                 always set to AF_INET 
  11740.  h_length       Length of the address in bytes 
  11741.  h_addr         Pointer to the network address of the host 
  11742.  
  11743.  Related Calls 
  11744.  
  11745.       endhostent() 
  11746.       gethostbyaddr() 
  11747.       gethostbyname() 
  11748.       sethostent() 
  11749.  
  11750.  
  11751. ΓòÉΓòÉΓòÉ 13.12. gethostid() ΓòÉΓòÉΓòÉ
  11752.  
  11753. The gethostid() call returns the unique 32-bit identifier of the current host. 
  11754.  
  11755. Syntax 
  11756.  
  11757. #include <unistd.h>
  11758. u_long gethostid()
  11759.  
  11760. Return Values 
  11761.  
  11762. The gethostid() call returns the 32-bit identifier, in host-byte order of the 
  11763. current host, which should be unique across all hosts. This identifier is 
  11764. usually the IP address of the primary interface. The default primary interface 
  11765. is lan0.  For a slip only or PPP only configuration, the sl0 or ppp0 is the 
  11766. primary interface.  If no primary interface exists, the call returns a 
  11767. hexadecimal of X'FFFFFFFF'. 
  11768.  
  11769. Related Calls 
  11770.  
  11771.       gethostname() 
  11772.  
  11773.  
  11774. ΓòÉΓòÉΓòÉ 13.13. gethostname() ΓòÉΓòÉΓòÉ
  11775.  
  11776. The gethostname() call gets the standard host name for the local host machine. 
  11777.  
  11778. Syntax 
  11779.  
  11780. #include <unistd.h>
  11781. int gethostname(name, namelen)
  11782. char *name;
  11783. int namelen;
  11784.  
  11785. Parameters 
  11786.  
  11787.  name 
  11788.    Pointer to a buffer. 
  11789.  
  11790.  namelen 
  11791.    Length of the buffer. 
  11792.  
  11793.  Description 
  11794.  
  11795.  This call copies the standard host name for the local host into the buffer 
  11796.  specified by the name parameter. The returned name is a null-terminated 
  11797.  string. If insufficient space is provided, the returned name is truncated to 
  11798.  fit the given space. System host names are limited to 256 characters. 
  11799.  
  11800.  The gethostname() call allows a calling process to determine the internal host 
  11801.  name for a machine on a network. 
  11802.  
  11803.  Return Values 
  11804.  
  11805.  The value 0 indicates success; the value -1 indicates an error. 
  11806.  
  11807.  Related Calls 
  11808.  
  11809.       gethostbyaddr() 
  11810.       gethostbyname() 
  11811.       gethostid() 
  11812.  
  11813.  
  11814. ΓòÉΓòÉΓòÉ 13.14. _getlong() ΓòÉΓòÉΓòÉ
  11815.  
  11816. The _getlong() call retrieves long byte quantities. 
  11817.  
  11818. Syntax 
  11819.  
  11820. #include <sys\types.h>
  11821. #include <netinet\in.h>
  11822. #include <arpa\nameser.h>
  11823. #include <resolv.h>
  11824. u_long _getlong (msgp)
  11825. u_char *msgp;
  11826.  
  11827. Parameters 
  11828.  
  11829.  msgp 
  11830.    Specifies a pointer into the byte stream. 
  11831.  
  11832.  Description 
  11833.  
  11834.  The _getlong() call gets long quantities from the byte stream or arbitrary 
  11835.  byte boundaries. 
  11836.  
  11837.  The _getlong() call is one of a group of calls that form the resolver, a set 
  11838.  of functions that resolves domain names. Global information used by the 
  11839.  resolver calls is kept in the _res data structure. The <RESOLV.H> file 
  11840.  contains the _res structure definition. (See The _res Data Structure for more 
  11841.  on the _res data structure.) 
  11842.  
  11843.  Return Values 
  11844.  
  11845.  The _getlong() call returns an unsigned long (32-bit) value. 
  11846.  
  11847.  Related Calls 
  11848.  
  11849.       dn_comp() 
  11850.       dn_expand() 
  11851.       dn_find() 
  11852.       dn_skipname() 
  11853.       _getshort() 
  11854.       putlong() 
  11855.       putshort() 
  11856.       res_init() 
  11857.       res_mkquery() 
  11858.       res_query() 
  11859.       res_search() 
  11860.       res_send() 
  11861.  
  11862.  
  11863. ΓòÉΓòÉΓòÉ 13.15. getnetbyaddr() ΓòÉΓòÉΓòÉ
  11864.  
  11865. The getnetbyaddr() call returns a pointer to the ETC\NETWORKS file entry that 
  11866. contains the specified network address. 
  11867.  
  11868. Syntax 
  11869.  
  11870. #include <netdb.h>
  11871. struct netent *getnetbyaddr(net, type)
  11872. u_long net;
  11873. int type;
  11874.  
  11875. Parameters 
  11876.  
  11877.  net 
  11878.    Network address. 
  11879.  
  11880.  type 
  11881.    Address family supported (AF_INET). 
  11882.  
  11883.  Description 
  11884.  
  11885.  The getnetbyaddr() call searches the ETC\NETWORKS file for the specified 
  11886.  network address. 
  11887.  
  11888.  The getnetbyaddr() call retrieves information from the ETC\NETWORKS file using 
  11889.  the network address as a search key. The getnetbyaddr() call searches the file 
  11890.  sequentially from the start of the file until it encounters a matching net 
  11891.  number and type or until it reaches the end of the file. 
  11892.  
  11893.  The getnetbyaddr() call returns a pointer to a netent structure, which 
  11894.  contains the equivalent fields for a network description line in the 
  11895.  ETC\NETWORKS file. The netent structure is defined in the <NETDB.H> file. 
  11896.  
  11897.  Use the endnetent() call to close the ETC\NETWORKS file. 
  11898.  
  11899.  Return Values 
  11900.  
  11901.  The return value points to static data that subsequent API calls can modify. A 
  11902.  pointer to a netent structure indicates success.  A NULL pointer indicates an 
  11903.  error or EOF. 
  11904.  
  11905.   The netent structure is defined in the <NETDB.H> header file and contains the 
  11906.  following elements: 
  11907.  
  11908.   Element        Description
  11909.  n_name         Official name of the network 
  11910.  n_aliases      An array, terminated with a NULL pointer, of alternative names 
  11911.                 for the network 
  11912.  n_addrtype     The address family of the network address being returned, 
  11913.                 always set to AF_INET 
  11914.  n_net          Network number, returned in host-byte order 
  11915.  
  11916.  Related Calls 
  11917.  
  11918.       endnetent() 
  11919.       getnetbyname() 
  11920.       getnetent() 
  11921.       setnetent() 
  11922.  
  11923.  
  11924. ΓòÉΓòÉΓòÉ 13.16. getnetbyname() ΓòÉΓòÉΓòÉ
  11925.  
  11926. The getnetbyname() call returns a pointer to the ETC\NETWORKS file entry that 
  11927. contains the specified network name. 
  11928.  
  11929. Syntax 
  11930.  
  11931. #include <netdb.h>
  11932. struct netent *getnetbyname(name)
  11933. char *name;
  11934.  
  11935. Parameters 
  11936.  
  11937.  name 
  11938.    Pointer to a network name. 
  11939.  
  11940.  Description 
  11941.  
  11942.  This call searches the ETC\NETWORKS file for the specified network name. 
  11943.  
  11944.  The getnetbyname() call retrieves information from the ETC\NETWORKS file using 
  11945.  the name parameter as a search key. The getnetbyname() call searches the file 
  11946.  sequentially from the start of the file until it encounters a matching net 
  11947.  name or until it reaches the end of the file. 
  11948.  
  11949.  The getnetbyname() call returns a pointer to a netent structure, which 
  11950.  contains the equivalent fields for a network description line in the 
  11951.  ETC\NETWORKS file. The netent structure is defined in the <NETDB.H> file. 
  11952.  
  11953.  Use the endnetent() call to close the ETC\NETWORKS file. 
  11954.  
  11955.  Return Values 
  11956.  
  11957.  The getnetbyname() call returns a pointer to a netent structure for the 
  11958.  network name specified on the call. The return value points to static data 
  11959.  that subsequent API calls can modify.  A pointer to a netent structure 
  11960.  indicates success.  A NULL pointer indicates an error or EOF. 
  11961.  
  11962.   The netent structure is defined in the <NETDB.H> header file and contains the 
  11963.  following elements: 
  11964.  
  11965.   Element        Description
  11966.  n_name         Official name of the network 
  11967.  n_aliases      An array, terminated with a NULL pointer, of alternative names 
  11968.                 for the network 
  11969.  n_addrtype     The address family of the network address being returned, 
  11970.                 always set to AF_INET 
  11971.  n_net          Network number, returned in host-byte order 
  11972.  
  11973.  Related Calls 
  11974.  
  11975.       endnetent() 
  11976.       getnetbyaddr() 
  11977.       getnetent() 
  11978.       setnetent() 
  11979.  
  11980.  
  11981. ΓòÉΓòÉΓòÉ 13.17. getnetent() ΓòÉΓòÉΓòÉ
  11982.  
  11983. The getnetent() call returns a pointer to the next entry in the ETC\NETWORKS 
  11984. file. 
  11985.  
  11986. Syntax 
  11987.  
  11988. #include <netdb.h>
  11989. struct netent *getnetent()
  11990.  
  11991. Description 
  11992.  
  11993. This call, by opening and sequentially reading the ETC\NETWORKS file, returns a 
  11994. pointer to the next entry in the file. 
  11995.  
  11996. The getnetent() call returns a pointer to a netent structure, which contains 
  11997. the equivalent fields for a network description line in the ETC\NETWORKS file. 
  11998. The netent structure is defined in the <NETDB.H> file. 
  11999.  
  12000. Use the endnetent() call to close the ETC\NETWORKS file. 
  12001.  
  12002. Return Values 
  12003.  
  12004. The getnetent() call returns a pointer to the next entry in the ETC\NETWORKS 
  12005. file. The return value points to static data that subsequent API calls can 
  12006. modify. A pointer to a netent structure indicates success. A NULL pointer 
  12007. indicates an error or EOF. 
  12008.  
  12009.  The netent structure is defined in the <NETDB.H> header file and contains the 
  12010. following elements: 
  12011.  
  12012.   Element        Description
  12013.  n_name         Official name of the network 
  12014.  n_aliases      An array, terminated with a NULL pointer, of alternative names 
  12015.                 for the network 
  12016.  n_addrtype     The address family of the network address being returned, 
  12017.                 always set to AF_INET 
  12018.  n_net          Network number, returned in host-byte order 
  12019.  
  12020.  Related Calls 
  12021.  
  12022.       endnetent() 
  12023.       getnetbyaddr() 
  12024.       getnetbyname() 
  12025.       setnetent() 
  12026.  
  12027.  
  12028. ΓòÉΓòÉΓòÉ 13.18. getprotobyname() ΓòÉΓòÉΓòÉ
  12029.  
  12030. The getprotobyname() call returns a pointer to the ETC\PROTOCOL file entry 
  12031. specified by a protocol name. 
  12032.  
  12033. Syntax 
  12034.  
  12035. #include <netdb.h>
  12036. struct protoent *getprotobyname(name)
  12037. char *name;
  12038.  
  12039. Parameters 
  12040.  
  12041.  name 
  12042.    Pointer to the specified protocol name string. 
  12043.  
  12044.  Description 
  12045.  
  12046.  This call searches the ETC\PROTOCOL file for the specified protocol name. 
  12047.  
  12048.  The getprotobyname() call retrieves protocol information from the ETC\PROTOCOL 
  12049.  file using the name parameter as a search key. An application program can use 
  12050.  this call to access a protocol name, its aliases, and protocol number. 
  12051.  
  12052.  The getprotobyname() call searches the file sequentially from the start of the 
  12053.  file until it encounters a matching protocol name, or until it reaches the end 
  12054.  of the file. 
  12055.  
  12056.  The getprotobyname() call returns a pointer to a protoent structure, which 
  12057.  contains fields for a line of information in the ETC\PROTOCOL file. The 
  12058.  protoent structure is defined in the <NETDB.H> file. 
  12059.  
  12060.  Use the endprotoent() call to close the ETC\PROTOCOL file. 
  12061.  
  12062.  Return Values 
  12063.  
  12064.  The getprotobyname() call returns a pointer to a protoent structure for the 
  12065.  network protocol specified on the call. The return value points to static data 
  12066.  that subsequent API calls can modify. A pointer to a protoent structure 
  12067.  indicates success. A NULL pointer indicates an error or EOF. 
  12068.  
  12069.  The protoent structure is defined in the <NETDB.H> header file and contains 
  12070.  the following elements: 
  12071.  
  12072.   Element        Description
  12073.  p_name         Official name of the protocol 
  12074.  p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12075.                 the protocol 
  12076.  p_proto        Protocol number 
  12077.  
  12078.  Related Calls 
  12079.  
  12080.       endprotoent() 
  12081.       getprotobynumber() 
  12082.       getprotoent() 
  12083.       setprotoent() 
  12084.  
  12085.  
  12086. ΓòÉΓòÉΓòÉ 13.19. getprotobynumber() ΓòÉΓòÉΓòÉ
  12087.  
  12088. The getprotobynumber() call returns a pointer to the ETC\PROTOCOL file entry 
  12089. specified by a protocol number. 
  12090.  
  12091. Syntax 
  12092.  
  12093. #include <netdb.h>
  12094. struct protoent * getprotobynumber(proto)
  12095. int proto;
  12096.  
  12097. Parameters 
  12098.  
  12099.  proto 
  12100.    Protocol number. 
  12101.  
  12102.  Description 
  12103.  
  12104.  This call searches the ETC\PROTOCOL file for the specified protocol number. 
  12105.  
  12106.  The getprotobynumber() call retrieves the protocol information from the 
  12107.  ETC\PROTOCOL file using the specified proto parameter as a search key. An 
  12108.  application program can use this call to access a protocol name, its aliases, 
  12109.  and protocol number. 
  12110.  
  12111.  The getprotobynumber() call searches the file sequentially from the start of 
  12112.  the file until it encounters a matching protocol number, or until it reaches 
  12113.  the end of the file. 
  12114.  
  12115.  The getprotobynumber() call returns a pointer to a protoent structure, which 
  12116.  contains fields for a line of information in the ETC\PROTOCOL file. The 
  12117.  protoent structure is defined in the <NETDB.H> file. 
  12118.  
  12119.  Use the endprotoent() call to close the ETC\PROTOCOL file. 
  12120.  
  12121.  Return Values 
  12122.  
  12123.  The getprotobynumber() call returns a pointer to a protoent structure for the 
  12124.  network protocol specified on the call. The return value points to static data 
  12125.  that subsequent API calls can modify. A pointer to a protoent structure 
  12126.  indicates success. A NULL pointer indicates an error or EOF. 
  12127.  
  12128.  The protoent structure is defined in the <NETDB.H> header file and contains 
  12129.  the following elements: 
  12130.  
  12131.   Element        Description
  12132.  p_name         Official name of the protocol 
  12133.  p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12134.                 the protocol 
  12135.  p_proto        Protocol number 
  12136.  
  12137.  Related Calls 
  12138.  
  12139.       endprotoent() 
  12140.       getprotobyname() 
  12141.       getprotoent() 
  12142.       setprotoent() 
  12143.  
  12144.  
  12145. ΓòÉΓòÉΓòÉ 13.20. getprotoent() ΓòÉΓòÉΓòÉ
  12146.  
  12147. The getprotoent() call returns a pointer to the next entry in the ETC\PROTOCOL 
  12148. file. 
  12149.  
  12150. Syntax 
  12151.  
  12152. #include <netdb.h>
  12153. struct protoent *getprotoent()
  12154.  
  12155. Description 
  12156.  
  12157. This call searches for the next entry in the ETC\PROTOCOL file. 
  12158.  
  12159. The getprotoent() call retrieves the protocol information from the ETC\PROTOCOL 
  12160. file. An application program can use this call to access a protocol name, its 
  12161. aliases, and protocol number. 
  12162.  
  12163. The getprotoent() call opens and performs a sequential read of the ETC\PROTOCOL 
  12164. file. The getprotoent() call returns a pointer to a protoent structure, which 
  12165. contains fields for a line of information in the ETC\PROTOCOL file. The 
  12166. protoent structure is defined in the <NETDB.H> file. 
  12167.  
  12168. Use the endprotoent() call to close the ETC\PROTOCOL file. 
  12169.  
  12170. Return Values 
  12171.  
  12172. The getprotoent() call returns a pointer to the next entry in the file, 
  12173. ETC\PROTOCOL. The return value points to static data that subsequent API calls 
  12174. can modify. A pointer to a protoent structure indicates success. A NULL pointer 
  12175. indicates an error or EOF. 
  12176.  
  12177. The protoent structure is defined in the <NETDB.H> header file and contains the 
  12178. following elements: 
  12179.  
  12180.   Element        Description
  12181.  p_name         Official name of the protocol 
  12182.  p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12183.                 the protocol 
  12184.  p_proto        Protocol number 
  12185.  
  12186.  Related Calls 
  12187.  
  12188.       endprotoent() 
  12189.       getprotobyname() 
  12190.       getprotobynumber() 
  12191.       setprotoent() 
  12192.  
  12193.  
  12194. ΓòÉΓòÉΓòÉ 13.21. getservbyname() ΓòÉΓòÉΓòÉ
  12195.  
  12196. The getservbyname() call returns a pointer to the ETC\SERVICES file entry 
  12197. specified by a service name. 
  12198.  
  12199. Syntax 
  12200.  
  12201. #include <netdb.h>
  12202. struct servent *getservbyname(name, proto)
  12203. char *name;
  12204. char *proto;
  12205.  
  12206. Parameters 
  12207.  
  12208.  name 
  12209.    Pointer to the service name. 
  12210.  
  12211.  proto 
  12212.    Pointer to the specified protocol. 
  12213.  
  12214.  Description 
  12215.  
  12216.  This call searches the ETC\SERVICES file for the specified service name, which 
  12217.  must match the protocol if a protocol is stated. 
  12218.  
  12219.  The getservbyname() call retrieves an entry from the ETC\SERVICES file using 
  12220.  the name parameter as a search key. 
  12221.  
  12222.  An application program can use this call to access a service, service aliases, 
  12223.  the protocol for the service, and a protocol port number for the service. 
  12224.  
  12225.  The getservbyname() call searches the ETC\SERVICES file sequentially from the 
  12226.  start of the file until it finds one of the following: 
  12227.  
  12228.      Matching name and protocol number 
  12229.      Matching name when the proto parameter is set to 0 
  12230.      End of the file 
  12231.   Upon locating a matching name and protocol, the getservbyname() call returns 
  12232.  a pointer to the servent structure, which contains fields for a line of 
  12233.  information from the ETC\SERVICES file. The <NETDB.H> file defines the servent 
  12234.  structure and structure fields. 
  12235.  
  12236.  Use the endservent() call to close the ETC\SERVICES file. 
  12237.  
  12238.  Return Values 
  12239.  
  12240.  The call returns a pointer to a servent structure for the network service 
  12241.  specified on the call. The return value points to static data that subsequent 
  12242.  API calls can modify. A pointer to a servent structure indicates success. A 
  12243.  NULL pointer indicates an error or EOF. 
  12244.  
  12245.  The servent structure is defined in the <NETDB.H> header file and contains the 
  12246.  following elements: 
  12247.  
  12248.   Element        Description
  12249.  s_name         Official name of the service 
  12250.  s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12251.                 the service 
  12252.  s_port         Port number of the service 
  12253.  s_proto        Required protocol to contact the service 
  12254.  
  12255.  Related Calls 
  12256.  
  12257.       endprotoent() 
  12258.       endservent() 
  12259.       getprotobyname() 
  12260.       getprotobynumber() 
  12261.       getprotoent() 
  12262.       getservbyport() 
  12263.       getservent() 
  12264.       setprotoent() 
  12265.       setservent() 
  12266.  
  12267.  
  12268. ΓòÉΓòÉΓòÉ 13.22. getservbyport() ΓòÉΓòÉΓòÉ
  12269.  
  12270. The getservbyport() call returns a pointer to the ETC\SERVICES file entry 
  12271. specified by a port number. 
  12272.  
  12273. Syntax 
  12274.  
  12275. #include <netdb.h>
  12276. struct servent *getservbyport(port, proto)
  12277. int port;
  12278. char *proto;
  12279.  
  12280. Parameters 
  12281.  
  12282.  port 
  12283.    Specified port. 
  12284.  
  12285.  proto 
  12286.    Pointer to the specified protocol. 
  12287.  
  12288.  Description 
  12289.  
  12290.  This call sequentially searches the ETC\SERVICES file for the specified port 
  12291.  number, which must match the protocol if a protocol is stated. 
  12292.  
  12293.  The getservbyport() call retrieves an entry from the ETC\SERVICES file using 
  12294.  the port parameter as a search key. 
  12295.  
  12296.  An application program can use this call to access a service, service aliases, 
  12297.  the protocol for the service, and a protocol port number for the service. 
  12298.  
  12299.  The getservbyname() call searches the ETC\SERVICES file sequentially from the 
  12300.  start of the file until it finds one of the following: 
  12301.  
  12302.      Matching protocol and port number 
  12303.      Matching protocol when the port parameter is set to 0 
  12304.      End of the file 
  12305.   Upon locating a matching protocol and port number-or upon locating a matching 
  12306.  protocol only (if the port parameter equals 0-the getservbyport() call returns 
  12307.  a pointer to the servent structure. This structure contains fields for a line 
  12308.  of information from the ETC\SERVICES file. The <NETDB.H> file defines the 
  12309.  servent structure and structure fields. 
  12310.  
  12311.  Use the endservent() call to close the ETC\SERVICES file. 
  12312.  
  12313.  Return Values 
  12314.  
  12315.  The getservbyport() call returns a pointer to a servent structure for the port 
  12316.  number specified on the call. The return value points to static data that 
  12317.  subsequent API calls can modify. A pointer to a servent structure indicates 
  12318.  success. A NULL pointer indicates an error or EOF. 
  12319.  
  12320.  The servent structure is defined in the <NETDB.H> header file and contains the 
  12321.  following elements: 
  12322.  
  12323.   Element        Description
  12324.  s_name         Official name of the service 
  12325.  s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12326.                 the service 
  12327.  s_port         Port number of the service 
  12328.  s_proto        Required protocol to contact the service 
  12329.  
  12330.  Related Calls 
  12331.  
  12332.       endprotoent() 
  12333.       endservent() 
  12334.       getprotobyname() 
  12335.       getprotoent() 
  12336.       getservbyname() 
  12337.       getservent() 
  12338.       setprotoent() 
  12339.       setservent() 
  12340.  
  12341.  
  12342. ΓòÉΓòÉΓòÉ 13.23. getservent() ΓòÉΓòÉΓòÉ
  12343.  
  12344. The getservent() call returns a pointer to the next entry in the ETC\SERVICES 
  12345. file. 
  12346.  
  12347. Syntax 
  12348.  
  12349. #include <netdb.h>
  12350. struct servent *getservent()
  12351.  
  12352. Description 
  12353.  
  12354. This call searches for the next line in the ETC\SERVICES file. An application 
  12355. program can use the getservent() call to retrieve information about network 
  12356. services and the protocol ports they use. 
  12357.  
  12358. The getservent() call returns a pointer to a servent structure, which contains 
  12359. fields for a line of information from the ETC\SERVICES file. The servent 
  12360. structure is defined in the <NETDB.H> file. 
  12361.  
  12362. The ETC\SERVICES file remains open after a call by getservent(). To close the 
  12363. ETC\SERVICES file after each call, use setservent(). Otherwise, use 
  12364. endservent() to close the file. 
  12365.  
  12366. Return Values 
  12367.  
  12368. The getservent() call returns a pointer to the next entry in the ETC\SERVICES 
  12369. file. The return value points to static data that subsequent API calls can 
  12370. modify. A pointer to a servent structure indicates success. A NULL pointer 
  12371. indicates an error or EOF. 
  12372.  
  12373. The servent structure is defined in the <NETDB.H> header file and contains the 
  12374. following elements: 
  12375.  
  12376.   Element        Description
  12377.  s_name         Official name of the service 
  12378.  s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12379.                 the service 
  12380.  s_port         Port number of the service 
  12381.  s_proto        Required protocol to contact the service 
  12382.  
  12383.  Related Calls 
  12384.  
  12385.       endprotoent() 
  12386.       endservent() 
  12387.       getprotobyname() 
  12388.       getprotobynumber() 
  12389.       getprotoent() 
  12390.       getservbyname() 
  12391.       getservbyport() 
  12392.       setprotoent() 
  12393.       setservent() 
  12394.  
  12395.  
  12396. ΓòÉΓòÉΓòÉ 13.24. _getshort() ΓòÉΓòÉΓòÉ
  12397.  
  12398. The _getshort() call retrieves short byte quantities. 
  12399.  
  12400. Syntax 
  12401.  
  12402. #include <sys\types.h>
  12403. #include <netinet\in.h>
  12404. #include <arpa\nameser.h>
  12405. #include <resolv.h>
  12406. u_short _getshort (msgp)
  12407. u_char *msgp;
  12408.  
  12409. Parameters 
  12410.  
  12411.  msgp 
  12412.    Specifies a pointer into the byte stream. 
  12413.  
  12414.  Description 
  12415.  
  12416.  The _getshort() call gets quantities from the byte stream or arbitrary byte 
  12417.  boundaries. 
  12418.  
  12419.  The _getshort() call is one of a group of calls that form the resolver, a set 
  12420.  of functions that resolve domain names. Global information used by the 
  12421.  resolver calls is kept in the _res data structure. The <RESOLV.H> file 
  12422.  contains the _res structure definition. (See The _res Data Structure for more 
  12423.  on the _res data structure.) 
  12424.  
  12425.  Return Values 
  12426.  
  12427.  The _getshort() call returns an unsigned short (16-bit) value. 
  12428.  
  12429.  Related Calls 
  12430.  
  12431.       dn_comp() 
  12432.       dn_expand() 
  12433.       dn_find() 
  12434.       dn_skipname() 
  12435.       _getlong() 
  12436.       putlong() 
  12437.       putshort() 
  12438.       res_init() 
  12439.       res_mkquery() 
  12440.  
  12441.  
  12442. ΓòÉΓòÉΓòÉ 13.25. h_errno ΓòÉΓòÉΓòÉ
  12443.  
  12444. The h_errno variable returns the last name resolution error that occurred in 
  12445. the current thread. 
  12446.  
  12447. Syntax 
  12448.  
  12449. #include <netdb.h>
  12450. int h_errno
  12451.  
  12452. Description 
  12453.  
  12454. The h_errno variable returns the last name resolution error that occurred in 
  12455. the current thread. These error codes are set by gethostname(), res_send(), 
  12456. res_query(), res_querydomain(), and res_search(). 
  12457.  
  12458. Return Values 
  12459.  
  12460. The value -1 indicates an error code is unavailable.  A non-zero, non-negative 
  12461. returned value is the TCP/IP error code. 
  12462.  
  12463.  Error Code              Description
  12464.  HOST_NOT_FOUND          The host cannot be found. 
  12465.  TRY_AGAIN               Server failure. 
  12466.  NO_RECOVERY             Non-recoverable error. 
  12467.  NO_DATA                 Valid name; no data record of requested type. 
  12468.  NO_ADDRESS              No address; look for MX record (mail exchange record 
  12469.                          used by DNS). 
  12470.  
  12471.  Related Calls 
  12472.  
  12473.       gethostname() 
  12474.       res_query() 
  12475.       res_querydomain() 
  12476.       res_search() 
  12477.       res_send() 
  12478.  
  12479.  
  12480. ΓòÉΓòÉΓòÉ 13.26. htonl() ΓòÉΓòÉΓòÉ
  12481.  
  12482. The socket call translates a long integer from host-byte order to network-byte 
  12483. order. 
  12484.  
  12485. Syntax 
  12486.  
  12487. #include <types.h>
  12488. u_long htonl(a)
  12489. u_long a;
  12490.  
  12491. Parameters 
  12492.  
  12493.  a 
  12494.    Unsigned long integer to be put into network-byte order. 
  12495.  
  12496.  Description 
  12497.  
  12498.  The htonl() call converts an unsigned long (32-bit) integer from host-byte 
  12499.  order to internet network-byte order. 
  12500.  
  12501.  The internet network requires addresses and ports in network standard-byte 
  12502.  order. Use the htonl() call to convert the host integer representation of 
  12503.  addresses and ports to internet network-byte order. 
  12504.  
  12505.  Return Values 
  12506.  
  12507.  Returns the translated long integer. 
  12508.  
  12509.  Related Calls 
  12510.  
  12511.       htons() 
  12512.       ntohl() 
  12513.       ntohs() 
  12514.  
  12515.  
  12516. ΓòÉΓòÉΓòÉ 13.27. htons() ΓòÉΓòÉΓòÉ
  12517.  
  12518. The socket call translates a short integer from host-byte order to network-byte 
  12519. order. 
  12520.  
  12521. Syntax 
  12522.  
  12523. #include <types.h>
  12524. u_short htons(a)
  12525. u_short a;
  12526.  
  12527. Parameters 
  12528.  
  12529.  a 
  12530.    Unsigned short integer to be put into network-byte order. 
  12531.  
  12532.  Description 
  12533.  
  12534.  The htons() call converts an unsigned short (16-bit) integer from host-byte 
  12535.  order to internet network-byte order. 
  12536.  
  12537.  The internet network requires addresses and ports in network standard-byte 
  12538.  order. Use the htons() call to convert ports from their host integer 
  12539.  representation to internet network-byte order. 
  12540.  
  12541.  Return Values 
  12542.  
  12543.  Returns the translated short integer. 
  12544.  
  12545.  Related Calls 
  12546.  
  12547.       htonl() 
  12548.       ntohl() 
  12549.       ntohs() 
  12550.  
  12551.  
  12552. ΓòÉΓòÉΓòÉ 13.28. inet_addr() ΓòÉΓòÉΓòÉ
  12553.  
  12554. The inet_addr() call constructs an internet address from character strings 
  12555. representing numbers expressed in standard dotted-decimal notation. 
  12556.  
  12557. Syntax 
  12558.  
  12559. #include <arpa\inet.h>
  12560. u_long inet_addr(cp)
  12561. char *cp;
  12562.  
  12563. Parameters 
  12564.  
  12565.  cp 
  12566.    A character string in standard dotted-decimal notation 
  12567.  
  12568.  Description 
  12569.  
  12570.  The inet_addr() call converts an ASCII string containing a valid internet 
  12571.  address using dotted-decimal notation into an internet address number typed as 
  12572.  an unsigned long value. An example of dotted-decimal notation is 
  12573.  120.121.5.123. The inet_addr() call returns an error value if the internet 
  12574.  address notation in the ASCII string supplied by the application is not valid. 
  12575.  
  12576.  Note: 
  12577.  
  12578.       Although inet_addr() call and inet_network() call both convert internet 
  12579.       addresses in dotted-decimal notation, they process ASCII strings 
  12580.       differently. When an application gives the inet_addr() call a string 
  12581.       containing an internet address value without a delimiter, the call 
  12582.       returns the logical product of the value represented by the string and 
  12583.       0xFFFFFFFF. For any other internet address, if the value of the fields 
  12584.       exceeds the previously defined limits, the inet_addr() call returns an 
  12585.       error value of -1. 
  12586.  
  12587.       When an application gives the inet_network() call a string containing an 
  12588.       internet address value without a delimiter, the inet_network() call 
  12589.       returns the logical product of the value represented by the string and 
  12590.       0xFF. For any other internet address, the call returns an error value of 
  12591.       -1 if the value of the fields exceeds the previously defined limits. 
  12592.  
  12593.       Sample return values for each call are as follows: 
  12594.  
  12595.  
  12596.              Application string       inet_addr() returns   inet_network()
  12597.                                                             returns
  12598.  
  12599.              0x1234567890abcdef       0x090abcdef           0x000000ef
  12600.  
  12601.              0x1234567890abcdef       0xFFFFFFFF (= -1)     0x0000ef00
  12602.  
  12603.              256.257.258.259          0xFFFFFFFF (= -1)     0x00010203
  12604.  
  12605.  
  12606.  The ASCII string for the inet_addr() call must conform to the following 
  12607.  format: 
  12608.  
  12609.   string::= field | field delimited_field^1-3 | delimited_field^1-3
  12610.   delimited_field::= delimiter field | delimiter
  12611.   delimiter::= .
  12612.   field::= 0X | 0x | 0Xhexadecimal* | 0x hexadecimal* | decimal* | 0 octal
  12613.   hexadecimal::= decimal |a|b|c|d|e|f|A|B|C|D|E|F
  12614.   decimal::= octal |8|9
  12615.   octal::= 0|1|2|3|4|5|6|7
  12616.  
  12617.  Notes: 
  12618.  
  12619.    1. ^n indicates n repetitions of a pattern. 
  12620.  
  12621.    2. ^n-m indicates n to m repetitions of a pattern. 
  12622.  
  12623.    3. * indicates 0 or more repetitions of a pattern, up to environmental 
  12624.       limits. 
  12625.  
  12626.    4. The Backus Naur form (BNF) description states the space character, if one 
  12627.       is used. Text indicates text, not a BNF symbol. 
  12628.  
  12629.  The inet_addr() call requires an application to terminate the string with a 
  12630.  null terminator (0x00) or a space (0x30). The string is considered invalid if 
  12631.  the application does not end it with a null terminator or a space. The call 
  12632.  ignores characters trailing a space. 
  12633.  
  12634.  The following describes the restrictions on the field values for the 
  12635.  inet_addr() call: 
  12636.  
  12637.  Format      Field Restrictions (in decimal)
  12638.  a           Value_a < 4,294,967,296 
  12639.  a.b         Value_a < 256; Value_b < 16,777,216 
  12640.  a.b.c       Value_a < 256; Value_b < 256; Value_c < 65536 
  12641.  a.b.c.d     Value_a < 256; Value_b < 256; Value_c < 256; Value_d < 256 
  12642.  
  12643.  When a four-part address is specified, each part is interpreted as a byte of 
  12644.  data and assigned, from left to right, to one of the 4 bytes of an internet 
  12645.  address. 
  12646.  
  12647.  When a three-part address is specified, the last part is interpreted as a 
  12648.  16-bit quantity and placed in the two rightmost bytes of the network address. 
  12649.  This makes the three-part address format convenient for specifying Class B 
  12650.  network addresses as 128.net.host. 
  12651.  
  12652.  When a two-part address is specified, the last part is interpreted as a 24-bit 
  12653.  quantity and placed in the three rightmost bytes of the network address. This 
  12654.  makes the two-part address format convenient for specifying Class A network 
  12655.  addresses as net.host. 
  12656.  
  12657.  When a one-part address is specified, the value is stored directly in the 
  12658.  network address space without any rearrangement of its bytes. 
  12659.  
  12660.  Numbers supplied as address parts in standard dotted-decimal notation can be 
  12661.  decimal, hexadecimal, or octal. Numbers are interpreted in C language syntax. 
  12662.  A leading 0x implies hexadecimal; a leading 0 implies octal. A number without 
  12663.  a leading 0 implies decimal. 
  12664.  
  12665.  Applications that use the inet_addr() call can enter field values exceeding 
  12666.  the above restrictions. The call accepts the least significant bits up to an 
  12667.  integer in length, then checks whether the truncated value exceeds the maximum 
  12668.  field value. For example, if an application enters a field value of 
  12669.  0x1234567890 and the system uses 16 bits per integer, then the inet_addr() 
  12670.  call uses bits 0-15. The call returns 0x34567890. 
  12671.  
  12672.  Applications can omit field values between delimiters. The inet_addr() call 
  12673.  interprets empty fields as 0. 
  12674.  
  12675.  Notes: 
  12676.  
  12677.    1. The inet_addr() call does not check the pointer to the ASCII string. The 
  12678.       user must ensure the validity of the address in the ASCII string. 
  12679.  
  12680.    2. The application must verify that the network and host IDs for the 
  12681.       internet address conform to either a Class A, B, or C internet address. 
  12682.       The inet_attr() call processes any other class of address as a Class C 
  12683.       address. 
  12684.  
  12685.  Return Values 
  12686.  
  12687.  The internet address is returned in network-byte order. The return value 
  12688.  points to static data that subsequent API calls can modify. 
  12689.  
  12690.  For valid input strings, the inet_addr() call returns an unsigned long value 
  12691.  comprised of the bit patterns of the input fields concatenated together. The 
  12692.  call places the first pattern in the most significant position and appends any 
  12693.  subsequent patterns to the next most significant positions. 
  12694.  
  12695.  The inet_addr() call returns an error value of -1 for invalid strings. 
  12696.  
  12697.  Note:  An internet address with a dotted-decimal notation value of 
  12698.         255.255.255.255 or its equivalent in a different base format causes the 
  12699.         inet_addr() call to return an unsigned long value of 4294967295. This 
  12700.         value is identical to the unsigned representation of the error value. 
  12701.         Otherwise, the inet_addr() call considers 255.255.255.255 a valid 
  12702.         internet address. 
  12703.  
  12704.  Related Calls 
  12705.  
  12706.       endhostent() 
  12707.       endnetent() 
  12708.       gethostbyaddr() 
  12709.       gethostbyname() 
  12710.       getnetbyaddr() 
  12711.       getnetbyname() 
  12712.       getnetent() 
  12713.       inet_lnaof() 
  12714.       inet_makeaddr() 
  12715.       inet_netof() 
  12716.       inet_network() 
  12717.       inet_ntoa() 
  12718.       sethostent() 
  12719.       setnetent() 
  12720.  
  12721.  
  12722. ΓòÉΓòÉΓòÉ 13.29. inet_lnaof() ΓòÉΓòÉΓòÉ
  12723.  
  12724. The inet_lnaof() call returns the local network portion of an internet host 
  12725. address. 
  12726.  
  12727. Syntax 
  12728.  
  12729. #include <types.h>
  12730. #include <arpa\inet.h>
  12731. u_long inet_lnaof(in)
  12732. struct in_addr in;
  12733.  
  12734. Parameters 
  12735.  
  12736.  in 
  12737.    Host internet address. 
  12738.  
  12739.  Description 
  12740.  
  12741.  The inet_lnaof() call masks off the host ID of an internet address based on 
  12742.  the internet address class. The calling application must enter the internet 
  12743.  address as an unsigned long value. 
  12744.  
  12745.  Note:  The application must verify that the network and host IDs for the 
  12746.         internet address conform to either a Class A, B, or C internet address. 
  12747.         The inet_lnaof() call processes any other class of address as a Class C 
  12748.         address. 
  12749.  
  12750.  Return Values 
  12751.  
  12752.  The local network address is returned in host-byte order. The return value 
  12753.  points to static data that subsequent API calls can modify. 
  12754.  
  12755.  The return values of the inet_lnaof() call depend on the class of internet 
  12756.  address the application provides: 
  12757.  
  12758.  Class A   The logical product of the internet address and 0x00FFFFFF 
  12759.  Class B   The logical product of the internet address and 0x0000FFFF 
  12760.  Class C   The logical product of the internet address and 0x000000FF 
  12761.  
  12762.  Related Calls 
  12763.  
  12764.       endhostent() 
  12765.       endnetent() 
  12766.       gethostbyaddr() 
  12767.       gethostbyname() 
  12768.       getnetbyaddr() 
  12769.       getnetbyname() 
  12770.       getnetent() 
  12771.       inet_addr() 
  12772.       inet_makeaddr() 
  12773.       inet_netof() 
  12774.       inet_network() 
  12775.       inet_ntoa() 
  12776.       sethostent() 
  12777.       setnetent() 
  12778.  
  12779.  
  12780. ΓòÉΓòÉΓòÉ 13.30. inet_makeaddr() ΓòÉΓòÉΓòÉ
  12781.  
  12782. The inet_makeaddr() call constructs an internet address from a network number 
  12783. and a local network address. 
  12784.  
  12785. Syntax 
  12786.  
  12787. #include <types.h>
  12788. #include <arpa\inet.h>
  12789. struct in_addr inet_makeaddr(net, lna)
  12790. u_long net;
  12791. u_long lna;
  12792.  
  12793. Parameters 
  12794.  
  12795.  net 
  12796.    Network number. 
  12797.  
  12798.  lna 
  12799.    Local network address. 
  12800.  
  12801.  Description 
  12802.  
  12803.  The inet_makeaddr() call forms an internet address from the network ID and 
  12804.  host ID provided by the application (as integer types). If the application 
  12805.  provides a Class A network ID, the inet_makeaddr() call forms the internet 
  12806.  address using the net ID in the highest-order byte, and the logical product of 
  12807.  the host ID and 0x00FFFFFF in the 3 lowest-order bytes. If the application 
  12808.  provides a Class B network ID, the inet_makeaddr() call forms the internet 
  12809.  address using the net ID in the two highest-order bytes, and the logical 
  12810.  product of the host ID and 0x0000FFFF in the lowest two ordered bytes. If the 
  12811.  application does not provide either a Class A or Class B network ID, the 
  12812.  inet_makeaddr() call forms the internet address using the network ID in the 3 
  12813.  highest-order bytes, and the logical product of the host ID and 0x0000FFFF in 
  12814.  the lowest-ordered byte. 
  12815.  
  12816.  The inet_makeaddr() call ensures that the internet address format conforms to 
  12817.  network order, with the first byte representing the high-order byte. The 
  12818.  inet_makeaddr() call stores the internet address in the structure as an 
  12819.  unsigned long value. 
  12820.  
  12821.  The application must verify that the network ID and host ID for the internet 
  12822.  address conform to class A, B, or C. The inet_makeaddr() call processes any 
  12823.  other class of address as a Class C address. 
  12824.  
  12825.  The inet_makeaddr() call expects the in_addr structure to contain only the 
  12826.  internet address field. If the application defines the in_addr structure 
  12827.  otherwise, then the value returned in in_addr by the inet_makeaddr() call is 
  12828.  undefined. 
  12829.  
  12830.  Return Values 
  12831.  
  12832.  The internet address is returned in network-byte order. The return value 
  12833.  points to static data that subsequent API calls can modify. 
  12834.  
  12835.  If the inet_makeaddr() call is unsuccessful, the call returns a value of -1. 
  12836.  
  12837.  Related Calls 
  12838.  
  12839.       endhostent() 
  12840.       endnetent() 
  12841.       gethostbyaddr() 
  12842.       gethostbyname() 
  12843.       getnetbyaddr() 
  12844.       getnetbyname() 
  12845.       getnetent() 
  12846.       inet_addr() 
  12847.       inet_lnaof() 
  12848.       inet_netof() 
  12849.       inet_network() 
  12850.       inet_ntoa() 
  12851.       sethostent() 
  12852.       setnetent() 
  12853.  
  12854.  
  12855. ΓòÉΓòÉΓòÉ 13.31. inet_netof() ΓòÉΓòÉΓòÉ
  12856.  
  12857. The inet_netof() call returns the network number portion of the internet host 
  12858. address in network-byte order. 
  12859.  
  12860. Syntax 
  12861.  
  12862. #include <types.h>
  12863. #include <arpa\inet.h>
  12864. u_long inet_netof(in)
  12865. struct in_addr in;
  12866.  
  12867. Parameters 
  12868.  
  12869.  in 
  12870.    Internet address in network-byte order. 
  12871.  
  12872.  Description 
  12873.  
  12874.  The inet_netof() call returns the network number from the specified internet 
  12875.  address number, typed as unsigned long value. The inet_netof() call masks off 
  12876.  the network number and the host number from the internet address, based on the 
  12877.  internet address class. 
  12878.  
  12879.  Note:  The application assumes responsibility for verifying that the network 
  12880.         number and the host number for the internet address conforms to a class 
  12881.         A or B or C internet address. The inet_netof() call processes any other 
  12882.         class of address as a class C address. 
  12883.  
  12884.  Return Values 
  12885.  
  12886.  The network number is returned in host-byte order. The return value points to 
  12887.  static data that subsequent API calls can modify. 
  12888.  
  12889.  When successful, the inet_netof() call returns a network number from the 
  12890.  specified long value representing the internet address. If the application 
  12891.  gives a class A internet address, the inet_lnoaf() call returns the logical 
  12892.  product of the internet address and 0xFF000000. If the application gives a 
  12893.  class B internet address, the inet_lnoaf() call returns the logical product of 
  12894.  the internet address and 0xFFFF0000. If the application does not give a class 
  12895.  A or B internet address,  the inet_lnoaf() call returns the logical product of 
  12896.  the internet address and 0xFFFFFF00. 
  12897.  
  12898.  Related Calls 
  12899.  
  12900.       endhostent() 
  12901.       endnetent() 
  12902.       gethostbyaddr() 
  12903.       gethostbyname() 
  12904.       getnetbyaddr() 
  12905.       getnetbyname() 
  12906.       getnetent() 
  12907.       inet_addr() 
  12908.       inet_lnaof() 
  12909.       inet_makeaddr() 
  12910.       inet_network() 
  12911.       inet_ntoa() 
  12912.       sethostent() 
  12913.       setnetent() 
  12914.  
  12915.  
  12916. ΓòÉΓòÉΓòÉ 13.32. inet_network() ΓòÉΓòÉΓòÉ
  12917.  
  12918. The inet_network() call constructs a network number from character strings 
  12919. representing numbers expressed in standard dotted-decimal notation. 
  12920.  
  12921. Syntax 
  12922.  
  12923. #include <types.h>
  12924. #include <arpa\inet.h>
  12925. u_long inet_network(cp)
  12926. char *cp;
  12927.  
  12928. Parameters 
  12929.  
  12930.  cp 
  12931.    A character string in standard dotted-decimal notation. 
  12932.  
  12933.  Description 
  12934.  
  12935.  The inet_network() call converts an ASCII string containing a valid internet 
  12936.  address using dotted-decimal notation (such as 120.121.122.123) to an internet 
  12937.  address number formatted as an unsigned long value. The inet_network() call 
  12938.  returns an error value if the application does not provide an ASCII string 
  12939.  containing a valid internet address using dotted-decimal notation. 
  12940.  
  12941.  The input ASCII string must represent a valid internet address number, as 
  12942.  described in Internet Address Formats. The input string must be terminated 
  12943.  with a null terminator (0x00) or a space (0x30). The inet_network() call 
  12944.  ignores characters that follow the terminating character. 
  12945.  
  12946.  The input string can express an internet address number in decimal, 
  12947.  hexadecimal, or octal format. In hexadecimal format, the string must begin 
  12948.  with 0x. The string must begin with 0 to indicate octal format. In decimal 
  12949.  format, the string requires no prefix. 
  12950.  
  12951.  Each octet of the input string must be delimited from another by a period. The 
  12952.  application can omit values between delimiters. The inet_network() call 
  12953.  interprets missing values as 0. 
  12954.  
  12955.  The following examples show valid strings and their output values in both 
  12956.  decimal and hexadecimal notation: 
  12957.  
  12958.  Examples of Valid Strings 
  12959.  
  12960.  
  12961.    Input string           Output value (in       Output value (in hex)
  12962.                           decimal)
  12963.  
  12964.    ...1                   1                      0x00000001
  12965.  
  12966.    .1..                   65536                  0x00010000
  12967.  
  12968.    1                      256                    0x00000100
  12969.  
  12970.    0xFFFFFFFF             255                    0x000000FF
  12971.  
  12972.    1.                     16777216               0x01000000
  12973.  
  12974.    1.2.3.4                16909060               0x01020304
  12975.  
  12976.    0x01.0X2.03.004        16909060               0x01020304
  12977.  
  12978.    1.2. 3.4               16777218               0x01000002
  12979.  
  12980.    9999.1.1.1             251724033              0x0F010101
  12981.  
  12982.  The following examples show invalid input strings and the reasons they are not 
  12983.  valid: 
  12984.  
  12985.  Examples of Invalid Strings 
  12986.  
  12987.  
  12988.    Input string     Reason string is not valid
  12989.  
  12990.    1.2.3.4.5        Excessive fields.
  12991.  
  12992.    1.2.3.4.         Excessive delimiters (and therefore fields).
  12993.  
  12994.    1,2              Bad delimiter.
  12995.  
  12996.    1p               String not terminated by null terminator nor
  12997.                     space.
  12998.  
  12999.    {empty string}   No field or delimiter present.
  13000.  
  13001.  Typically, the value of each octet of an internet address cannot exceed 246. 
  13002.  The inet_network() call can accept larger values, but it uses only the eight 
  13003.  least significant bits for each field value. For example, if an application 
  13004.  passes 0x1234567890.0xabcdef, the inet_network() call returns 37103 
  13005.  (0x000090EF). 
  13006.  
  13007.  The application must verify that the network ID and host ID for the internet 
  13008.  address conform to class A, class B, or class C. The inet_makeaddr() call 
  13009.  processes any nonconforming class of address as a class C address. 
  13010.  
  13011.  The inet_network() call does not check the pointer to the ASCII input string. 
  13012.  The application must verify the validity of the address of the string. 
  13013.  
  13014.  Return Values 
  13015.  
  13016.  The network number is returned in host-byte order. The return value points to 
  13017.  static data that subsequent API calls can modify. 
  13018.  
  13019.  For valid input strings, the inet_network() call returns an unsigned long 
  13020.  value that comprises the bit patterns of the input fields concatenated 
  13021.  together. The inet_network() call places the first pattern in the leftmost 
  13022.  (most significant) position and appends subsequent patterns if they exist. 
  13023.  
  13024.  For invalid input strings, the inet_network() call returns a value of -1. 
  13025.  
  13026.  Related Calls 
  13027.  
  13028.       endhostent() 
  13029.       endnetent() 
  13030.       gethostbyaddr() 
  13031.       gethostbyname() 
  13032.       getnetbyaddr() 
  13033.       getnetbyname() 
  13034.       getnetent() 
  13035.       inet_addr() 
  13036.       inet_netof() 
  13037.       inet_makeaddr() 
  13038.       inet_netof() 
  13039.       inet_ntoa() 
  13040.       sethostent() 
  13041.       setnetent() 
  13042.  
  13043.  
  13044. ΓòÉΓòÉΓòÉ 13.33. inet_ntoa() ΓòÉΓòÉΓòÉ
  13045.  
  13046. The inet_ntoa() call returns a pointer to a string in dotted-decimal notation. 
  13047.  
  13048. Syntax 
  13049.  
  13050. #include <types.h>
  13051. #include <arpa\inet.h>
  13052. char *inet_ntoa(in)
  13053. struct in_addr in;
  13054.  
  13055. Parameters 
  13056.  
  13057.  in 
  13058.    Host internet address. 
  13059.  
  13060.  Description 
  13061.  
  13062.  This call returns a pointer to a string expressed in the dotted-decimal 
  13063.  notation. The inet_ntoa() call accepts an internet address expressed as a 
  13064.  32-bit quantity in network-byte order and returns a string expressed in 
  13065.  dotted-decimal notation. All internet addresses are returned in network order, 
  13066.  with the first byte being the high-order byte. 
  13067.  
  13068.  Use C-language integers when specifying each part of a dotted-decimal 
  13069.  notation. 
  13070.  
  13071.  Return Values 
  13072.  
  13073.  Returns a pointer to the internet address expressed in dotted-decimal 
  13074.  notation. The return value points to static data that subsequent API calls can 
  13075.  modify. 
  13076.  
  13077.  If the inet_ntoa() call is unsuccessful, the call returns a value of -1. 
  13078.  
  13079.  Related Calls 
  13080.  
  13081.       endhostent() 
  13082.       endnetent() 
  13083.       gethostbyaddr() 
  13084.       gethostbyname() 
  13085.       getnetbyaddr() 
  13086.       getnetbyname() 
  13087.       getnetent() 
  13088.       inet_addr() 
  13089.       inet_netof() 
  13090.       inet_makeaddr() 
  13091.       inet_network() 
  13092.       sethostent() 
  13093.       setnetent() 
  13094.  
  13095.  
  13096. ΓòÉΓòÉΓòÉ 13.34. ntohl() ΓòÉΓòÉΓòÉ
  13097.  
  13098. The ntohl() call translates a long integer from network-byte order to host-byte 
  13099. order. 
  13100.  
  13101. Syntax 
  13102.  
  13103. #include <types.h>
  13104. u_long ntohl(a)
  13105. u_long a;
  13106.  
  13107. Parameters 
  13108.  
  13109.  a 
  13110.    Unsigned long integer to be put into host-byte order. 
  13111.  
  13112.  Description 
  13113.  
  13114.  This call translates a long integer from network-byte order to host-byte 
  13115.  order. Receiving hosts require addresses and ports in host-byte order.  Use 
  13116.  the ntohl() call to convert internet addresses to the host integer 
  13117.  representation. 
  13118.  
  13119.  Return Values 
  13120.  
  13121.  Returns the translated long integer. 
  13122.  
  13123.  Related Calls 
  13124.  
  13125.       endhostent() 
  13126.       endservent() 
  13127.       gethostbyaddr() 
  13128.       gethostbyname() 
  13129.       getservbyname() 
  13130.       getservbyport() 
  13131.       getservent() 
  13132.       htonl() 
  13133.       htons() 
  13134.       ntohs() 
  13135.       sethostent() 
  13136.       setservent() 
  13137.  
  13138.  
  13139. ΓòÉΓòÉΓòÉ 13.35. ntohs() ΓòÉΓòÉΓòÉ
  13140.  
  13141. The ntohs() call translates a short integer from network-byte order to 
  13142. host-byte order. 
  13143.  
  13144. Syntax 
  13145.  
  13146. #include <types.h>
  13147. u_short ntohs(a)
  13148. u_short a;
  13149.  
  13150. Parameters 
  13151.  
  13152.  a 
  13153.    Unsigned short integer to be put into host-byte order. 
  13154.  
  13155.  Description 
  13156.  
  13157.  This call translates a short integer from network-byte order to host-byte 
  13158.  order. Receiving hosts require addresses and ports in host-byte order.  Use 
  13159.  the ntohs() call to convert ports to the host integer representation. 
  13160.  
  13161.  Return Values 
  13162.  
  13163.  The ntohs() call returns the translated short integer. 
  13164.  
  13165.  Related Calls 
  13166.  
  13167.       endhostent() 
  13168.       endservent() 
  13169.       gethostbyaddr() 
  13170.       gethostbyname() 
  13171.       getservbyname() 
  13172.       getservbyport() 
  13173.       getservent() 
  13174.       htonl() 
  13175.       htons() 
  13176.       ntohl() 
  13177.       sethostent() 
  13178.       setservent() 
  13179.  
  13180.  
  13181. ΓòÉΓòÉΓòÉ 13.36. putlong() ΓòÉΓòÉΓòÉ
  13182.  
  13183. The putlong() call places long byte quantities into the byte stream. 
  13184.  
  13185. Syntax 
  13186.  
  13187. #include <sys\types.h>
  13188. #include <netinet\in.h>
  13189. #include <arpa\nameser.h>
  13190. #include <resolv.h>
  13191. void putlong(l, msgp)
  13192. u_long l;
  13193. u_char *msgp;
  13194.  
  13195. Parameters 
  13196.  
  13197.  l 
  13198.    Represents a 32-bit integer. 
  13199.  
  13200.  msgp 
  13201.    Represents a pointer into the byte stream. 
  13202.  
  13203.  Description 
  13204.  
  13205.  The putlong() call places long byte quantities into the byte stream or 
  13206.  arbitrary byte boundaries. 
  13207.  
  13208.  The putlong() call is one of a group of calls that form the resolver, a set of 
  13209.  functions that resolve domain names. Global information used by the resolver 
  13210.  calls is kept in the _res data structure. The <RESOLV.H> file contains the 
  13211.  _res structure definition. (See The _res Data Structure for more information.) 
  13212.  
  13213.  Related Calls 
  13214.  
  13215.       dn_comp() 
  13216.       dn_expand() 
  13217.       dn_find() 
  13218.       dn_skipname() 
  13219.       _getlong() 
  13220.       _getshort() 
  13221.       putshort() 
  13222.       res_init() 
  13223.       res_mkquery() 
  13224.       res_query() 
  13225.       res_search() 
  13226.       res_send() 
  13227.  
  13228.  
  13229. ΓòÉΓòÉΓòÉ 13.37. putshort() ΓòÉΓòÉΓòÉ
  13230.  
  13231. The putshort() call places short byte quantities into the byte stream. 
  13232.  
  13233. Syntax 
  13234.  
  13235. #include <sys\types.h>
  13236. #include <netinet\in.h>
  13237. #include <arpa\nameser.h>
  13238. #include <resolv.h>
  13239. void putshort (s, msgp)
  13240. u_short s;
  13241. u_char *msgp;
  13242.  
  13243. Parameters 
  13244.  
  13245.  s 
  13246.    Represents a 16-bit integer. 
  13247.  
  13248.  msgp 
  13249.    Represents a pointer into the byte stream. 
  13250.  
  13251.  Description 
  13252.  
  13253.  The putshort() call puts short byte quantities into the byte stream or 
  13254.  arbitrary byte boundaries. 
  13255.  
  13256.  The putshort() call is one of a group of calls that form the resolver, a set 
  13257.  of functions that resolve domain names. Global information used by the 
  13258.  resolver calls is kept in the _res data structure. The <RESOLV.H> file 
  13259.  contains the _res structure definition. (See The _res Data Structure for more 
  13260.  on the _res data structure.) 
  13261.  
  13262.  Related Calls 
  13263.  
  13264.       dn_comp() 
  13265.       dn_expand() 
  13266.       dn_find() 
  13267.       dn_skipname() 
  13268.       _getlong() 
  13269.       _getshort() 
  13270.       putlong() 
  13271.       res_init() 
  13272.       res_mkquery() 
  13273.       res_query() 
  13274.       res_send() 
  13275.  
  13276.  
  13277. ΓòÉΓòÉΓòÉ 13.38. Raccept() ΓòÉΓòÉΓòÉ
  13278.  
  13279. The Raccept() socket call accepts a connection request from a SOCKS server. 
  13280.  
  13281. Syntax 
  13282.  
  13283. #include <types.h>
  13284. #include <sys\socket.h>
  13285. #include <netinet\in.h>
  13286. int Raccept(s, name, namelen)
  13287. int s;
  13288. sockaddr *name;
  13289. int *namelen;
  13290.  
  13291. Parameters 
  13292.  
  13293.  s 
  13294.    Socket descriptor. 
  13295.  
  13296.  name 
  13297.    Pointer to a sockaddr structure that contains the socket address of the 
  13298.    connection client when the Raccept() call returns. The format of name is 
  13299.    determined by the communications domain where the client resides. This 
  13300.    parameter can be NULL if the caller is not interested in the client address. 
  13301.  
  13302.  namelen 
  13303.    Must initially point to an integer that contains the size in bytes of the 
  13304.    storage pointed to by name.  On return, that integer contains the size of 
  13305.    the data returned in the storage pointed to by name. If name is NULL, 
  13306.    namelen is ignored and can be NULL. 
  13307.  
  13308.  Description 
  13309.  
  13310.  This call is used to accept the first pending connection on the socket. If the 
  13311.  socket was bound through a SOCKS server using Rbind(), it will block until the 
  13312.  SOCKS server accepts a connection on its behalf. If the socket was not bound 
  13313.  through a SOCKS server, this call is equivalent to accept(). 
  13314.  
  13315.  Return Values 
  13316.  
  13317.  A non-negative socket descriptor indicates success; the value -1 indicates an 
  13318.  error. You can get the specific error code by calling sock_errno() or 
  13319.  psock_errno(). 
  13320.  
  13321.  Error Code             Description
  13322.  
  13323.  SOCENOTSOCK            The s parameter is not a valid socket descriptor. 
  13324.  
  13325.  SOCEFAULT              Using name and namelen would result in an attempt to 
  13326.                         copy the address into a portion of the caller address 
  13327.                         space into which information cannot be written. 
  13328.  
  13329.  SOCEINTR               Interrupted system call. 
  13330.  
  13331.  SOCEINVAL              Listen() was not called for socket s. 
  13332.  
  13333.  SOCENOBUFS             Insufficient buffer space available to create the new 
  13334.                         socket. 
  13335.  
  13336.  SOCEOPNOTSUPP          The s parameter is not connection-oriented. 
  13337.  
  13338.  SOCEWOULDBLOCK         The s parameter is in nonblocking mode and no 
  13339.                         connections are on the queue. 
  13340.  
  13341.  SOCECONNABORTED        The software caused a connection close. 
  13342.  
  13343.  Related Calls 
  13344.  
  13345.       accept() 
  13346.       connect() 
  13347.       Rbind() 
  13348.       Rconnect() 
  13349.       Rgetsockname() 
  13350.       Rlisten() 
  13351.       sock_errno() 
  13352.       socket() 
  13353.  
  13354.  
  13355. ΓòÉΓòÉΓòÉ 13.39. Rbind() ΓòÉΓòÉΓòÉ
  13356.  
  13357. The Rbind() call binds a local name to the socket. 
  13358.  
  13359. Syntax 
  13360.  
  13361. #include <types.h>
  13362. #include <sys\socket.h>
  13363. int Rbind(s, name, namelen remoteaddr)
  13364. int s;
  13365. struct sockaddr *name;
  13366. int namelen;
  13367. struct sockaddr *remoteaddr;
  13368.  
  13369. Parameters 
  13370.  
  13371.  s 
  13372.    Socket descriptor returned by a previous call to socket(). 
  13373.  
  13374.  name 
  13375.    Pointer to a sockaddr structure containing the name that is to be bound to 
  13376.    s. 
  13377.  
  13378.  namelen 
  13379.    Size in bytes of the sockaddr structure pointed to by name. 
  13380.  
  13381.  remoteaddr 
  13382.    Pointer to a sockaddr structure containing the address of the remote host 
  13383.    from which the connection is expected to be established. 
  13384.  
  13385.  Description 
  13386.  
  13387.  This call checks remoteaddr to see if it is reachable via a direct connection, 
  13388.  or whether a connection through a SOCKS server is required. If the former, 
  13389.  then this call is equivalent to a bind (s, name, namelen). If the latter, then 
  13390.  a connection to the SOCKS server is established and a bind request is sent. 
  13391.  Rgetsockname() may be called to retrieve the IP address and port number the 
  13392.  SOCKS server assigned. 
  13393.  
  13394.  Related Calls 
  13395.  
  13396.       bind() 
  13397.       htons() 
  13398.       inet_addr() 
  13399.       Rconnect() 
  13400.       Rgethostbyname() 
  13401.       Rgetsockname() 
  13402.       Rlisten() 
  13403.       sock_errno() 
  13404.       socket() 
  13405.  
  13406.  
  13407. ΓòÉΓòÉΓòÉ 13.40. Rconnect() ΓòÉΓòÉΓòÉ
  13408.  
  13409. The Rconnect() socket call requests a connection to a remote host. The request 
  13410. goes directly to a SOCKS server. 
  13411.  
  13412. Syntax 
  13413.  
  13414. #include <types.h>
  13415. #include <sys\socket.h>
  13416. int Rconnect(s, name, namelen)
  13417.  
  13418. Description 
  13419.  
  13420. See the "Description" section in connect() for additional information about 
  13421. connecting. (This description information also applies to the Rconnect() call). 
  13422.  
  13423. Related Calls 
  13424.  
  13425.       connect() 
  13426.       Raccept() 
  13427.       Rbind() 
  13428.       Rgetsockname() 
  13429.       send() 
  13430.       socket() 
  13431.  
  13432.  
  13433. ΓòÉΓòÉΓòÉ 13.41. res_init() ΓòÉΓòÉΓòÉ
  13434.  
  13435. The res_init() call initializes the default domain name. 
  13436.  
  13437. Syntax 
  13438.  
  13439. #include <types.h>
  13440. #include <netinet\in.h>
  13441. #include <arpa\nameser.h>
  13442. #include <resolv.h>
  13443. void res_init()
  13444.  
  13445. Description 
  13446.  
  13447. This call reads the ETC\RESOLV and ETC\RESOLV2 files for the domain name 
  13448. information and for the IP addresses of the initial hosts running the name 
  13449. server. If none of these files exist, name resolution will use the ETC\HOSTS 
  13450. file. One of these files should be operational. 
  13451.  
  13452. Note:  If the ETC\RESOLV files do not exist, the res_init() call attempts name 
  13453.        resolution using the local ETC\HOSTS file. If the system is not using a 
  13454.        domain name server, the ETC\RESOLV file should not exist. The ETC\HOSTS 
  13455.        file should be present on the system even if the system is using a name 
  13456.        server. In this instance, the file should contain the host IDs that the 
  13457.        system requires to function even if the name server is not functioning. 
  13458.  
  13459.  The res_init() call is one of a group of calls that form the resolver. The 
  13460.  resolver is a set of functions that perform a translation between domain names 
  13461.  and network addresses. Global information used by the resolver calls resides 
  13462.  in the _res data structure. The <RESOLV.H> file contains the _res data 
  13463.  structure definition. (See The _res Data Structure for more on the _res data 
  13464.  structure.) 
  13465.  
  13466.  Related Calls 
  13467.  
  13468.       dn_comp() 
  13469.       dn_expand() 
  13470.       dn_find() 
  13471.       dn_skipname() 
  13472.       _getlong() 
  13473.       _getshort() 
  13474.       putlong() 
  13475.       putshort() 
  13476.       res_mkquery() 
  13477.       res_query() 
  13478.       res_search() 
  13479.       res_send() 
  13480.  
  13481.  
  13482. ΓòÉΓòÉΓòÉ 13.42. res_mkquery() ΓòÉΓòÉΓòÉ
  13483.  
  13484. The res_mkquery() call makes a query message for the name servers in the 
  13485. internet domain. 
  13486.  
  13487. Syntax 
  13488.  
  13489. #include <types.h>
  13490. #include <netinet\in.h>
  13491. #include <arpa\nameser.h>
  13492. #include <resolv.h>
  13493. int res_mkquery(op, dname, class, type, data, datalen, newrr,
  13494.             buf, buflen)
  13495. int op;
  13496. char *dname;
  13497. int class;
  13498. int type;
  13499. char *data;
  13500. int datalen;
  13501. struct rrec *newrr;
  13502. char *buf;
  13503. int buflen;
  13504.  
  13505. Parameters 
  13506.  
  13507.  op 
  13508.    The usual type is QUERY, but you can set the parameter to any query type 
  13509.    defined in the <ARPA\NAMESER.H> header file. 
  13510.  
  13511.  dname 
  13512.    Pointer to the domain name. If dname points to a single label and the 
  13513.    RES_DEFNAMES bit in the _res data structure (see The _res Data Structure) 
  13514.    defined in the <RESOLV.H> header file is set, the call appends dname to the 
  13515.    current domain name. The current domain name is defined in the ETC\RESOLV 
  13516.    file. 
  13517.  
  13518.  class 
  13519.    One of the following values: 
  13520.  
  13521.    C_IN               ARPA Internet 
  13522.    C_CHAOS            Chaos network at MIT 
  13523.  
  13524.  type 
  13525.    One of the following type values for resources and queries: 
  13526.  
  13527.    T_A            Host address 
  13528.    T_NS           Authoritative server 
  13529.    T_MD           Mail destination 
  13530.    T_MF           Mail forwarder 
  13531.    T_CNAME        Canonical name 
  13532.    T_SOA          Start of authority zone 
  13533.    T_MB           Mailbox domain name 
  13534.    T_MG           Mail group member 
  13535.    T_MR           Mail rename name 
  13536.    T_NULL         Null resource record 
  13537.    T_WKS          Well-known service 
  13538.    T_PTR          Domain name pointer 
  13539.    T_HINFO        Host information 
  13540.    T_MINFO        Mailbox information 
  13541.    T_MX           Mail routing information 
  13542.    T_UINFO        User information 
  13543.    T_UID          User ID 
  13544.    T_GID          Group ID 
  13545.  
  13546.  data 
  13547.    Pointer to the data sent to the name server as a search key. 
  13548.  
  13549.  datalen 
  13550.    Size of the data parameter in bytes. 
  13551.  
  13552.  newrr 
  13553.    Reserved. Unused parameter. 
  13554.  
  13555.  buf 
  13556.    Pointer to the query message. 
  13557.  
  13558.  buflen 
  13559.    Length of the buffer in bytes pointed to by the buf parameter. 
  13560.  
  13561.  Description 
  13562.  
  13563.  This call creates packets for name servers in the internet domain. The call 
  13564.  makes a query message for the name servers and puts that query message in the 
  13565.  location pointed to by the buf parameter. 
  13566.  
  13567.  The res_mkquery() call is one of a group of calls that form the resolver. The 
  13568.  resolver is a set of functions that perform a translation between domain names 
  13569.  and network addresses. Global information used by the resolver calls resides 
  13570.  in the _res data structure. The <RESOLV.H> file contains the _res data 
  13571.  structure definition. (See The _res Data Structure for more on the _res data 
  13572.  structure.) 
  13573.  
  13574.  Return Values 
  13575.  
  13576.  When successful, the res_mkquery() call returns the size of the query. When 
  13577.  the query is larger than the value of buflen, the call fails and returns a 
  13578.  value of -1. 
  13579.  
  13580.  Related Calls 
  13581.  
  13582.       dn_comp() 
  13583.       dn_expand() 
  13584.       dn_find() 
  13585.       dn_skipname() 
  13586.       _getlong() 
  13587.       _getshort() 
  13588.       putlong() 
  13589.       putshort() 
  13590.       res_init() 
  13591.       res_query() 
  13592.       res_search() 
  13593.       res_send() 
  13594.  
  13595.  
  13596. ΓòÉΓòÉΓòÉ 13.43. res_query() ΓòÉΓòÉΓòÉ
  13597.  
  13598. The res_query() call provides an interface to the server query mechanism. 
  13599.  
  13600. Syntax 
  13601.  
  13602. #include <sys\types.h>
  13603. #include <netinet\in.h>
  13604. #include <arpa\nameser.h>
  13605. #include <resolv.h>
  13606. int res_query(name, class, type, answer, anslen)
  13607. char *name;
  13608. int class;
  13609. int type;
  13610. u_char *answer;
  13611. int anslen;
  13612.  
  13613. Parameters 
  13614.  
  13615.  name 
  13616.    Points to the name of the domain. If the name parameter points to a 
  13617.    single-component name and the RES_DEFNAMES structure is set, as it is by 
  13618.    default, the call appends the default domain name to the single-component 
  13619.    name. The current domain name is defined by the name server in use or is 
  13620.    specified in the ETC\RESOLV file. 
  13621.  
  13622.  class 
  13623.    Specifies one of the following values: 
  13624.  
  13625.    C_IN             Specifies the ARPA Internet 
  13626.    C_CHAOS          Specifies the Chaos network at MIT 
  13627.  
  13628.  type 
  13629.    Requires one of the following values: 
  13630.  
  13631.    T_A              Host address 
  13632.    T_NS             Authoritative server 
  13633.    T_MD             Mail destination 
  13634.    T_MF             Mail forwarder 
  13635.    T_CNAME          Canonical name 
  13636.    T_SOA            Start-of-authority zone 
  13637.    T_MB             Mailbox-domain name 
  13638.    T_MG             Mail-group member 
  13639.    T_MR             Mail-rename name 
  13640.    T_NULL           Null resource record 
  13641.    T_WKS            Well-known service 
  13642.    T_PTR            Domain name pointer 
  13643.    T_HINFO          Host information 
  13644.    T_MINFO          Mailbox information 
  13645.    T_MX             Mail-routing information 
  13646.    T_UINFO          User (finger command) information 
  13647.    T_UID            User ID 
  13648.    T_GID            Group ID 
  13649.  
  13650.  answer 
  13651.    Points to an address where the response is stored. 
  13652.  
  13653.  anslen 
  13654.    Specifies the size of the answer buffer. 
  13655.  
  13656.  Description 
  13657.  
  13658.  The res_query() call provides an interface to the server query mechanism. It 
  13659.  constructs a query, sends it to the local server, awaits a response, and makes 
  13660.  preliminary checks on the reply. The query requests information of the 
  13661.  specified type and class for the fully-qualified domain name specified in the 
  13662.  name parameter. The reply message is left in the answer buffer whose size is 
  13663.  specified by the anslen parameter, which is supplied by the caller. 
  13664.  
  13665.  The caller must parse answer and determine whether it answers the question. 
  13666.  
  13667.  The res_query() call is one of a group of calls that form the resolver, a set 
  13668.  of functions that resolve domain names. The _res data structure contains 
  13669.  global information used by the resolver calls. The <RESOLV.H> file contains 
  13670.  the _res structure definition. (See The _res Data Structure for more on the 
  13671.  _res data structure.) 
  13672.  
  13673.  Return Values 
  13674.  
  13675.  When successful, the res_query() call returns the size of the response. When 
  13676.  unsuccessful, the res_query() call returns a value of -1 and sets the h_errno 
  13677.  value to the appropriate error. 
  13678.  
  13679.  Related Calls 
  13680.  
  13681.       dn_comp() 
  13682.       dn_expand() 
  13683.       dn_find() 
  13684.       dn_skipname() 
  13685.       _getlong() 
  13686.       _getshort() 
  13687.       putlong() 
  13688.       putshort() 
  13689.       res_init() 
  13690.       res_mkquery() 
  13691.       res_search() 
  13692.       res_send() 
  13693.  
  13694.  
  13695. ΓòÉΓòÉΓòÉ 13.44. res_querydomain() ΓòÉΓòÉΓòÉ
  13696.  
  13697. The res_querydomain() call queries the concatenation of name and domain. 
  13698.  
  13699. Syntax 
  13700.  
  13701. #include <sys\types.h>
  13702. #include <netinet\in.h>
  13703. #include <arpa\nameser.h>
  13704. #include <resolv.h>
  13705. int res_querydomain(name, domain class, type, answer, anslen)
  13706. char *name;
  13707. char *domain;
  13708. int class;
  13709. int type;
  13710. u_char *answer;
  13711. int anslen;
  13712.  
  13713. Parameters 
  13714.  
  13715.  domain 
  13716.    Domain name. 
  13717.  
  13718.  name 
  13719.    Host name. 
  13720.  
  13721.  class 
  13722.    Specifies one of the following values: 
  13723.  
  13724.    C_IN             Specifies the ARPA Internet. 
  13725.    C_CHAOS          Specifies the Chaos network at MIT. 
  13726.  
  13727.  type 
  13728.    Requires one of the following values: 
  13729.  
  13730.    T_A              Host address 
  13731.    T_NS             Authoritative server 
  13732.    T_MD             Mail destination 
  13733.    T_MF             Mail forwarder 
  13734.    T_CNAME          Canonical name 
  13735.    T_SOA            Start-of-authority zone 
  13736.    T_MB             Mailbox-domain name 
  13737.    T_MG             Mail-group member 
  13738.    T_MR             Mail-rename name 
  13739.    T_NULL           Null resource record 
  13740.    T_WKS            Well-known service 
  13741.    T_PTR            Domain name pointer 
  13742.    T_HINFO          Host information 
  13743.    T_MINFO          Mailbox information 
  13744.    T_MX             Mail-routing information 
  13745.    T_UINFO          User (finger command) information 
  13746.    T_UID            User ID 
  13747.    T_GID            Group ID 
  13748.  
  13749.  answer 
  13750.    Points to an address where the response is stored. 
  13751.  
  13752.  anslen 
  13753.    Specifies the size of the answer buffer. 
  13754.  
  13755.  Description 
  13756.  
  13757.  The res_querydomain() call concatenates name and domain, removing a trailing 
  13758.  dot from name if domain is null. The res_querydomain() call then calls 
  13759.  res_query() to build and perform the query. 
  13760.  
  13761.  Return Values 
  13762.  
  13763.  The value 0 indicates success; the value -1 indicates an error. The h_errno() 
  13764.  value is set to the appropriate error code. 
  13765.  
  13766.  Related Calls 
  13767.  
  13768.       dn_comp() 
  13769.       dn_expand() 
  13770.       dn_find() 
  13771.       dn_skipname() 
  13772.       _getlong() 
  13773.       _getshort() 
  13774.       putlong() 
  13775.       putshort() 
  13776.       res_init() 
  13777.       res_mkquery() 
  13778.       res_search() 
  13779.       res_send() 
  13780.  
  13781.  
  13782. ΓòÉΓòÉΓòÉ 13.45. res_search() ΓòÉΓòÉΓòÉ
  13783.  
  13784. The res_search() call makes a query and awaits a response. 
  13785.  
  13786. Syntax 
  13787.  
  13788. #include <sys\types.h>
  13789. #include <netinet\in.h>
  13790. #include <arpa\nameser.h>
  13791. #include <resolv.h>
  13792. int res_search(name, class, type, answer, anslen)
  13793. char *name;
  13794. int class;
  13795. int type;
  13796. u_char *answer;
  13797. int anslen;
  13798.  
  13799. Parameters 
  13800.  
  13801.  name 
  13802.    Points to the name of the domain. If the name parameter points to a 
  13803.    single-component name and the RES_DEFNAMES structure is set, as it is by 
  13804.    default, the call appends the default domain name to the single-component 
  13805.    name. The current domain name is defined by the name server in use or is 
  13806.    specified in the ETC\RESOLV file. 
  13807.  
  13808.    If the RES_DNSRCH bit is set, as it is by default, the res_search() call 
  13809.    searches for host names in both the current domain and in parent domains. 
  13810.  
  13811.  class 
  13812.    Specifies one of the following values: 
  13813.  
  13814.    C_IN             Specifies the ARPA Internet. 
  13815.    C_CHAOS          Specifies the Chaos network at MIT. 
  13816.  
  13817.  type 
  13818.    Requires one of the following values: 
  13819.  
  13820.    T_A              Host address 
  13821.    T_NS             Authoritative server 
  13822.    T_MD             Mail destination 
  13823.    T_MF             Mail forwarder 
  13824.    T_CNAME          Canonical name 
  13825.    T_SOA            Start-of-authority zone 
  13826.    T_MB             Mailbox-domain name 
  13827.    T_MG             Mail-group member 
  13828.    T_MR             Mail-rename name 
  13829.    T_NULL           Null resource record 
  13830.    T_WKS            Well-known service 
  13831.    T_PTR            Domain name pointer 
  13832.    T_HINFO          Host information 
  13833.    T_MINFO          Mailbox information 
  13834.    T_MX             Mail-routing information 
  13835.    T_UINFO          User (finger command) information 
  13836.    T_UID            User ID 
  13837.    T_GID            Group ID 
  13838.  
  13839.  answer 
  13840.    Points to an address where the response is stored. 
  13841.  
  13842.  anslen 
  13843.    Specifies the size of the answer buffer. 
  13844.  
  13845.  Description 
  13846.  
  13847.  The res_search() call makes a query and awaits a response, like the 
  13848.  res_query() call. However, it also implements the default and search rules 
  13849.  controlled by the RES_DEFNAMES and RES_DNSRCH options. 
  13850.  
  13851.  Note:  This call is only useful for queries in the same name hierarchy as the 
  13852.         local host. 
  13853.  
  13854.  The res_search() call is one of a group of calls that form the resolver, a set 
  13855.  of functions that resolve domain names. The _res data structure contains 
  13856.  global information used by the resolver calls. The <RESOLV.H> file contains 
  13857.  the _res structure definition. (See The _res Data Structure for more on the 
  13858.  _res data structure.) 
  13859.  
  13860.  Return Values 
  13861.  
  13862.  When successful, the res_search() call returns the size of the response. When 
  13863.  unsuccessful, the res_search() call returns a value of -1 and sets the h_errno 
  13864.  value to the appropriate error. 
  13865.  
  13866.  Related Calls 
  13867.  
  13868.       dn_comp() 
  13869.       dn_expand() 
  13870.       dn_find() 
  13871.       dn_skipname() 
  13872.       _getlong() 
  13873.       _getshort() 
  13874.       putlong() 
  13875.       putshort() 
  13876.       res_init() 
  13877.       res_mkquery() 
  13878.       res_query() 
  13879.       res_send() 
  13880.  
  13881.  
  13882. ΓòÉΓòÉΓòÉ 13.46. res_send() ΓòÉΓòÉΓòÉ
  13883.  
  13884. The res_send() call sends a query to a local name server. 
  13885.  
  13886. Syntax 
  13887.  
  13888. #include <types.h>
  13889. #include <netinet\in.h>
  13890. #include <arpa\nameser.h>
  13891. #include <resolv.h>
  13892. int res_send(msg, msglen, ans, anslen)
  13893. char *msg;
  13894. int msglen;
  13895. char *ans;
  13896. int anslen;
  13897.  
  13898. Parameters 
  13899.  
  13900.  msg 
  13901.    Pointer to the beginning of a message. 
  13902.  
  13903.  msglen 
  13904.    Length of the buffer in bytes pointed to by the msg parameter. 
  13905.  
  13906.  ans 
  13907.    Pointer to the location where the received response is stored. 
  13908.  
  13909.  anslen 
  13910.    Length of the buffer in bytes pointed by the ans parameter. 
  13911.  
  13912.  Description 
  13913.  
  13914.  This call sends a query to the local name server and calls the res_init() call 
  13915.  if the RES_INIT option of the global _res structure is not set. It also 
  13916.  handles timeouts and retries. 
  13917.  
  13918.  The res_send() call is one of a set of calls that form the resolver. The 
  13919.  resolver is a group of functions that perform a translation between domain 
  13920.  names and network addresses. Global information used by the resolver calls 
  13921.  resides in the _res data structure. The <RESOLV.H> file contains the _res data 
  13922.  structure definition. (See The _res Data Structure for more on the _res data 
  13923.  structure.) 
  13924.  
  13925.  Return Values 
  13926.  
  13927.  When successful, the call returns the length of the message. When 
  13928.  unsuccessful, the call returns a value of -1. 
  13929.  
  13930.  Related Calls 
  13931.  
  13932.       dn_comp() 
  13933.       dn_expand() 
  13934.       dn_find() 
  13935.       dn_skipname() 
  13936.       _getlong() 
  13937.       _getshort() 
  13938.       putlong() 
  13939.       putshort() 
  13940.       res_init() 
  13941.       res_mkquery() 
  13942.       res_query() 
  13943.       res_search() 
  13944.  
  13945.  
  13946. ΓòÉΓòÉΓòÉ 13.47. rexec() ΓòÉΓòÉΓòÉ
  13947.  
  13948. The rexec() call allows command processing on a remote host. 
  13949.  
  13950. Syntax 
  13951.  
  13952. #include <utils.h>
  13953. int rexec(host, port, user, passwd, cmd, err_sd2p)
  13954. char **host;
  13955. int port;
  13956. char *user, *passwd, *cmd;
  13957. int *err_sd2p;
  13958.  
  13959. Parameters 
  13960.  
  13961.  host 
  13962.    Contains the name of a remote host that is listed in the ETC\HOSTS file or 
  13963.    ETC\RESOLV file. If the name of the host is not found in either file, the 
  13964.    rexec() call is unsuccessful. 
  13965.  
  13966.  port 
  13967.    Specifies the well-known internet port to use for the connection. A pointer 
  13968.    to the structure that contains the necessary port can be obtained by issuing 
  13969.    the following library call: 
  13970.  
  13971.       getservbyname("exec","tcp")
  13972.    When directly specifying an integer for the port, specify it in Network Byte 
  13973.    order, obtainable by using the htons() function call. 
  13974.  
  13975.  user 
  13976.    Points to a user ID valid at the remote host. 
  13977.  
  13978.  passwd 
  13979.    Points to a password valid at the remote host. 
  13980.  
  13981.  cmd 
  13982.    Points to the name of the command to be processed at the remote host. 
  13983.  
  13984.  err_sd2p 
  13985.    Points to an error socket descriptor. An auxiliary channel to a control 
  13986.    process is set up, and a descriptor for it is placed in the err_sd2p 
  13987.    parameter. The control process provides diagnostic output from the remote 
  13988.    command on this channel. This diagnostic information does not include remote 
  13989.    authorization failure, since this connection is set up after authorization 
  13990.    has been verified. 
  13991.  
  13992.  Description 
  13993.  
  13994.  The rexec() call allows the calling process to start commands on a remote 
  13995.  host. 
  13996.  
  13997.  If the rexec() connection succeeds, a socket in the internet domain of type 
  13998.  SOCK_STREAM is returned to the calling process and is given to the remote 
  13999.  command as standard input and standard output. 
  14000.  
  14001.  Return Values 
  14002.  
  14003.  When successful, the call returns a socket to the remote command. 
  14004.  
  14005.  When unsuccessful, the call returns a value of -1, indicating that the 
  14006.  specified host name does not exist. 
  14007.  
  14008.  Examples 
  14009.  
  14010.   int normsock;
  14011.   char *host = NULL, *luser = NULL, *password = NULL, *cmd;
  14012.   struct servent *sp;
  14013.   sp = getservbyname("exec", "tcp");
  14014.  
  14015.   host = "remote _host";
  14016.   luser = "my _userid";
  14017.   password = "my _password";
  14018.   cmd = "rempte_host_cmd";
  14019.  
  14020.   normsock = rexec(&host, sp->s_port, luser,password, cmd, &errsock);
  14021.   if (normsock == -1)
  14022.          exit(-1);
  14023.  
  14024.  Related Calls 
  14025.  
  14026.       getservbyname() 
  14027.  
  14028.  
  14029. ΓòÉΓòÉΓòÉ 13.48. Rgethostbyname() ΓòÉΓòÉΓòÉ
  14030.  
  14031. The Rgethostbyname() call returns a pointer to information about a host 
  14032. specified by a host name. The request goes directly to a SOCKS server, sockd. 
  14033.  
  14034. Syntax 
  14035.  
  14036. #include <netdb.h>
  14037. struct hostent *Rgethostbyname(name)
  14038. char *name;
  14039.  
  14040. See the "Description" section in gethostbyname() for additional information 
  14041. about this topic. (This description information also applies to the 
  14042. Rgethostbyname() call.) 
  14043.  
  14044. Related Calls 
  14045.  
  14046.       endhostent() 
  14047.       gethostbyaddr() 
  14048.       gethostent() 
  14049.       inet_addr() 
  14050.       sethostent() 
  14051.  
  14052.  
  14053. ΓòÉΓòÉΓòÉ 13.49. Rgetsockname() ΓòÉΓòÉΓòÉ
  14054.  
  14055. Rgetsockname() gets the socket name from the SOCKS server. 
  14056.  
  14057. Syntax 
  14058.  
  14059. #include <types.h>
  14060. #include <sys\socket.h>
  14061. int Rgetsockname(s, name, namelen)
  14062. int s;
  14063. struct sockaddr *name;
  14064. int *namelen;
  14065.  
  14066. Parameters 
  14067.  
  14068.  s 
  14069.    Socket descriptor. 
  14070.  
  14071.  name 
  14072.    Pointer to a sockaddr structure. The name of s is returned. 
  14073.  
  14074.  namelen 
  14075.    Pointer to the size in bytes of the buffer pointed to by name. 
  14076.  
  14077.  Description 
  14078.  
  14079.  This call returns the name the SOCKS server bound to the socket after a 
  14080.  successful call to Rbind() or connect(). If the socket is not connected 
  14081.  through a SOCKS server, this call is equivalent to getsockname(). 
  14082.  
  14083.  Return Values 
  14084.  
  14085.  The value 0 indicates success; the value -1 indicates an error. You can get 
  14086.  the specific error code by calling sock_errno() or psock_errno(). 
  14087.  
  14088.  Error Code        Description
  14089.  
  14090.  SOCENOTSOCK       The s parameter is not a valid socket descriptor. 
  14091.  
  14092.  SOCEFAULT         Using the name and namelen parameters as specified would 
  14093.                    result in an attempt to access storage outside of the 
  14094.                    address space of the caller. 
  14095.  
  14096.  SOCENOBUFS        No buffer space available. 
  14097.  
  14098.  Related Calls 
  14099.  
  14100.       getpeername() 
  14101.       getsockname() 
  14102.       Raccept() 
  14103.       Rbind() 
  14104.       Rconnect() 
  14105.       sock_errno() 
  14106.       socket() 
  14107.  
  14108.  
  14109. ΓòÉΓòÉΓòÉ 13.50. Rlisten() ΓòÉΓòÉΓòÉ
  14110.  
  14111. The Rlisten() socket call completes the binding necessary for a socket to 
  14112. accept connections and creates a connection request queue for incoming 
  14113. requests. This call goes directly to the SOCKS server, rather than querying the 
  14114. SOCKS flag (socks_flag). 
  14115.  
  14116. Syntax 
  14117.  
  14118. #include <types.h>
  14119. #include <sys\socket.h>
  14120. #include <netinet\in.h>
  14121. int Rlisten(s, backlog)
  14122. int s;
  14123. int backlog;
  14124.  
  14125. Parameters 
  14126.  
  14127.  s 
  14128.    Socket descriptor. 
  14129.  
  14130.  backlog 
  14131.    Controls the maximum queue length for pending connections. 
  14132.  
  14133.  Description 
  14134.  
  14135.  This call checks to see if the socket is connected through a SOCKS server, and 
  14136.  if not, calls listen(). If it is, the call has no effect. 
  14137.  
  14138.  Return Values 
  14139.  
  14140.  The value 0 indicates success; the value -1 indicates an error. You can get 
  14141.  the specific error code by calling sock_errno() or psock_errno(). 
  14142.  
  14143.  Error Code           Description
  14144.  SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  14145.  SOCEOPNOTSUPP        The s parameter is not a socket descriptor that supports 
  14146.                       the listen() call. 
  14147.  
  14148.  Related Calls 
  14149.  
  14150.       listen() 
  14151.       Raccept() 
  14152.       Rbind() 
  14153.       Rconnect() 
  14154.       sock_errno() 
  14155.       socket() 
  14156.  
  14157.  
  14158. ΓòÉΓòÉΓòÉ 13.51. sethostent() ΓòÉΓòÉΓòÉ
  14159.  
  14160. The sethostent() call opens and rewinds the ETC\HOSTS file. 
  14161.  
  14162. Syntax 
  14163.  
  14164. #include <netdb.h>
  14165. void sethostent(stayopen)
  14166. int stayopen;
  14167.  
  14168. Parameters 
  14169.  
  14170.  stayopen 
  14171.    Allows the ETC\HOSTS file to stay open after each call; specifying 0 closes 
  14172.    the file. 
  14173.  
  14174.  Description 
  14175.  
  14176.  This call opens and rewinds the ETC\HOSTS file. If the stayopen parameter is 
  14177.  nonzero, the ETC\HOSTS file stays open after each of the gethost calls. 
  14178.  
  14179.  Related Calls 
  14180.  
  14181.       endhostent() 
  14182.       gethostbyaddr() 
  14183.       gethostbyname() 
  14184.       gethostent() 
  14185.  
  14186.  
  14187. ΓòÉΓòÉΓòÉ 13.52. setnetent() ΓòÉΓòÉΓòÉ
  14188.  
  14189. The setnetent() call opens and rewinds the ETC\NETWORKS file. 
  14190.  
  14191. Syntax 
  14192.  
  14193. #include <netdb.h>
  14194. void setnetent(stayopen)
  14195. int stayopen;
  14196.  
  14197. Parameters 
  14198.  
  14199.  stayopen 
  14200.    Allows the ETC\NETWORKS file to stay open after each call; specifying 0 
  14201.    closes the file. 
  14202.  
  14203.  Description 
  14204.  
  14205.  This call opens and rewinds the ETC\NETWORKS file, which contains information 
  14206.  about known networks.  If the stayopen parameter is nonzero, the ETC\NETWORKS 
  14207.  file stays open after each of the getnet calls. 
  14208.  
  14209.  Related Calls 
  14210.  
  14211.       endnetent() 
  14212.       getnetbyaddr() 
  14213.       getnetbyname() 
  14214.       getnetent() 
  14215.  
  14216.  
  14217. ΓòÉΓòÉΓòÉ 13.53. setprotoent() ΓòÉΓòÉΓòÉ
  14218.  
  14219. The setprotoent() call opens and rewinds the ETC\PROTOCOL file. 
  14220.  
  14221. Syntax 
  14222.  
  14223. #include <netdb.h>
  14224. void setprotoent(stayopen)
  14225. int stayopen;
  14226.  
  14227. Parameters 
  14228.  
  14229.  stayopen 
  14230.    Allows the ETC\PROTOCOL file to stay open after each call; specifying 0 
  14231.    closes the file. 
  14232.  
  14233.  Description 
  14234.  
  14235.  This call opens and rewinds the ETC\PROTOCOL file, which contains information 
  14236.  about known protocols. If the stayopen parameter is nonzero, the ETC\PROTOCOL 
  14237.  file stays open after each of the getproto calls. 
  14238.  
  14239.  Related Calls 
  14240.  
  14241.       endprotoent() 
  14242.       getprotobyname() 
  14243.       getprotobynumber() 
  14244.       getprotoent() 
  14245.  
  14246.  
  14247. ΓòÉΓòÉΓòÉ 13.54. setservent() ΓòÉΓòÉΓòÉ
  14248.  
  14249. The setservent() call opens and rewinds the ETC\SERVICES file. 
  14250.  
  14251. Syntax 
  14252.  
  14253. #include <netdb.h>
  14254. void setservent(stayopen)
  14255. int stayopen;
  14256.  
  14257. Parameters 
  14258.  
  14259.  stayopen 
  14260.    Allows the ETC\SERVICES file to stay open after each call; specifying 0 
  14261.    closes the file. 
  14262.  
  14263.  Description 
  14264.  
  14265.  This call opens and rewinds the ETC\SERVICES file, which contains information 
  14266.  about known services and well-known ports. If the stayopen parameter is 
  14267.  nonzero, the ETC\SERVICES file stays open after each of the getserv calls. 
  14268.  
  14269.  Related Calls 
  14270.  
  14271.       endprotoent() 
  14272.       endservent() 
  14273.       getprotobyname() 
  14274.       getprotobynumber() 
  14275.       getprotoent() 
  14276.       getservbyname() 
  14277.       getservbyport() 
  14278.       getservent() 
  14279.       setprotoent() 
  14280.  
  14281.  
  14282. ΓòÉΓòÉΓòÉ 14. Remote Procedure and eXternal Data Representation API ΓòÉΓòÉΓòÉ
  14283.  
  14284. The following table briefly describes each remote procedure and XDR call, and 
  14285. identifies where you can find the syntax, parameters, and other appropriate 
  14286. information for these calls. 
  14287.  
  14288. Remote Procedure and XDR API Quick Reference 
  14289.  
  14290. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14291. ΓöéRPC or XDR Call                  Description                      Γöé
  14292. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14293. Γöéauth_destroy()                   Destroys authentication          Γöé
  14294. Γöé                                 information                      Γöé
  14295. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14296. Γöéauthnone_create()                Creates and returns a NULL RPC   Γöé
  14297. Γöé                                 authentication handle            Γöé
  14298. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14299. Γöéauthunix_create()                Creates and returns a UNIX-based Γöé
  14300. Γöé                                 authentication handle            Γöé
  14301. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14302. Γöéauthunix_create_default()        Calls authunix_create() with     Γöé
  14303. Γöé                                 default parameters               Γöé
  14304. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14305. Γöécallrpc()                        Calls remote procedures          Γöé
  14306. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14307. Γöéclnt_broadcast()                 Broadcasts a remote program to   Γöé
  14308. Γöé                                 all locally connected broadcast  Γöé
  14309. Γöé                                 networks                         Γöé
  14310. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14311. Γöéclnt_call()                      Calls the remote procedure (     Γöé
  14312. Γöé                                 procnum) associated with the     Γöé
  14313. Γöé                                 client handle (clnt)             Γöé
  14314. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14315. Γöéclnt_destroy()                   Destroys a client's RPC handle   Γöé
  14316. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14317. Γöéclnt_freeres()                   Deallocates resources assigned   Γöé
  14318. Γöé                                 for decoding the results of an   Γöé
  14319. Γöé                                 RPC                              Γöé
  14320. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14321. Γöéclnt_geterr()                    Copies the error structure from aΓöé
  14322. Γöé                                 client's handle to the local     Γöé
  14323. Γöé                                 structure                        Γöé
  14324. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14325. Γöéclnt_pcreateerror()              Indicates why a client handle    Γöé
  14326. Γöé                                 cannot be created                Γöé
  14327. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14328. Γöéclnt_perrno()                    Writes a message to the standard Γöé
  14329. Γöé                                 error device corresponding to theΓöé
  14330. Γöé                                 condition indicated by stat      Γöé
  14331. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14332. Γöéclnt_perror()                    Writes an error message          Γöé
  14333. Γöé                                 indicating why RPC failed        Γöé
  14334. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14335. Γöéclntraw_create()                 Creates a client transport handleΓöé
  14336. Γöé                                 to use in a single task          Γöé
  14337. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14338. Γöéclnttcp_create()                 Creates an RPC client transport  Γöé
  14339. Γöé                                 handle for the remote program    Γöé
  14340. Γöé                                 using TCP transport              Γöé
  14341. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14342. Γöéclntudp_create()                 Creates an RPC client transport  Γöé
  14343. Γöé                                 handle for the remote program    Γöé
  14344. Γöé                                 using UDP transport              Γöé
  14345. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14346. Γöéget_myaddress()                  Returns the local host's internetΓöé
  14347. Γöé                                 address                          Γöé
  14348. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14349. Γöégetrpcbyname()                   Returns an RPC program entry     Γöé
  14350. Γöé                                 specified by a name in the RPC   Γöé
  14351. Γöé                                 file                             Γöé
  14352. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14353. Γöégetrpcbynumber()                 Returns an RPC program entry     Γöé
  14354. Γöé                                 specified by a number in the RPC Γöé
  14355. Γöé                                 file                             Γöé
  14356. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14357. Γöégetrpcent()                      Returns the next entry in the    Γöé
  14358. Γöé                                 TCPIP\ETC\RPC file               Γöé
  14359. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14360. Γöépmap_getmaps()                   Returns a list of current        Γöé
  14361. Γöé                                 program-to-port mappings on a    Γöé
  14362. Γöé                                 specified remote host's          Γöé
  14363. Γöé                                 Portmapper                       Γöé
  14364. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14365. Γöépmap_getport()                   Returns the port number          Γöé
  14366. Γöé                                 associated with the remote       Γöé
  14367. Γöé                                 program, the version, and the    Γöé
  14368. Γöé                                 transport protocol               Γöé
  14369. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14370. Γöépmap_rmtcall()                   Instructs Portmapper to make an  Γöé
  14371. Γöé                                 RPC call to a procedure on a hostΓöé
  14372. Γöé                                 on your behalf                   Γöé
  14373. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14374. Γöépmap_set()                       Sets the mapping of the program  Γöé
  14375. Γöé                                 to port on the local machine's   Γöé
  14376. Γöé                                 Portmapper                       Γöé
  14377. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14378. Γöépmap_unset()                     Removes the mappings associated  Γöé
  14379. Γöé                                 with prognum and versnum on the  Γöé
  14380. Γöé                                 local machine's Portmapper       Γöé
  14381. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14382. Γöéregisterrpc()                    Registers a procedure with the   Γöé
  14383. Γöé                                 local Portmapper and creates a   Γöé
  14384. Γöé                                 control structure to remember theΓöé
  14385. Γöé                                 server procedure and its XDR     Γöé
  14386. Γöé                                 routine                          Γöé
  14387. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14388. Γöérpc_createerr                    A global variable that is set    Γöé
  14389. Γöé                                 when any RPC client creation     Γöé
  14390. Γöé                                 routine fails                    Γöé
  14391. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14392. Γöésvc_destroy()                    Deletes the RPC service transportΓöé
  14393. Γöé                                 handle xprt, which becomes       Γöé
  14394. Γöé                                 undefined after this routine is  Γöé
  14395. Γöé                                 called                           Γöé
  14396. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14397. Γöésvc_freeargs()                   Frees storage allocated to decodeΓöé
  14398. Γöé                                 the arguments received by        Γöé
  14399. Γöé                                 svc_getargs()                    Γöé
  14400. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14401. Γöésvc_getargs()                    Uses the XDR routine inproc to   Γöé
  14402. Γöé                                 decode the arguments of an RPC   Γöé
  14403. Γöé                                 request associated with the RPC  Γöé
  14404. Γöé                                 service transport handle xprt    Γöé
  14405. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14406. Γöésvc_getcaller()                  Gets the network address of the  Γöé
  14407. Γöé                                 client associated with the       Γöé
  14408. Γöé                                 service transport handle         Γöé
  14409. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14410. Γöésvc_getreq()                     Implements asynchronous event    Γöé
  14411. Γöé                                 processing and returns control toΓöé
  14412. Γöé                                 the program after all sockets    Γöé
  14413. Γöé                                 have been serviced               Γöé
  14414. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14415. Γöésvc_register()                   Registers procedures on the localΓöé
  14416. Γöé                                 Portmapper                       Γöé
  14417. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14418. Γöésvc_run()                        Accepts RPC requests and calls   Γöé
  14419. Γöé                                 the appropriate service using    Γöé
  14420. Γöé                                 svc_getreq()                     Γöé
  14421. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14422. Γöésvc_sendreply()                  Sends the results of an RPC to   Γöé
  14423. Γöé                                 the caller                       Γöé
  14424. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14425. Γöésvc_socks[ ]                     An array of socket descriptors   Γöé
  14426. Γöé                                 being serviced                   Γöé
  14427. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14428. Γöésvc_unregister()                 Removes all local mappings of    Γöé
  14429. Γöé                                 prognum versnum to dispatch      Γöé
  14430. Γöé                                 routines (prognum, versnum, *)   Γöé
  14431. Γöé                                 and to port numbers              Γöé
  14432. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14433. Γöésvcerr_auth()                    Sends an error reply when the    Γöé
  14434. Γöé                                 service dispatch routine cannot  Γöé
  14435. Γöé                                 execute an RPC request because ofΓöé
  14436. Γöé                                 authentication errors            Γöé
  14437. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14438. Γöésvcerr_decode()                  Sends an error reply when the    Γöé
  14439. Γöé                                 service dispatch routine cannot  Γöé
  14440. Γöé                                 decode its parameters            Γöé
  14441. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14442. Γöésvcerr_noproc()                  Sends an error reply when the    Γöé
  14443. Γöé                                 service dispatch routine cannot  Γöé
  14444. Γöé                                 call the procedure requested     Γöé
  14445. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14446. Γöésvcerr_noprog()                  Sends an error code when the     Γöé
  14447. Γöé                                 requested program is not         Γöé
  14448. Γöé                                 registered                       Γöé
  14449. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14450. Γöésvcerr_progvers()                Sends the low version number and Γöé
  14451. Γöé                                 high version number of RPC       Γöé
  14452. Γöé                                 service when the version numbers Γöé
  14453. Γöé                                 of two RPC programs do not match Γöé
  14454. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14455. Γöésvcerr_systemerr()               Sends an error reply when the    Γöé
  14456. Γöé                                 service dispatch routine detects Γöé
  14457. Γöé                                 a system error that has not been Γöé
  14458. Γöé                                 handled                          Γöé
  14459. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14460. Γöésvcerr_weakauth()                Sends an error reply when the    Γöé
  14461. Γöé                                 service dispatch routine cannot  Γöé
  14462. Γöé                                 run an RPC because of weak       Γöé
  14463. Γöé                                 authentication parameters        Γöé
  14464. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14465. Γöésvcraw_create()                  Creates a local RPC service      Γöé
  14466. Γöé                                 transport handle to simulate RPC Γöé
  14467. Γöé                                 programs within one host         Γöé
  14468. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14469. Γöésvctcp_create()                  Creates a TCP-based service      Γöé
  14470. Γöé                                 transport                        Γöé
  14471. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14472. Γöésvcudp_create()                  Creates a UDP-based service      Γöé
  14473. Γöé                                 transport                        Γöé
  14474. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14475. Γöéxdr_accepted_reply()             Translates between an RPC reply  Γöé
  14476. Γöé                                 message and its external         Γöé
  14477. Γöé                                 representation                   Γöé
  14478. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14479. Γöéxdr_array()                      Translates between an array and  Γöé
  14480. Γöé                                 its external representation      Γöé
  14481. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14482. Γöéxdr_authunix_parms()             Translates between UNIX-based    Γöé
  14483. Γöé                                 authentication information and   Γöé
  14484. Γöé                                 its external representation      Γöé
  14485. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14486. Γöéxdr_bool()                       Translates between a Boolean and Γöé
  14487. Γöé                                 its external representation      Γöé
  14488. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14489. Γöéxdr_bytes()                      Translates between byte strings  Γöé
  14490. Γöé                                 and their external               Γöé
  14491. Γöé                                 representations                  Γöé
  14492. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14493. Γöéxdr_callhdr()                    Translates between an RPC messageΓöé
  14494. Γöé                                 header and its external          Γöé
  14495. Γöé                                 representation                   Γöé
  14496. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14497. Γöéxdr_callmsg()                    Translates between RPC call      Γöé
  14498. Γöé                                 messages (header and             Γöé
  14499. Γöé                                 authentication, not argument     Γöé
  14500. Γöé                                 data) and their external         Γöé
  14501. Γöé                                 representations                  Γöé
  14502. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14503. Γöéxdr_destroy()                    Destroys the XDR stream pointed  Γöé
  14504. Γöé                                 to by the xdrs parameter         Γöé
  14505. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14506. Γöéxdr_double()                     Translates between C             Γöé
  14507. Γöé                                 double-precision numbers and     Γöé
  14508. Γöé                                 their external representations   Γöé
  14509. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14510. Γöéxdr_enum()                       Translates between C-enumerated  Γöé
  14511. Γöé                                 groups and their external        Γöé
  14512. Γöé                                 representations                  Γöé
  14513. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14514. Γöéxdr_float()                      Translates between C             Γöé
  14515. Γöé                                 floating-point numbers and their Γöé
  14516. Γöé                                 external representations         Γöé
  14517. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14518. Γöéxdr_getpos()                     Starts the get-position routine  Γöé
  14519. Γöé                                 associated with the XDR stream,  Γöé
  14520. Γöé                                 xdrs                             Γöé
  14521. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14522. Γöéxdr_inline()                     Returns a pointer to a continuousΓöé
  14523. Γöé                                 piece of the XDR stream's buffer Γöé
  14524. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14525. Γöéxdr_int()                        Translates between C integers andΓöé
  14526. Γöé                                 their external representations   Γöé
  14527. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14528. Γöéxdr_long()                       Translates between C long        Γöé
  14529. Γöé                                 integers and their external      Γöé
  14530. Γöé                                 representations                  Γöé
  14531. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14532. Γöéxdr_opaque()                     Translates between fixed-size    Γöé
  14533. Γöé                                 opaque data and its external     Γöé
  14534. Γöé                                 representation                   Γöé
  14535. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14536. Γöéxdr_opaque_auth()                Translates between RPC message   Γöé
  14537. Γöé                                 authentications and their        Γöé
  14538. Γöé                                 external representations         Γöé
  14539. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14540. Γöéxdr_pmap()                       Translates an RPC procedure      Γöé
  14541. Γöé                                 identification, such as is used  Γöé
  14542. Γöé                                 in calls to Portmapper           Γöé
  14543. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14544. Γöéxdr_pmaplist()                   Translates a variable number of  Γöé
  14545. Γöé                                 RPC procedure identifications,   Γöé
  14546. Γöé                                 such as those Portmapper creates Γöé
  14547. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14548. Γöéxdr_reference()                  Provides pointer chasing within  Γöé
  14549. Γöé                                 structures                       Γöé
  14550. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14551. Γöéxdr_rejected_reply()             Translates between rejected RPC  Γöé
  14552. Γöé                                 reply messages and their externalΓöé
  14553. Γöé                                 representations                  Γöé
  14554. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14555. Γöéxdr_replymsg()                   Translates between RPC reply     Γöé
  14556. Γöé                                 messages and their external      Γöé
  14557. Γöé                                 representations                  Γöé
  14558. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14559. Γöéxdr_setpos()                     Starts the set-position routine  Γöé
  14560. Γöé                                 associated with a XDR stream,    Γöé
  14561. Γöé                                 xdrs                             Γöé
  14562. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14563. Γöéxdr_short()                      Translates between C short       Γöé
  14564. Γöé                                 integers and their external      Γöé
  14565. Γöé                                 representations                  Γöé
  14566. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14567. Γöéxdr_string()                     Translates between C strings and Γöé
  14568. Γöé                                 their external representations   Γöé
  14569. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14570. Γöéxdr_u_int()                      Translates between C unsigned    Γöé
  14571. Γöé                                 integers and their external      Γöé
  14572. Γöé                                 representations                  Γöé
  14573. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14574. Γöéxdr_u_long()                     Translates between C unsigned    Γöé
  14575. Γöé                                 long integers and their external Γöé
  14576. Γöé                                 representations                  Γöé
  14577. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14578. Γöéxdr_u_short()                    Translates between C unsigned    Γöé
  14579. Γöé                                 short integers and their externalΓöé
  14580. Γöé                                 representations                  Γöé
  14581. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14582. Γöéxdr_union()                      Translates between a             Γöé
  14583. Γöé                                 discriminated C union and its    Γöé
  14584. Γöé                                 external representation          Γöé
  14585. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14586. Γöéxdr_vector()                     Translates between a fixed-lengthΓöé
  14587. Γöé                                 array and its external           Γöé
  14588. Γöé                                 representation                   Γöé
  14589. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14590. Γöéxdr_void()                       Returns a value of 1             Γöé
  14591. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14592. Γöéxdr_wrapstring()                 Translates between strings and   Γöé
  14593. Γöé                                 their external representations   Γöé
  14594. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14595. Γöéxdrmem_create()                  Initializes the XDR stream       Γöé
  14596. Γöé                                 pointed to by xdrs               Γöé
  14597. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14598. Γöéxdrrec_create()                  Initializes the XDR stream       Γöé
  14599. Γöé                                 pointed to by xdrs               Γöé
  14600. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14601. Γöéxdrrec_endofrecord()             Marks the data in the output     Γöé
  14602. Γöé                                 buffer as a completed record     Γöé
  14603. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14604. Γöéxdrrec_eof()                     Marks the end of the file, after Γöé
  14605. Γöé                                 using the rest of the current    Γöé
  14606. Γöé                                 record in the XDR stream         Γöé
  14607. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14608. Γöéxdrrec_skiprecord()              Discards the rest of the XDR     Γöé
  14609. Γöé                                 stream's current record in the   Γöé
  14610. Γöé                                 input buffer                     Γöé
  14611. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14612. Γöéxdrstdio_create()                Initializes the XDR stream       Γöé
  14613. Γöé                                 pointed to by xdrs               Γöé
  14614. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14615. Γöéxprt_register()                  Registers service transport      Γöé
  14616. Γöé                                 handles with the RPC service     Γöé
  14617. Γöé                                 package; also modifies the globalΓöé
  14618. Γöé                                 variable svc_socks[ ]            Γöé
  14619. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14620. Γöéxprt_unregister()                Unregisters the RPC service      Γöé
  14621. Γöé                                 transport handle                 Γöé
  14622. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14623.  
  14624.  
  14625. ΓòÉΓòÉΓòÉ 14.1. auth_destroy() ΓòÉΓòÉΓòÉ
  14626.  
  14627. The auth_destroy() call destroys authentication information. 
  14628.  
  14629. Syntax 
  14630.  
  14631. #include <rpc\rpc.h>
  14632.  
  14633. void
  14634. auth_destroy(auth)
  14635. AUTH *auth;
  14636.  
  14637. Parameters 
  14638.  
  14639.  auth 
  14640.    Pointer to authentication information. 
  14641.  
  14642.  Description 
  14643.  
  14644.  The auth_destroy() call deletes the authentication information for auth. After 
  14645.  you call this procedure, auth is undefined. 
  14646.  
  14647.  Related Calls 
  14648.  
  14649.       authnone_create() 
  14650.       authunix_create() 
  14651.       authunix_create_default() 
  14652.  
  14653.  
  14654. ΓòÉΓòÉΓòÉ 14.2. authnone_create() ΓòÉΓòÉΓòÉ
  14655.  
  14656. The authnone_create() call creates and returns a NULL RPC authentication 
  14657. handle. 
  14658.  
  14659. Syntax 
  14660.  
  14661. #include <rpc\rpc.h>
  14662.  
  14663. AUTH *
  14664. authnone_create()
  14665.  
  14666. Description 
  14667.  
  14668. The authnone_create() call creates and returns an RPC authentication handle. 
  14669. The handle passes the NULL authentication on each call. 
  14670.  
  14671. Related Calls 
  14672.  
  14673.       auth_destroy() 
  14674.       authunix_create() 
  14675.       authunix_create_default() 
  14676.  
  14677.  
  14678. ΓòÉΓòÉΓòÉ 14.3. authunix_create() ΓòÉΓòÉΓòÉ
  14679.  
  14680. The authunix_create() call creates and returns a UNIX-based authentication 
  14681. handle. 
  14682.  
  14683. Syntax 
  14684.  
  14685. #include <rpc\rpc.h>
  14686.  
  14687. AUTH *
  14688. authunix_create(host, uid, gid, len, aup_gids)
  14689. char *host;
  14690. int uid;
  14691. int gid;
  14692. int len;
  14693. int *aup_gids;
  14694.  
  14695. Parameters 
  14696.  
  14697.  host 
  14698.    Pointer to the symbolic name of the host where the desired server is 
  14699.    located. 
  14700.  
  14701.  uid 
  14702.    User's user ID. 
  14703.  
  14704.  gid 
  14705.    User's group ID. 
  14706.  
  14707.  len 
  14708.    Length of the information pointed to by aup_gids. 
  14709.  
  14710.  aup_gids 
  14711.    Pointer to an array of groups to which the user belongs. 
  14712.  
  14713.  Description 
  14714.  
  14715.  The authunix_create() call creates and returns an authentication handle that 
  14716.  contains UNIX-based authentication information. 
  14717.  
  14718.  Related Calls 
  14719.  
  14720.       auth_destroy() 
  14721.       authnone_create() 
  14722.       authunix_create_default() 
  14723.  
  14724.  
  14725. ΓòÉΓòÉΓòÉ 14.4. authunix_create_default() ΓòÉΓòÉΓòÉ
  14726.  
  14727. The authunix_create_default() call calls authunix_create() with default 
  14728. parameters. 
  14729.  
  14730. Syntax 
  14731.  
  14732. #include <rpc\rpc.h>
  14733.  
  14734. AUTH *
  14735. authunix_create_default()
  14736.  
  14737. Description 
  14738.  
  14739. The authunix_create_default() call calls authunix_create() with default 
  14740. parameters. 
  14741.  
  14742. Related Calls 
  14743.  
  14744.       auth_destroy() 
  14745.       authnone_create() 
  14746.       authunix_create() 
  14747.  
  14748.  
  14749. ΓòÉΓòÉΓòÉ 14.5. callrpc() ΓòÉΓòÉΓòÉ
  14750.  
  14751. The callrpc() call calls remote procedures. 
  14752.  
  14753. Syntax 
  14754.  
  14755. #include <rpc\rpc.h>
  14756.  
  14757. enum clnt_stat
  14758. callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
  14759. char *host;
  14760. u_long prognum;
  14761. u_long versnum;
  14762. u_long procnum;
  14763. xdrproc_t inproc;
  14764. char *in;
  14765. xdrproc_t outproc;
  14766. char *out;
  14767.  
  14768. Parameters 
  14769.  
  14770.  host 
  14771.    Pointer to the symbolic name of the host where the desired server is 
  14772.    located. 
  14773.  
  14774.  prognum 
  14775.    Program number of the remote procedure. 
  14776.  
  14777.  versnum 
  14778.    Version number of the remote procedure. 
  14779.  
  14780.  procnum 
  14781.    Procedure number of the remote procedure. 
  14782.  
  14783.  inproc 
  14784.    XDR procedure used to encode the arguments of the remote procedure. 
  14785.  
  14786.  in 
  14787.    Pointer to the arguments of the remote procedure. 
  14788.  
  14789.  outproc 
  14790.    XDR procedure used to decode the results of the remote procedure. 
  14791.  
  14792.  out 
  14793.    Pointer to the results of the remote procedure. 
  14794.  
  14795.  Description 
  14796.  
  14797.  The callrpc() call calls the remote procedure described by prognum, versnum, 
  14798.  and procnum running on the host system.  It encodes and decodes the parameters 
  14799.  for transfer. 
  14800.  
  14801.  Notes: 
  14802.  
  14803.    1. You can use clnt_perrno() to translate the return code into messages. 
  14804.  
  14805.    2. callrpc() cannot call the procedure xdr_enum. See xdr_enum() for more 
  14806.       information. 
  14807.  
  14808.    3. This procedure uses UDP as its transport layer. See clntudp_create() for 
  14809.       more information. 
  14810.  
  14811.  Return Values 
  14812.  
  14813.  RPC_SUCCESS indicates success; otherwise, an error has occurred. The results 
  14814.  of the remote procedure call return to out. 
  14815.  
  14816.  Examples 
  14817.  
  14818.   #define RMTPROGNUM (u_long)0x3fffffffL
  14819.   #define RMTPROGVER (u_long)0x1
  14820.   #define RMTPROCNUM (u_long)0x1
  14821.  
  14822.   int inproc=100, outproc, rstat;
  14823.   ...
  14824.   /* service request to host RPCSERVER_HOST */
  14825.   if (rstat = callrpc("RPCSERVER_HOST", RMTPROGNUM, RMTPROGVER, RMTPROCNUM,
  14826.                       xdr_int, (char *)&inproc, xdr_int,
  14827.                       (char *)&outproc)!= 0)
  14828.       {
  14829.        clnt_perrno(rstat);
  14830.        exit(1);
  14831.       }
  14832.   ...
  14833.  
  14834.  Related Calls 
  14835.  
  14836.       clnt_call() 
  14837.       clnt_perrno() 
  14838.       clntudp_create() 
  14839.  
  14840.  
  14841. ΓòÉΓòÉΓòÉ 14.6. clnt_broadcast() ΓòÉΓòÉΓòÉ
  14842.  
  14843. The clnt_broadcast() call broadcasts a remote program to all locally connected 
  14844. broadcast networks. 
  14845.  
  14846. Syntax 
  14847.  
  14848. #include <rpc\rpc.h>
  14849.  
  14850. enum clnt_stat
  14851. clnt_broadcast(prognum, versnum, procnum, inproc, in, outproc, out, eachresult)
  14852. u_long prognum;
  14853. u_long versnum;
  14854. u_long procnum;
  14855. xdrproc_t inproc;
  14856. caddr_t in;
  14857. xdrproc_t outproc;
  14858. caddr_t out;
  14859. resultproc_t eachresult;
  14860.  
  14861. Parameters 
  14862.  
  14863.  prognum 
  14864.    Program number of the remote procedure. 
  14865.  
  14866.  versnum 
  14867.    Version number of the remote procedure. 
  14868.  
  14869.  procnum 
  14870.    Procedure number of the remote procedure. 
  14871.  
  14872.  inproc 
  14873.    XDR procedure used to encode the arguments of the remote procedure. 
  14874.  
  14875.  in 
  14876.    Pointer to the arguments of the remote procedure. 
  14877.  
  14878.  outproc 
  14879.    XDR procedure used to decode the results of the remote procedure. 
  14880.  
  14881.  out 
  14882.    Pointer to the results of the remote procedure. 
  14883.  
  14884.  eachresult 
  14885.    Procedure called after each response. 
  14886.  
  14887.  Note:  resultproc_t is a type definition: 
  14888.  
  14889.                 typedef bool_t (*resultproc_t) ();
  14890.  
  14891.  Description 
  14892.  
  14893.  The clnt_broadcast() call broadcasts a remote program described by prognum, 
  14894.  versnum, and procnum to all locally connected broadcast networks. Each time 
  14895.  clnt_broadcast() receives a response, it calls eachresult(). 
  14896.  
  14897.  The syntax and parameters of eachresult() are: 
  14898.  
  14899.             #include <netinet\in.h>
  14900.             #include <rpc\rpctypes.h>
  14901.  
  14902.             bool_t eachresult(out, addr)
  14903.             char *out;
  14904.             struct sockaddr_in *addr;
  14905.  
  14906.       out 
  14907.              Has the same function as it does for clnt_broadcast(), except that 
  14908.              the output of the remote procedure is decoded 
  14909.  
  14910.       addr 
  14911.              Pointer to the address of the machine that sent the results 
  14912.  
  14913.  Return Values 
  14914.  
  14915.  If eachresult() returns 0, clnt_broadcast() waits for more replies; otherwise, 
  14916.  eachresult() returns the appropriate status. 
  14917.  
  14918.  Note:  Broadcast sockets are limited in size to the maximum transfer unit of 
  14919.         the data link. 
  14920.  
  14921.  Examples 
  14922.  
  14923.   enum clnt_stat cs;
  14924.   u_long prognum, versnum;
  14925.   ...
  14926.   cs = clnt_broadcast(prognum, versnum, NULLPROC, xdr_void,
  14927.                       (char *)NULL, xdr_void, (char *)NULL, eachresult);
  14928.   if ((cs != RPC_SUCCESS) && (cs != RPC_TIMEDOUT))
  14929.     {
  14930.      fprintf( " broadcast failed: \n");
  14931.      exit(-1);
  14932.     }
  14933.   ...
  14934.   bool_t
  14935.   eachresult(out, addr)
  14936.   void *out;                                    /* Nothing comes back */
  14937.   struct sockaddr_in *addr;                        /* Reply from whom */
  14938.   {
  14939.       register struct hostent *hp;
  14940.       ...
  14941.       hp = gethostbyaddr((char *) &addr->sin_addr, sizeof addr->sin_addr,
  14942.           AF_INET);
  14943.       printf("%s %s\n", inet_ntoa(addr->sin_addr), hp->h_name);
  14944.       ...
  14945.       return(FALSE);
  14946.   }
  14947.  
  14948.  Related Calls 
  14949.  
  14950.       callrpc() 
  14951.       clnt_call() 
  14952.  
  14953.  
  14954. ΓòÉΓòÉΓòÉ 14.7. clnt_call() ΓòÉΓòÉΓòÉ
  14955.  
  14956. The clnt_call() call calls the remote procedure (procnum) associated with the 
  14957. client handle (clnt). 
  14958.  
  14959. Syntax 
  14960.  
  14961. #include <rpc\rpc.h>
  14962.  
  14963. enum clnt_stat
  14964. clnt_call(clnt, procnum, inproc, in, outproc, out, tout)
  14965. CLIENT *clnt;
  14966. u_long procnum;
  14967. xdrproc_t inproc;
  14968. char *in;
  14969. xdrproc_t outproc;
  14970. char *out;
  14971. struct timeval tout;
  14972.  
  14973. Parameters 
  14974.  
  14975.  clnt 
  14976.    Pointer to a client handle that was previously obtained using 
  14977.    clntraw_create(), clnttcp_create(), or clntudp_create(). 
  14978.  
  14979.  procnum 
  14980.    Remote procedure number. 
  14981.  
  14982.  inproc 
  14983.    XDR procedure used to encode procnum's arguments. 
  14984.  
  14985.  in 
  14986.    Pointer to the remote procedure's arguments. 
  14987.  
  14988.  outproc 
  14989.    XDR procedure used to decode the remote procedure's results. 
  14990.  
  14991.  out 
  14992.    Pointer to the remote procedure's results. 
  14993.  
  14994.  tout 
  14995.    Time allowed for the server to respond, in units of 0.1 seconds. 
  14996.  
  14997.  Return Values 
  14998.  
  14999.  RPC_SUCCESS indicates success; otherwise, an error has occurred. The results 
  15000.  of the remote procedure call are returned to out. 
  15001.  
  15002.  Examples 
  15003.  
  15004.   u_long procnum;
  15005.   register CLIENT *clnt;
  15006.   enum clnt_stat cs;
  15007.   struct timeval  total_timeout;
  15008.   int intsend, intrecv;
  15009.  
  15010.   cs=clnt_call(clnt, procnum, xdr_int, &intsend,
  15011.      xdr_int, &intrecv, total_timeout);
  15012.   if ( cs != RPC_SUCCESS)
  15013.       printf("*Error* clnt_call fail :\n");
  15014.  
  15015.  Related Calls 
  15016.  
  15017.       callrpc() 
  15018.       clnt_perror() 
  15019.       clntraw_create() 
  15020.       clnttcp_create() 
  15021.       clntudp_create() 
  15022.  
  15023.  
  15024. ΓòÉΓòÉΓòÉ 14.8. clnt_destroy() ΓòÉΓòÉΓòÉ
  15025.  
  15026. The clnt_destroy() call destroys a client's RPC handle. 
  15027.  
  15028. Syntax 
  15029.  
  15030. #include <rpc\rpc.h>
  15031.  
  15032. void
  15033. clnt_destroy(clnt)
  15034. CLIENT *clnt;
  15035.  
  15036. Parameters 
  15037.  
  15038.  clnt 
  15039.    Pointer to a client handle that was previously created using 
  15040.    clntudp_create(), clnttcp_create(), or clntraw_create(). 
  15041.  
  15042.  Description 
  15043.  
  15044.  The clnt_destroy() call deletes a client RPC transport handle. This procedure 
  15045.  involves the deallocation of private data resources, including clnt. After you 
  15046.  use this procedure, clnt is undefined. Open sockets associated with clnt must 
  15047.  be closed. 
  15048.  
  15049.  Related Calls 
  15050.  
  15051.       clntraw_create() 
  15052.       clnttcp_create() 
  15053.       clntudp_create() 
  15054.  
  15055.  
  15056. ΓòÉΓòÉΓòÉ 14.9. clnt_freeres() ΓòÉΓòÉΓòÉ
  15057.  
  15058. The clnt_freeres() call deallocates resources assigned for decoding the results 
  15059. of an RPC. 
  15060.  
  15061. Syntax 
  15062.  
  15063. #include <rpc\rpc.h>
  15064.  
  15065. bool_t
  15066. clnt_freeres(clnt, outproc, out)
  15067. CLIENT *clnt;
  15068. xdrproc_t outproc;
  15069. char *out;
  15070.  
  15071. Parameters 
  15072.  
  15073.  clnt 
  15074.    Pointer to a client handle that was previously obtained using 
  15075.    clntraw_create(), clnttcp_create(), or clntudp_create(). 
  15076.  
  15077.  outproc 
  15078.    XDR procedure used to decode the remote procedure's results. 
  15079.  
  15080.  out 
  15081.    Pointer to the results of the remote procedure. 
  15082.  
  15083.  Return Values 
  15084.  
  15085.  The value 1 indicates success; the value 0 indicates an error. 
  15086.  
  15087.  Related Calls 
  15088.  
  15089.       clntraw_create() 
  15090.       clnttcp_create() 
  15091.       clntudp_create() 
  15092.  
  15093.  
  15094. ΓòÉΓòÉΓòÉ 14.10. clnt_geterr() ΓòÉΓòÉΓòÉ
  15095.  
  15096. The clnt_geterr() call copies the error structure from a client's handle to the 
  15097. local structure. 
  15098.  
  15099. Syntax 
  15100.  
  15101. #include <rpc\rpc.h>
  15102.  
  15103. void
  15104. clnt_geterr(clnt, errp)
  15105. CLIENT *clnt;
  15106. struct rpc_err *errp;
  15107.  
  15108. Parameters 
  15109.  
  15110.  clnt 
  15111.    Pointer to a client handle that was previously obtained using 
  15112.    clntraw_create(), clnttcp_create(), or clntudp_create(). 
  15113.  
  15114.  errp 
  15115.    Pointer to the address into which the error structure is copied. 
  15116.  
  15117.  Examples 
  15118.  
  15119.   u_long procnum;
  15120.   register CLIENT *clnt;
  15121.   enum clnt_stat cs;
  15122.   struct timeval  total_timeout;
  15123.   int intsend = 100, intrecv;
  15124.   struct rpc_err error;
  15125.   ...
  15126.   total_timeout.tv_sec = 20;
  15127.   total_timeout.tv_usec = 0;
  15128.   ...
  15129.   cs=clnt_call(clnt, procnum, xdr_int, &intsend,
  15130.      xdr_int, &intrecv, total_timeout);
  15131.   if ( cs != RPC_SUCCESS)
  15132.        {
  15133.              clnt_geterr(clnt, &error);
  15134.              clnt_perror(clnt, "recv from server");
  15135.        }
  15136.   ...
  15137.  
  15138.  Related Calls 
  15139.  
  15140.       clnt_call() 
  15141.       clnt_pcreateerror() 
  15142.       clnt_perrno() 
  15143.       clnt_perror() 
  15144.       clntraw_create() 
  15145.       clnttcp_create() 
  15146.       clntudp_create() 
  15147.  
  15148.  
  15149. ΓòÉΓòÉΓòÉ 14.11. clnt_pcreateerror() ΓòÉΓòÉΓòÉ
  15150.  
  15151. The clnt_pcreateerror() call indicates why a client handle cannot be created. 
  15152.  
  15153. Syntax 
  15154.  
  15155. #include <rpc\rpc.h>
  15156.  
  15157. void
  15158. clnt_pcreateerror(s)
  15159. char *s;
  15160.  
  15161. Parameters 
  15162.  
  15163.  s 
  15164.    Pointer to a string that is to be printed in front of the message. The 
  15165.    string is followed by a colon. 
  15166.  
  15167.  Description 
  15168.  
  15169.  The clnt_pcreateerror() call writes a message to the standard error device, 
  15170.  indicating why a client handle cannot be created. Use this procedure after the 
  15171.  clntraw_create(), clnttcp_create(), or clntudp_create() call fails. 
  15172.  
  15173.  For an example of the clnt_pcreateerror() call, see clnttcp_create(). 
  15174.  
  15175.  Related Calls 
  15176.  
  15177.       clnt_geterr() 
  15178.       clnt_perrno() 
  15179.       clnt_perror() 
  15180.       clntraw_create() 
  15181.       clnttcp_create() 
  15182.       clntudp_create() 
  15183.  
  15184.  
  15185. ΓòÉΓòÉΓòÉ 14.12. clnt_perrno() ΓòÉΓòÉΓòÉ
  15186.  
  15187. The clnt_perrno() call writes a message to the standard error device 
  15188. corresponding to the condition indicated by stat. 
  15189.  
  15190. Syntax 
  15191.  
  15192. #include <rpc\rpc.h>
  15193.  
  15194. void
  15195. clnt_perrno(stat)
  15196. enum clnt_stat stat;
  15197.  
  15198. Parameters 
  15199.  
  15200.  stat 
  15201.    The client status. 
  15202.  
  15203.  Description 
  15204.  
  15205.  The clnt_perrno() call writes a message to the standard error device 
  15206.  corresponding to the condition indicated by stat. Use this procedure after 
  15207.  callrpc() and clnt_broadcast() if there is an error. 
  15208.  
  15209.  Related Calls 
  15210.  
  15211.       callrpc() 
  15212.       clnt_geterr() 
  15213.       clnt_pcreateerror() 
  15214.       clnt_perror() 
  15215.  
  15216.  
  15217. ΓòÉΓòÉΓòÉ 14.13. clnt_perror() ΓòÉΓòÉΓòÉ
  15218.  
  15219. The clnt_perror() call writes an error message indicating why RPC failed. 
  15220.  
  15221. Syntax 
  15222.  
  15223. #include <rpc\rpc.h>
  15224.  
  15225. void
  15226. clnt_perror(clnt, s)
  15227. CLIENT *clnt;
  15228. char *s;
  15229.  
  15230. Parameters 
  15231.  
  15232.  clnt 
  15233.    Pointer to a client handle that was previously obtained using 
  15234.    clntudp_create(), clnttcp_create(), or clntraw_create(). 
  15235.  
  15236.  s 
  15237.    Pointer to a string that is to be printed in front of the message. The 
  15238.    string is followed by a colon. 
  15239.  
  15240.  Description 
  15241.  
  15242.  The clnt_perror() call writes a message to the standard error device, 
  15243.  indicating why an RPC failed. Use this procedure after clnt_call() if there is 
  15244.  an error. 
  15245.  
  15246.  For an example of the clnt_perror() call, see clnt_geterr(). 
  15247.  
  15248.  Related Calls 
  15249.  
  15250.       clnt_call() 
  15251.       clnt_geterr() 
  15252.       clnt_pcreateerror() 
  15253.       clnt_perrno() 
  15254.       clntraw_create() 
  15255.       clnttcp_create() 
  15256.       clntudp_create() 
  15257.  
  15258.  
  15259. ΓòÉΓòÉΓòÉ 14.14. clntraw_create() ΓòÉΓòÉΓòÉ
  15260.  
  15261. The clntraw_create() call creates a client transport handle to use in a single 
  15262. task. 
  15263.  
  15264. Syntax 
  15265.  
  15266. #include <rpc\rpc.h>
  15267.  
  15268. CLIENT *
  15269. clntraw_create(prognum, versnum)
  15270. u_long prognum;
  15271. u_long versnum;
  15272.  
  15273. Parameters 
  15274.  
  15275.  prognum 
  15276.    Remote program number. 
  15277.  
  15278.  versnum 
  15279.    Version number of the remote program. 
  15280.  
  15281.  Description 
  15282.  
  15283.  The clntraw_create() call creates a dummy client for the remote double 
  15284.  (prognum, versnum). Because messages are passed using a buffer within the 
  15285.  address space of the local process, the server should also use the same 
  15286.  address space, which simulates RPC programs within one address space. See 
  15287.  svcraw_create() for more information. 
  15288.  
  15289.  Return Values 
  15290.  
  15291.  NULL indicates failure. 
  15292.  
  15293.  Related Calls 
  15294.  
  15295.       clnt_call() 
  15296.       clnt_destroy() 
  15297.       clnt_pcreateerror() 
  15298.       clnttcp_create() 
  15299.       clntudp_create() 
  15300.       svcraw_create() 
  15301.  
  15302.  
  15303. ΓòÉΓòÉΓòÉ 14.15. clnttcp_create() ΓòÉΓòÉΓòÉ
  15304.  
  15305. The clnttcp_create() call creates an RPC client transport handle for the remote 
  15306. program using TCP transport. 
  15307.  
  15308. Syntax 
  15309.  
  15310. #include <rpc\rpc.h>
  15311.  
  15312. CLIENT *
  15313. clnttcp_create(addr, prognum, versnum, sockp, sendsz, recvsz)
  15314. struct sockaddr_in *addr;
  15315. u_long prognum;
  15316. u_long versnum;
  15317. int *sockp;
  15318. u_int sendsz;
  15319. u_int recvsz;
  15320.  
  15321. Parameters 
  15322.  
  15323.  addr 
  15324.    Pointer to the internet address of the remote program. If addr points to a 
  15325.    port number of 0, addr is set to the port on which the remote program is 
  15326.    receiving. 
  15327.  
  15328.  prognum 
  15329.    Remote program number. 
  15330.  
  15331.  versnum 
  15332.    Version number of the remote program. 
  15333.  
  15334.  sockp 
  15335.    Pointer to the socket. If sockp is RPC_ANYSOCK, then this routine opens a 
  15336.    new socket and sets sockp. 
  15337.  
  15338.  sendsz 
  15339.    Size of the send buffer.  Specify 0 to have clnttcp_create() pick a suitable 
  15340.    default size. 
  15341.  
  15342.  recvsz 
  15343.    Size of the receive buffer.  Specify 0 to have clnttcp_create() pick a 
  15344.    suitable default size. 
  15345.  
  15346.  Description 
  15347.  
  15348.  The clnttcp_create() call creates an RPC client transport handle for the 
  15349.  remote program specified by (prognum, versnum).  The client uses TCP as the 
  15350.  transport layer. 
  15351.  
  15352.  Return Values 
  15353.  
  15354.  NULL indicates failure. 
  15355.  
  15356.  Examples 
  15357.  
  15358.   #define RMTPROGNUM   (u_long)0x3fffffffL
  15359.   #define RMTPROGVER   (u_long)0x1L
  15360.  
  15361.   register CLIENT *clnt;
  15362.   int sock = RPC_ANYSOCK; /* can be also valid socket descriptor */
  15363.   struct hostent *hp;
  15364.   struct sockaddr_in server_addr;
  15365.  
  15366.   /* get the internet address of RPC server */
  15367.   if ((hp = gethostbyname("RPCSERVER_HOST") == NULL)
  15368.     {
  15369.      fprintf(stderr,"Can't get address for %s\n",argv[2]);
  15370.      exit (-1);
  15371.     }
  15372.  
  15373.   bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr, hp->h_length);
  15374.   server_addr.sin_family = AF_INET;
  15375.   server_addr.sin_port = 0;
  15376.  
  15377.   /* create TCP handle */
  15378.   if ((clnt = clnttcp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  15379.                               &sock, 1024*10, 1024*10)) == NULL)
  15380.      {
  15381.       clnt_pcreateerror("clnttcp_create");
  15382.       exit(-1);
  15383.      }
  15384.  
  15385.  Related Calls 
  15386.  
  15387.       clnt_destroy() 
  15388.       clnt_pcreateerror() 
  15389.       clntraw_create() 
  15390.       clntudp_create() 
  15391.  
  15392.  
  15393. ΓòÉΓòÉΓòÉ 14.16. clntudp_create() ΓòÉΓòÉΓòÉ
  15394.  
  15395. The clntudp_create() call creates an RPC client transport handle for the remote 
  15396. program using UDP transport. 
  15397.  
  15398. Syntax 
  15399.  
  15400. #include <rpc\rpc.h>
  15401. #include <netdb.h>
  15402.  
  15403. CLIENT *
  15404. clntudp_create(addr, prognum, versnum, wait, sockp)
  15405. struct sockaddr_in *addr;
  15406. u_long prognum;
  15407. u_long versnum;
  15408. struct timeval wait;
  15409. int *sockp;
  15410.  
  15411. Parameters 
  15412.  
  15413.  addr 
  15414.    Pointer to the internet address of the remote program. If addr points to a 
  15415.    port number of 0, addr is set to the port on which the remote program is 
  15416.    receiving. The remote PORTMAP service is used for this. 
  15417.  
  15418.  prognum 
  15419.    Remote program number. 
  15420.  
  15421.  versnum 
  15422.    Version number of the remote program. 
  15423.  
  15424.  wait 
  15425.    Interval at which UDP resends the call request, until either a response is 
  15426.    received or the call times out. Set the time-out length using the 
  15427.    clnt_call() procedure. 
  15428.  
  15429.  sockp 
  15430.    Pointer to the socket. If sockp is RPC_ANYSOCK, this routine opens a new 
  15431.    socket and sets sockp. 
  15432.  
  15433.  Description 
  15434.  
  15435.  The clntudp_create() call creates a client transport handle for the remote 
  15436.  program (prognum) with version (versnum).  UDP is used as the transport layer. 
  15437.  
  15438.  Note:  Do not use this procedure with procedures that use large arguments or 
  15439.         return large results. UDP RPC messages can contain only 2K bytes of 
  15440.         encoded data. 
  15441.  
  15442.  Return Values 
  15443.  
  15444.  NULL indicates failure. 
  15445.  
  15446.  Examples 
  15447.  
  15448.   #define RMTPROGNUM   (u_long)0x3fffffffL
  15449.   #define RMTPROGVER   (u_long)0x1L
  15450.  
  15451.   register CLIENT *clnt;
  15452.   int sock = RPC_ANYSOCK; /* can be also valid socket descriptor */
  15453.   struct hostent *hp;
  15454.   struct timeval pertry_timeout;
  15455.   struct sockaddr_in server_addr;
  15456.  
  15457.   /* get the internet address of RPC server */
  15458.   if ((hp = gethostbyname("RPC_HOST") == NULL)
  15459.     {
  15460.      fprintf(stderr,"Can't get address for %s\n",argv[2]);
  15461.      exit (-1);
  15462.     }
  15463.  
  15464.   pertry_timeout.tv_sec = 3;
  15465.   pertry_timeout.tv_usec = 0;
  15466.   bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr, hp->h_length);
  15467.   server_addr.sin_family = AF_INET;
  15468.   server_addr.sin_port = 0;
  15469.  
  15470.   /* create UDP handle */
  15471.   if ((clnt = clntudp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  15472.                                   pertry_timeout, &sock)) == NULL)
  15473.      {
  15474.       clnt_pcreateerror("clntudp_create");
  15475.       exit(-1);
  15476.      }
  15477.  
  15478.  Related Calls 
  15479.  
  15480.       clnt_destroy() 
  15481.       clnt_pcreateerror() 
  15482.       clntraw_create() 
  15483.       clnttcp_create() 
  15484.  
  15485.  
  15486. ΓòÉΓòÉΓòÉ 14.17. get_myaddress() ΓòÉΓòÉΓòÉ
  15487.  
  15488. The get_myaddress() call returns the local host's internet address. 
  15489.  
  15490. Syntax 
  15491.  
  15492. #include <rpc\rpc.h>
  15493.  
  15494. void
  15495. get_myaddress(addr)
  15496. struct sockaddr_in *addr;
  15497.  
  15498. Parameters 
  15499.  
  15500.  addr 
  15501.    Pointer to the location where the local internet address is placed. 
  15502.  
  15503.  Description 
  15504.  
  15505.  The get_myaddress() call puts the local host's internet address into addr. The 
  15506.  port number (addr->sin_port) is set to htons (PMAPPORT), which is 111. 
  15507.  
  15508.  
  15509. ΓòÉΓòÉΓòÉ 14.18. getrpcbyname() ΓòÉΓòÉΓòÉ
  15510.  
  15511. The getrpcbyname() call returns an RPC program entry specified by a name in the 
  15512. RPC file. 
  15513.  
  15514. Syntax 
  15515.  
  15516. #include <rpcnetdb.h>
  15517.  
  15518. struct rpcent *getrpcbyname(name)
  15519. char  *name;
  15520.  
  15521. Parameters 
  15522.  
  15523.  name 
  15524.    Pointer to the specified RPC program. 
  15525.  
  15526.  Description 
  15527.  
  15528.  The getrpcbyname() call sequentially searches from the beginning of the 
  15529.  TCPIP\ETC\RPC file until it finds a matching RPC program name or encounters 
  15530.  EOF. 
  15531.  
  15532.  Return Values 
  15533.  
  15534.  The getrpcbyname() call returns a pointer to an object with the rpcent 
  15535.  structure for the RPC program specified on the call. The rpcent structure is 
  15536.  defined in the <RPC\RPCNETDB.H> header file and contains the following 
  15537.  elements: 
  15538.  
  15539.   Element       Description
  15540.  r_name        The name of the server for this RPC program 
  15541.  r_aliases     A zero terminated list of alternate names for the RPC program 
  15542.  r_number      The RPC program number for this service 
  15543.  
  15544.  The return value points to static data that later calls overwrite. A pointer 
  15545.  to an rpcent structure indicates success. A NULL pointer indicates an error or 
  15546.  EOF. 
  15547.  
  15548.  Related Calls 
  15549.  
  15550.       getrpcbynumber() 
  15551.       getrpcent() 
  15552.  
  15553.  
  15554. ΓòÉΓòÉΓòÉ 14.19. getrpcbynumber() ΓòÉΓòÉΓòÉ
  15555.  
  15556. The getrpcbynumber() call returns an RPC program entry specified by a number in 
  15557. the RPC file. 
  15558.  
  15559. Syntax 
  15560.  
  15561. #include <rpcnetdb.h>
  15562.  
  15563. struct rpcent *getrpcbynumber(number)
  15564. u_long number;
  15565.  
  15566. Parameters 
  15567.  
  15568.  number 
  15569.    RPC program number. 
  15570.  
  15571.  Description 
  15572.  
  15573.  The getrpcbynumber() call sequentially searches from the beginning of the 
  15574.  TCPIP\ETC\RPC file until it finds a matching RPC program number or encounters 
  15575.  EOF. 
  15576.  
  15577.  Return Values 
  15578.  
  15579.  The getrpcbynumber() call returns a pointer to an object with the rpcent 
  15580.  structure for the RPC program specified on the call. The rpcent structure is 
  15581.  defined in <RPC\RPCNETDB.H> header file and contains the following elements: 
  15582.  
  15583.   Element       Description
  15584.  r_name        The name of the server for this RPC program 
  15585.  r_aliases     A zero terminated list of alternate names for the RPC program 
  15586.  r_number      The RPC program number for this service 
  15587.  
  15588.  The return value points to static data that later calls overwrite. A pointer 
  15589.  to an rpcent structure indicates success. A NULL pointer indicates an error or 
  15590.  EOF. 
  15591.  
  15592.  Related Calls 
  15593.  
  15594.       getrpcbyname() 
  15595.       getrpcent() 
  15596.  
  15597.  
  15598. ΓòÉΓòÉΓòÉ 14.20. getrpcent() ΓòÉΓòÉΓòÉ
  15599.  
  15600. The getrpcent() call returns the next entry in the TCPIP\ETC\RPC file. 
  15601.  
  15602. Syntax 
  15603.  
  15604. #include <rpcnetdb.h>
  15605.  
  15606. struct rpcent *getrpcent()
  15607.  
  15608. Return Values 
  15609.  
  15610. The getrpcent() call returns a pointer to the next entry in the TCPIP\ETC\RPC 
  15611. file. The rpcent structure is defined in the <RPC\RPCNETDB.H> header file and 
  15612. contains the following elements: 
  15613.  
  15614.   Element       Description
  15615.  r_name        The name of the server for this RPC program 
  15616.  r_aliases     A zero terminated list of alternate names for the RPC program 
  15617.  r_number      The RPC program number for this service 
  15618.  
  15619.  The return value points to static data that later calls overwrite. A pointer 
  15620.  to an rpcent structure indicates success. A NULL pointer indicates an error or 
  15621.  EOF. 
  15622.  
  15623.  Related Calls 
  15624.  
  15625.       getrpcbyname() 
  15626.       getrpcbynumber() 
  15627.  
  15628.  
  15629. ΓòÉΓòÉΓòÉ 14.21. pmap_getmaps() ΓòÉΓòÉΓòÉ
  15630.  
  15631. The pmap_getmaps() call returns a list of current program-to-port mappings on a 
  15632. specified remote host's Portmapper. 
  15633.  
  15634. Syntax 
  15635.  
  15636. #include <rpc\rpc.h>
  15637.  
  15638. struct pmaplist *
  15639. pmap_getmaps(addr)
  15640. struct sockaddr_in *addr;
  15641.  
  15642. Parameters 
  15643.  
  15644.  addr 
  15645.    Pointer to the internet address of the remote host. 
  15646.  
  15647.  Description 
  15648.  
  15649.  The pmap_getmaps() call returns a list of current program-to-port mappings on 
  15650.  the remote host's Portmapper specified by addr. 
  15651.  
  15652.  Examples 
  15653.  
  15654.   struct hostent *hp;
  15655.   struct sockaddr_in pmapper_addr;
  15656.   struct pmaplist *my_pmaplist = NULL;
  15657.  
  15658.   if ((hp = gethostbyname("PMAP_HOST") == NULL)
  15659.     {
  15660.      fprintf(stderr,"Can't get address for %s\n","PMAP_HOST");
  15661.      exit (-1);
  15662.     }
  15663.  
  15664.   bcopy(hp->h_addr, (caddr_t)&pmapper_addr.sin_addr.s_addr, hp->h_length);
  15665.   pmapper_addr.sin_family = AF_INET;
  15666.   pmapper_addr.sin_port = 0;
  15667.  
  15668.   /*
  15669.    *  get the list of program, version, protocol and port number
  15670.    *  from remote portmapper
  15671.    *
  15672.    *     struct pmap {
  15673.    *              long unsigned pm_prog;
  15674.    *              long unsigned pm_vers;
  15675.    *              long unsigned pm_prot;
  15676.    *              long unsigned pm_port;
  15677.    *             };
  15678.  
  15679.    *     struct pmaplist {
  15680.    *             struct pmap     pml_map;
  15681.    *             struct pmaplist *pml_next;
  15682.    *            };
  15683.    */
  15684.    my_pmaplist = pmap_getmaps(&pmapper_addr);
  15685.    ...
  15686.  
  15687.  Related Calls 
  15688.  
  15689.       pmap_getport() 
  15690.       pmap_rmtcall() 
  15691.       pmap_set() 
  15692.       pmap_unset() 
  15693.  
  15694.  
  15695. ΓòÉΓòÉΓòÉ 14.22. pmap_getport() ΓòÉΓòÉΓòÉ
  15696.  
  15697. The pmap_getport() call returns the port number associated with the remote 
  15698. program (prognum), the version (versnum), and the transport protocol 
  15699. (protocol). 
  15700.  
  15701. Syntax 
  15702.  
  15703. #include <rpc\rpc.h>
  15704.  
  15705. u_short
  15706. pmap_getport(addr, prognum, versnum, protocol)
  15707. struct sockaddr_in *addr;
  15708. u_long prognum;
  15709. u_long versnum;
  15710. u_long protocol;
  15711.  
  15712. Parameters 
  15713.  
  15714.  addr 
  15715.    Pointer to the internet address of the remote host. 
  15716.  
  15717.  prognum 
  15718.    Program number to be mapped. 
  15719.  
  15720.  versnum 
  15721.    Version number of the program to be mapped. 
  15722.  
  15723.  protocol 
  15724.    Transport protocol used by the program. 
  15725.  
  15726.  Return Values 
  15727.  
  15728.  The value 0 indicates that the mapping does not exist or that the remote 
  15729.  PORTMAP could not be contacted. If Portmapper cannot be contacted, 
  15730.  rpc_createerr contains the RPC status. 
  15731.  
  15732.  Related Calls 
  15733.  
  15734.       pmap_getmaps() 
  15735.       pmap_rmtcall() 
  15736.       pmap_set() 
  15737.       pmap_unset() 
  15738.  
  15739.  
  15740. ΓòÉΓòÉΓòÉ 14.23. pmap_rmtcall() ΓòÉΓòÉΓòÉ
  15741.  
  15742. The pmap_rmtcall() call instructs Portmapper to make an RPC call to a procedure 
  15743. on a host on your behalf. Use this procedure only for ping-type functions. 
  15744.  
  15745. Syntax 
  15746.  
  15747. #include <rpc\rpc.h>
  15748. #include <netdb.h>
  15749.  
  15750. enum clnt_stat
  15751. pmap_rmtcall(addr, prognum, versnum, procnum, inproc, in,
  15752.              outproc, out, tout, portp)
  15753. struct sockaddr_in *addr;
  15754. u_long prognum;
  15755. u_long versnum;
  15756. u_long procnum;
  15757. xdrproc_t inproc;
  15758. char *in;
  15759. xdrproc_t outproc;
  15760. char *out;
  15761. struct timeval tout;
  15762. u_long *portp;
  15763.  
  15764. Parameters 
  15765.  
  15766.  addr 
  15767.    Pointer to the internet address of the foreign host. 
  15768.  
  15769.  prognum 
  15770.    Remote program number. 
  15771.  
  15772.  versnum 
  15773.    Version number of the remote program. 
  15774.  
  15775.  procnum 
  15776.    Procedure to be called. 
  15777.  
  15778.  inproc 
  15779.    XDR procedure that encodes the arguments of the remote procedure. 
  15780.  
  15781.  in 
  15782.    Pointer to the arguments of the remote procedure. 
  15783.  
  15784.  outproc 
  15785.    XDR procedure that decodes the results of the remote procedure. 
  15786.  
  15787.  out 
  15788.    Pointer to the results of the remote procedure. 
  15789.  
  15790.  tout 
  15791.    Time-out period for the remote request. 
  15792.  
  15793.  portp 
  15794.    Port number of the triple (prognum, versnum, procnum), if the call from the 
  15795.    remote PORTMAP service succeeds. 
  15796.  
  15797.  Return Values 
  15798.  
  15799.  RPC_SUCCESS indicates success; otherwise, an error has occurred. The results 
  15800.  of the remote procedure call return to out. 
  15801.  
  15802.  Examples 
  15803.  
  15804.   int inproc, outproc,rc;
  15805.   u_long portp;
  15806.   struct timeval total_timeout;
  15807.   struct sockaddr_in *addr;
  15808.   ...
  15809.   get_myaddress(addr);
  15810.   ...
  15811.   total_timeout.tv_sec = 20;
  15812.   total_timeout.tv_usec = 0;
  15813.  
  15814.   rc = pmap_rmtcall(addr,RMTPROGNUM,RMTPROGVER,RMTPROCNUM,xdr_int,
  15815.   &inproc,xdr_int,&outproc,total_timeout,&portp);
  15816.   if (rc != 0)
  15817.    {
  15818.     fprintf(stderr,"error: pmap_rmtcall() failed: %d \n",rc);
  15819.     clnt_perrno(rc);
  15820.     exit(1);
  15821.    }
  15822.  
  15823.  Related Calls 
  15824.  
  15825.       pmap_getmaps() 
  15826.       pmap_getport() 
  15827.       pmap_set() 
  15828.       pmap_unset() 
  15829.  
  15830.  
  15831. ΓòÉΓòÉΓòÉ 14.24. pmap_set() ΓòÉΓòÉΓòÉ
  15832.  
  15833. The pmap_set() call sets the mapping of the program (specified by prognum, 
  15834. versnum, and protocol) to port on the local machine's Portmapper. This 
  15835. procedure is automatically called by the svc_register() procedure. 
  15836.  
  15837. Syntax 
  15838.  
  15839. #include <rpc\rpc.h>
  15840.  
  15841. bool_t
  15842. pmap_set(prognum, versnum, protocol, port)
  15843. u_long prognum;
  15844. u_long versnum;
  15845. u_long protocol;
  15846. u_short port;
  15847.  
  15848. Parameters 
  15849.  
  15850.  prognum 
  15851.    Local program number. 
  15852.  
  15853.  versnum 
  15854.    Version number of the local program. 
  15855.  
  15856.  protocol 
  15857.    Transport protocol used by the local program. 
  15858.  
  15859.  port 
  15860.    Port to which the local program is mapped. 
  15861.  
  15862.  Return Values 
  15863.  
  15864.  The value 1 indicates success; the value 0 indicates an error. 
  15865.  
  15866.  Related Calls 
  15867.  
  15868.       pmap_getmaps() 
  15869.       pmap_getport() 
  15870.       pmap_rmtcall() 
  15871.       pmap_unset() 
  15872.  
  15873.  
  15874. ΓòÉΓòÉΓòÉ 14.25. pmap_unset() ΓòÉΓòÉΓòÉ
  15875.  
  15876. The pmap_unset() call removes the mappings associated with prognum and versnum 
  15877. on the local machine's Portmapper. All ports for each transport protocol 
  15878. currently mapping the prognum and versnum are removed from the PORTMAP service. 
  15879.  
  15880. Syntax 
  15881.  
  15882. #include <rpc\rpc.h>
  15883.  
  15884. bool_t
  15885. pmap_unset(prognum, versnum)
  15886. u_long prognum;
  15887. u_long versnum;
  15888.  
  15889. Parameters 
  15890.  
  15891.  prognum 
  15892.    Local program number. 
  15893.  
  15894.  versnum 
  15895.    Version number of the local program. 
  15896.  
  15897.  Return Values 
  15898.  
  15899.  The value 1 indicates success; the value 0 indicates an error. 
  15900.  
  15901.  Examples 
  15902.  
  15903.   #define RMTPROGNUM   (u_long)0x3fffffffL
  15904.   #define RMTPROGVER   (u_long)0x1L
  15905.   ...
  15906.   /* remove the mapping of remote program */
  15907.   /* and its port from local Portmapper   */
  15908.   pmap_unset(RMTPROGNUM, RMTPROGVER);
  15909.   ...
  15910.  
  15911.  Related Calls 
  15912.  
  15913.       pmap_getmaps() 
  15914.       pmap_getport() 
  15915.       pmap_rmtcall() 
  15916.       pmap_set() 
  15917.  
  15918.  
  15919. ΓòÉΓòÉΓòÉ 14.26. registerrpc() ΓòÉΓòÉΓòÉ
  15920.  
  15921. The registerrpc() call registers a procedure with the local Portmapper and 
  15922. creates a control structure to remember the server procedure and its XDR 
  15923. routine. The svc_run() call uses the control structure. Procedures registered 
  15924. using registerrpc() are accessed using the UDP transport layer. 
  15925.  
  15926. Syntax 
  15927.  
  15928. #include <rpc\rpc.h>
  15929.  
  15930. int
  15931. registerrpc(prognum, versnum, procnum, procname, inproc, outproc)
  15932. u_long prognum;
  15933. u_long versnum;
  15934. u_long procnum;
  15935. char *(*procname) ();
  15936. xdrproc_t inproc;
  15937. xdrproc_t outproc;
  15938.  
  15939. Parameters 
  15940.  
  15941.  prognum 
  15942.    Program number to register. 
  15943.  
  15944.  versnum 
  15945.    Version number to register. 
  15946.  
  15947.  procnum 
  15948.    Procedure number to register. 
  15949.  
  15950.  procname 
  15951.    Procedure that is called when the registered program is requested. procname 
  15952.    must accept a pointer to its arguments and return a static pointer to its 
  15953.    results. 
  15954.  
  15955.  inproc 
  15956.    XDR procedure that decodes the arguments. 
  15957.  
  15958.  outproc 
  15959.    XDR procedure that encodes the results. 
  15960.  
  15961.  Note:  You cannot use xdr_enum() as an argument to registerrpc(). See 
  15962.         xdr_enum() for more information. 
  15963.  
  15964.  Return Values 
  15965.  
  15966.  The value 0 indicates success; the value -1 indicates an error. 
  15967.  
  15968.  Examples 
  15969.  
  15970.   #define RMTPROGNUM (u_long)0x3fffffffL
  15971.   #define RMTPROGVER (u_long)0x1
  15972.   #define RMTPROCNUM (u_long)0x1
  15973.  
  15974.   main()
  15975.    {
  15976.     int *rmtprog();
  15977.  
  15978.     /* register remote program with Portmapper */
  15979.     registerrpc(RMTPROGNUM, RMTPROGVER, RMTPROCNUM, rmtprog,
  15980.     xdr_int, xdr_int);
  15981.  
  15982.     /* infinite loop, waits for RPC request from client */
  15983.     svc_run();
  15984.     printf("Error: svc_run should never reach this point \n");
  15985.     exit(1);
  15986.    }
  15987.  
  15988.   int *
  15989.   rmtprog(inproc)          /* remote program */
  15990.   int *inproc;
  15991.  
  15992.   {
  15993.    int *outproc;
  15994.    ...
  15995.    /* Process request */
  15996.    ...
  15997.    return (outproc);
  15998.   }
  15999.  
  16000.  Related Calls 
  16001.  
  16002.       svc_register() 
  16003.       svc_run() 
  16004.  
  16005.  
  16006. ΓòÉΓòÉΓòÉ 14.27. rpc_createerr ΓòÉΓòÉΓòÉ
  16007.  
  16008. The rpc_createerr global variable is set when any RPC client creation routine 
  16009. fails. Use clnt_pcreateerror() to print the message. 
  16010.  
  16011. Syntax 
  16012.  
  16013. #include <rpc\rpc.h>
  16014.  
  16015. struct  rpc_createerr rpc_createerr;
  16016.  
  16017.  
  16018. ΓòÉΓòÉΓòÉ 14.28. svc_destroy() ΓòÉΓòÉΓòÉ
  16019.  
  16020. The svc_destroy() call deletes the RPC service transport handle xprt, which 
  16021. becomes undefined after this routine is called. 
  16022.  
  16023. Syntax 
  16024.  
  16025. #include <rpc\rpc.h>
  16026.  
  16027. void
  16028. svc_destroy(xprt)
  16029. SVCXPRT *xprt;
  16030.  
  16031. Parameter 
  16032.  
  16033.  xprt 
  16034.    Pointer to the service transport handle. 
  16035.  
  16036.  Related Calls 
  16037.  
  16038.       svcraw_create() 
  16039.       svctcp_create() 
  16040.       svcudp_create() 
  16041.  
  16042.  
  16043. ΓòÉΓòÉΓòÉ 14.29. svc_freeargs() ΓòÉΓòÉΓòÉ
  16044.  
  16045. The svc_freeargs() call frees storage allocated to decode the arguments 
  16046. received by svc_getargs(). 
  16047.  
  16048. Syntax 
  16049.  
  16050. #include <rpc\rpc.h>
  16051.  
  16052. bool_t
  16053. svc_freeargs(xprt, inproc, in)
  16054. SVCXPRT *xprt;
  16055. xdrproc_t inproc;
  16056. char *in;
  16057.  
  16058. Parameters 
  16059.  
  16060.  xprt 
  16061.    Pointer to the service transport handle. 
  16062.  
  16063.  inproc 
  16064.    XDR routine that decodes the arguments. 
  16065.  
  16066.  in 
  16067.    Pointer to the input arguments. 
  16068.  
  16069.  Return Values 
  16070.  
  16071.  The value 1 indicates success; the value 0 indicates an error. 
  16072.  
  16073.  Related Calls 
  16074.  
  16075.       svc_getargs() 
  16076.  
  16077.  
  16078. ΓòÉΓòÉΓòÉ 14.30. svc_getargs() ΓòÉΓòÉΓòÉ
  16079.  
  16080. The svc_getargs() call uses the XDR routine inproc to decode the arguments of 
  16081. an RPC request associated with the RPC service transport handle xprt. The 
  16082. results are placed at address in. 
  16083.  
  16084. Syntax 
  16085.  
  16086. #include <rpc\rpc.h>
  16087.  
  16088. bool_t
  16089. svc_getargs(xprt, inproc, in)
  16090. SVCXPRT *xprt;
  16091. xdrproc_t inproc;
  16092. char *in;
  16093.  
  16094. Parameters 
  16095.  
  16096.  xprt 
  16097.    Pointer to the service transport handle. 
  16098.  
  16099.  inproc 
  16100.    XDR routine that decodes the arguments. 
  16101.  
  16102.  in 
  16103.    Pointer to the decoded arguments. 
  16104.  
  16105.  Return Values 
  16106.  
  16107.  The value 1 indicates success; the value 0 indicates an error. 
  16108.  
  16109.  Examples 
  16110.  
  16111.   #define RMTPROGNUM   (u_long)0x3fffffffL
  16112.   #define RMTPROGVER   (u_long)0x1L
  16113.  
  16114.   ...
  16115.  
  16116.   SVCXPRT *transp;
  16117.  
  16118.   transp = svcudp_create(RPC_ANYSOCK);
  16119.   if (transp == NULL)
  16120.      {
  16121.       fprintf(stderr, "can't create an RPC server transport\n");
  16122.       exit(-1);
  16123.      }
  16124.   pmap_unset(RMTPROGNUM, RMTPROGVER);
  16125.   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  16126.      {
  16127.       fprintf(stderr, "can't register rmtprog() service\n");
  16128.       exit(-1);
  16129.      }
  16130.   printf("rmtprog() service registered.\n");
  16131.  
  16132.   svc_run();
  16133.   printf("Error:svc_run should never reach this point \n");
  16134.   exit(1);
  16135.   ...
  16136.  
  16137.   rmtprog(rqstp, transp)
  16138.   struct svc_req *rqstp;
  16139.   SVCXPRT *transp;
  16140.   {
  16141.       int intrecv;
  16142.  
  16143.       switch((int)rqstp->rq_proc)
  16144.          {
  16145.              case PROCNUM1:
  16146.                       svc_getargs(transp, xdr_int, &intrecv);
  16147.                         ...
  16148.                       return;
  16149.              case PROCNUM2:
  16150.                ...
  16151.          }
  16152.   ...
  16153.   }
  16154.  
  16155.  Related Calls 
  16156.  
  16157.       svc_freeargs() 
  16158.  
  16159.  
  16160. ΓòÉΓòÉΓòÉ 14.31. svc_getcaller() ΓòÉΓòÉΓòÉ
  16161.  
  16162. The svc_getcaller() call gets the network address of the client associated with 
  16163. the service transport handle. 
  16164.  
  16165. Syntax 
  16166.  
  16167. #include <rpc\rpc.h>
  16168.  
  16169. struct sockaddr_in *
  16170. svc_getcaller(xprt)
  16171. SVCXPRT *xprt;
  16172.  
  16173. Parameters 
  16174.  
  16175.  xprt 
  16176.    Pointer to the service transport handle. 
  16177.  
  16178.  
  16179. ΓòÉΓòÉΓòÉ 14.32. svc_getreq() ΓòÉΓòÉΓòÉ
  16180.  
  16181. The svc_getreq() call implements asynchronous event processing and returns 
  16182. control to the program after all sockets have been serviced. 
  16183.  
  16184. Syntax 
  16185.  
  16186. #include <rpc\rpc.h>
  16187.  
  16188. void
  16189. svc_getreq(socks, noavail)
  16190. int socks[];
  16191. int noavail;
  16192.  
  16193. Parameters 
  16194.  
  16195.  socks 
  16196.    Array of socket descriptors. 
  16197.  
  16198.  noavail 
  16199.    Integer specifying the number of socket descriptors in the array. 
  16200.  
  16201.  Description 
  16202.  
  16203.  Use the svc_getreq() call rather than svc_run() to do asynchronous event 
  16204.  processing. The routine returns control to the program when all sockets in the 
  16205.  socks array have been serviced. 
  16206.  
  16207.  Related Calls 
  16208.  
  16209.       svc_run() 
  16210.       svc_socks[ ] 
  16211.  
  16212.  
  16213. ΓòÉΓòÉΓòÉ 14.33. svc_register() ΓòÉΓòÉΓòÉ
  16214.  
  16215. The svc_register() call registers procedures on the local Portmapper. 
  16216.  
  16217. Syntax 
  16218.  
  16219. #include <rpc\rpc.h>
  16220. #include <netdb.h>
  16221.  
  16222. bool_t
  16223. svc_register(xprt, prognum, versnum, dispatch, protocol)
  16224. SVCXPRT *xprt;
  16225. u_long prognum;
  16226. u_long versnum;
  16227. void (*dispatch) ();
  16228. int protocol;
  16229.  
  16230. Parameters 
  16231.  
  16232.  xprt 
  16233.    Pointer to the service transport handle. 
  16234.  
  16235.  prognum 
  16236.    Program number to be registered. 
  16237.  
  16238.  versnum 
  16239.    Version number of the program to be registered. 
  16240.  
  16241.  dispatch 
  16242.    Dispatch routine associated with prognum and versnum. The structure of the 
  16243.    dispatch routine is as follows: 
  16244.  
  16245.       dispatch(request, xprt)
  16246.       struct svc_req *request;
  16247.       SVCXPRT *xprt;
  16248.  
  16249.  protocol 
  16250.    Protocol used. The value is generally one of the following: 
  16251.  
  16252.        0 (zero) 
  16253.        IPPROTO_UDP 
  16254.        IPPROTO_TCP When you use a value of 0, the service is not registered 
  16255.    with Portmapper. 
  16256.  
  16257.  Description 
  16258.  
  16259.  The svc_register() call associates the specified program with the service 
  16260.  dispatch routine dispatch. 
  16261.  
  16262.  Note:  When you use a toy RPC service transport created with svcraw_create(), 
  16263.         make a call to xprt_register() immediately after a call to 
  16264.         svc_register(). 
  16265.  
  16266.  Return Values 
  16267.  
  16268.  The value 1 indicates success; the value 0 indicates an error. 
  16269.  
  16270.  Examples 
  16271.  
  16272.   #define RMTPROGNUM   (u_long)0x3fffffffL
  16273.   #define RMTPROGVER   (u_long)0x1L
  16274.  
  16275.   SVCXPRT *transp;
  16276.  
  16277.   /* register the remote program with local Portmapper */
  16278.   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  16279.         {
  16280.          fprintf(stderr, "can't register rmtprog() service\n");
  16281.          exit(-1);
  16282.         }
  16283.  
  16284.   /* code for remote program; rmtprog  */
  16285.   rmtprog(rqstp, transp)
  16286.   struct svc_req *rqstp;
  16287.   SVCXPRT *transp;
  16288.     {
  16289.        ...
  16290.     }
  16291.  
  16292.  Related Calls 
  16293.  
  16294.       registerrpc() 
  16295.       svc_unregister() 
  16296.       xprt_register() 
  16297.  
  16298.  
  16299. ΓòÉΓòÉΓòÉ 14.34. svc_run() ΓòÉΓòÉΓòÉ
  16300.  
  16301. The svc_run() call accepts RPC requests and calls the appropriate service using 
  16302. svc_getreq(). The svc_run() call does not return control to the caller. 
  16303.  
  16304. Syntax 
  16305.  
  16306. #include <rpc\rpc.h>
  16307.  
  16308. void
  16309. svc_run()
  16310.  
  16311. Examples 
  16312.  
  16313. #define RMTPROGNUM   (u_long)0x3fffffffL
  16314. #define RMTPROGVER   (u_long)0x1L
  16315.  
  16316. ...
  16317.  
  16318. SVCXPRT *transp;
  16319.  
  16320. transp = svcudp_create(RPC_ANYSOCK);
  16321. if (transp == NULL)
  16322.    {
  16323.     fprintf(stderr, "can't create an RPC server transport\n");
  16324.     exit(-1);
  16325.    }
  16326. pmap_unset(RMTPROGNUM, RMTPROGVER);
  16327. if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  16328.    {
  16329.     fprintf(stderr, "can't register rmtprog() service\n");
  16330.     exit(-1);
  16331.    }
  16332. printf("rmtprog() service registered.\n");
  16333.  
  16334. svc_run();
  16335.  
  16336. printf("Error:svc_run should never reach this point \n");
  16337. exit(1);
  16338. ...
  16339.  
  16340. rmtprog(rqstp, transp)
  16341. struct svc_req *rqstp;
  16342. SVCXPRT *transp;
  16343.  {
  16344.  ...
  16345.  }
  16346.  
  16347. Related Calls 
  16348.  
  16349.       registerrpc() 
  16350.       svc_getreq() 
  16351.  
  16352.  
  16353. ΓòÉΓòÉΓòÉ 14.35. svc_sendreply() ΓòÉΓòÉΓòÉ
  16354.  
  16355. The svc_sendreply() call sends the results of an RPC to the caller. 
  16356.  
  16357. Syntax 
  16358.  
  16359. #include <rpc\rpc.h>
  16360.  
  16361. bool_t
  16362. svc_sendreply(xprt, outproc, out)
  16363. SVCXPRT *xprt;
  16364. xdrproc_t outproc;
  16365. char *out;
  16366.  
  16367. Parameters 
  16368.  
  16369.  xprt 
  16370.    Pointer to the caller's transport handle. 
  16371.  
  16372.  outproc 
  16373.    XDR procedure that encodes the results. 
  16374.  
  16375.  out 
  16376.    Pointer to the results. 
  16377.  
  16378.  Description 
  16379.  
  16380.  The service dispatch routine calls the svc_sendreply() call to send the 
  16381.  results of the call to the caller. 
  16382.  
  16383.  Return Values 
  16384.  
  16385.  The value 1 indicates success; the value 0 indicates an error. 
  16386.  
  16387.  Examples 
  16388.  
  16389.   #define RMTPROGNUM   (u_long)0x3fffffffL
  16390.   #define RMTPROGVER   (u_long)0x1L
  16391.  
  16392.   ...
  16393.  
  16394.   SVCXPRT *transp;
  16395.  
  16396.   transp = svcudp_create(RPC_ANYSOCK);
  16397.   if (transp == NULL)
  16398.      {
  16399.       fprintf(stderr, "can't create an RPC server transport\n");
  16400.       exit(-1);
  16401.      }
  16402.   pmap_unset(RMTPROGNUM, RMTPROGVER);
  16403.   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  16404.      {
  16405.       fprintf(stderr, "can't register rmtprog() service\n");
  16406.       exit(-1);
  16407.      }
  16408.   printf("rmtprog() service registered.\n");
  16409.  
  16410.   svc_run();
  16411.  
  16412.   printf("Error:svc_run should never reach this point \n");
  16413.   exit(1);
  16414.   ...
  16415.  
  16416.  
  16417.   rmtprog(rqstp, transp)
  16418.   struct svc_req *rqstp;
  16419.   SVCXPRT *transp;
  16420.   {
  16421.  
  16422.       int intrecv;
  16423.       int replysend;
  16424.       switch((int)rqstp->rq_proc)
  16425.        {
  16426.           case PROCNUM0:
  16427.              svc_getargs(transp, xdr_int, &intrecv);
  16428.                         ...
  16429.              /* process intrecv parameter */
  16430.              replysend = ( intrecv * 1000) + 100;
  16431.              /*  send reply to client */
  16432.              if (!svc_sendreply(transp, xdr_int, &replysend))
  16433.                 {
  16434.                  fprintf(stderr,"can't reply to RPC call\n");
  16435.                  exit(-1);
  16436.                 }
  16437.              return;
  16438.           case PROCNUM1:
  16439.              ...
  16440.        }
  16441.   ...
  16442.   }
  16443.  
  16444.  
  16445. ΓòÉΓòÉΓòÉ 14.36. svc_socks[ ] ΓòÉΓòÉΓòÉ
  16446.  
  16447. The array svc_socks[ ] is an array of socket descriptors being serviced. The 
  16448. integer noregistered specifies the number of socket descriptors in 
  16449. svc_socks[ ]. 
  16450.  
  16451. Syntax 
  16452.  
  16453. #include <rpc\rpc.h>
  16454.  
  16455. int svc_socks[ ];
  16456.  
  16457. #include <rpc\rpc.h>
  16458.  
  16459. int noregistered;
  16460.  
  16461. Related Calls 
  16462.  
  16463.       svc_getreq() 
  16464.  
  16465.  
  16466. ΓòÉΓòÉΓòÉ 14.37. svc_unregister() ΓòÉΓòÉΓòÉ
  16467.  
  16468. The svc_unregister() call removes all local mappings of prognum versnum to 
  16469. dispatch routines (prognum, versnum, *) and to port numbers. 
  16470.  
  16471. Syntax 
  16472.  
  16473. #include <rpc\rpc.h>
  16474.  
  16475. void
  16476. svc_unregister(prognum, versnum)
  16477. u_long prognum;
  16478. u_long versnum;
  16479.  
  16480. Parameters 
  16481.  
  16482.  prognum 
  16483.    Program number of the removed program. 
  16484.  
  16485.  versnum 
  16486.    Version number of the removed program. 
  16487.  
  16488.  Examples 
  16489.  
  16490.   #define RMTPROGNUM   (u_long)0x3fffffffL
  16491.   #define RMTPROGVER   (u_long)0x1L
  16492.   ...
  16493.     /* unregister remote program from local Portmapper */
  16494.     svc_unregister(RMTPROGNUM, RMTPROGVER);
  16495.   ...
  16496.  
  16497.  Related Calls 
  16498.  
  16499.       svc_register() 
  16500.  
  16501.  
  16502. ΓòÉΓòÉΓòÉ 14.38. svcerr_auth() ΓòÉΓòÉΓòÉ
  16503.  
  16504. The svcerr_auth() call sends an error reply when the service dispatch routine 
  16505. cannot execute an RPC request because of authentication errors. 
  16506.  
  16507. Syntax 
  16508.  
  16509. #include <rpc\rpc.h>
  16510.  
  16511. void
  16512. svcerr_auth(xprt, why)
  16513. SVCXPRT *xprt;
  16514. enum auth_stat why;
  16515.  
  16516. Parameters 
  16517.  
  16518.  xprt 
  16519.    Pointer to the service transport handle. 
  16520.  
  16521.  why 
  16522.    Reason why the call is refused. 
  16523.  
  16524.  Description 
  16525.  
  16526.  A service dispatch routine that refuses to run an RPC request because of 
  16527.  authentication errors calls svcerr_auth(). 
  16528.  
  16529.  Related Calls 
  16530.  
  16531.       svcerr_decode() 
  16532.       svcerr_noproc() 
  16533.       svcerr_noprog() 
  16534.       svcerr_progvers() 
  16535.       svcerr_systemerr() 
  16536.       svcerr_weakauth() 
  16537.  
  16538.  
  16539. ΓòÉΓòÉΓòÉ 14.39. svcerr_decode() ΓòÉΓòÉΓòÉ
  16540.  
  16541. The svcerr_decode() call sends an error reply when the service dispatch routine 
  16542. cannot decode its parameters. 
  16543.  
  16544. Syntax 
  16545.  
  16546. #include <rpc\rpc.h>
  16547.  
  16548. void
  16549. svcerr_decode(xprt)
  16550. SVCXPRT *xprt;
  16551.  
  16552. Parameters 
  16553.  
  16554.  xprt 
  16555.    Pointer to the service transport handle. 
  16556.  
  16557.  Description 
  16558.  
  16559.  A service dispatch routine that cannot decode its parameters calls 
  16560.  svcerr_decode(). 
  16561.  
  16562.  Related Calls 
  16563.  
  16564.       svcerr_auth() 
  16565.       svcerr_noproc() 
  16566.       svcerr_noprog() 
  16567.       svcerr_progvers() 
  16568.       svcerr_systemerr() 
  16569.       svcerr_weakauth() 
  16570.  
  16571.  
  16572. ΓòÉΓòÉΓòÉ 14.40. svcerr_noproc() ΓòÉΓòÉΓòÉ
  16573.  
  16574. The svcerr_noproc() call sends an error reply when the service dispatch routine 
  16575. cannot call the procedure requested. 
  16576.  
  16577. Syntax 
  16578.  
  16579. #include <rpc\rpc.h>
  16580.  
  16581. void
  16582. svcerr_noproc(xprt)
  16583. SVCXPRT *xprt;
  16584.  
  16585. Parameters 
  16586.  
  16587.  xprt 
  16588.    Pointer to the service transport handle. 
  16589.  
  16590.  Description 
  16591.  
  16592.  A service dispatch routine that does not implement the requested procedure 
  16593.  calls the svcerr_noproc() call. 
  16594.  
  16595.  Related Calls 
  16596.  
  16597.       svcerr_auth() 
  16598.       svcerr_decode() 
  16599.       svcerr_noprog() 
  16600.       svcerr_progvers() 
  16601.       svcerr_systemerr() 
  16602.       svcerr_weakauth() 
  16603.  
  16604.  
  16605. ΓòÉΓòÉΓòÉ 14.41. svcerr_noprog() ΓòÉΓòÉΓòÉ
  16606.  
  16607. The svcerr_noprog() call sends an error code when the requested program is not 
  16608. registered. 
  16609.  
  16610. Syntax 
  16611.  
  16612. #include <rpc\rpc.h>
  16613.  
  16614. void
  16615. svcerr_noprog(xprt)
  16616. SVCXPRT *xprt;
  16617.  
  16618. Parameters 
  16619.  
  16620.  xprt 
  16621.    Pointer to the service transport handle. 
  16622.  
  16623.  Description 
  16624.  
  16625.  Use the svcerr_noprog() call when the desired program is not registered. 
  16626.  
  16627.  Related Calls 
  16628.  
  16629.       svcerr_auth() 
  16630.       svcerr_decode() 
  16631.       svcerr_noproc() 
  16632.       svcerr_progvers() 
  16633.       svcerr_systemerr() 
  16634.       svcerr_weakauth() 
  16635.  
  16636.  
  16637. ΓòÉΓòÉΓòÉ 14.42. svcerr_progvers() ΓòÉΓòÉΓòÉ
  16638.  
  16639. The svcerr_progvers() call sends the low version number and high version number 
  16640. of RPC service when the version numbers of two RPC programs do not match. 
  16641.  
  16642. Syntax 
  16643.  
  16644. #include <rpc\rpc.h>
  16645.  
  16646. void
  16647. svcerr_progvers(xprt, low_vers, high_vers)
  16648. SVCXPRT *xprt;
  16649. u_long low_vers;
  16650. u_long high_vers;
  16651.  
  16652. Parameters 
  16653.  
  16654.  xprt 
  16655.    Pointer to the service transport handle. 
  16656.  
  16657.  low_vers 
  16658.    Low version number. 
  16659.  
  16660.  high_vers 
  16661.    High version number. 
  16662.  
  16663.  Description 
  16664.  
  16665.  A service dispatch routine calls the svcerr_progvers() call when the version 
  16666.  numbers of two RPC programs do not match. The call sends the supported low 
  16667.  version and high version of RPC service. 
  16668.  
  16669.  Related Calls 
  16670.  
  16671.       svcerr_decode() 
  16672.       svcerr_noproc() 
  16673.       svcerr_noprog() 
  16674.       svcerr_systemerr() 
  16675.       svcerr_weakauth() 
  16676.  
  16677.  
  16678. ΓòÉΓòÉΓòÉ 14.43. svcerr_systemerr() ΓòÉΓòÉΓòÉ
  16679.  
  16680. The svcerr_systemerr() call sends an error reply when the service dispatch 
  16681. routine detects a system error that has not been handled. 
  16682.  
  16683. Syntax 
  16684.  
  16685. #include <rpc\rpc.h>
  16686.  
  16687. void
  16688. svcerr_systemerr(xprt)
  16689. SVCXPRT *xprt;
  16690.  
  16691. Parameters 
  16692.  
  16693.  xprt 
  16694.    Pointer to the service transport handle. 
  16695.  
  16696.  Description 
  16697.  
  16698.  A service dispatch routine calls the svcerr_systemerr() call when it detects a 
  16699.  system error that is not handled by the protocol. 
  16700.  
  16701.  Related Calls 
  16702.  
  16703.       svcerr_auth() 
  16704.       svcerr_decode() 
  16705.       svcerr_noproc() 
  16706.       svcerr_noprog() 
  16707.       svcerr_progvers() 
  16708.       svcerr_weakauth() 
  16709.  
  16710.  
  16711. ΓòÉΓòÉΓòÉ 14.44. svcerr_weakauth() ΓòÉΓòÉΓòÉ
  16712.  
  16713. The svcerr_weakauth() call sends an error reply when the service dispatch 
  16714. routine cannot run an RPC because of weak authentication parameters. 
  16715.  
  16716. Syntax 
  16717.  
  16718. #include <rpc\rpc.h>
  16719.  
  16720. void
  16721. svcerr_progvers(xprt)
  16722. SVCXPRT *xprt;
  16723.  
  16724. Parameters 
  16725.  
  16726.  xprt 
  16727.    Pointer to the service transport handle. 
  16728.  
  16729.  Description 
  16730.  
  16731.  A service dispatch routine calls the svcerr_weakauth() call when it cannot run 
  16732.  an RPC because of correct but weak authentication parameters 
  16733.  
  16734.  Note:  This is the equivalent of svcerr_auth(xprt, AUTH_TOOWEAK). 
  16735.  
  16736.  Related Calls 
  16737.  
  16738.       svcerr_auth() 
  16739.       svcerr_decode() 
  16740.       svcerr_noproc() 
  16741.       svcerr_noprog() 
  16742.       svcerr_progvers() 
  16743.       svcerr_systemerr() 
  16744.  
  16745.  
  16746. ΓòÉΓòÉΓòÉ 14.45. svcraw_create() ΓòÉΓòÉΓòÉ
  16747.  
  16748. The svcraw_create() call creates a local RPC service transport handle to 
  16749. simulate RPC programs within one host. 
  16750.  
  16751. Syntax 
  16752.  
  16753. #include <rpc\rpc.h>
  16754.  
  16755. SVCXPRT *
  16756. svcraw_create()
  16757.  
  16758. Description 
  16759.  
  16760. The svcraw_create() call creates a local RPC service transport used for 
  16761. timings, to which it returns a pointer. Because messages are passed using a 
  16762. buffer within the address space of the local process, the client process must 
  16763. also use the same address space. This allows the simulation of RPC programs 
  16764. within one host. See clntraw_create() for more information. 
  16765.  
  16766. Return Values 
  16767.  
  16768. NULL indicates failure. 
  16769.  
  16770. Related Calls 
  16771.  
  16772.       clntraw_create() 
  16773.       svc_destroy() 
  16774.       svctcp_create() 
  16775.       svcudp_create() 
  16776.  
  16777.  
  16778. ΓòÉΓòÉΓòÉ 14.46. svctcp_create() ΓòÉΓòÉΓòÉ
  16779.  
  16780. The svctcp_create() call creates a TCP-based service transport. 
  16781.  
  16782. Syntax 
  16783.  
  16784. #include <rpc\rpc.h>
  16785.  
  16786. SVCXPRT *
  16787. svctcp_create(sock, send_buf_size, recv_buf_size)
  16788. int sock;
  16789. u_int send_buf_size;
  16790. u_int recv_buf_size;
  16791.  
  16792. Parameters 
  16793.  
  16794.  sock 
  16795.    Socket descriptor. If sock is RPC_ANYSOCK, a new socket is created. If the 
  16796.    socket is not bound to a local TCP port, it is bound to an arbitrary port. 
  16797.  
  16798.  send_buf_size 
  16799.    Size of the send buffer. Specify 0 if you want the call to pick a suitable 
  16800.    default value. 
  16801.  
  16802.  recv_buf_size 
  16803.    Size of the receive buffer. Specify 0 if you want the call to pick a 
  16804.    suitable default value. 
  16805.  
  16806.  Description 
  16807.  
  16808.  The svctcp_create() call creates a TCP-based service transport to which it 
  16809.  returns a pointer. xprt->xp_sock contains the transport's socket descriptor; 
  16810.  xprt->xp_port contains the transport's port number. 
  16811.  
  16812.  Return Values 
  16813.  
  16814.  NULL indicates failure. 
  16815.  
  16816.  Examples 
  16817.  
  16818.   ...
  16819.   SVCXPRT *transp;
  16820.  
  16821.   transp = svctcp_create(RPC_ANYSOCK, 1024*10, 1024*10);
  16822.   ...
  16823.  
  16824.  Related Calls 
  16825.  
  16826.       svc_destroy() 
  16827.       svcraw_create() 
  16828.       svcudp_create() 
  16829.  
  16830.  
  16831. ΓòÉΓòÉΓòÉ 14.47. svcudp_create() ΓòÉΓòÉΓòÉ
  16832.  
  16833. The svcudp_create() call creates a UDP-based service transport. 
  16834.  
  16835. Syntax 
  16836.  
  16837. #include <rpc\rpc.h>
  16838.  
  16839. SVCXPRT *
  16840. svcudp_create(sockp)
  16841. int sockp;
  16842.  
  16843. Parameters 
  16844.  
  16845.  sockp 
  16846.    The socket number associated with the service transport handle. If sockp is 
  16847.    RPC_ANYSOCK, a new socket is created.  If the socket is not bound to a local 
  16848.    port, it is bound to an arbitrary port. 
  16849.  
  16850.  Description 
  16851.  
  16852.  The svcudp_create() call creates a UDP-based service transport to which it 
  16853.  returns a pointer. xprt->xp_sock contains the transport's socket descriptor. 
  16854.  xprt->xp_port contains the transport's port number. 
  16855.  
  16856.  Return Values 
  16857.  
  16858.  NULL indicates failure. 
  16859.  
  16860.  Examples 
  16861.  
  16862.   ...
  16863.   SVCXPRT *transp;
  16864.  
  16865.   transp = svcudp_create(RPC_ANYSOCK);
  16866.   ...
  16867.  
  16868.  Related Calls 
  16869.  
  16870.       svc_destroy() 
  16871.       svcraw_create() 
  16872.       svctcp_create() 
  16873.  
  16874.  
  16875. ΓòÉΓòÉΓòÉ 14.48. xdr_accepted_reply() ΓòÉΓòÉΓòÉ
  16876.  
  16877. The xdr_accepted_reply() call translates between an RPC reply message and its 
  16878. external representation. 
  16879.  
  16880. Syntax 
  16881.  
  16882. #include <rpc\rpc.h>
  16883.  
  16884. bool_t
  16885. xdr_accepted_reply(xdrs, ar)
  16886. XDR *xdrs;
  16887. struct accepted_reply *ar;
  16888.  
  16889. Parameters 
  16890.  
  16891.  xdrs 
  16892.    Pointer to an XDR stream. 
  16893.  
  16894.  ar 
  16895.    Pointer to the reply to be represented. 
  16896.  
  16897.  Return Values 
  16898.  
  16899.  The value 1 indicates success; the value 0 indicates an error. 
  16900.  
  16901.  
  16902. ΓòÉΓòÉΓòÉ 14.49. xdr_array() ΓòÉΓòÉΓòÉ
  16903.  
  16904. The xdr_array() call translates between an array and its external 
  16905. representation. 
  16906.  
  16907. Syntax 
  16908.  
  16909. #include <rpc\rpc.h>
  16910.  
  16911. bool_t
  16912. xdr_array(xdrs, arrp, sizep, maxsize, elsize, elproc)
  16913. XDR *xdrs;
  16914. char **arrp;
  16915. u_int *sizep;
  16916. u_int maxsize;
  16917. u_int elsize;
  16918. xdrproc_t elproc;
  16919.  
  16920. Parameters 
  16921.  
  16922.  xdrs 
  16923.    Pointer to an XDR stream. 
  16924.  
  16925.  arrp 
  16926.    Address of the pointer to the array. 
  16927.  
  16928.  sizep 
  16929.    Pointer to the element count of the array. 
  16930.  
  16931.  maxsize 
  16932.    Maximum number of elements accepted. 
  16933.  
  16934.  elsize 
  16935.    Size of each of the array's elements, found using sizeof(). 
  16936.  
  16937.  elproc 
  16938.    XDR routine that translates an individual array element. 
  16939.  
  16940.  Return Values 
  16941.  
  16942.  The value 1 indicates success; the value 0 indicates an error. 
  16943.  
  16944.  Examples 
  16945.  
  16946.   struct myarray
  16947.      {
  16948.       int  *arrdata;
  16949.       u_int   arrlength;
  16950.      };
  16951.  
  16952.   void
  16953.   xdr_myarray(xdrsp,arrp)
  16954.   XDR  *xdrsp;
  16955.   struct myarray *arrp;
  16956.   {
  16957.     xdr_array(xdrsp,(caddr_t *)&arrp->arrdata,&arrp->arrlength,
  16958.                                       MAXLEN,sizeof(int),xdr_int);
  16959.   }
  16960.  
  16961.   ...
  16962.   static int arrc_in[10],arrc_out[10];
  16963.   ...
  16964.   u_long procnum;
  16965.   register CLIENT *clnt;
  16966.   enum clnt_stat cs;
  16967.   struct timeval  total_timeout;
  16968.   ...
  16969.   total_timeout.tv_sec = 20;
  16970.   total_timeout.tv_usec = 0;
  16971.   ...
  16972.   myarrc_in.arrdata =  & arrc_in&lbrk.0&rbrk.;
  16973.   myarrc_in.arrlength = ( sizeof(arrc_in) / sizeof (int) );
  16974.   myarrc_out.arrdata = & arrc_out&lbrk.0&rbrk.;
  16975.   myarrc_out.arrlength = ( sizeof(arrc_out) / sizeof (int) );
  16976.  
  16977.   cs=clnt_call(clnt, procnum, xdr_myarray, (char *) &myarrc_in, xdr_myarray,
  16978.                                    (char *)&myarrc_out, total_timeout);
  16979.   if ( cs != RPC_SUCCESS)
  16980.           printf("*Error* clnt_call fail :\n");
  16981.   ...
  16982.  
  16983.  
  16984. ΓòÉΓòÉΓòÉ 14.50. xdr_authunix_parms() ΓòÉΓòÉΓòÉ
  16985.  
  16986. The xdr_authunix_parms() call translates between UNIX-based authentication 
  16987. information and its external representation. 
  16988.  
  16989. Syntax 
  16990.  
  16991. #include <rpc\rpc.h>
  16992.  
  16993. bool_t
  16994. xdr_authunix_parms(xdrs, aupp)
  16995. XDR *xdrs;
  16996. struct authunix_parms *aupp;
  16997.  
  16998. Parameters 
  16999.  
  17000.  xdrs 
  17001.    Pointer to an XDR stream. 
  17002.  
  17003.  aupp 
  17004.    Pointer to the authentication information. 
  17005.  
  17006.  Return Values 
  17007.  
  17008.  The value 1 indicates success; the value 0 indicates an error. 
  17009.  
  17010.  
  17011. ΓòÉΓòÉΓòÉ 14.51. xdr_bool() ΓòÉΓòÉΓòÉ
  17012.  
  17013. The xdr_bool() call translates between a Boolean and its external 
  17014. representation. 
  17015.  
  17016. Syntax 
  17017.  
  17018. #include <rpc\rpc.h>
  17019.  
  17020. bool_t
  17021. xdr_bool(xdrs, bp)
  17022. XDR *xdrs;
  17023. bool_t *bp;
  17024.  
  17025. Parameters 
  17026.  
  17027.  xdrs 
  17028.    Pointer to an XDR stream. 
  17029.  
  17030.  bp 
  17031.    Pointer to the Boolean. 
  17032.  
  17033.  Return Values 
  17034.  
  17035.  The value 1 indicates success; the value 0 indicates an error. 
  17036.  
  17037.  
  17038. ΓòÉΓòÉΓòÉ 14.52. xdr_bytes() ΓòÉΓòÉΓòÉ
  17039.  
  17040. The xdr_bytes() call translates between byte strings and their external 
  17041. representations. 
  17042.  
  17043. Syntax 
  17044.  
  17045. #include <rpc\rpc.h>
  17046.  
  17047. bool_t
  17048. xdr_bytes(xdrs, sp, sizep, maxsize)
  17049. XDR *xdrs;
  17050. char **sp;
  17051. u_int *sizep;
  17052. u_int maxsize;
  17053.  
  17054. Parameters 
  17055.  
  17056.  xdrs 
  17057.    Pointer to an XDR stream. 
  17058.  
  17059.  sp 
  17060.    Pointer to a pointer to the byte string. 
  17061.  
  17062.  sizep 
  17063.    Pointer to the byte string size. 
  17064.  
  17065.  maxsize 
  17066.    Maximum size of the byte string. 
  17067.  
  17068.  Return Values 
  17069.  
  17070.  The value 1 indicates success; the value 0 indicates an error. 
  17071.  
  17072.  Examples 
  17073.  
  17074.   struct mybytes
  17075.      {
  17076.       char    *bytdata;
  17077.       u_int   bytlength;
  17078.      };
  17079.  
  17080.   void
  17081.   xdr_mybytes(xdrsp,arrp)
  17082.   XDR  *xdrsp;
  17083.   struct mybytes *arrp;
  17084.   {
  17085.      xdr_bytes(xdrsp,(caddr_t *)&arrp->bytdata,&arrp->bytlength,MAXLEN);
  17086.   }
  17087.  
  17088.   ...
  17089.   char *bytc_in ,*bytc_out;
  17090.   ...
  17091.   u_long procnum;
  17092.   register CLIENT *clnt;
  17093.   enum clnt_stat cs;
  17094.   struct timeval  total_timeout;
  17095.   ...
  17096.   total_timeout.tv_sec = 20;
  17097.   total_timeout.tv_usec = 0;
  17098.   ...
  17099.  
  17100.   mybytc_in.bytdata =  bytc_in;
  17101.   mybytc_in.bytlength = strlen(bytc_in)+1;
  17102.   cs=clnt_call(clnt, procnum, xdr_mybytes, (caddr_t *) &mybytc_in,
  17103.               xdr_mybytes, (caddr_t *)&mybytc_out, total_timeout);
  17104.   if ( cs != RPC_SUCCESS)
  17105.      printf("*Error* clnt_call fail :\n");
  17106.  
  17107.  
  17108. ΓòÉΓòÉΓòÉ 14.53. xdr_callhdr() ΓòÉΓòÉΓòÉ
  17109.  
  17110. The xdr_callhdr() call translates between an RPC message header and its 
  17111. external representation. 
  17112.  
  17113. Syntax 
  17114.  
  17115. #include <rpc\rpc.h>
  17116.  
  17117. void
  17118. xdr_callhdr(xdrs, chdr)
  17119. XDR *xdrs;
  17120. struct rpc_msg *chdr;
  17121.  
  17122. Parameters 
  17123.  
  17124.  xdrs 
  17125.    Pointer to the XDR stream. 
  17126.  
  17127.  chdr 
  17128.    Pointer to the call header. 
  17129.  
  17130.  
  17131. ΓòÉΓòÉΓòÉ 14.54. xdr_callmsg() ΓòÉΓòÉΓòÉ
  17132.  
  17133. The xdr_callmsg() call translates between RPC call messages (header and 
  17134. authentication, not argument data) and their external representations. 
  17135.  
  17136. Syntax 
  17137.  
  17138. #include <rpc\rpc.h>
  17139.  
  17140. void
  17141. xdr_callmsg(xdrs, cmsg)
  17142. XDR *xdrs;
  17143. struct rpc_msg *cmsg;
  17144.  
  17145. Parameters 
  17146.  
  17147.  xdrs 
  17148.    Pointer to the XDR stream. 
  17149.  
  17150.  cmsg 
  17151.    Pointer to the call message. 
  17152.  
  17153.  
  17154. ΓòÉΓòÉΓòÉ 14.55. xdr_destroy() ΓòÉΓòÉΓòÉ
  17155.  
  17156. The xdr_destroy() call destroys the XDR stream pointed to by the xdrs 
  17157. parameter. 
  17158.  
  17159. Syntax 
  17160.  
  17161. #include <rpc\rpc.h>
  17162.  
  17163. void xdr_destroy(xdrs)
  17164. XDR *xdrs;
  17165.  
  17166. Parameters 
  17167.  
  17168.  xdrs 
  17169.    Pointer to the XDR stream. 
  17170.  
  17171.  Description 
  17172.  
  17173.  The xdr_destroy() call invokes the destroy routine associated with the 
  17174.  eXternal Data Representation stream pointed to by the xdrs parameter, and 
  17175.  frees the private data structures allocated to the stream. 
  17176.  
  17177.  
  17178. ΓòÉΓòÉΓòÉ 14.56. xdr_double() ΓòÉΓòÉΓòÉ
  17179.  
  17180. The xdr_double() call translates between C double-precision numbers and their 
  17181. external representations. 
  17182.  
  17183. Syntax 
  17184.  
  17185. #include <rpc\rpc.h>
  17186.  
  17187. bool_t
  17188. xdr_double(xdrs, dp)
  17189. XDR *xdrs;
  17190. double *dp;
  17191.  
  17192. Parameters 
  17193.  
  17194.  xdrs 
  17195.    Pointer to the XDR stream. 
  17196.  
  17197.  dp 
  17198.    Pointer to a double-precision number. 
  17199.  
  17200.  Return Values 
  17201.  
  17202.  The value 1 indicates success; the value 0 indicates an error. 
  17203.  
  17204.  
  17205. ΓòÉΓòÉΓòÉ 14.57. xdr_enum() ΓòÉΓòÉΓòÉ
  17206.  
  17207. The xdr_enum() call translates between C-enumerated groups and their external 
  17208. representations. 
  17209.  
  17210. Syntax 
  17211.  
  17212. #include <rpc\rpc.h>
  17213.  
  17214. bool_t
  17215. xdr_enum(xdrs, ep)
  17216. XDR *xdrs;
  17217. enum_t *ep;
  17218.  
  17219. Parameters 
  17220.  
  17221.  xdrs 
  17222.    Pointer to the XDR stream. 
  17223.  
  17224.  ep 
  17225.    Pointer to the enumerated number. 
  17226.  
  17227.  Description 
  17228.  
  17229.  The xdr_enum() call translates between C-enumerated groups and their external 
  17230.  representations. When you call the procedures callrpc() and registerrpc(), 
  17231.  create a stub procedure for both the server and the client before the 
  17232.  procedure of the application program using xdr_enum(). Verify that this 
  17233.  procedure looks like the following: 
  17234.  
  17235.   #include <rpc\rpc.h>
  17236.  
  17237.   void
  17238.   static xdr_enum_t(xdrs, ep)
  17239.   XDR *xdrs;
  17240.   enum_t *ep;
  17241.   {
  17242.          xdr_enum(xdrs, ep)
  17243.   }
  17244.  The xdr_enum_t procedure is used as the inproc and outproc in both the client 
  17245.  and server RPCs. 
  17246.  
  17247.  For example, an RPC client would contain the following lines: 
  17248.  
  17249.                            ...
  17250.  
  17251.   error = callrpc(argv[1],ENUMRCVPROG,VERSION,ENUMRCVPROC,
  17252.                        xdr_enum_t,&innumber,xdr_enum_t,&outnumber);
  17253.  
  17254.                            ...
  17255.  
  17256.  An RPC server would contain the following line: 
  17257.  
  17258.  
  17259.   registerrpc(ENUMRCVPROG,VERSION,ENUMRCVPROC,xdr_enum_t,
  17260.                       xdr_enum_t);
  17261.  
  17262.                            ...
  17263.  
  17264.  Return Values 
  17265.  
  17266.  The value 1 indicates success; the value 0 indicates an error. 
  17267.  
  17268.  
  17269. ΓòÉΓòÉΓòÉ 14.58. xdr_float() ΓòÉΓòÉΓòÉ
  17270.  
  17271. The xdr_float() call translates between C floating-point numbers and their 
  17272. external representations. 
  17273.  
  17274. Syntax 
  17275.  
  17276. #include <rpc\rpc.h>
  17277.  
  17278. bool_t
  17279. xdr_float(xdrs, fp)
  17280. XDR *xdrs;
  17281. float *fp;
  17282.  
  17283. Parameters 
  17284.  
  17285.  xdrs 
  17286.    Pointer to the XDR stream. 
  17287.  
  17288.  fp 
  17289.    Pointer to the floating-point number. 
  17290.  
  17291.  Return Values 
  17292.  
  17293.  The value 1 indicates success; the value 0 indicates an error. 
  17294.  
  17295.  
  17296. ΓòÉΓòÉΓòÉ 14.59. xdr_getpos() ΓòÉΓòÉΓòÉ
  17297.  
  17298. The xdr_getpos() call starts the get-position routine associated with the XDR 
  17299. stream, xdrs. 
  17300.  
  17301. Syntax 
  17302.  
  17303. #include <rpc\rpc.h>
  17304.  
  17305. u_int
  17306. xdr_getpos(xdrs)
  17307. XDR *xdrs;
  17308.  
  17309. Parameters 
  17310.  
  17311.  xdrs 
  17312.    Pointer to the XDR stream. 
  17313.  
  17314.  Return Values 
  17315.  
  17316.  The xdr_getpos() call returns an unsigned integer, which indicates the 
  17317.  position of the XDR byte stream. 
  17318.  
  17319.  Related Calls 
  17320.  
  17321.       xdr_setpos() 
  17322.  
  17323.  
  17324. ΓòÉΓòÉΓòÉ 14.60. xdr_inline() ΓòÉΓòÉΓòÉ
  17325.  
  17326. The xdr_inline() call returns a pointer to a continuous piece of the XDR 
  17327. stream's buffer. 
  17328.  
  17329. Syntax 
  17330.  
  17331. #include <rpc\rpc.h>
  17332.  
  17333. long *
  17334. xdr_inline(xdrs, len)
  17335. XDR *xdrs;
  17336. int len;
  17337.  
  17338. Parameters 
  17339.  
  17340.  xdrs 
  17341.    Pointer to the XDR stream. 
  17342.  
  17343.  len 
  17344.    Length in bytes of the desired buffer. 
  17345.  
  17346.  Description 
  17347.  
  17348.  The xdr_inline() call returns a pointer to a continuous piece of the XDR 
  17349.  stream's buffer. The value is long * rather than char *, because the external 
  17350.  data representation of any object is always an integer multiple of 32 bits. 
  17351.  
  17352.  Note:  xdr_inline() might return NULL if there is not enough space in the 
  17353.         stream buffer to satisfy the request. 
  17354.  
  17355.  Return Values 
  17356.  
  17357.  The value 1 indicates success; the value 0 indicates an error. 
  17358.  
  17359.  
  17360. ΓòÉΓòÉΓòÉ 14.61. xdr_int() ΓòÉΓòÉΓòÉ
  17361.  
  17362. The xdr_int() call translates between C integers and their external 
  17363. representations. 
  17364.  
  17365. Syntax 
  17366.  
  17367. #include <rpc\rpc.h>
  17368.  
  17369. bool_t
  17370. xdr_int(xdrs, ip)
  17371. XDR *xdrs;
  17372. int *ip;
  17373.  
  17374. Parameters 
  17375.  
  17376.  xdrs 
  17377.    Pointer to the XDR stream. 
  17378.  
  17379.  ip 
  17380.    Pointer to the integer. 
  17381.  
  17382.  Return Values 
  17383.  
  17384.  The value 1 indicates success; the value 0 indicates an error. 
  17385.  
  17386.  
  17387. ΓòÉΓòÉΓòÉ 14.62. xdr_long() ΓòÉΓòÉΓòÉ
  17388.  
  17389. The xdr_long() call translates between C long integers and their external 
  17390. representations. 
  17391.  
  17392. Syntax 
  17393.  
  17394. #include <rpc\rpc.h>
  17395.  
  17396. bool_t
  17397. xdr_long(xdrs, lp)
  17398. XDR *xdrs;
  17399. long *lp;
  17400.  
  17401. Parameters 
  17402.  
  17403.  xdrs 
  17404.    Pointer to an XDR stream. 
  17405.  
  17406.  lp 
  17407.    Pointer to the long integer. 
  17408.  
  17409.  Return Values 
  17410.  
  17411.  The value 1 indicates success; the value 0 indicates an error. 
  17412.  
  17413.  
  17414. ΓòÉΓòÉΓòÉ 14.63. xdr_opaque() ΓòÉΓòÉΓòÉ
  17415.  
  17416. The xdr_opaque() call translates between fixed-size opaque data and its 
  17417. external representation. 
  17418.  
  17419. Syntax 
  17420.  
  17421. #include <rpc\rpc.h>
  17422.  
  17423. bool_t
  17424. xdr_opaque(xdrs, cp, cnt)
  17425. XDR *xdrs;
  17426. char *cp;
  17427. u_int cnt;
  17428.  
  17429. Parameters 
  17430.  
  17431.  xdrs 
  17432.    Pointer to an XDR stream. 
  17433.  
  17434.  cp 
  17435.    Pointer to the opaque object. 
  17436.  
  17437.  cnt 
  17438.    Size of the opaque object. 
  17439.  
  17440.  Return Values 
  17441.  
  17442.  The value 1 indicates success; the value 0 indicates an error. 
  17443.  
  17444.  
  17445. ΓòÉΓòÉΓòÉ 14.64. xdr_opaque_auth() ΓòÉΓòÉΓòÉ
  17446.  
  17447. The xdr_opaque_auth() call translates between RPC message authentications and 
  17448. their external representations. 
  17449.  
  17450. Syntax 
  17451.  
  17452. #include <rpc\rpc.h>
  17453.  
  17454. bool_t
  17455. xdr_opaque_auth(xdrs, ap)
  17456. XDR *xdrs;
  17457. struct opaque_auth *ap;
  17458.  
  17459. Parameters 
  17460.  
  17461.  xdrs 
  17462.    Pointer to an XDR stream. 
  17463.  
  17464.  ap 
  17465.    Pointer to the opaque authentication information. 
  17466.  
  17467.  Return Values 
  17468.  
  17469.  The value 1 indicates success; the value 0 indicates an error. 
  17470.  
  17471.  
  17472. ΓòÉΓòÉΓòÉ 14.65. xdr_pmap() ΓòÉΓòÉΓòÉ
  17473.  
  17474. The xdr_pmap() call translates an RPC procedure identification, such as is used 
  17475. in calls to Portmapper. 
  17476.  
  17477. Syntax 
  17478.  
  17479. #include <rpc\rpc.h>
  17480.  
  17481. bool_t
  17482. xdr_pmap(xdrs, regs)
  17483. XDR *xdrs;
  17484. struct pmap *regs;
  17485.  
  17486. Parameters 
  17487.  
  17488.  xdrs 
  17489.    Pointer to an XDR stream. 
  17490.  
  17491.  regs 
  17492.    Pointer to the PORTMAP parameters. 
  17493.  
  17494.  Return Values 
  17495.  
  17496.  The value 1 indicates success; the value 0 indicates an error. 
  17497.  
  17498.  
  17499. ΓòÉΓòÉΓòÉ 14.66. xdr_pmaplist() ΓòÉΓòÉΓòÉ
  17500.  
  17501. The xdr_pmaplist() call translates a variable number of RPC procedure 
  17502. identifications, such as those Portmapper creates. 
  17503.  
  17504. Syntax 
  17505.  
  17506. #include <rpc\rpc.h>
  17507.  
  17508. bool_t
  17509. xdr_pmaplist(xdrs, rp)
  17510. XDR *xdrs;
  17511. struct pmaplist **rp;
  17512.  
  17513. Parameters 
  17514.  
  17515.  xdrs 
  17516.    Pointer to an XDR stream. 
  17517.  
  17518.  rp 
  17519.    Pointer to a pointer to the PORTMAP data array. 
  17520.  
  17521.  Return Values 
  17522.  
  17523.  The value 1 indicates success; the value 0 indicates an error. 
  17524.  
  17525.  
  17526. ΓòÉΓòÉΓòÉ 14.67. xdr_reference() ΓòÉΓòÉΓòÉ
  17527.  
  17528. The xdr_reference() call provides pointer chasing within structures. 
  17529.  
  17530. Syntax 
  17531.  
  17532. #include <rpc\rpc.h>
  17533.  
  17534. bool_t
  17535. xdr_reference(xdrs, pp, size, proc)
  17536. XDR *xdrs;
  17537. char **pp;
  17538. u_int size;
  17539. xdrproc_t proc;
  17540.  
  17541. Parameters 
  17542.  
  17543.  xdrs 
  17544.    Pointer to an XDR stream. 
  17545.  
  17546.  pp 
  17547.    Pointer to a pointer. 
  17548.  
  17549.  size 
  17550.    Size of the target. 
  17551.  
  17552.  proc 
  17553.    XDR procedure that translates an individual element of the type addressed by 
  17554.    the pointer. 
  17555.  
  17556.  Return Values 
  17557.  
  17558.  The value 1 indicates success; the value 0 indicates an error. 
  17559.  
  17560.  
  17561. ΓòÉΓòÉΓòÉ 14.68. xdr_rejected_reply() ΓòÉΓòÉΓòÉ
  17562.  
  17563. The xdr_rejected_reply() call translates between rejected RPC reply messages 
  17564. and their external representations. 
  17565.  
  17566. Syntax 
  17567.  
  17568. #include <rpc\rpc.h>
  17569.  
  17570. bool_t
  17571. xdr_rejected_reply(xdrs, rr)
  17572. XDR *xdrs;
  17573. struct rejected_reply *rr;
  17574.  
  17575. Parameters 
  17576.  
  17577.  xdrs 
  17578.    Pointer to an XDR stream. 
  17579.  
  17580.  rr 
  17581.    Pointer to the rejected reply. 
  17582.  
  17583.  Return Values 
  17584.  
  17585.  The value 1 indicates success; the value 0 indicates an error. 
  17586.  
  17587.  
  17588. ΓòÉΓòÉΓòÉ 14.69. xdr_replymsg() ΓòÉΓòÉΓòÉ
  17589.  
  17590. The xdr_replymsg() call translates between RPC reply messages and their 
  17591. external representations. 
  17592.  
  17593. Syntax 
  17594.  
  17595. #include <rpc\rpc.h>
  17596.  
  17597. bool_t
  17598. xdr_replymsg(xdrs, rmsg)
  17599. XDR *xdrs;
  17600. struct rpc_msg *rmsg;
  17601.  
  17602. Parameters 
  17603.  
  17604.  xdrs 
  17605.    Pointer to an XDR stream. 
  17606.  
  17607.  rmsg 
  17608.    Pointer to the reply message. 
  17609.  
  17610.  Return Values 
  17611.  
  17612.  The value 1 indicates success; the value 0 indicates an error. 
  17613.  
  17614.  
  17615. ΓòÉΓòÉΓòÉ 14.70. xdr_setpos() ΓòÉΓòÉΓòÉ
  17616.  
  17617. The xdr_setpos() starts the set-position routine associated with a XDR stream, 
  17618. xdrs. 
  17619.  
  17620. Syntax 
  17621.  
  17622. #include <rpc\rpc.h>
  17623.  
  17624. int
  17625. xdr_setpos(xdrs, pos)
  17626. XDR *xdrs;
  17627. u_int pos;
  17628.  
  17629. Parameters 
  17630.  
  17631.  xdrs 
  17632.    Pointer to an XDR stream. 
  17633.  
  17634.  pos 
  17635.    Position value obtained from xdr_getpos(). 
  17636.  
  17637.  Return Values 
  17638.  
  17639.  The value 1 indicates success; the value 0 indicates an error. 
  17640.  
  17641.  Related Calls 
  17642.  
  17643.       xdr_getpos() 
  17644.  
  17645.  
  17646. ΓòÉΓòÉΓòÉ 14.71. xdr_short() ΓòÉΓòÉΓòÉ
  17647.  
  17648. The xdr_short() call translates between C short integers and their external 
  17649. representations. 
  17650.  
  17651. Syntax 
  17652.  
  17653. #include <rpc\rpc.h>
  17654.  
  17655. bool_t
  17656. xdr_short(xdrs, sp)
  17657. XDR *xdrs;
  17658. short *sp;
  17659.  
  17660. Parameters 
  17661.  
  17662.  xdrs 
  17663.    Pointer to an XDR stream. 
  17664.  
  17665.  sp 
  17666.    Pointer to the short integer. 
  17667.  
  17668.  Return Values 
  17669.  
  17670.  The value 1 indicates success; the value 0 indicates an error. 
  17671.  
  17672.  
  17673. ΓòÉΓòÉΓòÉ 14.72. xdr_string() ΓòÉΓòÉΓòÉ
  17674.  
  17675. The xdr_string() call translates between C strings and their external 
  17676. representations. 
  17677.  
  17678. Syntax 
  17679.  
  17680. #include <rpc\rpc.h>
  17681.  
  17682. bool_t
  17683. xdr_string(xdrs, sp, maxsize)
  17684. XDR *xdrs;
  17685. char **sp;
  17686. u_int maxsize;
  17687.  
  17688. Parameters 
  17689.  
  17690.  xdrs 
  17691.    Pointer to an XDR stream. 
  17692.  
  17693.  sp 
  17694.    Pointer to a pointer to the string. 
  17695.  
  17696.  maxsize 
  17697.    Maximum size of the string. 
  17698.  
  17699.  Return Values 
  17700.  
  17701.  The value 1 indicates success; the value 0 indicates an error. 
  17702.  
  17703.  
  17704. ΓòÉΓòÉΓòÉ 14.73. xdr_u_int() ΓòÉΓòÉΓòÉ
  17705.  
  17706. The xdr_u_int() call translates between C unsigned integers and their external 
  17707. representations. 
  17708.  
  17709. Syntax 
  17710.  
  17711. #include <rpc\rpc.h>
  17712.  
  17713. bool_t
  17714. xdr_u_int(xdrs, up)
  17715. XDR *xdrs;
  17716. unsigned *up;
  17717.  
  17718. Parameters 
  17719.  
  17720.  xdrs 
  17721.    Pointer to an XDR stream. 
  17722.  
  17723.  up 
  17724.    Pointer to the unsigned integer. 
  17725.  
  17726.  Return Values 
  17727.  
  17728.  The value 1 indicates success; the value 0 indicates an error. 
  17729.  
  17730.  
  17731. ΓòÉΓòÉΓòÉ 14.74. xdr_u_long() ΓòÉΓòÉΓòÉ
  17732.  
  17733. The xdr_u_long() call translates between C unsigned long integers and their 
  17734. external representations. 
  17735.  
  17736. Syntax 
  17737.  
  17738. #include <rpc\rpc.h>
  17739.  
  17740. bool_t
  17741. xdr_u_long(xdrs, ulp)
  17742. XDR *xdrs;
  17743. u_long *ulp;
  17744.  
  17745. Parameters 
  17746.  
  17747.  xdrs 
  17748.    Pointer to an XDR stream. 
  17749.  
  17750.  ulp 
  17751.    Pointer to the unsigned long integer. 
  17752.  
  17753.  Return Values 
  17754.  
  17755.  The value 1 indicates success; the value 0 indicates an error. 
  17756.  
  17757.  
  17758. ΓòÉΓòÉΓòÉ 14.75. xdr_u_short() ΓòÉΓòÉΓòÉ
  17759.  
  17760. The xdr_u_short() call translates between C unsigned short integers and their 
  17761. external representations. 
  17762.  
  17763. Syntax 
  17764.  
  17765. #include <rpc\rpc.h>
  17766.  
  17767. bool_t
  17768. xdr_u_short(xdrs, usp)
  17769. XDR *xdrs;
  17770. u_short *usp;
  17771.  
  17772. Parameters 
  17773.  
  17774.  xdrs 
  17775.    Pointer to an XDR stream. 
  17776.  
  17777.  usp 
  17778.    Pointer to the unsigned short integer. 
  17779.  
  17780.  Return Values 
  17781.  
  17782.  The value 1 indicates success; the value 0 indicates an error. 
  17783.  
  17784.  
  17785. ΓòÉΓòÉΓòÉ 14.76. xdr_union() ΓòÉΓòÉΓòÉ
  17786.  
  17787. The xdr_union() call translates between a discriminated C union and its 
  17788. external representation. 
  17789.  
  17790. Syntax 
  17791.  
  17792. #include <rpc\rpc.h>
  17793.  
  17794. bool_t
  17795. xdr_union(xdrs, dscmp, unp, choices, dfault)
  17796. XDR *xdrs;
  17797. int *dscmp;
  17798. char *unp;
  17799. struct xdr_discrim *choices;
  17800. xdrproc_t dfault;
  17801.  
  17802. Parameters 
  17803.  
  17804.  xdrs 
  17805.    Pointer to an XDR stream. 
  17806.  
  17807.  dscmp 
  17808.    Pointer to the union's discriminant. 
  17809.  
  17810.  unp 
  17811.    Pointer to the union. 
  17812.  
  17813.  choices 
  17814.    Pointer to an array detailing the XDR procedure to use on each arm of the 
  17815.    union. 
  17816.  
  17817.  dfault 
  17818.    Default XDR procedure to use. 
  17819.  
  17820.  Return Values 
  17821.  
  17822.  The value 1 indicates success; the value 0 indicates an error. 
  17823.  
  17824.  
  17825. ΓòÉΓòÉΓòÉ 14.77. xdr_vector() ΓòÉΓòÉΓòÉ
  17826.  
  17827. The xdr_vector() call translates between a fixed-length array and its external 
  17828. representation. 
  17829.  
  17830. Syntax 
  17831.  
  17832. #include <rpc\rpc.h>
  17833.  
  17834. bool_t
  17835. xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
  17836. XDR *xdrs;
  17837. char *basep;
  17838. u_int nelem;
  17839. u_int elemsize;
  17840. xdrproc_t xdr_elem
  17841.  
  17842. Parameters 
  17843.  
  17844.  xdrs 
  17845.    Pointer to the XDR stream. 
  17846.  
  17847.  basep 
  17848.    Pointer to the base of the array. 
  17849.  
  17850.  nelem 
  17851.    Element count of the array. 
  17852.  
  17853.  elemsize 
  17854.    Size of each of the array's elements, found by using the sizeof() operator. 
  17855.  
  17856.  xdr_elem 
  17857.    Pointer to the XDR routine that translates an individual array element. 
  17858.  
  17859.  Description 
  17860.  
  17861.  The xdr_vector() call translates between a fixed-length array and its external 
  17862.  representation. Unlike variable-length arrays, the storage of fixed-length 
  17863.  arrays is static and unfreeable. 
  17864.  
  17865.  Return Values 
  17866.  
  17867.  The value 1 indicates success; the value 0 indicates an error. 
  17868.  
  17869.  
  17870. ΓòÉΓòÉΓòÉ 14.78. xdr_void() ΓòÉΓòÉΓòÉ
  17871.  
  17872. The xdr_void() call returns a value of 1. 
  17873.  
  17874. Syntax 
  17875.  
  17876. #include <rpc\rpc.h>
  17877.  
  17878. bool_t
  17879. xdr_void()
  17880.  
  17881. Description 
  17882.  
  17883. The xdr_void() call is used like a command that does not require any other XDR 
  17884. functions. You can place this call in the inproc or outproc parameter of the 
  17885. clnt_call() function when you do not need to move data. 
  17886.  
  17887. Return Values 
  17888.  
  17889. The xdr_void() call always returns a value of 1. 
  17890.  
  17891. Related Calls 
  17892.  
  17893.       callrpc() 
  17894.       clnt_broadcast() 
  17895.       clnt_call() 
  17896.       clnt_freeres() 
  17897.       pmap_rmtcall() 
  17898.       registerrpc() 
  17899.       svc_freeargs() 
  17900.       svc_getargs() 
  17901.       svc_sendreply() 
  17902.  
  17903.  
  17904. ΓòÉΓòÉΓòÉ 14.79. xdr_wrapstring() ΓòÉΓòÉΓòÉ
  17905.  
  17906. The xdr_wrapstring() call translates between strings and their external 
  17907. representations. 
  17908.  
  17909. Syntax 
  17910.  
  17911. #include <rpc\rpc.h>
  17912.  
  17913. bool_t
  17914. xdr_wrapstring(xdrs, sp)
  17915. XDR *xdrs;
  17916. char **sp;
  17917.  
  17918. Parameters 
  17919.  
  17920.  xdrs 
  17921.    Pointer to an XDR stream. 
  17922.  
  17923.  sp 
  17924.    Pointer to a pointer to the string. 
  17925.  
  17926.  Description 
  17927.  
  17928.  The xdr_wrapstring() call is the same as calling xdr_string() with a maximum 
  17929.  size of MAXUNSIGNED. It is useful because many RPC procedures implicitly start 
  17930.  two-parameter XDR routines, and xdr_string() is a three-parameter routine. 
  17931.  
  17932.  Return Values 
  17933.  
  17934.  The value 1 indicates success; the value 0 indicates an error. 
  17935.  
  17936.  
  17937. ΓòÉΓòÉΓòÉ 14.80. xdrmem_create() ΓòÉΓòÉΓòÉ
  17938.  
  17939. The xdrmem_create() call initializes the XDR stream pointed to by xdrs. Data is 
  17940. written to, or read from, addr. 
  17941.  
  17942. Syntax 
  17943.  
  17944. #include <rpc\rpc.h>
  17945.  
  17946. void
  17947. xdrmem_create(xdrs, addr, size, op)
  17948. XDR *xdrs;
  17949. char *addr;
  17950. u_int size;
  17951. enum xdr_op op;
  17952.  
  17953. Parameters 
  17954.  
  17955.  xdrs 
  17956.    Pointer to an XDR stream. 
  17957.  
  17958.  addr 
  17959.    Pointer to the memory location. 
  17960.  
  17961.  size 
  17962.    Maximum size of addr, in multiples of 4. 
  17963.  
  17964.  op 
  17965.    The direction of the XDR stream (either XDR_ENCODE, XDR_DECODE, or 
  17966.    XDR_FREE). 
  17967.  
  17968.  
  17969. ΓòÉΓòÉΓòÉ 14.81. xdrrec_create() ΓòÉΓòÉΓòÉ
  17970.  
  17971. The xdrrec_create() call initializes the XDR stream pointed to by xdrs. 
  17972.  
  17973. Syntax 
  17974.  
  17975. #include <rpc\rpc.h>
  17976.  
  17977. void
  17978. xdrrec_create(xdrs, sendsize, recvsize, handle, readit, writeit)
  17979. XDR *xdrs;
  17980. u_int sendsize;
  17981. u_int recvsize;
  17982. char *handle;
  17983. int (*readit)();
  17984. int (*writeit)();
  17985.  
  17986. Parameters 
  17987.  
  17988.  xdrs 
  17989.    Pointer to an XDR stream. 
  17990.  
  17991.  sendsize 
  17992.    Size of the send buffer.  Specify 0 to choose the default. 
  17993.  
  17994.  recvsize 
  17995.    Size of the receive buffer.  Specify 0 to choose the default. 
  17996.  
  17997.  handle 
  17998.    First parameter passed to readit() and writeit(). 
  17999.  
  18000.  readit() 
  18001.    Called when a stream's input buffer is empty. 
  18002.  
  18003.  writeit() 
  18004.    Called when a stream's output buffer is full. 
  18005.  
  18006.  Description 
  18007.  
  18008.  The xdrrec_create() call initializes the XDR stream pointed to by xdrs. 
  18009.  
  18010.  Note:  The caller must set the op field in the xdrs structure. 
  18011.  
  18012.  Attention: 
  18013.  
  18014.   This XDR procedure implements an intermediate record string. Additional bytes 
  18015.  in the XDR stream provide record boundary information. 
  18016.  
  18017.  
  18018. ΓòÉΓòÉΓòÉ 14.82. xdrrec_endofrecord() ΓòÉΓòÉΓòÉ
  18019.  
  18020. The xdrrec_endofrecord() call marks the data in the output buffer as a 
  18021. completed record. 
  18022.  
  18023. Syntax 
  18024.  
  18025. #include <rpc\rpc.h>
  18026.  
  18027. bool_t
  18028. xdrrec_endofrecord(xdrs, sendnow)
  18029. XDR *xdrs;
  18030. int sendnow;
  18031.  
  18032. Parameters 
  18033.  
  18034.  xdrs 
  18035.    Pointer to an XDR stream. 
  18036.  
  18037.  sendnow 
  18038.    Specifies nonzero to write out data in the output buffer. 
  18039.  
  18040.  Description 
  18041.  
  18042.  You can start the xdrrec_endofrecord() call only on streams created by 
  18043.  xdrrec_create(). Data in the output buffer is marked as a complete record. 
  18044.  
  18045.  Return Values 
  18046.  
  18047.  The value 1 indicates success; the value 0 indicates an error. 
  18048.  
  18049.  
  18050. ΓòÉΓòÉΓòÉ 14.83. xdrrec_eof() ΓòÉΓòÉΓòÉ
  18051.  
  18052. The xdrrec_eof() call marks the end of the file, after using the rest of the 
  18053. current record in the XDR stream. 
  18054.  
  18055. Syntax 
  18056.  
  18057. #include <rpc\rpc.h>
  18058.  
  18059. bool_t
  18060. xdrrec_eof(xdrs)
  18061. XDR *xdrs;
  18062. int empty;
  18063.  
  18064. Parameters 
  18065.  
  18066.  xdrs 
  18067.    Pointer to an XDR stream. 
  18068.  
  18069.  Description 
  18070.  
  18071.  You can start the xdrrec_eof() call only on streams created by 
  18072.  xdrrec_create(). 
  18073.  
  18074.  Return Values 
  18075.  
  18076.  The value 1 indicates the current record has been consumed; the value 0 
  18077.  indicates continued input on the stream. 
  18078.  
  18079.  
  18080. ΓòÉΓòÉΓòÉ 14.84. xdrrec_skiprecord() ΓòÉΓòÉΓòÉ
  18081.  
  18082. The xdrrec_skiprecord() call discards the rest of the XDR stream's current 
  18083. record in the input buffer. 
  18084.  
  18085. Syntax 
  18086.  
  18087. #include <rpc\rpc.h>
  18088.  
  18089. bool_t
  18090. xdrrec_skiprecord(xdrs)
  18091. XDR *xdrs;
  18092.  
  18093. Parameters 
  18094.  
  18095.  xdrs 
  18096.    Pointer to an XDR stream. 
  18097.  
  18098.  Description 
  18099.  
  18100.  You can start the xdrrec_skiprecord() call only on streams created by 
  18101.  xdrrec_create(). The XDR implementation is instructed to discard the remaining 
  18102.  data in the input buffer. 
  18103.  
  18104.  Return Values 
  18105.  
  18106.  The value 1 indicates success; the value 0 indicates an error. 
  18107.  
  18108.  Related Calls 
  18109.  
  18110.       xdrrec_create() 
  18111.  
  18112.  
  18113. ΓòÉΓòÉΓòÉ 14.85. xdrstdio_create() ΓòÉΓòÉΓòÉ
  18114.  
  18115. The xdrstdio_create() call initializes the XDR stream pointed to by xdrs. Data 
  18116. is written to or read from the standard I/O stream or file. 
  18117.  
  18118. Syntax 
  18119.  
  18120. #include <rpc\rpc.h>
  18121. #include <stdio.h>
  18122.  
  18123. void
  18124. xdrstdio_create(xdrs, file, op)
  18125. XDR *xdrs;
  18126. FILE *file;
  18127. enum xdr_op op;
  18128.  
  18129. Parameters 
  18130.  
  18131.  xdrs 
  18132.    Pointer to an XDR stream. 
  18133.  
  18134.  file 
  18135.    File name for the input and output stream. 
  18136.  
  18137.  op 
  18138.    The direction of the XDR stream (either XDR_ENCODE, XDR_DECODE, or 
  18139.    XDR_FREE). 
  18140.  
  18141.  
  18142. ΓòÉΓòÉΓòÉ 14.86. xprt_register() ΓòÉΓòÉΓòÉ
  18143.  
  18144. The xprt_register() call registers service transport handles with the RPC 
  18145. service package. This routine also modifies the global variable svc_socks[ ]. 
  18146.  
  18147. Syntax 
  18148.  
  18149. #include <rpc\rpc.h>
  18150.  
  18151. void
  18152. xprt_register(xprt)
  18153. SVCXPRT *xprt;
  18154.  
  18155. Parameters 
  18156.  
  18157.  xprt 
  18158.    Pointer to the service transport handle. 
  18159.  
  18160.  Related Calls 
  18161.  
  18162.       svc_register() 
  18163.  
  18164.  
  18165. ΓòÉΓòÉΓòÉ 14.87. xprt_unregister() ΓòÉΓòÉΓòÉ
  18166.  
  18167. The xprt_unregister() call unregisters the RPC service transport handle. 
  18168.  
  18169. Syntax 
  18170.  
  18171. #include <rpc\rpc.h>
  18172.  
  18173. void
  18174. xprt_unregister(xprt)
  18175. SVCXPRT *xprt;
  18176.  
  18177. Parameters 
  18178.  
  18179.  xprt 
  18180.    Pointer to the service transport handle. 
  18181.  
  18182.  Description 
  18183.  
  18184.  The xprt_unregister() call unregisters an RPC service transport handle. A 
  18185.  transport handle should be unregistered with the RPC service package before it 
  18186.  is destroyed. This routine also modifies the global variable svc_socks[ ]. 
  18187.  
  18188.  
  18189. ΓòÉΓòÉΓòÉ 15. File Transfer Protocol API ΓòÉΓòÉΓòÉ
  18190.  
  18191. The following table briefly describes each FTP API call, and identifies where 
  18192. you can find the syntax, parameters, and other appropriate information for 
  18193. these calls. 
  18194.  
  18195. File Transfer Protocol API Quick Reference 
  18196.  
  18197. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18198. ΓöéFTP Call                 Description                              Γöé
  18199. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18200. Γöéftpappend()              Appends information to a remote file     Γöé
  18201. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18202. Γöéftpcd()                  Changes the current working directory on Γöé
  18203. Γöé                         a host                                   Γöé
  18204. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18205. Γöéftpdelete()              Deletes files on a remote host           Γöé
  18206. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18207. Γöéftpdir()                 Gets a directory in wide format from a   Γöé
  18208. Γöé                         host                                     Γöé
  18209. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18210. Γöéftpget()                 Gets a file from an FTP server           Γöé
  18211. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18212. Γöéftplogoff()              Closes all current connections           Γöé
  18213. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18214. Γöéftpls()                  Gets directory information in short      Γöé
  18215. Γöé                         format from a remote host and writes it  Γöé
  18216. Γöé                         to a local file                          Γöé
  18217. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18218. Γöéftpmkd()                 Creates a new directory on a target      Γöé
  18219. Γöé                         machine                                  Γöé
  18220. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18221. Γöéftpping()                Resolves a host name and sends a ping to Γöé
  18222. Γöé                         the remote host to determine if the host Γöé
  18223. Γöé                         is responding                            Γöé
  18224. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18225. Γöéftpproxy()               Transfers a file between two remote      Γöé
  18226. Γöé                         servers without sending the file to the  Γöé
  18227. Γöé                         local host                               Γöé
  18228. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18229. Γöéftpput()                 Transfers a file to an FTP server        Γöé
  18230. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18231. Γöéftpputunique()           Transfers a file to a host and ensures itΓöé
  18232. Γöé                         is created with a unique name            Γöé
  18233. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18234. Γöéftppwd()                 Stores the string containing the FTP     Γöé
  18235. Γöé                         server description of the current workingΓöé
  18236. Γöé                         directory on the host to the buffer      Γöé
  18237. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18238. Γöéftprename()              Renames a file on a remote host          Γöé
  18239. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18240. Γöéftpquote()               Sends a string to the server verbatim    Γöé
  18241. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18242. Γöéftprmd()                 Removes a directory on a target machine  Γöé
  18243. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18244. Γöéftpsite()                Executes the site command                Γöé
  18245. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18246. Γöéftpsys()                 Stores the string containing the FTP     Γöé
  18247. Γöé                         server description of the operating      Γöé
  18248. Γöé                         system running on the host in a buffer   Γöé
  18249. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18250. Γöéftptrcoff()              Closes the trace file, and stops tracing Γöé
  18251. Γöé                         of the command and reply sequences that  Γöé
  18252. Γöé                         were sent over the control connection    Γöé
  18253. Γöé                         between the local and remote hosts       Γöé
  18254. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18255. Γöéftptrcon()               Opens the trace file specified and startsΓöé
  18256. Γöé                         tracing                                  Γöé
  18257. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18258. Γöéftpver()                 Stores the string containing the FTP API Γöé
  18259. Γöé                         version                                  Γöé
  18260. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18261. Γöéping()                   Sends a ping to the remote host to       Γöé
  18262. Γöé                         determine if the host is responding      Γöé
  18263. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18264.  
  18265.  
  18266. ΓòÉΓòÉΓòÉ 15.1. Return Values ΓòÉΓòÉΓòÉ
  18267.  
  18268. Most functions return a value of -1 to indicate failure and a value of 0 to 
  18269. indicate success.  Two functions do not return 0 and -1 values: ftplogoff(), 
  18270. which is of type void, and ftpping(), which returns an error code rather than 
  18271. storing the return value in ftperrno.  When the value is -1, the global integer 
  18272. variable ftperrno is set to one of the following codes: 
  18273.  
  18274.  Return Code         Description
  18275.  FTPSERVICE          Unknown service. 
  18276.  FTPHOST             Unknown host. 
  18277.  FTPSOCKET           Unable to obtain socket. 
  18278.  FTPCONNECT          Unable to connect to server. 
  18279.  FTPLOGIN            Login failed. 
  18280.  FTPABORT            Transfer aborted. 
  18281.  FTPLOCALFILE        Problem opening the local file. 
  18282.  FTPDATACONN         Problem initializing data connection. 
  18283.  FTPCOMMAND          Command failed. 
  18284.  FTPPROXYTHIRD       Proxy server does not support third party. 
  18285.  FTPNOPRIMARY        No primary connection for proxy transfer. 
  18286.  
  18287.  
  18288. ΓòÉΓòÉΓòÉ 15.2. ftpappend() ΓòÉΓòÉΓòÉ
  18289.  
  18290. The ftpappend() call appends information to a remote file. 
  18291.  
  18292. Syntax 
  18293.  
  18294. #include <ftpapi.h>
  18295.  
  18296. int ftpappend(host, userid, passwd, acct,  local,
  18297.           remote, transfertype)
  18298. char *host;
  18299. char *userid;
  18300. char *passwd;
  18301. char *acct;
  18302. char *local;
  18303. char *remote;
  18304. int transfertype;
  18305.  
  18306. Parameters 
  18307.  
  18308.  host 
  18309.    Host running the FTP server. 
  18310.  
  18311.    To specify the port number (other than the well-know port) used by the FTP 
  18312.    server,  code the host name, followed by a blank, then the port number. For 
  18313.    example, specify ftpappend ("server1 1234",...) 
  18314.  
  18315.  userid 
  18316.    ID used for logon. 
  18317.  
  18318.  passwd 
  18319.    Password of the user ID. 
  18320.  
  18321.  acct 
  18322.    Account (when needed); can be NULL. 
  18323.  
  18324.  local 
  18325.    Local file name. 
  18326.  
  18327.  remote 
  18328.    Remote file name. 
  18329.  
  18330.  transfertype 
  18331.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  18332.    binary. 
  18333.  
  18334.  Return Values 
  18335.  
  18336.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18337.  ftperrno indicates the specific error.  See Return Values for a description of 
  18338.  the return codes. 
  18339.  
  18340.  Examples 
  18341.  
  18342.   int rc;
  18343.   rc=ftpappend("conypc","jason","ehgr1",NULL,"abc.doc","new.doc",T_ASCII);
  18344.  
  18345.  The local ASCII file abc.doc is appended to the file new.doc in the current 
  18346.  working directory at the host conypc. 
  18347.  
  18348.  
  18349. ΓòÉΓòÉΓòÉ 15.3. ftpcd() ΓòÉΓòÉΓòÉ
  18350.  
  18351. The ftpcd() call changes the current working directory on a host. 
  18352.  
  18353. Syntax 
  18354.  
  18355. #include <ftpapi.h>
  18356.  
  18357. int ftpcd(host, userid, passwd, acct, dir)
  18358. char *host;
  18359. char *userid;
  18360. char *passwd;
  18361. char *acct,
  18362. char *dir;
  18363.  
  18364. Parameters 
  18365.  
  18366.  host 
  18367.    Host running the FTP server. 
  18368.  
  18369.    To specify the port number (other than the well-know port) used by the FTP 
  18370.    server,  code the host name, followed by a blank, then the port number. For 
  18371.    example, specify ftpcd ("server1 1234",...) 
  18372.  
  18373.  userid 
  18374.    ID used for logon. 
  18375.  
  18376.  passwd 
  18377.    Password of the user ID. 
  18378.  
  18379.  acct 
  18380.    Account (when needed); can be NULL. 
  18381.  
  18382.  dir 
  18383.    New working directory. 
  18384.  
  18385.  Return Values 
  18386.  
  18387.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18388.  ftperrno indicates the specific error.  See Return Values for a description of 
  18389.  the return codes. 
  18390.  
  18391.  Examples 
  18392.  
  18393.   int rc;
  18394.   rc=ftpcd("conypc","jason","ehgr1",NULL,"mydir");
  18395.  
  18396.  The current working directory is changed to mydir on the host conypc using the 
  18397.  user ID jason and the password ehgr1. 
  18398.  
  18399.  
  18400. ΓòÉΓòÉΓòÉ 15.4. ftpdelete() ΓòÉΓòÉΓòÉ
  18401.  
  18402. The ftpdelete() call deletes files on a remote host. 
  18403.  
  18404. Syntax 
  18405.  
  18406. #include <ftpapi.h>
  18407.  
  18408. int ftpdelete(host, userid, passwd, acct, name)
  18409. char *host;
  18410. char *userid;
  18411. char *passwd;
  18412. char *acct;
  18413. char *name;
  18414.  
  18415. Parameters 
  18416.  
  18417.  host 
  18418.    Host running the FTP server. 
  18419.  
  18420.    To specify the port number (other than the well-know port) used by the FTP 
  18421.    server,  code the host name, followed by a blank, then the port number. For 
  18422.    example, specify ftpdelete ("server1 1234",...) 
  18423.  
  18424.  userid 
  18425.    ID used for logon. 
  18426.  
  18427.  passwd 
  18428.    Password of the user ID. 
  18429.  
  18430.  acct 
  18431.    Account (when needed); can be NULL. 
  18432.  
  18433.  name 
  18434.    File to be deleted. 
  18435.  
  18436.  Return Values 
  18437.  
  18438.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18439.  ftperrno indicates the specific error.  See Return Values for a description of 
  18440.  the return codes. 
  18441.  
  18442.  Examples 
  18443.  
  18444.   int rc;
  18445.   rc=ftpdelete("conypc","jason","ehgr1",NULL,"abc.1");
  18446.  
  18447.  The file abc.1 is deleted on the host conypc using the user ID jason and the 
  18448.  password ehgr1. 
  18449.  
  18450.  
  18451. ΓòÉΓòÉΓòÉ 15.5. ftpdir() ΓòÉΓòÉΓòÉ
  18452.  
  18453. The ftpdir() call gets a directory in wide format from a host. 
  18454.  
  18455. Syntax 
  18456.  
  18457. #include <ftpapi.h>
  18458.  
  18459. int ftpdir(host, userid, passwd, acct, local, pattern,)
  18460. char *host;
  18461. char *userid;
  18462. char *passwd;
  18463. char *acct;
  18464. char *local;
  18465. char *pattern;
  18466.  
  18467. Parameters 
  18468.  
  18469.  host 
  18470.    Host running the FTP server. 
  18471.  
  18472.    To specify the port number (other than the well-know port) used by the FTP 
  18473.    server,  code the host name, followed by a blank, then the port number. For 
  18474.    example, specify ftpdir ("server1 1234",...) 
  18475.  
  18476.  userid 
  18477.    ID used for logon. 
  18478.  
  18479.  passwd 
  18480.    Password of the user ID. 
  18481.  
  18482.  acct 
  18483.    Account (when needed); can be NULL. 
  18484.  
  18485.  local 
  18486.    Local file name. 
  18487.  
  18488.  pattern 
  18489.    The file name or pattern of the files to be listed on the foreign host. 
  18490.    Patterns are any combination of ASCII characters.  The following two 
  18491.    characters have special meaning: 
  18492.  
  18493.    *        Shows that any character or group of characters can occupy that 
  18494.             position in the pattern. 
  18495.  
  18496.    ?        Shows that any single character can occupy that position in the 
  18497.             pattern. 
  18498.  
  18499.  Return Values 
  18500.  
  18501.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18502.  ftperrno indicates the specific error.  See Return Values for a description of 
  18503.  the return codes. 
  18504.  
  18505.  Examples 
  18506.  
  18507.   int rc;
  18508.   rc=ftpdir("conypc","jason","ehgr1",NULL,"conypc.dir","*.c");
  18509.  
  18510.  ftpdir() gets a directory of *.c files in wide format, and stores the 
  18511.  directory in a local file, conypc.dir. 
  18512.  
  18513.  
  18514. ΓòÉΓòÉΓòÉ 15.6. ftpget() ΓòÉΓòÉΓòÉ
  18515.  
  18516. The ftpget() call gets a file from an FTP server. 
  18517.  
  18518. Syntax 
  18519.  
  18520. #include <ftpapi.h>
  18521.  
  18522. int ftpget(host, userid, passwd, acct,  local, remote,
  18523.        mode, transfertype)
  18524. char *host;
  18525. char *userid;
  18526. char *passwd;
  18527. char *acct;
  18528. char *local;
  18529. char *remote;
  18530. char *mode;
  18531. int transfertype;
  18532.  
  18533. Parameters 
  18534.  
  18535.  host 
  18536.    Host running the FTP server. 
  18537.  
  18538.    To specify the port number (other than the well-know port) used by the FTP 
  18539.    server,  code the host name, followed by a blank, then the port number. For 
  18540.    example, specify ftpget ("server1 1234",...) 
  18541.  
  18542.  userid 
  18543.    ID used for logon. 
  18544.  
  18545.  passwd 
  18546.    Password of the user ID. 
  18547.  
  18548.  acct 
  18549.    Account (when needed); can be NULL. 
  18550.  
  18551.  local 
  18552.    Local file name. 
  18553.  
  18554.  remote 
  18555.    Remote file name. 
  18556.  
  18557.  mode 
  18558.    Either w for write or a for append. 
  18559.  
  18560.  transfertype 
  18561.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  18562.    binary. 
  18563.  
  18564.  Return Values 
  18565.  
  18566.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18567.  ftperrno indicates the specific error.  See Return Values for a description of 
  18568.  the return codes. 
  18569.  
  18570.  Examples 
  18571.  
  18572.   int rc;
  18573.   rc=ftpget("conypc","jason","ehgr1",NULL,"new.doc","abc.doc","w",T_ASCII);
  18574.  
  18575.  The system copies the ASCII file abc.doc on the host conypc into the local 
  18576.  current working directory as the file new.doc.  If the file new.doc already 
  18577.  exists in the local current working directory, the contents of the file 
  18578.  abc.doc overwrite the file new.doc. 
  18579.  
  18580.  
  18581. ΓòÉΓòÉΓòÉ 15.7. ftplogoff() ΓòÉΓòÉΓòÉ
  18582.  
  18583. The ftplogoff() call closes all current connections. An application must call 
  18584. this before terminating. 
  18585.  
  18586. Syntax 
  18587.  
  18588. #include <ftpapi.h>
  18589.  
  18590. void ftplogoff()
  18591.  
  18592.  
  18593. ΓòÉΓòÉΓòÉ 15.8. ftpls() ΓòÉΓòÉΓòÉ
  18594.  
  18595. The ftpls() call gets directory information in short format from a remote host 
  18596. and writes it to a local file. 
  18597.  
  18598. Syntax 
  18599.  
  18600. #include <ftpapi.h>
  18601.  
  18602. int ftpls(host, userid, passwd, acct, local, pattern)
  18603. char *host;
  18604. char *userid;
  18605. char *passwd;
  18606. char *acct;
  18607. char *local;
  18608. char *pattern;
  18609.  
  18610. Parameters 
  18611.  
  18612.  host 
  18613.    Host running the FTP server. 
  18614.  
  18615.    To specify the port number (other than the well-know port) used by the FTP 
  18616.    server,  code the host name, followed by a blank, then the port number. For 
  18617.    example, specify ftpls ("server1 1234",...) 
  18618.  
  18619.  userid 
  18620.    ID used for logon. 
  18621.  
  18622.  passwd 
  18623.    Password of the user ID. 
  18624.  
  18625.  acct 
  18626.    Account (when needed); can be NULL. 
  18627.  
  18628.  local 
  18629.    Local file into which the information is placed. 
  18630.  
  18631.  pattern 
  18632.    The file name or pattern of the files to be listed on the foreign host. 
  18633.    Patterns are any combination of ASCII characters.  The following two 
  18634.    characters have special meaning: 
  18635.  
  18636.    *        Shows that any character or group of characters can occupy that 
  18637.             position in the pattern. 
  18638.  
  18639.    ?        Shows that any single character can occupy that position in the 
  18640.             pattern. 
  18641.  
  18642.  Return Values 
  18643.  
  18644.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18645.  ftperrno indicates the specific error.  See Return Values for a description of 
  18646.  the return codes. 
  18647.  
  18648.  Examples 
  18649.  
  18650.   int rc;
  18651.   rc=ftpls("conypc","jason","ehgr1",NULL,"conypc.dir","*.c");
  18652.  
  18653.  ftpls() gets a directory of *.c files in short format and stores the names in 
  18654.  the local file conypc.dir. 
  18655.  
  18656.  
  18657. ΓòÉΓòÉΓòÉ 15.9. ftpmkd() ΓòÉΓòÉΓòÉ
  18658.  
  18659. The ftpmkd() call creates a new directory on a target machine. 
  18660.  
  18661. Syntax 
  18662.  
  18663. #include <ftpapi.h>
  18664.  
  18665. int ftpmkd(host, userid, passwd, acct, dir)
  18666. char *host;
  18667. char *userid;
  18668. char *passwd;
  18669. char *acct;
  18670. char *dir;
  18671.  
  18672. Parameters 
  18673.  
  18674.  host 
  18675.    Host running the FTP server 
  18676.  
  18677.    To specify the port number (other than the well-know port) used by the FTP 
  18678.    server,  code the host name, followed by a blank, then the port number. For 
  18679.    example, specify ftpmkd ("server1 1234",...) 
  18680.  
  18681.  userid 
  18682.    ID used for logon. 
  18683.  
  18684.  passwd 
  18685.    Password of the user ID. 
  18686.  
  18687.  acct 
  18688.    Account (when needed); can be NULL. 
  18689.  
  18690.  dir 
  18691.    Directory to be created. 
  18692.  
  18693.  Return Values 
  18694.  
  18695.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18696.  ftperrno indicates the specific error.  See Return Values for a description of 
  18697.  the return codes. 
  18698.  
  18699.  Examples 
  18700.  
  18701.   int rc;
  18702.   rc=ftpmkd("conypc","jason","ehgr1",NULL,"mydir");
  18703.  
  18704.  The directory mydir is created on the host conypc, using the user ID jason and 
  18705.  the password ehgr1. 
  18706.  
  18707.  
  18708. ΓòÉΓòÉΓòÉ 15.10. ftpping() ΓòÉΓòÉΓòÉ
  18709.  
  18710. The ftpping() call resolves a host name and sends a ping to the remote host to 
  18711. determine if the host is responding. 
  18712.  
  18713. Syntax 
  18714.  
  18715. #include <ftpapi.h>
  18716.  
  18717. int ftpping(host, len, addr)
  18718. char *host;
  18719. int len;
  18720. unsigned long *addr;
  18721.  
  18722. Parameters 
  18723.  
  18724.  host 
  18725.    Host running the FTP server. 
  18726.  
  18727.  len 
  18728.    Length of the ping packets. 
  18729.  
  18730.  addr 
  18731.    Buffer in which to return the host internet address. 
  18732.  
  18733.  Description 
  18734.  
  18735.  The ftpping() call tries to resolve the host name through a name server. If 
  18736.  the name server is not present, ftpping() searches the TCPIP\ETC\HOSTS file 
  18737.  for a matching host name.  Unlike the ping() call, ftpping() could take 
  18738.  several seconds because it must resolve the host name before it sends a ping. 
  18739.  For this reason, use ftpping() only in the first try to determine if the host 
  18740.  is responding.  The ftpping() call sets the addr parameter to the internet 
  18741.  address of the host.  After the first try, use this address value to call 
  18742.  ping. 
  18743.  
  18744.  If the ftpping() return value is positive, the return value is the number of 
  18745.  milliseconds it took for the echo to return.  If the return value is negative, 
  18746.  it contains an error code.  The parameter len specifies the length of the ping 
  18747.  packet(s). 
  18748.  
  18749.  Return Values 
  18750.  
  18751.  The following are ftpping() call return codes and their corresponding 
  18752.  descriptions: 
  18753.  
  18754.  Return Code         Description
  18755.  PINGREPLY           Host does not reply 
  18756.  PINGSOCKET          Unable to obtain socket 
  18757.  PINGPROTO           Unknown protocol ICMP 
  18758.  PINGSEND            Send failed 
  18759.  PINGRECV            Recv() failed 
  18760.  PINGHOST            Unknown host 
  18761.  
  18762.  Examples 
  18763.  
  18764.   int              rc;
  18765.   unsigned long    addr;
  18766.  
  18767.   rc = ftpping("conypc", 256, &addr);
  18768.  
  18769.  The ftpping() call sends a 256-byte ping packet to the host conypc. 
  18770.  
  18771.  
  18772. ΓòÉΓòÉΓòÉ 15.11. ftpproxy() ΓòÉΓòÉΓòÉ
  18773.  
  18774. The ftpproxy() call transfers a file between two remote servers without sending 
  18775. the file to the local host. 
  18776.  
  18777. Syntax 
  18778.  
  18779. #include <ftpapi.h>
  18780.  
  18781. int ftpproxy(host1, userid1, passwd1, acct1, host2, userid2,
  18782.          passwd2, acct2, fn1, fn2, transfertype)
  18783. char *host1;
  18784. char *userid1;
  18785. char *passwd1;
  18786. char *acct1;
  18787. char *host2;
  18788. char *userid2;
  18789. char *passwd2;
  18790. char *acct2;
  18791. char *fn1;
  18792. char *fn2;
  18793. int transfertype;
  18794.  
  18795. Parameters 
  18796.  
  18797.  host1 
  18798.    Target host running the FTP server. 
  18799.  
  18800.    To specify the port number (other than the well-know port) used by the FTP 
  18801.    server,  code the host name, followed by a blank, then the port number. For 
  18802.    example, specify ftpproxy ("server1 1234",...) 
  18803.  
  18804.  userid1 
  18805.    ID used for logon on host 1. 
  18806.  
  18807.  passwd1 
  18808.    Password of the user ID on host 1. 
  18809.  
  18810.  acct1 
  18811.    Account for host 1 (when needed); can be NULL. 
  18812.  
  18813.  host2 
  18814.    Source host running the FTP server. 
  18815.  
  18816.    To specify the port number (other than the well-know port) used by the FTP 
  18817.    server,  code the host name, followed by a blank, then the port number. For 
  18818.    example, specify ftpproxy (host1,..."server2 1234",...) 
  18819.  
  18820.  userid2 
  18821.    ID used for logon on host 2. 
  18822.  
  18823.  passwd2 
  18824.    Password of the user ID on host 2. 
  18825.  
  18826.  acct2 
  18827.    Account for host 2 (when needed); can be NULL. 
  18828.  
  18829.  fn1 
  18830.    File to be written on host 1. 
  18831.  
  18832.  fn2 
  18833.    File to be copied from host 2. 
  18834.  
  18835.  transfertype 
  18836.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  18837.    binary. 
  18838.  
  18839.  Description 
  18840.  
  18841.  The ftpproxy() call copies a file on a specified source host directly to a 
  18842.  specified target host, without involving the requesting host in the file 
  18843.  transfer.  This call is functionally the same as the FTP client subcommand 
  18844.  proxy put. 
  18845.  
  18846.  Notes: 
  18847.  
  18848.    1. For ftpproxy() to complete successfully, both the source and the target 
  18849.       hosts must be running the FTP servers. In addition, ftpproxy() does not 
  18850.       support connections through a firewall. 
  18851.  
  18852.    2. You can specify port number for either host1 or host2, or for both. 
  18853.  
  18854.  Return Values 
  18855.  
  18856.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18857.  ftperrno indicates the specific error.  See Return Values for a description of 
  18858.  the return codes. 
  18859.  
  18860.  Examples 
  18861.  
  18862.   int rc;
  18863.   rc=ftpproxy("pc1","oleg","erst",NULL,   /* target host information*/
  18864.               "pc2","yan", "dssa1", NULL, /* source host information*/
  18865.               "\tmp\newdoc.1",            /* target file name */
  18866.               "\tmp\doc.1",               /* source file name */
  18867.               T_ASCII);                   /* ASCII transfer */
  18868.  
  18869.  The ASCII file \tmp\doc.1 on the host pc2 is copied to host pc1 as the file 
  18870.  \tmp\newdoc.1. 
  18871.  
  18872.  
  18873. ΓòÉΓòÉΓòÉ 15.12. ftpput() ΓòÉΓòÉΓòÉ
  18874.  
  18875. The ftpput() call transfers a file to an FTP server. 
  18876.  
  18877. Syntax 
  18878.  
  18879. #include <ftpapi.h>
  18880.  
  18881. int ftpput(host, userid, passwd, acct, local, remote,
  18882.        transfertype)
  18883. char *host;
  18884. char *userid;
  18885. char *passwd;
  18886. char *acct;
  18887. char *local;
  18888. char *remote;
  18889. int transfertype;
  18890.  
  18891. Parameters 
  18892.  
  18893.  host 
  18894.    Host running the FTP server. 
  18895.  
  18896.    To specify the port number (other than the well-know port) used by the FTP 
  18897.    server,  code the host name, followed by a blank, then the port number. For 
  18898.    example, specify ftpput ("server1 1234",...) 
  18899.  
  18900.  userid 
  18901.    ID used for logon. 
  18902.  
  18903.  passwd 
  18904.    Password of the user ID. 
  18905.  
  18906.  acct 
  18907.    Account (when needed); can be NULL. 
  18908.  
  18909.  local 
  18910.    Local file name. 
  18911.  
  18912.  remote 
  18913.    Remote file name. 
  18914.  
  18915.  transfertype 
  18916.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  18917.    binary. 
  18918.  
  18919.  Return Values 
  18920.  
  18921.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18922.  ftperrno indicates the specific error.  See Return Values for a description of 
  18923.  the return codes. 
  18924.  
  18925.  Examples 
  18926.  
  18927.   int rc;
  18928.   rc=ftpput("conypc","jason","ehgr1",NULL,"abc.doc","new.doc",T_ASCII);
  18929.  
  18930.  The system copies the ASCII file abc.doc on the local current working 
  18931.  directory to the current working directory of the host conypc as file new.doc. 
  18932.  If the file new.doc already exists, the contents of the file abc.doc overwrite 
  18933.  the file new.doc. 
  18934.  
  18935.  
  18936. ΓòÉΓòÉΓòÉ 15.13. ftpputunique() ΓòÉΓòÉΓòÉ
  18937.  
  18938. The ftpputunique() call transfers a file to a host and ensures it is created 
  18939. with a unique name. 
  18940.  
  18941. Syntax 
  18942.  
  18943. #include <ftpapi.h>
  18944.  
  18945. int ftpputunique(host, userid, passwd, acct, local, remote,
  18946.                  transfertype)
  18947. char *host;
  18948. char *userid;
  18949. char *passwd;
  18950. char *acct;
  18951. char *local;
  18952. char *remote;
  18953. int transfertype;
  18954.  
  18955. Parameters 
  18956.  
  18957.  host 
  18958.    Host running the FTP server. 
  18959.  
  18960.    To specify the port number (other than the well-know port) used by the FTP 
  18961.    server,  code the host name, followed by a blank, then the port number. For 
  18962.    example, specify ftpputunique ("server1 1234",...) 
  18963.  
  18964.  userid 
  18965.    ID used for logon. 
  18966.  
  18967.  passwd 
  18968.    Password of the user ID. 
  18969.  
  18970.  acct 
  18971.    Account (when needed); can be NULL. 
  18972.  
  18973.  local 
  18974.    Local file name. 
  18975.  
  18976.  remote 
  18977.    Remote file name. 
  18978.  
  18979.  transfertype 
  18980.    Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  18981.    binary. 
  18982.  
  18983.  Description 
  18984.  
  18985.  The ftpputunique() call copies a local file to a file on a specified host. It 
  18986.  guarantees that the new file will have a unique name and that the new file 
  18987.  will not overwrite a file with the same name. If the file already exists on 
  18988.  the host, a new and unique file name is created and used as the target of the 
  18989.  file transfer. 
  18990.  
  18991.  Return Values 
  18992.  
  18993.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  18994.  ftperrno indicates the specific error.  See Return Values for a description of 
  18995.  the return codes. 
  18996.  
  18997.  Examples 
  18998.  
  18999.   int rc;
  19000.   rc=ftpputunique(
  19001.          "conypc","jason","ehgr1",NULL,"abc.doc", "new.doc",T_ASCII);
  19002.  
  19003.  The ASCII file abc.doc is copied to the current working directory of the host 
  19004.  conypc as file new.doc, unless the file new.doc already exists.  If the file 
  19005.  new.doc already exists, the file new.doc is given a new name unique within the 
  19006.  current working directory on the host conypc.  The name of the new file is 
  19007.  displayed upon successful completion of the file transfer. 
  19008.  
  19009.  
  19010. ΓòÉΓòÉΓòÉ 15.14. ftppwd() ΓòÉΓòÉΓòÉ
  19011.  
  19012. The ftppwd() call stores the string containing the FTP server description of 
  19013. the current working directory on the host to the buffer. 
  19014.  
  19015. Syntax 
  19016.  
  19017. #include <ftpapi.h>
  19018.  
  19019. int ftppwd(host, userid, passwd, acct, buf, buflen)
  19020. char *host;
  19021. char *userid;
  19022. char *passwd;
  19023. char *acct,
  19024. char *buf;
  19025. crt *buflen;
  19026.  
  19027. Parameters 
  19028.  
  19029.  host 
  19030.    Host running the FTP server. 
  19031.  
  19032.    To specify the port number (other than the well-know port) used by the FTP 
  19033.    server,  code the host name, followed by a blank, then the port number. For 
  19034.    example, specify ftppwd ("server1 1234",...) 
  19035.  
  19036.  userid 
  19037.    ID used for logon. 
  19038.  
  19039.  passwd 
  19040.    Password of the user ID. 
  19041.  
  19042.  acct 
  19043.    Account (when needed); can be NULL. 
  19044.  
  19045.  buf 
  19046.    Buffer to store the string returned by the FTP server. 
  19047.  
  19048.  buflen 
  19049.    Length of buf. 
  19050.  
  19051.  Description 
  19052.  
  19053.  The ftppwd() call stores the string containing the FTP server description of 
  19054.  the current working directory on the host to the buffer buf. The string 
  19055.  describing the current working directory is truncated to fit buf if it is 
  19056.  longer than buflen.  The returned string is always null-terminated. 
  19057.  
  19058.  Return Values 
  19059.  
  19060.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  19061.  ftperrno indicates the specific error.  See Return Values for a description of 
  19062.  the return codes. 
  19063.  
  19064.  Examples 
  19065.  
  19066.   int rc;
  19067.   rc=ftppwd("conypc","jason","ehgr1","dirbuf", sizeof dirbuf);
  19068.  
  19069.  After the ftppwd() call, the buffer dirbuf contains the following: 
  19070.  
  19071.   "C:\" is current directory.
  19072.  
  19073.  The server reply describing the current working directory on host conypc using 
  19074.  user ID jason with password eghr1 is stored to dirbuf. 
  19075.  
  19076.  
  19077. ΓòÉΓòÉΓòÉ 15.15. ftpquote() ΓòÉΓòÉΓòÉ
  19078.  
  19079. The ftpquote() call sends a string to the server verbatim. 
  19080.  
  19081. Syntax 
  19082.  
  19083. #include <ftpapi.h>
  19084.  
  19085. int ftpquote(host, userid, passwd, acct, quotestr)
  19086. char *host;
  19087. char *userid;
  19088. char *passwd;
  19089. char *acct;
  19090. char *quotestr;
  19091.  
  19092. Parameters 
  19093.  
  19094.  host 
  19095.    Host running the FTP server. 
  19096.  
  19097.    To specify the port number (other than the well-know port) used by the FTP 
  19098.    server,  code the host name, followed by a blank, then the port number. For 
  19099.    example, specify ftpquote ("server1 1234",...) 
  19100.  
  19101.  userid 
  19102.    ID used for logon. 
  19103.  
  19104.  passwd 
  19105.    Password of the user ID. 
  19106.  
  19107.  acct 
  19108.    Account (when needed); can be NULL. 
  19109.  
  19110.  quotestr 
  19111.    Quote string to be passed to the FTP server verbatim. 
  19112.  
  19113.  Return Values 
  19114.  
  19115.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  19116.  ftperrno indicates the specific error.  See Return Values for a description of 
  19117.  the return codes. 
  19118.  
  19119.  Examples 
  19120.  
  19121.   int rc;
  19122.   rc=ftpquote("conypc","jason","ehgr1",NULL,"site idle 2000");
  19123.  
  19124.  The idle is set to time out in 2000 seconds. Your server might not support 
  19125.  that amount of idle time. 
  19126.  
  19127.  
  19128. ΓòÉΓòÉΓòÉ 15.16. ftprename() ΓòÉΓòÉΓòÉ
  19129.  
  19130. The ftprename() call renames a file on a remote host. 
  19131.  
  19132. Syntax 
  19133.  
  19134. #include <ftpapi.h>
  19135.  
  19136. int ftprename(host, userid, passwd, acct, namefrom, nameto)
  19137. char *host;
  19138. char *userid;
  19139. char *passwd;
  19140. char *acct;
  19141. char *namefrom;
  19142. char *nameto;
  19143.  
  19144. Parameters 
  19145.  
  19146.  host 
  19147.    Host running the FTP server. 
  19148.  
  19149.    To specify the port number (other than the well-know port) used by the FTP 
  19150.    server,  code the host name, followed by a blank, then the port number. For 
  19151.    example, specify ftprename ("server1 1234",...) 
  19152.  
  19153.  userid 
  19154.    ID used for logon. 
  19155.  
  19156.  passwd 
  19157.    Password of the user ID. 
  19158.  
  19159.  acct 
  19160.    Account (when needed); can be NULL. 
  19161.  
  19162.  namefrom 
  19163.    Original file name. 
  19164.  
  19165.  nameto 
  19166.    New file name. 
  19167.  
  19168.  Return Values 
  19169.  
  19170.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  19171.  ftperrno indicates the specific error.  See Return Values for a description of 
  19172.  the return codes. 
  19173.  
  19174.  Examples 
  19175.  
  19176.   int rc;
  19177.   rc=ftprename("conypc","jason","ehgr1",NULL,"abc.1","cd.fg");
  19178.  
  19179.  The file abc.1 is renamed to cd.fg on host conypc, using user ID jason, with 
  19180.  password ehgr1. 
  19181.  
  19182.  
  19183. ΓòÉΓòÉΓòÉ 15.17. ftprmd() ΓòÉΓòÉΓòÉ
  19184.  
  19185. The ftprmd() call removes a directory on a target machine. 
  19186.  
  19187. Syntax 
  19188.  
  19189. #include <ftpapi.h>
  19190.  
  19191. int ftprmd(host, userid, passwd, acct, dir)
  19192. char *host;
  19193. char *userid;
  19194. char *passwd;
  19195. char *acct;
  19196. char *dir;
  19197.  
  19198. Parameters 
  19199.  
  19200.  host 
  19201.    Host running the FTP server. 
  19202.  
  19203.    To specify the port number (other than the well-know port) used by the FTP 
  19204.    server,  code the host name, followed by a blank, then the port number. For 
  19205.    example, specify ftprmd ("server1 1234",...) 
  19206.  
  19207.  userid 
  19208.    ID used for logon. 
  19209.  
  19210.  passwd 
  19211.    Password of the user ID. 
  19212.  
  19213.  acct 
  19214.    Account (when needed); can be NULL. 
  19215.  
  19216.  dir 
  19217.    Directory to be removed. 
  19218.  
  19219.  Return Values 
  19220.  
  19221.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  19222.  ftperrno indicates the specific error.  See Return Values for a description of 
  19223.  the return codes. 
  19224.  
  19225.  Examples 
  19226.  
  19227.   int rc;
  19228.   rc=ftprmd("conypc","jason","ehgr1",NULL,"mydir");
  19229.  
  19230.  The directory, mydir, is removed on the host, conypc, using the user ID, 
  19231.  jason, and the password, ehgr1. 
  19232.  
  19233.  
  19234. ΓòÉΓòÉΓòÉ 15.18. ftpsite() ΓòÉΓòÉΓòÉ
  19235.  
  19236. The ftpsite() call executes the site command. (For more information about the 
  19237. site command, see the TCP/IP Command Reference .) 
  19238.  
  19239. Note:  ftpsite() does not support connections through a firewall. 
  19240.  
  19241.  Syntax 
  19242.  
  19243.   #include <ftpapi.h>
  19244.  
  19245.   int ftpsite(host, userid, passwd, acct, sitestr)
  19246.   char *host;
  19247.   char *userid;
  19248.   char *passwd;
  19249.   char *acct;
  19250.   char *sitestr;
  19251.  
  19252.  Parameters 
  19253.  
  19254.  host 
  19255.    Host running the FTP server. 
  19256.  
  19257.    To specify the port number (other than the well-know port) used by the FTP 
  19258.    server,  code the host name, followed by a blank, then the port number. For 
  19259.    example, specify ftpsite ("server1 1234",...) 
  19260.  
  19261.  userid 
  19262.    ID used for logon. 
  19263.  
  19264.  passwd 
  19265.    Password of the user ID. 
  19266.  
  19267.  acct 
  19268.    Account (when needed); can be NULL. 
  19269.  
  19270.  sitestr 
  19271.    Site string to be executed. 
  19272.  
  19273.  Return Values 
  19274.  
  19275.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  19276.  ftperrno indicates the specific error.  See Return Values for a description of 
  19277.  the return codes. 
  19278.  
  19279.  Examples 
  19280.  
  19281.   int rc;
  19282.   rc=ftpsite("conypc","jason","ehgr1",NULL,"idle 2000");
  19283.  
  19284.  The idle is set to time out in 2000 seconds. Your server might not support 
  19285.  that amount of idle time. 
  19286.  
  19287.  
  19288. ΓòÉΓòÉΓòÉ 15.19. ftpsys() ΓòÉΓòÉΓòÉ
  19289.  
  19290. The ftpsys() call stores the string containing the FTP server description of 
  19291. the operating system running on the host in a buffer. 
  19292.  
  19293. Syntax 
  19294.  
  19295. #include <ftpapi.h>
  19296.  
  19297. int ftpsys(host, userid, passwd, acct, buf, buflen)
  19298. char *host;
  19299. char *userid;
  19300. char *passwd;
  19301. char *acct,
  19302. char *buf;
  19303. int *buflen;
  19304.  
  19305. Parameters 
  19306.  
  19307.  host 
  19308.    Host running the FTP server. 
  19309.  
  19310.    To specify the port number (other than the well-know port) used by the FTP 
  19311.    server,  code the host name, followed by a blank, then the port number. For 
  19312.    example, specify ftpsys ("server1 1234",...) 
  19313.  
  19314.  userid 
  19315.    ID used for logon. 
  19316.  
  19317.  passwd 
  19318.    Password of the user ID. 
  19319.  
  19320.  acct 
  19321.    Account (when needed); can be NULL. 
  19322.  
  19323.  buf 
  19324.    Buffer to store the string returned by the FTP server. 
  19325.  
  19326.  buflen 
  19327.    Length of buf. 
  19328.  
  19329.  Description 
  19330.  
  19331.  The ftpsys() call stores the string containing the FTP server description of 
  19332.  the operating system running on the host in the buffer buf. The string 
  19333.  describing the operating system of the host is truncated to fit buf if it is 
  19334.  longer than buflen.  The returned string is always null-terminated. 
  19335.  
  19336.  Return Values 
  19337.  
  19338.  The value 0 indicates success; the value -1 indicates an error.  The value of 
  19339.  ftperrno indicates the specific error.  See Return Values for a description of 
  19340.  the return codes. 
  19341.  
  19342.  Examples 
  19343.  
  19344.   int rc;
  19345.   rc=ftpsys("ralvmm","jason","ehgr1",hostsysbuf, sizeof hostsysbuf);
  19346.  
  19347.  After the ftpsys() call the buffer hostsysbuf contains the following: 
  19348.  
  19349.   VM is the operating system of this server.
  19350.  
  19351.  The FTP server reply describing the operating system of host ralvmm using user 
  19352.  ID jason with password eghr1 is stored to hostsysbuf. 
  19353.  
  19354.  
  19355. ΓòÉΓòÉΓòÉ 15.20. ftptrcoff() ΓòÉΓòÉΓòÉ
  19356.  
  19357. The ftptrcoff() closes the trace file, and stops tracing of the command and 
  19358. reply sequences that were sent over the control connection between the local 
  19359. and remote hosts. 
  19360.  
  19361. Syntax 
  19362.  
  19363. #include <ftpapi.h>
  19364.  
  19365. int ftptrcoff(void)
  19366.  
  19367. Return Values 
  19368.  
  19369. The ftptrcoff() always return a value of 0. 
  19370.  
  19371. Examples 
  19372.  
  19373. int rc;
  19374. rc = ftptrcoff();
  19375.  
  19376.  
  19377. ΓòÉΓòÉΓòÉ 15.21. ftptrcon() ΓòÉΓòÉΓòÉ
  19378.  
  19379. The ftptrcon() call opens the trace file specified and starts tracing. 
  19380.  
  19381. Syntax 
  19382.  
  19383. #include <ftpapi.h>
  19384.  
  19385. int ftptrcon(fileSpec, mode)
  19386. char *fileSpec;
  19387. int mode;
  19388.  
  19389. Parameters 
  19390.  
  19391.  fileSpec 
  19392.    Identifies the name of the trace file. 
  19393.  
  19394.  mode 
  19395.    Specifies the trace mode as overwrite or append.  Use M_OVERLAY for trace 
  19396.    data which overwrites previous information.  Use M_APPEND for trace data 
  19397.    which appends to previous information. 
  19398.  
  19399.  Description 
  19400.  
  19401.  The ftptrcon() call opens the trace file specified and starts tracing of the 
  19402.  command and reply sequences sent over the control connection between the local 
  19403.  and remote hosts.  The trace file can be written over or appended to. 
  19404.  
  19405.  No notification is provided if writing of trace data fails. 
  19406.  
  19407.  Telnet command and reply sequences are not traced nor are command and reply 
  19408.  sequences between the local host and a proxy host. 
  19409.  
  19410.  Return Values 
  19411.  
  19412.  There are three possible return values for ftptrcon(): 
  19413.  
  19414.      0 when successful 
  19415.      TRCMODE indicates the value set into mode was not valid 
  19416.      TRCOPEN indicates the trace file could not be opened 
  19417.  
  19418.  Examples 
  19419.  
  19420.  To write the trace data into a file named api.trc in the C:\WORK directory, 
  19421.  use : 
  19422.  
  19423.   int rc;
  19424.   rc = ftptrcon("c\\work\\api.trc", M_OVERLAY);
  19425.  
  19426.  If the file already existed, the new trace data overwrites the previous trace 
  19427.  data (overlay mode). 
  19428.  
  19429.  
  19430. ΓòÉΓòÉΓòÉ 15.22. ftpver() ΓòÉΓòÉΓòÉ
  19431.  
  19432. The ftpver() call stores the string containing the FTP API version. 
  19433.  
  19434. Syntax 
  19435.  
  19436. #include <ftpapi.h>
  19437.  
  19438. int ftpver(buf, buflen)
  19439. char *buf;
  19440. int buflen;
  19441.  
  19442. Parameters 
  19443.  
  19444.  buf 
  19445.    Identifies the buffer to store the version string. 
  19446.  
  19447.  buflen 
  19448.    Specifies the length of the buffer. 
  19449.  
  19450.  Description 
  19451.  
  19452.  The ftpver() call stores the string containing the FTP API version. The string 
  19453.  is truncated to fit into the buffer if it is longer than the buffer length. 
  19454.  The returned string is always null-terminated. 
  19455.  
  19456.  Return Values 
  19457.  
  19458.  The value of 0 when successful.  The value of -1  when the complete version 
  19459.  string could not be copied because the buffer length was too small. 
  19460.  
  19461.  Examples 
  19462.  
  19463.   int rc;
  19464.   rc = ftpver(verBuf, bufLen);
  19465.  
  19466.  After the ftpver() call, the buffer contains the version number. 
  19467.  
  19468.  
  19469. ΓòÉΓòÉΓòÉ 15.23. ping() ΓòÉΓòÉΓòÉ
  19470.  
  19471. The ping() call sends a ping to the remote host to determine if the host is 
  19472. responding. 
  19473.  
  19474. Syntax 
  19475.  
  19476. #include <ftpapi.h>
  19477.  
  19478. int ping(addr, len)
  19479. unsigned long addr;
  19480. int len;
  19481.  
  19482. Parameters 
  19483.  
  19484.  addr 
  19485.    Internet address of the host in network byte order. 
  19486.  
  19487.  len 
  19488.    Length of the ping packets. 
  19489.  
  19490.  Description 
  19491.  
  19492.  The ping() call sends a ping to the host with ICMP Echo Request.  The ping() 
  19493.  call is useful to determine whether the host is alive before attempting FTP 
  19494.  transfers, because time-out on regular connections is more than a minute. The 
  19495.  ping() call returns within 3 seconds, at most, if the host is not responding. 
  19496.  
  19497.  Return Values 
  19498.  
  19499.  If the return value is positive, the return value is the number of 
  19500.  milliseconds it took for the echo to return.  If the return value is negative, 
  19501.  it contains an error code. 
  19502.  
  19503.  The following are ping() call return codes and their corresponding 
  19504.  descriptions: 
  19505.  
  19506.  Return Code       Description
  19507.  PINGREPLY         Host does not reply 
  19508.  PINGSOCKET        Unable to obtain socket 
  19509.  PINGPROTO         Unknown protocol ICMP 
  19510.  PINGSEND          Send failed 
  19511.  PINGRECV          Recv() failed 
  19512.  
  19513.  Examples 
  19514.  
  19515.   #include <stdio.h>
  19516.   #include <netdb.h>
  19517.   #include <ftpapi.h>
  19518.  
  19519.   struct hostent *hp;     /* Pointer to host info */
  19520.  
  19521.   main(int argc, char *argv[], char *envp[])
  19522.   {
  19523.      int i;
  19524.      unsigned long addr;
  19525.  
  19526.      if (argc!=2) {
  19527.        printf("Usage: p <host>\n");
  19528.        exit(1);
  19529.      }
  19530.  
  19531.      hp = gethostbyname(argv[1]);
  19532.  
  19533.   if (hp) {
  19534.           memcpy( (char *)&addr, hp->h_addr, hp->h_length);
  19535.           i = ping(addr,256);
  19536.           printf("ping reply in %d milliseconds\n",i);
  19537.   } else {
  19538.           printf("unknown host\n");
  19539.           exit(2);
  19540.          }
  19541.          ftplogoff(); /* close all connections */
  19542.   }
  19543.  
  19544.  
  19545. ΓòÉΓòÉΓòÉ 16. Resource ReSerVation Protocol API ΓòÉΓòÉΓòÉ
  19546.  
  19547. This table briefly describes each RSVP API call, and provides links to the 
  19548. syntax, parameters, and other appropriate information for these calls: 
  19549.  
  19550. RSVP API Quick Reference 
  19551.  
  19552. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  19553. ΓöéRSVP Call                Description                              Γöé
  19554. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19555. Γöérapi_dispatch()          Dispatches an RSVP event                 Γöé
  19556. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19557. Γöérapi_fmt_adspec()        Formats adspec information for printng   Γöé
  19558. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19559. Γöérapi_fmt_filtspec()      Formats filterspec information for       Γöé
  19560. Γöé                         printing                                 Γöé
  19561. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19562. Γöérapi_fmt_flowspec()      Formats flowspec information for printingΓöé
  19563. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19564. Γöérapi_fmt_tspec()         Formats tspec information for printing   Γöé
  19565. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19566. Γöérapi_getfd()             Gets the alert socket for a session      Γöé
  19567. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19568. Γöérapi_release()           Ends an RSVP session                     Γöé
  19569. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19570. Γöérapi_reserve()           Makes a reservation to be a receiver     Γöé
  19571. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19572. Γöérapi_sender()            Specifies parameters to become a sender  Γöé
  19573. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19574. Γöérapi_session()           Starts an RSVP session                   Γöé
  19575. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19576. Γöérapi_version()           Gets the RSVP version                    Γöé
  19577. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  19578. Γöéuser_rapi_callback()     Initializes the user callback function   Γöé
  19579. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  19580.  
  19581.  
  19582. ΓòÉΓòÉΓòÉ 16.1. Return Values and Definitions ΓòÉΓòÉΓòÉ
  19583.  
  19584. These return values have these meanings for RSVP calls: 
  19585.  
  19586.  RAPI_ERR_OK No error. 
  19587.  RAPI_ERR_INVAL Parameter not valid. 
  19588.  RAPI_ERR_MAXSESS Too many sessions. 
  19589.  RAPI_ERR_BADSID Session identifier out of valid range. 
  19590.  RAPI_ERR_N_FFS Wrong n_filter or n_flow for this style. 
  19591.  RAPI_ERR_BADSTYLE Illegal reservation style. 
  19592.  RAPI_ERR_SYSCALL System error. See errno. 
  19593.  RAPI_ERR_OVERFLOW Parameter list overflow. 
  19594.  RAPI_ERR_MEMFULL Not enough memory. 
  19595.  RAPI_ERR_NORSVP Daemon does not respond or does not exist. 
  19596.  RAPI_ERR_OBJTYPE Object type error. 
  19597.  RAPI_ERR_OBJLEN Object length error. 
  19598.  RAPI_ERR_NOTSPEC No sender tspec in rapi_sender. 
  19599.  RAPI_ERR_INTSERV Intserv format error. 
  19600.  RAPI_ERR_BADSEND Sender interface does not exist. 
  19601.  RAPI_ERR_BADRECV Receiver interface does not exist. 
  19602.  RAPI_ERR_UNSUPPORTED Unsupported return code. 
  19603.  RAPI_ERR_UNKNOWN Unknown return code. 
  19604.  
  19605.  
  19606. ΓòÉΓòÉΓòÉ 16.2. rapi_dispatch() ΓòÉΓòÉΓòÉ
  19607.  
  19608. The rapi_dispatch() call dispatches an RSVP event. 
  19609.  
  19610. Syntax 
  19611.  
  19612. #include <rsvprapi.h>
  19613.  
  19614. int rapi_dispatch(void);
  19615.  
  19616. Parameters: None. 
  19617.  
  19618. Description 
  19619.  
  19620. The rapi_getfd() call returns a socket for the session.  The socket may be used 
  19621. with the select() call as a read socket. When select() indicates that there is 
  19622. some data to read, call rapi_dispatch() call to read and process the data from 
  19623. the socket.  Typically rapi_dispatch() will call user_rapi_callback() to 
  19624. provide the program with information.  The user program should only process 
  19625. data from the socket by calling rapi_dispatch(). 
  19626.  
  19627. Return Values and Descriptions 
  19628.  
  19629. These return values indicate the specific errors for rapi_dispatch(): 
  19630.  
  19631.  RAPI_ERR_INVAL           Conversion from RSVP daemon structures to API 
  19632.                           structures encountered data values that are not valid 
  19633.                           or not supported. 
  19634.  
  19635.  RAPI_ERR_MEMFULL         Could not allocate memory. 
  19636.  
  19637.  RAPI_ERR_NORSVP          Could not connect to the RSVP daemon.  It may not be 
  19638.                           running. 
  19639.  
  19640.  Related Calls 
  19641.  
  19642.       rapi_getfd() 
  19643.       select() 
  19644.       user_rapi_callback() 
  19645.  
  19646.  
  19647. ΓòÉΓòÉΓòÉ 16.3. rapi_fmt_adspec() ΓòÉΓòÉΓòÉ
  19648.  
  19649. The rapi_fmt_adspec() call formats adspec information as a printable string. 
  19650.  
  19651. Syntax 
  19652.  
  19653. #include <rsvprapi.h>
  19654.  
  19655. void rapi_fmt_adspec(
  19656.        rapi_adspec_t *padspec,
  19657.        char          *buffer,
  19658.        int            length);
  19659.  
  19660. Parameters 
  19661.  
  19662.  padspec 
  19663.            Pointer to an adspec. 
  19664.  
  19665.  buffer 
  19666.            Pointer to a buffer where the information will be put for printing. 
  19667.  
  19668.  length 
  19669.            The number of characters the buffer can hold. 
  19670.  
  19671.  Description 
  19672.  
  19673.  The rapi_fmt_adspec() call formats the information in an adspec into the 
  19674.  buffer, in a form suitable for printing.  The output information is truncated 
  19675.  if the buffer is too small. 
  19676.  
  19677.  Return Values 
  19678.  
  19679.  None. 
  19680.  
  19681.  Related Calls 
  19682.  
  19683.       rapi_fmt_filtspec() 
  19684.       rapi_fmt_flowspec() 
  19685.       rapi_fmt_tspec() 
  19686.  
  19687.  
  19688. ΓòÉΓòÉΓòÉ 16.4. rapi_fmt_filtspec() ΓòÉΓòÉΓòÉ
  19689.  
  19690. The rapi_fmt_filtspec() call formats filterspec information as a printable 
  19691. string. 
  19692.  
  19693. Syntax 
  19694.  
  19695. #include <rsvprapi.h>
  19696.  
  19697. void rapi_fmt_filtspec (
  19698.         rapi_filter_t *pfilter,
  19699.         char          *buffer
  19700.         int            length);
  19701.  
  19702. Parameters 
  19703.  
  19704.  pfilter 
  19705.            Pointer to a filterspec. 
  19706.  
  19707.  buffer 
  19708.            Pointer to a buffer where the information will be put for printing. 
  19709.  
  19710.  length 
  19711.            The number of characters the buffer can hold. 
  19712.  
  19713.  Description 
  19714.  
  19715.  The rapi_fmt_filtspec() call formats the information in a filterspec into the 
  19716.  buffer, in a form suitable for printing.  The output information is truncated 
  19717.  if the buffer is too small. 
  19718.  
  19719.  Return Values 
  19720.  
  19721.  None. 
  19722.  
  19723.  Related Calls 
  19724.  
  19725.       rapi_fmt_adspec() 
  19726.       rapi_fmt_flowspec() 
  19727.       rapi_fmt_tspec() 
  19728.  
  19729.  
  19730. ΓòÉΓòÉΓòÉ 16.5. rapi_fmt_flowspec() ΓòÉΓòÉΓòÉ
  19731.  
  19732. The rapi_fmt_flowspec() call formats flowspec information as a printable 
  19733. string. 
  19734.  
  19735. Syntax 
  19736.  
  19737. #include <rsvprapi.h>
  19738.  
  19739. void rapi_fmt_flowspec(
  19740.        rapi_flowspec_t *pflowspec,
  19741.        char            *buffer,
  19742.        int              length);
  19743.  
  19744. Parameters 
  19745.  
  19746.  pflowspec 
  19747.            Pointer to a flowspec. 
  19748.  
  19749.  buffer 
  19750.            Pointer to a buffer where the information will be put for printing. 
  19751.  
  19752.  length 
  19753.            The number of characters the buffer can hold. 
  19754.  
  19755.  Description 
  19756.  
  19757.  The rapi_fmt_flowspec() call formats the information in a flowspec into the 
  19758.  buffer, in a form suitable for printing.  The output information is truncated 
  19759.  if the buffer is too small. 
  19760.  
  19761.  Return Values 
  19762.  
  19763.  None. 
  19764.  
  19765.  Related Calls 
  19766.  
  19767.       rapi_fmt_adspec() 
  19768.       rapi_fmt_filtspec() 
  19769.       rapi_fmt_tspec() 
  19770.  
  19771.  
  19772. ΓòÉΓòÉΓòÉ 16.6. rapi_fmt_tspec() ΓòÉΓòÉΓòÉ
  19773.  
  19774. The rapi_fmt_tspec() call formats tspec information as a printable string. 
  19775.  
  19776. Syntax 
  19777.  
  19778. #include <rsvprapi.h>
  19779.  
  19780. void rapi_fmt_tspec(
  19781.        rapi_tspec_t *ptspec,
  19782.        char         *buffer,
  19783.        int           length);
  19784.  
  19785. Parameters 
  19786.  
  19787.  ptspec 
  19788.            Pointer to a tspec. 
  19789.  
  19790.  buffer 
  19791.            Pointer to a buffer where the information will be put for printing. 
  19792.  
  19793.  length 
  19794.            The number of characters the buffer can hold. 
  19795.  
  19796.  Description 
  19797.  
  19798.  The rapi_fmt_tspec() call formats the information in a tspec into the buffer, 
  19799.  in a form suitable for printing.  The output information is truncated if the 
  19800.  buffer is too small. 
  19801.  
  19802.  Return Values 
  19803.  
  19804.  None. 
  19805.  
  19806.  Related Calls 
  19807.  
  19808.       rapi_fmt_adspec() 
  19809.       rapi_fmt_filtspec() 
  19810.       rapi_fmt_flowspec() 
  19811.  
  19812.  
  19813. ΓòÉΓòÉΓòÉ 16.7. rapi_getfd() ΓòÉΓòÉΓòÉ
  19814.  
  19815. The rapi_getfd() call obtains the alert socket for a session. 
  19816.  
  19817. Syntax 
  19818.  
  19819. #include <rsvprapi.h>
  19820.  
  19821. int  rapi_getfd(
  19822.        rapi_sid_t sid);
  19823.  
  19824. Parameters 
  19825.  
  19826.  sid 
  19827.            Session identifier. 
  19828.  
  19829.  Description 
  19830.  
  19831.  The rapi_getfd() call formats the information in a tspec into the buffer, in a 
  19832.  form suitable for printing.  The output information is truncated if the buffer 
  19833.  is too small. 
  19834.  
  19835.  Return Values 
  19836.  
  19837.  A socket number is returned, or -1.  The value -1 indicates an invalid session 
  19838.  ID was used as an argument. 
  19839.  
  19840.  Related Calls 
  19841.  
  19842.       rapi_dispatch() 
  19843.       rapi_session() 
  19844.       select() 
  19845.       user_rapi_callback() 
  19846.  
  19847.  
  19848. ΓòÉΓòÉΓòÉ 16.8. rapi_release() ΓòÉΓòÉΓòÉ
  19849.  
  19850. The rapi_release() call ends an RSVP session. 
  19851.  
  19852. Syntax 
  19853.  
  19854. #include <rsvprapi.h>
  19855.  
  19856. int  rapi_release(
  19857.        rapi_sid_t sid);
  19858.  
  19859. Parameters 
  19860.  
  19861.  sid 
  19862.            Session identifier of an open session. 
  19863.  
  19864.  Description 
  19865.  
  19866.  The rapi_release() call closes an open session.  The session ID will no longer 
  19867.  be valid. 
  19868.  
  19869.  Return Values and Descriptions 
  19870.  
  19871.  RAPI_ERR_BADSID          The session identifier is invalid, or the session is 
  19872.                           not open 
  19873.  
  19874.  RAPI_ERR_NORSVP          The API could not communicate with the RSVP daemon. 
  19875.  
  19876.  RAPI_ERR_OK              The session was closed successfully. 
  19877.  
  19878.  Related Calls 
  19879.  
  19880.       rapi_session() 
  19881.  
  19882.  
  19883. ΓòÉΓòÉΓòÉ 16.9. rapi_reserve() ΓòÉΓòÉΓòÉ
  19884.  
  19885. The rapi_reserve() call makes a reservation to be a receiver. 
  19886.  
  19887. Syntax 
  19888.  
  19889. #include <rsvprapi.h>
  19890.  
  19891. int  rapi_reserve(
  19892.        rapi_sid_t         sid,
  19893.        int                flag,
  19894.        struct sockaddr   *phost,
  19895.        rapi_sytleid_t     style,
  19896.        rapi_stylex_t     *pstyle,
  19897.        rapi_policy_t     *ppolicy,
  19898.        int                numFilters,
  19899.        rapi_filter_t     *pfilter,
  19900.        int                numFlows,
  19901.        rapi_flowspec_t   *pflow);
  19902.  
  19903. Parameters 
  19904.  
  19905.  sid 
  19906.            Session identifier. 
  19907.  
  19908.  flag 
  19909.            Only the optional RAPI_REQ_CONFIRM flag can be used, or a zero. 
  19910.            Using this flag requests a RAPI_RESV_CONFIRM event be provided to 
  19911.            the callback function when the reservation is complete.  This 
  19912.            indicates merely a high probability that the reservation was 
  19913.            completed, not that it is certain. 
  19914.  
  19915.  phost 
  19916.            Receive host address and port, or NULL. For this implementation, 
  19917.            this is a pointer to a sockaddr_in structure. If the address is 
  19918.            INADDR_ANY, or if phost is NULL, the default interface will be used. 
  19919.  
  19920.  style 
  19921.            The reservation style may be RAPI_RSTYLE_WILDCARD, 
  19922.            RAPI_RSTYLE_FIXED, or RAPI_RSTYLE_SE. 
  19923.  
  19924.  pstyle 
  19925.            Style extension (not supported). 
  19926.  
  19927.  ppolicy 
  19928.            Receiver policy (not supported). 
  19929.  
  19930.  numFilters 
  19931.            Number of filterspecs pointed to by pfilter. 
  19932.  
  19933.  pfilter 
  19934.            An array of filterspecs. 
  19935.  
  19936.  numFlows 
  19937.            The number of flowspecs pointed to by pflow.  If 0, the current 
  19938.            reservation for the session is removed, if there is one. 
  19939.  
  19940.  pflow 
  19941.            An array of flowspecs. 
  19942.  
  19943.  Description 
  19944.  
  19945.  The rapi_reserve() call establishes the user of the session as a receiver. It 
  19946.  specifies a reservation style and a filterspec array and flowspec array. If 
  19947.  there is a previous reservation still in effect, and the rapi_reserve() call 
  19948.  specifies a different one, the new reservation replaces the previous one.  If 
  19949.  the number of flowspecs is 0, the current reservation is deleted but no new 
  19950.  reservation is made. 
  19951.  
  19952.  After successfully calling rapi_reserve(), the application callback function 
  19953.  can be called with RAPI_RESV_ERROR or RAPI_RESV_CONFIRM events. 
  19954.  
  19955.  There are three reservation styles: 
  19956.  
  19957.      Fixed filter (RAPI_RSTYLE_FIXED) specifies one or more senders in the 
  19958.       array of filterspecs, and an equal number of flowspecs. The i-th flowspec 
  19959.       is associated with the i-th filterspec. 
  19960.  
  19961.      Shared explicit filter (RAPI_RSTYLE_SE) specifies one or more senders in 
  19962.       the array of filterspecs, and one flowspec. All the senders are expected 
  19963.       to match the flowspec. 
  19964.  
  19965.      Wildcard filter (RAPI_RSTYLE_WILDCARD) specifies a single flowspec, and 
  19966.       either no filterspec, or a single filterspec with appropriate 
  19967.       wildcard(s).  If no sender is specified with a filterspec, any sender 
  19968.       that matches the flowspec is a valid sender. 
  19969.  
  19970.  Filterspecs have two formats: 
  19971.  
  19972.      RAPI_FILTERFORM_1 allows for a wildcard specification of allowable 
  19973.       senders.  This format is not supported in this implementation of the RSVP 
  19974.       API. 
  19975.  
  19976.      RAPI_FILTERFORM_BASE has a sockaddr_in structure that specifies a sender 
  19977.       IP address and port. 
  19978.  
  19979.  Flowspecs have the following formats: 
  19980.  
  19981.      RAPI_FORMAT_IS_CL specifies a controlled load flowspec. 
  19982.  
  19983.      RAPI_FORMAT_IS_GUAR specifies a guarenteed flowspec. 
  19984.  The flowspec data fields relate to rapi_reserve(). 
  19985.  
  19986.  Return Values and Descriptions 
  19987.  
  19988.  RAPI_ERR_BADSID          The session identifier is not valid, or the session 
  19989.                           is not open. 
  19990.  
  19991.  RAPI_ERR_INVAL           The argument is not valid. 
  19992.  
  19993.  RAPI_ERR_OK              The daemon accepted the reservation. Asynchronous 
  19994.                           callbacks may report further status. 
  19995.  
  19996.  Related Calls 
  19997.  
  19998.       rapi_sender() 
  19999.  
  20000.  
  20001. ΓòÉΓòÉΓòÉ 16.10. rapi_sender() ΓòÉΓòÉΓòÉ
  20002.  
  20003. The rapi_sender() call provides information required to become a sender. 
  20004.  
  20005. Syntax 
  20006.  
  20007.        #include <rsvprapi.h>
  20008.  
  20009. int  rapi_sender(
  20010.        rapi_sid_t          sid,
  20011.        int                 flags,
  20012.        struct sockaddr    *plocal,
  20013.        rapi_filter_t      *pfilter,
  20014.        rapi_tspec_t       *ptraffic,
  20015.        rapi_adspec_t      *padvert,
  20016.        rapi_policy_t      *ppolicy,
  20017.        int                 ttl);
  20018.  
  20019. Parameters 
  20020.  
  20021.  sid 
  20022.            Session identifier. 
  20023.  
  20024.  flags 
  20025.            No flags are supported; specify 0. 
  20026.  
  20027.  plocal 
  20028.            Local host (src addr, port).  This argument points to a structure 
  20029.            that specifies the interface that will be used to send the data. 
  20030.            For this implementation, this should be a sockaddr_in structure. If 
  20031.            the IP source address is INADDR_ANY, the default IP address of the 
  20032.            host will be used.  If plocal is NULL, the program is withdrawing 
  20033.            its registration as a sender for the session and the other arguments 
  20034.            will be ignored. 
  20035.  
  20036.  pfilter 
  20037.            Sender template. This parameter is not supported. Specify NULL. 
  20038.  
  20039.  ptraffic 
  20040.            Sender tspec. This parameter is a pointer to the traffic 
  20041.            specification for the data flow that this sender will send. 
  20042.  
  20043.  padvent 
  20044.            Sender adspec. This parameter is not supported; specify NULL. 
  20045.  
  20046.  ppolicy 
  20047.            Sender policy data. This parameter is not supported; specify NULL. 
  20048.  
  20049.  ttl 
  20050.            Time to live of the multicast data. If sending data to a multicast 
  20051.            group, specify the TTL used to send to that group, as specified with 
  20052.            setsockopt() option IP_MULTICAST_TTL. 
  20053.  
  20054.  Description 
  20055.  
  20056.  The rapi_sender() call establishes the program as a sender for the specified 
  20057.  session. After checking the arguments for validity, this call sends an 
  20058.  appropriate message to the destination. 
  20059.  
  20060.  After successfully calling rapi_sender(), the application callback function 
  20061.  may receive RAPI_RESV_EVENT or RAPI_PATH_ERROR events. 
  20062.  
  20063.  Return Values and Descriptions 
  20064.  
  20065.  RAPI_ERR_BADSID          The session identifier is not valid, or the session 
  20066.                           is not open. 
  20067.  
  20068.  RAPI_ERR_INVAL           An argument is not valid. 
  20069.  
  20070.  RAPI_ERR_NORSVP          The RSVP daemon in not running. 
  20071.  
  20072.  RAPI_ERR_NOTSPEC         No traffic spec (tspec) was specified. 
  20073.  
  20074.  RAPI_ERR_OK              The call succeeded. 
  20075.  
  20076.  Related Calls 
  20077.  
  20078.       rapi_reserve() 
  20079.  
  20080.  
  20081. ΓòÉΓòÉΓòÉ 16.11. rapi_session() ΓòÉΓòÉΓòÉ
  20082.  
  20083. The rapi_session() call starts an RSVP session. 
  20084.  
  20085. Syntax 
  20086.  
  20087.        #include <rsvprapi.h>
  20088.        #include <netinet\in.h>
  20089.  
  20090. rapi_sid_t  rapi_session(
  20091.             struct sockaddr *pdest,
  20092.             int              protoId,
  20093.             int              flags,
  20094.             rapi_event_rtn_t caller,
  20095.             void            *pClientArg,
  20096.             int             *perror);
  20097.  
  20098. Parameters 
  20099.  
  20100.  pdest 
  20101.            A pointer to a sockaddr structure that defines an address and port 
  20102.            for the destination.  The sockaddr structure should be sockaddr_in. 
  20103.            For multicast, this should be the multicast group and port. 
  20104.            Otherwise, it should be the address and port of the receiver of the 
  20105.            unicast data stream. 
  20106.  
  20107.  protoId 
  20108.            Protocol to be used for the data stream.  For example, IPPROTO_UDP 
  20109.            can be used for UDP (unicast or multicast), or IPPROTO_TCP can be 
  20110.            used for TCP (unicast). If protoId is 0, it is set by default to 
  20111.            IPPROTO_UPD. 
  20112.  
  20113.  flags 
  20114.            No flags are defined at this time; specify 0. 
  20115.  
  20116.  caller 
  20117.            A pointer to a callback function to be used for asynchronous events. 
  20118.            The pointer may be NULL, indicating that there is no such routine. 
  20119.  
  20120.  pClientArg 
  20121.            A user supplied parameter that will be passed to the callback 
  20122.            function. The parameter may be NULL. 
  20123.  
  20124.  perror 
  20125.            A pointer to a variable in which error codes are passed. 
  20126.  
  20127.  Description 
  20128.  
  20129.  The rapi_session() call creates an RSVP API session.  The session ID is an 
  20130.  opaque non-zero value that refers to the session until it is released with 
  20131.  rapi_release().  It is not useful to compare session IDs from different 
  20132.  processes or from different hosts on the network. 
  20133.  
  20134.  After rapi_session() is successfully called, the application callback function 
  20135.  may receive RAPI_PATH_EVENT messages. 
  20136.  
  20137.  Return Values and Descriptions 
  20138.  
  20139.  A non-zero return value is a new session ID which is used as a handle in 
  20140.  subsequent calls to the API.  A zero return value (NULL_SID) indicates an 
  20141.  error, in which case an error code is in the error code variable pointed to by 
  20142.  the perror parameter. 
  20143.  
  20144.  If the return code is zero, rapi_session() stores these values in the error 
  20145.  code variable: 
  20146.  
  20147.  RAPI_ERR_NORSVP          The RSVP daemon in not running. 
  20148.  
  20149.  RAPI_ERR_SYSCALL         System call error; see errno. 
  20150.  
  20151.  RAPI_ERR_MAXSESS         Too many sessions. 
  20152.  
  20153.  RAPI_ERR_OK              No error. 
  20154.  
  20155.  Related Calls 
  20156.  
  20157.       rapi_release() 
  20158.       user_rapi_callback() 
  20159.  
  20160.  
  20161. ΓòÉΓòÉΓòÉ 16.12. rapi_version() ΓòÉΓòÉΓòÉ
  20162.  
  20163. The rapi_version() call gets the RSVP version. 
  20164.  
  20165. Syntax 
  20166.  
  20167. #include <rsvprapi.h>
  20168.  
  20169. int rapi_version(void);
  20170.  
  20171. Return Values 
  20172.  
  20173. The rapi_version() call returns the version of the RSVP API.  The integer value 
  20174. is encoded as major*100 + minor.  The major number of this release is 4. 
  20175.  
  20176.  
  20177. ΓòÉΓòÉΓòÉ 16.13. user_rapi_callback() ΓòÉΓòÉΓòÉ
  20178.  
  20179. The user_rapi_callback() call provides the RSVP callback function. 
  20180.  
  20181. Syntax 
  20182.  
  20183.        #include <rsvprapi.h>
  20184.  
  20185. int  _System user_rapi_callback(
  20186.        rapi_sid_t         sid,
  20187.        rapi_eventinfo_t   eventType,
  20188.        rapi_styleid_t     styleID,
  20189.        int                errorCode,
  20190.        int                errorValue,
  20191.        struct sockaddr   *pErrorNodeAddr,
  20192.        u_char             errorFlags,
  20193.        int                nFilterSpecs,
  20194.        rapi_filter_t     *pFilterSpec,
  20195.        int                nFlowSpecs,
  20196.        rapi_flowspec_t   *pFlowSpec,
  20197.        int                nAdSpecs,
  20198.        rapi_adspec_t     *pAdSpec,
  20199.        void              *pClientArg);
  20200.  
  20201. Parameters 
  20202.  
  20203.  sid 
  20204.            Session identifier of the session that generated the event. 
  20205.  
  20206.  eventType 
  20207.            One of these event types: 
  20208.  
  20209.            RAPI_PATH_EVENT A path event is generated by a rapi_sender() call 
  20210.                           for the session.  This can be received by a program 
  20211.                           that has called rapi_session().  A non-zero value of 
  20212.                           nFlowSpecs indicates that a path exists from a sender 
  20213.                           to a potential receiver. A zero value of nFlowSpecs 
  20214.                           indicates that a previous path may have gone away. 
  20215.  
  20216.            RAPI_RESV_EVENT A reservation event is generated by a rapi_reserve() 
  20217.                           call for the session.  This is received by a sender 
  20218.                           to which the reservation applies. A zero value of 
  20219.                           nFlowSpecs indicates that a previous reservation may 
  20220.                           have gone away. 
  20221.  
  20222.            RAPI_PATH_ERROR There has been an error associated with the path 
  20223.                           event. See errorCode for the type of error. 
  20224.  
  20225.            RAPI_RESV_ERROR There has been an error associated with the 
  20226.                           reservation event.  See errorCode for the type of 
  20227.                           error. 
  20228.  
  20229.            RAPI_RESV_CONFIRM When a rapi_reserve() call specifies that 
  20230.                           confirmation of the reservation is requested, this 
  20231.                           event can be generated to confirm (with a very high 
  20232.                           probability) that the reservation has been made from 
  20233.                           receiver to sender. 
  20234.  
  20235.  styleID 
  20236.            Reservation style. This is non-zero only for RAPI_RESV_EVENT and 
  20237.            RAPI_RESV_ERROR. 
  20238.  
  20239.  errorCode 
  20240.            Type of error that occurred, for a RAPI_PATH_ERROR or 
  20241.            RAPI_RESV_ERROR event. 
  20242.  
  20243.  errorValue 
  20244.            Extra error value for a RAPI_PATH_ERROR or RAPI_RESV_ERROR event. 
  20245.            This parameter is used if it is necessary for RSVP to report an 
  20246.            extra error. An example might be an "errno" value. 
  20247.  
  20248.  pErrorNodeAddr 
  20249.            A pointer to the IP address and port of the node that detected an 
  20250.            error. For this implementation, this is a pointer to a sockaddr_in 
  20251.            structure. This is set only for a RAPI_PATH_ERROR or RAPI_RESV_ERROR 
  20252.            event. 
  20253.  
  20254.  errorFlags 
  20255.  
  20256.            Error flag for a RAPI_PATH_ERROR event. Set to one of these values: 
  20257.  
  20258.            RAPI_ERRF_InPlace This value indicates that the reservation failed, 
  20259.                           but another probably smaller reservation was left in 
  20260.                           place at the failing node address. 
  20261.  
  20262.            RAPI_ERRF_NotGuilty This value indicates that the flowspec that was 
  20263.                           requested by this receiver was not the cause of the 
  20264.                           error, even though the reservation failed. Presumably 
  20265.                           the failure was due to a larger reservation that this 
  20266.                           one was merged with. 
  20267.  
  20268.  nFilterSpecs 
  20269.            The number of filterspecs or sender templates pointed to by 
  20270.            pFilterSpec. 
  20271.  
  20272.  pFilterSpec 
  20273.            A pointer to an array of filterspecs or sender templates, or NULL. 
  20274.  
  20275.  nFlowSpecs 
  20276.            The number of flowspecs or tspecs pointed to by pFlowSpec. 
  20277.  
  20278.  pFlowSpec 
  20279.            A pointer to an array of flowspecs or tspecs, or NULL. 
  20280.  
  20281.  nAdSpecs 
  20282.            The number of adspecs pointed to by pAdSpec. 
  20283.  
  20284.  pAdSpec 
  20285.            A pointer to an array of adspecs, or NULL. 
  20286.  
  20287.  pClientArg 
  20288.            The client-supplied argument that was provided when rapi_session() 
  20289.            was called. 
  20290.  
  20291.  Description 
  20292.  
  20293.  The user_rapi_callback() call processes asynchronous events from the RSVP API. 
  20294.  A pointer to the function is passed to rapi_session(). The callback function 
  20295.  must be declared as shown above.  The name of the function is chosen by the 
  20296.  user, but is shown above as user_rapi_callback(). 
  20297.  
  20298.  The rapi_getfd() call returns a socket for the session.  The socket may be 
  20299.  used with the select() call as a read socket.  When a select() call indicates 
  20300.  that there is some data to read, a rapi_dispatch() call should be issued to 
  20301.  read and process the data from the socket.  Typically the rapi_dispatch() call 
  20302.  will invoke the user callback function to provide the program with 
  20303.  information, if the user supplied such a function in the rapi_session() call. 
  20304.  
  20305.  The user callback function should copy any information that it wants to save, 
  20306.  because the storage that is pointed to by the pErrorNodeAddr, pFilterSpec, 
  20307.  pFlowSpec, and pAdSpec will be freed as soon as the callback function returns. 
  20308.  
  20309.  Return Values 
  20310.  
  20311.  The function is declared to have an integer return value, but nothing is done 
  20312.  with the value currently.  It is recommended that the user always return 0. 
  20313.  
  20314.  Related Calls 
  20315.  
  20316.       rapi_dispatch() 
  20317.       rapi_getfd() 
  20318.       rapi_session() 
  20319.       select() 
  20320.  
  20321.  
  20322. ΓòÉΓòÉΓòÉ 17. Appendixes ΓòÉΓòÉΓòÉ
  20323.  
  20324. This section describes: 
  20325.  
  20326.      NETWORKS File Structure 
  20327.  
  20328.       Provides examples of network names contained in the TCPIP\ETC\NETWORKS 
  20329.       file. 
  20330.  
  20331.      Socket Error Constants 
  20332.  
  20333.       Provides the socket error codes and descriptions. 
  20334.  
  20335.      Well-Known Port Assignments 
  20336.  
  20337.       Provides a list of the well-known ports supported by TCP/IP. 
  20338.  
  20339.      Notices 
  20340.  
  20341.       Contains copyright notices, disclaimers, and trademarks relating to 
  20342.       TCP/IP for OS/2 Warp. 
  20343.  
  20344.  
  20345. ΓòÉΓòÉΓòÉ 18. NETWORKS File Structure ΓòÉΓòÉΓòÉ
  20346.  
  20347. The NETWORKS file contains the network name, number, and alias or aliases of 
  20348. known networks. The NETWORKS file must reside in the directory specified by the 
  20349. ETC environment variable. The NETWORKS file is used only by the following 
  20350. socket calls: 
  20351.  
  20352.      endnetent() 
  20353.      getnetbyaddr() 
  20354.      getnetbyname() 
  20355.      getnetent() 
  20356.      setnetent() 
  20357.  
  20358.  The following table lists examples of network names contained in the NETWORKS 
  20359.  file. 
  20360.  
  20361.  Name Structures of Known Networks 
  20362.  
  20363.  
  20364.    Name of File           Contents of File       Sample File Entries
  20365.    ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  20366.    NETWORKS               official_network_name  ne-region 128.1
  20367.                           network_number alias   classb.net1 at1-region
  20368.                                                  128.2 classb.net2
  20369.                                                  lab-net 192.5.1
  20370.                                                  classc.net5
  20371.  
  20372.  
  20373. ΓòÉΓòÉΓòÉ 19. Socket Error Constants ΓòÉΓòÉΓòÉ
  20374.  
  20375. The following table provides the error constants set by socket calls. This 
  20376. table can be found in the <NERRNO.H> header file. 
  20377.  
  20378.  
  20379. /*
  20380. * The redefinition of error constants is necessary to avoid conflict with
  20381. * standard compiler error constants.
  20382. *
  20383. * All OS/2 SOCKETS API error constants are biased by SOCBASEERR from the "normal"
  20384. *
  20385. */
  20386.  
  20387. #define SOCBASEERR              10000
  20388.  
  20389. /*
  20390. * OS/2 SOCKETS  API definitions of regular Microsoft C 6.0 error constants
  20391. */
  20392.  
  20393. #define SOCEPERM           (SOCBASEERR+1)   /*Not owner*/
  20394. #define SOCESRCH           (SOCBASEERR+3)   /*No such process*/
  20395. #define SOCEINTR           (SOCBASEERR+4)   /*Interrupted system call*/
  20396. #define SOCENXIO           (SOCBASEERR+6)   /*No such device or address*/
  20397. #define SOCEBADF           (SOCBASEERR+9)   /*Bad file number*/
  20398. #define SOCEACCES          (SOCBASEERR+13)  /*Permission denied*/
  20399. #define SOCEFAULT          (SOCBASEERR+14)  /*Bad address*/
  20400. #define SOCEINVAL          (SOCBASEERR+22)  /*Invalid argument*/
  20401. #define SOCEMFILE          (SOCBASEERR+24)  /*Too many open files*/
  20402. #define SOCEPIPE           (SOCBASEERR+32)  /*Broken pipe*/
  20403.  
  20404. #define SOCEOS2ERR         (SOCBASEERR+100) /*OS/2 Error*/
  20405.  
  20406. /*
  20407. * OS/2 SOCKETS API definitions of regular BSD error constants
  20408. */
  20409.  
  20410. #define SOCEWOULDBLOCK     (SOCBASEERR+35)  /*Operation would block*/
  20411. #define SOCEINPROGRESS     (SOCBASEERR+36)  /*Operation now in progress*/
  20412. #define SOCEALREADY        (SOCBASEERR+37)  /*Operation already in progress*/
  20413. #define SOCENOTSOCK        (SOCBASEERR+38)  /*Socket operation on non-socket*/
  20414. #define SOCEDESTADDRREQ    (SOCBASEERR+39)  /*Destination address required*/
  20415. #define SOCEMSGSIZE        (SOCBASEERR+40)  /*Message too long*/
  20416. #define SOCEPROTOTYPE      (SOCBASEERR+41)  /*Protocol wrong type for socket*/
  20417. #define SOCENOPROTOOPT     (SOCBASEERR+42)  /*Protocol not available*/
  20418. #define SOCEPROTONOSUPPORT (SOCBASEERR+43)  /*Protocol not supported*/
  20419. #define SOCESOCKTNOSUPPORT (SOCBASEERR+44)  /*Socket type not supported*/
  20420. #define SOCEOPNOTSUPP      (SOCBASEERR+45)  /*Operation not supported on socket*/
  20421. #define SOCEPFNOSUPPORT    (SOCBASEERR+46)  /*Protocol family not supported*/
  20422. #define SOCEAFNOSUPPORT    (SOCBASEERR+47)  /*Address family not supported by protocol family*/
  20423. #define SOCEADDRINUSE      (SOCBASEERR+48)  /*Address already in use*/
  20424. #define SOCEADDRNOTAVAIL   (SOCBASEERR+49)  /*Can't assign requested address*/
  20425. #define SOCENETDOWN        (SOCBASEERR+50)  /*Network is down*/
  20426. #define SOCENETUNREACH     (SOCBASEERR+51)  /*Network is unreachable*/
  20427. #define SOCENETRESET       (SOCBASEERR+52)  /*Network dropped connection on reset*/
  20428. #define SOCECONNABORTED    (SOCBASEERR+53)  /*Software caused connection abort*/
  20429. #define SOCECONNRESET      (SOCBASEERR+54)  /*Connection reset by peer*/
  20430. #define SOCENOBUFS         (SOCBASEERR+55)  /*No buffer space available*/
  20431. #define SOCEISCONN         (SOCBASEERR+56)  /*Socket is already connected*/
  20432. #define SOCENOTCONN        (SOCBASEERR+57)  /*Socket is not connected*/
  20433. #define SOCESHUTDOWN       (SOCBASEERR+58)  /*Can't send after socket shutdown*/
  20434. #define SOCETOOMANYREFS    (SOCBASEERR+59)  /*Too many references: can't splice*/
  20435. #define SOCETIMEDOUT       (SOCBASEERR+60)  /*Connection timed out*/
  20436. #define SOCECONNREFUSED    (SOCBASEERR+61)  /*Connection refused*/
  20437. #define SOCELOOP           (SOCBASEERR+62)  /*Too many levels of symbolic links*/
  20438. #define SOCENAMETOOLONG    (SOCBASEERR+63)  /*File name too long*/
  20439. #define SOCEHOSTDOWN       (SOCBASEERR+64)  /*Host is down*/
  20440. #define SOCEHOSTUNREACH    (SOCBASEERR+65)  /*No route to host*/
  20441. #define SOCENOTEMPTY       (SOCBASEERR+66)  /*Directory not empty*/
  20442.  
  20443. /*
  20444. * OS/2 SOCKETS API errors redefined as regular BSD error constants
  20445. */
  20446.  
  20447. #define EWOULDBLOCK         SOCEWOULDBLOCK
  20448. #define EINPROGRESS         SOCEINPROGRESS
  20449. #define EALREADY            SOCEALREADY
  20450. #define ENOTSOCK            SOCENOTSOCK
  20451. #define EDESTADDRREQ        SOCEDESTADDRREQ
  20452. #define EMSGSIZE            SOCEMSGSIZE
  20453. #define EPROTOTYPE          SOCEPROTOTYPE
  20454. #define ENOPROTOOPT         SOCENOPROTOOPT
  20455. #define EPROTONOSUPPORT     SOCEPROTONOSUPPORT
  20456. #define ESOCKTNOSUPPORT     SOCESOCKTNOSUPPORT
  20457. #define EOPNOTSUPP          SOCEOPNOTSUPP
  20458. #define EPFNOSUPPORT        SOCEPFNOSUPPORT
  20459. #define EAFNOSUPPORT        SOCEAFNOSUPPORT
  20460. #define EADDRINUSE          SOCEADDRINUSE
  20461. #define EADDRNOTAVAIL       SOCEADDRNOTAVAIL
  20462. #define ENETDOWN            SOCENETDOWN
  20463. #define ENETUNREACH         SOCENETUNREACH
  20464. #define ENETRESET           SOCENETRESET
  20465. #define ECONNABORTED        SOCECONNABORTED
  20466. #define ECONNRESET          SOCECONNRESET
  20467. #define ENOBUFS             SOCENOBUFS
  20468. #define EISCONN             SOCEISCONN
  20469. #define ENOTCONN            SOCENOTCONN
  20470. #define ESHUTDOWN           SOCESHUTDOWN
  20471. #define ETOOMANYREFS        SOCETOOMANYREFS
  20472. #define ETIMEDOUT           SOCETIMEDOUT
  20473. #define ECONNREFUSED        SOCECONNREFUSED
  20474. #define ELOOP               SOCELOOP
  20475. #define ENAMETOOLONG        SOCENAMETOOLONG
  20476. #define EHOSTDOWN           SOCEHOSTDOWN
  20477. #define EHOSTUNREACH        SOCEHOSTUNREACH
  20478. #define ENOTEMPTY           SOCENOTEMPTY
  20479.  
  20480.  
  20481. ΓòÉΓòÉΓòÉ 20. Well-Known Port Assignments ΓòÉΓòÉΓòÉ
  20482.  
  20483. The following table is a list of the common well-known ports supported by 
  20484. TCP/IP. It provides the port number, keyword, and a description of the reserved 
  20485. port assignment. Port numbers of less than 1024 are reserved for system 
  20486. applications. You can also find a complete list of well-known port numbers in 
  20487. the ETC\SERVICES file. 
  20488.  
  20489. TCP Well-Known Port Assignments 
  20490.  
  20491. TCP Well-Known Port Assignments 
  20492.  
  20493. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  20494. ΓöéPort Number    Keyword           Reserved for      Services        Γöé
  20495. Γöé                                                   Description     Γöé
  20496. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20497. Γöé0                                reserved                          Γöé
  20498. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20499. Γöé5              rje               remote job entry  remote job entryΓöé
  20500. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20501. Γöé7              echo              echo              echo            Γöé
  20502. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20503. Γöé9              discard           discard           sink null       Γöé
  20504. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20505. Γöé11             systat            active users      active users    Γöé
  20506. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20507. Γöé13             daytime           daytime           daytime         Γöé
  20508. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20509. Γöé15             netstat           Netstat           who is up or    Γöé
  20510. Γöé                                                   Netstat         Γöé
  20511. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20512. Γöé19             chargen           ttytst source     character       Γöé
  20513. Γöé                                                   generator       Γöé
  20514. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20515. Γöé21             ftp               FTP               File Transfer   Γöé
  20516. Γöé                                                   Protocol        Γöé
  20517. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20518. Γöé23             telnet            Telnet            Telnet          Γöé
  20519. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20520. Γöé25             smtp              mail              Simple Mail     Γöé
  20521. Γöé                                                   Transfer        Γöé
  20522. Γöé                                                   Protocol        Γöé
  20523. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20524. Γöé37             time              timeserver        timeserver      Γöé
  20525. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20526. Γöé39             rlp               resource          Resource        Γöé
  20527. Γöé                                                   Location        Γöé
  20528. Γöé                                                   Protocol        Γöé
  20529. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20530. Γöé42             nameserver        name              host name serverΓöé
  20531. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20532. Γöé43             nicname           who is            who is          Γöé
  20533. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20534. Γöé53             domain            name server       domain name     Γöé
  20535. Γöé                                                   server          Γöé
  20536. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20537. Γöé57             mtp               private terminal  private terminalΓöé
  20538. Γöé                                 access            access          Γöé
  20539. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20540. Γöé67             bootps            bootps dhcps      bootp server    Γöé
  20541. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20542. Γöé68             bootpc            bootpc dhcpc      bootp client    Γöé
  20543. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20544. Γöé69             tftp              TFTP              Trivial File    Γöé
  20545. Γöé                                                   Transfer        Γöé
  20546. Γöé                                                   Protocol        Γöé
  20547. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20548. Γöé70             gopher            gopher            Gopher          Γöé
  20549. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20550. Γöé77                               netrjs            any private RJE Γöé
  20551. Γöé                                                   service         Γöé
  20552. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20553. Γöé79             finger            finger            finger          Γöé
  20554. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20555. Γöé80             www-http          www-http          World Wide Web  Γöé
  20556. Γöé                                                   HTTP            Γöé
  20557. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20558. Γöé87             link              ttylink           any private     Γöé
  20559. Γöé                                                   terminal link   Γöé
  20560. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20561. Γöé95             supdup            supdup            SUPDUP Protocol Γöé
  20562. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20563. Γöé101            hostname          hostname          nic hostname    Γöé
  20564. Γöé                                                   server, usually Γöé
  20565. Γöé                                                   from SRI-NIC    Γöé
  20566. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20567. Γöé109            pop               postoffice        Post Office     Γöé
  20568. Γöé                                                   Protocol        Γöé
  20569. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20570. Γöé111            sunrpc            sunrpc            Sun remote      Γöé
  20571. Γöé                                                   procedure call  Γöé
  20572. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20573. Γöé113            auth              authentication    authentication  Γöé
  20574. Γöé                                                   service         Γöé
  20575. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20576. Γöé115            sftp              sftp              Simple File     Γöé
  20577. Γöé                                                   Transfer        Γöé
  20578. Γöé                                                   Protocol        Γöé
  20579. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20580. Γöé117            uucp-path         UUCP path service UUCP path       Γöé
  20581. Γöé                                                   service         Γöé
  20582. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20583. Γöé119            untp              readnews untp     USENET News     Γöé
  20584. Γöé                                                   Transfer        Γöé
  20585. Γöé                                                   Protocol        Γöé
  20586. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20587. Γöé123            ntp               NTP               Network Time    Γöé
  20588. Γöé                                                   Protocol        Γöé
  20589. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20590. Γöé160                              reserved                          Γöé
  20591. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20592. Γöé163-223                          reserved                          Γöé
  20593. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20594. Γöé449            AS-SVRMAP         mapper function   servers for     Γöé
  20595. Γöé                                 for AS/400        sign-on, centralΓöé
  20596. Γöé                                 servers           management,     Γöé
  20597. Γöé                                                   network print,  Γöé
  20598. Γöé                                                   database, streamΓöé
  20599. Γöé                                                   file, data      Γöé
  20600. Γöé                                                   queue, and      Γöé
  20601. Γöé                                                   remote command  Γöé
  20602. Γöé                                                   and distributed Γöé
  20603. Γöé                                                   program calls.  Γöé
  20604. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20605. Γöé712            vexec             vice-exec         Andrew File     Γöé
  20606. Γöé                                                   System          Γöé
  20607. Γöé                                                   authenticated   Γöé
  20608. Γöé                                                   service         Γöé
  20609. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20610. Γöé713            vlogin            vice-login        Andrew File     Γöé
  20611. Γöé                                                   System          Γöé
  20612. Γöé                                                   authenticated   Γöé
  20613. Γöé                                                   service         Γöé
  20614. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20615. Γöé714            vshell            vice-shell        Andrew File     Γöé
  20616. Γöé                                                   System          Γöé
  20617. Γöé                                                   authenticated   Γöé
  20618. Γöé                                                   service         Γöé
  20619. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20620. Γöé2001           filesrv                             Andrew File     Γöé
  20621. Γöé                                                   System service  Γöé
  20622. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20623. Γöé2106           venus.itc                           Andrew File     Γöé
  20624. Γöé                                                   System service, Γöé
  20625. Γöé                                                   for the Venus   Γöé
  20626. Γöé                                                   process         Γöé
  20627. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  20628.  
  20629. UDP Well-Known Port Assignments 
  20630.  
  20631. UDP Well-Known Port Assignments 
  20632.  
  20633. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  20634. ΓöéPort Number    Keyword           Reserved for      Services        Γöé
  20635. Γöé                                                   Description     Γöé
  20636. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20637. Γöé0                                reserved                          Γöé
  20638. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20639. Γöé5              rje               remote job entry  remote job entryΓöé
  20640. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20641. Γöé7              echo              echo              echo            Γöé
  20642. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20643. Γöé9              discard           discard           sink null       Γöé
  20644. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20645. Γöé11             users             active users      active users    Γöé
  20646. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20647. Γöé13             daytime           daytime           daytime         Γöé
  20648. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20649. Γöé15             netstat           Netstat           Netstat         Γöé
  20650. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20651. Γöé19             chargen           ttytst source     character       Γöé
  20652. Γöé                                                   generator       Γöé
  20653. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20654. Γöé37             time              timeserver        timeserver      Γöé
  20655. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20656. Γöé39             rlp               resource          Resource        Γöé
  20657. Γöé                                                   Location        Γöé
  20658. Γöé                                                   Protocol        Γöé
  20659. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20660. Γöé42             nameserver        name              host name serverΓöé
  20661. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20662. Γöé43             nicname           who is            who is          Γöé
  20663. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20664. Γöé53             domain            name server       domain name     Γöé
  20665. Γöé                                                   server          Γöé
  20666. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20667. Γöé67             bootps            bootps dhcps      bootp server    Γöé
  20668. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20669. Γöé68             bootpc            bootpc dhcpc      bootp client    Γöé
  20670. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20671. Γöé69             tftp              TFTP              Trivial File    Γöé
  20672. Γöé                                                   Transfer        Γöé
  20673. Γöé                                                   Protocol        Γöé
  20674. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20675. Γöé70             gopher            gopher            Gopher          Γöé
  20676. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20677. Γöé75                                                 any private dialΓöé
  20678. Γöé                                                   out service     Γöé
  20679. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20680. Γöé77                               netrjs            any private RJE Γöé
  20681. Γöé                                                   service         Γöé
  20682. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20683. Γöé79             finger            finger            finger          Γöé
  20684. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20685. Γöé80             www-http          www-http          World Wide Web  Γöé
  20686. Γöé                                                   HTTP            Γöé
  20687. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20688. Γöé111            sunrpc            sunrpc            Sun remote      Γöé
  20689. Γöé                                                   procedure call  Γöé
  20690. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20691. Γöé123            ntp               NTP               Network Time    Γöé
  20692. Γöé                                                   Protocol        Γöé
  20693. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20694. Γöé135            llbd              NCS LLBD          NCS local       Γöé
  20695. Γöé                                                   location broker Γöé
  20696. Γöé                                                   daemon          Γöé
  20697. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20698. Γöé160-223                          reserved                          Γöé
  20699. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20700. Γöé531            rvd-control                         rvd control portΓöé
  20701. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20702. Γöé2001           rauth2                              Andrew File     Γöé
  20703. Γöé                                                   System service, Γöé
  20704. Γöé                                                   for the Venus   Γöé
  20705. Γöé                                                   process         Γöé
  20706. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20707. Γöé2002           rfilebulk                           Andrew File     Γöé
  20708. Γöé                                                   System service, Γöé
  20709. Γöé                                                   for the Venus   Γöé
  20710. Γöé                                                   process         Γöé
  20711. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20712. Γöé2003           rfilesrv                            Andrew File     Γöé
  20713. Γöé                                                   System service, Γöé
  20714. Γöé                                                   for the Venus   Γöé
  20715. Γöé                                                   process         Γöé
  20716. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20717. Γöé2018           console                             Andrew File     Γöé
  20718. Γöé                                                   System service  Γöé
  20719. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20720. Γöé2115           ropcons                             Andrew File     Γöé
  20721. Γöé                                                   System service, Γöé
  20722. Γöé                                                   for the Venus   Γöé
  20723. Γöé                                                   process         Γöé
  20724. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20725. Γöé2131           rupdsrv                             assigned in     Γöé
  20726. Γöé                                                   pairs; bulk mustΓöé
  20727. Γöé                                                   be srv +1       Γöé
  20728. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20729. Γöé2132           rupdbulk                            assigned in     Γöé
  20730. Γöé                                                   pairs; bulk mustΓöé
  20731. Γöé                                                   be srv +1       Γöé
  20732. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20733. Γöé2133           rupdsrv1                            assigned in     Γöé
  20734. Γöé                                                   pairs; bulk mustΓöé
  20735. Γöé                                                   be srv +1       Γöé
  20736. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20737. Γöé2134           rupdbulk1                           assigned in     Γöé
  20738. Γöé                                                   pairs; bulk mustΓöé
  20739. Γöé                                                   be srv +1       Γöé
  20740. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  20741.  
  20742.  
  20743. ΓòÉΓòÉΓòÉ 21. Notices ΓòÉΓòÉΓòÉ
  20744.  
  20745. Third Edition (September 1997) 
  20746.  
  20747. The following paragraph does not apply to the United Kingdom or any country 
  20748. where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS 
  20749. MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY 
  20750. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  20751. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states 
  20752. do not allow disclaimer of express or implied warranties in certain 
  20753. transactions; therefore, this statement may not apply to you. 
  20754.  
  20755. This publication might include technical inaccuracies or typographical errors. 
  20756. Changes are periodically made to the information herein; these changes will be 
  20757. incorporated in new editions of the publication. IBM may make improvements 
  20758. and/or changes in the product(s) and/or the program(s) described in this 
  20759. publication at any time. 
  20760.  
  20761. This publication was developed for products and services offered in the United 
  20762. States of America. IBM may not offer the products, services, or features 
  20763. discussed in this document in other countries, and the information is subject 
  20764. to change without notice. Consult your local IBM representative for information 
  20765. on the products, services, and features available in your area. 
  20766.  
  20767. Requests for technical information about IBM products should be made to your 
  20768. IBM reseller or IBM marketing representative. 
  20769.  
  20770.  
  20771. ΓòÉΓòÉΓòÉ 21.1. Copyright Notices ΓòÉΓòÉΓòÉ
  20772.  
  20773. COPYRIGHT LICENSE: This publication contains printed sample application 
  20774. programs in source language, which illustrate OS/2 programming techniques. You 
  20775. may copy, modify, and distribute these sample programs in any form without 
  20776. payment to IBM, for the purposes of developing, using, marketing or 
  20777. distributing application programs conforming to the OS/2 application 
  20778. programming interface. 
  20779.  
  20780. Each copy of any portion of these sample programs or any derivative work that 
  20781. is distributed to others must include a copyright notice as follows: "(C)(your 
  20782. company name) (year). All rights reserved." 
  20783.  
  20784. (C) Copyright International Business Machines Corporation 1995, 1997. All 
  20785. rights reserved. 
  20786.  
  20787. Note to U.S. government Users - Documentation related to restricted rights - 
  20788. Use, duplication or disclosure is subject to restrictions set forth in GSA ADP 
  20789. Schedule Contract with IBM Corp. 
  20790.  
  20791. IBM is required to include the following statements in order to distribute 
  20792. portions of this document and the software described herein. 
  20793.  
  20794. __________________________________ 
  20795.  
  20796. Sun RPC is a product of Sun Microsystems, Inc. and is provided for unrestricted 
  20797. use provided that this legend is included on all tape media and as a part of 
  20798. the software program in whole or part.  Users may copy or modify Sun RPC 
  20799. without charge, but are not authorized to license or distribute it to anyone 
  20800. else except as part of a product or program developed by the user. 
  20801.  
  20802. SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 
  20803. WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, OR 
  20804. ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 
  20805.  
  20806. Sun RPC is provided with no support and without any obligation on the part of 
  20807. Sun Microsystems, Inc. to assist in its use, correction, modification or 
  20808. enhancement. 
  20809.  
  20810. SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT 
  20811. OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC OR ANY PART THEREOF. 
  20812.  
  20813. In no event will Sun Microsystems, Inc. be liable for any lost revenue or 
  20814. profits or other special, indirect and consequential damages, even if Sun has 
  20815. been advised of the possibility of such damages. 
  20816.  
  20817. __________________________________ 
  20818.  
  20819. Copyright (c) 1983, 1995 Eric P. Allman 
  20820.  
  20821. Copyright (c) 1988, 1993 The Regents of the University of California. All 
  20822. rights reserved. 
  20823.  
  20824. Redistribution and use in source and binary forms, with or without 
  20825. modification, are permitted provided that the following conditions are met: 
  20826.  
  20827.      Redistributions of source code must retain the above copyright notice, 
  20828.       this list of conditions and the following disclaimer. 
  20829.      Redistributions in binary form must reproduce the above copyright notice, 
  20830.       this list of conditions and the following disclaimer in the documentation 
  20831.       and/or other materials provided with the distribution. 
  20832.      All advertising materials mentioning features or use of this software 
  20833.       must display the following acknowledgment: This product includes software 
  20834.       developed by the University of California, Berkeley and its contributors. 
  20835.      Neither the name of the University nor the names of its contributors may 
  20836.       be used to endorse or promote products derived from this software without 
  20837.       specific prior written permission. 
  20838.  
  20839.  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY 
  20840.  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  20841.  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
  20842.  DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 
  20843.  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
  20844.  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
  20845.  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  20846.  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
  20847.  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
  20848.  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  20849.  
  20850.  __________________________________ 
  20851.  
  20852.  Copyright (c) 1993 The Australian National University. All rights reserved. 
  20853.  
  20854.  Redistribution and use in source and binary forms are permitted provided that 
  20855.  the above copyright notice and this paragraph are duplicated in all such forms 
  20856.  and that any documentation, advertising materials, and other materials related 
  20857.  to such distribution and use acknowledge that the software was developed by 
  20858.  the Australian National University.  The name of the University may not be 
  20859.  used to endorse or promote products derived from this software without 
  20860.  specific prior written permission. 
  20861.  
  20862.  THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 
  20863.  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
  20864.  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
  20865.  
  20866.  __________________________________ 
  20867.  
  20868.  Copyright (c) 1989 Carnegie Mellon University. All rights reserved. 
  20869.  
  20870.  Redistribution and use in source and binary forms are permitted provided that 
  20871.  the above copyright notice and this paragraph are duplicated in all such forms 
  20872.  and that any documentation, advertising materials, and other materials related 
  20873.  to such distribution and use acknowledge that the software was developed by 
  20874.  Carnegie Mellon University.  The name of the University may not be used to 
  20875.  endorse or promote products derived from this software without specific prior 
  20876.  written permission. 
  20877.  
  20878.  THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 
  20879.  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
  20880.  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
  20881.  
  20882.  __________________________________ 
  20883.  
  20884.  Copyright (c) CERN 1994 
  20885.  
  20886.  The copyright and all other rights relating to this computer software, in 
  20887.  whatever form, including but not limited to the source code, the object code 
  20888.  and user documentation, are vested in CERN. 
  20889.  
  20890.  CERN, on a royalty-free and non-exclusive basis, hereby grants permission to 
  20891.  use, copy, change, modify, translate, display, distribute and make available 
  20892.  this computer software, subject to the following conditions: 
  20893.  
  20894.      This computer software is provided on an as-is basis and CERN provides no 
  20895.       express or implied warranties of any kind, including but not limited to 
  20896.       those of merchantability, fitness for a particular purpose and 
  20897.       non-infringement of the proprietary rights, such as copyrights, patents 
  20898.       and trade secrets, of third parties. CERN accepts no liability whatsoever 
  20899.       for or in connection with the use of this computer software. 
  20900.      All copies made of this computer software or of parts thereof shall 
  20901.       include this copyright statement in full. 
  20902.      However, if this computer software or parts thereof are made available in 
  20903.       any other form than their original form, or are included in any other 
  20904.       computer software, the following short acknowledgment only must be 
  20905.       mentioned in the copyright statement and in the user documentation (or, 
  20906.       in the absence thereof, in any other appropriate place) concerning the 
  20907.       computer software thus made available or created. 
  20908.  
  20909.       "This product includes computer software created and made available by 
  20910.       CERN.  This acknowledgment shall be mentioned in full in any product 
  20911.       which includes the CERN computer software included herein or parts 
  20912.       thereof". 
  20913.  
  20914.  __________________________________ 
  20915.  
  20916.  Portions Copyright (C) 1993, 1994 by NEC Systems Laboratory. 
  20917.  
  20918.  Permission to use, copy, modify, and distribute this software for any purpose 
  20919.  with or without fee is hereby granted, provided that the above copyright 
  20920.  notice and this permission notice appear in all copies, and that the name of 
  20921.  NEC systems Laboratory not be used in advertising or publicity pertaining to 
  20922.  distribution of the document or software without specific, prior permission. 
  20923.  
  20924.  THE SOFTWARE IS PROVIDED 'AS IS' AND NEC SYSTEMS LABORATORY DISCLAIMS ALL 
  20925.  WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF 
  20926.  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NEC SYSTEMS LABORATORY BE 
  20927.  LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY 
  20928.  DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
  20929.  ACTION OR CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  20930.  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
  20931.  
  20932.  __________________________________ 
  20933.  
  20934.  Some portions of this publication relating to X Window System are Copyright 
  20935.  (C) 1987, 1988 by the Massachusetts Institute of Technology, Cambridge, 
  20936.  Massachusetts; by Digital Equipment Corporation, Maynard, Massachusetts; and 
  20937.  by Hewlett-Packard Corporation. All Rights Reserved. 
  20938.  
  20939.  Permission to use, copy, modify, and distribute the M.I.T., Digital Equipment 
  20940.  Corporation, and Hewlett-Packard Corporation portions of this software and its 
  20941.  documentation for any purpose without fee is hereby granted, provided that the 
  20942.  above copyright notice appears in all copies and that both that copyright 
  20943.  notice and this permission notice appear in supporting documentation, and that 
  20944.  the names of M.I.T., Digital, and Hewlett-Packard make no representation about 
  20945.  the suitability of this software for any purpose. It is provided "as is" 
  20946.  without express or implied warranty. 
  20947.  
  20948.  
  20949. ΓòÉΓòÉΓòÉ 21.2. Disclaimers ΓòÉΓòÉΓòÉ
  20950.  
  20951. References in this publication to IBM products, programs, or services do not 
  20952. imply that IBM intends to make these available in all countries in which IBM 
  20953. operates. Any reference to an IBM product, program or service is not intended 
  20954. to state or imply that only IBM's product, program, or service may be used. 
  20955. Subject to IBM's valid intellectual property or other legally protectable 
  20956. rights, any functionally equivalent product, program, or service may be used 
  20957. instead of the IBM product, program, or service. Evaluation and verification of 
  20958. operation in conjunction with other products, programs, or services, except 
  20959. those expressly designated by IBM, are the user's responsibility. 
  20960.  
  20961. IBM may have patents or pending patent applications covering subject matter in 
  20962. this document. The furnishing of this document does not give you any license to 
  20963. these patents. You can send license inquiries, in writing, to: 
  20964.  
  20965.   IBM Director of Licensing
  20966.   IBM Corporation
  20967.   500 Columbus Avenue
  20968.   Thornwood, NY 10594
  20969.   U.S.A.
  20970.  
  20971. Licensees of this program who wish to have information about it for the purpose 
  20972. of enabling:  (i) the exchange of information between independently created 
  20973. programs and other programs (including this one) and (ii) the mutual use of the 
  20974. information which has been exchanged, should contact IBM Corporation, 
  20975. Department LZKS, 11400 Burnet Road, Austin, TX 78758, U.S.A.  Such information 
  20976. may be available, subject to appropriate terms and conditions, including in 
  20977. some cases, payment of a fee. 
  20978.  
  20979.  
  20980. ΓòÉΓòÉΓòÉ 21.3. Acknowledgments ΓòÉΓòÉΓòÉ
  20981.  
  20982. TCP/IP for OS/2 incorporates compression code by the Info-ZIP group.  There are 
  20983. no extra charges or costs due to the use of this code, and the original 
  20984. compression sources are freely available from Compuserve in the OS2USER forum 
  20985. and by anonymous ftp from the Internet site ftp.uu.net:/pub/archiving/zip. 
  20986.  
  20987.  
  20988. ΓòÉΓòÉΓòÉ 21.4. Trademarks ΓòÉΓòÉΓòÉ
  20989.  
  20990. The following terms are trademarks of the IBM Corporation in the United States 
  20991. or other countries or both: 
  20992.  
  20993.      AIX 
  20994.      AS/400 
  20995.      IBM 
  20996.      Operating System/2 
  20997.      OS/2 
  20998.      RT 
  20999.      VisualAge 
  21000.  
  21001.  The following terms are trademarks of other companies: 
  21002.  
  21003.  Microsoft, Windows, and the Windows 95 logo are trademarks or registered 
  21004.  trademarks of Microsoft Corporation. 
  21005.  
  21006.  UNIX is a trademark of UNIX System Laboratories, Inc. 
  21007.  
  21008.  Other company, product, and service names which may be denoted by a double 
  21009.  asterisk (**), may be trademarks or service marks of others.