home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / book / tcppr.inf (.txt) < prev    next >
OS/2 Help File  |  1999-05-11  |  583KB  |  21,624 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Edition Notice ΓòÉΓòÉΓòÉ
  3.  
  4. Note 
  5.  
  6. Before using this information and the product it supports, be sure to read the 
  7. general information under Notices. 
  8.  
  9. Fourth Edition (February 1999) 
  10.  
  11. This edition applies to the IBM TCP/IP Version 4.21 for OS/2 Warp licensed 
  12. program. 
  13.  
  14. In the U.S., customers can order publications by calling IBM Software 
  15. Manufacturing Solutions at 1 800-879-2755. Outside the U.S., customers should 
  16. contact the IBM branch office serving their locality. 
  17.  
  18.  
  19. ΓòÉΓòÉΓòÉ 2. About This Information ΓòÉΓòÉΓòÉ
  20.  
  21. This IBM TCP/IP for OS/2 Warp Programming Reference describes the routines for 
  22. application programming in the TCP/IP for OS/2 Warp environment on a 
  23. workstation. 
  24.  
  25. This edition applies to the IBM TCP/IP Version 4.21 for OS/2 Warp licensed 
  26. program. 
  27.  
  28. This section describes: 
  29.  
  30.     Primary users of this information 
  31.  
  32.     Content of each major information division 
  33.  
  34.     Conventions used in this information 
  35.  
  36.     New functions in this information 
  37.  
  38.     Where to find more information 
  39.  
  40.  
  41. ΓòÉΓòÉΓòÉ 2.1. Who Should Use This Information ΓòÉΓòÉΓòÉ
  42.  
  43. This information is intended for application and system programmers with 
  44. experience in writing application programs on a workstation. You should also be 
  45. familiar with the OS/2 operating system and know multitasking operating system 
  46. concepts.  It is important that you also know the C programming language. 
  47.  
  48. If you are not familiar with TCP/IP concepts, see Internetworking With TCP/IP 
  49. Volume I:  Principles, Protocols, and Architecture , and Internetworking With 
  50. TCP/IP Volume II:  Implementation and Internals. 
  51.  
  52.  
  53. ΓòÉΓòÉΓòÉ 2.2. What This Information Describes ΓòÉΓòÉΓòÉ
  54.  
  55. This document contains guidance and reference information about the following 
  56. topics. 
  57.  
  58. Guidance Information 
  59.  
  60.     Sockets General Programming Information 
  61.  
  62.      Describes the TCP/IP socket interface and how to use the socket routines 
  63.      in a user-written application. 
  64.  
  65.     Sockets in the Internet Domain 
  66.  
  67.      Describes TCP/IP network protocols, getting started with sockets in the 
  68.      Internet domain, Internet address formats, and TCP/IP-specific network 
  69.      utility routines. 
  70.  
  71.     Sockets over Local IPC 
  72.  
  73.      Describes how programmers can communicate on the same machine using the 
  74.      sockets API, and the local IPC address format. 
  75.  
  76.     Sockets over NetBIOS 
  77.  
  78.      Describes how programmers can communicate with NetBIOS using the sockets 
  79.      API, and the NetBIOS address format. 
  80.  
  81.     Windows Sockets Version 1.1 for OS/2 
  82.  
  83.      Presents information for implementing the Winsock 1.1 API for OS/2 
  84.      applications. 
  85.  
  86.     Remote Procedure Calls 
  87.  
  88.      Describes the remote procedure calls and how to use them in a user-written 
  89.      application. 
  90.  
  91.     File Transfer Protocol 
  92.  
  93.      Describes the file transfer protocol routines and how to use them in a 
  94.      user-written application. 
  95.  
  96.     Resource ReSerVation Protocol 
  97.  
  98.      Describes the resource reservation protocol routines and how to use them 
  99.      in a user-written application. 
  100.  
  101. Reference Information 
  102.  
  103.     Protocol-Independent C Sockets API 
  104.  
  105.      Describes the protocol-independent socket calls supported by networking 
  106.      services. This information includes call syntax, usage, and related 
  107.      information. 
  108.  
  109.     TCP/IP Network Utility Routines API 
  110.  
  111.      Describes the sockets utility and Sockets Secure Support (SOCKS) function 
  112.      calls supported by networking services. This information includes call 
  113.      syntax, usage, and related information. 
  114.  
  115.     Remote Procedure and eXternal Data Representation API 
  116.  
  117.      Describes the remote procedure and XDR function calls along with their 
  118.      syntax, usage, and related information. 
  119.  
  120.     File Transfer Protocol API 
  121.  
  122.      Describes the file transfer protocol function calls along with their 
  123.      syntax, usage, and related information. 
  124.  
  125.     Resource ReSerVation Protocol API 
  126.  
  127.      Describes the resource reservation protocol function calls along with 
  128.      their syntax, usage, and related information. 
  129.  
  130. Appendixes 
  131.  
  132.     NETWORKS File Structure 
  133.  
  134.      Provides examples of network names contained in the TCPIP\ETC\NETWORKS 
  135.      file. 
  136.  
  137.     Socket Error Constants 
  138.  
  139.      Provides the socket error codes and descriptions. 
  140.  
  141.     Well-Known Port Assignments 
  142.  
  143.      Provides a list of the well-known ports supported by TCP/IP. 
  144.  
  145.     Notices 
  146.  
  147.      Contains copyright notices, disclaimers, and trademarks relating to TCP/IP 
  148.      for OS/2 Warp. 
  149.  
  150.  
  151. ΓòÉΓòÉΓòÉ 2.3. Conventions Used in This Information ΓòÉΓòÉΓòÉ
  152.  
  153. How the Term "Internet" Is Used 
  154.  
  155. An internet is a logical collection of networks supported by gateways, routers, 
  156. bridges, hosts, and various layers of protocols that permit the network to 
  157. function as a large, virtual network. 
  158.  
  159. The term internet is used as a generic term for a TCP/IP network and should not 
  160. be confused with the Internet (note capital I), which consists of large 
  161. national backbone networks (such as MILNET, NSFNet, and CREN) and myriad 
  162. regional and local campus networks all over the world. 
  163.  
  164.  
  165. ΓòÉΓòÉΓòÉ 2.4. What Is New in This Information ΓòÉΓòÉΓòÉ
  166.  
  167. For the list of changes that have been made since earlier versions of TCP/IP 
  168. for OS/2, see 
  169.  
  170.     Changes in Version 4.21. 
  171.  
  172.     Changes in Version 4.21. 
  173.  
  174.     Changes in Version 4 (Merlin). 
  175.  
  176.  
  177. ΓòÉΓòÉΓòÉ 2.4.1. Changes in Version 4.21 ΓòÉΓòÉΓòÉ
  178.  
  179. The following new API functions have been added: 
  180.  
  181.   1. accept_and_recv() 
  182.  
  183.   2. send_file() 
  184.  
  185. Also, a description for new library, R0LIB32, has been added. 
  186.  
  187.  
  188. ΓòÉΓòÉΓòÉ 2.4.2. Changes in Version 4.21 ΓòÉΓòÉΓòÉ
  189.  
  190. Descriptions of TCP Extensions for Transactions (T/TCP), TCP Extensions for 
  191. High Performance, and High Performance Send (HPS) have been added to Sockets 
  192. General Programming Information. 
  193.  
  194. The Resource ReSerVation Protocol (RSVP) has been added. See: 
  195.  
  196.      Resource ReSerVation Protocol 
  197.      Resource ReSerVation Protocol API 
  198.  
  199. Support for Berkley Software Distribution (BSD) Version 4.4 is added. 
  200.  
  201.      In Protocol-Independent C Sockets API, changes have been made to 
  202.      getsockopt() and setsockopt(). sysctl() has been added. The ioctl() call 
  203.      has been split into os2_ioctl() for OS/2 and ioctl() for BSD, and the 
  204.      select() call has been split into os2_select() for OS/2 and select() for 
  205.      BSD. The sock_init() call has been removed. 
  206.  
  207.      In TCP/IP Network Utility Routines API, the bswap(), lswap() and 
  208.      tcp_h_errno() calls have been removed. 
  209.  
  210. In File Transfer Protocol API, additions have been made to the host parameter 
  211. to allow you to specify the port number used by the FTP server. 
  212.  
  213.  
  214. ΓòÉΓòÉΓòÉ 2.4.3. Changes in Version 4 (Merlin) ΓòÉΓòÉΓòÉ
  215.  
  216. This edition reorganizes the information from the previous edition into 
  217. guidance and reference sections, adds substantially to the sockets guidance 
  218. material in Sockets General Programming Information and Sockets in the Internet 
  219. Domain, and also adds the following function calls: 
  220.  
  221. In Protocol-Independent C Sockets API: 
  222.  
  223.      addsockettolist() 
  224.      removesocketfromlist() 
  225.  
  226. In TCP/IP Network Utility Routines API: 
  227.  
  228.      dn_find() 
  229.      dn_skipname() 
  230.      _getlong() 
  231.      _getshort() 
  232.      h_errno 
  233.      putlong() 
  234.      putshort() 
  235.      Raccept() 
  236.      Rbind() 
  237.      Rconnect() 
  238.      res_query() 
  239.      res_querydomain() 
  240.      res_search() 
  241.      rexec() 
  242.      Rgethostbyname() 
  243.      Rgetsockname() 
  244.      Rlisten() 
  245.  
  246. In addition, the os2_connect() and os2_gethostbyname() calls have been removed; 
  247. see connect() and gethostbyname() instead. 
  248.  
  249.  
  250. ΓòÉΓòÉΓòÉ 2.5. For More Information ΓòÉΓòÉΓòÉ
  251.  
  252. You may purchase this information in printed form by ordering IBM publication 
  253. number SC31-8407. U.S. customers can order by calling IBM Software 
  254. Manufacturing Solutions at 1-800-879-2755.  Outside the U.S., customers should 
  255. contact the IBM branch office serving their locality. 
  256.  
  257.  
  258. ΓòÉΓòÉΓòÉ 3. Guidance Information ΓòÉΓòÉΓòÉ
  259.  
  260. This section describes: 
  261.  
  262.     Sockets General Programming Information 
  263.  
  264.      Describes the TCP/IP socket interface and how to use the socket routines 
  265.      in a user-written application. 
  266.  
  267.     Sockets in the Internet Domain 
  268.  
  269.      Describes TCP/IP network protocols, getting started with sockets in the 
  270.      Internet domain, Internet address formats, and TCP/IP-specific network 
  271.      utility routines. 
  272.  
  273.     Sockets over Local IPC 
  274.  
  275.      Describes how programmers can communicate on the same machine using the 
  276.      sockets API, and the local IPC address format. 
  277.  
  278.     Sockets over NetBIOS 
  279.  
  280.      Describes how programmers can communicate with NetBIOS using the sockets 
  281.      API, and the NetBIOS address format. 
  282.  
  283.     Windows Sockets Version 1.1 for OS/2 
  284.  
  285.      Presents information for implementing the Winsock 1.1 API for OS/2 
  286.      applications. 
  287.  
  288.     Remote Procedure Calls 
  289.  
  290.      Describes the remote procedure calls and how to use them in a user-written 
  291.      application. 
  292.  
  293.     File Transfer Protocol 
  294.  
  295.      Describes the file transfer protocol routines and how to use them in a 
  296.      user-written application. 
  297.  
  298.     Resource ReSerVation Protocol 
  299.  
  300.      Describes the resource reservation protocol routines and how to use them 
  301.      to ensure that some quality of service can be reserved for sending and 
  302.      receiving on the network. 
  303.  
  304.  
  305. ΓòÉΓòÉΓòÉ 4. Sockets General Programming Information ΓòÉΓòÉΓòÉ
  306.  
  307. This section contains technical information for planning, designing, and 
  308. writing application programs that use the sockets application programming 
  309. interface (API) in a TCP/IP Version 4.21 for OS/2 Warp environment. 
  310.  
  311. Topics 
  312.  
  313.      Introduction to Networking Services 
  314.      Sockets Overview 
  315.      Socket Protocol Families 
  316.      Socket Addresses 
  317.      Socket Types 
  318.      Socket Creation 
  319.      Binding Names to Sockets 
  320.      Socket Connections 
  321.      Obtaining Socket Addresses 
  322.      Server Connections 
  323.      Connectionless Datagram Services 
  324.      Socket Options 
  325.      Socket Data Transfer 
  326.      Socket Shutdown 
  327.      Typical Socket Session Diagram 
  328.      TCP Extensions for Transactions (T/TCP) 
  329.      TCP Extensions for High Performance (RFC 1323) 
  330.      High Performance Send 
  331.      Passing Sockets Between Processes 
  332.      Multithreading Considerations 
  333.      Accessing a TCP/IP API DLL from an Intermediate DLL 
  334.      Differences between OS/2 and Standard BSD Sockets 
  335.      Compiling and Linking a Sockets API Application 
  336.      Sample Programs 
  337.  
  338.  
  339. ΓòÉΓòÉΓòÉ 4.1. Introduction to Networking Services ΓòÉΓòÉΓòÉ
  340.  
  341. OS/2 Warp has integrated networking services that provide a 32-bit sockets API 
  342. for the: 
  343.  
  344.     Internet (TCP/IP) domain 
  345.     NetBIOS communication domain 
  346.     Local interprocess communication (Local IPC) domain 
  347. The sockets API lets you write distributed or client/server applications using 
  348. TCP/IP or NetBIOS to communicate across networks. The API also allows 
  349. interprocess communication within a single workstation. OS/2 Warp's sockets API 
  350. is based on the Berkeley Software Distribution (BSD) Version 4.4 sockets 
  351. implementation. 
  352.  
  353. The OS/2 Warp operating system's networking services consists of three layers: 
  354.  
  355.     The sockets layer 
  356.     The protocol layer 
  357.     The device layer 
  358. The sockets layer supplies the interface between the calls and lower layers, 
  359. the protocol layer contains the protocol stacks used for communication, and the 
  360. device layer contains the device drivers that control the network devices. The 
  361. following figure illustrates the relationship between the layers: 
  362.  
  363.  
  364. Client/Server Model
  365.  
  366. Processes communicate using the client/server model. In this model, a server 
  367. process acting as one endpoint of a two-way communication path listens to a 
  368. socket. At the other end a client process communicates to the server process 
  369. through another socket. The client process can be on the same machine or on a 
  370. different machine from the server process. The protocol stack(s) on the 
  371. machine(s) maintains internal connections, and routes data between the client 
  372. and server. 
  373.  
  374. The following figure describes the OS/2 Warp kernel and internal structure of 
  375. TCP/IP Version 4.21 for OS/2 Warp. 
  376.  
  377.  
  378. Internal Structure of TCP/IP
  379.  
  380. The major components of the OS/2 TCP/IP stack are: 
  381.  
  382. Control Program 
  383.  
  384. CNTRL.EXE provides threads to run the TCP/IP stack.  It provides a thread for 
  385. each of the following: 
  386.  
  387.     TCP fast timeout processing 
  388.     TCP slow timeout processing 
  389.     Debug thread for IP 
  390.     ARP timeout processing 
  391.     Watchdog thread for the adapter status 
  392.     Loopback IP packets processing 
  393.  
  394. CNTRL.EXE is normally started from CONFIG.SYS with a RUN = statement. It should 
  395. be the first program to begin executing when TCP/IP is started. 
  396.  
  397. Sockets Layer The sockets layer comprises the dynamic link libraries for the 
  398. different categories of applications, and the device drivers. 
  399.  
  400.     DLLs: 
  401.  
  402.      TCPIP32.DLL exports the 32-bit BSD Version 4.4 sockets API to 
  403.      applications. TCP32DLL.DLL and SO32DLL.DLL together export the 32-bit BSD 
  404.      Version 4.3 socket APIs to applications. These three DLLs are 
  405.      thread-reentrant. TCPIPDLL.DLL provides the sockets APIs for 16-bit 
  406.      applications. 
  407.  
  408.     Device driver: 
  409.  
  410.      SOCKETS.SYS provides the common sockets layer for the protocol stacks. 
  411.      Calls made to the socket APIs first pass through SOCKETS.SYS, which routes 
  412.      the call to the correct protocol stack.  The socket address families 
  413.      supported are AF_OS2 (or equivalently, AF_UNIX), AF_INET, and AF_NETBIOS 
  414.      (or equivalently, AF_NB). 
  415.  
  416. Protocol Layer The protocol layer holds the device drivers. 
  417.  
  418. AFOS2.SYS is the  Local Interprocess Communication (LIPC) device driver.  This 
  419. driver supports AF_OS2 and AF_UNIX socket types. These socket types can be used 
  420. by applications within one OS/2 machine to communicate with each other. 
  421.  
  422. AFNB.SYS device driver provides support for sockets over NetBIOS.  This driver 
  423. supports applications written using the AF_NETBIOS or AF_NB socket type. 
  424.  
  425. AFINET.SYS is the transport protocol device driver for the AF_INET socket type. 
  426. AFINET.SYS is essentially TCP/IP code. It is compliant with NDIS version 2.0.1; 
  427. any MAC driver written to that specification should work with the stack. SLIP, 
  428. PPP, X25, and SNAlink use a special interface in this driver to their 
  429. respective hardware. 
  430.  
  431.  
  432. ΓòÉΓòÉΓòÉ 4.1.1. R0LIB32 Library ΓòÉΓòÉΓòÉ
  433.  
  434. Ring-3 application programs access the networking kernel through tcp32dll.dll 
  435. and so32dll.dll. For the device drivers at Ring-0, the ring transitions to 
  436. access the networking kernel (sockets.sys) are very costly, and hence the 
  437. r0lib.lib interface provides a way to access the networking kernel through 
  438. 16-bit API calls. Because the r0lib is a 16-bit interface and the TCP/IP stack 
  439. version 4.21 and above is a 32-bit stack, version 4.21 provides a new library 
  440. at Ring-0, called r0lib32. 
  441.  
  442. This new library not only saves the thunking in the stack kernel, but also 
  443. bypasses the thunking layer, which is required for the 32-bit device drivers to 
  444. go through the existing r0lib. All 32-bit device drivers can now use the 
  445. r0lib32 to get into the stack without any thunking or ring transition 
  446. overheads. 
  447.  
  448.  
  449. ΓòÉΓòÉΓòÉ 4.2. Sockets Overview ΓòÉΓòÉΓòÉ
  450.  
  451. This section provides some background information about the OS/2 Warp sockets 
  452. API, defines it in more detail, and describes its basic functions. 
  453.  
  454. Topics 
  455.  
  456.      Sockets Background 
  457.      What Is a Socket? 
  458.      Socket Facilities 
  459.  
  460.  
  461. ΓòÉΓòÉΓòÉ 4.2.1. Sockets Background ΓòÉΓòÉΓòÉ
  462.  
  463. The sockets API was developed in response to the need for sophisticated 
  464. interprocess communication facilities to meet the following goals: 
  465.  
  466.     Provide access to communications networks such as an internet 
  467.  
  468.     Enable communication between unrelated processes, which can either reside 
  469.      locally on the same host computer or on multiple host machines 
  470.  
  471. The sockets API provides a generic interface that allows networking 
  472. applications to use any protocol stack. After you pick the protocol stack, you 
  473. can choose the type of socket that you want, based on the communication 
  474. characteristics that you desire.  For example, stream sockets offer a reliable 
  475. method of data transmission without message boundaries, whereas datagram 
  476. sockets offer message boundaries but do not guarantee reliability. 
  477.  
  478.  
  479. ΓòÉΓòÉΓòÉ 4.2.2. What Is a Socket? ΓòÉΓòÉΓòÉ
  480.  
  481. A socket is a communication channel abstraction that enables unrelated 
  482. processes to exchange data locally and across networks. A single socket is one 
  483. endpoint of a full-duplex (two-way) communication channel. This means that data 
  484. can be transmitted and received simultaneously. From an application program 
  485. perspective, a socket is a resource allocated by the operating system, similar 
  486. to a file handle. It is represented by an unsigned integer called a socket 
  487. descriptor. A pair of sockets is used to communicate between processes on a 
  488. single workstation or different workstations. Each socket of the pair is used 
  489. by its own process to send and receive data with the other socket. 
  490.  
  491. When a socket is created, it is associated with a particular protocol stack 
  492. (called the protocol family) and socket type within that family. Communication 
  493. can occur only between sockets that use the same socket type within the same 
  494. protocol family. 
  495.  
  496.  
  497. ΓòÉΓòÉΓòÉ 4.2.3. Socket Facilities ΓòÉΓòÉΓòÉ
  498.  
  499. Socket calls and network library calls provide the building blocks for IPC. An 
  500. application program must perform the basic functions, described in the 
  501. following sections, to conduct IPC through the sockets layer. 
  502.  
  503. Topics 
  504.  
  505.      Creating and Binding Sockets 
  506.      Accepting and Initiating Socket Connections 
  507.      Sending and Receiving Data 
  508.      Shutting Down Socket Operations 
  509.      Translating Network Addresses 
  510.  
  511.  
  512. ΓòÉΓòÉΓòÉ 4.2.3.1. Creating and Binding Sockets ΓòÉΓòÉΓòÉ
  513.  
  514. A socket is created with the socket() call. This call creates a socket of a 
  515. specified: 
  516.  
  517.     protocol family 
  518.     socket type 
  519.     protocol 
  520. Sockets have different qualities depending on these specifications. The 
  521. protocol family specifies the protocol stack to be used with the created 
  522. socket. The socket type defines its communication properties such as 
  523. reliability, ordering, and prevention of duplication of messages (see Socket 
  524. Types). The protocol specifies which network protocol to use within the domain. 
  525. The protocol must support the characteristics requested by the socket type. 
  526.  
  527. An application can use the bind() call to associate a local name (usually a 
  528. network address) with a socket. The form and meaning of socket addresses are 
  529. dependent on the protocol family in which the socket is created. The socket 
  530. name is specified by a sockaddr structure. 
  531.  
  532. The bind() call is optional under some circumstances: the connect() call and 
  533. any of the data transmission calls (for example,  send()) will automatically 
  534. associate the local name to the socket if bind() hasn't been called. 
  535.  
  536.  
  537. ΓòÉΓòÉΓòÉ 4.2.3.2. Accepting and Initiating Socket Connections ΓòÉΓòÉΓòÉ
  538.  
  539. Sockets can be connected or unconnected. Unconnected sockets are produced by 
  540. the socket() call. An unconnected socket can become a connected socket by: 
  541.  
  542.     Client application: Actively connecting to another socket, using the 
  543.      connect() call 
  544.  
  545.     Server application: Binding a name to the socket, and then listening for 
  546.      and accepting a connection from another socket, using the listen() and 
  547.      accept() calls. 
  548.  
  549. Stream sockets require a connection before you can transfer data. Other types 
  550. of sockets, such as datagram sockets, need not establish connections before 
  551. use. 
  552.  
  553.  
  554. ΓòÉΓòÉΓòÉ 4.2.3.3. Sending and Receiving Data ΓòÉΓòÉΓòÉ
  555.  
  556. The sockets API includes a variety of calls for transferring data. They all 
  557. operate similarly, but take different parameters to support different levels of 
  558. functionality. Some socket calls support scatter-gather communication. Some 
  559. support only connected sockets while others will work on any socket. Some calls 
  560. support additional flags to control how data is sent or received. See Data 
  561. Transfer Calls for a summary of which calls support which options. 
  562.  
  563.  
  564. ΓòÉΓòÉΓòÉ 4.2.3.4. Shutting Down Socket Operations ΓòÉΓòÉΓòÉ
  565.  
  566. Once sockets are no longer of use they can be shut down or closed using the 
  567. shutdown() or soclose() call. Typically, the shutdown() call is used if you 
  568. want to shut down data transfer in one direction while keeping the other 
  569. direction open.  The soclose() call shuts down data transfer in both directions 
  570. and then releases the resources associated with the socket. 
  571.  
  572.  
  573. ΓòÉΓòÉΓòÉ 4.2.3.5. Translating Network Addresses ΓòÉΓòÉΓòÉ
  574.  
  575. Application programs need to translate human-readable addresses into the 
  576. low-level form used by the protocol. The sockets API includes calls to: 
  577.  
  578.     Map host names to IP addresses and back 
  579.     Map network names to numbers and back 
  580.     Map service and protocol names to numbers and back 
  581.     Convert numbers from network-byte order (big-endian) to host-byte order 
  582.      (which is little-endian on OS/2 machines) and back 
  583.  
  584.  
  585. ΓòÉΓòÉΓòÉ 4.3. Socket Protocol Families ΓòÉΓòÉΓòÉ
  586.  
  587. Sockets that share common communication properties, such as naming conventions 
  588. and address formats, are grouped into protocol families. 
  589.  
  590. A protocol family includes the following: 
  591.  
  592.     Rules for manipulating and interpreting network addresses 
  593.     A collection of related address formats that comprise an address family 
  594.     A set of network protocols 
  595.  
  596. Topics 
  597.  
  598.      Supported Protocol Families 
  599.      TCP/IP Properties 
  600.      Local IPC Properties 
  601.      NetBIOS Domain Properties 
  602.      Routing Domain Properties 
  603.  
  604.  
  605. ΓòÉΓòÉΓòÉ 4.3.1. Supported Protocol Families ΓòÉΓòÉΓòÉ
  606.  
  607. The supported domains' protocol families are defined in the <SYS\SOCKET.H> 
  608. header file and are listed in the following table: 
  609.  
  610. Protocol Families Supported 
  611.  
  612. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  613. ΓöéProtocol       #define in        Supported         Supported SocketΓöé
  614. ΓöéFamily         <SYS\SOCKET.H>    Protocols         Types           Γöé
  615. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  616. ΓöéTCP/IP         PF_INET           ICMP, IP, TCP,    Datagram, raw,  Γöé
  617. Γöé                                 UDP               stream          Γöé
  618. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  619. ΓöéLocal IPC      PF_OS2 or PF_UNIX Local IPC         Datagram, streamΓöé
  620. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  621. ΓöéNetBIOS        PF_NETBIOS or     NetBIOS           Datagram,       Γöé
  622. Γöé               PF_NB                               sequenced packetΓöé
  623. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  624. ΓöéRouting        PF_ROUTE          Routing messages  Raw             Γöé
  625. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  626.  
  627.  As the table indicates, some socket types can be used in more than one 
  628. protocol family. 
  629.  
  630.  
  631. ΓòÉΓòÉΓòÉ 4.3.2. TCP/IP Properties ΓòÉΓòÉΓòÉ
  632.  
  633. Provides socket communication between a local process and a process running on 
  634. a remote host. The SOCK_STREAM socket type is supported by TCP (Transmission 
  635. Control Protocol); the SOCK_DGRAM socket type is supported by UDP (User 
  636. Datagram Protocol). Each is layered on top of the transport-level Internet 
  637. Protocol (IP). ICMP (Internet Control Message Protocol) is implemented on top 
  638. of IP and is accessible through a raw socket. The raw socket interface, 
  639. SOCK_RAW sockets, allows access to the raw facilities of IP. Each raw socket is 
  640. associated with one IP protocol number and receives all traffic for that 
  641. protocol. This allows administrative and debugging functions to occur and 
  642. enables user-level implementations of special-purpose protocols such as 
  643. inter-gateway routing protocols. 
  644.  
  645.  
  646. ΓòÉΓòÉΓòÉ 4.3.3. Local IPC Properties ΓòÉΓòÉΓòÉ
  647.  
  648. Provides socket communication between processes running on the same machine. 
  649. The SOCK_STREAM socket type provides pipe-like facilities, while the SOCK_DGRAM 
  650. socket type provides reliable message-style communications. 
  651.  
  652.  
  653. ΓòÉΓòÉΓòÉ 4.3.4. NetBIOS Domain Properties ΓòÉΓòÉΓòÉ
  654.  
  655. Provides connection-oriented, reliable, full-duplex service to an application. 
  656. SOCK_SEQPACKET provides reliable message-style communications, while SOCK_DGRAM 
  657. provides a connectionless mode of communications. 
  658.  
  659.  
  660. ΓòÉΓòÉΓòÉ 4.3.5. Routing Domain Properties ΓòÉΓòÉΓòÉ
  661.  
  662. The PF_ROUTE domain supports communications between a process and the routing 
  663. facilities in the kernel. 
  664.  
  665.  
  666. ΓòÉΓòÉΓòÉ 4.4. Socket Addresses ΓòÉΓòÉΓòÉ
  667.  
  668. Sockets can be named with an address so that processes can connect to them. The 
  669. sockets layer treats an address as an opaque object. Applications supply and 
  670. receive addresses as tagged, variable-length byte strings. A sockaddr data 
  671. structure can be used as a template for referring to the identifying tag of 
  672. each socket address. 
  673.  
  674. Topics 
  675.  
  676.      Socket Address Data Structures 
  677.      Socket Addresses in TCP/IP 
  678.      Connection Modes 
  679.  
  680.  
  681. ΓòÉΓòÉΓòÉ 4.4.1. Socket Address Data Structures ΓòÉΓòÉΓòÉ
  682.  
  683. The sockaddr data structure is used to provide a generic name for a socket. The 
  684. following figure illustrates this data structure: 
  685.  
  686.  
  687. sockaddr Structure
  688.  
  689. The <SYS\SOCKET.H> file contains this data structure. The sa_len field 
  690. specifies how long the address is; this field is only used with routing 
  691. sockets. The family (sa_family) identifies which protocol family this address 
  692. corresponds to. The contents of the socket address data (sa_data) field depend 
  693. on the protocol in use. 
  694.  
  695. Additional data structures are defined that correspond to a particular protocol 
  696. family and overlay the sockaddr structure. The types of socket address data 
  697. structures are as follows: 
  698.  
  699. Socket Address Data Structures 
  700.  
  701. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  702. ΓöéData Structure        sa_family Value  Protocol     Header File     Γöé
  703. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  704. Γöéstruct sockaddr_in    AF_INET          TCP/IP       <NETINET\IN.H>  Γöé
  705. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  706. Γöéstruct sockaddr_un    AF_OS2 or        Local IPC    <SYS\UN.H>      Γöé
  707. Γöé                      AF_UNIX                                       Γöé
  708. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  709. Γöéstruct sockaddr_nb    AF_NETBIOS or    NetBIOS      <NETNB\NB.H>    Γöé
  710. Γöé                      AF_NB                                         Γöé
  711. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  712.  
  713. The contents of the various socket addresses are as follows: 
  714.  
  715. Internet 
  716.   A socket name in the internet domain is an internet address, made up of a 
  717.   32-bit IP address and a 16-bit port number. The 32-bit address is composed of 
  718.   network and host parts; the network part is variable in size. The host part 
  719.   can be interpreted optionally as a subnet field plus the host on a subnet; 
  720.   this is enabled by setting a network address mask. 
  721.  
  722. OS/2 or UNIX 
  723.   A socket name in the OS/2 or UNIX domain is a unique listing of ASCII 
  724.   characters of up to 108 bytes. 
  725.  
  726. NetBIOS 
  727.   A socket name in the NetBIOS domain is made up of a 16-byte NetBIOS name and 
  728.   is used as is. 
  729.  
  730.  
  731. ΓòÉΓòÉΓòÉ 4.4.2. Socket Addresses in TCP/IP ΓòÉΓòÉΓòÉ
  732.  
  733. TCP/IP provides a set of 16-bit port numbers within each host. Because each 
  734. host assigns port numbers independently, it is possible for sockets on 
  735. different hosts to have the same port number. 
  736.  
  737. To ensure that socket addresses are unique within a network, TCP/IP 
  738. concatenates the internet address of the LAN interface with the port number to 
  739. devise the internet socket address. Since a host's internet address is always 
  740. unique within a network, the socket address for a particular socket on a 
  741. particular host is unique. Additionally, since each connection is fully 
  742. specified by the pair of sockets it joins, every connection between internet 
  743. hosts is also uniquely identified. 
  744.  
  745. The port numbers from 0 to 1023 are reserved for official internet services. 
  746. Port numbers in the range of 1024-49151 are reserved for other registered 
  747. services that are common on internet networks. These port numbers are listed in 
  748. the ETC\SERVICES file. When a client process needs one of these well-known 
  749. services at a particular host, the client process sends a service request to 
  750. the socket address for the well-known port at the server. 
  751.  
  752. The port numbers from 49152 to 65535 are generally used by client processes 
  753. which need a port, but don't care which one they get. These port numbers are 
  754. usually assigned by the TCP/IP stack when a connect() or sendto() is performed 
  755. without having done a previous bind(). 
  756.  
  757.  
  758. ΓòÉΓòÉΓòÉ 4.4.3. Connection Modes ΓòÉΓòÉΓòÉ
  759.  
  760. A connection mode refers to an established logical channel for the transmission 
  761. of data between two application programs. 
  762.  
  763. The sockets API supports two connection modes: 
  764.  
  765.     Connection-oriented 
  766.     Connectionless 
  767.  
  768. In the connectionless mode, sockets are not tied to a destination address. 
  769. Applications sending messages can specify a different destination address for 
  770. each datagram, if necessary, or they can tie the socket to a specific 
  771. destination address for the duration of the connection. 
  772.  
  773. The connection-oriented mode requires a logical connection to be established 
  774. between two applications before data transfer or communication can occur. 
  775. Applications encounter some overhead during the connection establishment phase 
  776. as the applications negotiate the connection request. This mode is useful for 
  777. applications that use long datastream transmissions or require reliable 
  778. transmissions of data. 
  779.  
  780. The connectionless mode does not require a logical connection to allow 
  781. communication between applications. Rather, individual messages are transmitted 
  782. independently from one application to another application. Each message must 
  783. contain the data and all information required for delivery of the message to 
  784. its destination. Normally, datagram and raw socket types use the connectionless 
  785. mode. 
  786.  
  787. The term connected refers to two endpoints that have an established logical 
  788. connection between them. Stream and sequenced packet socket types use the 
  789. connection-oriented mode. For information on how datagram and raw socket types 
  790. can be connected, see Datagram or Raw Sockets. 
  791.  
  792.  
  793. ΓòÉΓòÉΓòÉ 4.5. Socket Types ΓòÉΓòÉΓòÉ
  794.  
  795. Sockets are classified according to communication properties. Processes usually 
  796. communicate between sockets of the same type. However, if the underlying 
  797. communication protocols support the communication, sockets of different types 
  798. can communicate. 
  799.  
  800. Each socket has an associated type, which describes the semantics of 
  801. communications using that socket. The socket type determines the socket 
  802. communication properties such as reliability, ordering, and prevention of 
  803. duplication of messages. The basic set of socket types is defined in the 
  804. <SYS\SOCKET.H> file: 
  805.  
  806. /*Standard socket types */
  807.  
  808. #define  SOCK_STREAM            1 /*virtual circuit*/
  809.  
  810. #define  SOCK_DGRAM             2 /*datagram*/
  811.  
  812. #define  SOCK_RAW               3 /*raw socket*/
  813.  
  814. #define  SOCK_SEQPACKET         5 /*sequenced packet stream*/
  815.  
  816. Other socket types can be defined. 
  817.  
  818. OS/2 supports the basic set of sockets: 
  819.  
  820. SOCK_DGRAM 
  821.   Provides datagrams, which are connectionless messages of a fixed maximum 
  822.   length. This type of socket is generally used for short messages, such as a 
  823.   name server or time server, since the order and reliability of message 
  824.   delivery is not guaranteed. 
  825.  
  826.   A datagram socket supports the bidirectional flow of data which is not 
  827.   sequenced, reliable, or unduplicated. A process receiving messages on a 
  828.   datagram socket may find messages duplicated or in an order different from 
  829.   the order sent. Record boundaries in data are, however, preserved. Datagram 
  830.   sockets closely model the facilities found in many contemporary 
  831.   packet-switched networks. 
  832.  
  833.   An application can use the sendto() and recvfrom() calls or the sendmsg() and 
  834.   recvmsg() calls to exchange data over a datagram socket. If an application is 
  835.   using datagram sockets and calls connect() fully specifying the destination 
  836.   address, the socket will be considered connected. The application program can 
  837.   then use the other data transfer calls send() and recv() or writev() and 
  838.   readv(). The connected or unconnected method of data transfer stays in effect 
  839.   until connect() is called again with a different destination address. 
  840.  
  841.   Datagram sockets may be used to send broadcast messages over TCP/IP and 
  842.   NetBIOS. For TCP/IP, the constant INADDR_BROADCAST, defined in 
  843.   <NETINET\IN.H>, can be used to send a broadcast datagram. For NetBIOS, the 
  844.   address format has a type field that specifies whether the address is unique, 
  845.   multicast, or broadcast. 
  846.  
  847. SOCK_STREAM 
  848.   Provides sequenced, two-way byte streams with a transmission mechanism for 
  849.   stream data. This socket type transmits data reliably (in order, not 
  850.   duplicated, and retransmitted if necessary) without record boundaries, and 
  851.   with out-of-band capabilities. 
  852.  
  853.   There is no guarantee for a one-to-one correspondence of send and receive 
  854.   calls.  It is possible for data sent by one send() call to be received by 
  855.   more than one different receive call, or the other way around. 
  856.  
  857.   Stream sockets  are either active or passive. Active sockets are used by 
  858.   clients who actively initiate connection requests with connect(). Passive 
  859.   sockets are used by servers to passively wait for and accept connection 
  860.   requests with the listen() and accept() calls. A passive socket that has 
  861.   indicated its willingness to accept connections with the listen() call cannot 
  862.   be used to initiate connection requests. 
  863.  
  864.   After a connection has been established between stream sockets, any of the 
  865.   data transfer calls can be used: 
  866.  
  867.       send() and recv() 
  868.       sendto() and recvfrom() 
  869.       sendmsg() and recvmsg() 
  870.       writev() and readv() 
  871.  
  872.   Usually, a send()-recv() pair is used for sending data on stream sockets. 
  873.  
  874. SOCK_RAW 
  875.   Provides access to internal network protocols and interfaces. A raw socket 
  876.   allows an application direct access to lower-level communication protocols, 
  877.   such as IP and ICMP. Raw sockets are intended for advanced users who wish to 
  878.   take advantage of some protocol feature not directly accessible through a 
  879.   normal interface, or who wish to build new protocols atop existing low-level 
  880.   protocols. 
  881.  
  882.   Raw sockets are normally datagram-oriented, though their exact 
  883.   characteristics are dependent upon the interface provided by the protocol. 
  884.   However, raw sockets can be connected if connect() is called to specify the 
  885.   destination address. 
  886.  
  887. SOCK_SEQPACKET 
  888.   Provides sequenced, reliable, and unduplicated flow of information. Every 
  889.   sequenced packet is sent and received as a complete record. 
  890.  
  891.   After a connection has been established between sequenced packet sockets, any 
  892.   of the data transfer calls can be used: 
  893.  
  894.       send() and recv() 
  895.       sendto() and recvfrom() 
  896.       sendmsg() and recvmsg() 
  897.       writev() and readv() 
  898.  
  899.   Usually, a send()-recv() pair is used for sending data on sequenced packet 
  900.   sockets. 
  901.  
  902. Topics 
  903.  
  904.      Socket Types Summary 
  905.      Guidelines for Using Socket Types 
  906.  
  907.  
  908. ΓòÉΓòÉΓòÉ 4.5.1. Socket Types Summary ΓòÉΓòÉΓòÉ
  909.  
  910. The following table summarizes many of the attributes and features of supported 
  911. socket types: 
  912.  
  913. Socket Types 
  914.  
  915. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  916. ΓöéSocket Type #define in      Protocols     Connection   Primary SocketΓöé
  917. Γöé            <SYS\SOCKET.H>                Oriented?    Calls         Γöé
  918. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  919. ΓöéStream      SOCK_STREAM     TCP/IP, Local yes          send() or     Γöé
  920. Γöé                            IPC                        recv()        Γöé
  921. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  922. ΓöéSequenced   SOCK_SEQPACKET  NetBIOS       yes          send() or     Γöé
  923. Γöépacket                                                 recv()        Γöé
  924. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  925. ΓöéDatagram    SOCK_DGRAM      TCP/IP, Local no*          sendto() or   Γöé
  926. Γöé                            IPC, NetBIOS               recvfrom()*   Γöé
  927. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  928. ΓöéRaw         SOCK_RAW        TCP/IP        no*          sendto() or   Γöé
  929. Γöé                                                       recvfrom()*   Γöé
  930. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  931.  
  932. Table Note  (*) Datagram sockets and raw sockets are connectionless, unless the 
  933.             application has called connect() for the socket. In this case, the 
  934.             socket is connected. Refer to Connection Modes for additional 
  935.             information. 
  936.  
  937.  
  938. ΓòÉΓòÉΓòÉ 4.5.2. Guidelines for Using Socket Types ΓòÉΓòÉΓòÉ
  939.  
  940. If you are communicating with an existing application, you must use the same 
  941. socket type and the same protocol as the existing application. 
  942.  
  943. Raw sockets have a special purpose of interfacing directly to the underlying 
  944. protocol layer. If you are writing a new protocol on top of Internet Protocol 
  945. (IP) or wish to use the Internet Control Message Protocol (ICMP), then you must 
  946. use raw sockets. 
  947.  
  948. You should consider the following factors in choosing a socket type for new 
  949. applications: 
  950.  
  951.     Reliability:  Stream and sequenced packet sockets provide the most 
  952.      reliable connection. Connectionless datagram and raw sockets are 
  953.      unreliable because packets can be discarded, duplicated, or received out 
  954.      of order. This may be acceptable if the application does not require 
  955.      reliability, or if the application implements the reliability on top of 
  956.      the sockets API. 
  957.  
  958.     Performance:  The overhead associated with reliability, flow control, 
  959.      packet reassembly, and connection maintenance degrades the performance of 
  960.      stream and sequenced packet sockets so that these socket types do not 
  961.      perform as well as datagram sockets acting in a connectionless mode. 
  962.  
  963.     Amount of data to be transferred:  Datagram and sequenced packet sockets 
  964.      impose a limit on the amount of data transferred in each packet. 
  965.  
  966.  
  967. ΓòÉΓòÉΓòÉ 4.6. Socket Creation ΓòÉΓòÉΓòÉ
  968.  
  969. The basis for communication between processes centers on the socket mechanism. 
  970. A socket is comparable to an OS/2 file handle. Application programs request the 
  971. operating system to create a socket through the use of the socket() call. When 
  972. an application program requests the creation of a new socket, the operating 
  973. system returns an integer that the application program uses to reference the 
  974. newly created socket. 
  975.  
  976. To create a socket with the socket() call, the application program must include 
  977. a protocol family and a socket type. It can also include a specific 
  978. communication protocol within the specified protocol family. 
  979.  
  980. An example of an application using the socket() call is: 
  981.  
  982.  
  983. An Application Using the socket() Call
  984.  
  985. int s;
  986. ...
  987. s = socket(PF_INET, SOCK_STREAM, 0);
  988.  
  989. In this example, the socket() call allocates a socket descriptor s in the 
  990. internet protocol family (PF_INET). The type parameter is a constant that 
  991. specifies the type of socket.  For the internet communication domain, this can 
  992. be SOCK_STREAM, SOCK_DGRAM, or SOCK_RAW. The protocol parameter is a constant 
  993. that specifies which protocol to use. Passing 0 chooses the default protocol 
  994. for the specified socket type. Supported Protocol Families includes information 
  995. on default protocols. If successful, socket() returns a non-negative integer 
  996. socket descriptor. 
  997.  
  998. See Socket Connections for more about creating sockets. 
  999.  
  1000.  
  1001. ΓòÉΓòÉΓòÉ 4.7. Binding Names to Sockets ΓòÉΓòÉΓòÉ
  1002.  
  1003. The socket() call creates a socket without a name. An unnamed socket is one 
  1004. without any association to a local address. Until a name is bound to a socket, 
  1005. no messages can be received on it. 
  1006.  
  1007. Communicating processes are bound by an association. The bind() call allows a 
  1008. process to specify half of an association: local address and local port 
  1009. (TCP/IP), or local path name (NetBIOS and local IPC). The connect() and 
  1010. accept() calls are used to complete a socket's association. 
  1011.  
  1012. An application program may not care about the local address it uses and may 
  1013. allow the protocol software to select one. This is not true for server 
  1014. processes. Server processes that operate at a well-known port need to be able 
  1015. to specify that port to the system. 
  1016.  
  1017. In most domains, associations must be unique. Internet domain associations must 
  1018. never include duplicate protocol, local address, local port, foreign address, 
  1019. or foreign port tuples. 
  1020.  
  1021. Wildcard addressing is provided to aid local address binding in the Internet 
  1022. domain. When an address is specified as INADDR_ANY (a constant defined in the 
  1023. <NETINET\IN.H> file), the system interprets the address as any valid address. 
  1024.  
  1025. Sockets with wildcard local addresses may receive messages directed to the 
  1026. specified port number and sent to any of the possible addresses assigned to a 
  1027. host. If a server process wished to connect only hosts on a given network, it 
  1028. would bind the address of the hosts on the appropriate network. 
  1029.  
  1030. A local port can be specified or left unspecified (denoted by 0), in which case 
  1031. the system selects an appropriate port number for it. 
  1032.  
  1033. The bind() call accepts the s, name, and namelen parameters. The s parameter is 
  1034. the integer descriptor of the socket to be bound. The name parameter specifies 
  1035. the local address, and the namelen parameter indicates the length of address in 
  1036. bytes. The local address is defined by a data structure termed sockaddr. 
  1037.  
  1038. In the internet  domain, a process does not have to bind an address and port 
  1039. number to a socket, because the connect() and send() calls automatically bind 
  1040. an appropriate address if they are used with an unbound socket. 
  1041.  
  1042. The bound name is a variable-length byte string that is interpreted by the 
  1043. supporting protocols. Its interpretation can vary from protocol family to 
  1044. protocol family (this is one of the properties of the protocol family). 
  1045.  
  1046. An example of an application using the bind() call is: 
  1047.  
  1048.  
  1049. An Application Using the bind() Call
  1050.  
  1051. int rc;
  1052. int s;
  1053. struct sockaddr_in myname;
  1054.  
  1055. /* clear the structure */
  1056. memset(&myname, 0, sizeof(myname));
  1057. myname.sin_len = sizeof(myname);
  1058. myname.sin_family = AF_INET;
  1059. myname.sin_addr.s_addr = inet_addr("129.5.24.1"); /* specific interface */
  1060. myname.sin_port = htons(1024);
  1061. ...
  1062. rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  1063.  
  1064. For a server in the internet domain to be able to listen for connections on a 
  1065. stream socket or issue recvfrom() on a datagram socket, the server must first 
  1066. bind the socket to a specific address family, local address, and local port. 
  1067. This example binds myname to socket s. Note that the sockaddr_in structure 
  1068. should be zeroed before calling bind(). For a more detailed description, see 
  1069. bind(). For information on the sockaddr_in structure, see Internet Address 
  1070. Formats. 
  1071.  
  1072. The unique name myname specifies that the application uses an internet address 
  1073. family (AF_INET) at internet address 129.5.24.1, and is bound to port 1024. The 
  1074. preceding example shows two useful network utility routines. 
  1075.  
  1076.     inet_addr()  takes an internet address in dotted-decimal form and returns 
  1077.      it in network-byte order. For a more detailed description, see 
  1078.      inet_addr(). 
  1079.  
  1080.     htons()  takes a port number in host-byte order and returns the port in 
  1081.      network-byte order.  For a more detailed description, see htons(). 
  1082.  
  1083. The next figure shows how the bind() call on the server side uses the network 
  1084. utility routine getservbyname() to find a well-known port number for a 
  1085. specified service from the ETC\SERVICES file (for more information on 
  1086. well-known ports, see Ports). The figure also shows the use of the internet 
  1087. address wildcard value INADDR_ANY.  This is the value generally used on a 
  1088. socket bind() call.  It binds the socket to all internet addresses available on 
  1089. the local machine, without requiring the program to know the local internet 
  1090. address. (The code fragment in the preceding figure will run successfully only 
  1091. on the machine with internet address 192.5.24.1.) If a host has more than one 
  1092. internet address (that is, if it is multihomed host), messages sent to any of 
  1093. the addresses will be deliverable to a socket bound to INADDR_ANY. 
  1094.  
  1095.  
  1096. A bind() Call Using the getservbyname() Call
  1097.  
  1098. int rc;
  1099. int s;
  1100. struct sockaddr_in myname;
  1101. struct servent *sp;
  1102. ...
  1103. sp = getservbyname("login","tcp");  /* get application specific */
  1104. /* well-known port          */
  1105. ...
  1106. /* clear the structure */
  1107. memset(&myname, 0, sizeof(myname));
  1108. myname.sin_len = sizeof(myname);
  1109. myname.sin_family = AF_INET;
  1110. myname.sin_addr.s_addr = INADDR_ANY;  /* any interface */
  1111. myname.sin_port = sp->s_port;
  1112. ...
  1113. rc = bind(s,(struct sockaddr *)&myname,sizeof(myname));
  1114.  
  1115. See bind() for more on this call. 
  1116.  
  1117.  
  1118. ΓòÉΓòÉΓòÉ 4.8. Socket Connections ΓòÉΓòÉΓòÉ
  1119.  
  1120. Initially, a socket is created in the unconnected state, meaning the socket is 
  1121. not associated with any foreign destination. The connect() call binds a 
  1122. permanent destination to a socket, placing it in the connected state. An 
  1123. application program must call connect() to establish a connection before it can 
  1124. transfer data through a reliable stream socket. Sockets used with 
  1125. connectionless datagram services need not be connected before they are used, 
  1126. but connecting sockets makes it possible to transfer data without specifying 
  1127. the destination each time. 
  1128.  
  1129. The semantics of the connect() call depend on the underlying protocols. In the 
  1130. case of TCP, the connect() call builds a TCP connection with the destination, 
  1131. or returns an error if it cannot. In the case of connectionless services, the 
  1132. connect() call does nothing more than store the destination address locally. 
  1133.  
  1134. Connections are established between a client process and a server process. In a 
  1135. connection-oriented network environment, a client process initiates a 
  1136. connection and a server process receives, or responds to, a connection. The 
  1137. client and server interactions occur as follows: 
  1138.  
  1139.     The server, when willing to offer its advertised services, binds a socket 
  1140.      to a well-known address associated with the service. 
  1141.  
  1142.     The server process socket is then marked to indicate incoming connections 
  1143.      are to be accepted on it. It is then possible for an unrelated process to 
  1144.      rendezvous with the server. 
  1145.  
  1146.     The client requests services from the server by initiating a connection to 
  1147.      the server's socket. The client process uses a connect() call to initiate 
  1148.      a socket connection. 
  1149.  
  1150.     If the client process' socket is unbound at the time of the connect() 
  1151.      call, the system automatically selects and binds a name to the socket if 
  1152.      necessary. This is the usual way that local addresses are bound to a 
  1153.      socket. 
  1154.  
  1155.     If the connection to the server fails, the client's connect() call fails 
  1156.      (any name automatically bound by the system, however, remains). Otherwise, 
  1157.      the socket is associated with the server and data transfer can begin. 
  1158.  
  1159. An example of a client application using the connect() call to request a 
  1160. connection is: 
  1161.  
  1162.  
  1163. An Application Using the connect() Call
  1164.  
  1165. int s;
  1166. struct sockaddr_in servername;
  1167. int rc;
  1168. ...
  1169. memset(&servername, 0, sizeof(servname));
  1170. servname.sin_len = sizeof(servname);
  1171. servername.sin_family = AF_INET;
  1172. servername.sin_addr.s_addr = inet_addr("129.5.24.1");
  1173. servername.sin_port = htons(1024);
  1174. ...
  1175. rc = connect(s, (struct sockaddr *) &servername, sizeof(servername));
  1176.  
  1177. The connect() call attempts to connect socket s to the server with name 
  1178. supplied in servername. This could be the server that was used in the previous 
  1179. bind() example. With TCP stream sockets the caller blocks until the connection 
  1180. is accepted by the server.  On successful return from connect(), the socket s 
  1181. is associated with the connection to the server. See ioctl() for additional 
  1182. information about determining blocking and nonblocking behavior. Note that the 
  1183. sockaddr_in structure should be cleared before calling connect(). For a more 
  1184. detailed description, see connect(). 
  1185.  
  1186. The following figure shows an example of using the gethostbyname() network 
  1187. utility routine to find out the internet address of serverhost from the name 
  1188. server or the ETC\HOSTS file: 
  1189.  
  1190.  
  1191. An Application Using the gethostbyname() Call
  1192.  
  1193. int s;
  1194. struct sockaddr_in servername;
  1195. char *hostname = "serverhost";
  1196. int rc;
  1197. int connect(int s, struct sockaddr *name, int namelen);  /* extracted from sys\socket.h */
  1198. struct hostent *hp;
  1199. ...
  1200.  
  1201. hp = gethostbyname(hostname);
  1202.  
  1203. /* clear the structure */
  1204. memset(&servername, 0, sizeof(servname));
  1205. servername.sin_len = sizeof(servername);
  1206. servername.sin_family = AF_INET;
  1207. servername.sin_addr.s_addr = *((u_long *)hp->h_addr);
  1208. servername.sin_port = htons(1024);
  1209. ...
  1210. rc = connect(s,(struct sockaddr *)&servername,sizeof(servername));
  1211.  
  1212.  
  1213. ΓòÉΓòÉΓòÉ 4.9. Obtaining Socket Addresses ΓòÉΓòÉΓòÉ
  1214.  
  1215. The sockets API includes calls that allow an application to obtain the address 
  1216. of the destination to which a socket connects and the local address of a 
  1217. socket. The socket calls that allow a program to retrieve socket addresses are: 
  1218.  
  1219.     getsockname() 
  1220.     getpeername() 
  1221.  
  1222. For additional information that you may need before binding or obtaining socket 
  1223. addresses, see: 
  1224.  
  1225.     Socket Addresses 
  1226.     Socket Connections 
  1227.  
  1228.  
  1229. ΓòÉΓòÉΓòÉ 4.10. Server Connections ΓòÉΓòÉΓòÉ
  1230.  
  1231. In the internet domain, the server process creates a socket, binds it to a 
  1232. well-known protocol port, and waits for requests. The listen() call allows 
  1233. server processes to prepare a socket for incoming connections. In terms of 
  1234. underlying protocols, the listen() call puts the socket in a passive mode ready 
  1235. to accept connections. When the server process starts the listen() call, it 
  1236. also informs the operating system that the protocol software should queue 
  1237. multiple simultaneous connection requests that arrive at a socket. The listen() 
  1238. call includes a parameter that allows a process to specify the length of the 
  1239. connection queue for that socket. If the queue is full when a connection 
  1240. request arrives, the operating system refuses the connection. The listen() call 
  1241. applies only to sockets that have selected reliable stream delivery or 
  1242. connection-oriented datagram service. An example of a server application using 
  1243. the listen() call is: 
  1244.  
  1245.  
  1246. An Application Using the listen() Call
  1247.  
  1248. int s;
  1249. int backlog;
  1250. int rc;
  1251. ...
  1252. rc = listen(s, 5);
  1253.  
  1254. The listen() call is used to indicate that the server is ready to begin 
  1255. accepting connections. In this example, a maximum of five connection requests 
  1256. can be queued for the server. Additional requests are ignored.  For a more 
  1257. detailed description, see listen(). 
  1258.  
  1259. Once a socket has been set up, the server process needs to wait for a 
  1260. connection. The server process waits for a connection by using the accept() 
  1261. call. A call to the accept() call blocks until a connection request arrives. 
  1262. When a request arrives, the operating system returns the address of the client 
  1263. process that has placed the request. The operating system also creates a new 
  1264. socket that has its destination connected to the requesting client process and 
  1265. returns the new socket descriptor to the calling server process. The original 
  1266. socket still has a wildcard foreign destination which remains open. 
  1267.  
  1268. When a connection arrives, the call to accept() returns. The server process can 
  1269. either handle requests interactively or concurrently. In the interactive 
  1270. approach, the thread that did the accept() handles the request itself, closes 
  1271. the new socket, and then starts the accept() call to obtain the next connection 
  1272. request. In the concurrent approach, after the call to accept() returns, the 
  1273. server process creates a new thread to handle the request. The new thread 
  1274. proceeds to service the request, and then exits. The original thread invokes 
  1275. the accept() call to obtain the next connection request. 
  1276.  
  1277. An example of a server application for accepting a connection request by using 
  1278. the accept() call is: 
  1279.  
  1280.  
  1281. An Application Using the accept() Call
  1282.  
  1283. int clientsocket;
  1284. int s;
  1285. struct sockaddr clientaddress;
  1286. int addrlen;
  1287. ...
  1288. addrlen = sizeof(clientaddress);
  1289. ...
  1290. clientsocket = accept(s, &clientaddress, &addrlen);
  1291.  
  1292.  
  1293. ΓòÉΓòÉΓòÉ 4.11. Handling Multiple Sockets ΓòÉΓòÉΓòÉ
  1294.  
  1295. Applications can handle multiple sockets. In such situations, you can use the 
  1296. select() call to determine the sockets that have data to be read, those that 
  1297. are ready for data to be written, and the sockets that have pending exception 
  1298. conditions. If the timeout parameter is positive, select() waits up to the 
  1299. amount of time indicated for at least one socket to become ready on the 
  1300. indicated conditions. This is useful for applications servicing multiple 
  1301. connections that cannot afford to block waiting for data on one connection. 
  1302.  
  1303. There are two versions of the select() call: a TCP/IP Version 4.21 for OS/2 
  1304. Warp version and a version modeled after the BSD select() call. An example of 
  1305. how the TCP/IP Version 4.21 for OS/2 Warp select() call is used is shown in the 
  1306. next figure. For information on using the BSD version of the select() call, see 
  1307. select(). 
  1308.  
  1309.  
  1310. An Application Using the select() Call
  1311.  
  1312. ...
  1313. int socks[3];    /* array of sockets */
  1314. long timeout = MAX_TIMEOUT;
  1315. int s1, s2, s3;
  1316. int number_ready;
  1317. ...
  1318. /* put sockets to check in socks[] */
  1319. socks[0] = s1;     /* read socket number */
  1320. socks[1] = s2;     /* write socket number */
  1321. socks[2] = s3;     /* second write socket number */
  1322.  
  1323. /* check for READ on s1, WRITE on s2 and s3 */
  1324. number_ready = os2_select(socks, 1, 2, 0, timeout);
  1325.  
  1326. In this example, the application indicates the sockets to be checked for 
  1327. readability or readiness for writing. 
  1328.  
  1329.  
  1330. ΓòÉΓòÉΓòÉ 4.12. Connectionless Datagram Services ΓòÉΓòÉΓòÉ
  1331.  
  1332. The operating system provides support for connectionless interactions typical 
  1333. of the datagram facilities found in packet-switched networks. A datagram socket 
  1334. provides a symmetric interface for data exchange. While processes are still 
  1335. likely to be client and server, there is no requirement for connection 
  1336. establishment. Instead, each message includes the destination address. 
  1337.  
  1338. An application program can create datagram sockets using the socket() call. In 
  1339. the internet domain, if a particular local address is needed, a bind() call 
  1340. must precede the first data transmission. Otherwise, the operating system sets 
  1341. the local address or port when data is first sent. The application program uses 
  1342. the sendto() and recvfrom() calls to transmit data; these calls include 
  1343. parameters that allow the client process to specify the address of the intended 
  1344. recipient of the data. 
  1345.  
  1346. In addition to the sendto() and recvfrom() calls, datagram sockets can also use 
  1347. the connect() call to associate a socket with a specific destination address. 
  1348. In this case, any data sent on the socket is automatically addressed to the 
  1349. connected peer socket, and only data received from that peer is delivered to 
  1350. the client process. Only one connected address is permitted for each socket at 
  1351. one time; a second connect() call changes the destination address. 
  1352.  
  1353. A connect() call request on a datagram socket results in the operating system 
  1354. recording the peer socket's address (as compared to a stream socket, where a 
  1355. connect request initiates establishment of an end-to-end connection). The 
  1356. accept() and listen() calls are not used with datagram sockets. 
  1357.  
  1358. While a datagram socket is connected, errors from recent send() calls can be 
  1359. returned asynchronously. These errors can be reported on subsequent operations 
  1360. on the socket, or a special socket option, SO_ERROR. This option, when used 
  1361. with the getsockopt() call, can be used to interrogate the error status. A 
  1362. select() call for reading or writing returns true when a process receives an 
  1363. error indication. The next operation returns the error, and the error status is 
  1364. cleared. 
  1365.  
  1366. See Socket Types for more information that you may need before connecting 
  1367. sockets. 
  1368.  
  1369.  
  1370. ΓòÉΓòÉΓòÉ 4.13. Socket Options ΓòÉΓòÉΓòÉ
  1371.  
  1372. In addition to binding a socket to a local address or connecting it to a 
  1373. destination address, application programs need a method to control the behavior 
  1374. of a socket. For example, when using protocols that use timeout and 
  1375. retransmission, the application program may want to obtain or set the timeout 
  1376. parameters. An application program may also want to control the allocation of 
  1377. buffer space, determine if the socket allows transmission of broadcast, or 
  1378. control processing of out-of-band data. The ioctl-style getsockopt() and 
  1379. setsockopt() calls provide the means to control socket operations. The 
  1380. getsockopt() call allows an application program to request information about 
  1381. socket options. The setsockopt() call allows an application program to set a 
  1382. socket option using the same set of values obtained with the getsockopt() call. 
  1383. Not all socket options apply to all sockets. The options that can be set depend 
  1384. on the current state of the socket and the underlying protocol being used. 
  1385.  
  1386.  
  1387. ΓòÉΓòÉΓòÉ 4.14. Socket Data Transfer ΓòÉΓòÉΓòÉ
  1388.  
  1389. Most of the work performed by the sockets layer is in sending and receiving 
  1390. data. The sockets layer itself does not impose any structure on data 
  1391. transmitted or received through sockets. Any data interpretation or structuring 
  1392. is logically isolated in the implementation of the protocol family. 
  1393.  
  1394. Once a connection is established between sockets, an application program can 
  1395. send and receive data. 
  1396.  
  1397. Topics 
  1398.  
  1399.      Sending and Receiving Data 
  1400.      Out-of-Band Data 
  1401.      Socket I/O Modes 
  1402.  
  1403.  
  1404. ΓòÉΓòÉΓòÉ 4.14.1. Sending and Receiving Data ΓòÉΓòÉΓòÉ
  1405.  
  1406. Sending and receiving data can be done with any one of several calls. The calls 
  1407. vary according to the amount of information to be transmitted and received and 
  1408. the state of the socket being used to perform the operation. 
  1409.  
  1410.     The writev() call can be used with a socket that is in a connected state, 
  1411.      as the destination of the data is implicitly specified by the connection. 
  1412.  
  1413.     The sendto() and sendmsg() calls allow the process to specify the 
  1414.      destination for a message explicitly. 
  1415.  
  1416.     The recv() call allows a process to receive data on a connected socket 
  1417.      without receiving the sender's address. 
  1418.  
  1419.     The recvfrom() and recvmsg() calls allow the process to retrieve the 
  1420.      incoming message and the sender's address. 
  1421.  
  1422. While the send() and recv() calls are virtually identical to the readv() and 
  1423. writev() calls, the extra flags argument in the send() and recv() calls is 
  1424. important. The flags, defined in the <SYS\SOCKET.H> file, can be defined as a 
  1425. nonzero value if the application program requires one or more of the following: 
  1426.  
  1427. MSG_OOB             Sends or receives out-of-band data. 
  1428. MSG_PEEK            Looks at data without reading. 
  1429. MSG_DONTROUTE       Sends data without routing packets. 
  1430.  
  1431. Out-of-band data is specific to stream sockets. The option to have data sent 
  1432. without routing applied to the outgoing packets is currently used only by the 
  1433. routing table management process, and is unlikely to be of interest to the 
  1434. casual user. The ability to preview data is, however, of general interest. When 
  1435. the MSG_PEEK flag is specified with a recv() call, any data present is returned 
  1436. to the user, but treated as still unread. That is, the next readv() or recv() 
  1437. call applied to the socket returns the data previously previewed. 
  1438.  
  1439. The following example shows an application sending data on a connected socket 
  1440. and receiving data in response. The flags field can be used to specify 
  1441. additional options to send() or recv(), such as sending out-of-band data. For 
  1442. additional information, see send() and recv(). 
  1443.  
  1444.  
  1445. An Application Using the send() and recv() Calls
  1446.  
  1447. int bytes_sent;
  1448. int bytes_received;
  1449. char data_sent[256] = "data to be sent on connected socket";
  1450. char data_received[256];
  1451. int s;
  1452. ...
  1453. bytes_sent = send(s, data_sent, sizeof(data_sent), 0);
  1454. ...
  1455. bytes_received = recv(s, data_received, sizeof(data_received), 0);
  1456.  
  1457. An example of an application sending from a connected socket and receiving data 
  1458. in response is: 
  1459.  
  1460.  
  1461. An Application Using the sendto() and recvfrom() Call
  1462.  
  1463. int bytes_sent;
  1464. int bytes_received;
  1465. char data_sent[256] = "data to be sent using sendto()";
  1466. char data_received[256];
  1467. struct sockaddr_in to;
  1468. struct sockaddr from;
  1469. int addrlen;
  1470. int s;
  1471. ...
  1472. memset(&to, 0, sizeof(to));
  1473. to.sin_len = sizeof(to);
  1474. to.sin_family = AF_INET;
  1475. to.sin_addr.s_addr   = inet_addr("129.5.24.1");
  1476. to.sin_port   = htons(1024);
  1477. ...
  1478. bytes_sent = sendto(s, data_sent, sizeof(data_sent), 0, (struct sockaddr *) &to, sizeof(to));
  1479. ...
  1480. addrlen = sizeof(from); /* must be initialized */
  1481. bytes_received = recvfrom(s, data_received, sizeof(data_received), 0, &from, &addrlen);
  1482.  
  1483. The sendto() and recvfrom() calls take additional parameters that allow the 
  1484. caller to specify the recipient of the data or to be notified of the sender of 
  1485. the data. See recvfrom(), and sendto(), for more information about these 
  1486. additional parameters. 
  1487.  
  1488. A list of the data transfer calls and a summary of some of their 
  1489. characteristics follows: 
  1490.  
  1491. Data Transfer Calls 
  1492.  
  1493. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1494. ΓöéData Transfer Buffers      Option Flags? Sockets Used  Server       Γöé
  1495. ΓöéCall                                     With          Address      Γöé
  1496. Γöé                                                       Required?    Γöé
  1497. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1498. Γöésend()        Single       Yes           Connected     No           Γöé
  1499. Γöé                                         only                       Γöé
  1500. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1501. Γöérecv()        Single       Yes           Connected     No           Γöé
  1502. Γöé                                         only                       Γöé
  1503. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1504. Γöésendto()      Single       Yes           Any socket    Yes          Γöé
  1505. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1506. Γöérecvfrom()    Single       Yes           Any socket    Yes          Γöé
  1507. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1508. Γöéwritev()      Multiple     No            Connected     No           Γöé
  1509. Γöé                                         only                       Γöé
  1510. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1511. Γöéreadv()       Multiple     No            Connected     No           Γöé
  1512. Γöé                                         only                       Γöé
  1513. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1514. Γöésendmsg()     Multiple     Yes           Any socket    Yes          Γöé
  1515. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1516. Γöérecvmsg()     Multiple     Yes           Any socket    Yes          Γöé
  1517. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1518.  
  1519. For additional information that you may need when obtaining or setting socket 
  1520. options, see: 
  1521.  
  1522.     Socket Types 
  1523.     Out-of-Band Data 
  1524.     IP Multicasting 
  1525.  
  1526.  
  1527. ΓòÉΓòÉΓòÉ 4.14.2. Out-of-Band Data ΓòÉΓòÉΓòÉ
  1528.  
  1529. The stream socket abstraction includes the concept of out-of-band data. 
  1530. Out-of-band data is a logically independent transmission channel associated 
  1531. with each pair of connected stream sockets. Out-of-band data can be delivered 
  1532. to the socket independently of the normal receive queue or within the receive 
  1533. queue depending upon the status of the SO_OOBINLINE socket-level option. The 
  1534. abstraction defines that the out-of-band data facilities must support the 
  1535. reliable delivery of at least one out-of-band message at a time. This message 
  1536. must contain at least one byte of data, and at least one message can be pending 
  1537. delivery to the user at any one time. 
  1538.  
  1539. For communication protocols that support only in-band signaling (that is, the 
  1540. urgent data is delivered in sequence with the normal data), the operating 
  1541. system normally extracts the data from the normal data stream and stores it 
  1542. separately. This allows users to choose between receiving the urgent data in 
  1543. order and receiving it out of sequence without having to buffer all the 
  1544. intervening data. 
  1545.  
  1546. If multiple sockets have out-of-band data awaiting delivery, an application 
  1547. program can use a select() call for exceptional conditions to determine those 
  1548. sockets with such data pending. The select() call does not indicate the actual 
  1549. arrival of the out-of-band data, but only notification that it is pending. 
  1550.  
  1551. In addition to the information passed, a logical mark is placed in the data 
  1552. stream to indicate the point at which the out-of-band data was sent. When a 
  1553. signal flushes any pending output, all data up to the mark in the data stream 
  1554. is discarded. 
  1555.  
  1556. To send an out-of-band message, the MSG_OOB flag is supplied to a send() or 
  1557. sendto() call. To receive out-of-band data, an application program must set the 
  1558. MSG_OOB flag when performing a recvfrom() or recv() call. 
  1559.  
  1560. An application program can determine if the read pointer is currently pointing 
  1561. at the logical mark in the data stream, by using the SIOCATMARK ioctl() call. 
  1562.  
  1563. A process can also read or peek at the out-of-band data without first reading 
  1564. up to the logical mark. This is more difficult when the underlying protocol 
  1565. delivers the urgent data in-band with the normal data, and only sends 
  1566. notification of its presence ahead of time (that is, the TCP protocol used to 
  1567. implement streams in the internet domain). With such protocols, the out-of-band 
  1568. byte may not have arrived when a recv() call is performed with the MSG_OOB 
  1569. flag. In that case, the call will return an SOCEWOULDBLOCK error code. There 
  1570. may be enough in-band data in the input buffer for normal flow control to 
  1571. prevent the peer from sending the urgent data until the buffer is cleared. The 
  1572. process must then read enough of the queued data so that the urgent data can be 
  1573. delivered. 
  1574.  
  1575. Certain programs that use multiple bytes of urgent data, and that must handle 
  1576. multiple urgent signals, need to retain the position of urgent data within the 
  1577. stream. The socket-level option, SO_OOBINLINE provides the capability. With 
  1578. this option, the position of the urgent data (the logical mark) is retained. 
  1579. The urgent data immediately follows the mark within the normal data stream that 
  1580. is returned without the MSG_OOB flag. Reception of multiple urgent indications 
  1581. causes the mark to move, but no out-of-band data is lost. 
  1582.  
  1583.  
  1584. ΓòÉΓòÉΓòÉ 4.14.3. Socket I/O Modes ΓòÉΓòÉΓòÉ
  1585.  
  1586. Sockets can be set to either blocking or nonblocking I/O mode. The FIONBIO 
  1587. ioctl operation is used to determine this mode. When the FIONBIO ioctl is set, 
  1588. the socket is marked nonblocking. If a read is tried and the desired data is 
  1589. not available, the socket does not wait for the data to become available, but 
  1590. returns immediately with the SOCEWOULDBLOCK error code. 
  1591.  
  1592. When the FIONBIO ioctl is not set, the socket is in blocking mode. In this 
  1593. mode, if a read is tried and the desired data is not available, the calling 
  1594. process waits for the data. Similarly, when writing, if FIONBIO is set and the 
  1595. output queue is full, an attempt to write causes the process to return 
  1596. immediately with an error code of SOCEWOULDBLOCK. 
  1597.  
  1598. An example of using the ioctl() call to help perform asynchronous (nonblocking) 
  1599. socket operations is: 
  1600.  
  1601.  
  1602. An Application Using the ioctl() Call
  1603.  
  1604. int s;
  1605. int bytes_received;
  1606. int dontblock;
  1607. char buf[256];
  1608. int rc;
  1609. ...
  1610. dontblock = 1;
  1611. ...
  1612. rc = ioctl(s, FIONBIO, (char *) &dontblock);
  1613. ...
  1614. bytes_received = recv(s, buf, sizeof(buf), 0);
  1615. if (bytes_received == -1)
  1616. {
  1617. if (sock_errno() == SOCEWOULDBLOCK)
  1618. /* data is not present */
  1619. else
  1620. /* error occurred */
  1621. }
  1622. else
  1623. /* bytes_ received indicates amount of data received in buf */
  1624.  
  1625. This example causes the socket s to be placed in nonblocking mode.  When this 
  1626. socket is passed as a parameter to calls that would block, such as recv() when 
  1627. data is not present, it causes the call to return with an error code, and sets 
  1628. the error value to SOCEWOULDBLOCK.  Setting the mode of the socket to be 
  1629. nonblocking allows an application to continue processing without becoming 
  1630. blocked. For a more detailed description, see ioctl(). 
  1631.  
  1632. When performing nonblocking I/O on sockets, a program must check for the 
  1633. SOCEWOULDBLOCK error code. This occurs when an operation would normally block, 
  1634. but the socket it was performed on is marked as nonblocking. The following 
  1635. socket calls return a SOCEWOULDBLOCK error code: 
  1636.  
  1637.     accept() 
  1638.     send() 
  1639.     recv() 
  1640.     readv() 
  1641.     writev() 
  1642.  
  1643. Processes using these calls should be prepared to deal with the SOCEWOULDBLOCK 
  1644. error code. For a nonblocking socket, the connect() call returns an 
  1645. SOCEINPROGRESS error code if the connection cannot be completed immediately. 
  1646.  
  1647. If an operation such as a send operation cannot be done completely, but partial 
  1648. writes are permissible (for example when using a stream socket), the data that 
  1649. can be sent immediately is processed, and the return value indicates the amount 
  1650. actually sent. 
  1651.  
  1652.  
  1653. ΓòÉΓòÉΓòÉ 4.15. Socket Shutdown ΓòÉΓòÉΓòÉ
  1654.  
  1655. Once a socket is no longer required, the calling program can discard the socket 
  1656. by applying a soclose() call to the socket descriptor. If a reliable delivery 
  1657. socket has data associated with it when a close takes place, the system 
  1658. continues to attempt data transfer. However, if the data is still not 
  1659. delivered, the system discards the data. Should the application program have no 
  1660. use for any pending data, it can use the shutdown() call on the socket prior to 
  1661. closing it. 
  1662.  
  1663. Topics 
  1664.  
  1665.      Closing Sockets 
  1666.  
  1667.  
  1668. ΓòÉΓòÉΓòÉ 4.15.1. Closing Sockets ΓòÉΓòÉΓòÉ
  1669.  
  1670. Closing a socket and reclaiming its resources is not always a straightforward 
  1671. operation. In certain situations, such as when a process exits, a soclose() 
  1672. call is expected to be successful. However, when a socket promising reliable 
  1673. delivery of data is closed with data still queued for transmission or awaiting 
  1674. acknowledgment of reception, the socket must attempt to transmit the data. If 
  1675. the socket discards the queued data to allow the soclose() call to complete 
  1676. successfully, it violates its promise to deliver data reliably. Discarding data 
  1677. can cause naive processes, which depend upon the implicit semantics of the 
  1678. soclose() call, to work unreliably in a network environment. However, if 
  1679. sockets block until all data has been transmitted successfully, in some 
  1680. communication domains a soclose() call may never complete. 
  1681.  
  1682. The sockets layer compromises in an effort to address this problem and maintain 
  1683. the semantics of the soclose() call. In normal operation, closing a socket 
  1684. causes any queued but unaccepted connections to be discarded. If the socket is 
  1685. in a connected state, a disconnect is initiated. When the disconnect request 
  1686. completes, the network support notifies the sockets layer, and the socket 
  1687. resources are reclaimed. The network layer may then attempt to transmit any 
  1688. data queued in the socket's send buffer, although this is not guaranteed. 
  1689.  
  1690. Alternatively, a socket may be marked explicitly to force the application 
  1691. program to linger when closing until pending data are flushed and the 
  1692. connection has shut down. This option is marked in the socket data structure 
  1693. using the setsockopt() call with the SO_LINGER option. The setsockopt() call, 
  1694. using the linger option, takes a linger structure. When an application program 
  1695. indicates that a socket is to linger, it also specifies a duration for the 
  1696. lingering period. If the lingering period expires before the disconnect is 
  1697. completed, the socket layer forcibly shuts down the socket, discarding any data 
  1698. still pending. 
  1699.  
  1700. An example of deallocating the socket descriptor s using the soclose() call is: 
  1701.  
  1702.  
  1703. An Application Using the soclose() Call
  1704.  
  1705. ...
  1706. /* close the socket */
  1707. soclose(s);
  1708. ...
  1709.  
  1710.  
  1711. ΓòÉΓòÉΓòÉ 4.16. Typical Socket Session Diagram ΓòÉΓòÉΓòÉ
  1712.  
  1713. The following figure shows a graphical representation for the general sequence 
  1714. of socket calls needed to provide communication between applications for 
  1715. supported socket types. For stream or sequenced packet socket types, and for 
  1716. datagram socket types, see the following figure. This basic sequence is the 
  1717. same for each supported protocol family for all supported socket types. This 
  1718. means that a programmer can modify the protocol family selection and the 
  1719. networking addressing parameters of an existing sockets program, recompile and 
  1720. relink, and the program can be run with another protocol. This also allows 
  1721. programs that use sockets with multiple protocols to be easily constructed. 
  1722.  
  1723.  
  1724. A Typical Stream or Sequenced Packet Socket Session
  1725.  
  1726.  
  1727. ΓòÉΓòÉΓòÉ 4.17. TCP Extensions for Transactions (T/TCP) ΓòÉΓòÉΓòÉ
  1728.  
  1729. A client-server transaction is a client request to a server followed by the 
  1730. server's reply. TCP Extensions for Transactions (T/TCP) is an extension to TCP 
  1731. designed to make client-server transactions more efficient. For typical 
  1732. transaction processing, a reliable delivery of data is needed, with no explicit 
  1733. connection setup or tear down, and with minimal idle state at both ends. UDP is 
  1734. faster but not reliable. Standard TCP provides the reliability but with the 
  1735. overhead of connection setup and time wait delay. T/TCP addresses these needs. 
  1736. T/TCP can match UDP performance, and adds reliability. 
  1737.  
  1738. The goal of T/TCP is to allow each transaction (request and response sequence) 
  1739. to be efficiently performed as a single incarnation of a TCP connection. 
  1740. Standard TCP imposes two performance problems for transaction-oriented 
  1741. communication.  First, a TCP connection is opened with a three-way handshake 
  1742. which must complete successfully before any data can be transferred. This 
  1743. handshake adds an extra round-trip time to transaction latency. Second, closing 
  1744. a TCP connection leaves one or both ends in time wait state (2 maximum segment 
  1745. lifetime periods (2 MSL)), which limits the rate of successive transactions 
  1746. between the same host-port pair, since a new incarnation cannot be reopened 
  1747. until the time wait delay expires.  (The default value for the time wait delay 
  1748. can be checked by using the INETCFG.EXE utility.) 
  1749.  
  1750. T/TCP addresses the handshake issue by using TCP Accelerated Open (TAO), which 
  1751. is based on using a new incarnation number called 'connection count (CC)'. 
  1752. T/TCP uses the monotonic property of CC values to bypass the handshake. A T/TCP 
  1753. server host keeps a cache containing the last valid CC value that it has 
  1754. received from each different client host. If an initial SYN segment (connection 
  1755. request) from a particular client host carries a CC value larger than the 
  1756. cached value, then the incoming segment is ensured to be new and the connection 
  1757. can be accepted immediately. The use of CC also truncates the time wait delay. 
  1758. Apart from rate of transactions, reduction in the time wait delay also saves 
  1759. locked-up resources from the hosts. 
  1760.  
  1761. T/TCP introduces three new TCP options; namely, CC, CCnew and CCecho, and adds 
  1762. seven new states to the existing ten finite TCP states. To invoke T/TCP, both 
  1763. client and server ends of the transaction must support T/TCP. The CC value is 
  1764. sent by the client in the SYN segment (for active open) indicating a 
  1765. willingness to use T/TCP. The server sends back CCecho in the SYN-ACK segment, 
  1766. declaring that it understands T/TCP. The client can still optionally disable 
  1767. T/TCP and force a handshake by sending a CCNew segment. If any of the ends do 
  1768. not support T/TCP, the connection procedure reverts to the normal TCP 
  1769. connection setup procedure. 
  1770.  
  1771. To take advantage of T/TCP, the socket calls sequence on a typical T/TCP client 
  1772. application is different from the client shown in  A Typical Stream or 
  1773. Sequenced Packet Socket Session.  On a typical T/TCP client application, after 
  1774. opening a Stream socket the client does not call connect(). Instead, it calls 
  1775. sendto() with the flag of MSG_EOF. This will send the request to the server, 
  1776. establish the connection, and cause a FIN to be sent from the client to the 
  1777. server. This single sendto() call combines the functionality of connect(), 
  1778. write(), and shutdown() of a normal TCP session. The typical T/TCP transaction 
  1779. server application is the same as a typical TCP server, except the MSG_EOF flag 
  1780. can be indicated on the send() call to cause a FIN to be sent at the end of the 
  1781. transaction data. 
  1782.  
  1783. T/TCP can be turned on for a system-wide effect through the INET configuration 
  1784. utility command 'inetcfg -set CC 1'. You can use getsockopt() and setsockopt() 
  1785. for each socket through the TCP_CC socket option.  By default the T/TCP option 
  1786. is turned off. 
  1787.  
  1788. To assure that T/TCP is being invoked, IP tracing function can be turned on 
  1789. through 'iptrace -i', and the trace file IPTRACE.DMP can be formatted with the 
  1790. IPFORMAT utility, which can explicitly show the three CC option values in the 
  1791. formatted dump. 
  1792.  
  1793. For more details on T/TCP functional specification, refer to RFC 1644 T/TCP 
  1794. -TCP Extensions for Transactions Functional Specification. 
  1795.  
  1796.  
  1797. ΓòÉΓòÉΓòÉ 4.18. TCP Extensions for High Performance (RFC 1323) ΓòÉΓòÉΓòÉ
  1798.  
  1799. Request For Comments 1323 suggested some TCP extensions for performance 
  1800. improvement over very high speed links. Two TCP options are introduced by RFC 
  1801. 1323: Window Scale and TCP Timestamps. 
  1802.  
  1803. The Window Scale option allows the TCP receive window size to be larger than 
  1804. the present limit of 64K bytes, by defining an implicit scale factor, which is 
  1805. used to multiply the window size value found in the TCP header to obtain the 
  1806. true window size. The Window Scale option is carried in SYN segments during the 
  1807. connection setup phase. 
  1808.  
  1809. If the TCP Timestamp option is enabled, the sender places a time stamp in every 
  1810. TCP segment, and then the receiver sends the time stamp back in the 
  1811. acknowledgment, allowing the sender to calculate the Round Trip Time (RTT) for 
  1812. each acknowledgment. This RTT estimation helps TCP to discard received 
  1813. duplicate segments, to calculate the retransmission timer, and to decide 
  1814. whether to start the slow-start process. The presence of the TCP Timestamp 
  1815. option also allows TCP to perform Protection Against Wrapped Sequences (PAWS). 
  1816. PAWS assumes that every received TCP segment contains a TCP time stamp whose 
  1817. values are monotonically non-decreasing in time. A segment can be discarded as 
  1818. an old duplicate if it is received with a time stamp less than a time stamp 
  1819. recently received on this connection. 
  1820.  
  1821. The TCP Timestamp option can be enabled for a system-wide effect through the 
  1822. INET configuration utility 'inetcfg -set timestmp 1'. It can also be retrieved 
  1823. and set for each socket through the TCP_TIMESTMP socket option. Similarly, the 
  1824. Window Scale option can be enabled system-wide through 'inetcfg -set winscale 
  1825. 1,' and can also be retrieved and set for each socket through the TCP_WINSCALE 
  1826. socket option. 
  1827.  
  1828. By default, the system-wide Window Scaling option is enabled and the 
  1829. system-wide TCP Timestamp option is disabled. Both options, if set, can be 
  1830. traced through the IPTRACE utility and can be displayed in the IPFORMAT dump. 
  1831.  
  1832. For more details on these two TCP extensions, refer to RFC 1323 TCP Extensions 
  1833. for High Performance. 
  1834.  
  1835.  
  1836. ΓòÉΓòÉΓòÉ 4.19. High Performance Send ΓòÉΓòÉΓòÉ
  1837.  
  1838. High Performance Send is a new feature of TCP/IP 4.21 that allows an 
  1839. application to send data over sockets without incurring a memory copy.  To use 
  1840. it, special memory is first allocated to the application from the TCP/IP stack 
  1841. with the sysctl() call. Then the application calls  send(), sendto(), or 
  1842. sendmsg() with the MSG_MAPIO flag. The application must wait for notification 
  1843. from the stack that the stack has finished using the memory passed on the 
  1844. previous send-type call. Only then should the application reuse the memory to 
  1845. send more data. 
  1846.  
  1847. There are two ways to determine if the stack has finished using the memory: 
  1848. event semaphores and polling. These are described in Determining if HPS Memory 
  1849. is Available for Reuse. 
  1850.  
  1851. A complete example of using HPS appears in the samples directory of the 
  1852. toolkit. 
  1853.  
  1854. Topics 
  1855.  
  1856.      Allocating HPS Memory 
  1857.      Using HPS Memory with Send Calls 
  1858.      Determining if HPS Memory is Available for Reuse 
  1859.      Freeing HPS Memory 
  1860.  
  1861.  
  1862. ΓòÉΓòÉΓòÉ 4.19.1. Allocating HPS Memory ΓòÉΓòÉΓòÉ
  1863.  
  1864. To allocate HPS memory, the application calls sysctl() as follows: 
  1865.  
  1866.            int mib[4];
  1867.            unsigned long ptrs[15];
  1868.            size_t ptrslen;
  1869.            int ret;
  1870.            mib[0] = CTL_OS2;
  1871.            mib[1] = PF_INET;
  1872.            mib[2] = IPPROTO_IP;
  1873.            mib[3] = OS2_MEMMAPIO;
  1874.  
  1875.            memset(ptr, 0, sizeof(ptrs));
  1876.            ptrslen = sizeof(ptrs);
  1877.            ret = sysctl(mib, sizeof(mib) / sizeof(mib[0]), ptrs,
  1878.                         &ptrslen, NULL, 0);
  1879.  
  1880. The TCP/IP stack will allocate 60K bytes of memory and return 15 pointers to 4K 
  1881. byte blocks.  These must be passed on subsequent send calls with the MSG_MAPIO 
  1882. flag. 
  1883.  
  1884. To allocate memory and attach a shared-event semaphore to each block as well, 
  1885. the application should initialize the ptrs array with the shared-event 
  1886. semaphore handles before calling sysctl(): 
  1887.  
  1888.            int mib[4];
  1889.            unsigned long ptrs[15];
  1890.            size_t ptrslen;
  1891.            int i;
  1892.            APIRET rc;
  1893.            int ret;
  1894.  
  1895.            mib[0] = CTL_OS2;
  1896.            mib[1] = PF_INET;
  1897.            mib[2] = IPPROTO_IP;
  1898.            mib[3] = OS2_MEMMAPIO;
  1899.  
  1900.            for (i = 0; i < sizeof(ptrs) / sizeof(ptrs[0]); i++) {
  1901.                rc = DosCreateEventSemaphore(NULL, &ptrs[i], DC_SEM_SHARED, FALSE);
  1902.                if (rc != NO_ERROR)
  1903.                   exit(1);
  1904.            }
  1905.            ptrslen = sizeof(ptrs);
  1906.            ret = sysctl(mib, sizeof(mib) / sizeof(mib[0]), ptrs, &ptrslen, NULL, 0);
  1907.  
  1908.  
  1909. ΓòÉΓòÉΓòÉ 4.19.2. Using HPS Memory with Send Calls ΓòÉΓòÉΓòÉ
  1910.  
  1911. To send data using HPS, the user passes one or more of the pointers received 
  1912. from an HPS allocation call to one of the send-type calls along with the 
  1913. MSG_MAPIO flag: 
  1914.  
  1915.           int ret, sock;
  1916.           unsigned long ptrs[15];
  1917.           struct msghdr hdr;
  1918.           struct iovec iovec[2];
  1919.  
  1920.           ret = send(sock, ptrs[0], 4096, MSG_MAPIO);
  1921.  
  1922.           hdr.msg_name = NULL;
  1923.           hdr.msg_namelen = 0;
  1924.           hdr.msg_iov = iovec;
  1925.           hdr.msg_iovlen = 2;
  1926.           iovec[0].iov_base = ptrs[0];
  1927.           iovec[0].iov_len = 4096;
  1928.           iovec[1].iov_base = ptrs[1];
  1929.           iovec[1].iov_len = 96;
  1930.           hdr.msg_control = NULL;
  1931.           hdr.msg_controllen = 0;
  1932.           hdr.msg_flags = 0;
  1933.           ret = sendmsg(sock, &hdr, MSG_MAPIO);
  1934.  
  1935. Notes: 
  1936.  
  1937.   1. On the send() and sendto() calls, only one pointer and up to 4096 bytes 
  1938.      may be sent per call. 
  1939.  
  1940.   2. The pointers passed to the any of the send-type calls must be exactly as 
  1941.      returned from the allocation call; they may not be altered in any way. 
  1942.  
  1943.  
  1944. ΓòÉΓòÉΓòÉ 4.19.3. Determining if HPS Memory is Available for Reuse ΓòÉΓòÉΓòÉ
  1945.  
  1946. After a successful send-type call using HPS memory, the user must wait until 
  1947. the stack is finished with it before reusing it.  There are two ways to 
  1948. determine if HPS memory is available for reuse: event semaphores and polling. 
  1949.  
  1950. To use the event semaphores method, the application must allocate 15 shared 
  1951. event sempahores and pass them on the sysctl() call used to allocate the HPS 
  1952. memory (see the second example under Allocating HPS Memory).  When the stack is 
  1953. finished using the HPS memory, it will post any event semaphores corresponding 
  1954. to the 4K blocks that are now free. 
  1955.  
  1956. To use the polling method, the application calls sysctl() with an array of 
  1957. pointers.  The stack will check each pointer, and if the block is in use, will 
  1958. zero the pointer in the array.  The polling method may be used even if event 
  1959. semaphores were also allocated for the memory. Following is an example of the 
  1960. polling method: 
  1961.  
  1962.          long arrayofptrs[15];
  1963.          int mib[4];
  1964.          unsigned int needed;
  1965.  
  1966.          mib[0] = CTL_OS2;
  1967.          mib[1] = AF_INET;
  1968.          mib[2] = 0;
  1969.          mib[3] = OS2_QUERY_MEMMAPIO;
  1970.          needed = sizeof(arrayofptrs);
  1971.  
  1972.          if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), arrayofptrs,
  1973.              &needed, NULL, 0) < 0) {
  1974.              psock_errno("sysctl(QUERY_MEMMAPIO)");
  1975.              exit(1);
  1976.          }
  1977.          for (i = 0; i < 15; i++) {
  1978.             if (arrayofptrs[i] == 0) {
  1979.                /* pointer is in use */
  1980.             }
  1981.          }
  1982.  
  1983.  
  1984. ΓòÉΓòÉΓòÉ 4.19.4. Freeing HPS Memory ΓòÉΓòÉΓòÉ
  1985.  
  1986. To free HPS memory, the application calls sysctl() as follows: 
  1987.  
  1988.          int mib[4];
  1989.          unsigned long ptrs[15];
  1990.          int ret;
  1991.  
  1992.          mib[0] = CTL_OS2;
  1993.          mib[1] = PF_INET;
  1994.          mib[2] = IPPROTO_IP;
  1995.          mib[3] = OS2_MEMMAPIO;
  1996.  
  1997.          ret = sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL,
  1998.                       0, ptrs, sizeof(ptrs));
  1999.  
  2000. The ptrs parameter is the list of array of pointers returned on the allocation 
  2001. call. 
  2002.  
  2003.  
  2004. ΓòÉΓòÉΓòÉ 4.20. Passing Sockets Between Processes ΓòÉΓòÉΓòÉ
  2005.  
  2006. Because sockets are not file handles on OS/2, sockets are not automatically 
  2007. passed from a parent process to a child process. Instead, sockets are global to 
  2008. the system and unsecure, so that any process may access any valid socket. To 
  2009. ensure sockets are always properly closed when a process terminates, 
  2010. TCPIP32.DLL installs an exit list handler (with an order code of 0x99) that 
  2011. closes all remaining sockets that were opened by that process. If a process 
  2012. attempts to pass a socket to a child process, both the parent and child need to 
  2013. notify TCPIP32.DLL that a change in ownership occurred so that the exit list 
  2014. handler for the two processes close the correct sockets when the processes 
  2015. terminate. 
  2016.  
  2017. To pass ownership from parent to child, the parent process needs to issue 
  2018. removesocketfromlist() with the socket number that is being transferred to the 
  2019. child. The child process needs to issue addsockettolist() with the same socket 
  2020. number to assume ownership of it. After these two calls are completed, the 
  2021. child process's exit list handler will automatically close the socket that was 
  2022. passed once the child terminates (unless the child application closes the 
  2023. socket itself before it terminates.) See addsockettolist() and 
  2024. removesocketfromlist() for additional details. 
  2025.  
  2026.  
  2027. ΓòÉΓòÉΓòÉ 4.21. Multithreading Considerations ΓòÉΓòÉΓòÉ
  2028.  
  2029. The sockets and network utility routines are completely reentrant. Multiple 
  2030. threads of an application can perform any socket call. 
  2031.  
  2032. Note:  Each thread that makes sockets calls has memory automatically allocated 
  2033.        for it by TCPIP32.DLL to store per-thread information (such as the error 
  2034.        code for the last sockets call made on that thread).  If a thread only 
  2035.        makes protocol-independent calls, the amount of memory allocated will be 
  2036.        small (on the order of 100 bytes).  If a thread issues any of the TCP/IP 
  2037.        network utility calls, however, a 4K block will also be allocated for 
  2038.        that thread.  None of the memory that is allocated will be deallocated 
  2039.        until the process terminates.  It will be reused however, if a thread 
  2040.        terminates and another thread is created. 
  2041.  
  2042.  
  2043. ΓòÉΓòÉΓòÉ 4.22. Accessing a TCP/IP API DLL from an Intermediate DLL ΓòÉΓòÉΓòÉ
  2044.  
  2045. A TCP/IP API DLL can be accessed both directly from an application and through 
  2046. an intermediate DLL. An example of an intermediate DLL is a virtual network API 
  2047. layer that supports generalized network functionality for applications and uses 
  2048. the TCP/IP API. 
  2049.  
  2050. The OS/2 Warp Toolkit contains a sample program to build a DLL.  You can find 
  2051. the program in the SAMPLES\TCPIPTK\SAMPDLL directory. 
  2052.  
  2053. For more information about DLLs, refer to the OS/2 Warp Technical Library, 
  2054. Control Programming Guide 
  2055.  
  2056.  
  2057. ΓòÉΓòÉΓòÉ 4.23. Differences between OS/2 and Standard BSD Sockets ΓòÉΓòÉΓòÉ
  2058.  
  2059. Networking services sockets is based on the Berkeley Software Distribution 
  2060. version 4.4 sockets implementation. 
  2061.  
  2062. The IBM OS/2 socket implementation differs from the Berkeley socket 
  2063. implementation as follows: 
  2064.  
  2065.     Sockets are not OS/2 files or devices.  Socket numbers have no 
  2066.      relationship to OS/2 file handles.  Therefore, the read(), write(), and 
  2067.      close() calls do not work for sockets: using them gives incorrect results. 
  2068.      Use the recv(), send(), and soclose() calls instead. 
  2069.  
  2070.     Error codes set by the OS/2 TCP/IP sockets implementation are not made 
  2071.      available via the global errno variable.  Instead, error codes are 
  2072.      accessed by using the sock_errno() call (see sock_errno()). Use the 
  2073.      psock_errno() call, instead of the perror() call, to write a short error 
  2074.      message to the standard error device describing the last error encountered 
  2075.      during a call to a socket library function.  To access system return 
  2076.      values, use the errno.h include statement supplied with the compiler. 
  2077.  
  2078.      This is intended to obtain per-thread error codes in a multithreaded 
  2079.      application environment and to avoid conflict with standard ANSI C error 
  2080.      constants. 
  2081.  
  2082.      BSD-style error checking is as follows: 
  2083.  
  2084.        - 
  2085.  
  2086.                     rt = recv(s, buf, sizeof(buf), 0);
  2087.                     if (rt == -1 && errno == EWOULDBLOCK)
  2088.                     {...}
  2089.  
  2090.        - 
  2091.  
  2092.                     if (recv(s, buf, sizeof(buf), 0) < 0) {
  2093.                     perror("Recv()");
  2094.                     exit(1);
  2095.                     }
  2096.  
  2097.      The preferred OS/2-style error checking is as follows: 
  2098.  
  2099.        - 
  2100.  
  2101.                     rt = recv(s, buf, sizeof(buf), 0);
  2102.                     if (rt == -1 && sock_errno() == SOCEWOULDBLOCK)
  2103.                     {...}
  2104.  
  2105.        - 
  2106.  
  2107.                     if (recv(s, buf, sizeof(buf), 0) < 0)
  2108.                     {
  2109.                     psock_errno("Recv()");
  2110.                     exit(1);
  2111.                     }
  2112.  
  2113.      Error constants consistent with BSD sockets are provided for compatibility 
  2114.      purposes; your application can use the error constant EWOULDBLOCK, instead 
  2115.      of SOCEWOULDBLOCK.  See Socket Error Constants, or the <NERRNO.H> file for 
  2116.      definitions of error constants. 
  2117.  
  2118.     Unlike the Berkeley select() call, you cannot use the OS/2 select() call 
  2119.      to wait for activity on devices other than sockets.  See select() for more 
  2120.      information. 
  2121.  
  2122.     The ioctl(), getsockopt(), setsockopt(), and sysctl() calls don't support 
  2123.      all of the options supported by BSD and add some options not supported by 
  2124.      BSD. See ioctl(), getsockopt(), setsockopt(), and sysctl() for more 
  2125.      information. 
  2126.  
  2127.  
  2128. ΓòÉΓòÉΓòÉ 4.24. Compiling and Linking a Sockets API Application ΓòÉΓòÉΓòÉ
  2129.  
  2130. Follow these steps to compile and link a sockets API application using the IBM 
  2131. VisualAge C++ compiler: 
  2132.  
  2133.   1. To compile your program, enter: 
  2134.  
  2135.           icc /Gm /c myprog.c
  2136.  
  2137.   2. To create an executable program, you can enter: 
  2138.  
  2139.      For VisualAge C++ 
  2140.  
  2141.           ilink /NOFREEFORMAT myprog,myprog.exe /STACK:0x4000
  2142.  
  2143. Note:  For more information about the compile and link options, multithreaded 
  2144.        libraries, and dynamic link libraries, refer to the User's Guide 
  2145.        provided with your compiler. 
  2146.  
  2147.  
  2148. ΓòÉΓòÉΓòÉ 4.25. Sample Programs ΓòÉΓòÉΓòÉ
  2149.  
  2150. The following sample programs are included in the TCP/IP toolkit: 
  2151.  
  2152. SOCKET    These samples consist of several C socket client-server programs. 
  2153.  
  2154. SAMPDLL   These samples demonstrate building and using a DLL that uses TCP/IP. 
  2155.  
  2156. HPS       These samples demonstrate using High Performance Send. 
  2157.  
  2158. RPC       These samples provide examples of Remote Procedure Call (RPC) client, 
  2159.           server, and raw data stream programs. 
  2160.  
  2161. RPCGEN    The samples define remote procedure characteristics and demonstrate 
  2162.           an RPC client and server program. 
  2163.  
  2164.  
  2165. ΓòÉΓòÉΓòÉ 5. Sockets in the Internet Domain ΓòÉΓòÉΓòÉ
  2166.  
  2167. This section describes the use of sockets in the internet domain. 
  2168.  
  2169. Topics 
  2170.  
  2171.      Protocols Used in the Internet Domain 
  2172.      Getting Started with Sockets in the Internet Domain 
  2173.      Network-Byte Order 
  2174.      Internet Address Formats 
  2175.      TCP/IP-Specific Network Utility Routines 
  2176.      The _res Data Structure 
  2177.      Ports 
  2178.      IP Multicasting 
  2179.      Socket Secure Support 
  2180.  
  2181.  
  2182. ΓòÉΓòÉΓòÉ 5.1. Protocols Used in the Internet Domain ΓòÉΓòÉΓòÉ
  2183.  
  2184. This section describes the network protocols in TCP/IP. The internet domain is 
  2185. supported only by the TCP/IP protocol suite. Networking protocols like TCP/IP 
  2186. are layered as shown in the following figure. For more information on the 
  2187. internet domain and the TCP/IP protocol suite, refer to TCP/IP Illustrated, 
  2188. Volume 1: The Protocols, W. Richard Stevens, Addison-Wesley Publishing Co., 
  2189. 1994. 
  2190.  
  2191.  
  2192. The Internet Layered Architecture
  2193.  
  2194. Topics 
  2195.  
  2196.      Transmission Control Protocol (TCP) 
  2197.      User Datagram Protocol (UDP) 
  2198.      Internet Protocol (IP) 
  2199.      Internet Control Message Protocol (ICMP) 
  2200.      Address Resolution Protocol (ARP) 
  2201.      Internet Group Management Protocol (IGMP) 
  2202.  
  2203.  
  2204. ΓòÉΓòÉΓòÉ 5.1.1. Transmission Control Protocol (TCP) ΓòÉΓòÉΓòÉ
  2205.  
  2206. TCP is a transport protocol that provides a reliable mechanism for delivering 
  2207. packets between hosts on an internet. TCP takes a stream of data, breaks it 
  2208. into datagrams, sends each one individually using Internet Protocol (IP), and 
  2209. reassembles the datagrams at the destination node. If any datagrams are lost or 
  2210. damaged during transmission, TCP detects this and resends the missing 
  2211. datagrams. The received data stream is a reliable copy of the transmitted data 
  2212. stream. 
  2213.  
  2214. Note:  The PUSH flag is a notification from the sender to the receiver for the 
  2215.        receiver to pass all the data that it has to the receiving process. 
  2216.        This data consists of whatever is in the segment with the PUSH flag, 
  2217.        along with any other data the receiving TCP has collected for the 
  2218.        receiving process. Our TCP implementation automatically sets the PUSH 
  2219.        flag if the data in the segment being sent empties the send buffer. In 
  2220.        addition, our implementation ignores a received PUSH flag because we 
  2221.        don't delay the delivery of the received data to the application. 
  2222.  
  2223. You can use TCP sockets for both passive (server) and active (client) 
  2224. applications. While some calls are necessary for both types, some are 
  2225. role-specific. TCP is the default protocol for stream sockets in the internet 
  2226. domain. For sample C socket communication client and server programs, see the 
  2227. TCP/IP samples included in the OS/2 Warp Toolkit. 
  2228.  
  2229. TCP is a connection-oriented protocol.  It is used to communicate between pairs 
  2230. of applications. After you make a connection, it exists until you close the 
  2231. socket. During the connection, data is either delivered or an error code is 
  2232. returned by networking services. 
  2233.  
  2234.  
  2235. ΓòÉΓòÉΓòÉ 5.1.2. User Datagram Protocol (UDP) ΓòÉΓòÉΓòÉ
  2236.  
  2237. UDP is a transport-layer datagram protocol that sends and receives whole 
  2238. packets across the network. UDP is used for application-to-application programs 
  2239. between TCP/IP hosts. UDP does not offer a guarantee of datagram delivery or 
  2240. duplication protection.  UDP does provide checksums for both the header and 
  2241. data portions of a datagram. However, applications that require reliable 
  2242. delivery of streams of data should use TCP. UDP is the default protocol for 
  2243. datagram sockets in the internet domain. 
  2244.  
  2245. Unlike applications using TCP, UDP applications are usually connectionless.  A 
  2246. UDP socket application can become connected by calling the connect() API. An 
  2247. unconnected socket can be used to communicate with many hosts; but a connected 
  2248. socket, because it has a dedicated destination, can exchange data with only one 
  2249. host at a time. 
  2250.  
  2251. UDP is considered an unreliable protocol because it sends its data over the 
  2252. network without verification. Consequently, after a packet has been accepted by 
  2253. the UDP interface, neither the arrival of the packet nor the arrival order of 
  2254. the packet at the destination can be guaranteed. 
  2255.  
  2256.  
  2257. ΓòÉΓòÉΓòÉ 5.1.3. Internet Protocol (IP) ΓòÉΓòÉΓòÉ
  2258.  
  2259. The IP network layer provides the interface from the transport layer 
  2260. (host-to-host) protocols to the link-level protocols. IP is the basic transport 
  2261. mechanism for routing IP packets to the next gateway, router, or destination 
  2262. host. 
  2263.  
  2264. IP provides the means to transmit packets of data from sources to destinations. 
  2265. Sources and destinations are hosts identified by 32-bit IP addresses, which are 
  2266. assigned independent of the underlying physical network. Outgoing packets 
  2267. automatically have an IP header prepended to them, and incoming packets have 
  2268. their IP header removed before being passed to the higher-level protocols. This 
  2269. protocol ensures the unique addressing of hosts in an internet network. 
  2270.  
  2271. IP does not ensure a reliable communication, because it does not require 
  2272. acknowledgments from the sending host, the receiving host, or intermediate 
  2273. hosts. IP does not provide error control for data; it provides only a header 
  2274. checksum. IP treats each packet as an independent entity, unrelated to any 
  2275. other packet. IP does not perform retransmissions or flow control. A 
  2276. higher-level protocol like TCP (Transmission Control Protocol) that uses IP 
  2277. must implement its own reliability procedures. 
  2278.  
  2279. Applications do not typically access IP directly, but rather use TCP or UDP 
  2280. which, in turn, use IP. Raw sockets can use IP. 
  2281.  
  2282.  
  2283. ΓòÉΓòÉΓòÉ 5.1.4. Internet Control Message Protocol (ICMP) ΓòÉΓòÉΓòÉ
  2284.  
  2285. ICMP is used to pass control information between hosts. For example, the 
  2286. information can be sent in any of the following situations: 
  2287.  
  2288.     When a host checks to see if another host is available (PING) 
  2289.     When a packet cannot reach its destination 
  2290.     When a gateway or router can direct a host to send traffic on a shorter 
  2291.      route 
  2292.     When a gateway or router does not have the buffering capacity to forward a 
  2293.      packet 
  2294.  
  2295. ICMP provides feedback about problems in the communication environment; it does 
  2296. not make IP reliable. The use of ICMP does not guarantee that an IP packet will 
  2297. be delivered reliably or that an ICMP message will be returned to the source 
  2298. host when an IP packet is not delivered or is incorrectly delivered. 
  2299.  
  2300. Raw sockets can use ICMP and, like IP, ICMP is not typically used by 
  2301. application programs directly. 
  2302.  
  2303.  
  2304. ΓòÉΓòÉΓòÉ 5.1.5. Address Resolution Protocol (ARP) ΓòÉΓòÉΓòÉ
  2305.  
  2306. ARP maps IP addresses to hardware addresses. TCP/IP uses ARP to collect and 
  2307. distribute the information for mapping tables. 
  2308.  
  2309. ARP is not directly available to users or applications. When an application 
  2310. sends an internet packet, IP requests the appropriate address mapping. If the 
  2311. mapping is not in the mapping table, an ARP broadcast packet is sent to all the 
  2312. hosts on the local network requesting the physical hardware address for the 
  2313. host. 
  2314.  
  2315. Proxy ARP allows an assigned substitute ARP agent (typically a router) to 
  2316. respond to ARP requests on behalf of certain hosts which reside on the outside 
  2317. of a network. A proxy ARP agent must be defined beforehand for the ARP hosts 
  2318. which will have their -P (Public) flag set. 
  2319.  
  2320.  
  2321. ΓòÉΓòÉΓòÉ 5.1.6. Internet Group Management Protocol (IGMP) ΓòÉΓòÉΓòÉ
  2322.  
  2323. RFC 1112 defines IGMP, which describes interactions between IP multicast hosts 
  2324. and multicast routers. A multicast router needs to know the current membership 
  2325. of host groups in all attached local networks in order to forward multicast 
  2326. datagrams to hosts on local networks.  IP multicast datagrams will not be 
  2327. forwarded to local networks if there are no members of the destination host 
  2328. group. 
  2329.  
  2330. There are two types of IGMP messages transmitted on local networks. Both types 
  2331. of messages are transmitted by multicasting to reduce network load.  A 
  2332. multicast router periodically sends IGMP membership queries to hosts on the 
  2333. same network.  An IGMP membership query is sent to the all-hosts group 
  2334. (224.0.0.1). 
  2335.  
  2336. Upon receiving a membership query from a multicast router, a multicast host 
  2337. starts a random timer for each host group joined on the interface that receives 
  2338. IGMP membership queries. A host sends IGMP membership reports when timers 
  2339. expire. Membership reports are sent to the host group being reported. 
  2340.  
  2341. If other hosts on the same network are to receive an IGMP membership report on 
  2342. the same host group, these hosts should cancel the timer before it expires. 
  2343. This prevents duplicated IGMP membership reports from flooding a local network. 
  2344. An IGMP membership report is also sent when a host joins a new host group. 
  2345.  
  2346. When a multicast router receives an IGMP membership report of one host group, 
  2347. the router updates its knowledge of the current membership on a particular 
  2348. network.  If no reports are received on a particular host group after several 
  2349. queries, a multicast router assumes that there are no local members on that 
  2350. host group and stops forwarding any multicast datagrams with that destination 
  2351. host group. 
  2352.  
  2353.  
  2354. ΓòÉΓòÉΓòÉ 5.2. Getting Started with Sockets in the Internet Domain ΓòÉΓòÉΓòÉ
  2355.  
  2356. This section provides some basic information for getting started with sockets 
  2357. in the internet domain: 
  2358.  
  2359.     Use the socket() call to create a socket in the internet domain specifying 
  2360.      PF_INET for the domain parameter. 
  2361.  
  2362.     Use AF_INET for the address family. 
  2363.  
  2364.     The following socket types are supported for the internet domain: 
  2365.  
  2366.        -  Datagram (SOCK_DGRAM) 
  2367.        -  Raw (SOCK_RAW) 
  2368.        -  Stream (SOCK_STREAM) 
  2369.  
  2370.      The socket type is passed as a parameter to the socket() call. For 
  2371.      additional information, see Socket Types and general socket programming 
  2372.      concepts in Sockets General Programming Information. 
  2373.  
  2374.     Datagram sockets use the UDP protocol, stream sockets use the TCP 
  2375.      protocol, and raw sockets can use the raw, ICMP, or IGMP protocols. 
  2376.  
  2377.     Use the network utility routines to get addresses with a given name (see 
  2378.      TCP/IP-Specific Network Utility Routines for additional information). 
  2379.  
  2380.  
  2381. ΓòÉΓòÉΓòÉ 5.3. Network-Byte Order ΓòÉΓòÉΓòÉ
  2382.  
  2383. Ports and addresses are specified to sockets API calls by using the 
  2384. network-byte ordering convention. Network-byte order is also known as big 
  2385. endian byte ordering, which has the high-order byte at the starting address. By 
  2386. contrast, little endian has the low-order byte at the starting address. Using 
  2387. network-byte ordering for data exchanged between hosts allows hosts using 
  2388. different underlying byte ordering conventions to exchange address information. 
  2389. There is a set of network utility functions for translating addresses from 
  2390. host-byte to network-byte order and from network-byte to host-byte order. For 
  2391. more information about network-byte order and address translation, see: 
  2392.  
  2393.     bind() 
  2394.     htonl() 
  2395.     htons() 
  2396.     ntohl() 
  2397.     ntohs() 
  2398.  
  2399. Note:  The socket interface does not handle application data byte ordering 
  2400.        differences. Application writers must handle data buffer byte order 
  2401.        differences themselves. 
  2402.  
  2403.  
  2404. ΓòÉΓòÉΓòÉ 5.4. Internet Address Formats ΓòÉΓòÉΓòÉ
  2405.  
  2406. This section describes the address formats used in the internet domain. 
  2407.  
  2408. internet addresses (IP) are 32-bit values that represent a network interface. 
  2409. Every internet address within an administered internet (AF_INET) communication 
  2410. domain must be unique. A host can have as many internet addresses as it has 
  2411. network interfaces. For more information about internet address formats, see 
  2412. Internetworking with TCP/IP Volume I:  Principles, Protocols, and Architectures 
  2413. , and Volume II:  Implementation and Internals , Douglas E. Comer, Prentice 
  2414. Hall, 1991. 
  2415.  
  2416. Each internet host is assigned at least one unique internet address. This 
  2417. address is used by IP and other higher-level protocols. When a host is a 
  2418. gateway, it has more than one IP address.  Gateway hosts connect two or more 
  2419. physical networks and have one IP address per connected physical network. 
  2420.  
  2421. Addresses within an internet consist of a network number and a local address. 
  2422. All physical host IP addresses share the same network number and are logically 
  2423. part of the same network even if that network is connected with various 
  2424. physical media. 
  2425.  
  2426. Hosts on disjoint physical networks might also have the same network number, 
  2427. but are not part of the same internet network. Hosts that are part of the same 
  2428. internet network can exchange packets directly without going through 
  2429. intermediate routers. An internet network can be subdivided logically using a 
  2430. subnet mask. All host interfaces to the same physical network are given the 
  2431. same subnetwork number. An internet domain can provide standards for assigning 
  2432. addresses to networks, broadcasts, and subnetworks. 
  2433.  
  2434. Dotted-Decimal Notation: A commonly used notation for internet host addresses 
  2435. is the dotted-decimal format, which divides the 32-bit address into four 8-bit 
  2436. fields. The value of each field is specified as a decimal number, and the 
  2437. fields are separated by periods (for example, 10.2.0.52). 
  2438.  
  2439. Address examples in this document use dotted-decimal notation in the following 
  2440. forms: 
  2441.  
  2442.     nnn.lll.lll.lll 
  2443.     nnn.nnn.lll.lll 
  2444.     nnn.nnn.nnn.lll 
  2445.  
  2446. where: 
  2447.  
  2448. nnn     represents part or all of a network number. 
  2449. lll     represents part or all of a local address. 
  2450.  
  2451. Note:  Additional details about internet network address format class A, B, C, 
  2452.        and D addresses, subnetwork address format, and broadcast address 
  2453.        formats can be found in the TCP/IP Guide 
  2454.  
  2455. Addressing within an Internet Domain: A socket address in an internet 
  2456. communication domain is composed of five fields in the following sockaddr_in 
  2457. structure: length, address family, port, internet address, and a .*  reserved 
  2458. field. The sockaddr_in structure should be cleared before use. The structure is 
  2459. located in the <NETINET\IN.H> header file: 
  2460.  
  2461. struct in_addr {
  2462.         u_long s_addr;
  2463. };
  2464.  
  2465. struct sockaddr_in {
  2466.         u_char sin_len;            /* sizeof (struct sockaddr_in) = 16 */
  2467.         u_char sin_family;         /* AFINET */
  2468.         u_short sin_port;          /* port id */
  2469.         struct  in_addr sin_addr;  /* address */
  2470.         char    sin_zero[8];       /* not used */
  2471. };
  2472.  
  2473. The sin_len field is set to 16 as the size of the sockaddr_in structure. 
  2474.  
  2475. The sin_family field is set to AF_INET. 
  2476.  
  2477. The sin_port field is set to the port number in network-byte order. If you are 
  2478. specifying your workstation address in sin_addr and you set sin_port to 0 using 
  2479. the bind() call, the system assigns an available port. If you specify a 
  2480. different workstation address in sin_addr, you must specify the port. For more 
  2481. information on ports, see Ports. 
  2482.  
  2483. The sin_addr field is set to the internet address represented in network-byte 
  2484. order. When specified as a parameter to bind(), sin_addr is usually set to the 
  2485. constant INADDR_ANY, as defined in <NETINET\IN.H>. This binds the socket to any 
  2486. and all local internet addresses. By using INADDR_ANY, an application can bind 
  2487. a socket without specifying the local internet address. The constant INADDR_ANY 
  2488. also allows an application running on a host with multiple interfaces (called a 
  2489. multihomed host) to receive UDP datagrams and TCP connection requests arriving 
  2490. at any interface on a single socket. (The application is not required to have 
  2491. one socket per interface, with each interface bound to a specific internet 
  2492. address). 
  2493.  
  2494. To specify your workstation address, you can leave sin_addr unspecified.  If 
  2495. you are specifying a different workstation address, you must specify a valid 
  2496. internet address for that workstation. 
  2497.  
  2498. The sin_zero field is not used, and it should be set to 0 by the application 
  2499. before passing the address structure to any sockets call. 
  2500.  
  2501.  
  2502. ΓòÉΓòÉΓòÉ 5.5. TCP/IP-Specific Network Utility Routines ΓòÉΓòÉΓòÉ
  2503.  
  2504. This section describes the library of network utility routines. 
  2505.  
  2506. Network utility routines are described in the following sections. 
  2507.  
  2508. Topics 
  2509.  
  2510.      Host Names Information 
  2511.      Network Names Information 
  2512.      Protocol Names Information 
  2513.      Service Names Information 
  2514.      Network Address Translation 
  2515.      Network-Byte Order Translation 
  2516.      Internet Address Manipulation 
  2517.      Domain Name Resolution 
  2518.  
  2519.  
  2520. ΓòÉΓòÉΓòÉ 5.5.1. Host Names Information ΓòÉΓòÉΓòÉ
  2521.  
  2522. The following is a list of host-related calls: 
  2523.  
  2524.     gethostbyname() 
  2525.     gethostbyaddr() 
  2526.     sethostent() 
  2527.     gethostent() 
  2528.     endhostent() 
  2529.     gethostname() 
  2530.     gethostid() 
  2531.  
  2532. The gethostbyname() call takes an internet host name and returns a hostent 
  2533. structure, which contains the name of the host, aliases, host address family 
  2534. and host address. The hostent structure is defined in the <NETDB.H> header 
  2535. file. The gethostbyaddr() call maps the internet host address into a hostent 
  2536. structure. 
  2537.  
  2538. The database for these calls is provided by the name server or the ETC\HOSTS 
  2539. file if a name server is not present or is unable to resolve the host name. 
  2540.  
  2541. The sethostent(), gethostent(), and endhostent() calls open, provide sequential 
  2542. access to, and close the ETC\HOSTS file. 
  2543.  
  2544. The gethostname() call gets the name for the local host machine. 
  2545.  
  2546. The gethostid() call returns an integer that identifies the host machine. Host 
  2547. IDs fall under the category of internet network addressing because, by 
  2548. convention, the 32-bit internet address is used. 
  2549.  
  2550.  
  2551. ΓòÉΓòÉΓòÉ 5.5.2. Network Names Information ΓòÉΓòÉΓòÉ
  2552.  
  2553. The following is a list of network-related calls: 
  2554.  
  2555.     getnetbyname() 
  2556.     getnetbyaddr() 
  2557.     setnetent() 
  2558.     getnetent() 
  2559.     endnetent() 
  2560.  
  2561. The getnetbyname() call takes a network name and returns a netent structure, 
  2562. which contains the name of the network, aliases, network address family, and 
  2563. network number.  The netent structure is defined in the <NETDB.H> header file. 
  2564. The getnetbyaddr() call maps the network number into a netent structure. 
  2565.  
  2566. The database for these calls is provided by the ETC\NETWORKS file. 
  2567.  
  2568. The setnetent(), getnetent(), and endnetent() calls open, provide sequential 
  2569. access to, and close the ETC\NETWORKS file. 
  2570.  
  2571.  
  2572. ΓòÉΓòÉΓòÉ 5.5.3. Protocol Names Information ΓòÉΓòÉΓòÉ
  2573.  
  2574. The following is a list of protocol related calls: 
  2575.  
  2576.     getprotobyname() 
  2577.     getprotobynumber() 
  2578.     setprotoent() 
  2579.     getprotoent() 
  2580.     endprotoent() 
  2581.  
  2582. The getprotobyname() call takes the protocol name and returns a protoent 
  2583. structure, which contains the name of the protocol, aliases, and protocol 
  2584. number.  The protoent structure is defined in the <NETDB.H> header file.  The 
  2585. getprotobynumber() call maps the protocol number into a protoent structure. 
  2586.  
  2587. The database for these calls is provided by the ETC\PROTOCOL file. 
  2588.  
  2589. The setprotoent(), getprotoent(), and endprotoent() calls open, provide 
  2590. sequential access to, and close the ETC\PROTOCOL file. 
  2591.  
  2592.  
  2593. ΓòÉΓòÉΓòÉ 5.5.4. Service Names Information ΓòÉΓòÉΓòÉ
  2594.  
  2595. The following is a list of service related calls: 
  2596.  
  2597.     getservbyname() 
  2598.     getservbyport() 
  2599.     setservent() 
  2600.     getservent() 
  2601.     endservent() 
  2602.  
  2603. The getservbyname() call takes the service name and protocol, and returns a 
  2604. servent structure that contains the name of the service, aliases, port number, 
  2605. and protocol.  The servent structure is defined in the <NETDB.H> header file. 
  2606. The getservbyport() call maps the port number and protocol into a servent 
  2607. structure. 
  2608.  
  2609. The database for these calls is provided by the ETC\SERVICES file. 
  2610.  
  2611. The setservent(), getservent(), and endservent() calls open, provide sequential 
  2612. access to, and close the ETC\SERVICES file. 
  2613.  
  2614.  
  2615. ΓòÉΓòÉΓòÉ 5.5.5. Network Address Translation ΓòÉΓòÉΓòÉ
  2616.  
  2617. Network library calls enable an application program to locate and construct 
  2618. network addresses while using interprocess communication facilities in a 
  2619. distributed environment. 
  2620.  
  2621. Locating a service on a remote host requires many levels of mapping before 
  2622. client and server can communicate. A network service is assigned a name that is 
  2623. intended to be understandable for a user. This name and the name of the peer 
  2624. host must then be translated into network addresses. Finally, the address must 
  2625. then be used to determine a physical location and route to the service. 
  2626.  
  2627. Network library calls map: 
  2628.  
  2629.     Host names to network addresses 
  2630.     Network names to network numbers 
  2631.     Protocol names to protocol numbers 
  2632.     Service names to port numbers 
  2633.  
  2634. Additional network library calls exist to simplify the manipulation of names 
  2635. and addresses. 
  2636.  
  2637. An application program must include the <NETDB.H> file when using any of the 
  2638. network library calls. 
  2639.  
  2640. Note:  All networking services return values in standard network byte order. 
  2641.  
  2642.  
  2643. ΓòÉΓòÉΓòÉ 5.5.6. Network-Byte Order Translation ΓòÉΓòÉΓòÉ
  2644.  
  2645. Internet domain ports and addresses are usually specified to calls using the 
  2646. network-byte ordering convention.  The following calls translate integers from 
  2647. host- to network-byte order and from network- to host-byte order. 
  2648.  
  2649. htonl()     Translates host to network, long integer (32-bit) 
  2650. htons()     Translates host to network, short integer (16-bit) 
  2651. ntohl()     Translates network to host, long integer (32-bit) 
  2652. ntohs()     Translates network to host, short integer (16-bit) 
  2653.  
  2654.  
  2655. ΓòÉΓòÉΓòÉ 5.5.7. Internet Address Manipulation ΓòÉΓòÉΓòÉ
  2656.  
  2657. The following calls convert internet addresses and decimal notation, and 
  2658. manipulate the network number and local network address portions of an internet 
  2659. address: 
  2660.  
  2661. inet_addr()         Translates dotted-decimal notation to a 32-bit internet 
  2662.                     address (network-byte order). 
  2663.  
  2664. inet_network()      Translates dotted-decimal notation to a network number 
  2665.                     (host-byte order), and zeros in the host part. 
  2666.  
  2667. inet_ntoa()         Translates 32-bit internet address (network-byte order) to 
  2668.                     dotted-decimal notation. 
  2669.  
  2670. inet_netof()        Extracts network number (host-byte order) from 32-bit 
  2671.                     internet address (network-byte order). 
  2672.  
  2673. inet_lnaof()        Extracts local network address (host-byte order) from 
  2674.                     32-bit internet address (network-byte order). 
  2675.  
  2676. inet_makeaddr()     Constructs internet address (network-byte order) from 
  2677.                     network number and local network address. 
  2678.  
  2679.  
  2680. ΓòÉΓòÉΓòÉ 5.5.8. Domain Name Resolution ΓòÉΓòÉΓòÉ
  2681.  
  2682. In TCP/IP, communication is based on internet addresses. When a TCP/IP 
  2683. application receives a symbolic host name, it calls a host name resolver 
  2684. routine to resolve the symbolic name into an internet address. The host name 
  2685. resolver routine queries a domain name server or a local HOSTS file, or both, 
  2686. to perform the name resolution. 
  2687.  
  2688. If a RESOLV2 file or RESOLV file exists in the ETC subdirectory, the host name 
  2689. resolver routine first tries to resolve the name by querying the name servers 
  2690. specified in that file. 
  2691.  
  2692. If resolution through a name server fails or if a RESOLV2 or RESOLV file does 
  2693. not exist, the host name resolver routine tries to resolve the name locally by 
  2694. searching the HOSTS file in the ETC subdirectory for a match of the symbolic 
  2695. host name. 
  2696.  
  2697. The above search order can be reversed by setting the OS/2 environment variable 
  2698. USE_HOST_FIRST to any nonzero value. If this variable is set, the host name 
  2699. resolver routine searches the local HOSTS file first before querying a domain 
  2700. name server. 
  2701.  
  2702. If a match is found, the routine returns the corresponding internet address. If 
  2703. a match is not found, the routine displays a message stating that the host is 
  2704. unknown. 
  2705.  
  2706. RESOLV and RESOLV2 files 
  2707.  
  2708. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2709. ΓöéNETWORK       RESOLV FILE                RESOLV2 FILE              Γöé
  2710. ΓöéCONNECTION                                                         Γöé
  2711. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2712. ΓöéLAN only                                 X                         Γöé
  2713. Γöéconnection                                                         Γöé
  2714. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2715. ΓöéSLIP only     X                                                    Γöé
  2716. Γöéconnection                                                         Γöé
  2717. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2718. ΓöéLAN and SLIP  X                          X (used for domain name   Γöé
  2719. Γöéconnections                              resolution)               Γöé
  2720. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2721.  
  2722. The following resolver calls are used to make, send, and interpret packets for 
  2723. name servers in the internet domain: 
  2724.  
  2725.     res_query() 
  2726.     res_querydomain() 
  2727.     res_mkquery() 
  2728.     res_send() 
  2729.     res_search() 
  2730.     res_init() 
  2731.     dn_comp() 
  2732.     dn_expand() 
  2733.     dn_find() 
  2734.     dn_skipname() 
  2735.     _getshort() 
  2736.     _getlong() 
  2737.     putlong() 
  2738.     putshort() 
  2739.  
  2740.  
  2741. ΓòÉΓòÉΓòÉ 5.6. The _res Data Structure ΓòÉΓòÉΓòÉ
  2742.  
  2743. Global information used by these resolver calls is kept in the _res data 
  2744. structure. This structure is defined in the <RESOLV.H> file and contains the 
  2745. following members: 
  2746.  
  2747. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2748. ΓöéType                  Member                Contents             Γöé
  2749. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2750. Γöéint                   retrans               Retransmission time  Γöé
  2751. Γöé                                            interval             Γöé
  2752. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2753. Γöéint                   retry                 Number of times to   Γöé
  2754. Γöé                                            retransmit           Γöé
  2755. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2756. Γöélong                  options               Option flags         Γöé
  2757. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2758. Γöéint                   nscount               Number of name       Γöé
  2759. Γöé                                            servers              Γöé
  2760. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2761. Γöéstruct                nsaddr_list           Address of name      Γöé
  2762. Γöésockaddr_in[MAXNS]                          server               Γöé
  2763. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2764. Γöéunsigned short        id                    Current packet id    Γöé
  2765. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2766. Γöéchar[MAXDNAME]        defdname              Default domain       Γöé
  2767. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2768. Γöéchar*[MAXDNSRCH+1]    dnsrch                Components of domain Γöé
  2769. Γöé                                            to search            Γöé
  2770. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2771.  
  2772. The options field of the _res data structure is constructed by logically ORing 
  2773. the following values: 
  2774.  
  2775. RES_INIT 
  2776.   Indicates whether the initial name server and default domain name have been 
  2777.   initialized (that is, whether the res_init() call has been called). 
  2778.  
  2779. RES_DEBUG 
  2780.   Prints debugging messages. 
  2781.  
  2782. RES_USEVC 
  2783.   Uses Transmission Control Protocol/Internet Protocol (TCP/IP) connections for 
  2784.   queries instead of User Datagram Protocol/Internet Protocol (UDP/IP). 
  2785.  
  2786. RES_STAYOPEN 
  2787.   Used with the RES_USEVC value, keeps the TCP/IP connection open between 
  2788.   queries. While UDP/IP is the mode normally used, TCP/IP mode and this option 
  2789.   are useful for programs that regularly perform many queries. 
  2790.  
  2791. RES_RECURSE 
  2792.   Sets the Recursion Desired bit for queries. This is the default. 
  2793.  
  2794. RES_DEFNAMES 
  2795.   Appends the default domain name to single-label queries. This is the default. 
  2796.  
  2797. These environment variables affect values related to the _res data structure: 
  2798.  
  2799. LOCALDOMAIN 
  2800.   Overrides the default local domain, which is read from the ETC\RESOLV.conf 
  2801.   file and stored in the defdname field of the _res data structure. 
  2802.  
  2803. RES_TIMEOUT 
  2804.   Overrides the default value of the retrans field of the _res data structure, 
  2805.   which is the value of the RES_TIMEOUT constant defined in the <RESOLV.H> 
  2806.   file. This value is the base timeout period in seconds between queries to the 
  2807.   name servers. After each failed attempt, the timeout period is doubled. The 
  2808.   timeout period is divided by the number of name servers defined. The minimum 
  2809.   timeout period is 1 second. 
  2810.  
  2811. RES_RETRY 
  2812.   Overrides the default value for the retry field of the _res data structure, 
  2813.   which is 4. This value is the number of times the resolver tries to query the 
  2814.   name servers before giving up. Setting RES_RETRY to 0 prevents the resolver 
  2815.   from querying the name servers. 
  2816.  
  2817. The res_send() call does not perform interactive queries and expects the name 
  2818. server to handle recursion. 
  2819.  
  2820.  
  2821. ΓòÉΓòÉΓòÉ 5.7. Ports ΓòÉΓòÉΓòÉ
  2822.  
  2823. A port is used to differentiate between multiple applications on a host using 
  2824. the same protocol (TCP or UDP).  It is an additional qualifier used by the 
  2825. system software to get data to the correct application. Physically, a port is a 
  2826. 16-bit integer.  Some ports are reserved for particular applications and are 
  2827. called well-known ports. Well-Known Port Assignments contains the well-known 
  2828. port assignments list. 
  2829.  
  2830.  
  2831. ΓòÉΓòÉΓòÉ 5.8. IP Multicasting ΓòÉΓòÉΓòÉ
  2832.  
  2833. This section presents general concepts as well as technical implementation 
  2834. details about IP multicasting. 
  2835.  
  2836. Multicasting enables a message to be transmitted to a group of hosts, instead 
  2837. of having to address and send the message to each group member individually. 
  2838. This reduces the traffic impact on networks with, for example, audio/video 
  2839. applications involving more than two participants. internet addressing provides 
  2840. for Class D addressing that is used for multicasting. 
  2841.  
  2842. Topics 
  2843.  
  2844.      Multicasting and the setsockopt() Call 
  2845.      A Socket Program Example 
  2846.  
  2847.  
  2848. ΓòÉΓòÉΓòÉ 5.8.1. Multicasting and the setsockopt() Call ΓòÉΓòÉΓòÉ
  2849.  
  2850. When a datagram socket is defined, the setsockopt() call can be used to modify 
  2851. it. In order to join or leave a multicast group, use the setsockopt() call with 
  2852. the IP_ADD_MEMBERSHIP or IP_DROP_MEMBERSHIP flags. The interface that is used 
  2853. and the group used are specified in an ip_mreq structure that contains the 
  2854. following fields: 
  2855.  
  2856. struct ip_mreq{
  2857.    struct in_addr imr_multiaddr;
  2858.    struct in_addr imr_interface;
  2859. }
  2860.  
  2861. The in_addr structure is defined as: 
  2862.  
  2863. struct in_addr{
  2864.    ulong s_addr;
  2865. }
  2866.  
  2867. A host group consists of zero or more IP hosts.  An IP datagram designated to a 
  2868. host group address will be delivered to all the current members of that group. 
  2869. A host group does not have a fixed membership.  Any IP multicast-capable hosts 
  2870. can join or leave a host group dynamically. 
  2871.  
  2872. To join or leave a host group, an application needs to specify a host group 
  2873. address, ranging from 224.0.0.2 to 239.255.255.255, and a network interface 
  2874. address.  (Note that 224.0.0.0 is reserved and 224.0.0.1 is permanently 
  2875. assigned to the all hosts group, which includes all hosts and routers 
  2876. participating in IP multicast.) It is possible to join the same host group on 
  2877. more than one network interface.  It is also possible for more than one 
  2878. application to join the same host group.  A host's IP module discards an 
  2879. incoming multicast datagram designated for a host group not joined on that 
  2880. incoming network interface, even though the same host group is joined on 
  2881. another network interface. 
  2882.  
  2883. In order to send to a multicasting group it is not necessary to join the 
  2884. groups. For receiving transmissions sent to a multicasting group membership is 
  2885. required. For multicast sending use an IP_MULTICAST_IF flag with the 
  2886. setsockopt() call. This specifies the interface to be used. 
  2887.  
  2888. An application can specify the time-to-live value of outgoing multicast 
  2889. datagrams.  The default value is one for all IP multicast datagrams.  An 
  2890. application can also specify whether a copy of the multicast datagram is looped 
  2891. back in the case where the host itself is a member of the destination host 
  2892. group.  By default, a copy of the multicast datagram is looped back. 
  2893.  
  2894. It may be necessary to call the setsockopt() call with the IP_MULTICAST_LOOP 
  2895. flag in order to control the loopback of multicast packets. By default, packets 
  2896. are delivered to all members of the multicast group including the sender, if it 
  2897. is a member. However, this can be disabled with the setsockopt() call using the 
  2898. IP_MULTICAST_LOOP flag. 
  2899.  
  2900. For hosts that attach to more than one network, an application can choose which 
  2901. interface is used for the initial transmission. Only one interface can be used 
  2902. for the initial transmission.  Further transmission to other networks is the 
  2903. responsibility of multicast routers.  Do not be confused by the interface where 
  2904. a host group joins the outgoing interface for multicast transmission.  The 
  2905. interface specified when joining or leaving a host group is mainly for 
  2906. receiving incoming multicast datagrams. An application can join one host group 
  2907. on one network interface but transmit data to the same host group by way of 
  2908. another interface. 
  2909.  
  2910. Currently multicast is supported only on UDP, so datagram sockets should be 
  2911. used to do multicast operations. One thing to consider is that using aliasing 
  2912. and multicasting together (with multiple processes) may give unexpected 
  2913. results, and the following limitations apply. 
  2914.  
  2915.     More than one socket can bind on Class D IP address (or mcast address) and 
  2916.      a common port; for example, two clients that want to receive the same 
  2917.      mcast packet. 
  2918.  
  2919.     These sockets must also set a socket option, SO_REUSEADDR. 
  2920.  
  2921. The setsockopt() call flags that are required for multicast communication and 
  2922. used with the IPPROTO_IP protocol level follow: 
  2923.  
  2924. IP_ADD_MEMBERSHIP 
  2925.   Joins a multicast group as specified in the optval parameter of type struct 
  2926.   ip_mreq. A maximum of 20 groups may be joined per socket. 
  2927.  
  2928. IP_DROP_MEMBERSHIP 
  2929.   Leaves a multicast group as specified in the optval parameter of type struct 
  2930.   ip_mreq. Only allowable for processes with UID=0. 
  2931.  
  2932. IP_MULTICAST_IF 
  2933.   Permits sending of multicast messages on an interface as specified in the 
  2934.   optval parameter of type struct in_addr. An address of INADDR_ANY 
  2935.   (0x000000000) removes the previous selection of an interface in the multicast 
  2936.   options. If no interface is specified then the interface leading to the 
  2937.   default route is used. 
  2938.  
  2939. IP_MULTICAST_LOOP 
  2940.   Sets multicast loopback, determining whether or not transmitted messages are 
  2941.   delivered to the sending host. An optval parameter of type uchar is used to 
  2942.   control loopback being on or off. 
  2943.  
  2944. IP_MULTICAST_TTL 
  2945.   Sets the time-to-live for multicast packets. An optval parameter of type 
  2946.   uchar is used to set this value between 0 and 255. 
  2947.  
  2948. The getsockopt() function can also be used with the multicast flags to obtain 
  2949. information about a particular socket: 
  2950.  
  2951. IP_MULTICAST_IF 
  2952.   Retrieves the interface's IP address. 
  2953.  
  2954. IP_MULTICAST_LOOP 
  2955.   Retrieves the specified looping mode from the multicast options. 
  2956.  
  2957. IP_MULTICAST_TTL 
  2958.   Retrieves the time-to-live in the multicast options. 
  2959.  
  2960. The following examples demonstrate the use of the setsockopt() call with the 
  2961. protocol level set to the Internet Protocol (IPPROTO_IP). 
  2962.  
  2963. To mark a socket for sending to a multicast group on a particular interface: 
  2964.  
  2965. struct ip_mreq imr;
  2966. setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &imr.imr_interface,
  2967. sizeof(struct
  2968. in_addr));
  2969.  
  2970. To disable the loopback on a socket: 
  2971.  
  2972. char loop = 0;
  2973. setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(uchar));
  2974.  
  2975. To allow address reuse for binding multiple multicast applications to the same 
  2976. IP group address: 
  2977.  
  2978. int on = 1;
  2979. setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int));
  2980.  
  2981. To join a multicast group for receiving: 
  2982.  
  2983. struct ip_mreq imr;
  2984. setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(struct
  2985. ip_mreq));
  2986.  
  2987. To leave a multicast group: 
  2988.  
  2989. struct ip_mreq imr;
  2990. setsockopt(s, IPPROTO_IP, IP_DROP_MEMBERSHIP, &imr, sizeof(struct
  2991. ip_mreq));
  2992.  
  2993.  
  2994. ΓòÉΓòÉΓòÉ 5.8.2. A Socket Program Example ΓòÉΓòÉΓòÉ
  2995.  
  2996. Following is an example of a socket application using IP multicasting. 
  2997.  
  2998. struct sockaddr_in *to = (struct sockaddr_in *)&group;  /* group address     */
  2999. struct sockaddr_in listen_addr;
  3000. struct ip_mreq imr;                          /* multicast request structure  */
  3001. struct in_addr ifaddr;                       /* multicast outgoing interface */
  3002. short  loop = 0;                             /* don't loop back              */
  3003. short  ttl = 16;                             /* multicast time-to-live       */
  3004.  
  3005.        sock_init();
  3006.  
  3007.        /* init */
  3008.        imr.imr_multiaddr.s_addr = 0xe0010101;     /* 224.1.1.1 */
  3009.        imr.imr_multiaddr.s_addr = htonl(imr.imr_multiaddr.s_addr);
  3010.        imr.imr_interface.s_addr = INADDR_ANY;
  3011.        imr.imr_interface.s_addr = htonl(imr.imr_interface.s_addr);
  3012.        ifaddr.s_addr = INADDR_ANY;
  3013.        ifaddr.s_addr = htonl(ifaddr.s_addr);
  3014.  
  3015.        bzero( (char *)&group, sizeof(struct sockaddr_in) );
  3016.        to->sin_len = sizeof(to);
  3017.        to->sin_family = AF_INET;
  3018.        to->sin_port = 1201;                     /* some port number */
  3019.        to->sin_port = htons(to->sin_port);
  3020.        to->sin_addr.s_addr = imr.imr_multiaddr.s_addr;
  3021.        listen_addr = (*to);
  3022.  
  3023.        sock = socket(AF_INET, SOCK_DGRAM, 0);
  3024.  
  3025.        if (sock <= 0)  {
  3026.        psock_errno("Bad socket");
  3027.        exit(1);
  3028.        }
  3029.  
  3030.        /* join group */
  3031.        if( setsockopt( sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
  3032.        &imr, sizeof(struct ip_mreq) ) == -1 )  {
  3033.        psock_errno( "can't join group" );
  3034.        exit(1);
  3035.        }
  3036.  
  3037.        /* set multicast options */
  3038.        if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF,
  3039.        &ifaddr, sizeof(ifaddr)) == -1) {
  3040.        perror ("can't set multicast source interface");
  3041.        exit(1);
  3042.        }
  3043.        if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, 1) == -1)) {
  3044.        psock_errno ("can't disable multicast loopback");
  3045.        exit(1);
  3046.        }
  3047.        if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 1) == -1)) {
  3048.        psock_errno ("can't set multicast ttl");
  3049.        exit(1);
  3050.        }
  3051.  
  3052.        /* bind to a group address */
  3053.        if (bind(sock, &listen_addr, sizeof(struct sockaddr_in)) != 0) {
  3054.        psock_errno("Binding multicast socket");
  3055.        exit(1);
  3056.        }
  3057.  
  3058.        .
  3059.        .
  3060.        .
  3061.  
  3062.        /* leave group */
  3063.        if( setsockopt( sock, IPPROTO_IP, IP_DROP_MEMBERSHIP,
  3064.        &imr, sizeof(struct ip_mreq) ) == -1 )  {
  3065.        psock_errno( "can't leave group" );
  3066.        exit(1);
  3067.        }
  3068.        .
  3069.        .
  3070.        .
  3071.  
  3072.  
  3073. ΓòÉΓòÉΓòÉ 5.9. Socket Secure Support ΓòÉΓòÉΓòÉ
  3074.  
  3075. OS/2 supports Socket Secure Support (SOCKS) Version 4. This section presents 
  3076. information about OS/2 SOCKSification. 
  3077.  
  3078. Topics 
  3079.  
  3080.      The SOCKS Server 
  3081.      The SOCKS Library 
  3082.  
  3083.  
  3084. ΓòÉΓòÉΓòÉ 5.9.1. The SOCKS Server ΓòÉΓòÉΓòÉ
  3085.  
  3086. A SOCKS server is a type of firewall that protects computers in a network from 
  3087. access by users outside that network. A SOCKS server is similar to a proxy 
  3088. gateway in that they both work as proxy agents but their approaches are 
  3089. different. 
  3090.  
  3091. OS/2 SOCKS support for TCP/IP applications allows client applications to 
  3092. interact with a SOCKS server. OS/2 SOCKSified DLLs get the necessary 
  3093. information from socks.cfg. The DLL checks to determine if the connection 
  3094. should go through SOCKS. If socks_flag is on in socks.env and socks.cfg 
  3095. indicates that the connection should go through socks, then the connection goes 
  3096. through SOCKS.  Otherwise, the connection does not go through SOCKS.  The 
  3097. following figure illustrates how a typical write() to a socket would appear. 
  3098.  
  3099.  
  3100. A Typical Write() to a SOCKS Server
  3101.  
  3102. With SOCKS support, client applications connect to the SOCKS server and then 
  3103. the SOCKS server connects to an external network. The SOCKS server verifies 
  3104. that a host name and user ID are allowed to access an internet. 
  3105.  
  3106. If you are using a SOCKS server, connect() will call Rconnect(). See connect() 
  3107. for information about the connect() call.  The following figure illustrates 
  3108. connect(). 
  3109.  
  3110.  
  3111. connect() Request
  3112.  
  3113. From the user's point of view (behind the firewall host within the local area 
  3114. network), there is no difference between running SOCKS and the regular client 
  3115. software on a host.  All connections at the application level appear to work 
  3116. the same, with the hidden difference that all traffic is passing through sockd 
  3117. on the firewall host.  This transparency is achieved through the Socks library 
  3118. routines. 
  3119.  
  3120. Connect requests are originated by a call to Rconnect() on the internal host. 
  3121. This causes sockd to establish a connection to the remote host and return a 
  3122. success or fail response.  At this point, the application can read and write to 
  3123. the socket connection to the firewall and sockd acts as a bridge between the 
  3124. local and external socket connections. 
  3125.  
  3126.  
  3127. ΓòÉΓòÉΓòÉ 5.9.2. The SOCKS Library ΓòÉΓòÉΓòÉ
  3128.  
  3129. The SOCKS library calls establish connections to sockd on the firewall and 
  3130. transmit information.  The sockd daemon performs the operation as if it were 
  3131. originating the request. Any data sockd receives from the external connection 
  3132. is then passed on to the original requestor.  To the internal host everything 
  3133. appears as usual, but to the external host sockd appears to be the originator 
  3134. of the communication. 
  3135.  
  3136. The SOCKS library routines pass all network connections to sockd, which is 
  3137. running on the firewall.  The functions that are provided are designated by the 
  3138. letter R preceding the name of the regular C library socket calls that they are 
  3139. replacing. The SOCKS routines take the same parameters as the original 
  3140. functions, with the exception of Rbind(). Rbind() has an additional parameter: 
  3141. the address of the remote host from which the connection is established. 
  3142.  
  3143. The following routines are supported: 
  3144.  
  3145. Routine            Parameters
  3146.  
  3147. Raccept            (int socket, struct sockaddr*addr, int addrlen) 
  3148.  
  3149. Rbind              (int socket, struct sockaddr*name, int namelen, struct 
  3150.                    sockaddr*remote) 
  3151.  
  3152. Rconnect           (int socket, struct sockaddr*name, int namelen) 
  3153.  
  3154. Rgethostbyname     (char *host) 
  3155.  
  3156. Rgetsockname       (int socket, struct sockaddr*name, int namelen) 
  3157.  
  3158. Rlisten            (int socket, int backlog) 
  3159.  
  3160. See the information for the regular calls in Protocol-Independent C Sockets 
  3161. API. 
  3162.  
  3163. The following figure shows how a gethostbyname() call works. 
  3164.  
  3165.  
  3166. gethostbyname
  3167.  
  3168. The following figure shows how an Rbind() request works. 
  3169.  
  3170.  
  3171. Rbind() Request
  3172.  
  3173.  
  3174. ΓòÉΓòÉΓòÉ 6. Sockets over Local IPC ΓòÉΓòÉΓòÉ
  3175.  
  3176. This section describes how sockets over Local Inter-Processor Communication 
  3177. (IPC) allow the programmer to communicate between applications on the same 
  3178. machine using the sockets API. Local IPC sockets are not bound to a network 
  3179. protocol but rather use the underlying host facilities to provide 
  3180. high-performance IPC. 
  3181.  
  3182. Topics 
  3183.  
  3184.      Getting Started with Sockets Over Local IPC 
  3185.      Local IPC Address Format 
  3186.  
  3187.  
  3188. ΓòÉΓòÉΓòÉ 6.1. Getting Started with Sockets Over Local IPC ΓòÉΓòÉΓòÉ
  3189.  
  3190. This section provides some basic information for getting started with sockets 
  3191. over Local IPC: 
  3192.  
  3193.     Use PF_OS2, or PF_UNIX for the protocol family 
  3194.  
  3195.     Use AF_OS2, or AF_UNIX for the address family 
  3196.  
  3197.     The following socket types are supported for the Local IPC domain: 
  3198.  
  3199.        -  Datagram (SOCK_DGRAM) 
  3200.        -  Stream (SOCK_STREAM) 
  3201.  
  3202.      The socket type is passed as a parameter to the socket() call. For 
  3203.      additional information, see Socket Types. 
  3204.  
  3205.     A unique text string is used as a name.  See Local IPC Address Format for 
  3206.      details. 
  3207.  
  3208.     If a connect() socket call is received without an explicit bind() call, an 
  3209.      implicit bind is automatically performed.  The application can use any 
  3210.      name, and a unique Local IPC name is generated by networking services. You 
  3211.      can retrieve the Local IPC name by using the getsockname() call. 
  3212.  
  3213.  
  3214. ΓòÉΓòÉΓòÉ 6.2. Local IPC Address Format ΓòÉΓòÉΓòÉ
  3215.  
  3216. A socket address in a local system is composed of three fields in the following 
  3217. sockaddr_un structure: length, address family, and path name. The structure is 
  3218. located in the <SYS\UN.H> header file: 
  3219.  
  3220. struct sockaddr_un {
  3221.     u_char  sun_len;             /* sockaddr len including null */
  3222.     u_char  sun_family;          /* AF_OS2 or AF_UNIX */
  3223.     char    sun_path[108];       /* path name */
  3224. };
  3225. struct sockaddr_un un;
  3226.  
  3227. The sun_family field is set to AF_OS2 or AF_UNIX. 
  3228.  
  3229. The sun_path field is the OS/2 Warp file and path name to be used as the 
  3230. address of the Local IPC socket. If the address is NULL, the bind call binds a 
  3231. unique local address to the socket descriptor s. Each address is a combination 
  3232. of address family (sun_family) and a character string (sun_path) no longer than 
  3233. 108 characters. 
  3234.  
  3235. Each socket must use a unique character string as its local name to bind a name 
  3236. to a socket. The name in sun_path should begin with "\socket\". 
  3237.  
  3238. For example, 
  3239.  
  3240. struct sockaddr_un un;
  3241. int sd;
  3242. sd = socket(PF_OS2, SOCK_STREAM, 0);
  3243. memset(&un, 0, sizeof(un);
  3244.  
  3245. un.sun_len = sizeof(un);
  3246. un.sun_family = AF_OS2;
  3247. strcpy(un.sun_path, "\socket\XYZ", 12);
  3248. bind(sd, (struct sockaddr *)&un, sizeof(un));
  3249.  
  3250.  
  3251. ΓòÉΓòÉΓòÉ 7. Sockets over NetBIOS ΓòÉΓòÉΓòÉ
  3252.  
  3253. This section describes the use of sockets with NetBIOS. Each application 
  3254. assigns itself one or more NetBIOS names for each adapter.  The NetBIOS 
  3255. protocol maintains a table of the names that a node is known by on the network. 
  3256. NetBIOS supports two types of names: unique and group. When the name is unique, 
  3257. the application binds the name and NetBIOS checks the network to ensure that 
  3258. the name is not already being used as a unique name. NetBIOS supports multicast 
  3259. by allowing applications to bind to a group name and communicate. 
  3260.  
  3261. Topics 
  3262.  
  3263.      Getting Started with Sockets Over NetBIOS 
  3264.      NetBIOS Address Format 
  3265.  
  3266.  
  3267. ΓòÉΓòÉΓòÉ 7.1. Getting Started with Sockets Over NetBIOS ΓòÉΓòÉΓòÉ
  3268.  
  3269. This section provides some basic information for getting started with sockets 
  3270. over NetBIOS: 
  3271.  
  3272.     Use PF_NETBIOS or PF_NB for the protocol family. 
  3273.  
  3274.     Use AF_NETBIOS or AF_NB for the address family. 
  3275.  
  3276.     The following socket types are supported for the NetBIOS domain: 
  3277.  
  3278.        -  Datagram (SOCK_DGRAM) 
  3279.        -  Sequenced packet (SOCK_SEQPACKET) 
  3280.  
  3281.       The socket type is passed as a parameter to the socket() call. For 
  3282.      additional information see Socket Types. 
  3283.  
  3284.     If a connect() socket call is received without an explicit bind() call, an 
  3285.      implicit bind is automatically performed.  In this case, the application 
  3286.      does not care about its own name, and a unique NetBIOS name is generated 
  3287.      by networking services. You can retrieve the NetBIOS name by using the 
  3288.      getsockname() call. 
  3289.  
  3290.     Applications using the NetBIOS communication domain can use sockets in 
  3291.      both a connection-oriented (sequenced packet) and connectionless 
  3292.      (datagram) mode. 
  3293.  
  3294.     A NetBIOS application on one workstation can use sockets to communicate 
  3295.      with an NCB NetBIOS application on a different workstation. 
  3296.  
  3297.  
  3298. ΓòÉΓòÉΓòÉ 7.2. NetBIOS Address Format ΓòÉΓòÉΓòÉ
  3299.  
  3300. A socket address in a NetBIOS address family is composed of the six fields in 
  3301. the following sockaddr_nb structure: length, address family, address type, a 
  3302. reserved field, adapter number, and NetBIOS name. This structure is located in 
  3303. the <NETNB\NB.H> header file: 
  3304.  
  3305. struct       sockaddr_nb {
  3306.     u_char   snb_len;                  /* sizeof(struct sockaddr_nb) */
  3307.     u_char   snb_family;               /* AF_NETBIOS */
  3308.     short    snb_type;                 /* 0:unique or 1:group */
  3309.     char     snb_nbnetid[NB_NETIDLEN]; /* NetBIOS netid */
  3310.     char     snb_name[NAMELEN];        /* NetBIOS name */
  3311. }
  3312.  
  3313. The length field (snb_len) is set to sizeof(struct sockaddr_nb). 
  3314.  
  3315. The family field (snb_family) is set to AF_NETBIOS or AF_NB. 
  3316.  
  3317. The address type field (snb_type) is used to specify the name as either a 
  3318. unique (NB_UNIQUE) or a group (NB_GROUP) name. 
  3319.  
  3320. The network identifier field (sub_netid) is used by the protocol stack to 
  3321. contain the NetBIOS netid, which is the logical adapter number that the name is 
  3322. associated with. 
  3323.  
  3324. The name field (snb_name) contains the 16-byte NetBIOS name, and is used as is. 
  3325.  
  3326. If a connect() socket call is received without an explicit bind() call, an 
  3327. implicit bind is automatically performed.  The application can use any name, 
  3328. and a unique NetBIOS name is generated by the system. A NetBIOS name is 
  3329. generated for this socket by converting the 6-byte MAC address to an ASCII hex 
  3330. string, and postpended with a 2-byte number that increments after each use. You 
  3331. can retrieve the NetBIOS name by using the getsockname() call. 
  3332.  
  3333. Note that for the NetBIOS domain, more than one socket can be bound to the same 
  3334. local address to establish multiple connections to one or more remote 
  3335. destinations. To enable this feature, the socket option SO_REUSEADDR must be 
  3336. set (see setsockopt()). In addition, you can bind more than one address to the 
  3337. same adapter. 
  3338.  
  3339.  
  3340. ΓòÉΓòÉΓòÉ 8. Windows Sockets Version 1.1 for OS/2 ΓòÉΓòÉΓòÉ
  3341.  
  3342. This section presents information for implementing OS/2 applications that use 
  3343. the Windows Sockets, or Winsock, API.  OS/2 supports two varieties of the 
  3344. Winsock API: one for use by 32-bit Developer API Extensions (Open32) 
  3345. applications, and another for use by 32-bit PM applications and 32-bit Command 
  3346. Line (VIO) applications. Except for the specific differences listed in this 
  3347. section, these implementations comply with the Windows Sockets Version 1.1 
  3348. specification, and corrections or amplifications as described in the draft 
  3349. Windows Sockets Version 2.0 specification. 
  3350.  
  3351. Topics 
  3352.  
  3353.      Overview 
  3354.      Blocking Hook Support 
  3355.      Asynchronous Functions 
  3356.      Differences between OS/2 WInsock and the Winsock 1.1 Specification 
  3357.      Using the Winsock 1.1 for OS/2 Trace Command and Trace Formatter 
  3358.      Where to Find Winsock Reference Information 
  3359.  
  3360.  
  3361. ΓòÉΓòÉΓòÉ 8.1. Overview ΓòÉΓòÉΓòÉ
  3362.  
  3363. Winsock for OS/2 consists of two DLLs: 
  3364.  
  3365. PMWSOCK.DLL for the 32-bit PM and 32-bit VIO environments 
  3366. DAPWSOCK.DLL for the Open32 environment 
  3367.  
  3368. Two header files, <PMWSOCK.H> and <WINSOCK.H>, which are tailored to the PM and 
  3369. Open32 environments respectively, are included. <PMWSOCK.H> is similar to 
  3370. <WINSOCK.H> but has changes to data types and function prototypes to 
  3371. accommodate PM.  <PMWSOCK.H> is also used by VIO applications. 
  3372.  
  3373.  
  3374. ΓòÉΓòÉΓòÉ 8.2. Blocking Hook Support ΓòÉΓòÉΓòÉ
  3375.  
  3376. Blocking hooks were introduced in Winsock to support Windows 3.x's 
  3377. non-preemptive multitasking.  When an application issues a blocking sockets 
  3378. call, Winsock starts processing the call and then enters a loop where it 
  3379. alternates between calling a blocking hook and checking to see if the socket 
  3380. call has completed or been cancelled. The blocking hook is responsible for 
  3381. dispatching messages to keep the system responsive while the socket call is 
  3382. processing. Blocking hooks are installed on a per-thread basis. 
  3383.  
  3384. In Win32 systems, blocking hooks aren't necessary because Win32 systems support 
  3385. preemptive multitasking.  Consequently, Win32 versions of Winsock do not 
  3386. provide a default blocking hook, and using blocking hooks is discouraged. 
  3387. Nonetheless, an application programmer can call WSASetBlockingHook to install 
  3388. one. 
  3389.  
  3390. In the OS/2 implementation of Winsock, when a call is made to a Winsock 
  3391. function that blocks and a blocking hook has been installed in that thread, a 
  3392. new thread is started to issue the socket call.  The original thread then 
  3393. starts spinning in a loop, alternating between calling the user's blocking-hook 
  3394. function and checking to see if the socket call has completed or has been 
  3395. cancelled.  A half-second sleep is inserted between each iteration of the loop 
  3396. to avoid consuming large amounts of CPU time.  When the socket call completes, 
  3397. or is cancelled, the new thread passes the results of the socket call to the 
  3398. original thread and then ends. 
  3399.  
  3400. When a call is made to a Winsock function that blocks and a blocking hook has 
  3401. not been installed for that thread, the socket call is issued directly and no 
  3402. threads are started. 
  3403.  
  3404.  
  3405. ΓòÉΓòÉΓòÉ 8.3. Asynchronous Functions ΓòÉΓòÉΓòÉ
  3406.  
  3407. Asynchronous functions were added to Winsock to make sockets friendlier to the 
  3408. GUI programmer. When an application issues an asynchronous Winsock call, 
  3409. Winsock starts processing the call and immediately returns to the caller. When 
  3410. the call completes, Winsock posts a message to the application's message queue 
  3411. to inform the application of the results of the function. 
  3412.  
  3413. For the OS/2 implementation of Winsock, asynchronous calls are handled 
  3414. similarly to the way blocking hooks are handled. Each call to an asynchronous 
  3415. Winsock function causes a secondary thread to issue the socket call.  The 
  3416. original thread then returns to the application. When the socket call returns, 
  3417. the secondary thread posts a message to the appropriate message queue. 
  3418.  
  3419. To avoid creating and terminating many threads, the asynchronous calls maintain 
  3420. a small pool of threads that are dedicated to servicing asynchronous calls. 
  3421. The threads are created as needed and are not terminated until the application 
  3422. ends.  When the application issues an asynchronous call, Winsock determines if 
  3423. there is a free thread in the pool.  If a free thread exists, Winsock uses it 
  3424. to service the call. If there is not a free thread in the pool, Winsock checks 
  3425. to see if the maximum number of threads that can fit in the pool has been 
  3426. started. If the maximum number of threads has not been started, Winsock starts 
  3427. a new thread, adds it to the pool, and has the new thread service the socket 
  3428. call. 
  3429.  
  3430. If no free threads are in the pool and the pool is filled to capacity, Winsock 
  3431. starts a new thread to service the call. After the call completes and the 
  3432. message has been posted, the new thread terminates. 
  3433.  
  3434.  
  3435. ΓòÉΓòÉΓòÉ 8.4. Differences between OS/2 WInsock and the Winsock 1.1 Specification ΓòÉΓòÉΓòÉ
  3436.  
  3437. This section describes the differences between the TCP/IP for OS/2 
  3438. implementation of Winsock and the Winsock 1.1 specification. 
  3439.  
  3440. WSASetLastError and WSAGetLastError APIs 
  3441.  
  3442. The Winsock specification states that on Win32 systems, WSAGetLastError and 
  3443. WSASetLastError will simply call the Win32 GetLastError and SetLastError 
  3444. functions.  For reasons of efficiency, the Open32 version of OS/2 Winsock 
  3445. implements these two calls internally and does not call GetLastError or 
  3446. SetLastError. Also because PM does not have a function that is equivalent to 
  3447. SetLastError, the PM version of Winsock also implements these calls internally. 
  3448.  
  3449. BSD Compatibility Files 
  3450.  
  3451. The Winsock 1.1 specification states that the standard <BSD NETDB.H>, 
  3452. <ARPA/INET.H>, <SYS/TIME.H>, <SYS/SOCKET.H>, and <NETINET/IN.H> header files 
  3453. should be supplied by Winsock implementations and should just include 
  3454. <WINSOCK.H>.  Because TCP/IP for OS/2 also supplies a BSD socket library, it 
  3455. does not comply with the specification in this regard.  If a developer includes 
  3456. any of those header files, the developer will get the BSD version of those 
  3457. header files, not the Winsock version. 
  3458.  
  3459. Calling Conventions 
  3460.  
  3461. In the Winsock 1.1 specification, Winsock calls are defined to use the PASCAL 
  3462. calling convention (the standard calling convention on Windows systems).  OS/2 
  3463. also has the PASCAL calling convention, but instead it uses APIENTRY as the 
  3464. standard calling convention. Because of this, OS/2 Winsock uses the APIENTRY 
  3465. convention for all of its Winsock calls. 
  3466.  
  3467. In the Open32 environment, PASCAL is defined (with #define) to be APIENTRY by 
  3468. <OS2WDEF.H>, which is part of Open32, so no changes are needed to <WINSOCK.H> 
  3469. to accommodate APIENTRY. 
  3470.  
  3471. In the PM and VIO environments, PASCAL and APIENTRY are two different calling 
  3472. conventions, so the Winsock function prototypes in <PMWSOCK.H> have been 
  3473. modified by replacing all occurrences of PASCAL with APIENTRY. 
  3474.  
  3475. Topics 
  3476.  
  3477.      Differences between <PMWSOCK.H> and Standard <WINSOCK.H> Header Files 
  3478.      Differences between IBM Open32 <WINSOCK.H> and Standard <WINSOCK.H> Header 
  3479.      Files 
  3480.  
  3481.  
  3482. ΓòÉΓòÉΓòÉ 8.4.1. Differences between <PMWSOCK.H> and Standard <WINSOCK.H> Header Files ΓòÉΓòÉΓòÉ
  3483.  
  3484. Following are the differences between <PMWSOCK.H> and standard <WINSOCK.H> 
  3485. header files: 
  3486.  
  3487.     <PMWSOCK.H> does not include (with #include) any header files. 
  3488.  
  3489.     The keyword FAR has been removed from all functions and pointers. 
  3490.  
  3491.     The keyword PASCAL has been removed from all of the prototypes and 
  3492.      replaced with APIENTRY. 
  3493.  
  3494.     The FARPROC type in the WSASetBlockingHook prototype has been replaced 
  3495.      with PFN. 
  3496.  
  3497.     The hostent, netent, servent, and protoent structures had several entries 
  3498.      that were defined as "short;" these have been widened to "int." The two 
  3499.      fields of the linger structure have been widened from "u_short" to "int." 
  3500.      These changes were made to comply with the definitions in the BSD header 
  3501.      files. 
  3502.  
  3503.     A bug in the IN_CLASSC macro has been corrected. 
  3504.  
  3505.     The CONST keyword for the buf parameter of the prototype for 
  3506.      WSAAsyncGetHostByAddr has been removed (it was an error). 
  3507.  
  3508.  
  3509. ΓòÉΓòÉΓòÉ 8.4.2. Differences between IBM Open32 <WINSOCK.H> and Standard <WINSOCK.H> Header Files ΓòÉΓòÉΓòÉ
  3510.  
  3511. Following are the differences between IBM Open32 and <WINSOCK.H>: 
  3512.  
  3513.     <WINSOCK.H> includes <OS2WIN.H> instead of <WINDOWS.H>. 
  3514.  
  3515.     The keyword FAR has been removed from all functions and pointers. 
  3516.  
  3517.     The hostent, netent, servent, and protoent structures had several entries 
  3518.      that were defined as "short."  These have been widened to "int." The two 
  3519.      fields of the linger structure have been widened from "u_short" to "int." 
  3520.      These changes were made to comply with the definitions in the BSD header 
  3521.      files. 
  3522.  
  3523.     A bug in the IN_CLASSC macro has been corrected. 
  3524.  
  3525.     The CONST keyword for the buf parameter of the prototype for 
  3526.      WSAAsyncGetHostByAddr has been removed (it was an error). 
  3527.  
  3528.  
  3529. ΓòÉΓòÉΓòÉ 8.5. Using the Winsock 1.1 for OS/2 Trace Command and Trace Formatter ΓòÉΓòÉΓòÉ
  3530.  
  3531. Winsock 1.1 for OS/2 includes tracing capability to aid Winsock developers in 
  3532. isolating problems related to one of the following: 
  3533.  
  3534.     The client application 
  3535.     The Winsock 1.1 DLL 
  3536.  
  3537. Topics 
  3538.  
  3539.      Sample Winsock Trace Output 
  3540.      WSTRACE Command 
  3541.      WSFORMAT Command 
  3542.  
  3543.  
  3544. ΓòÉΓòÉΓòÉ 8.5.1. Sample Winsock Trace Output ΓòÉΓòÉΓòÉ
  3545.  
  3546. Using the trace capability, developers can trace Winsock procedure calls and 
  3547. exits, parameter values, and return values.  Following is a sample of formatted 
  3548. Winsock trace output: 
  3549.  
  3550. Winsock Trace - Version 1   Trace Date 05/07/1996   Trace Time 14:04:51.28
  3551. Thread  TimeStamp  Winsock Function  (Parameters)
  3552. -------------------------------------------------------------------------------
  3553.  
  3554. 00001 14:04:51.35 WSAISBLOCKING Entry  ()
  3555. 00001 14:04:51.35 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3556. 00001 14:04:51.35 WSASTARTUP Exit  (wVersionRequired=101, lpWSADATA=4B00C Return=0)
  3557. 00001 14:04:51.35 GETHOSTNAME Entry ()
  3558. 00001 14:04:51.35 WSAISBLOCKING Entry  ()
  3559. 00001 14:04:51.35 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3560. 00001 14:04:51.35 GETHOSTNAME Exit (Return=0, Hostname=screamin)
  3561. 00001 14:04:51.38 INET_NTOA Entry  (in_addr=4263781641)
  3562. 00001 14:04:51.38 INET_NTOA Exit  (in_addr=4263781641, Return=9.37.36.254)
  3563. 00001 14:04:57.25 SOCKET Entry  (address family=2[af_inet], type=1[sock_stream], protocol=0[ip])
  3564. 00001 14:04:57.25 WSAISBLOCKING Entry  ()
  3565. 00001 14:04:57.25 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3566. 00001 14:04:57.25 SOCKET Exit  (address family=2[af_inet], type=1[sock_stream], protocol=0[ip] Return=187)
  3567. 00001 14:05:05.88 GETHOSTNAME Entry ()
  3568. 00001 14:05:05.88 WSAISBLOCKING Entry  ()
  3569. 00001 14:05:05.88 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3570. 00001 14:05:05.88 GETHOSTNAME Exit (Return=0, Hostname=screamin)
  3571. 00001 14:05:11.03 HTONS Entry  (host=0)
  3572. 00001 14:05:11.03 HTONS Exit  (host=0, Return=0)
  3573. 00001 14:05:11.03 BIND Entry  (socket=187, sockaddr struct[family=2 (af_inet), port=0, s_addr=9.37.36.254])
  3574. 00001 14:05:11.03 WSAISBLOCKING Entry  ()
  3575. 00001 14:05:11.03 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3576. 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)
  3577. 00001 14:05:19.31 CLOSESOCKET Entry  (Socket=187)
  3578. 00001 14:05:19.31 WSAISBLOCKING Entry  ()
  3579. 00001 14:05:19.31 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3580. 00001 14:05:19.31 CLOSESOCKET Exit  (Socket=187, Return=0)
  3581. 00001 14:05:28.91 WSACLEANUP Entry ()
  3582. 00001 14:05:28.91 WSAISBLOCKING Entry  ()
  3583. 00001 14:05:28.91 WSAISBLOCKING Exit  (False : No blocking call in progress)
  3584.  
  3585. The following sections provide details for using the Winsock 1.1 for OS/2 trace 
  3586. command and trace formatter. 
  3587.  
  3588.  
  3589. ΓòÉΓòÉΓòÉ 8.5.2. WSTRACE Command ΓòÉΓòÉΓòÉ
  3590.  
  3591. The WSTRACE command enables and disables Winsock tracing in an OS/2 session. 
  3592.  
  3593. Syntax 
  3594.  
  3595.               ΓöîΓöÇonΓöÇΓöÇΓöÉ
  3596. ΓöÇWSTRACEΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3597.               ΓööΓöÇoffΓöÇΓöÿ   Γö£ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3598.                         Γöé Γö£ΓöÇfilenameΓöÇΓöñ      Γöé
  3599.                         Γöé Γö£ΓöÇCOM1ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ      Γöé
  3600.                         Γöé Γö£ΓöÇCOM2ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ      Γöé
  3601.                         Γöé Γö£ΓöÇCOM3ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ      Γöé
  3602.                         Γöé ΓööΓöÇCOM4ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ      Γöé
  3603.                         Γöé      ΓöîΓöÇWSTRACEΓöÇΓöÇΓöÉ Γöé
  3604.                         ΓööΓöÇ -p ΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÿ
  3605.                                ΓööΓöÇpipenameΓöÇΓöÿ
  3606.  
  3607.       ΓöîΓöÇ64ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3608. ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3609.       ΓööΓöÇ -b buffsizeΓöÇΓöÿ
  3610.  
  3611. Parameters 
  3612.  
  3613. on 
  3614.   Turns tracing on.  This is the default. 
  3615.  
  3616. off 
  3617.   Turns tracing off. 
  3618.  
  3619. filename 
  3620.   Specifies the file name of the file that the trace output will be written to. 
  3621.   COM1, COM2, COM3, and COM4 may be used to direct the trace to a serial port. 
  3622.  
  3623. -p pipename 
  3624.   Specifies the pipe name of an OS/2 pipe that the trace output will be written 
  3625.   to. Pipe names do not have to include a \PIPE\ prefix. If pipename is not 
  3626.   specified with the -p parameter, the pipe name defaults to WSTRACE. 
  3627.  
  3628. -b buffsize 
  3629.   Specifies the size of the global trace buffer. If the -b parameter is not 
  3630.   specified, the buffer size defaults to 64 KB. 
  3631.  
  3632. Notes: 
  3633.  
  3634.   1. When neither filename nor pipename is specified, trace output is written 
  3635.      by default to the file WSTRACE.DMP in the local directory. 
  3636.  
  3637.   2. When a pipe or COM port is specified as the destination for tracing 
  3638.      information, start the WSFORMAT command in an OS/2 session on the 
  3639.      destination device before running the Winsock application to be traced. 
  3640.  
  3641.   3. When specifying a serial port as the Winsock trace device, be sure that 
  3642.      the serial port settings match on both ends of the line. The OS/2 MODE 
  3643.      command lets you set the serial port settings. For more information about 
  3644.      the MODE command, see the OS/2 Command Reference or enter: 
  3645.  
  3646.           help mode
  3647.      in an OS/2 session. 
  3648.  
  3649.  
  3650. ΓòÉΓòÉΓòÉ 8.5.3. WSFORMAT Command ΓòÉΓòÉΓòÉ
  3651.  
  3652. The WSFORMAT command is the Winsock trace formatter.  The WSFORMAT command 
  3653. accepts the binary trace input from a serial port, file, or OS/2 pipe, and 
  3654. converts the input into a readable format that can then be displayed on-screen 
  3655. or written to a file, serial port, or OS/2 pipe. 
  3656.  
  3657. Syntax 
  3658.  
  3659. ΓöÇWSFORMATΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3660.                Γö£ΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3661.                Γöé Γö£ΓöÇinput_filenameΓöÇΓöñ      Γöé
  3662.                Γöé Γö£ΓöÇCOM1ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ      Γöé
  3663.                Γöé Γö£ΓöÇCOM2ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ      Γöé
  3664.                Γöé Γö£ΓöÇCOM3ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ      Γöé
  3665.                Γöé ΓööΓöÇCOM4ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ      Γöé
  3666.                Γöé      ΓöîΓöÇWSTRACEΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé
  3667.                ΓööΓöÇ -p ΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÿ
  3668.                       ΓööΓöÇinput_pipenameΓöÇΓöÿ
  3669.  
  3670.       ΓöîΓöÇWSFORMAT.DMPΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3671. ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3672.       ΓööΓöÇ -f formatted_output_filenameΓöÇΓöÿ
  3673.  
  3674.       ΓöîΓöÇWSTRACE.DMPΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3675. ΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  3676.       ΓööΓöÇ -b binary_output_filenameΓöÇΓöÿ
  3677.  
  3678. Parameters 
  3679.  
  3680. input_filename 
  3681.   Specifies the file name of the input file containing the trace information to 
  3682.   format.  COM1, COM2, COM3, and COM4 may be used to accept trace data from a 
  3683.   serial port. 
  3684.  
  3685. -p input_pipename 
  3686.   Specifies the pipe name of the OS/2 pipe that contains the trace data to 
  3687.   format. Pipe names do not have to include a \PIPE\ prefix. If input_pipename 
  3688.   is not specified with the -p parameter, the pipe name defaults to WSTRACE. 
  3689.  
  3690. -f formatted_output_file 
  3691.   Specifies the file name of the file that the formatted trace output will be 
  3692.   written to. If formatted_output_file is not specified with the -f parameter, 
  3693.   the file name defaults to WSFORMAT.DMP in the current directory. 
  3694.  
  3695. -b binary_output_file 
  3696.   Specifies the file name of the file that will receive a copy of the binary 
  3697.   information being formatted.  This can be used to save a copy of the trace 
  3698.   information coming from a serial port or pipe. If binary_output_file is not 
  3699.   specified with the -b parameter, the output file name defaults to WSTRACE.DMP 
  3700.   in the local directory. 
  3701.  
  3702. Notes: 
  3703.  
  3704.   1. If the -f option is not specified, the formatted trace output is written 
  3705.      to the screen. 
  3706.  
  3707.   2. When specifying a serial port as the Winsock trace device, be sure that 
  3708.      the serial port settings match on both ends of the line. The OS/2 MODE 
  3709.      command lets you set the serial port settings. For more information about 
  3710.      the MODE command, see the OS/2 Command Reference or enter: 
  3711.  
  3712.           help mode
  3713.      in an OS/2 session. 
  3714.  
  3715.  
  3716. ΓòÉΓòÉΓòÉ 8.6. Where to Find Winsock Reference Information ΓòÉΓòÉΓòÉ
  3717.  
  3718. To obtain Winsock reference information, including socket and database routines 
  3719. and Microsoft Windows-specific extensions, consult the Windows Sockets 
  3720. specification. This specification is documented by authors from a number of 
  3721. corporations and is available from many places, including: 
  3722.  
  3723.     The IBM TCP/IP for OS/2 Programmer's Development Toolkit on the IBM 
  3724.      Developer's Connection CD-ROM ( Windows Sockets Version 1.1 only) 
  3725.  
  3726.     The Internet, at URL http://www.stardust.com ( Windows Sockets Version 1.1 
  3727.      only) 
  3728.  
  3729.     Directory /pub/winsock on host microdyne.com by way of anonymous ftp 
  3730.  
  3731. To be added to the Windows Sockets mailing list, address your request to 
  3732. winsock-request@microdyne.com. 
  3733.  
  3734.  
  3735. ΓòÉΓòÉΓòÉ 9. Remote Procedure Calls ΓòÉΓòÉΓòÉ
  3736.  
  3737. This section describes the high-level remote procedure calls (RPCs) implemented 
  3738. in TCP/IP for OS/2, including the RPC programming interface to the C language 
  3739. and communication between processes. 
  3740.  
  3741. Topics 
  3742.  
  3743.      The RPC Protocol 
  3744.      The RPC Interface 
  3745.      Remote Programs and Procedures 
  3746.      Portmapper 
  3747.      eXternal Data Representation (XDR) 
  3748.      The RPC Intermediate Layer 
  3749.      The RPC Lowest Layer 
  3750.      rpcgen Command 
  3751.      rpcinfo Command 
  3752.      The enum clnt_stat Structure 
  3753.      The Remote Procedure Call Library 
  3754.      Differences between OS/2 and Sun Microsystems RPCs 
  3755.      Compiling an RPC API Application 
  3756.  
  3757.  
  3758. ΓòÉΓòÉΓòÉ 9.1. The RPC Protocol ΓòÉΓòÉΓòÉ
  3759.  
  3760. The RPC protocol enables remote execution of subroutines across a TCP/IP 
  3761. network. RPC, together with the eXternal Data Representation (XDR) protocol, 
  3762. defines a standard for representing data that is independent of internal 
  3763. protocols or formatting. RPCs can communicate between processes on the same or 
  3764. different hosts. 
  3765.  
  3766. The RPC protocol enables users to work with remote procedures as if the 
  3767. procedures were local. The remote procedure calls are defined through routines 
  3768. contained in the RPC protocol.  Each call message is matched with a reply 
  3769. message. The RPC protocol is a message-passing protocol that implements other 
  3770. non-RPC protocols, such as batching and broadcasting remote calls.  The RPC 
  3771. protocol also supports callback procedures and the select subroutine on the 
  3772. server side. 
  3773.  
  3774. RPC provides an authentication process that identifies the server and client to 
  3775. each other.  RPC includes a slot for the authentication parameters on every 
  3776. remote procedure call so that the caller can identify itself to the server. The 
  3777. client package generates and returns authentication parameters. RPC supports 
  3778. various types of authentication, such as the UNIX systems. 
  3779.  
  3780. In RPC, each server supplies a program that is a set of procedures. The 
  3781. combination of a host address, a program number, and a procedure number 
  3782. specifies one remote service procedure. In the RPC model, the client makes a 
  3783. procedure call to send a data packet to the server. When the packet arrives, 
  3784. the server calls a dispatch routine, performs whatever service is requested, 
  3785. and sends a reply back to the client.  The procedure call then returns to the 
  3786. client. 
  3787.  
  3788. RPC is divided into two layers:  intermediate and lowest. Generally, you use 
  3789. the RPC interface to communicate between processes on different workstations in 
  3790. a network. However, RPC works just as well for communication between different 
  3791. processes on the same workstation. 
  3792.  
  3793. The Portmapper program maps RPC program and version numbers to a 
  3794. transport-specific port number. The Portmapper program makes dynamic binding of 
  3795. remote programs possible. 
  3796.  
  3797. To write network applications using RPC, programmers need a working knowledge 
  3798. of network theory and C programming language. For most applications, 
  3799. understanding the RPC mechanisms usually hidden by the RPCGEN protocol compiler 
  3800. is also helpful. However, RPCGEN makes understanding the details of RPC 
  3801. unnecessary. The figures in The RPC Interface give an overview of the 
  3802. high-level RPC client and server processes from initialization through cleanup. 
  3803. See the SAMPLES\RPC directory for sample RPC client, server, and raw data 
  3804. stream programs. RPCGEN samples are in the SAMPLES\RPCGEN directory. 
  3805.  
  3806. For more information about the RPC and XDR protocols, see the Sun Microsystems 
  3807. publication, Networking on the Sun Workstation: Remote Procedure Call 
  3808. Programming Guide , RFC 1057 and RFC 1014. 
  3809.  
  3810.  
  3811. ΓòÉΓòÉΓòÉ 9.2. The RPC Interface ΓòÉΓòÉΓòÉ
  3812.  
  3813. The RPC model is similar to the local procedure call model. In the local model, 
  3814. the caller places the argument to a procedure in a specified location such as a 
  3815. result register. Then, the caller transfers control to the procedure. The 
  3816. caller eventually regains control, extracts the results of the procedure, and 
  3817. continues the execution. 
  3818.  
  3819. RPC works in the same way: One thread of control winds logically through the 
  3820. caller and server processes as follows: 
  3821.  
  3822.   1. The caller process sends a call message that includes the procedure 
  3823.      parameters to the server process and then waits for a reply message 
  3824.      (blocks). 
  3825.  
  3826.   2. A process on the server side, which is dormant until the arrival of the 
  3827.      call message, extracts the procedure parameters, computes the results, and 
  3828.      sends a reply message.  Then the server waits for the next call message. 
  3829.  
  3830.   3. A process on the caller side receives the reply message and extracts the 
  3831.      results of the procedure. The caller then resumes the execution. 
  3832.  
  3833. See the following figures for an illustration of the RPC model: 
  3834.  
  3835.  
  3836. Remote Procedure Call (Client)
  3837.  
  3838.  
  3839. Remote Procedure Call (Server)
  3840.  
  3841.  
  3842. ΓòÉΓòÉΓòÉ 9.3. Remote Programs and Procedures ΓòÉΓòÉΓòÉ
  3843.  
  3844. The RPC call message has three unsigned fields: 
  3845.  
  3846.     Remote program number 
  3847.     Remote program version number 
  3848.     Remote procedure number 
  3849.  
  3850. The three fields uniquely identify the procedure to be called. The program 
  3851. number defines a group of related remote procedures, each of which has a 
  3852. different procedure number. Each program also has a version number. 
  3853.  
  3854. The central system authority administers the program number. A remote program 
  3855. number is assigned by groups of 0x20000000, as shown in the following list: 
  3856.  
  3857. Program Number          Description
  3858.  
  3859. 0-1xxxxxxx              Is predefined and administered by the OS/2 TCP/IP 
  3860.                         system. 
  3861.  
  3862. 20000000-3xxxxxxx       Represents the user defined numbers 
  3863.  
  3864. 40000000-5xxxxxxx       Represents transient numbers 
  3865.  
  3866. 60000000-7xxxxxxx       Reserved 
  3867.  
  3868. 80000000-9xxxxxxx       Reserved 
  3869.  
  3870. a0000000-bxxxxxxx       Reserved 
  3871.  
  3872. c0000000-dxxxxxxx       Reserved 
  3873.  
  3874. e0000000-fxxxxxxx       Reserved 
  3875.  
  3876.  
  3877. ΓòÉΓòÉΓòÉ 9.4. Portmapper ΓòÉΓòÉΓòÉ
  3878.  
  3879. This section describes the Portmapper service and its uses. 
  3880.  
  3881. Topics 
  3882.  
  3883.      Portmapper Protocol 
  3884.      Registering and Unregistering a Port with Portmapper 
  3885.      Contacting Portmapper 
  3886.      Portmapper Procedures 
  3887.  
  3888.  
  3889. ΓòÉΓòÉΓòÉ 9.4.1. Portmapper Protocol ΓòÉΓòÉΓòÉ
  3890.  
  3891. The Portmapper protocol defines a network service that clients use to look up 
  3892. the port number of any remote program supported by the server. The client 
  3893. programs must find the port numbers of the server programs that they intend to 
  3894. use. 
  3895.  
  3896. The Portmapper program: 
  3897.  
  3898.     Maps RPC program and version numbers to transport specific port numbers. 
  3899.  
  3900.     Enables dynamic binding of remote programs. This is desirable because the 
  3901.      range of reserved port numbers is small, and the number of potential 
  3902.      remote programs is large. When running only the Portmapper program on a 
  3903.      reserved port, you can determine the port numbers of other remote programs 
  3904.      by querying Portmapper. 
  3905.  
  3906.     Supports both the UDP and TCP protocols. 
  3907. The RPC client contacts Portmapper on port number 111 on either of these 
  3908. protocols. 
  3909.  
  3910.  
  3911. ΓòÉΓòÉΓòÉ 9.4.2. Registering and Unregistering a Port with Portmapper ΓòÉΓòÉΓòÉ
  3912.  
  3913. Portmapper is the only network service that must have a dedicated port (111). 
  3914. Other RPC network services can be assigned port numbers statically or 
  3915. dynamically, if the services register their ports with the host's local 
  3916. Portmapper. The RPC server can register or unregister their services by using 
  3917. the following calls: 
  3918.  
  3919. svc_register()        Associates a program with the service dispatch routine 
  3920.  
  3921. svc_unregister()      Removes all local mappings to dispatch routines and port 
  3922.                       numbers 
  3923.  
  3924. registerrpc()         Registers a procedure with the local Portmapper and 
  3925.                       creates a control structure to remember the server 
  3926.                       procedure and its XDR routine 
  3927.  
  3928.  
  3929. ΓòÉΓòÉΓòÉ 9.4.3. Contacting Portmapper ΓòÉΓòÉΓòÉ
  3930.  
  3931. To find the port of a remote program, the client sends an RPC request to 
  3932. well-known port 111 of the server's host. If Portmapper has a port number entry 
  3933. for the remote program, Portmapper provides the port number in the RPC reply. 
  3934. The client then requests the remote program by sending an RPC request to the 
  3935. port number provided by Portmapper. 
  3936.  
  3937. Clients can save port numbers of recently called remote programs to avoid 
  3938. having to contact Portmapper for each request to a server. 
  3939.  
  3940. RPC also provides the following calls for interfacing with Portmapper: 
  3941.  
  3942. Call                  Description
  3943.  
  3944. pmap_getmaps()        Returns a list of current program-to-port mappings on the 
  3945.                       foreign host 
  3946.  
  3947. pmap_getport()        Returns the port number associated with the remove 
  3948.                       program, version, and transport protocol 
  3949.  
  3950. pmap_rmtcall()        Instructs Portmapper to make an RPC call to a procedure 
  3951.                       on the host 
  3952.  
  3953. pmap_set()            Sets the mapping of a program to a port on the local 
  3954.                       machine 
  3955.  
  3956. pmap_unset()          Removes mappings associated with the program and version 
  3957.                       number on the local machine 
  3958.  
  3959. xdr_pmap()            Translates an RPC procedure identification 
  3960.  
  3961. xdr_pmaplist()        Translates a variable number of RPC procedure 
  3962.                       identifications 
  3963.  
  3964.  
  3965. ΓòÉΓòÉΓòÉ 9.4.4. Portmapper Procedures ΓòÉΓòÉΓòÉ
  3966.  
  3967. The Portmapper program supports the following procedures: 
  3968.  
  3969. Procedure               Description
  3970.  
  3971. PMAPPROC_NULL           Has no parameters. A caller can use the return code to 
  3972.                         determine if Portmapper is running. 
  3973.  
  3974. PMAPPROC_SET            Registers itself with the Portmapper program on the 
  3975.                         same machine. It passes the: 
  3976.  
  3977.                             Program number 
  3978.                             Program version number 
  3979.                             Transport protocol number 
  3980.                             Port number 
  3981.  
  3982.                         The procedure has successfully established the mapping 
  3983.                         if the return value is TRUE. The procedure does not 
  3984.                         establish a mapping if one already exists. 
  3985.  
  3986. PMAPPROC_UNSET          Unregisters the program and version numbers with 
  3987.                         Portmapper on the same machine. 
  3988.  
  3989. PMAPPROC_GETPORT        Returns the port number when given a program number, 
  3990.                         version number, and transport protocol number. A port 
  3991.                         value of 0 indicates the program has not been 
  3992.                         registered. 
  3993.  
  3994. PMAPPROC_DUMP           Takes no input, but returns a list of program, version, 
  3995.                         protocol, and port numbers. 
  3996.  
  3997. PMAPPROC_CALLIT         Allows a caller to call another remote procedure on the 
  3998.                         same machine without knowing the remote procedure's 
  3999.                         port number. The PMAPPROC_CALLIT procedure sends a 
  4000.                         response only if the procedure is successfully run. 
  4001.  
  4002.  
  4003. ΓòÉΓòÉΓòÉ 9.5. eXternal Data Representation (XDR) ΓòÉΓòÉΓòÉ
  4004.  
  4005. This section describes the eXternal Data Representation (XDR) standard and its 
  4006. use. 
  4007.  
  4008. Topics 
  4009.  
  4010.      The XDR Standard 
  4011.      Basic Block Size 
  4012.      The XDR Subroutine Format 
  4013.      XDR Data Types and their Filter Primitives 
  4014.      XDR Filter Primitives 
  4015.      XDR Nonfilter Primitives 
  4016.  
  4017.  
  4018. ΓòÉΓòÉΓòÉ 9.5.1. The XDR Standard ΓòÉΓòÉΓòÉ
  4019.  
  4020. An eXternal Data Representation (XDR) is a data representation standard that is 
  4021. independent of languages, operating systems, manufacturers, and hardware 
  4022. architecture. This standard enables networked computers to share data 
  4023. regardless of the machine on which the data is produced or consumed. The XDR 
  4024. language permits transfer of data between diverse computer architectures. 
  4025.  
  4026. An XDR approach to standardizing data representations is canonical. That is, 
  4027. XDR defines a single byte (big endian), a single floating-point representation 
  4028. (IEEE), and so on. Any program running on any machine can use XDR to create 
  4029. portable data by translating its local representation to the XDR standards. 
  4030. Similarly, any program running on any machine can read portable data by 
  4031. translating the XDR standard representations to its local equivalents. 
  4032.  
  4033. The XDR standard is the backbone of the RPC, because data for remote procedure 
  4034. calls is sent using the XDR standard. 
  4035.  
  4036. To use XDR routines, C programs must include the <RPC\XDR.H> header file, which 
  4037. is automatically included by the <RPC\RPC.H> header file. 
  4038.  
  4039.  
  4040. ΓòÉΓòÉΓòÉ 9.5.2. Basic Block Size ΓòÉΓòÉΓòÉ
  4041.  
  4042. The XDR language is based on the assumption that bytes (an octet) can be ported 
  4043. to, and encoded on, media that preserve the meaning of the bytes across the 
  4044. hardware boundaries of data. XDR does not represent bit fields or bit maps; it 
  4045. represents data in blocks of multiples of 4 bytes (32 bits). If the bytes 
  4046. needed to contain the data are not a multiple of four, enough (1 to 3) bytes to 
  4047. make the total byte count a multiple of four follow the n bytes. The bytes are 
  4048. read from, or written to, a byte stream in order. The order dictates that byte 
  4049. m precedes m+1. Bytes are ported and encoded from low order to high order in 
  4050. local area networks (LANs). Representing data in standardized formats resolves 
  4051. situations that occur when different byte-ordering formats exist on networked 
  4052. machines. This also enables machines with different structure-alignment 
  4053. algorithms to communicate with each other. 
  4054.  
  4055.  
  4056. ΓòÉΓòÉΓòÉ 9.5.3. The XDR Subroutine Format ΓòÉΓòÉΓòÉ
  4057.  
  4058. An XDR routine is associated with each data type. XDR routines have the 
  4059. following format: 
  4060.  
  4061. xdr_xxx(xdrs,dp)
  4062.           XDR *xdrs;
  4063.           xxx *dp;
  4064. {
  4065. }
  4066.  
  4067. The routine has the following parameters: 
  4068.  
  4069. xxx 
  4070.   XDR data type. 
  4071.  
  4072. xdrs 
  4073.   Opaque handle that points to an XDR stream. The system passes the opaque 
  4074.   handle pointer to the primitive XDR routines. 
  4075.  
  4076. dp 
  4077.   Address of the data value that is to be encoded or decoded. 
  4078.  
  4079. If they succeed, the XDR routines return a value of 1; if they do not succeed, 
  4080. they return a value of 0. 
  4081.  
  4082.  
  4083. ΓòÉΓòÉΓòÉ 9.5.4. XDR Data Types and their Filter Primitives ΓòÉΓòÉΓòÉ
  4084.  
  4085. The XDR standard defines basic and constructed data types. The XDR filter 
  4086. primitives are routines that define the basic and constructed data types. The 
  4087. XDR language provides RPC programmers with a specification for uniform 
  4088. representation that includes filter primitives for basic and constructed data 
  4089. types. 
  4090.  
  4091. The basic data types include: 
  4092.  
  4093.     Integers 
  4094.     Enumeration 
  4095.     Booleans 
  4096.     Floating point decimals 
  4097.     Void 
  4098.     Constants 
  4099.     Typedef 
  4100.     Optional data 
  4101.  
  4102. The constructed data types include: 
  4103.  
  4104.     Arrays 
  4105.     Opaque data 
  4106.     Strings 
  4107.     Byte arrays 
  4108.     Structures 
  4109.     Discriminated unions 
  4110.     Pointers 
  4111.  
  4112.  
  4113. ΓòÉΓòÉΓòÉ 9.5.5. XDR Filter Primitives ΓòÉΓòÉΓòÉ
  4114.  
  4115. The XDR standard translates both basic and constructed data types. For basic 
  4116. data types such as integer, XDR provides basic filter primitives that: 
  4117.  
  4118.     Serialize information from the local host's representation to XDR 
  4119.      representation 
  4120.  
  4121.     Deserialize information from the XDR representation to the local host's 
  4122.      representation 
  4123.  
  4124. For constructed data types, XDR provides constructed filter primitives that 
  4125. allow the use of basic data types (such as integers and floating-point numbers) 
  4126. to create more complex constructs (such as arrays and discriminated unions). 
  4127.  
  4128. Topics 
  4129.  
  4130.      Integer Filter Primitives 
  4131.      Enumeration Filter Primitives 
  4132.      Floating-Point Filter Primitives 
  4133.      Opaque Data Filter Primitive 
  4134.      Array Filter Primitives 
  4135.      String Filter Primitives 
  4136.      Primitive for Pointers to Structures 
  4137.      Primitive for Discriminated Unions 
  4138.      Passing Routines without Data 
  4139.  
  4140.  
  4141. ΓòÉΓòÉΓòÉ 9.5.5.1. Integer Filter Primitives ΓòÉΓòÉΓòÉ
  4142.  
  4143. The XDR filters cover signed and unsigned integers, as well as signed and 
  4144. unsigned short and long integers. 
  4145.  
  4146. The routines for XDR integer filters are: 
  4147.  
  4148. Routine          Description
  4149.  
  4150. xdr_int()        Translates between C integers and their external 
  4151.                  representations 
  4152.  
  4153. xdr_u_int()      Translates between C unsigned integers and their external 
  4154.                  representations 
  4155.  
  4156. xdr_long()       Translates between C long integers and their external 
  4157.                  representations 
  4158.  
  4159. xdr_u_long()     Translates between C unsigned long integers and their external 
  4160.                  representations 
  4161.  
  4162. xdr_short()      Translates between C short integers and their external 
  4163.                  representations 
  4164.  
  4165. xdr_u_short()    Translates between C unsigned short integers and their 
  4166.                  external representations 
  4167.  
  4168.  
  4169. ΓòÉΓòÉΓòÉ 9.5.5.2. Enumeration Filter Primitives ΓòÉΓòÉΓòÉ
  4170.  
  4171. The XDR library provides a primitive for generic enumerations based on the 
  4172. assumption that a C enumeration value (enum) has the same representation. A 
  4173. special enumeration in XDR, known as the Boolean, provides a value of 0 or 1 
  4174. represented internally in a binary notation. 
  4175.  
  4176. The routines for the XDR library enumeration filters are: 
  4177.  
  4178. Routine         Description
  4179.  
  4180. xdr_enum()      Translates between C language enums and their external 
  4181.                 representations 
  4182.  
  4183. xdr_bool()      Translates between Booleans and their external representations 
  4184.  
  4185.  
  4186. ΓòÉΓòÉΓòÉ 9.5.5.3. Floating-Point Filter Primitives ΓòÉΓòÉΓòÉ
  4187.  
  4188. The XDR library provides primitives that translate between floating-point data 
  4189. and their external representations. Floating-point data encodes an integer with 
  4190. an exponent. Floats and double-precision numbers compose floating-point data. 
  4191.  
  4192. Note:  Numbers are represented as Institute of Electrical and Electronics 
  4193.        Engineers (IEEE) standard floating points. Routines might fail when 
  4194.        decoding IEEE representations into machine specific representations. 
  4195.  
  4196. The routines for the XDR floating-point filters are: 
  4197.  
  4198. Routine         Description
  4199.  
  4200. xdr_float()     Translates between C language floats and their external 
  4201.                 representations 
  4202.  
  4203. xdr_double()    Translates between C language double-precision numbers and 
  4204.                 their external representations 
  4205.  
  4206.  
  4207. ΓòÉΓòÉΓòÉ 9.5.5.4. Opaque Data Filter Primitive ΓòÉΓòÉΓòÉ
  4208.  
  4209. Opaque data is composed of bytes of a fixed size that are not interpreted as 
  4210. they pass through the data streams. Opaque data bytes, such as handles, are 
  4211. passed between server and client without being inspected by the client. The 
  4212. client uses the data as it is and then returns it to the server. By definition, 
  4213. the actual data contained in the opaque object is not portable between 
  4214. computers. 
  4215.  
  4216. The XDR library includes the following routine for opaque data: 
  4217.  
  4218. Routine         Description
  4219. xdr_opaque()    Translates between opaque data and its external representation 
  4220.  
  4221.  
  4222. ΓòÉΓòÉΓòÉ 9.5.5.5. Array Filter Primitives ΓòÉΓòÉΓòÉ
  4223.  
  4224. Arrays are constructed filter primitives that can be generic arrays or byte 
  4225. arrays. The XDR library provides filter primitives for handling both types of 
  4226. arrays. 
  4227.  
  4228.  
  4229. ΓòÉΓòÉΓòÉ 9.5.5.5.1. Generic Arrays ΓòÉΓòÉΓòÉ
  4230.  
  4231. These consist of arbitrary elements. You use them in much the same way as byte 
  4232. arrays. The primitive for generic arrays requires an additional parameter to 
  4233. define the size of the element in the array and to call an XDR routine to 
  4234. encode or decode each element in the array. 
  4235.  
  4236. The XDR library includes the following routines for generic arrays: 
  4237.  
  4238. Routine         Description
  4239.  
  4240. xdr_array()     Translates between variable-length arrays and their 
  4241.                 corresponding external representations 
  4242.  
  4243. xdr_vector()    Translates between fixed-length arrays and their corresponding 
  4244.                 external representations 
  4245.  
  4246.  
  4247. ΓòÉΓòÉΓòÉ 9.5.5.5.2. Byte Arrays ΓòÉΓòÉΓòÉ
  4248.  
  4249. These differ from strings by having a byte count. That is, the length of the 
  4250. array is set to an unsigned integer. They also differ in that byte arrays do 
  4251. not end with a null character. The XDR library provides a primitive for byte 
  4252. arrays. External and internal representations of byte arrays are the same. 
  4253.  
  4254. The XDR library includes the following routine for byte arrays: 
  4255.  
  4256. Routine         Description
  4257. xdr_bytes()     Translates between counted byte string arrays and their 
  4258.                 external representations 
  4259.  
  4260.  
  4261. ΓòÉΓòÉΓòÉ 9.5.5.6. String Filter Primitives ΓòÉΓòÉΓòÉ
  4262.  
  4263. A string is a constructed filter primitive that consists of a sequence of bytes 
  4264. terminated by a null byte. The null byte does not figure into the length of the 
  4265. string. Externally, strings are represented by a sequence of American Standard 
  4266. Code Information Interchange (ASCII) characters. Internally, XDR represents 
  4267. them as pointers to characters with the designation char *. 
  4268.  
  4269. The XDR library includes primitives for the following string routines: 
  4270.  
  4271. Routine             Description
  4272.  
  4273. xdr_string()        Translates between C language strings and their external 
  4274.                     representations 
  4275.  
  4276. xdr_wrapstring()    Calls the xdr_string subroutine 
  4277.  
  4278.  
  4279. ΓòÉΓòÉΓòÉ 9.5.5.7. Primitive for Pointers to Structures ΓòÉΓòÉΓòÉ
  4280.  
  4281. The XDR library provides the primitive for pointers so that structures 
  4282. referenced within other structures can be easily serialized, deserialized, and 
  4283. released. 
  4284.  
  4285. The XDR library includes the following routine for pointers to structures: 
  4286.  
  4287. Routine             Description
  4288.  
  4289. xdr_reference()     Provides pointer chasing within structures 
  4290.  
  4291.  
  4292. ΓòÉΓòÉΓòÉ 9.5.5.8. Primitive for Discriminated Unions ΓòÉΓòÉΓòÉ
  4293.  
  4294. A discriminated union is a C language union, which is an object that holds 
  4295. several data types.  One arm of the union contains an enumeration value 
  4296. (enum_t), or discriminant, that holds a specific object to be processed over 
  4297. the system first. 
  4298.  
  4299. The XDR library includes the following routine for discriminated unions: 
  4300.  
  4301. Routine         Description
  4302. xdr_union()     Translates between discriminated unions and their external 
  4303.                 representations 
  4304.  
  4305.  
  4306. ΓòÉΓòÉΓòÉ 9.5.5.9. Passing Routines without Data ΓòÉΓòÉΓòÉ
  4307.  
  4308. Sometimes an XDR routine must be supplied to the RPC system, but no data is 
  4309. required or passed. The XDR library provides the following primitive for this 
  4310. function: 
  4311.  
  4312. Routine         Description
  4313. xdr_void()      Supplies an XDR subroutine to the RPC system without sending 
  4314.                 data 
  4315.  
  4316.  
  4317. ΓòÉΓòÉΓòÉ 9.5.6. XDR Nonfilter Primitives ΓòÉΓòÉΓòÉ
  4318.  
  4319. Use the XDR nonfilter primitives to create, manipulate, implement, and destroy 
  4320. XDR data streams. These primitives allow you to: 
  4321.  
  4322.     Describe the data stream position 
  4323.     Change the data stream position 
  4324.     Destroy a data stream 
  4325.  
  4326. Topics 
  4327.  
  4328.      Creating and Using XDR Data Streams 
  4329.      Manipulating an XDR Data Stream 
  4330.      Implementing an XDR Data Stream 
  4331.      Destroying an XDR Data Stream 
  4332.  
  4333.  
  4334. ΓòÉΓòÉΓòÉ 9.5.6.1. Creating and Using XDR Data Streams ΓòÉΓòÉΓòÉ
  4335.  
  4336. You get XDR data streams by calling creation routines that take arguments 
  4337. specifically designed for the properties of the stream. There are existing XDR 
  4338. data streams for serializing or deserializing data in standard input and output 
  4339. streams, memory streams, and record streams. 
  4340.  
  4341. Note:  RPC clients do not have to create XDR streams, because the RPC system 
  4342.        creates and passes these streams to the client. 
  4343.  
  4344. The types of data streams include: 
  4345.  
  4346.     Standard I/O streams 
  4347.     Memory streams 
  4348.     Record streams 
  4349.  
  4350.  
  4351. ΓòÉΓòÉΓòÉ 9.5.6.1.1. Standard I/O Streams ΓòÉΓòÉΓòÉ
  4352.  
  4353. XDR data streams serialize and deserialize standard input/output( I/O) by 
  4354. calling the standard I/O creation routine to initialize the XDR data stream 
  4355. pointed to by the xdrs parameter. 
  4356.  
  4357. The XDR library includes the following routine for standard I/O data streams: 
  4358.  
  4359. Routine                 Description
  4360. xdrstdio_create()       Initializes the XDR data stream pointed to by the xdrs 
  4361.                         parameter 
  4362.  
  4363.  
  4364. ΓòÉΓòÉΓòÉ 9.5.6.1.2. Memory Streams ΓòÉΓòÉΓòÉ
  4365.  
  4366. XDR data streams serialize and deserialize data from memory by calling the XDR 
  4367. memory creation routine to initialize, in local memory, the XDR stream pointed 
  4368. at by the xdrs parameter. In RPC, the UDP/IP implementation of remote procedure 
  4369. calls uses this routine to build entire call and reply messages in memory 
  4370. before sending the message to the recipient. 
  4371.  
  4372. The XDR library includes the following routine for memory data streams: 
  4373.  
  4374. Routine                 Description
  4375. xdrmem_create()         Initializes, in local memory, the XDR stream pointed to 
  4376.                         by the xdrs parameter 
  4377.  
  4378.  
  4379. ΓòÉΓòÉΓòÉ 9.5.6.1.3. Record Streams ΓòÉΓòÉΓòÉ
  4380.  
  4381. Record streams are XDR streams built on top of record fragments, which are 
  4382. built on TCP/IP streams. TCP/IP is a connection protocol for transporting large 
  4383. streams of data at one time rather than transporting a single data packet at a 
  4384. time. 
  4385.  
  4386. The primary use of a record stream is to interface remote procedure calls to 
  4387. TCP connections.  It can also be used to stream data into or out of normal 
  4388. files. 
  4389.  
  4390. XDR provides the following routines for use with record streams: 
  4391.  
  4392. Routine                       Description
  4393.  
  4394. xdrrec_create()               Provides an XDR stream that can contain long 
  4395.                               sequences of records 
  4396.  
  4397. xdrrec_endofrecord()          Causes the current outgoing data to be marked as 
  4398.                               a record 
  4399.  
  4400. xdrrec_skiprecord()           Causes the position of an input stream to move to 
  4401.                               the beginning of the next record 
  4402.  
  4403. xdrrec_eof()                  Checks the buffer for an input stream that 
  4404.                               identifies the end of file (EOF) 
  4405.  
  4406.  
  4407. ΓòÉΓòÉΓòÉ 9.5.6.2. Manipulating an XDR Data Stream ΓòÉΓòÉΓòÉ
  4408.  
  4409. XDR provides the following routines for describing the data stream position and 
  4410. changing the data stream position: 
  4411.  
  4412. Routine             Description
  4413.  
  4414. xdr_getpos()        Returns an unsigned integer that describes the current 
  4415.                     position in the data stream 
  4416.  
  4417. xdr_setpos()        Changes the current position in the XDR stream 
  4418.  
  4419.  
  4420. ΓòÉΓòÉΓòÉ 9.5.6.3. Implementing an XDR Data Stream ΓòÉΓòÉΓòÉ
  4421.  
  4422. You can create and implement XDR data streams. The following example shows the 
  4423. abstract data types (XDR handle) required for you to implement your own XDR 
  4424. streams. They contain operations applied to the stream (an operation vector for 
  4425. the particular implementation) and two private fields for using that 
  4426. implementation. 
  4427.  
  4428. enum xdr_op  { XDR_ENCODE=0, XDR_DECODE=1, XDR_FREE=2 };
  4429. typedef struct xdr {
  4430.         enum xdr_op  x_op;
  4431.         struct xdr_ops {
  4432.                bool_t  (*x_getlong)(struct xdr *, long *);
  4433.                bool_t  (*x_putlong)(struct xdr *, long *);
  4434.                bool_t  (*x_getbytes)(struct xdr *, caddr_t, u_int);
  4435.         /* get some bytes from " */
  4436.                bool_t  (*x_putbytes)(struct xdr *, caddr_t, u_int);
  4437.         /* put some bytes to " */
  4438.                u_int   (*x_getpostn)(struct xdr *);
  4439.                bool_t  (*x_setpostn)(struct xdr *,u_int);
  4440.                long *  (*x_inline)(struct xdr *,u_int);
  4441.                void    (*x_destroy)(struct xdr *);
  4442.         } *x_ops;
  4443.         caddr_t         x_public;
  4444.         caddr_t         x_private;
  4445.         caddr_t         x_base;
  4446.         int             x_handy;
  4447. } XDR;
  4448.  
  4449. The following parameters are pointers to XDR stream manipulation routines: 
  4450.  
  4451. Parameter           Description
  4452. x_getlong           Gets long integer values from the data stream. 
  4453. x_putlong           Puts long integer values into the data stream. 
  4454. x_getbytes          Gets bytes from the data streams. 
  4455. x_putbytes          Puts bytes into the data streams. 
  4456. x_getpostn          Returns the stream offset. 
  4457. x_setpostn          Repositions the offset. 
  4458. x_inline            Points to an internal data buffer, used for any purpose. 
  4459. x_destroy           Frees the private data structure. 
  4460. x_ops               Specifies the current operation being performed on the 
  4461.                     stream. This field is important to the XDR primitives, but 
  4462.                     the stream's implementation does not depend on the value of 
  4463.                     this parameter. 
  4464.  
  4465. The following fields are specific to a stream's implementation: 
  4466.  
  4467. Field           Description
  4468.  
  4469. x_public        Specific user data that is private to the stream's 
  4470.                 implementation and that is not used by the XDR primitive 
  4471.  
  4472. x_private       Points to the private data 
  4473.  
  4474. x_base          Contains the position information in the data stream that is 
  4475.                 private to the user implementation 
  4476.  
  4477. x_handy         Data can contain extra information as necessary 
  4478.  
  4479.  
  4480. ΓòÉΓòÉΓòÉ 9.5.6.4. Destroying an XDR Data Stream ΓòÉΓòÉΓòÉ
  4481.  
  4482. XDR provides a routine that destroys the XDR stream pointed to by the xdrs 
  4483. parameter and frees the private data structures allocated to the stream. 
  4484.  
  4485. Routine             Description
  4486. xdr_destroy()       Destroys the XDR stream pointed to by the xdrs parameter 
  4487.  
  4488. The use of the XDR stream handle is undefined after it is destroyed. 
  4489.  
  4490.  
  4491. ΓòÉΓòÉΓòÉ 9.6. The RPC Intermediate Layer ΓòÉΓòÉΓòÉ
  4492.  
  4493. The calls of the RPC intermediate layer are: 
  4494.  
  4495. Routine             Description
  4496. registerrpc()       Registers a procedure with the local Portmapper 
  4497. callrpc()           Calls a remote procedure on the specified system 
  4498. svc_run()           Accepts RPC requests and calls the appropriate service 
  4499.                     using svc_getreq() 
  4500.  
  4501. The transport mechanism is the User Datagram Protocol (UDP). The UDP transport 
  4502. mechanism handles only arguments and results that are less than 8K bytes in 
  4503. length. At this level, RPC does not allow timeout specifications, choice of 
  4504. transport, or process control, in case of errors. If you need this kind of 
  4505. control, consider the lowest layer of RPC. 
  4506.  
  4507. With only these three RPC calls, you can write a powerful RPC-based network 
  4508. application.  The sequence of events follows: 
  4509.  
  4510.   1. Use the registerrpc() call to register your remote program with the local 
  4511.      Portmapper. See Portmapper for more information. The following is an 
  4512.      example of an RPC server: 
  4513.  
  4514.  
  4515.           /* define remote program number and version */
  4516.  
  4517.           #define RMTPROGNUM (u_long)0x3fffffffL
  4518.           #define RMTPROGVER (u_long)0x1
  4519.           #define RMTPROCNUM (u_long)0x1
  4520.  
  4521.           #include <stdio.h>
  4522.           #include <rpc\rpc.h>
  4523.  
  4524.  
  4525.           main()
  4526.           {
  4527.            int *rmtprog();
  4528.  
  4529.            /* register remote program with Portmapper */
  4530.            registerrpc(RMTPROGNUM, RMTPROGVER, RMTPROCNUM, rmtprog,
  4531.            xdr_int, xdr_int);
  4532.            /* infinite loop, waits for RPC request from client */
  4533.            svc_run();
  4534.            printf("Error: svc_run should never reach this point \n");
  4535.            exit(1);
  4536.           }
  4537.  
  4538.           int *
  4539.           rmtprog(inproc)          /* remote program */
  4540.           int *inproc;
  4541.  
  4542.           {
  4543.           int *outproc;
  4544.           ...
  4545.            /* Process request */
  4546.           ...
  4547.            return (outproc);
  4548.           }
  4549.  
  4550.      The registerrpc() call registers a C procedure rmtprog, which corresponds 
  4551.      to a given RPC procedure number. 
  4552.  
  4553.      The registerrpc() call has six parameters: 
  4554.  
  4555.          The first three parameters are the program, version, and procedure 
  4556.           numbers of the remote procedure to be registered. 
  4557.  
  4558.          The fourth parameter, rmtprog, is the name of the local procedure 
  4559.           that implements the remote procedure. 
  4560.  
  4561.          The last two parameters, xdr_int, are the XDR filters for the remote 
  4562.           procedure's arguments and results. 
  4563.  
  4564.      After registering a procedure, the RPC server goes into an infinite loop 
  4565.      waiting for a client request to service. 
  4566.  
  4567.   2. The RPC client uses callrpc() to make a service request to the RPC server. 
  4568.      The following is an example of an RPC client using the callrpc() call: 
  4569.  
  4570.           /* define remote program number and version */
  4571.  
  4572.           #define RMTPROGNUM (u_long)0x3fffffffL
  4573.           #define RMTPROGVER (u_long)0x1
  4574.           #define RMTPROCNUM (u_long)0x1
  4575.  
  4576.           #include <stdio.h>
  4577.           #include <rpc\rpc.h>
  4578.  
  4579.           main()
  4580.           {
  4581.             int inproc=100, outproc, rstat;
  4582.  
  4583.           ...
  4584.  
  4585.             /* service request to host RPCSERVER_HOST */
  4586.             if (rstat = callrpc("RPCSERVER_HOST", RMTPROGNUM,
  4587.                         RMTPROGVER, RMTPROCNUM, xdr_int, (char *)&inproc,
  4588.                         xdr_int, (char *)&outproc)!= 0)
  4589.                {
  4590.                 clnt_perrno(rstat);   /* Why  callrpc() failed ? */
  4591.                 exit(1);
  4592.                }
  4593.           ...
  4594.  
  4595.             }
  4596.  
  4597.      The callrpc() call has eight parameters: 
  4598.  
  4599.          The first is the name of the remote server machine. 
  4600.  
  4601.          The next three parameters are the program, version, and procedure 
  4602.           numbers. 
  4603.  
  4604.          The fifth and sixth parameters are an XDR filter, and an argument to 
  4605.           be encoded and passed to the remote procedure. 
  4606.  
  4607.          The final two parameters are a filter for decoding the results 
  4608.           returned by the remote procedure, and a pointer to the place where 
  4609.           the procedure's results are to be stored. 
  4610.  
  4611.      You handle multiple arguments and results by embedding them in structures. 
  4612.      The callrpc() call returns 0 if it succeeds, otherwise nonzero. The exact 
  4613.      meaning of the returned code is in the <RPC\CLNT.H> header file and is an 
  4614.      enum clnt_stat structure cast into an integer. 
  4615.  
  4616.  
  4617. ΓòÉΓòÉΓòÉ 9.7. The RPC Lowest Layer ΓòÉΓòÉΓòÉ
  4618.  
  4619. This section describes the lowest layer of RPC and when to use it. 
  4620.  
  4621. Topics 
  4622.  
  4623.      When to Use the RPC Lowest Layer 
  4624.      Server Side Program 
  4625.      Client Side Program 
  4626.  
  4627.  
  4628. ΓòÉΓòÉΓòÉ 9.7.1. When to Use the RPC Lowest Layer ΓòÉΓòÉΓòÉ
  4629.  
  4630. Use the lowest layer of RPC in the following situations: 
  4631.  
  4632.     You need to use TCP. The intermediate layer uses UDP, which restricts RPC 
  4633.      calls to 8K bytes of data.  TCP permits calls to send long streams of 
  4634.      data. 
  4635.  
  4636.     You want to allocate and free memory while serializing or deserializing 
  4637.      messages with XDR routines. No RPC call at the intermediate level 
  4638.      explicitly permits freeing memory. XDR routines are used for memory 
  4639.      allocation as well as for serializing and deserializing. 
  4640.  
  4641.     You need to perform authentication on the client side or the server side 
  4642.      by supplying credentials or verifying them. 
  4643.  
  4644.  
  4645. ΓòÉΓòÉΓòÉ 9.7.2. Server Side Program ΓòÉΓòÉΓòÉ
  4646.  
  4647. The following is an example of the lowest layer of RPC on the server side 
  4648. program: 
  4649.  
  4650. #define RMTPROGNUM   (u_long)0x3fffffffL
  4651. #define RMTPROGVER   (u_long)0x1L
  4652. #define LONGPROC   1
  4653. #define STRINGPROC 2
  4654.  
  4655. #define MAXLEN 100
  4656.  
  4657. #include <stdio.h>
  4658. #include <rpc\rpc.h>
  4659. #include <sys\socket.h>
  4660.  
  4661. main(argc, argv)
  4662. int argc;
  4663. char *argv[ ];
  4664.  
  4665. {
  4666.      int rmtprog();
  4667.      SVCXPRT *transp;
  4668.  
  4669. ...
  4670.  
  4671. /* create TCP transport handle */
  4672.      transp = svctcp_create(RPC_ANYSOCK, 1024*10, 1024*10);
  4673. /* or create UDP transport handle */
  4674. /*   transp = svcudp_create(RPC_ANYSOCK);  */
  4675.      if (transp == NULL)   /* check transport handle creation */
  4676.       {
  4677.         fprintf(stderr, "can't create an RPC server transport\n");
  4678.         exit(-1);
  4679.       }
  4680.  
  4681. /* If exists, remove the mapping of remote program and port */
  4682.      pmap_unset(RMTPROGNUM, RMTPROGVER);
  4683.  
  4684. /* register remote program (TCP transport) with local Portmapper */
  4685.      if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog,
  4686.                          IPPROTO_TCP))
  4687. /* or register remote program (UDP transport) with local Portmapper */
  4688. /*   if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog,*/
  4689.                       /* IPPROTO_UDP)) */
  4690.       {
  4691.        fprintf(stderr, "can't register rmtprog() service\n");
  4692.        exit(-1);
  4693.       }
  4694.  
  4695.      svc_run();
  4696.      printf("Error:svc_run should never reaches this point \n");
  4697.      exit(1);
  4698.  
  4699. }
  4700.  
  4701. rmtprog(rqstp, transp)           /* code for remote program */
  4702. struct svc_req *rqstp;
  4703. SVCXPRT *transp;
  4704. {
  4705.    long in_long,out_long;
  4706.    char buf[100], *in_string=buf, *out_string=buf;
  4707. ...
  4708.    switch((int)rqstp->rq_proc)   /* Which procedure ? */
  4709.    {
  4710.     case NULLPROC:
  4711.          if (!svc_sendreply(transp,xdr_void, 0))
  4712.           {
  4713.            fprintf(stderr,"can't reply to RPC call\n");
  4714.            exit(-1);
  4715.           }
  4716.          return;
  4717.  
  4718.     case LONGPROC:
  4719. ...
  4720.          /* Process the request */
  4721.          if (!svc_sendreply(transp,xdr_long,&out_long))
  4722.           {
  4723.            fprintf(stderr,"can't reply to RPC call\n");
  4724.            exit(-1);
  4725.           }
  4726.          return;
  4727.  
  4728.     case STRINGPROC:   /* send received "Hello" message back */
  4729.                                  /* to client */
  4730.          svc_getargs(transp,xdr_wrapstring,(char *)&in_string);
  4731.          strcpy(out_string,in_string);
  4732.  
  4733.          /* send a reply back to a RPC client */
  4734.          if (!svc_sendreply(transp,xdr_wrapstring,
  4735.                                           (char *)&out_string))
  4736.           {
  4737.            fprintf(stderr,"can't reply to RPC call\n");
  4738.            exit(-1);
  4739.           }
  4740.          return;
  4741.     case ... :
  4742. ...
  4743.        /* Any Remote procedure in RMTPROGNUM program */
  4744. ...
  4745.     default:
  4746.        /* Requested procedure not found */
  4747.        svcerr_noproc(transp);
  4748.        return;
  4749.     }
  4750. }
  4751.  
  4752. The following steps describe the lowest layer of RPC on the server side 
  4753. program: 
  4754.  
  4755.   1. Service the transport handle. 
  4756.  
  4757.      The svctcp_create() and svcudp_create() calls create TCP and UDP transport 
  4758.      handles (SVCXPRT) respectively, used for receiving and replying to RPC 
  4759.      messages. The SVCXPRT transport handle structure is defined in the 
  4760.      <RPC\SVC.H> header file. 
  4761.  
  4762.      If the argument of the svctcp_create() call is RPC_ANYSOCK, the RPC 
  4763.      library creates a socket on which to receive and reply to remote procedure 
  4764.      calls. The svctcp_create() and clnttcp_create() calls cause the RPC 
  4765.      library calls to bind the appropriate socket, if it is not already bound. 
  4766.  
  4767.      If the argument of the svctcp_create() call is not RPC_ANYSOCK, the 
  4768.      svctcp_create() call expects its argument to be a valid socket number.  If 
  4769.      you specify your own socket, it can be bound or unbound.  If it is bound 
  4770.      to a port by you, the port numbers of the svctcp_create() and 
  4771.      clnttcp_create() calls must match. 
  4772.  
  4773.      If the send and receive buffer size parameter of svctcp_create() is 0, the 
  4774.      system selects a reasonable default. 
  4775.  
  4776.   2. Register the rmtprog service with Portmapper. 
  4777.  
  4778.      If the rmtprog service terminated abnormally the last time it was used, 
  4779.      the pmap_unset() call erases any trace of it before restarting. The 
  4780.      pmap_unset() call erases the entry for RMTPROGNUM from the Portmapper's 
  4781.      table. 
  4782.  
  4783.      A service can register its port number with the local Portmapper service 
  4784.      by specifying a nonzero protocol number in the svc_register() call. A 
  4785.      programmer at the client machine can determine the server port number by 
  4786.      consulting Portmapper at the server machine. You can do this automatically 
  4787.      by specifying 0 as the port number in the clntudp_create() or 
  4788.      clnttcp_create() calls. 
  4789.  
  4790.      Finally, the program and version number are associated with the rmtprog 
  4791.      procedure. The final argument to the svc_register() call is the protocol 
  4792.      being used, which in this case is IPPROTO_TCP. Register at the program 
  4793.      level, not at the procedure level. 
  4794.  
  4795.   3. Run the remote program RMTPROG. 
  4796.  
  4797.      The rmtprog service routine must call and dispatch the appropriate XDR 
  4798.      calls based on the procedure number. Unlike the registerrpc() call, which 
  4799.      performs them automatically, the rmtprog routine requires two tasks: 
  4800.  
  4801.          When the NULLPROC procedure (currently 0) returns with no results, 
  4802.           use it as a simple test for detecting whether a remote program is 
  4803.           running. 
  4804.  
  4805.          Check for incorrect procedure numbers. If you detect one, call the 
  4806.           svcerr_noproc() call to handle the error. 
  4807.  
  4808.      As an example, the procedure STRINGPROC has an argument for a character 
  4809.      string and returns the character string back to the client. The 
  4810.      svc_getargs() call takes an SVCXPRT handle, the xdr_wrapstring() call, and 
  4811.      a pointer that indicates where to place the input. 
  4812.  
  4813.      The user service (rmtprog) serializes the results and returns them to the 
  4814.      RPC caller through the svc_sendreply() call. 
  4815.  
  4816.      Parameters of the svc_sendreply() call include the: 
  4817.  
  4818.          SVCXPRT handle 
  4819.          XDR routine, which indicates return data type 
  4820.          Pointer to the data to be returned 
  4821.  
  4822.  
  4823. ΓòÉΓòÉΓòÉ 9.7.3. Client Side Program ΓòÉΓòÉΓòÉ
  4824.  
  4825. The following is an example of the lowest layer of RPC on the client side 
  4826. program: 
  4827.  
  4828. #define RMTPROGNUM  (u_long)0x3fffffffL
  4829. #define RMTPROGVER  (u_long)0x1L
  4830. #define STRINGPROC  (u_long)2
  4831.  
  4832. #include <stdio.h>
  4833. #include <rpc\rpc.h>
  4834. #include <sys\socket.h>
  4835. #include <netdb.h>
  4836.  
  4837. main(argc, argv)
  4838. int argc;
  4839. char *argv[ ];
  4840. {
  4841.    struct hostent *hp;
  4842.    struct timeval pertry_timeout, total_timeout;
  4843.    struct sockaddr_in server_addr;
  4844.    int sock = RPC_ANYSOCK;
  4845.    static char buf[100], *strc_in= "Hello", *strc_out=buf;
  4846.    char *parrc_in, *parrc_out;
  4847.    register CLIENT *clnt;
  4848.    enum clnt_stat cs;
  4849. ...
  4850.    /* get the Internet address of RPC server host */
  4851.    if ((hp = gethostbyname("RPCSERVER_HOST")) == NULL)
  4852.     {
  4853.      fprintf(stderr,"Can't get address for %s\n","RPCSERVER_HOST");
  4854.      exit (-1);
  4855.     }
  4856.  
  4857.    pertry_timeout.tv_sec = 3;
  4858.    pertry_timeout.tv_usec = 0;
  4859.  
  4860.    /* set sockaddr_in structure */
  4861.    bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr,
  4862.                               hp->h_length);
  4863.    server_addr.sin_family = AF_INET;
  4864.    server_addr.sin_port = 0;
  4865.  
  4866.    /* create clnt TCP handle */
  4867.    if ((clnt = clnttcp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  4868.                              &sock, 1024*10, 1024*10)) == NULL)
  4869.     {
  4870.      clnt_pcreateerror("clnttcp_create fail"); /* Why failed ? */
  4871.      exit(-1);
  4872.     }
  4873.  
  4874. /*
  4875.  *  create clnt UDP handle
  4876.  *  if ((clnt = clntudp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  4877.  *                             pertry_timeout, &sock)) == NULL)
  4878.  *   {
  4879.  *     clnt_pcreateerror("clntudp_create fail");
  4880.  *     exit(-1);
  4881.  *   }
  4882.  */
  4883.    total_timeout.tv_sec = 10;
  4884.    total_timeout.tv_usec = 0;
  4885. ...
  4886.  
  4887.    /*call the remote procedure STRINGPROC associated with */
  4888.    /*client handle (clnt) */
  4889.    cs=clnt_call(clnt, STRINGPROC,xdr_wrapstring,
  4890.    (char *)&strc_in[j],
  4891.                     xdr_wrapstring, (char *)&strc_out,total_timeout);
  4892.          if (cs != RPC_SUCCESS)
  4893.                printf("*Error* clnt_call fail :\n");
  4894.  
  4895.    clnt_destroy(clnt);  /* deallocate any memory associated  */
  4896.                         /* with clnt handle                  */
  4897. ...
  4898. }
  4899.  
  4900. The following steps describe the lowest layer of RPC on the client side 
  4901. program: 
  4902.  
  4903.   1. Determine the internet address of the RPC server host. 
  4904.  
  4905.      Use the gethostbyname() call to determine the internet address of the 
  4906.      host, which is running the RPC server. Initialize the socaddr_in 
  4907.      structure, found in the <NETINET\IN.H> header file. 
  4908.  
  4909.      If you are not familiar with socket calls, see Sockets General Programming 
  4910.      Information. 
  4911.  
  4912.   2. Use the client RPC handle. 
  4913.  
  4914.      The clnttcp_create() and clntudp_create() calls create TCP and UDP client 
  4915.      RPC handles (CLIENT), respectively. The CLIENT structure is defined in the 
  4916.      <RPC\CLNT.H> header file. 
  4917.  
  4918.      There are six parameters for the clnttcp_create() call: 
  4919.  
  4920.          Server address 
  4921.          Program number 
  4922.          Version number 
  4923.          Pointer to a valid socket descriptor 
  4924.          Send buffer size 
  4925.          Receive buffer size 
  4926.  
  4927.      Use the same parameters for the clntudp_create() call, except for the send 
  4928.      and receive buffer size. Instead, specify a timeout value (between tries). 
  4929.  
  4930.   3. Call the remote procedure. 
  4931.  
  4932.      The low-level version of the callrpc() call is the clnt_call(), which has 
  4933.      seven parameters: 
  4934.  
  4935.          CLIENT pointer 
  4936.          Remote procedure number (STRINGPROC) 
  4937.          XDR call for serializing the argument 
  4938.          Pointer to the argument 
  4939.          XDR call for deserializing the return value from the RPC server 
  4940.          Pointer to where the return value is to be placed 
  4941.          Total time in seconds to wait for a reply 
  4942.  
  4943.      For UDP transport, the number of tries is the clnt_call() timeout divided 
  4944.      by the clntudp_create() timeout. 
  4945.  
  4946.      The return code RPC_SUCCESS indicates a successful call; otherwise, an 
  4947.      error has occurred. You find the RPC error code in the <RPC\CLNT.H> header 
  4948.      file. 
  4949.  
  4950.      The clnt_destroy() call always deallocates the space associated with the 
  4951.      client handle. If the RPC library opened the socket associated with the 
  4952.      client handle, the clnt_destroy() call closes it. If you open the socket, 
  4953.      it stays open. 
  4954.  
  4955.  
  4956. ΓòÉΓòÉΓòÉ 9.8. rpcgen Command ΓòÉΓòÉΓòÉ
  4957.  
  4958. Use the rpcgen command to generate C code to implement an RPC protocol. The 
  4959. input to RPCGEN is a language similar to C, known as RPC language. 
  4960.  
  4961. You normally use rpcgen infile to generate the following four output files. For 
  4962. example, if the infile is named PROTO.X, rpcgen generates: 
  4963.  
  4964.     A header file called PROTO.H 
  4965.     XDR routines called PROTOX.C 
  4966.     Server-side stubs called PROTOS.C 
  4967.     Client-side stubs called PROTOC.C 
  4968.  
  4969. For more information on the rpcgen command, see the Sun Microsystems 
  4970. publication, Networking on the Sun Workstation:  Remote Procedure Call 
  4971. Programming Guide. 
  4972.  
  4973. Syntax 
  4974.  
  4975. ΓöÇrpcgenΓöÇΓöÇ infileΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4976.  
  4977. ΓöÇrpcgenΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇ -cΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  4978.              Γö£ΓöÇ -hΓöÇΓöñ   ΓööΓöÇ -o outfileΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÿ
  4979.              Γö£ΓöÇ -lΓöÇΓöñ                 ΓööΓöÇ infileΓöÇΓöÿ
  4980.              ΓööΓöÇ -mΓöÇΓöÿ
  4981.  
  4982. ΓöÇrpcgenΓöÇΓöÇΓöÇΓöÇ -s transportΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇ
  4983.                              ΓööΓöÇ -o outfileΓöÇΓöÿ   ΓööΓöÇ infileΓöÇΓöÇΓöÿ
  4984.  
  4985. Parameters 
  4986.  
  4987. -c Compiles into XDR routines. 
  4988.  
  4989. -h Compiles into C data definitions (a header file). 
  4990.  
  4991. -l Compiles into client-side stubs. 
  4992.  
  4993. -m Compiles into server-side stubs without generating a main routine. 
  4994.  
  4995. -o outfile Specifies the name of the output file. If none is specified, 
  4996.   standard output is used for -c, -h, -l, -m, and -s modes. 
  4997.  
  4998. infile Specifies the name of the input file written in the RPC language. 
  4999.  
  5000. -s transport Compiles into server-side stubs, using the given transport. 
  5001.  
  5002.  
  5003. ΓòÉΓòÉΓòÉ 9.9. rpcinfo Command ΓòÉΓòÉΓòÉ
  5004.  
  5005. The rpcinfo command makes an RPC call to the RPC server and reports the status 
  5006. of the server, which is registered and operational with Portmapper. 
  5007.  
  5008. Syntax 
  5009.  
  5010. rpcinfo for a Host 
  5011.  
  5012.                    ΓöîΓöÇ local_hostΓöÇΓöÇΓöÉ
  5013. ΓöÇrpcinfoΓöÇΓöÇ -pΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  5014.                    ΓööΓöÇ hostΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ   ΓööΓöÇ > filenameΓöÇΓöÿ
  5015.  
  5016.  Using UDP to send rpcinfo for a Host 
  5017.  
  5018. ΓöÇrpcinfoΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ -u host prognumΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ
  5019.               ΓööΓöÇ -n portnumΓöÇΓöÿ                    ΓööΓöÇ versnumΓöÇΓöÿ
  5020.  
  5021. ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  5022.       ΓööΓöÇ > filenameΓöÇΓöÿ
  5023.  
  5024. Using TCP to send rpcinfo for a Host 
  5025.  
  5026. ΓöÇrpcinfoΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ -t host prognumΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇ
  5027.               ΓööΓöÇ -n portnumΓöÇΓöÿ                    ΓööΓöÇ versnumΓöÇΓöÿ
  5028.  
  5029. ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  5030.       ΓööΓöÇ > filenameΓöÇΓöÿ
  5031.  
  5032. Using UDP to send rpcinfo Broadcast to Hosts 
  5033.  
  5034. ΓöÇrpcinfoΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇ prognumΓöÇΓöÇ versnumΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇ
  5035.             ΓööΓöÇ -bΓöÇΓöÿ                        ΓööΓöÇ > filenameΓöÇΓöÿ
  5036.  
  5037. Parameters 
  5038.  
  5039. -p host 
  5040.   Queries the Portmapper about the specified host and prints a list of all 
  5041.   registered RPC programs. If the host is not specified, the system defaults to 
  5042.   the local host name. 
  5043.  
  5044. > filename 
  5045.   Specifies a file to which the list of registered RPC programs is redirected. 
  5046.  
  5047. -n portnum 
  5048.   Specifies the port number to be used for the -t and -u parameters. This value 
  5049.   replaces the port number that is given by the Portmapper. 
  5050.  
  5051. -u host prognum versnum 
  5052.   Uses UDP to send an RPC call to procedure 0 of prognum and versnum on the 
  5053.   specified host, and reports whether a response is received. 
  5054.  
  5055. -t host prognum versnum 
  5056.   Uses TCP to send an RPC call to procedure 0 of prognum and versnum on the 
  5057.   specified host and reports whether a response is received. 
  5058.  
  5059. -b prognum versnum 
  5060.   Uses UDP to sends an RPC broadcast to procedure 0 of the specified prognum 
  5061.   and versnum and reports all hosts that respond. 
  5062.  
  5063. The prognum argument can be either a name or a number. If you specify a 
  5064. versnum, the rpcinfo command tries to call that version of the specified 
  5065. program. Otherwise, it tries to find all the registered version numbers for the 
  5066. program you specify by calling version 0; then it tries to call each registered 
  5067. version. 
  5068.  
  5069. The TCPIP\ETC\RPC file is associated with the rpcinfo command. This file 
  5070. contains a list of server names and their corresponding RPC program numbers and 
  5071. aliases. 
  5072.  
  5073. Examples 
  5074.  
  5075. Use the rpcinfo command as follows to display RPC services registered on the 
  5076. local host: 
  5077.  
  5078. rpcinfo -p
  5079.  
  5080. Examples 
  5081.  
  5082. Use the rpcinfo command as follows to display RPC services registered on a 
  5083. remote host named charm: 
  5084.  
  5085. rpcinfo -p charm
  5086.  
  5087. Examples 
  5088.  
  5089. Use the rpcinfo command as follows to display the status of a particular RPC 
  5090. program on the remote host named charm: 
  5091.  
  5092. rpcinfo -u charm 100003 2
  5093.  
  5094. or 
  5095.  
  5096. rpcinfo -u charm nfs 2
  5097.  
  5098. In the previous examples, the rpcinfo command shows one of the following: 
  5099.  
  5100. Program 100003 Version 2 ready and waiting
  5101.  
  5102. or 
  5103.  
  5104. Program 100003 Version 2 is not available
  5105.  
  5106. Examples 
  5107.  
  5108. Use the rpcinfo command as follows to display all hosts on the local network 
  5109. that are running a certain version of a specific RPC server: 
  5110.  
  5111. rpcinfo -b 100003 2
  5112.  
  5113. or 
  5114.  
  5115. rpcinfo -b nfsprog 2
  5116.  
  5117. In these examples, the rpcinfo command lists all hosts that are running Version 
  5118. 2 of the NFS daemon. 
  5119.  
  5120. Note:  The version number is required for the -b parameter. 
  5121.  
  5122.  
  5123. ΓòÉΓòÉΓòÉ 9.10. The enum clnt_stat Structure ΓòÉΓòÉΓòÉ
  5124.  
  5125. The enum clnt_stat structure is defined in the <RPC\CLNT.H> file. RPCs 
  5126. frequently return enum clnt_stat information. The format of the enum clnt_stat 
  5127. structure follows: 
  5128.  
  5129. enum clnt_stat  {
  5130. RPC_SUCCESS=0,            /* call succeeded */
  5131. /*
  5132.  * local errors
  5133.  */
  5134. RPC_CANTENCODEARGS=1,     /* can't encode arguments */
  5135. RPC_CANTDECODERES=2,      /* can't decode results */
  5136. RPC_CANTSEND=3,           /* failure in sending call */
  5137. RPC_CANTRECV=4,           /* failure in receiving result */
  5138. RPC_TIMEDOUT=5,           /* call timed out */
  5139. /*
  5140.  * remote errors
  5141.  */
  5142. RPC_VERSMISMATCH=6,       /* RPC versions not compatible */
  5143. RPC_AUTHERROR=7,          /* authentication error */
  5144. RPC_PROGUNAVAIL=8,        /* program not available */
  5145. RPC_PROGVERSMISMATCH=9,   /* program version mismatched */
  5146. RPC_PROCUNAVAIL=10,       /* procedure unavailable */
  5147. RPC_CANTDECODEARGS=11,    /* decode arguments error */
  5148. RPC_SYSTEMERROR=12,       /* generic "other problem" */
  5149. /*
  5150.  * callrpc errors
  5151.  */
  5152. RPC_UNKNOWNHOST=13,       /* unknown host name */
  5153. /*
  5154.  * create errors
  5155.  */
  5156. RPC_PMAPFAILURE=14,        /* the pmapper failed in its call */
  5157. RPC_PROGNOTREGISTERED=15,  /* remote program is not registered */
  5158. /*
  5159.  * unspecified error
  5160.  */
  5161. RPC_FAILED=16
  5162.             };
  5163.  
  5164.  
  5165. ΓòÉΓòÉΓòÉ 9.11. The Remote Procedure Call Library ΓòÉΓòÉΓòÉ
  5166.  
  5167. To use the RPCs described in this section, you must have the following header 
  5168. files in your H\INCLUDE directory: 
  5169.  
  5170. RPC Header File       What It Contains 
  5171.  
  5172. RPC\AUTH.H            Authentication interface 
  5173.  
  5174. RPC\AUTH_UNI.H        Protocol for UNIX-style authentication parameters for RPC 
  5175.  
  5176. RPC\CLNT.H            Client-side remote procedure call interface 
  5177.  
  5178. RPC\PMAP_CLN.H        Supplies C routines to get to PORTMAP services 
  5179.  
  5180. RPC\PMAP_PRO.H        Protocol for the local binder service, or pmap 
  5181.  
  5182. RPC\RPC.H             Includes the RPC header files necessary to do remote 
  5183.                       procedure calling 
  5184.  
  5185. RPC\RPC_MSG.H         Message definitions 
  5186.  
  5187. RPC\RPCNETDB.H        Data definitions for network utility calls 
  5188.  
  5189. RPC\RPCTYPES.H        RPC additions to <TYPES.H> 
  5190.  
  5191. RPC\SVC.H             Server-side remote procedure call interface 
  5192.  
  5193. RPC\SVC_AUTH.H        Service side of RPC authentication 
  5194.  
  5195. RPC\XDR.H             eXternal Data Representation serialization routines 
  5196.  
  5197. The RPC routines are in the RPC32DLL.LIB file in the LIB directory. 
  5198.  
  5199. Put the following statement at the beginning of any file using RPC code: 
  5200.  
  5201. #include <rpc\rpc.h>
  5202.  
  5203.  
  5204. ΓòÉΓòÉΓòÉ 9.12. Differences between OS/2 and Sun Microsystems RPCs ΓòÉΓòÉΓòÉ
  5205.  
  5206. The IBM OS/2 RPC implementation differs from the Sun Microsystems RPC 
  5207. implementation as follows: 
  5208.  
  5209.     The global variables svc_socks[ ] and noregistered are used in place of 
  5210.      the svc_fds global variable. See svc_socks[ ] for the use of these 
  5211.      variables. 
  5212.  
  5213.     Functions that rely on file descriptor structures are not supported. 
  5214.  
  5215.     The svc_getreq() call supports the socks and noavail global variables. In 
  5216.      the Sun Microsystems implementation, the svc_getreq() call supports the 
  5217.      rdfds global variable. 
  5218.  
  5219.     TYPES.H for RPC has been renamed to RPCTYPES.H. 
  5220.  
  5221.  
  5222. ΓòÉΓòÉΓòÉ 9.13. Compiling an RPC API Application ΓòÉΓòÉΓòÉ
  5223.  
  5224. Follow these steps to compile and link the RPC API application using an IBM 
  5225. 32-bit compiler for OS/2: 
  5226.  
  5227.   1. To compile your program, enter: 
  5228.  
  5229.           icc /C myprog.c
  5230.  
  5231.   2. To create an executable program, you can enter: 
  5232.  
  5233.      For VisualAge C++ 
  5234.  
  5235.           ilink /NOFREEFORMAT myprog,myprog.exe,NULL, rpc32dll.lib
  5236.  
  5237. Notes: 
  5238.  
  5239.   1. The RPC API is not re-entrant.  If you are using a multithreaded program, 
  5240.      you must serialize the access to the APIs. 
  5241.  
  5242.   2. For more information about the compile and link options, and dynamic link 
  5243.      libraries, see the User's Guide provided with your compiler. 
  5244.  
  5245.  
  5246. ΓòÉΓòÉΓòÉ 10. File Transfer Protocol ΓòÉΓòÉΓòÉ
  5247.  
  5248. The File Transfer Protocol (FTP) API allows applications to have a client 
  5249. interface for file transfer. Applications written to this interface can 
  5250. communicate with multiple FTP servers at the same time. The interface supports 
  5251. a maximum of 256 simultaneous connections and enables third-party proxy 
  5252. transfers between pairs of FTP servers. Consecutive third-party transfers are 
  5253. allowed between any sequence of pairs of FTP servers. 
  5254.  
  5255. The FTP API tracks the servers to which an application is currently connected. 
  5256. When a new request for FTP service is requested, the API checks whether a 
  5257. connection to the server exists and establishes one if it does not exist.  If 
  5258. the server has dropped the connection since last use, the API re-establishes 
  5259. it. 
  5260.  
  5261. Note:  The FTP API is not re-entrant. If you are using a multithreaded program, 
  5262.        you must serialize the access to the APIs. For example, without 
  5263.        serialization, the program may fail if it has two threads running 
  5264.        concurrently and each thread has its own connection to a server. 
  5265.  
  5266.  
  5267. ΓòÉΓòÉΓòÉ 10.1. FTP API Call Library ΓòÉΓòÉΓòÉ
  5268.  
  5269. To use the FTP API, you must have the <FTPAPI.H> header file in your 
  5270. TCPIP\INCLUDE directory. The FTP API routines are in the FTPAPI.LIB file in the 
  5271. LIB directory. 
  5272.  
  5273. Put the following statement at the top of any file using FTP API code: 
  5274.  
  5275. #include <ftpapi.h>
  5276.  
  5277.  
  5278. ΓòÉΓòÉΓòÉ 10.2. Compiling and Linking an FTP API Application ΓòÉΓòÉΓòÉ
  5279.  
  5280. Follow these steps to compile and link the FTP API application using an IBM 
  5281. 32-bit compiler for OS/2: 
  5282.  
  5283.   1. To compile your program, enter: 
  5284.  
  5285.           icc /C myprog.c
  5286.  
  5287.   2. To create an executable program, you can enter: 
  5288.  
  5289.      For VisualAge C++ 
  5290.  
  5291.           ilink /NOFREEFORMAT myprog,myprog.exe,NULL,
  5292.           ftpapi.lib
  5293.  
  5294. Notes: 
  5295.  
  5296.   1. The FTP API is not re-entrant.  If you are using a multithreaded program, 
  5297.      you must serialize the access to the APIs. 
  5298.  
  5299.   2. For more information about the compile and link options, and dynamic link 
  5300.      libraries, see the User's Guide provided with your compiler. 
  5301.  
  5302.   3. The FTP API can connect to an FTP server using a specific port rather than 
  5303.      the well-known port. Code the port number as part of the host name 
  5304.      specification, such as ftpget ("server1 1234", ...) to connect to server1 
  5305.      by port 1234. 
  5306.  
  5307.  
  5308. ΓòÉΓòÉΓòÉ 11. Resource ReSerVation Protocol ΓòÉΓòÉΓòÉ
  5309.  
  5310. The sender and receiver of a data stream use the RSVP (Resource ReSerVation 
  5311. Protocol) to ensure that some quality of service can be reserved on the 
  5312. network.  This is in contrast to the usual "best effort" service that is 
  5313. provided, where packets are handled "first come first served." 
  5314.  
  5315. This section describes the resource reservation protocol implemented in TCP/IP 
  5316. for OS/2. 
  5317.  
  5318.  
  5319. ΓòÉΓòÉΓòÉ 11.1. RSVP Introduction ΓòÉΓòÉΓòÉ
  5320.  
  5321. RSVP is a Quality of Service (QoS) setup protocol. Quality of Service is a set 
  5322. of communication characteristics required by an application. RSVP does not send 
  5323. or receive data.  Other protocols do the actual transmitting and receiving of 
  5324. data.  A 5-tuple (protocol, destination address, destination port, sender 
  5325. address, sender port) defines the data flow for a QoS. RSVP sets up QoS for 
  5326. flow in a single direction.  If two programs will be both sending and receiving 
  5327. and need QoS for each direction, QoS for each flow must be reserved 
  5328. independently.  Initial implementations of RSVP have been mainly concerned with 
  5329. UDP unicast or UDP multicast, or other IP protocols, such as TCP. 
  5330.  
  5331. The RSVPD.EXE daemon implements the RSVP protocol. Applications use an API 
  5332. interface (LIBRSVP.DLL) to communicate with the daemon. The associated toolkit 
  5333. contains a header file (RSVPRAPI.H) and the library stub for the DLL 
  5334. (LIBRSVP.LIB). 
  5335.  
  5336. The sender initiates a session and causes RSVP path messages to go to the 
  5337. receiver.  The path messages indicate what flow the sender is willing to send. 
  5338. RSVP daemons between the sender and receiver can also add information about 
  5339. what flows they can support.  A reservation is set up when the  receiver sends 
  5340. a reservation to the sender of a path message.  The receiver can ask for 
  5341. confirmation that the reservation was set up. 
  5342.  
  5343. Once a flow is established, the daemons along that flow maintain it 
  5344. automatically by periodically resending path packets from the sender daemon and 
  5345. resending reservation packets in the reverse direction from the receiver's 
  5346. daemon. 
  5347.  
  5348. There are two types of QoS specification: a controlled load flowspec and a 
  5349. guaranteed flowspec. 
  5350.  
  5351. Generally, requesting a Quality of Service means at least that a specific 
  5352. bandwidth (number of bytes per second) is requested.  There are five parameters 
  5353. in a controlled load flowspec.  There are implications in these parameters 
  5354. about how much the packets can get "bunched up."  For example, if you send a 
  5355. 100K burst of packets once every two seconds, the average data rate is 50K per 
  5356. second.  This data flow could be unacceptable, because the sender or receiver 
  5357. (or intervening routers) might only be able to handle 10K bursts every 0.2 
  5358. seconds, for a much more even flow of data.  In the part of the TCP/IP stack 
  5359. that performs QoS processing on the local machine, setting up for a particular 
  5360. reservation usually involves at least two major actions: 
  5361.  
  5362.     prioritizing packets as they wait to leave the machine onto the network 
  5363.      (or to applications running on the machine) 
  5364.  
  5365.     preallocation of buffers so that space resources will be adequate for the 
  5366.      QoS. 
  5367.  
  5368. Some applications, like audio data for a conversation, where excessive delay 
  5369. can easily become intolerable, require packets to be delivered within a 
  5370. specified time. Such applications should use the guaranteed flowspec. Besides 
  5371. the five parameters of the controlled load flowspec, two other parameters, 
  5372. guaranteed rate and slack term, specify the delay through the network. 
  5373.  
  5374.  
  5375. ΓòÉΓòÉΓòÉ 11.2. Consequences of Partial RSVP Deployment on a Network ΓòÉΓòÉΓòÉ
  5376.  
  5377. RSVP works in a network where not every node along a data flow path has RSVP 
  5378. implemented.  The QoS of transmission through sections of the network can be 
  5379. unpredictable where RSVP is not implemented.  The setup process will still be 
  5380. done where the flow passes through RSVP-capable nodes. 
  5381.  
  5382.  
  5383. ΓòÉΓòÉΓòÉ 11.3. Using the RSVP API ΓòÉΓòÉΓòÉ
  5384.  
  5385. This section outlines typical sender and receiver scenarios for using the RSVP 
  5386. API calls. 
  5387.  
  5388. An RSVP sender session might have these steps: 
  5389.  
  5390.   1. Determine the sender and destination addresses and ports. 
  5391.  
  5392.   2. Start a session with rapi_session(), and provide it with the name of your 
  5393.      callback function. 
  5394.  
  5395.   3. Call rapi_getfd() to obtain an alert socket. 
  5396.  
  5397.   4. Call rapi_sender() to establish the program as a sender. 
  5398.  
  5399.   5. Call select() to wait for a read on the alert socket. 
  5400.  
  5401.   6. When data is ready to be read on the alert socket, call rapi_dispatch() to 
  5402.      read it. 
  5403.  
  5404.   7. Your callback routine is called as needed by rapi_dispatch(). 
  5405.  
  5406.   8. When your callback sees a reservation message from a receiver, go to the 
  5407.      next step, otherwise go back to step 5. 
  5408.  
  5409.   9. Process the flowspec information to determine packet size, and so on, and 
  5410.      start sending data on a data socket. 
  5411.  
  5412.  10. The select() call on the alert socket should continue to be used to watch 
  5413.      for asynchronous error conditions. 
  5414.  
  5415.  11. When you are finished sending the data, call rapi_release() to end the 
  5416.      RSVP session. 
  5417.  
  5418. An RSVP receiver session might have these steps: 
  5419.  
  5420.   1. Determine the sender and destination addresses and ports, and if the 
  5421.      destination is a multicast group, join it. 
  5422.  
  5423.   2. Call rapi_session() to start a session, and provide it with your callback 
  5424.      function. 
  5425.  
  5426.   3. Call rapi_getfd() to get the alert socket. 
  5427.  
  5428.   4. Use select() to wait for a read on the alert socket. 
  5429.  
  5430.   5. When data is ready to be read on the alert socket, call rapi_dispatch() to 
  5431.      read it. 
  5432.  
  5433.   6. Call rapi_dispatch() as needed to call your callback routine. 
  5434.  
  5435.   7. When your callback sees a path message from a sender, go to the next step, 
  5436.      otherwise go back to step 4. 
  5437.  
  5438.   8. Process the adspec information in the path message to determine what the 
  5439.      reservation should be, and call rapi_reserve() to let the sender(s) see 
  5440.      reservation messages. 
  5441.  
  5442.   9. Call select() to begin listening for the data stream on a data socket. 
  5443.      Continue to call select() on the alert socket as well, to watch for 
  5444.      asynchronous error conditions. 
  5445.  
  5446.  10. When you are finished receiving the data, use rapi_release() to end the 
  5447.      RSVP session. 
  5448.  
  5449. Topics 
  5450.  
  5451.      Determining Addresses and Ports 
  5452.      Starting a Session 
  5453.      Getting an Alert Socket 
  5454.      Establishing the Program as a Sender 
  5455.      Using Select() with the Alert Socket 
  5456.      Callback Function Example 
  5457.      Making a QoS Reservation 
  5458.      Receiving a Reservation Message 
  5459.      Watching for Asynchronous RSVP Events 
  5460.      Closing the RSVP Session 
  5461.  
  5462.  
  5463. ΓòÉΓòÉΓòÉ 11.3.1. Determining Addresses and Ports ΓòÉΓòÉΓòÉ
  5464.  
  5465. The destination address and port are a specific IP address and port if the data 
  5466. flow is unicast.  If the data flow is by way of a multicast group, the 
  5467. destination address and port are for a multicast group.  Generally, address and 
  5468. port determination depends upon the protocol to be used to send and receive the 
  5469. data stream. 
  5470.  
  5471. If the data flow is for the TCP protocol, the usual listen() - connect() - 
  5472. accept() sequence can be done by server and client.  Then the IP address and 
  5473. port for each end of the connection are available using the getsockname() and 
  5474. getpeername() calls. 
  5475.  
  5476. If the data flow is for UDP unicast or multicast, agreement about IP addresses 
  5477. and ports may have to be done externally to the RSVP protocol or the UDP 
  5478. protocol.  This would depend upon the application.  For example, it might be 
  5479. necessary ahead of time to agree upon a multicast address and port to use for a 
  5480. video broadcast. 
  5481.  
  5482. When joining a multicast group as a receiver, it is possible to see path 
  5483. messages to that group which are coming from senders.  Then a receiver can make 
  5484. reservations for data flows from the senders.  A path message includes the IP 
  5485. address and port of the sender. 
  5486.  
  5487. RSVP is designed to use a variety of network address types. Thus the API uses 
  5488. the more general sockaddr structure. To operate with Internet Protocol 
  5489. addresses,  the sockaddr structure must be cast to sockaddr_in. 
  5490.  
  5491.  
  5492. ΓòÉΓòÉΓòÉ 11.3.2. Starting a Session ΓòÉΓòÉΓòÉ
  5493.  
  5494. The sender and receiver start sessions in the same way, by issuing a 
  5495. rapi_session() call.  This call requires a sockaddr structure, which defines a 
  5496. destination address and port, a protocol number, an optional callback function 
  5497. that you provide, and some other parameters. If the session is multicast, then 
  5498. the address is for a multicast group to which the senders send data.  The port 
  5499. can be considered an extension of the multicast address.  The address and port 
  5500. must agree for all users of that multicast group.  The rapi_session() call 
  5501. returns a session ID that is used in subsequent calls to the RSVP API. 
  5502.  
  5503. This example assumes that the destination is a multicast group. 
  5504.  
  5505.  
  5506. #include
  5507.     int retcode;
  5508.     rapi_sid_t sessID;          /* RSVP session ID */
  5509.     int proto = IPPROTO_UDP;    /* protocol (UDP) */
  5510.     struct sockaddr_in mulAddr; /* multicast address, port, protocol */
  5511.     int alertSoc;               /* alert socket for asynchronous events */
  5512.     int ttl;                    /* multicast time to live value */
  5513.  
  5514.     mulAddr.sin_family = AF_INET;
  5515.     mulAddr.sin_addr.s_addr = inet_addr("224.1.1.1");
  5516.     mulAddr.sin_port = htons(1201);
  5517.  
  5518.     /* Do multicast group setup at this point. Code omitted here. */
  5519.  
  5520.     sessID = rapi_session((struct sockaddr *)&mulAddr, proto, 0, callback,
  5521.                           NULL, &retcode);
  5522.     if (! sessID)
  5523.         {
  5524.         printf("Session did not start! rapi_session() error code %d\n",
  5525.                retcode);
  5526.         exit(1);
  5527.         }
  5528.     else
  5529.         {
  5530.         alertSoc = rapi_getfd(sessID);
  5531.         printf("Session %d started, alert socket is %d\n",
  5532.                sessID, alertSoc);
  5533.         }
  5534.     if (alertSoc <= 0)
  5535.         {
  5536.         printf("Error, rapi_getfd() could not provide an alert socket!\n");
  5537.         exit(1);
  5538.         }
  5539.  
  5540.  
  5541. ΓòÉΓòÉΓòÉ 11.3.3. Getting an Alert Socket ΓòÉΓòÉΓòÉ
  5542.  
  5543. The sender and receiver both would issue a rapi_getfd() call at this point. The 
  5544. call returns an alert socket.  The socket is used to send data to the RSVP API. 
  5545. The program should issue a select() call on the socket as a read socket in 
  5546. order to know when asynchronous events are available. The program should not 
  5547. read the socket. 
  5548.  
  5549. If the program is going to receive data, this is a good point to use select() 
  5550. to wait for path messages that indicate that one or more senders are available. 
  5551. There is an example of this in a later section. 
  5552.  
  5553. If the program is going to send data, this is a good time to tell the RSVP API 
  5554. that the program will be a sender. 
  5555.  
  5556.  
  5557. ΓòÉΓòÉΓòÉ 11.3.4. Establishing the Program as a Sender ΓòÉΓòÉΓòÉ
  5558.  
  5559. The rapi_sender() call tells RSVP that the program will be a sender.  This call 
  5560. establishes the sender address and port for the data flow, and it specifies the 
  5561. characteristics of the data stream in RSVP terms, with a tspec (transmission 
  5562. specification).  This information will go to the destination in an RSVP path 
  5563. message.  The RSVP API will take care of repeating the message as needed 
  5564. according to the RSVP protocol. 
  5565.  
  5566. This example shows the use of rapi_sender(): 
  5567.  
  5568. int retcode;
  5569.     struct sockaddr_in senderAddr; /* sender address, port, protocol */
  5570.     rapi_tspec_t sndTSpec;
  5571.  
  5572.     /* set up senderAddr and sndTSpec */
  5573.  
  5574.     senderAddr.sin_family = AF_INET;
  5575.     senderAddr.sin_addr.s_addr = inet_addr("129.5.24.1");
  5576.     senderAddr.sin_port = htons(1024);
  5577.  
  5578.  
  5579. /* set the object size and form in the object header */
  5580. sndTSpec.len = sizeof(sndTSpec);
  5581. sndTSpec.form = RAPI_FORMAT_IS_GEN;
  5582. /* fill in the body of the Tspec object */
  5583.     sndTSpec.tspec_r = 100000;
  5584.     sndTSpec.tspec_b = 2600;
  5585.     sndTSpec.tspec_p = 100000;
  5586.     sndTSpec.tspec_m = 1300;
  5587.     sndTSpec.tspec_M = 1300;
  5588.  
  5589.     retcode = rapi_sender(
  5590.             sessID,           /* Session ID                              */
  5591.             0,                /* Flags - not defined                     */
  5592.             (struct sockaddr *)&senderAddr,
  5593.                               /* Local host: (Src addr, port), net order */
  5594.             NULL,             /* Sender template - not supported         */
  5595.             &sndTSpec,        /* Sender tspec                            */
  5596.             NULL,             /* Sender adspec - not supported           */
  5597.             NULL,             /* Sender policy data - not supported      */
  5598.             ttl               /* TTL of multicast session (if multicast) */
  5599.             );
  5600.     if (retcode)
  5601.         printf("rapi_sender() error %d\n", retcode);
  5602.  
  5603.  
  5604. ΓòÉΓòÉΓòÉ 11.3.5. Using Select() with the Alert Socket ΓòÉΓòÉΓòÉ
  5605.  
  5606. The alert socket is used to communicate messages from the RSVP daemon to the 
  5607. API.  These messages generally turn into events for the program. The select() 
  5608. call is used to wait for read data on the alert socket.  Once there is read 
  5609. data available, the program must call rapi_dispatch() so that the RSVP API can 
  5610. read the data and handle it properly.  Typically, rapi_dispatch() will, in 
  5611. turn, call your callback function, possibly more than once. 
  5612.  
  5613. In the <RSVPRAPI.H> header file, the data type rapi_event_rtn_t is declared to 
  5614. be a pointer to a callback function.  The arguments of the function are also 
  5615. declared there, so that you can see how to declare your callback function 
  5616. arguments. 
  5617.  
  5618. This example shows a loop with a select() call waiting on the alert socket 
  5619. until a path message is received and handled by a callback function: 
  5620.  
  5621. fd_set readSockets;
  5622.     int rc, rapi_rc;
  5623.     int receivedPathEvent = 0; /* set to 1 by the callback routine */
  5624.  
  5625.     while (! receivedPathEvent)
  5626.         {
  5627.         FD_ZERO(&readSockets);
  5628.         FD_SET(alertSoc, &readSockets);
  5629.         if ((rc = select(FD_SETSIZE, &readSockets, NULL, NULL, &timeout)) < 0)
  5630.             {
  5631.             psock_errno("select() on alert socket");
  5632.             exit(1);
  5633.             }
  5634.         if (rc > 0 && FD_ISSET(alertSoc, &readSockets))
  5635.             {
  5636.             rapi_rc = rapi_dispatch();
  5637.             if (rapi_rc == RAPI_ERR_NORSVP)
  5638.                 {
  5639.                 printf("Warning! RSVP has gone away.\n");
  5640.                 exit(1);
  5641.                 }
  5642.             }
  5643.         } /* end while */
  5644.  
  5645. Waiting for a reservation message would be handled similarly. 
  5646.  
  5647.  
  5648. ΓòÉΓòÉΓòÉ 11.3.6. Callback Function Example ΓòÉΓòÉΓòÉ
  5649.  
  5650. This example mainly shows the code that works with the previous example, which 
  5651. looks for a path message.  This example also prints all the event information, 
  5652. using the format routines of the RSVP API where appropriate: 
  5653.  
  5654. struct sockaddr_in sndAddr; /* remember the sender IP addr:port here */
  5655.  
  5656.     int _System callback(
  5657.         rapi_sid_t         sid,          /* Which sid generated event    */
  5658.         rapi_eventinfo_t   eventType,    /* Event type                   */
  5659.         rapi_styleid_t     styleID,      /* Style ID                     */
  5660.         int                errorCode,    /* Error code                   */
  5661.         int                errorValue,   /* Error value                  */
  5662.         struct sockaddr   *pNodeAddr,    /* Error node address           */
  5663.         u_char             errorFlags,   /* Error flags                  */
  5664.         int                nFilterSpecs, /* Number of filterspecs/sender*/
  5665.                                          /*      templates in list       */
  5666.         rapi_filter_t     *pFilterSpec,  /* Filterspec/sender templ list*/
  5667.         int                nFlowSpecs,   /* Number of flowspecs/Tspecs   */
  5668.         rapi_flowspec_t   *pFlowSpec,    /* Flowspec/tspec list          */
  5669.         int                nAdSpecs,     /* Number of adspecs            */
  5670.         rapi_adspec_t     *pAdSpec,      /* Adspec list                  */
  5671.         void *             pClientArg    /* Client supplied arg          */
  5672.         )
  5673.     {
  5674.     int i;
  5675.     #define FMT_BUF_SIZE 600
  5676.     char buf[FMT_BUF_SIZE];
  5677.     printf("callback() sid %d, eventType %d, styleID %d\n",
  5678.            sid, eventType, styleID);
  5679.  
  5680.     /* if we received the path event then tell the select loop */
  5681.     if (eventType == RAPI_PATH_EVENT)
  5682.         {
  5683.         receivedPathEvent = 1;
  5684.         /* get the sender address from pFilterSpec */
  5685.         if (nFilterSpec && (pFilterSpec->form == RAPI_FILTERFORM_BASE))
  5686.            sndAddr = pFilterSpec->filter.base.sender;
  5687.         /* else it is another address form... */
  5688.         }
  5689.  
  5690.  
  5691. In a realistic program, the adspec information would be processed to determine 
  5692. what services are supported by network elements that support RSVP. Information 
  5693. on data rate, bandwidth, packet MTU, and so on, normally would be available.  A 
  5694. receiver would determine what reservation flowspec would be suitable for the 
  5695. data stream that the sender could send. 
  5696.  
  5697. If a reservation event is being processed by a sender, the adspec information 
  5698. normally would provide the upper limit on packet size, and other useful 
  5699. information, and the sender could adjust its data flow accordingly. 
  5700.  
  5701. To print all the event information: 
  5702.  
  5703.     if (errorCode == RAPI_ERR_OK)
  5704.         printf("errorCode %d\n", errorCode);
  5705.     else
  5706.         printf("errorCode %d, errorValue %d, nodeAddr %s:%d, errorFlags %d\n",
  5707.                errorCode, errorValue,
  5708.                inet_ntoa(((struct sockaddr_in*)pNodeAddr->sin_addr),
  5709.                ((struct sockaddr_in*)pNodeAddr->sin_port, errorFlags);
  5710.     if (nFilterSpecs)
  5711.         for (i = 0; i < nFilterSpecs; ++i)
  5712.             {
  5713.             rapi_fmt_filtspec(pFilterSpec + i, buf, FMT_BUF_SIZE);
  5714.             printf("filterspec %d, %s\n", i, buf);
  5715.             }
  5716.     else
  5717.         printf("No filter specs\n");
  5718.     if (nFlowSpecs)
  5719.         for (i = 0; i < nFlowSpecs; ++i)
  5720.             {
  5721.             rapi_fmt_flowspec(pFlowSpec + i, buf, FMT_BUF_SIZE);
  5722.             printf("flowspec %d, %s\n", i, buf);
  5723.             }
  5724.     else
  5725.         printf("No flowspecs\n");
  5726.     if (nAdSpecs)
  5727.         for (i = 0; i < nAdSpecs; ++i)
  5728.             {
  5729.             rapi_fmt_adspec(pAdSpec + i, buf, FMT_BUF_SIZE);
  5730.             printf("adspec %d, %s\n", i, buf);
  5731.             }
  5732.     else
  5733.         printf("No adspecs\n");
  5734.     /* the function must return a value, but the API does nothing to it */
  5735.     return 0;
  5736.     } /* end callback */
  5737.  
  5738.  
  5739. ΓòÉΓòÉΓòÉ 11.3.7. Making a QoS Reservation ΓòÉΓòÉΓòÉ
  5740.  
  5741. The rapi_reserve() call is used by the receiver to make a reservation or change 
  5742. a reservation.  The call specifies a reservation style, filterspecs (data 
  5743. senders), and flowspecs (QoS specifications). 
  5744.  
  5745. This example shows how a receiver makes or changes a reservation: 
  5746.  
  5747. #define MAX_RSVP_SENDERS 10
  5748.     int retcode;
  5749.     rapi_styleid_t rapiStyle = RAPI_RSTYLE_FIXED; /* fixed reservation */
  5750.     int filterSpecCount;
  5751.     rapi_filter_t filterSpec[MAX_RSVP_SENDERS];
  5752.     int flowSpecCount;
  5753.     rapi_flowspec_t flowSpec[MAX_RSVP_SENDERS];
  5754.  
  5755.     filterSpecCount = 1;   /* one specified sender this time */
  5756.     /* set the object size and form in the object header */
  5757.     filterSpec[0].len = sizeof(rapi_hdr_t) + sizeof(rapi_filter_base_t);
  5758.     filterSpec[0].form = RAPI_FILTERFORM_BASE;
  5759.     /* fill in the body of the filterspec object */
  5760.     filterSpec[0].filter.base.sender = sndAddr; /* copied from path event */
  5761.  
  5762.     flowSpecCount = 1;     /* one flowspec this time */
  5763.     /* set the object size and form in the object header */
  5764.     flowSpec[0].len = sizeof(rapi_hdr_t) + sizeof(CL_flowspec_t);
  5765.     flowSpec[0].form = RAPI_FORMAT_IS_CL;
  5766.     /* fill in the body of the flowspec object */
  5767.     flowSpec[0].cl_tspec_r = 100000;
  5768.     flowSpec[0].cl_tspec_b = 2600;
  5769.     flowSpec[0].cl_tspec_p = 100000;
  5770.     flowSpec[0].cl_tspec_m = 1300;
  5771.     flowSpec[0].cl_tspec_M = 1300;
  5772.  
  5773.     retcode = rapi_reserve(
  5774.             sessID,  /* session id */
  5775.             RAPI_REQ_CONFIRM,    /* flags */
  5776.             NULL,    /* rcv host addr (optional, sessID has destination) */
  5777.             rapiStyle,    /* style ID */
  5778.             NULL,    /* style extension, not supported */
  5779.             NULL,    /* receiver policy, not supported */
  5780.             filterSpecCount,
  5781.             filterSpec,   /* array of filterspecs */
  5782.             flowSpecCount,
  5783.             flowSpec      /* array of flowspecs */
  5784.             );
  5785.     if (retcode)
  5786.         printf("rapi_reserve() error %d\n", retcode);
  5787.  
  5788. The rapi_reserve() call above has the optional RAPI_REQ_CONFIRM flag, that asks 
  5789. for a confirmation message to be sent if the reservation is made. Such an event 
  5790. indicates that the reservation had a very high probability of succeeding. 
  5791.  
  5792. After making the reservation, the receiver should start listening for the data 
  5793. stream on a data socket. 
  5794.  
  5795.  
  5796. ΓòÉΓòÉΓòÉ 11.3.8. Receiving a Reservation Message ΓòÉΓòÉΓòÉ
  5797.  
  5798. After a sender's callback function receives a reservation message, the sender 
  5799. can start sending data to the destination.  The RSVP data flow has been set up 
  5800. with the reserved Quality of Service. 
  5801.  
  5802. Start listening for the data stream on a data socket. 
  5803.  
  5804.  
  5805. ΓòÉΓòÉΓòÉ 11.3.9. Watching for Asynchronous RSVP Events ΓòÉΓòÉΓòÉ
  5806.  
  5807. Both a sender and a receiver should continue to use a select() call on the 
  5808. alert socket to watch for asynchronous error conditions.  The select() call can 
  5809. be in separate thread, or it can be a select() call that is used in sending or 
  5810. receiving the data stream. 
  5811.  
  5812.  
  5813. ΓòÉΓòÉΓòÉ 11.3.10. Closing the RSVP Session ΓòÉΓòÉΓòÉ
  5814.  
  5815. Use the rapi_release() call to close an RSVP session.  When the program ends, 
  5816. the RSVP API will also close any sessions that the program has open. 
  5817.  
  5818.  
  5819. ΓòÉΓòÉΓòÉ 11.4. Reservation Styles ΓòÉΓòÉΓòÉ
  5820.  
  5821. Bandwidth reservation relates to the way the bandwidth is to be allocated (the 
  5822. reservation type), and the technique used to select senders (the sender 
  5823. selection). The reservation type may be distinct for individual data flows, or 
  5824. may be shared among multiple data flows. The selection of the senders may be 
  5825. explicit (meaning that individual senders are identified individually), or it 
  5826. may be a wildcard selection that implicitly selects all the senders to a 
  5827. session.  This table shows the reservation styles that are defined for the 
  5828. various Sender Selection-Reservation Type combinations: 
  5829.  
  5830. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5831. ΓöéSender Selection      Reservation Type      Reservation Style    Γöé
  5832. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5833. Γöéexplicit              distinct              Fixed-Filter (FF)    Γöé
  5834. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5835. Γöéexplicit              shared                Shared-Explicit (SE) Γöé
  5836. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5837. Γöéwildcard              distinct              (none defined)       Γöé
  5838. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5839. Γöéwildcard              shared                Wildcard-Filter (WF) Γöé
  5840. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5841.  
  5842. The fixed filter (FF) style specifies a distinct flow for each sender. The 
  5843. bandwidth reservations are made separately for each flow.  Parameters in the 
  5844. reservation specify each sender explicitly. 
  5845.  
  5846. With the shared explicit (SE) style, each of the senders is specified 
  5847. explicitly in the reservation message, but the reserved bandwidth is shared by 
  5848. all the senders wherever they can be merged upstream from the receiver. 
  5849.  
  5850. The wildcard filter (WF) style specifies a single reservation of bandwidth 
  5851. which is to be shared by all the senders.  This type of reservation is 
  5852. propagated upstream to all senders as they become senders in the RSVP session. 
  5853. Besides there being a single bandwidth reservation for all the senders to the 
  5854. receiver that makes the reservation, the other receivers in the same multicast 
  5855. group will have their bandwidth reservations merged as well.  The "largest" 
  5856. such reservation for the session at any point in the multicast tree determines 
  5857. how much bandwidth is reserved at that point in the tree. 
  5858.  
  5859. The wildcard and shared explicit styles are primarily useful for multicast 
  5860. applications where the data sources are unlikely to transmit simultaneously. 
  5861.  
  5862.  
  5863. ΓòÉΓòÉΓòÉ 11.5. Tspecs and Flowspecs ΓòÉΓòÉΓòÉ
  5864.  
  5865. The sender tspec contains a structure with five fields that define the flow. 
  5866. The two receiver flowspecs also contain this structure. 
  5867.  
  5868.     typedef struct {
  5869.        float32_t  IS_Tspec_r; /* Token bucket rate (IP packet bytes/sec) */
  5870.        float32_t  IS_Tspec_b; /* Token bucket depth (bytes) */
  5871.        float32_t  IS_Tspec_p; /* Peak data rate (IP packet bytes/sec) */
  5872.        u_int32_t  IS_Tspec_m; /* Min Policed Unit (bytes) */
  5873.        u_int32_t  IS_Tspec_M; /* Max packet size (bytes) */
  5874.     }   IS_Tspec_t;
  5875.  
  5876. The token bucket rate (r) is in bytes of IP datagrams per second.  That is, the 
  5877. packets must include the IP packet header (20 bytes) and either the UDP header 
  5878. (8 bytes) or the TCP header (20 bytes), as well as the data in the packet, when 
  5879. computing packet sizes.  The valid value of r may range from 1 byte per second 
  5880. to 40 terabytes per second.  The bucket depth (b) may range from 1 byte to 250 
  5881. gigabytes. 
  5882.  
  5883. The maximum packet size (M) should be no bigger than the maximum transmission 
  5884. unit (MTU) of the path between sender and receiver. The value of m must be no 
  5885. bigger than M. 
  5886.  
  5887. In a tspec the sender indicates, for any arbitrary time period of T seconds, 
  5888. that the amount of data sent in that period will not be greater than r*T+b. 
  5889. When computing this, any packet that is less than the minimum policed unit (m) 
  5890. in size should be counted as m bytes. 
  5891.  
  5892. The token bucket model is a way of viewing the transmission of data. The sender 
  5893. has a stream of data that comes from some source, and the sender expects to 
  5894. send it using RSVP.  The sender may need to send at a specified rate dictated 
  5895. by the data stream source, for example an audio or video data stream.  The 
  5896. receiver may need to output the data in a timely fashion after receiving it as 
  5897. well.  The token bucket rate is the rate at which the sender will send. 
  5898. Imagine bytes (tokens) filling the token bucket.  When enough accumulate so 
  5899. that the above formula is not violated, a packet is built and sent.  The bucket 
  5900. is reduced by the amount that was sent. 
  5901.  
  5902. The peak data rate (p) is mainly used in guaranteed flowspecs. It can be set 
  5903. the same as r, for controlled load flowspecs.  In guaranteed flowspecs, it is 
  5904. required that for any time period T, that the amount of data sent in that 
  5905. period cannot exceed M+p*T. 
  5906.  
  5907. A Guaranteed flowspec has a tspec and an rspec. An rspec is shown below. 
  5908.  
  5909.     typedef struct {
  5910.        float32_t  Guar_Rspec_R; /* Guaranteed Rate (IP packet bytes/sec) */
  5911.        u_int32_t  Guar_Rspec_S; /* Slack term (microseconds) */
  5912.     }   Guar_Rspec_t;
  5913.  
  5914. The guaranteed rate (R) and slack term (S) are computed by the receiver based 
  5915. upon the values in the adspec in the path message.  They are explained in a 
  5916. later section. 
  5917.  
  5918. A sender and receiver in an RSVP session negotiate reasonable values of packet 
  5919. size, and so forth, by using information in the path and reservation messages. 
  5920. Typically, a sender specifies the largest packet it is willing to send.  This 
  5921. value will be in the path message tspec.  When the path message is seen by a 
  5922. receiver, the packet size (in the adspec) will be the maximum that can be 
  5923. handled by all the RSVP-enabled nodes that the message passed through. (If one 
  5924. or more nodes was not RSVP-enabled, then that fact is also indicated in the 
  5925. adspec.  In that case, the reservation that is made should be considered 
  5926. unreliable.) Once the receiver makes a reservation, if the reservation is 
  5927. subsequently merged with other reservations then a similar process can happen 
  5928. as the reservation message goes toward the sender.  Thus the sender can see 
  5929. what the maximum packet size should be for the packets to be sent reliably to 
  5930. all receivers.  If a packet is larger than that size, it will be sent by "best 
  5931. effort" technique rather than according to the reservation that was made. 
  5932.  
  5933. A similar process occurs for delay through the network, so that the receiver 
  5934. has an estimate of what sort of service it can expect and request. 
  5935.  
  5936.  
  5937. ΓòÉΓòÉΓòÉ 11.6. Adspecs ΓòÉΓòÉΓòÉ
  5938.  
  5939. Adspecs are a part of path events.  Adspecs carry information about the RSVP 
  5940. support that is possible in the network for a specified flow. 
  5941.  
  5942. An adspec is created by the RSVP daemon when a sender calls rapi_sender(). The 
  5943. path message traverses the network to the receiver, and accumulates changes to 
  5944. the adspec when passing through each RSVP enabled network node. The receiver 
  5945. callback function is called with a path event.  The path event has the original 
  5946. sender tspec, and the adspec that indicates the support that is possible 
  5947. through the network for that tspec.  The receiver then calls rapi_reserve() to 
  5948. make a reservation based upon the information in the tspec and adspec.  Then 
  5949. the reservation message traverses the network to the sender.  The QoS 
  5950. reservation is set up in each RSVP node until the reservation message reaches 
  5951. the sender.  The sender callback function is called with a reserve event.  The 
  5952. sender then may adjust packet size or other factors in order to use the 
  5953. reservation effectively, based upon the reservation information. 
  5954.  
  5955. When the application callback function is passed a non-NULL pointer for the 
  5956. adspec, then the pointer points to an IS_adspec_t data type: 
  5957.  
  5958.     typedef struct {
  5959.             Gen_adspec_t    Gen_Adspec;
  5960.             rbool_t         CL_present;
  5961.             CL_adspec_t     CL_Adspec;
  5962.             rbool_t         Guar_present;
  5963.             Guar_adspec_t   Guar_Adspec;
  5964.     } IS_adspec_t;
  5965.  
  5966. The IS_adspec_t data type has several fields.  The Gen_Adspec field is always 
  5967. present.  If CL_present is true, then CL_Adspec contains a CL_adspec_t data 
  5968. type, which is a composite of the controlled flow support for the path. If 
  5969. Guar_present is true, then Guar_Adspec contains a Guar_adspec_t data type, 
  5970. which is a composite of the guaranteed flow support for the path. 
  5971.  
  5972. The Gen_Adspec_t data type is shown below. 
  5973.  
  5974.     typedef struct {
  5975.             rbool_t    servBreak;    /* break in service */
  5976.             u_int16_t  ISHops;       /* num Int-serv aware hops */
  5977.             float32_t  pathBW;       /* min path band width (bytes/sec) */
  5978.             u_int32_t  pathLatency;  /* min path latency (microseconds) */
  5979.             u_int16_t  composedMTU;  /* composed path MTU */
  5980.     } Gen_adspec_t;
  5981.  
  5982. If servBreak is true, then there is at least one hop on the path that does not 
  5983. have QoS support and QoS must be considered unreliable. ISHops specifies the 
  5984. number of hops that do have QoS support of some sort (controlled load or 
  5985. guaranteed).  There are estimates for minimum path bandwidth and minimum delay 
  5986. through the path.  The composedMTU is the maximum transmission unit that can be 
  5987. sent on the path without fragmentation of the packet.  The composedMTU includes 
  5988. the IP packet header and whatever protocol headers (UDP, TCP, and so on) will 
  5989. be in the packet.  Note that a particular type of service might have a 
  5990. different value for the composedMTU, due to implementation differences for 
  5991. various types of QoS. 
  5992.  
  5993. The CL_adspec_t data type provides information specifically for controlled load 
  5994. flows on the path.  Note that it is possible for there to be a break in service 
  5995. for controlled load even if QoS is supported at every node.  Some nodes may 
  5996. only implement QoS for guaranteed flows. 
  5997.  
  5998.     typedef struct {
  5999.             rbool_t    servBreak;    /* break in service */
  6000.             u_int16_t  ISHops;       /* num Int-serv aware hops */
  6001.             float32_t  pathBW;       /* min path band width (bytes/sec) */
  6002.             u_int32_t  pathLatency;  /* min path latency (microseconds) */
  6003.             u_int16_t  composedMTU;  /* composed path MTU */
  6004.     } CL_adspec_t;
  6005.  
  6006. The fields have the same significance as for Gen_adspec_t but refer  only to 
  6007. path hops for which controlled load is supported. 
  6008.  
  6009. The Guar_adspec_t data type provides information specifically for guaranteed 
  6010. flows on the path.  Note that it is possible for there to be a break in service 
  6011. for guaranteed flows even if QoS is supported at every node. Some nodes may 
  6012. only implement controlled load QoS. 
  6013.  
  6014.     typedef struct {
  6015.             rbool_t    servBreak;    /* break in service */
  6016.             u_int16_t  ISHops;       /* num Int-serv aware hops */
  6017.             float32_t  pathBW;       /* min path band width (bytes/sec) */
  6018.             u_int32_t  pathLatency;  /* min path latency (microseconds) */
  6019.             u_int16_t  composedMTU;  /* composed path MTU (bytes) */
  6020.             u_int32_t  Ctot;         /* total rate dep. err (bytes) */
  6021.             u_int32_t  Dtot;         /* total rate indep. err (microseconds) */
  6022.             u_int32_t  Csum;         /* reshaped rate dep. err (bytes) */
  6023.             u_int32_t  Dsum;         /* reshaped rate indep. err (microseconds) */
  6024.     } Guar_adspec_t;
  6025.  
  6026. The first five fields have the same significance as for Gen_adspec_t but refer 
  6027. only to path hops for which guaranteed flow is supported. The remaining fields 
  6028. are unique to guaranteed flows. 
  6029.  
  6030.  
  6031. ΓòÉΓòÉΓòÉ 11.7. Controlled Load Reservations ΓòÉΓòÉΓòÉ
  6032.  
  6033. The controlled load reservation requests a reservation for a guaranteed data 
  6034. rate.  The receiver is asking for an IP packet byte rate that is no greater 
  6035. than r*T+b bytes for any arbitrary time of T seconds.  The receiver expects to 
  6036. not need more than b bytes of packet space for arriving packets in the TCP/IP 
  6037. stack, while it is busy processing previously received packets.  The receiver 
  6038. should request a maximum packet size M no bigger than the composedMTU from the 
  6039. controlled load adspec.  When computing r*T+b, packets smaller than m should be 
  6040. treated as if they were size m. The peak rate p in the reservation is checked 
  6041. for validity but usually is ignored. 
  6042.  
  6043. For more information, refer to Internet RFC 1633, Integrated Services in the 
  6044. Internet Architecture: an Overview, and Internet Draft 
  6045. draft-ietf-intserv-ctrl-load-svc-07. 
  6046.  
  6047.  
  6048. ΓòÉΓòÉΓòÉ 11.8. Guaranteed Reservations ΓòÉΓòÉΓòÉ
  6049.  
  6050. Guaranteed reservations are more complex than controlled load because 
  6051. guaranteed flow provides a way to reserve a specified maximum delay through the 
  6052. network, as well as a specified data rate.  Guaranteed service does not control 
  6053. the average or minimum packet delay. Guaranteed service also does not control 
  6054. jitter, the difference between minimum and maximum packet delays. 
  6055.  
  6056. The guaranteed flow model of the network assumes that there are two sources of 
  6057. delay in the network, the delay (D) that is independent of rate of flow, and 
  6058. the delay (C) that is proportional to rate of flow. Delay for a rate r would be 
  6059. C*r+D in an ideal situation.  In practice, the RSVP-enabled network elements 
  6060. provide an upper bound for their contribution to C and D, and a lower bound for 
  6061. D. The lower bound for C is 0. The receiver chooses a reservation that takes 
  6062. these bounds into consideration. 
  6063.  
  6064. The pathLatency field of the adspec for guaranteed service is an estimate of 
  6065. the minimum delay through the network for that type of service.  It can be 
  6066. estimated from many diverse factors such as speed of light through fiber cables 
  6067. or minimum path length of routing code. Each RSVP-enabled node adds its own 
  6068. estimate of this value to the adspec. 
  6069.  
  6070. The delay that is based on the data rate can include many factors, such as time 
  6071. to queue a packet, and maximum time to wait for the current packet to be sent 
  6072. before the next one can be sent from an interface. 
  6073.  
  6074. When a path message arrives at the receiver, the guaranteed flow adspec will 
  6075. contain Ctot and Dtot, which are accumulations of the C and D delay factors on 
  6076. the path through the network.  The terms Csum and Dsum are used by intermediate 
  6077. nodes along with the slack term that the guaranteed flow will provide.  These 
  6078. terms are used by nodes that will "reshape" the data flow to make it conform to 
  6079. the flow parameters. 
  6080.  
  6081. These are the formula variables and their sources, for determining the 
  6082. Guaranteed flowspec. 
  6083.  
  6084. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6085. ΓöéVar    Spec            Spec Field          Description             Γöé
  6086. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6087. ΓöéBmin   Guar_adspec_t   pathBW              Minimum path bandwidth  Γöé
  6088. Γöé                                           (IP packet bytes per    Γöé
  6089. Γöé                                           second)                 Γöé
  6090. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6091. ΓöéMTU    Guar_adspec_t   composedMTU         Composed path MTU       Γöé
  6092. Γöé                                           (bytes)                 Γöé
  6093. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6094. ΓöéCtot   Guar_adspec_t   Ctot                Total rate-dependent    Γöé
  6095. Γöé                                           error (bytes)           Γöé
  6096. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6097. ΓöéDtot   Guar_adspec_t   Dtot                Total rate-independent  Γöé
  6098. Γöé                                           error (microseconds)    Γöé
  6099. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6100. Γöér      IS_Tspec_t      IS_Tspec_r          Token bucket rate (IP   Γöé
  6101. Γöé                                           packet bytes per second)Γöé
  6102. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6103. Γöéb      IS_Tspec_t      IS_Tspec_b          Token bucket depth      Γöé
  6104. Γöé                                           (bytes)                 Γöé
  6105. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6106. Γöép      IS_Tspec_t      IS_Tspec_p          Peak data rate (IP      Γöé
  6107. Γöé                                           packet bytes per second)Γöé
  6108. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6109. Γöém      IS_Tspec_t      IS_Tspec_m          Minimum Policed Unit    Γöé
  6110. Γöé                                           (bytes)                 Γöé
  6111. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6112. ΓöéM      IS_Tspec_t      IS_Tspec_M          Maximum packet size     Γöé
  6113. Γöé                                           (bytes)                 Γöé
  6114. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6115. ΓöéR      Guar_Rspec_t    Guar_Rspec_R        Guaranteed rate (IP     Γöé
  6116. Γöé                                           packet bytes per second)Γöé
  6117. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6118. ΓöéS      Guar_Rspec_t    Guar_Rspec_S        Slack term              Γöé
  6119. Γöé                                           (microseconds)          Γöé
  6120. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6121.  
  6122. Values for r, b, p, m, M, R, and S are to be computed for the guaranteed 
  6123. reservation.  Assume that the reservation r, b, p, and m are chosen based on 
  6124. the original tspec values in the path message.  If Bmin is greater than r or p, 
  6125. they should be increased at least to Bmin. Assume that the reservation M is set 
  6126. to a reasonable value for the application that is not greater than MTU.  Assume 
  6127. that the minimum delay is not greater than the maximum that the application can 
  6128. tolerate.  Note that all computation described below should be floating point , 
  6129. especially the division by 1000000 that converts between microseconds and 
  6130. seconds. 
  6131.  
  6132. If r <= p <= R then the upper bound on end-to-end requested delay (Dreq) in 
  6133. seconds is: 
  6134.  
  6135. Dreq = (M+Ctot)/R + Dtot/1000000
  6136.  
  6137. If r <= R < p then the upper bound on Dreq in seconds is 
  6138.  
  6139.  
  6140. Dreq = [(b-M)/R*(p-R)/(p-r)] + (M+Ctot)/R + Dtot/1000000
  6141.  
  6142. The higher the value of R is, the lower Dreq will be.  The application will 
  6143. choose an R value that is sufficiently high that the maximum delay is 
  6144. sufficient for what the sender and receiver need to do.  Note that studies have 
  6145. shown that packets will often arrive much more quickly than the maximum delay, 
  6146. and therefore the application must be prepared to buffer them. 
  6147.  
  6148. If the peak rate p is unknown or unspecified, it should be set to infinity. 
  6149. Infinity is represented in IEEE floating point with an exponent of all one bits 
  6150. (255), and a sign and mantissa of all zero bits.  In that case the upper bound 
  6151. on end-to-end delay in seconds simplifies to: 
  6152.  
  6153. Dreq = b/R + Ctot/R + Dtot/1000000
  6154.  
  6155. The slack term S is the difference between the requested maximum delay and the 
  6156. desired delay, and must be a non-negative number.  A typical desired delay is 
  6157. when R is set to r, in the ideal fluid model of flow. The delay in that model 
  6158. is 
  6159.  
  6160. Dideal = b/r + Ctot/r + Dtot/1000000
  6161.  
  6162. The slack term can then be: 
  6163.  
  6164. S = Dreq - Dideal.
  6165.  
  6166. If the application chooses an S greater than zero, then RSVP-enabled nodes on 
  6167. the path can use it and the Csum and Dsum values to adjust their local 
  6168. reservations to lower the amount of resources allocated to the flow. 
  6169.  
  6170. Note that a guaranteed reservation may have its values R and S adjusted by 
  6171. intervening nodes, so that the reservation seen by the sender in the 
  6172. reservation message may be different from what the receiver provided with 
  6173. rapi_reserve() call. 
  6174.  
  6175. For more information, refer to Internet RFC 1633, Integrated Services in the 
  6176. Internet Architecture: an Overview, and Internet Draft 
  6177. draft-ietf-intserv-ctrl-load-svc-07. 
  6178.  
  6179.  
  6180. ΓòÉΓòÉΓòÉ 12. Reference Information ΓòÉΓòÉΓòÉ
  6181.  
  6182. This section describes: 
  6183.  
  6184.     Protocol-Independent C Sockets API 
  6185.  
  6186.      Describes the protocol-independent socket calls supported by networking 
  6187.      services. This information includes call syntax, usage, and related 
  6188.      information. 
  6189.  
  6190.     TCP/IP Network Utility Routines API 
  6191.  
  6192.      Describes the sockets utility and Sockets Secure Support (SOCKS) function 
  6193.      calls supported by networking services. This information includes call 
  6194.      syntax, usage, and related information. 
  6195.  
  6196.     Remote Procedure and eXternal Data Representation API 
  6197.  
  6198.      Describes the remote procedure and XDR function calls along with their 
  6199.      syntax, usage, and related information. 
  6200.  
  6201.     File Transfer Protocol API 
  6202.  
  6203.      Describes the file transfer protocol function calls along with their 
  6204.      syntax, usage, and related information. 
  6205.  
  6206.     Resource ReSerVation Protocol API 
  6207.  
  6208.      Describes the resource reservation protocol function calls along with 
  6209.      their syntax, usage, and related information. 
  6210.  
  6211.  
  6212. ΓòÉΓòÉΓòÉ 13. Protocol-Independent C Sockets API ΓòÉΓòÉΓòÉ
  6213.  
  6214. The following table briefly describes each protocol-independent socket call 
  6215. supported by networking services and identifies where you can find the syntax, 
  6216. parameters, and other appropriate information. The socket calls described in 
  6217. this section can be used to access services for all protocols. 
  6218.  
  6219. Note:  If you are using the internet communications domain (PF_INET protocol 
  6220.        family), you can use all APIs in the following table and those in TCP/IP 
  6221.        Network Utility Routines API. 
  6222.  
  6223. Protocol-Independent Sockets API Quick Reference 
  6224.  
  6225. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6226. ΓöéSocket Call                    Description                        Γöé
  6227. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6228. Γöéaccept()                       Accepts a connection request from aΓöé
  6229. Γöé                               remote host                        Γöé
  6230. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6231. Γöéaccept_and_recv()              Accepts a connection on a socket,  Γöé
  6232. Γöé                               receives the first message from    Γöé
  6233. Γöé                               the connected client, and returns  Γöé
  6234. Γöé                               the local and peer addresses       Γöé
  6235. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6236. Γöéaddsockettolist()              Adds a socket to the list of owned Γöé
  6237. Γöé                               sockets for the calling process    Γöé
  6238. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6239. Γöébind()                         Binds a local name to the socket   Γöé
  6240. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6241. Γöéconnect()                      Requests a connection to a remote  Γöé
  6242. Γöé                               host                               Γöé
  6243. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6244. Γöégetpeername()                  Gets the name of the peer connectedΓöé
  6245. Γöé                               to socket                          Γöé
  6246. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6247. Γöégetsockname()                  Gets the local socket name         Γöé
  6248. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6249. Γöégetsockopt()                   Gets the socket options associated Γöé
  6250. Γöé                               with a socket                      Γöé
  6251. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6252. Γöéioctl()                        Performs special operations on     Γöé
  6253. Γöé                               sockets                            Γöé
  6254. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6255. Γöélisten()                       Completes the binding necessary forΓöé
  6256. Γöé                               a socket to accept connections and Γöé
  6257. Γöé                               creates a connection request queue Γöé
  6258. Γöé                               for incoming requests              Γöé
  6259. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6260. Γöéos2_ioctl()                    Performs special operations on     Γöé
  6261. Γöé                               sockets; in particular, operations Γöé
  6262. Γöé                               related to returning status from   Γöé
  6263. Γöé                               kernel                             Γöé
  6264. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6265. Γöéos2_select()                   Gets read, write, and exception    Γöé
  6266. Γöé                               status on a group of sockets (OS/2 Γöé
  6267. Γöé                               version)                           Γöé
  6268. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6269. Γöépsock_errno()                  Writes a short error message to theΓöé
  6270. Γöé                               standard error device              Γöé
  6271. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6272. Γöéreadv()                        Receives data on a socket into a   Γöé
  6273. Γöé                               set of buffers                     Γöé
  6274. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6275. Γöérecv()                         Receives data on a connected socketΓöé
  6276. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6277. Γöérecvfrom()                     Receives data on a socket          Γöé
  6278. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6279. Γöérecvmsg()                      Receives data and control          Γöé
  6280. Γöé                               information on a socket            Γöé
  6281. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6282. Γöéremovesocketfromlist()         Removes a socket from the list of  Γöé
  6283. Γöé                               owned sockets for the calling      Γöé
  6284. Γöé                               process                            Γöé
  6285. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6286. Γöéselect()                       Gets read, write, and exception    Γöé
  6287. Γöé                               status on a group of sockets (BSD  Γöé
  6288. Γöé                               version)                           Γöé
  6289. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6290. Γöésend()                         Sends data on a connected socket   Γöé
  6291. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6292. Γöésend_file()                    Sends the file data over a         Γöé
  6293. Γöé                               connected socket                   Γöé
  6294. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6295. Γöésendmsg()                      Sends data and control information Γöé
  6296. Γöé                               on a socket                        Γöé
  6297. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6298. Γöésendto()                       Sends data on a socket             Γöé
  6299. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6300. Γöésetsockopt()                   Sets options associated with a     Γöé
  6301. Γöé                               socket                             Γöé
  6302. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6303. Γöéshutdown()                     Shuts down all or part of a full   Γöé
  6304. Γöé                               duplex connection                  Γöé
  6305. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6306. Γöéso_cancel()                    Cancels a pending blocking sockets Γöé
  6307. Γöé                               API call on a socket               Γöé
  6308. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6309. Γöésock_errno()                   Returns error code set by a socket Γöé
  6310. Γöé                               call                               Γöé
  6311. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6312. Γöésocket()                       Creates an endpoint for            Γöé
  6313. Γöé                               communication and returns a socket Γöé
  6314. Γöé                               descriptor representing the        Γöé
  6315. Γöé                               endpoint                           Γöé
  6316. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6317. Γöésoclose()                      Shuts down a socket and frees      Γöé
  6318. Γöé                               resources allocated to the socket  Γöé
  6319. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6320. Γöésysctl()                       Performs special operations on the Γöé
  6321. Γöé                               TCP/IP stack kernel                Γöé
  6322. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6323. Γöéwritev()                       Writes data from a set of specifiedΓöé
  6324. Γöé                               buffers on a socket                Γöé
  6325. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6326.  
  6327.  
  6328. ΓòÉΓòÉΓòÉ 13.1. accept() ΓòÉΓòÉΓòÉ
  6329.  
  6330. The accept() socket call accepts a connection request from a remote host. 
  6331. Raccept() accepts a connection request from a SOCKS server. See Socket Secure 
  6332. Support for information about SOCKS. 
  6333.  
  6334. Syntax 
  6335.  
  6336. #include <types.h>
  6337. #include <sys\socket.h>
  6338. #include <netinet\in.h>
  6339. #include <netnb\nb.h>
  6340. #include <sys\un.h>
  6341. int accept(s, name, namelen)
  6342. int s;
  6343. sockaddr *name;
  6344. int *namelen;
  6345.  
  6346. Parameters 
  6347.  
  6348.   Socket descriptor. 
  6349.  
  6350. name 
  6351.   Pointer to a sockaddr structure that contains the socket address of the 
  6352.   connection client when the accept() call returns. The format of name is 
  6353.   determined by the communications domain where the client resides. This 
  6354.   parameter can be NULL if the caller is not interested in the client address. 
  6355.  
  6356. namelen 
  6357.   Must initially point to an integer that contains the size in bytes of the 
  6358.   storage pointed to by name.  On return, that integer contains the size of the 
  6359.   data returned in the storage pointed to by name. If name is NULL, namelen is 
  6360.   ignored and can be NULL. 
  6361.  
  6362. Description 
  6363.  
  6364. This call is used by a server acting in a connection-oriented mode to accept a 
  6365. connection request from a client.  The call accepts the first connection on its 
  6366. queue of pending connection requests. The accept() call creates a new socket 
  6367. descriptor with the same properties as s and returns it to the caller. The new 
  6368. socket descriptor cannot be used to accept new connections. The original 
  6369. socket, s, remains available to accept more connection requests. 
  6370.  
  6371. If the queue has no pending connection requests, accept() blocks the caller 
  6372. unless s is in nonblocking mode.  If no connection requests are queued and s is 
  6373. in nonblocking mode, accept() returns a value of -1 and sets the return code to 
  6374. SOCEWOULDBLOCK. 
  6375.  
  6376. The s parameter must be a socket descriptor created with the socket() call.  It 
  6377. is usually bound to an address with the bind() call and must be made capable of 
  6378. accepting connections with the listen() call.  The listen() call marks the 
  6379. socket as one that accepts connections and allocates a queue to hold pending 
  6380. connection requests. The listen() call allows the caller to place an upper 
  6381. boundary on the size of the queue. 
  6382.  
  6383. The name parameter is a pointer to a buffer where the connection requester 
  6384. address is placed. The name parameter is optional and can be set to be the NULL 
  6385. pointer.  If set to NULL, the requester address is not copied into the buffer. 
  6386. The exact format of name depends on the communications domain where the 
  6387. communication request originated. For example, if the connection request 
  6388. originated in the internet domain, name points to a sockaddr_in structure as 
  6389. defined in the header file <NETINET\IN.H>. 
  6390.  
  6391. The namelen parameter is used only if name is not NULL. Before calling 
  6392. accept(), you must set the integer pointed to by namelen to the size, in bytes, 
  6393. of the buffer pointed to by name. On successful return, the integer pointed to 
  6394. by namelen contains the actual number of bytes copied into the buffer. If the 
  6395. buffer is not large enough to hold the address, up to namelen bytes of the 
  6396. requester address are copied. 
  6397.  
  6398. This call is used only with SOCK_STREAM or SOCK_SEQPACKET sockets. You cannot 
  6399. screen requesters without calling accept().  The application cannot tell the 
  6400. system the requesters it will accept connections from.  The caller can, 
  6401. however, choose to close a connection immediately after discovering the 
  6402. identity of the requester. 
  6403.  
  6404. The select() call can be used to check the socket for incoming connection 
  6405. requests. 
  6406.  
  6407. Return Values 
  6408.  
  6409. A non-negative socket descriptor indicates success; the value -1 indicates an 
  6410. error. You can get the specific error code by calling sock_errno() or 
  6411. psock_errno(). 
  6412.  
  6413. Error Code             Description
  6414.  
  6415. SOCENOTSOCK            The s parameter is not a valid socket descriptor. 
  6416.  
  6417. SOCEFAULT              Using name and namelen would result in an attempt to 
  6418.                        copy the address into a portion of the caller address 
  6419.                        space into which information cannot be written. 
  6420.  
  6421. SOCEINTR               Interrupted system call. 
  6422.  
  6423. SOCEINVAL              Listen() was not called for socket s. 
  6424.  
  6425. SOCENOBUFS             Insufficient buffer space available to create the new 
  6426.                        socket. 
  6427.  
  6428. SOCEOPNOTSUPP          The s parameter is not connection-oriented. 
  6429.  
  6430. SOCEWOULDBLOCK         The s parameter is in nonblocking mode and no 
  6431.                        connections are on the queue. 
  6432.  
  6433. SOCECONNABORTED        The software caused a connection close. 
  6434.  
  6435. Examples 
  6436.  
  6437. The following are two examples of the accept() call.  In the first, the caller 
  6438. wants to have the requester address returned. In the second, the caller does 
  6439. not want to have the requester address returned. 
  6440.  
  6441. int clientsocket;
  6442. int s;
  6443. struct sockaddr clientaddress;
  6444. int addrlen;
  6445. int accept(int s, struct sockaddr *addr, int *addrlen); /* extracted from sys/socket.h */
  6446. /* socket(), bind(), and listen() have been called */
  6447. /* EXAMPLE 1: I want the address now */
  6448. addrlen = sizeof(clientaddress);
  6449. clientsocket = accept(s, &clientaddress, &addrlen);
  6450. /* EXAMPLE 2: I can get the address later using getpeername() */
  6451. clientsocket = accept(s, (struct sockaddr *) 0, (int *) 0);
  6452.  
  6453. Related Calls 
  6454.  
  6455.      accept_and_recv() 
  6456.      bind() 
  6457.      connect() 
  6458.      getpeername() 
  6459.      getsockname() 
  6460.      listen() 
  6461.      sock_errno() 
  6462.      socket() 
  6463.  
  6464.  
  6465. ΓòÉΓòÉΓòÉ 13.2. accept_and_recv() ΓòÉΓòÉΓòÉ
  6466.  
  6467. The accept_and_recv( ) API accepts a connection on a socket, receives the first 
  6468. message from the connected client, and returns the local and peer addresses. 
  6469.  
  6470. Syntax 
  6471.  
  6472. #include <types.h>
  6473. #include <sys\socket.h>
  6474. #include <netinet\in.h>
  6475. #include <sys\time.h>
  6476. int accpet_and_recv(s,&sock_accex,&cli_addr,&cli_len,&local,&locallen,outbuff,alloc)
  6477. int s;
  6478. long sock_accex;
  6479. struct sockaddr_in cli_addr;
  6480. long cli_len;
  6481. struct sockaddr_in local;
  6482. long locallen;
  6483. char * outbuff;
  6484. int alloc;
  6485.  
  6486. Parameters 
  6487.  
  6488.   Socket descriptor of the listening socket. 
  6489.  
  6490. sock_accex 
  6491.   Pointer to an int that specifies the socket on which to accept the 
  6492.   connection. This pointer should be initialized to -1 so that the kernel 
  6493.   accepts the socket and returns this pointer to the application using this 
  6494.   parameter. 
  6495.  
  6496. cli_addr 
  6497.   Pointer to a sockaddr structure where the address of the connecting socket 
  6498.   will be returned. 
  6499.  
  6500. cli_len 
  6501.   Pointer to a socklen_t that, on output, specifies the length of the stored 
  6502.   address. 
  6503.  
  6504. local_addr 
  6505.   Pointer to a sockaddr structure where the address of the connecting socket 
  6506.   will be returned. 
  6507.  
  6508. locallen 
  6509.   Pointer to a socklen_t that, on, output specifies the length of the stored 
  6510.   address. 
  6511.  
  6512. outbuff 
  6513.   Pointer to the buffer where the message should be stored. 
  6514.  
  6515. alloc 
  6516.   Length in bytes of the buffer pointed to by the buffer argument. 
  6517.  
  6518. Description 
  6519.  
  6520. The accept_and_recv( ) call combines the socket functions accept( ) and recv( ) 
  6521. into a single API transition. The accept_and_recv( ) function accepts a new 
  6522. connection, receives the first block of data from the client and returns the 
  6523. local and remote addresses to the application. The thread sleeping on 
  6524. accept_and_recv( ) wakes-up only after it gets the first data block from the 
  6525. client. 
  6526.  
  6527. Return Values 
  6528.  
  6529. The total number of bytes received in the receive buffer associated with the 
  6530. accept_and_recv() is returned upon successful completion and a value of -1 is 
  6531. returned in case of an error. 
  6532.  
  6533. Error Code             Description
  6534.  
  6535. EBADF                  The sockfd or the sock_accex is not a valid descriptor. 
  6536.  
  6537. ECONNABORTED           A connection has been ended. 
  6538.  
  6539. ECONNRESET             A connection was forcibly closed by a peer. 
  6540.  
  6541. EFAULT                 The buffer pointed to by sock_accex,cli_addr, clilen, 
  6542.                        local, locallen or buffer was not valid. 
  6543.  
  6544. EISCONN                The sock_accex is either bound or already connected. 
  6545.  
  6546. ENOTSOCK               The sockfd or the sock_accex argument does not refer to 
  6547.                        a socket. 
  6548.  
  6549. EOPNOTSUPP             The socket type of the specified socket does not support 
  6550.                        accepting connections or the O_NONBLOCK is set for this 
  6551.                        socket and non-blocking is not supported for this 
  6552.                        function, or the                       accept_and_recv( ) function is 
  6553.                        not supported by this version of TCP/IP. 
  6554.  
  6555. ENOREUSE               Socket reuse is not supported. 
  6556.  
  6557. EINTR                  The accept_and_recv( ) function was interrupted by a 
  6558.                        signal that was caught before a valid connection 
  6559.                        arrived. 
  6560.  
  6561. EINTRNODATA            The accept_and_recv( ) function was interrupted by a 
  6562.                        signal that was caught after a valid connection arrived 
  6563.                        but before the first block of data. 
  6564.  
  6565. EINVAL                 The sockfd is not accepting connections. 
  6566.  
  6567. EMFILE                 {OPEN_MAX} descriptors are currently open in the calling 
  6568.                        process. 
  6569.  
  6570. ENFILE                 The maximum number of descriptors in the system are 
  6571.                        already open. 
  6572.  
  6573. EIO                    An I/O error occured. 
  6574.  
  6575. ENOBUFS                No buffer space available. 
  6576.  
  6577. ENOMEM                 There was insufficient memory available to complete the 
  6578.                        operation. 
  6579.  
  6580. EPROTO                 A protocol error occured. 
  6581.  
  6582. ENOSR                  There are insufficient STREAMS resources available for 
  6583.                        the operation to complete. 
  6584.  
  6585. Related Calls 
  6586.  
  6587.      accept() 
  6588.      recv() 
  6589.      bind() 
  6590.      connect() 
  6591.      getpeername() 
  6592.      getsockname() 
  6593.      listen() 
  6594.      sock_errno() 
  6595.      socket() 
  6596.  
  6597.  
  6598. ΓòÉΓòÉΓòÉ 13.3. addsockettolist() ΓòÉΓòÉΓòÉ
  6599.  
  6600. The addsockettolist() call adds a socket to the list of owned sockets for the 
  6601. calling process. 
  6602.  
  6603. Syntax 
  6604.  
  6605. #include <types.h>
  6606. #include <sys\socket.h>
  6607. void addsockettolist(s)
  6608. int s;
  6609.  
  6610. Parameters 
  6611.  
  6612.   Socket descriptor. 
  6613.  
  6614. Description 
  6615.  
  6616. When a process ends, the sockets library automatically cleans up sockets by 
  6617. registering an exit list handler.  This exit routine closes all open sockets 
  6618. that are maintained in a process's socket list. When a process is initiated the 
  6619. list is empty, and whenever a socket(), accept(), or soclose() call is made the 
  6620. list is updated.  The addsockettolist() call provides a mechanism to transfer 
  6621. socket ownership to another process. The addsockettolist() call adds the socket 
  6622. indicated by the s parameter to the calling process's socket ownership list. 
  6623.  
  6624. Return Values 
  6625.  
  6626. The value 1 indicates success; the value 0 indicates an error. 
  6627.  
  6628. Related Calls 
  6629.  
  6630.      removesocketfromlist() 
  6631.  
  6632.  
  6633. ΓòÉΓòÉΓòÉ 13.4. bind() ΓòÉΓòÉΓòÉ
  6634.  
  6635. The bind() socket call binds a local name to the socket. Rbind() binds a SOCKS 
  6636. local name to the socket. See Socket Secure Support for information about 
  6637. SOCKS. 
  6638.  
  6639. Syntax 
  6640.  
  6641. #include <types.h>
  6642. #include <sys\socket.h>
  6643. int bind(s, name, namelen)
  6644. int s;
  6645. struct sockaddr *name;
  6646. int namelen;
  6647.  
  6648. Parameters 
  6649.  
  6650.   Socket descriptor returned by a previous call to socket(). 
  6651.  
  6652. name 
  6653.   Pointer to a sockaddr structure containing the name that is to be bound to s. 
  6654.  
  6655. namelen 
  6656.   Size in bytes of the sockaddr structure pointed to by name. 
  6657.  
  6658. Description 
  6659.  
  6660. The bind() call binds a unique local name to the socket with descriptor s. 
  6661. After calling socket(), a descriptor does not have a name associated with it. 
  6662. However, it does belong to a particular addressing family as specified when 
  6663. socket() is called.  The exact format of a name depends on the addressing 
  6664. family.  The bind() procedure also allows servers to specify from which network 
  6665. interfaces they wish to receive UDP packets and TCP connection requests. 
  6666.  
  6667. If s was created in the AF_INET domain, the format of the name buffer is 
  6668. expected to be sockaddr_in as defined in the header file <NETINET\IN.H>: 
  6669.  
  6670. struct in_addr
  6671. {
  6672.         u_long s_addr;
  6673. };
  6674. struct sockaddr_in
  6675. {
  6676.         u_char  sin_len;
  6677.         u_char  sin_family;
  6678.         u_short sin_port;
  6679.         struct  in_addr sin_addr;
  6680.         char    sin_zero[8];
  6681. };
  6682.  
  6683. The sin_len field is ignored. The sin_family field must be set to AF_INET.  The 
  6684. sin_port field is set to the port that the application must bind to.  It must 
  6685. be specified in network byte order.  If sin_port is set to 0, the caller leaves 
  6686. it to the system to assign an available port.  The application can call 
  6687. getsockname() to discover the port number assigned.  The sin_addr field is set 
  6688. to the internet address and must be specified in network byte order.  On hosts 
  6689. with more than one network interface (called multihomed hosts), a caller can 
  6690. select the interface that the host will bind to. 
  6691.  
  6692. Subsequently, only UDP packets or TCP connection requests which match the bound 
  6693. name from this interface are routed to the socket.  If sin_addr is set to the 
  6694. constant INADDR_ANY, as defined in <NETINET\IN.H>, the caller is requesting 
  6695. that the socket be bound to all network interfaces on the host.  After this, 
  6696. UDP packets or TCP connections which match the bound name from all interfaces 
  6697. are routed to the socket.  This becomes important when a server offers a 
  6698. service to multiple networks.  By leaving the address unspecified, the server 
  6699. can accept all UDP packets or TCP connection requests made for its port, 
  6700. regardless of the network interface on which the requests arrived.  The 
  6701. sin_zero field is not used and must be set to all zeros. 
  6702.  
  6703. In the NetBIOS (AF_NET) domain, set all 16 characters in snb_name in the 
  6704. sockaddr_nb structure to binary zeros (null). The system will generate a name 
  6705. for the socket. 
  6706.  
  6707. Return Values 
  6708.  
  6709. The value 0 indicates success; the value -1 indicates an error. You can get the 
  6710. specific error code by calling sock_errno() or psock_errno(). 
  6711.  
  6712. Error Code              Description
  6713.  
  6714. SOCEADDRINUSE           The address is already in use.  See the SO_REUSEADDR 
  6715.                         option described under getsockopt() and the 
  6716.                         SO_REUSEADDR option described under setsockopt(). 
  6717.  
  6718. SOCEADDRNOTAVAIL        The address specified is not valid on this host.  For 
  6719.                         example, the internet address does not specify a valid 
  6720.                         network interface. 
  6721.  
  6722. SOCEAFNOSUPPORT         The address family is not supported. 
  6723.  
  6724. SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  6725.  
  6726. SOCEFAULT               Using name and namelen would result in an attempt to 
  6727.                         copy the address into a non-writable portion of the 
  6728.                         caller's address space. 
  6729.  
  6730. SOCEINVAL               The socket is already bound to an address, or namelen 
  6731.                         is not the expected length. 
  6732.  
  6733. SOCENOBUFS              No buffer space is available. 
  6734.  
  6735. Examples 
  6736.  
  6737. Note the following about the bind() call examples: 
  6738.  
  6739.     For the internet examples, put the internet address and port in 
  6740.      network-byte order. To put the port into network-byte order, use the 
  6741.      htons() utility routine to convert a short integer from host-byte order to 
  6742.      network-byte order. 
  6743.  
  6744.     For the internet examples, set the address field using the inet_addr() 
  6745.      utility routine, which takes a character string representing the 
  6746.      dotted-decimal address of an interface and returns the binary internet 
  6747.      address representation in network-byte order. 
  6748.  
  6749.     Zero the structure before using it to ensure that the name requested does 
  6750.      not set any reserved fields. 
  6751.  
  6752. See connect() for examples of how a client might connect to servers. 
  6753.  
  6754. int rc;
  6755. int s;
  6756. struct sockaddr_in myname;
  6757. int bind(int s, struct sockaddr *name, int namelen); /* extracted from sys/socket.h */
  6758. /* Bind to a specific interface in the internet domain */
  6759. /* clear the structure */
  6760. memset(&myname, 0, sizeof(myname));
  6761. myname.sin_len = sizeof(myname);
  6762. myname.sin_family = AF_INET;
  6763. myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  6764. myname.sin_port = htons(1024);
  6765. ...
  6766. rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  6767.  
  6768. /* Bind to all internet network interfaces on the system */
  6769. /* clear the structure */
  6770. memset(&myname, 0, sizeof(myname));
  6771. myname.sin_len = sizeof(myname);
  6772. myname.sin_family = AF_INET;
  6773. myname.sin_addr.s_addr = INADDR_ANY; /* all interfaces */
  6774. myname.sin_port = htons(1024);
  6775. ...
  6776. rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  6777.  
  6778. /* Bind to a specific interface in the internet domain.
  6779. Let the system choose a port                        */
  6780. /* clear the structure */
  6781. memset(&myname, 0, sizeof(myname));
  6782. myname.sin_len = sizeof(myname);
  6783. myname.sin_family = AF_INET;
  6784. myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  6785. myname.sin_port = 0;
  6786. ...
  6787. rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  6788.  
  6789. /* Bind to a unique NetBIOS name on adapter 0 */
  6790. struct sockaddr_nb nbname;
  6791. memset(&nbname, 0, sizeof(nbname));
  6792. nbname.sin_len = sizeof(nbname);
  6793. nbname.snb_family = AF_NB;
  6794. nbname.snb_type = NB_UNIQUE;
  6795. nbname.snb_adapter = 0;
  6796. strcpy(nbname.snb_name, "NBSERVER"); /* Note that a NetBIOS name is
  6797.                                         16 bytes long.  In this example,
  6798.                                         the last 8 bytes are filled
  6799.                                         with zeros.                    */
  6800.  
  6801. ...
  6802. rc = bind(s, (struct sockaddr *) &nbname, sizeof(nbname));
  6803.  
  6804. Related Calls 
  6805.  
  6806.      connect() 
  6807.      gethostbyname() 
  6808.      getsockname() 
  6809.      htons() 
  6810.      inet_addr() 
  6811.      listen() 
  6812.      sock_errno() 
  6813.      socket() 
  6814.  
  6815.  
  6816. ΓòÉΓòÉΓòÉ 13.5. connect() ΓòÉΓòÉΓòÉ
  6817.  
  6818. The connect() socket call requests a connection to a remote host. 
  6819.  
  6820. Syntax 
  6821.  
  6822. #include <types.h>
  6823. #include <sys\socket.h>
  6824. int connect(s, name, namelen)
  6825. int s;
  6826. struct sockaddr *name;
  6827. int namelen;
  6828.  
  6829. Parameters 
  6830.  
  6831.   Socket descriptor used to originate the connection request. 
  6832.  
  6833. name 
  6834.   Pointer to a sockaddr structure containing the address of the socket to which 
  6835.   a connection will be attempted. 
  6836.  
  6837. namelen 
  6838.   Size in bytes of the sockaddr structure pointed to by name. 
  6839.  
  6840. Description 
  6841.  
  6842. The following diagram illustrates connect() processing: 
  6843.  
  6844.  
  6845. connect() Processing
  6846.  
  6847. If you are using a SOCKS server, connect() calls Rconnect(). See Socket Secure 
  6848. Support for information about SOCKS. 
  6849.  
  6850. Stream or sequenced packet sockets: The connect() call performs two tasks when 
  6851. called for a stream or sequenced packet socket: 
  6852.  
  6853.   1. Completes the binding if necessary for a socket 
  6854.   2. Attempts to create a connection between two sockets. 
  6855.  
  6856. This call is used by the client side of socket-based applications to establish 
  6857. a connection with a server. The remote server must have a passive open pending. 
  6858. This means the server must successfully call bind() and listen(); otherwise, 
  6859. connect() returns a value of -1 and the error value is set to SOCECONNREFUSED. 
  6860. If you are using a SOCKS server and the connection is rejected by the SOCKS 
  6861. server, the return code will be SOCECONNREFUSED. 
  6862.  
  6863. In the internet communication domain, a timeout occurs if a connection to the 
  6864. remote host is not successful within 75 seconds (1 minute and 15 seconds). 
  6865. There is no timeout for Local IPC. In the NetBIOS communication domain, a 
  6866. timeout occurs if a connection to the host is not successful within the time 
  6867. defined by the NetBIOS protocol parameters Transmit Timer multiplied by 
  6868. Transmit Retry. 
  6869.  
  6870. If s is in blocking mode, the connect() call blocks the caller until the 
  6871. connection is established or until an error is received.  If the socket is in 
  6872. nonblocking mode, and the connection was successfully initiated, connect() 
  6873. returns a value of -1 and sets the error value to SOCEINPROGRESS. The caller 
  6874. can test the completion of the connection setup by calling: 
  6875.  
  6876.     select(), to test for the ability to write to the socket 
  6877.     getsockopt(), with option SO_ERROR, to test if the connection succeeded 
  6878. Stream or sequenced packet sockets can call connect() only once.
  6879.  
  6880. Datagram or raw sockets: The connect() call specifies the destination peer 
  6881. address when called for a datagram or raw socket. Normally, datagram and raw 
  6882. sockets use connectionless data transfer calls such as sendto() and recvfrom(). 
  6883. However, applications can call connect() to specify and store the destination 
  6884. peer address for this socket.  The system will then know which address to send 
  6885. data to on this socket. This method of communication allows datagram and raw 
  6886. sockets to be connected. However, data is still not guaranteed to be delivered. 
  6887. Thus the normal features of connectionless mode sockets are maintained. The 
  6888. address is remembered until another connect() call is made. This permits the 
  6889. use of readv(), recv(), send(), and writev(), which are usually reserved for 
  6890. connection-oriented sockets. The application can still use sendto(), 
  6891. recvfrom(), sendmsg(), and recvmsg().  The advantage of calling connect() and 
  6892. being connected is that the destination peer address does not have to be 
  6893. specified for all datagrams sent. 
  6894.  
  6895. Datagram and raw sockets can call connect() multiple times. The application can 
  6896. reset their destination address by specifying a new address on the connect() 
  6897. call. In addition, the socket can be returned to operate in a connectionless 
  6898. mode by calling connect() with a null destination address. The null address is 
  6899. created by zeroing the sockaddr structure and only setting the address family 
  6900. field. The call to connect will return a value of -1, indicating that the 
  6901. connection to the null address cannot be established. Calling sock_errno() will 
  6902. return SOCEADDRNOTAVAIL. For more information on connecting datagram sockets, 
  6903. see Description for sendto(). 
  6904.  
  6905. Return Values 
  6906.  
  6907. The value 0 indicates success; the value -1 indicates an error. You can get the 
  6908. specific error code by calling sock_errno() or psock_errno(). If you are using 
  6909. a SOCKS server and the SOCKS server rejects the connection, the return code 
  6910. will be SOCECONNREFUSED. 
  6911.  
  6912. Error Code              Description
  6913.  
  6914. SOCEADDRNOTAVAIL        The calling host cannot reach the specified 
  6915.                         destination. 
  6916.  
  6917. SOCEAFNOSUPPORT         The address family is not supported. 
  6918.  
  6919. SOCEALREADY             The socket s is marked nonblocking, and a previous 
  6920.                         connection attempt has not completed. 
  6921.  
  6922. SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  6923.  
  6924. SOCECONNREFUSED         The connection request was rejected by the destination 
  6925.                         host. If you are using a SOCKS server and the SOCKS 
  6926.                         server rejects the connection, the return code will be 
  6927.                         SOCECONNREFUSED. 
  6928.  
  6929. SOCEFAULT               Using name and namelen would result in an attempt to 
  6930.                         copy the address into a portion of the caller's address 
  6931.                         space to which data cannot be written. 
  6932.  
  6933. SOCEINPROGRESS          The socket s is marked nonblocking, and the connection 
  6934.                         cannot be completed immediately. The SOCEINPROGRESS 
  6935.                         value does not indicate an error condition. 
  6936.  
  6937. SOCEINTR                Interrupted system call. 
  6938.  
  6939. SOCEINVAL               The namelen parameter is not a valid length. 
  6940.  
  6941. SOCEISCONN              The socket s is already connected. 
  6942.  
  6943. SOCENETUNREACH          The network cannot be reached from this host. 
  6944.  
  6945. SOCETIMEDOUT            The connection establishment timed out before a 
  6946.                         connection was made. 
  6947.  
  6948. SOCENOBUFS              No buffer space is available. 
  6949.  
  6950. SOCEOPNOTSUPP           The operation is not supported on socket s. 
  6951.  
  6952. Examples 
  6953.  
  6954. Note the following about these connect() call examples: 
  6955.  
  6956.     For the internet examples, put the internet address and port in 
  6957.      network-byte order.  To put the port into network-byte order, use the 
  6958.      htons() utility routine to convert a short integer from host-byte order to 
  6959.      network-byte order. 
  6960.  
  6961.     For the internet examples, set the address field using the inet_addr() 
  6962.      utility routine, which takes a character string representing the 
  6963.      dotted-decimal address of an interface and returns the binary internet 
  6964.      address representation in network-byte order. 
  6965.  
  6966.     To ensure that the name requested does not set any reserved fields, zero 
  6967.      the structure before using it. 
  6968.  
  6969. These examples could be used to connect to the servers shown in the examples 
  6970. listed for bind(). 
  6971.  
  6972. int s;
  6973. struct sockaddr_in servername;
  6974. int rc;
  6975. int connect(int s, struct sockaddr *name, int namelen); /* extracted from sys/socket.h */
  6976. /* Connect to server bound to a specific interface in the internet domain */
  6977. /* clear the structure */
  6978. memset(&servername, 0, sizeof(servername));
  6979. servername.sin_len = sizeof(servername);
  6980. servername.sin_family = AF_INET;
  6981. servername.sin_addr.s_addr = inet_addr("129.5.24.1"); /* specific interface */
  6982. servername.sin_port = htons(1024); /* set to the port to which */
  6983.                                            /* the server is bound */
  6984. ...
  6985. rc = connect(s, (struct sockaddr *) &servername, sizeof(servername));
  6986.  
  6987. /* Connect to a NetBIOS server */
  6988. struct sockaddr_nb nbservername;
  6989. memset(&nbservername, 0, sizeof(nbservername));
  6990. nbservername.snb_len = sizeof(nbservername);
  6991. nbservername.snb_family = AF_NB;
  6992. nbservername.snb_type = NB_UNIQUE;
  6993. nbservername.snb_adapter = 0;
  6994. strcpy(nbservername.snb_name, "NBSERVER");
  6995. ...
  6996. rc = connect(s, (struct sockaddr *) &nbservername, sizeof(nbservername));
  6997.  
  6998. Related Calls 
  6999.  
  7000.      accept() 
  7001.      accept_and_recv() 
  7002.      bind() 
  7003.      getsockname() 
  7004.      htons() 
  7005.      inet_addr() 
  7006.      listen() 
  7007.      Rconnect() 
  7008.      select() 
  7009.      send() 
  7010.      sock_errno() 
  7011.      socket() 
  7012.  
  7013.  
  7014. ΓòÉΓòÉΓòÉ 13.6. getpeername() ΓòÉΓòÉΓòÉ
  7015.  
  7016. The getpeername() socket call gets the name of the peer connected to socket. 
  7017.  
  7018. Syntax 
  7019.  
  7020. #include <types.h>
  7021. #include <sys\socket.h>
  7022. int getpeername(s, name, namelen)
  7023. int s;
  7024. struct sockaddr *name;
  7025. int *namelen;
  7026.  
  7027. Parameters 
  7028.  
  7029.   Socket descriptor. 
  7030.  
  7031. name 
  7032.   Pointer to a sockaddr structure.  The name of the peer connected to socket s 
  7033.   is returned. The exact format of name is determined by the domain where 
  7034.   communication occurs. 
  7035.  
  7036. namelen 
  7037.   Pointer to the size in bytes of the sockaddr structure pointed to by name. 
  7038.  
  7039. Description 
  7040.  
  7041. This call returns the name of the peer connected to socket s. The namelen 
  7042. parameter must be initialized to indicate the size of the space pointed to by 
  7043. name. On return, namelen is set to the size of the peer name copied. If the 
  7044. buffer is too small, the peer name is truncated. 
  7045.  
  7046. The getpeername() call operates only on connected sockets. If the connection is 
  7047. through a SOCKS server, the address returned will be that of the SOCKS server. 
  7048.  
  7049. A process can use the getsockname() call to retrieve the local address of a 
  7050. socket. 
  7051.  
  7052. Return Values 
  7053.  
  7054. The value 0 indicates success; the value -1 indicates an error. You can get the 
  7055. specific error code by calling sock_errno() or psock_errno(). 
  7056.  
  7057. Error Code          Description
  7058.  
  7059. SOCENOTSOCK         The s parameter is not a valid socket descriptor. 
  7060.  
  7061. SOCEFAULT           Using the name and namelen parameters as specified would 
  7062.                     result in an attempt to access storage outside of the 
  7063.                     address space of the caller. 
  7064.  
  7065. SOCENOTCONN         The socket is not connected. 
  7066.  
  7067. SOCENOBUFS          No buffer space is available. 
  7068.  
  7069. Related Calls 
  7070.  
  7071.      accept() 
  7072.      bind() 
  7073.      connect() 
  7074.      getsockname() 
  7075.      Rgetsockname() 
  7076.      sock_errno() 
  7077.      socket() 
  7078.  
  7079.  
  7080. ΓòÉΓòÉΓòÉ 13.7. getsockname() ΓòÉΓòÉΓòÉ
  7081.  
  7082. The getsockname() socket call gets the local socket name.  If you are using a 
  7083. SOCKS server, see Socket Secure Support for information about SOCKS. 
  7084.  
  7085. Syntax 
  7086.  
  7087. #include <types.h>
  7088. #include <sys\socket.h>
  7089. int getsockname(s, name, namelen)
  7090. int s;
  7091. struct sockaddr *name;
  7092. int *namelen;
  7093.  
  7094. Parameters 
  7095.  
  7096.   Socket descriptor. 
  7097.  
  7098. name 
  7099.   Pointer to a sockaddr structure. The name of s is returned. 
  7100.  
  7101. namelen 
  7102.   Pointer to the size in bytes of the buffer pointed to by name. 
  7103.  
  7104. Description 
  7105.  
  7106. This call returns the name for the socket specified by the s parameter in the 
  7107. structure pointed to by the name parameter.  It returns the address to the 
  7108. socket that has been bound.  If the socket is not bound to an address, the call 
  7109. returns with the family set and the rest of the structure is set to zero. For 
  7110. example, an unbound socket in the internet domain would cause the name to point 
  7111. to a sockaddr_in structure with the sin_family field set to AF_INET and all 
  7112. other fields zeroed. 
  7113.  
  7114. The namelen parameter must be initialized to indicate the size of the space 
  7115. pointed to by name and is set to the size of the local name copied. If the 
  7116. buffer is too small, the local name is truncated. 
  7117.  
  7118. Sockets are explicitly assigned a name after a successful call to bind(). 
  7119. Stream and sequenced packet sockets are implicitly assigned a name after a 
  7120. successful call to connect() or accept() if bind() was not called. 
  7121.  
  7122. If the socket is connected through a SOCKS server, this call returns the IP 
  7123. address and port of the local machine that is being used to communicate with 
  7124. the SOCKS server. 
  7125.  
  7126. The getsockname() call is often used to discover the port assigned to a socket 
  7127. after the socket has been implicitly bound to a port.  For example, an 
  7128. application can call connect() without previously calling bind(). In this case, 
  7129. the connect() call completes the binding necessary by assigning a port to the 
  7130. socket. 
  7131.  
  7132. A process can use the getpeername() call to determine the address of a 
  7133. destination socket in a socket connection. 
  7134.  
  7135. Return Values 
  7136.  
  7137. The value 0 indicates success; the value -1 indicates an error. You can get the 
  7138. specific error code by calling sock_errno() or psock_errno(). 
  7139.  
  7140. Error Code        Description
  7141.  
  7142. SOCENOTSOCK       The s parameter is not a valid socket descriptor. 
  7143.  
  7144. SOCEFAULT         Using the name and namelen parameters as specified would 
  7145.                   result in an attempt to access storage outside of the address 
  7146.                   space of the caller. 
  7147.  
  7148. SOCENOBUFS        No buffer space available. 
  7149.  
  7150. Related Calls 
  7151.  
  7152.      accept() 
  7153.      accept_and_recv() 
  7154.      bind() 
  7155.      connect() 
  7156.      getpeername() 
  7157.      Rgetsockname() 
  7158.      sock_errno() 
  7159.      socket() 
  7160.  
  7161.  
  7162. ΓòÉΓòÉΓòÉ 13.8. getsockopt() ΓòÉΓòÉΓòÉ
  7163.  
  7164. The getsockopt() socket call gets the socket options associated with a socket. 
  7165.  
  7166. Syntax 
  7167.  
  7168. #include <types.h>
  7169. #include <sys\socket.h>
  7170. int getsockopt(s, level, optname, optval, optlen)
  7171. int s;
  7172. int level;
  7173. int optname;
  7174. char *optval;
  7175. int *optlen;
  7176.  
  7177. Parameters 
  7178.  
  7179.   Socket descriptor. 
  7180.  
  7181. level 
  7182.   Specifies which option level is being queried for the specified optname. 
  7183.  
  7184. optname 
  7185.   Name of a specified socket option. Only one option can be specified on a 
  7186.   call. 
  7187.  
  7188. optval 
  7189.   Pointer to buffer to receive the option data requested. 
  7190.  
  7191. optlen 
  7192.   Pointer to the size of the buffer. 
  7193.  
  7194. Description 
  7195.  
  7196. This call returns the value of a socket option at the socket or protocol level. 
  7197. It can be called for sockets of all domain types. Some options are supported 
  7198. only for specific socket types. You must specify the level of the option and 
  7199. the name of the option to retrieve option values. The following table lists the 
  7200. supported levels. 
  7201.  
  7202. Supported Levels 
  7203.  
  7204. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7205. ΓöéSupported Level               #define in                         Γöé
  7206. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7207. ΓöéSOL_SOCKET                    <SYS\SOCKET.H>                     Γöé
  7208. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7209. ΓöéIPPROTO_IP                    <NETINET\IN.H>                     Γöé
  7210. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7211. ΓöéIPPROTO_TCP                   <NETINET\IN.H>                     Γöé
  7212. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7213. ΓöéNBPROTO_NB                    <NETNB\NB.H>                       Γöé
  7214. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7215.  
  7216. The optval parameter is a pointer to the buffer where the option values are 
  7217. returned. The optlen parameter must be initially set to the size of the buffer 
  7218. before calling getsockopt().  On return, the optlen parameter is set to the 
  7219. actual size of the data returned. For socket options that are Boolean, the 
  7220. option is enabled if optval is nonzero and disabled if optval is 0. 
  7221.  
  7222. The following tables list the supported options for getsockopt() at each level 
  7223. (SOL_SOCKET, IPPROTO_IP, IPPROTO_TCP). Detailed descriptions of the options 
  7224. follow each table. 
  7225.  
  7226. Supported getsockopt() Socket Options for SOL_SOCKET 
  7227.  
  7228. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7229. ΓöéOption Name     Description             Domains(*) Data     Boolean Γöé
  7230. Γöé                                                   Type     or ValueΓöé
  7231. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7232. ΓöéSO_ACCEPTCONN   Listen status           I, L       int      Boolean Γöé
  7233. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7234. ΓöéSO_BROADCAST    Allow sending of        I, N       int      Boolean Γöé
  7235. Γöé                broadcast messages                                  Γöé
  7236. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7237. ΓöéSO_DEBUG        Turn on recording of    I, L       int      Boolean Γöé
  7238. Γöé                debugging information                               Γöé
  7239. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7240. ΓöéSO_DONTROUTE    Bypass routing tables   I, L       int      Boolean Γöé
  7241. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7242. ΓöéSO_ERROR        Return any pending      I, L       int      Value   Γöé
  7243. Γöé                error and clear                                     Γöé
  7244. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7245. ΓöéSO_KEEPALIVE    Keep connections alive  I          int      Boolean Γöé
  7246. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7247. ΓöéSO_LINGER       Linger on close if data I          struct   Value   Γöé
  7248. Γöé                present                            linger           Γöé
  7249. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7250. ΓöéSO_L_BROADCAST  Limited broadcast sent  I          int      Boolean Γöé
  7251. Γöé                on all interfaces                                   Γöé
  7252. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7253. ΓöéSO_OPTIONS      Retrieve socket options I          int      Flags   Γöé
  7254. Γöé                (flags)                                             Γöé
  7255. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7256. ΓöéSO_OOBINLINE    Leave received OOB data I          int      Boolean Γöé
  7257. Γöé                in-line                                             Γöé
  7258. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7259. ΓöéSO_RCVBUF       Receive buffer size     I, L, N    int      Value   Γöé
  7260. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7261. ΓöéSO_RCV_SHUTDOWN If shutdown called for  I, L       int      Boolean Γöé
  7262. Γöé                receive                                             Γöé
  7263. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7264. ΓöéSO_RCVLOWAT     Receive low watermark   I, L       int      Value   Γöé
  7265. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7266. ΓöéSO_RCVTIMEO     Receive timeout         I, L       struct   Value   Γöé
  7267. Γöé                                                   timeval          Γöé
  7268. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7269. ΓöéSO_REUSEADDR    Allow local address     I, N       int      Boolean Γöé
  7270. Γöé                reuse                                               Γöé
  7271. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7272. ΓöéSO_REUSEPORT    Allow local port reuse  I          int      Boolean Γöé
  7273. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7274. ΓöéSO_SNDBUF       Send buffer size        I, L, N    int      Value   Γöé
  7275. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7276. ΓöéSO_SND_SHUTDOWN If shutdown called for  I, L       int      Boolean Γöé
  7277. Γöé                send                                                Γöé
  7278. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7279. ΓöéSO_SNDLOWAT     Send low watermark      I, L       int      Value   Γöé
  7280. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7281. ΓöéSO_SNDTIMEO     Send timeout            I, L       struct   Value   Γöé
  7282. Γöé                                                   timeval          Γöé
  7283. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7284. ΓöéSO_TYPE         Socket type             I, L, N    int      Value   Γöé
  7285. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7286. ΓöéSO_USELOOPBACK  Bypass hardware when    I, L       int      Boolean Γöé
  7287. Γöé                possible                                            Γöé
  7288. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7289.  
  7290. Table Note  (*) This column specifies the communication domains to which this 
  7291.             option applies: I for internet, L for local IPC, and N for NetBIOS. 
  7292.  
  7293. The following options are recognized for SOL_SOCKET: 
  7294.  
  7295. Option                Description
  7296.  
  7297. SO_ACCEPTCONN         Returns true if the socket is in the listen state. 
  7298.  
  7299. SO_BROADCAST          (Datagram sockets only.) Retrieves the current status of 
  7300.                       the SO_BROADCAST option. When this option is enabled, the 
  7301.                       application can send broadcast messages over s, if the 
  7302.                       interface specified in the destination supports 
  7303.                       broadcasting of packets. 
  7304.  
  7305. SO_DEBUG              Retrieves the current status of the SO_DEBUG option. 
  7306.  
  7307. SO_DONTROUTE          Retrieves the current status of the SO_DONTROUTE option. 
  7308.                       When this option is enabled, it causes outgoing messages 
  7309.                       to bypass the standard routing algorithm and be directed 
  7310.                       to the appropriate network interface, according to the 
  7311.                       network portion of the destination address. When enabled, 
  7312.                       packets can be sent only to directly connected networks 
  7313.                       (networks for which this host has an interface). 
  7314.  
  7315. SO_ERROR              Returns any pending error on the socket and clears the 
  7316.                       error status.  It can be used to check for asynchronous 
  7317.                       errors on connected datagram sockets or for other 
  7318.                       asynchronous errors (errors that are not returned 
  7319.                       explicitly by one of the socket calls). 
  7320.  
  7321. SO_KEEPALIVE          (Stream sockets only.) Retrieves the current status of 
  7322.                       the SO_KEEPALIVE option. TCP uses a timer called the 
  7323.                       keepalive timer.  This timer is used to monitor idle 
  7324.                       connections that might have been disconnected because of 
  7325.                       a peer crash or timeout. When this option is enabled, a 
  7326.                       keepalive packet is periodically sent to the peer.  This 
  7327.                       is mainly used to allow servers to close connections that 
  7328.                       are no longer active as a result of clients going away 
  7329.                       without properly closing connections. 
  7330.  
  7331. SO_LINGER             (Stream sockets only.) Retrieves the current status of 
  7332.                       the SO_LINGER option.  When this option is enabled and 
  7333.                       there is unsent data present when soclose() is called, 
  7334.                       the calling application is blocked during the soclose() 
  7335.                       call until the data is transmitted or the connection has 
  7336.                       timed out. When this option is disabled, the soclose() 
  7337.                       call returns without blocking the caller, and TCP waits 
  7338.                       to try to send the data. Although the data transfer is 
  7339.                       usually successful, it cannot be guaranteed, because TCP 
  7340.                       waits only a finite amount of time to send the data. 
  7341.  
  7342.                       The optval parameter points to a linger structure, 
  7343.                       defined in <SYS\SOCKET.H>: 
  7344.  
  7345.                                                  Field          Description
  7346.                       l_onoff             Option on/off 
  7347.                       l_linger            Linger time 
  7348.  
  7349.                       The l_onoff field is set to zero if the SO_LINGER option 
  7350.                       is being disabled. A nonzero value enables the option. 
  7351.  
  7352.                       The l_linger field specifies the amount of time in 
  7353.                       seconds to linger on close. A value of zero will cause 
  7354.                       soclose() to wait until the disconnect completes. 
  7355.  
  7356. SO_L_BROADCAST        Gets limited broadcast sent on all interfaces. 
  7357.  
  7358. SO_OPTIONS            Gets the current socket options from the stack. The 
  7359.                       socket option flags are returned as a 32-bit variable. 
  7360.                       The so_xxx socket option flags are defined in 
  7361.                       <SYS\SOCKET.H>. 
  7362.  
  7363. SO_OOBINLINE          (Stream sockets only.) Retrieves the current status of 
  7364.                       the SO_OOBINLINE option. When this option is enabled, it 
  7365.                       causes out-of-band data to be placed in the normal data 
  7366.                       input queue as it is received, making it available to 
  7367.                       recv(), and recvfrom() without having to specify the 
  7368.                       MSG_OOB flag in those calls.  When this option is 
  7369.                       disabled, it causes out-of-band data to be placed in the 
  7370.                       priority data input queue as it is received, making it 
  7371.                       available to recv() and recvfrom() only by specifying the 
  7372.                       MSG_OOB flag in those calls. 
  7373.  
  7374. SO_RCVBUF             Retrieves buffer size for input. This value tailors the 
  7375.                       receive buffer size for specific application needs, such 
  7376.                       as increasing the buffer size for high-volume 
  7377.                       connections. 
  7378.  
  7379. SO_RCV_SHUTDOWN       Returns true if shutdown was called for receive. 
  7380.  
  7381. SO_RCVLOWAT           Retrieves the receive low watermark. 
  7382.  
  7383. SO_RCVTIMEO           Retrieves the receive timeout. The optval parameter is a 
  7384.                       pointer to a timeval structure, which is defined in 
  7385.                       <SYS\TIME.H>. 
  7386.  
  7387. SO_REUSEADDR          (Stream and datagram sockets only.) Retrieves the current 
  7388.                       status of the SO_REUSEADDR option. When this option is 
  7389.                       enabled,  local addresses that are already in use can be 
  7390.                       bound. This alters the normal algorithm used in the 
  7391.                       bind() call. At connect time, the system checks to be 
  7392.                       sure that no local address and port have the same foreign 
  7393.                       address and port. The error SOCEADDRINUSE is returned if 
  7394.                       the association already exists. 
  7395.  
  7396. SO_REUSEPORT          (Stream and datagram sockets only.) Retrieves the current 
  7397.                       status of the SO_REUSEPORT option. This option specifies 
  7398.                       that the rules used in validating ports supplied by a 
  7399.                       subroutine of the bind() call should  allow reuse of a 
  7400.                       local port/address combination.  Each binding of the 
  7401.                       port/address combination must specify the socket option. 
  7402.                       This option enables or disables the reuse of local 
  7403.                       port/address combinations. 
  7404.  
  7405. SO_SNDBUF             Retrieves the send buffer size. This value tailors the 
  7406.                       send buffer size for specific application needs, such as 
  7407.                       increasing the buffer size for high-volume connections. 
  7408.  
  7409. SO_SND_SHUTDOWN       Returns true if the shutdown function was called as part 
  7410.                       of the send() call. 
  7411.  
  7412. SO_SNDLOWAT           Retrieves the send low watermark. 
  7413.  
  7414. SO_SNDTIMEO           Retrieves the send timeout. optval is a pointer to a 
  7415.                       timeval structure, which is defined in <SYS\TIME.H>. 
  7416.  
  7417. SO_TYPE               Retrieves the socket type.  On return, the integer 
  7418.                       pointed to by optval is set to one of the following: 
  7419.                       SOCK_STREAM, SOCK_DGRAM, or SOCK_RAW. 
  7420.  
  7421. SO_USELOOPBACK        Bypasses hardware when possible. 
  7422.  
  7423. Supported getsockopt() Socket Options for IPPROTO_IP 
  7424.  
  7425. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7426. ΓöéOption Name         Description              Data Type     Boolean Γöé
  7427. Γöé                                                           or ValueΓöé
  7428. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7429. ΓöéIP_HDRINCL          Header is included with  int           Boolean Γöé
  7430. Γöé                    data                                           Γöé
  7431. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7432. ΓöéIP_MULTICAST_IF     Default interface for    struct        Value   Γöé
  7433. Γöé                    outgoing multicasts      in_addr               Γöé
  7434. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7435. ΓöéIP_MULTICAST_LOOP   Loopback of outgoing     uchar         Boolean Γöé
  7436. Γöé                    multicast                                      Γöé
  7437. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7438. ΓöéIP_MULTICAST_TTL    Default TTL for outgoing uchar         Value   Γöé
  7439. Γöé                    multicast                                      Γöé
  7440. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7441. ΓöéIP_OPTIONS          IP options               char *        Value   Γöé
  7442. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7443. ΓöéIP_RECVDSTADDR      Queueing IP destination  int           Boolean Γöé
  7444. Γöé                    address                                        Γöé
  7445. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7446. ΓöéIP_RECVTRRI         Queueing token ring      int           Boolean Γöé
  7447. Γöé                    routing information                            Γöé
  7448. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7449. ΓöéIP_RETOPTS          IP options               char *        Value   Γöé
  7450. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7451. ΓöéIP_TOS              IP type of service for   int           Value   Γöé
  7452. Γöé                    outgoing datagrams                             Γöé
  7453. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7454. ΓöéIP_TTL              IP time to live for      int           Value   Γöé
  7455. Γöé                    outgoing datagrams                             Γöé
  7456. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7457.  
  7458. The following options are recognized for IPPROTO_IP: 
  7459.  
  7460. Option                   Description
  7461.  
  7462. IP_HDRINCL               (Raw sockets only.) Specifies whether the IP header is 
  7463.                          included with data. 
  7464.  
  7465. IP_MULTICAST_IF          Retrieves the default interface for outgoing 
  7466.                          multicasts. 
  7467.  
  7468. IP_MULTICAST_LOOP        Retrieves the value of the loopback setting for 
  7469.                          outgoing multicast. 
  7470.  
  7471. IP_MULTICAST_TTL         Retrieves the default time to live for outgoing 
  7472.                          multicast packets. 
  7473.  
  7474. IP_OPTIONS               Retrieves IP options. Same as IP_RETOPTS. 
  7475.  
  7476.                          The data type is char * ip_retopts[4], such as 
  7477.  
  7478.                                                   ip_retopts[0]=IPOPT_OPTVAL
  7479.                                                   ip_retopts[1]=IPOPT_OLEN
  7480.                                                   ip_retopts[2]=IPOPT_OFFSET
  7481.                                                   ip_retopts[3]=IPOPT_MINOFF
  7482.                          For an example that uses IP_RETOPTS, see Example of 
  7483.                          IP_RETOPTS Socket Call. 
  7484.  
  7485. IP_RECVDSTADDR           (UDP only.) Retrieves queueing IP destination address. 
  7486.                          This option must get this information through a 
  7487.                          recvmsg() call. For more information, see Example of 
  7488.                          recvmsg() Call. 
  7489.  
  7490. IP_RECVTRRI              (UDP packets on token ring only.) Retrieves the flag 
  7491.                          that indicates whether queueing of token ring routing 
  7492.                          information is enabled. This TTRI information must be 
  7493.                          received as control data through a recvmsg() call. For 
  7494.                          more information , see Example of recvmsg() Call. 
  7495.  
  7496. IP_RETOPTS               Retrieves IP options to be included in outgoing 
  7497.                          datagrams. 
  7498.  
  7499.                          The data type is char * ip_retopts[4], such as 
  7500.  
  7501.                                                   ip_retopts[0]=IPOPT_OPTVAL
  7502.                                                   ip_retopts[1]=IPOPT_OLEN
  7503.                                                   ip_retopts[2]=IPOPT_OFFSET
  7504.                                                   ip_retopts[3]=IPOPT_MINOFF
  7505.  
  7506.                          For an example that uses IP_RETOPTS, see Example of 
  7507.                          IP_RETOPTS Socket Call. 
  7508.  
  7509. IP_TOS                   Retrieves IP type of service for outgoing datagrams. 
  7510.  
  7511. IP_TTL                   Retrieves IP time to live value for outgoing 
  7512.                          datagrams. 
  7513.  
  7514. Supported getsockopt() Socket Options for IPPROTO_TCP 
  7515.  
  7516. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7517. ΓöéOption Name       Description               Data Type     Boolean  Γöé
  7518. Γöé                                                          or Value Γöé
  7519. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7520. ΓöéTCP_CC            Connection count function int           Boolean  Γöé
  7521. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7522. ΓöéTCP_MAXSEG        Maximum segment size      int           Value    Γöé
  7523. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7524. ΓöéTCP_MSL           TCP MSL value             int           Value    Γöé
  7525. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7526. ΓöéTCP_NODELAY       Don't delay send to       int           Boolean  Γöé
  7527. Γöé                  coalesce packets                                 Γöé
  7528. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7529. ΓöéTCP_TIMESTMP      Time stamp function       int           Boolean  Γöé
  7530. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7531. ΓöéTCP_WINSCALE      Window scale function     int           Boolean  Γöé
  7532. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7533.  
  7534. The following options are recognized for IPPROTO_TCP: 
  7535.  
  7536. Option                Description
  7537.  
  7538. TCP_CC                (T/TCP only.) Retrieves the connection count function 
  7539.                       enabled/disabled status flag (RFC 1644). For more 
  7540.                       information about T/TCP, see TCP Extensions for 
  7541.                       Transactions (T/TCP). 
  7542.  
  7543. TCP_MAXSEG            Retrieves the maximum segment size. 
  7544.  
  7545. TCP_MSL               Retrieves the TCP Maximum Segment Lifetime (MSL) value. 
  7546.  
  7547. TCP_NODELAY           (Stream sockets only.) Retrieves the current status of 
  7548.                       the TCP_NODELAY option. Disables the buffering algorithm 
  7549.                       so that the client's TCP sends small packets as soon as 
  7550.                       possible.  This often has no performance effects on LANs, 
  7551.                       but can degrade performance on WANs. 
  7552.  
  7553. TCP_TIMESTMP          (T/TCP only.) Retrieves the TCP timestamp function 
  7554.                       enabled/disabled status flag (RFC 1323). For more 
  7555.                       information about high performance, see TCP Extensions 
  7556.                       for High Performance (RFC 1323). 
  7557.  
  7558. TCP_WINSCALE          (T/TCP only) Retrieves the window scale function 
  7559.                       enabled/disabled status flag (RFC 1323). For more 
  7560.                       information about high performance, see TCP Extensions 
  7561.                       for High Performance (RFC 1323). 
  7562.  
  7563. Supported getsockopt() Socket Options for NBPROTO_NB 
  7564.  
  7565. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7566. ΓöéOption Name       Description               Data Type     Boolean  Γöé
  7567. Γöé                                                          or Value Γöé
  7568. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7569. ΓöéNB_DGRAM_TYPE     Type of datagrams to      int           Value    Γöé
  7570. Γöé                  receive                                          Γöé
  7571. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7572.  
  7573. The following option is recognized for NBPROTO_NB: 
  7574.  
  7575. Option                Description
  7576.  
  7577. NB_DGRAM_TYPE         (Datagram sockets only.) Retrieves the type of datagrams 
  7578.                       to be received on the socket.  The possible values are: 
  7579.  
  7580.                       NB_DGRAM               The socket is to receive normal 
  7581.                                              (unicast) datagrams only. 
  7582.  
  7583.                       NB_BROADCAST           The socket is to receive broadcast 
  7584.                                              datagrams only. 
  7585.  
  7586.                       NB_DGRAM_ANY           The socket can receive both normal 
  7587.                                              or broadcast datagrams. 
  7588.  
  7589. Return Values 
  7590.  
  7591. The value 0 indicates success; the value -1 indicates an error. You can get the 
  7592. specific error code by calling sock_errno() or psock_errno(). 
  7593.  
  7594. sock_errno() Value       Description
  7595.  
  7596. SOCEADDRINUSE            The address is already in use. 
  7597.  
  7598. SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  7599.  
  7600. SOCEFAULT                Using optval and optlen parameters would result in an 
  7601.                          attempt to access memory outside the caller's address 
  7602.                          space. 
  7603.  
  7604. SOCENOPROTOOPT           The optname parameter or level parameter is not 
  7605.                          recognized. 
  7606.  
  7607. Examples 
  7608.  
  7609. The following are examples of the getsockopt() call. See setsockopt() for 
  7610. examples of how the options are set. 
  7611.  
  7612. int rc;
  7613. int s;
  7614. int optval;
  7615. int optlen;
  7616. struct linger lstruct;
  7617. int getsockopt(int s, int level, int optname, char *optval, int *optlen);
  7618. /* extracted from sys/socket.h */
  7619. ...
  7620. /* Is out of band data in the normal input queue? */
  7621. optlen = sizeof(int);
  7622. rc = getsockopt( s, SOL_SOCKET, SO_OOBINLINE, (char *) &optval, &optlen);
  7623. if (rc == 0)
  7624. {
  7625.     if (optlen == sizeof(int))
  7626.     {
  7627.          if (optval)
  7628.             /* yes it is in the normal queue */
  7629.          else
  7630.             /* no it is not                  */
  7631.     }
  7632. }
  7633. ...
  7634. /* Do I linger on close? */
  7635. optlen = sizeof(lstruct);
  7636. rc = getsockopt( s, SOL_SOCKET, SO_LINGER, (char *) &lstruct, &optlen);
  7637. if (rc == 0)
  7638. {
  7639.     if (optlen == sizeof(lstruct))
  7640.     {
  7641.         if (lstruct.l_onoff)
  7642.            /* yes I linger */
  7643.         else
  7644.            /* no I do not  */
  7645.     }
  7646. }
  7647.  
  7648. The following is an example of the ip_retopts socket option. 
  7649.  
  7650.  
  7651. Example of IP_RETOPTS Socket Call
  7652.  
  7653. /* [0]:IPOPT_OPTVAL, [1]:IPOPT_OLEN, [2]:IPOPT_OFFSET, [3]:IPOPT_MINOFF */
  7654. char ip_retopts[8];
  7655.  
  7656. main()
  7657. {
  7658.     int optlen, sraw, i;
  7659.  
  7660.  
  7661.     if ((sraw = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
  7662.         psock_errno("Socket()");
  7663.  
  7664.     printf("IP_RETOPTS or OP_OPTIONS will get/set the IP options \n");
  7665.     ip_retopts[IPOPT_OPTVAL] = IPOPT_TS ;    /* TimeStamp IP options to set */
  7666.     ip_retopts[IPOPT_OLEN]   = 8;
  7667.     ip_retopts[IPOPT_OFFSET] = 4;
  7668.     ip_retopts[IPOPT_MINOFF] = 4;
  7669.  
  7670.     printf("Setting the IP_RETOPTS to TimeStamp option (%d) \n",
  7671.                           ip_retopts[IPOPT_OPTVAL]);
  7672.     if (setsockopt(sraw,IPPROTO_IP,IP_RETOPTS,(char *)&ip_retopts[0] ,
  7673.                           sizeof(ip_retopts)) < 0)
  7674.         psock_errno("setsockopt() IP_RETOPTS");
  7675.  
  7676.     /* NOTE ::: when the getsockopt returns it will stick in the first hop    */
  7677.     /*          destination in the first 4 bytes by shifting all data right.  */
  7678.     memset(ip_retopts, 0, sizeof(ip_retopts));
  7679.     printf("Get the ip_retopts value set for this socket\n");
  7680.     optlen = sizeof(ip_retopts);
  7681.     if (getsockopt(sraw,IPPROTO_IP,IP_OPTIONS,(char *)ip_retopts,&optlen) < 0) {
  7682.         psock_errno("getsockopt() IP_RETOPTS ");
  7683.     }
  7684.     else {
  7685.        if  (ip_retopts[4+IPOPT_OPTVAL] == IPOPT_TS)
  7686.          printf ("IP_RETOPTS now set to TimeStamp option(%d) \n",
  7687.                     ip_retopts[4+IPOPT_OPTVAL]);
  7688.        else
  7689.          printf ("IP_RETOPTS now set to ??? (%d) \n",
  7690.                     ip_retopts[4+IPOPT_OPTVAL]);
  7691.     }
  7692.  
  7693.     soclose(sraw);
  7694. }
  7695.  
  7696. Related Calls 
  7697.  
  7698.      bind() 
  7699.      endprotoent() 
  7700.      getprotobyname() 
  7701.      getprotobynumber() 
  7702.      getprotoent() 
  7703.      setprotoent() 
  7704.      setsockopt() 
  7705.      sock_errno() 
  7706.      socket() 
  7707.  
  7708.  
  7709. ΓòÉΓòÉΓòÉ 13.9. ioctl() ΓòÉΓòÉΓòÉ
  7710.  
  7711. The ioctl() socket call performs special operations on sockets. 
  7712.  
  7713. Syntax 
  7714.  
  7715. #include <types.h>
  7716. #include <sys\socket.h>
  7717. #include <sys\ioctl.h>
  7718. #include <net\route.h>
  7719. #include <net\if.h>
  7720. #include <net\if_arp.h>
  7721. int ioctl(s, cmd, data)
  7722. int s;
  7723. int cmd;
  7724. caddr_t data;
  7725.  
  7726. Parameters 
  7727.  
  7728.   Socket descriptor. 
  7729.  
  7730. cmd 
  7731.   Command to perform. 
  7732.  
  7733. data 
  7734.   Pointer to the data associated with cmd. 
  7735.  
  7736. Description 
  7737.  
  7738. This call controls the operating characteristics of sockets. The data parameter 
  7739. is a pointer to data associated with the particular command, and its format 
  7740. depends on the command that is requested. 
  7741.  
  7742. Option             Description
  7743.  
  7744. FIOASYNC           This option has no effect. 
  7745.  
  7746. FIONBIO            Sets or clears nonblocking input/output for a socket. When 
  7747.                    this option is set, input/output calls will not block until 
  7748.                    the call is completed. The data parameter is a pointer to an 
  7749.                    integer. If the integer is 0, nonblocking input/output on 
  7750.                    the socket is cleared. Otherwise, the socket is set for 
  7751.                    nonblocking input/output. 
  7752.  
  7753. FIONREAD           Gets the number of immediately readable bytes for the 
  7754.                    socket. The data parameter is a pointer to an integer. Sets 
  7755.                    the value of the integer to the number of immediately 
  7756.                    readable characters for the socket. 
  7757.  
  7758. Internet: The following ioctl commands are supported for the internet domain: 
  7759.  
  7760. Option             Description
  7761.  
  7762. OSIOCGIFADDR       Provided for compatibility with releases of TCP/IP prior to 
  7763.                    4.21. The data parameter is a pointer to an ifreq structure. 
  7764.                    The interface address is returned in the old sockaddr format 
  7765.                    in the argument. 
  7766.  
  7767. OSIOCGIFDSTADDR    Provided for compatibility with releases of TCP/IP prior to 
  7768.                    4.21. The data parameter is a pointer to an ifreq structure. 
  7769.                    The destination address is returned in the old sockaddr 
  7770.                    format in the argument. 
  7771.  
  7772. OSIOCGIFBRDADDR    Provided for compatibility with releases of TCP/IP prior to 
  7773.                    4.21. The data parameter is a pointer to an ifreq structure. 
  7774.                    The broadcast address is returned in the old sockaddr format 
  7775.                    in the argument. 
  7776.  
  7777. OSIOCGIFCONF       Provided for compatibility with releases of TCP/IP prior to 
  7778.                    4.21. The data parameter is a pointer to an ifreq structure. 
  7779.                    The interface configuration is returned in the old sockaddr 
  7780.                    format in the argument. 
  7781.  
  7782. OSIOCGIFNETMASK    Provided for compatibility with releases of TCP/IP prior to 
  7783.                    4.21. The data parameter is a pointer to an ifreq structure. 
  7784.                    The interface netmask is returned in the old sockaddr format 
  7785.                    in the argument. 
  7786.  
  7787. SIOCADDMULTI       Adds a 48-bit physical multicast address.  This works only 
  7788.                    for Ethernet. The data parameter is a pointer to an ifreq 
  7789.                    structure. 
  7790.  
  7791. SIOCADDRT          Adds a routing table entry.  The data parameter is a pointer 
  7792.                    to an rtentry structure, as defined in <NET\ROUTE.H>. The 
  7793.                    routing table entry, passed as an argument, is added to the 
  7794.                    routing tables. 
  7795.  
  7796. SIOCAIFADDR        Adds an IP address for an interface. The data parameter is a 
  7797.                    pointer to an ifaliasreq structure, which is defined in 
  7798.                    <NET\IF.H> 
  7799.  
  7800. SIOCARP            Sends an ARP request to all interfaces for a given IP 
  7801.                    address. The data parameter is a pointer to the IP address 
  7802.                    in the type of an unsigned long integer. 
  7803.  
  7804. SIOCATMARK         Queries whether the current location in the data input is 
  7805.                    pointing to out-of-band data. The data parameter is a 
  7806.                    pointer to an integer. Sets the argument to 1 if the socket 
  7807.                    points to a mark in the data stream for out-of-band data. 
  7808.                    Otherwise, sets the argument to 0. 
  7809.  
  7810. SIOCDARP           Deletes an arp table entry. The data parameter is a pointer 
  7811.                    to an arpreq as defined in <NET\IF_ARP.H>.  The arp table 
  7812.                    entry passed as an argument is deleted from the arp tables, 
  7813.                    if it exists. 
  7814.  
  7815. SIOCDELMULTI       (Ethernet only.) Deletes a 48-bit physical multicast 
  7816.                    address.  The data parameter is a pointer to an ifreq 
  7817.                    structure, which is defined in <NET\IF.H>. 
  7818.  
  7819. SIOCDELRT          Deletes a routing table entry. The data parameter is a 
  7820.                    pointer to a rtentry structure, as defined in <NET\ROUTE.H>. 
  7821.                    If it exists, the routing table entry passed as an argument 
  7822.                    is deleted from the routing tables. 
  7823.  
  7824. SIOCDIFADDR        Deletes an IP address for an interface. The data parameter 
  7825.                    is a pointer to an ifreq structure, defined in <NET\IF.H>. 
  7826.  
  7827. SIOCGARP           Gets the arp table entries. The data parameter is a pointer 
  7828.                    to an arpreq structure, as defined in <NET\IF_ARP.H>. The 
  7829.                    arp table entry passed as an argument is returned from the 
  7830.                    arp tables if it exists. 
  7831.  
  7832. SIOCGARP_TR        Gets the token-ring arp table entries with routing 
  7833.                    information field. The data parameter is a pointer to an 
  7834.                    arpreq_tr structure, as defined in <NET\IF_ARP.H>. The arp 
  7835.                    table entry from the arp table is returned if it exists. 
  7836.  
  7837. SIOCGIFADDR        Gets the network interface address. The data parameter is a 
  7838.                    pointer to an ifreq structure, as defined in <NET\IF.H>. The 
  7839.                    interface address is returned in the argument. 
  7840.  
  7841. SIOCGIFBOUND       Checks the number of Medium Access Control (MAC) drivers 
  7842.                    that will be bound or have been bound. The data parameter is 
  7843.                    a pointer to a bndreq structure, defined in 
  7844.                    <SYS\IOCTLOS2.H>. The bindinds variable in the structure 
  7845.                    will return the number of MAC drivers that the INET protocol 
  7846.                    will bind to, and the bound variable will return the number 
  7847.                    of MAC drivers that have been bound. 
  7848.  
  7849. SIOCGIFBRDADDR     Gets the network interface broadcast address. The data 
  7850.                    parameter is a pointer to an ifreq structure, as defined in 
  7851.                    <NET\IF.H>. The interface broadcast address is returned in 
  7852.                    the argument. 
  7853.  
  7854. SIOCGIFCONF        Gets the network interface configuration. The data parameter 
  7855.                    is a pointer to an ifconf structure, as defined in 
  7856.                    <NET\IF.H>.  The interface configuration is returned in the 
  7857.                    argument. It is important to note that the ifconf structure 
  7858.                    changed in TCP/IP 4.21. 
  7859.  
  7860. SIOCGIFDSTADDR     Gets the network interface destination address. The data 
  7861.                    parameter is a pointer to an ifreq structure, as defined in 
  7862.                    <NET\IF.H>. The interface destination (point-to-point) 
  7863.                    address is returned in the argument. 
  7864.  
  7865. SIOCGIFEFLAGS      Gets extended flags for the interface. The data parameter is 
  7866.                    a pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7867.                    The interface extended flags are returned in the ifr_eflags 
  7868.                    field. 
  7869.  
  7870. SIOCGIFFLAGS       Gets the network interface flags. The data parameter is a 
  7871.                    pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7872.                    The interface flags are returned in the ifr_flags field. 
  7873.  
  7874. SIOCGIFMETRIC      Gets the network interface routing metric. The data 
  7875.                    parameter is a pointer to an ifreq structure, as defined in 
  7876.                    <NET\IF.H>.  The interface routing metric is returned in the 
  7877.                    ifr_metric field. 
  7878.  
  7879. SIOCGIFMTU         Gets the interface MTU value. The data parameter is a 
  7880.                    pointer to an ifreq structure, as defined in <NET\IF.H>. The 
  7881.                    interface MTU is returned in the ifr_metric field. 
  7882.  
  7883. SIOCGIFNETMASK     Gets the network interface network mask. The data parameter 
  7884.                    is a pointer to an ifreq structure, as defined in 
  7885.                    <NET\IF.H>. The interface network mask is returned in the 
  7886.                    ifr_dstaddr field. 
  7887.  
  7888. SIOCGIFTRACE       Gets data from the interface input/output tracing buffer. 
  7889.                    The data parameter is a pointer to an ifreq structure, as 
  7890.                    defined in <NET\IF.H>. The ifr_data field should point to 
  7891.                    the pkt_trace_hdr structure as defined in <NET\IF.H>. 
  7892.  
  7893. SIOCGIFVALID       Checks if the interface is valid. The data parameter is a 
  7894.                    pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7895.  
  7896. SIOCGMCAST         Gets the joined multicast addresses for the interface. The 
  7897.                    data parameter is a pointer to an addrreq structure, as 
  7898.                    defined in <NET\IF.H>. 
  7899.  
  7900. SIOCGMSL           Gets the TCP Maximum Segment Lifetime (MSL) value, in 
  7901.                    seconds. 
  7902.  
  7903. SIOCGSTAT          Gets the serial link interface statistics. The data 
  7904.                    parameter is a pointer to an ifreq structure, as defined in 
  7905.                    <NET\IF.H>. The ifr_data field should point to an ifstat 
  7906.                    structure, as defined in <NET\IF.H>. 
  7907.  
  7908. SIOCGUNIT          Gets the interface unit number. 
  7909.  
  7910. SIOCMULTISBC       Use broadcast for physical transmission of IP multicast 
  7911.                    datagrams (RFC 1469). 
  7912.  
  7913. SIOCMULTISFA       Use functional address for physical transmission of IP 
  7914.                    multicast datagrams (RFC 1469). 
  7915.  
  7916. SIOCSARP            Sets an arp table entry. The data parameter is a pointer to 
  7917.                    an arpreq as defined in <NET\IF_ARP.H>.  The arp table entry 
  7918.                    passed as an argument is added to the arp tables. 
  7919.  
  7920. SIOCSARP_TR        Sets a token-ring arp table entry with routing information. 
  7921.                    The data parameter is a pointer to an arp_req structure, as 
  7922.                    defined in <NET\IF_ARP.H>. 
  7923.  
  7924. SIOCSHOSTID        Sets the IP address of the host that will be displayed by 
  7925.                    the HOSTID.EXE utility. The data parameter is a pointer to 
  7926.                    the IP address of the type of unsigned long. 
  7927.  
  7928. SIOCSIF802_3       Sets the interface to send packets in 802.3 format. The data 
  7929.                    parameter is a pointer to an ifreq structure, as defined in 
  7930.                    <NET\IF.H>. 
  7931.  
  7932. SIOCSIFADDR        Sets the network interface address. The data parameter is a 
  7933.                    pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7934.                    Sets the interface address to the value passed in the 
  7935.                    argument. 
  7936.  
  7937. SIOCSIFALLRTB      Sets the interface to use all-route broadcast, for token 
  7938.                    ring only. The data parameter is a pointer to an ifreq 
  7939.                    structure, as defined in <NET\IF.H>. 
  7940.  
  7941. SIOCSIFBRD         Sets the interface to use single route broadcast, for token 
  7942.                    ring only. The data parameter is a pointer to an ifreq 
  7943.                    structure, as defined in <NET\IF.H>. 
  7944.  
  7945. SIOCSIFBRDADDR     Sets the network interface broadcast address. The data 
  7946.                    parameter is a pointer to an ifreq structure, as defined in 
  7947.                    <NET\IF.H>. Sets the interface broadcast address to the 
  7948.                    value passed in the argument. 
  7949.  
  7950. SIOCSIFDSTADDR     Sets the network interface destination address. The data 
  7951.                    parameter is a pointer to an ifreq structure, as defined in 
  7952.                    <NET\IF.H>. Sets the interface destination (point-to-point) 
  7953.                    address to the value passed in the argument. 
  7954.  
  7955. SIOCSIFEFLAGS      Sets extended flags for the interface. The data parameter is 
  7956.                    a pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7957.                    The extended flags should be passed in the ifr_eflags field. 
  7958.  
  7959. SIOCSIFFDDI        Sets the token-ring interface to use canonical format of 
  7960.                    ARP. The data parameter is a pointer to an ifreq structure, 
  7961.                    as defined in <NET\IF.H>. 
  7962.  
  7963. SIOCSIFFLAGS       Sets the network interface flags. The data parameter is a 
  7964.                    pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7965.                    Sets the interface flags to the values passed in the 
  7966.                    ifr_flags field. 
  7967.  
  7968. SIOCSIFMETRIC      Sets the network interface routing metric. The data 
  7969.                    parameter is a pointer to an ifreq structure, as defined in 
  7970.                    <NET\IF.H>.  Sets the interface routing metric to the value 
  7971.                    passed in the ifr_metric field. 
  7972.  
  7973. SIOCSIFMTU         Sets the interface MTU value. The data parameter is a 
  7974.                    pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7975.                    Sets the interface MTU to the value passed in the ifr_metric 
  7976.                    field. 
  7977.  
  7978. SIOCSIFNETMASK     Sets the network interface network mask. The data parameter 
  7979.                    is a pointer to an ifreq structure, as defined in 
  7980.                    <NET\IF.H>. Sets the interface network mask to the value 
  7981.                    passed in the argument. 
  7982.  
  7983. SIOCSIFNO802_3     Sets the interface to send packets with Ethernet header 
  7984.                    frame format. The data parameter is a pointer to an ifreq 
  7985.                    structure, as defined in <NET\IF.H>. 
  7986.  
  7987. SIOCSIFNOFDDI      Sets the token-ring interface to use noncanonical format for 
  7988.                    ARP. 
  7989.  
  7990. SIOCSIFNOREDIR     Disable ICMP redirect function for an interface. The data 
  7991.                    parameter is a pointer to an ifreq structure, as defined in 
  7992.                    <NET\IF.H>. 
  7993.  
  7994. SIOCSIFRUNNINGBLK  (Token ring only.) Blocks the calling thread until the 
  7995.                    interface is back in running state. The data parameter is a 
  7996.                    pointer to an ifreq structure, as defined in <NET\IF.H>. 
  7997.                    This is typically useful when the network cable needs to be 
  7998.                    disconnected temporarily. 
  7999.  
  8000. SIOCSIFTRACE       Creates an interface input/output tracing packet. The data 
  8001.                    parameter is a pointer to an ifreq structure, as defined in 
  8002.                    <NET\IF.H>. The trace packet should be placed in the 
  8003.                    pkt_trace_hdr structure, as defined in <NET\IF.H>, which 
  8004.                    should be pointed to by the ifr_data field. 
  8005.  
  8006. SIOCSIFYESREDIR    Enables ICMP redirect function for an interface. The data 
  8007.                    parameter is a pointer to an ifreq structure, as defined in 
  8008.                    <NET\IF.H>. 
  8009.  
  8010. SIOCSMSL           Sets the TCP Maximum Segment Lifetime (MSL) value in 
  8011.                    seconds. 
  8012.  
  8013. SIOCSRDBRD         Enables loopback for broadcast packets. 
  8014.  
  8015. SIOCSSTAT          Sets the serial link interface statistics. The data 
  8016.                    parameter is a pointer to an ifreq structure, as defined in 
  8017.                    <NET\IF.H>. The statistics are returned in an ifstat 
  8018.                    structure pointed to by the ifr_data field. 
  8019.  
  8020. SIOCSSYN           Sets the SYN attack prevention function flag on or off. The 
  8021.                    data parameter should point to an integer that contains zero 
  8022.                    for off and nonzero for on. The function is off by default. 
  8023.  
  8024. SIOFLUSHRT         Flushes the entire routing table, including all routes to 
  8025.                    all interfaces. 
  8026.  
  8027. SIOFLUSHRTIFP      Flushes all routes for the specified interface only. The 
  8028.                    data parameter is a pointer to an interface name, such as 
  8029.                    lan0. 
  8030.  
  8031. SIOSTATCNTAT       Gets the count of ARP entries. 
  8032.  
  8033. SIOSTATCNTRT       Gets the count of entries in the routing table. 
  8034.  
  8035. SIOSTATICMP        Gets ICMP statistics. The data parameter is a pointer to an 
  8036.                    icmpstat structure, as defined in <NETINET\ICMP_VAR.H>. 
  8037.  
  8038. SIOSTATICMPZ       Clears ICMP statistics. The data parameter is a pointer to 
  8039.                    an icmpstat structure, as defined in <NETINET\ICMP_VAR.H>. 
  8040.  
  8041. SIOSTATIGMP        Gets IGMP statistics. The data parameter is a pointer to an 
  8042.                    igmpstat structure, as defined in <NETINET\IGMP_VAR.H>. 
  8043.  
  8044. SIOSTATIGMPZ       Clears IGMP statistics. The data parameter is a pointer to 
  8045.                    an igmpstat structure, as defined in <NETINET\IGMP_VAR.H>. 
  8046.  
  8047. SIOSTATIP          Gets IP statistics. The data parameter is a pointer to an 
  8048.                    ipstat structure, as defined in <NETINET\IP_VAR.H>. 
  8049.  
  8050. SIOSTATIPZ         Clears IP statistics. The data parameter is a pointer to an 
  8051.                    ipstat structure, as defined in <NETINET\IP_VAR.H>. 
  8052.  
  8053. SIOSTATMBUF        Gets memory usage status. The data parameter is a pointer to 
  8054.                    an mbstat structure, as defined in <SYS\MBUF.H>. 
  8055.  
  8056. SIOSTATTCP         Gets TCP statistics. The data parameter is a pointer to a 
  8057.                    tcpstat structure, as defined in <NETINET\TCP_VAR.H>. 
  8058.  
  8059. SIOSTATTCPZ        Clears TCP statistics. The data parameter is a pointer to a 
  8060.                    tcpstat structure, as defined in <NETINET\TCP_VAR.H>. 
  8061.  
  8062. SIOSTATUDP         Gets UDP statistics. The data parameter is a pointer to a 
  8063.                    udpstat structure, as defined in <NETINET\UDP_VAR.H>. 
  8064.  
  8065. SIOSTATUDPZ        Clears UDP statistics. The data parameter is a pointer to a 
  8066.                    udpstat structure, as defined in <NETINET\UDP_VAR.H>. 
  8067.  
  8068. NetBIOS: The following ioctl() calls are supported for the NetBIOS domain: 
  8069.  
  8070. Option             Description
  8071.  
  8072. SIOCGNBNAME        Gets the NetBIOS host name. The data parameter is a pointer 
  8073.                    to a socaddr_nb structure, which is defined in <NETNB\NB.H>. 
  8074.  
  8075. SIOCGNCBFN         Issues ncb.find.name. The data parameter is a pointer to a 
  8076.                    socaddr_nb structure, which is defined in <NETNB\NB.H>. 
  8077.  
  8078. SIOCSNBNAME        Sets the NetBIOS host name. The data parameter is a pointer 
  8079.                    to a socaddr_nb structure, which is defined in <NETNB\NB.H>. 
  8080.  
  8081. Return Values 
  8082.  
  8083. The value 0 indicates success; the value -1 indicates an error. You can get the 
  8084. specific error code by calling sock_errno() or psock_errno(). 
  8085.  
  8086. sock_errno() Value       Description
  8087. SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  8088. SOCEINVAL                The request is not valid or not supported. 
  8089. SOCEOPNOTSUPP            The operation is not supported on the socket. 
  8090. SOCEFAULT                Using data would result in an attempt to access memory 
  8091.                          outside the caller address space. 
  8092.  
  8093. Examples 
  8094.  
  8095. The following is an example of the ioctl() call. 
  8096.  
  8097. int s;
  8098. int dontblock;
  8099. int rc;
  8100. int ioctl(int s, int cmd, caddr_t data);  /* extracted from sys\socket.h */
  8101. ...
  8102. /* Place the socket into nonblocking mode */
  8103. dontblock = 1;
  8104. rc = ioctl(s, FIONBIO, (char *) &dontblock);
  8105. ...
  8106.  
  8107. Related Calls 
  8108.  
  8109.      os2_ioctl() 
  8110.      sock_errno() 
  8111.  
  8112.  
  8113. ΓòÉΓòÉΓòÉ 13.10. listen() ΓòÉΓòÉΓòÉ
  8114.  
  8115. The listen() socket call completes the binding necessary for a socket to accept 
  8116. connections and creates a connection request queue for incoming requests. 
  8117.  
  8118. Syntax 
  8119.  
  8120. #include <types.h>
  8121. #include <sys\socket.h>
  8122. #include <netinet\in.h>
  8123. int listen(s, backlog)
  8124. int s;
  8125. int backlog;
  8126.  
  8127. Parameters 
  8128.  
  8129.   Socket descriptor. 
  8130.  
  8131. backlog 
  8132.   Controls the maximum queue length for pending connections. 
  8133.  
  8134. Description 
  8135.  
  8136. The listen() call performs two tasks: 
  8137.  
  8138.   1. Completes the binding necessary for a socket s, if bind() has not been 
  8139.      called for s 
  8140.  
  8141.   2. Creates a connection request queue of length backlog, to queue incoming 
  8142.      connection requests. 
  8143. When the queue is full, additional connection requests are ignored.
  8144.  
  8145. The listen() call indicates a readiness to accept client connection requests. 
  8146. It transforms an active socket into a passive socket.  After listen() is 
  8147. called, s can never be used as an active socket to initiate connection 
  8148. requests. listen() is called after allocating a socket with socket() and after 
  8149. binding a name to s with bind().  listen() must be called before calling 
  8150. accept(). 
  8151.  
  8152. listen() can only be called on connection-oriented sockets. 
  8153.  
  8154. If the backlog parameter is less than 0, then listen() interprets backlog as 0. 
  8155. If the backlog parameter is greater than SOMAXCONN, as defined in 
  8156. <SYS\SOCKET.H>, then listen() interprets backlog as SOMAXCONN. 
  8157.  
  8158. Return Values 
  8159.  
  8160. The value 0 indicates success, the value -1 indicates an error. You can get the 
  8161. specific error code by calling sock_errno() or psock_errno(). 
  8162.  
  8163. Error Code           Description
  8164. SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  8165. SOCEOPNOTSUPP        The s parameter is not a socket descriptor that supports 
  8166.                      the listen() call. 
  8167.  
  8168. Related Calls 
  8169.  
  8170.      accept() 
  8171.      accept_and_recv() 
  8172.      bind() 
  8173.      connect() 
  8174.      sock_errno() 
  8175.      socket() 
  8176.  
  8177.  
  8178. ΓòÉΓòÉΓòÉ 13.11. os2_ioctl() ΓòÉΓòÉΓòÉ
  8179.  
  8180. The os2_ioctl() socket call performs special operations on sockets; in 
  8181. particular, operations related to returning status from kernel. 
  8182.  
  8183. Syntax 
  8184.  
  8185. #include <types.h>
  8186. #include <sys\socket.h>
  8187. #include <sys\ioctl.h>
  8188. #include <net\route.h>
  8189. #include <net\if.h>
  8190. #include <net\if_arp.h>
  8191. int os2_ioctl(s, cmd, data, lendata)
  8192. int s;
  8193. int cmd;
  8194. caddr_t data;
  8195. int lendata;
  8196.  
  8197. Parameters 
  8198.  
  8199.   Socket descriptor. 
  8200.  
  8201. cmd 
  8202.   Command to perform. 
  8203.  
  8204. data 
  8205.   Pointer to the data buffer associated with cmd where returned data is placed. 
  8206.  
  8207. lendata 
  8208.   Length (in bytes) of the data to be returned in the buffer. 
  8209.  
  8210. Description 
  8211.  
  8212. The following os2_ioctl() commands are supported for the internet domain. The 
  8213. data parameter is a pointer to data associated with the particular command, and 
  8214. its format depends on the command that is requested. 
  8215.  
  8216. Option             Description
  8217.  
  8218. SIOSTATARP         Gets the ARP table. The data parameter is a pointer to an 
  8219.                    oarptab structure as defined in <NETINET\IF_ETHER.H>. 
  8220.  
  8221. SIOSTATAT          Gets all interface addresses. The data parameter is a 
  8222.                    pointer to the buffer for receiving returned data. At 
  8223.                    return, the first two bytes of the buffer contain the number 
  8224.                    of returned addresses, followed by the address information 
  8225.                    for each interface address. For each address, the buffer 
  8226.                    contains: 
  8227.  
  8228.                        The IP address, of type unsigned long 
  8229.                        An interface index, of type unsigned short 
  8230.                        A netmask, of type unsigned long 
  8231.                        The broadcast address, of type unsigned long 
  8232.  
  8233. SIOSTATIF          Gets interface statistics. The data parameter is a pointer 
  8234.                    to an ifmib structure as defined in <NET\IF.H>. 
  8235.  
  8236. SIOSTATIF42        Gets interface statistics for all interfaces (maximum of 
  8237.                    42). The data parameter is a pointer to sequential instances 
  8238.                    of an ifmib structure as defined in <NET\IF.H>. 
  8239.  
  8240. SIOSTATRT          Gets routing entries from the routing table. The data 
  8241.                    parameter is a pointer to an rtentries structure as defined 
  8242.                    in <NET\ROUTE.H>. 
  8243.  
  8244. SIOSTATSO          Gets sockets' statistics. The data parameter is a pointer to 
  8245.                    sequential instances of a sostats structure as defined in 
  8246.                    <SYS\SOCKET.H>. 
  8247.  
  8248. Return Values 
  8249.  
  8250. The value 0 indicates success; the value -1 indicates an error. You can get the 
  8251. specific error code by calling sock_errno() or psock_errno(). 
  8252.  
  8253. sock_errno() Value       Description
  8254. SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  8255. SOCEINVAL                The request is not valid or not supported. 
  8256. SOCEOPNOTSUPP            The operation is not supported on the socket. 
  8257. SOCEFAULT                Using data and lendata would result in an attempt to 
  8258.                          access memory outside the caller address space. 
  8259.  
  8260. Examples 
  8261.  
  8262. The following is an example of the os2_ioctl() call. 
  8263.  
  8264. int s;
  8265. char buf [1024];
  8266. int rc;
  8267. int os2_ioctl(int s, int cmd, caddr_t data, int lendata);  /* extracted from sys\socket.h */
  8268. ...
  8269. rc = os2_ioctl(s, SIOSTATAT, (char *) buf, sizeof(buf));
  8270. ...
  8271.  
  8272. Related Calls 
  8273.  
  8274.      sock_errno() 
  8275.      ioctl() 
  8276.  
  8277.  
  8278. ΓòÉΓòÉΓòÉ 13.12. os2_select() ΓòÉΓòÉΓòÉ
  8279.  
  8280. The socket call gets read, write, and exception status on a group of sockets. 
  8281.  
  8282. With the os2_select() call, the socket numbers are specified as an array of 
  8283. integers, in which the read socket numbers are followed by write socket 
  8284. numbers, followed by the exception socket numbers. TCP/IP for OS/2 Warp 
  8285. monitors the activity on a socket by specifying the number of sockets to be 
  8286. checked for readability, readiness for writing, and exception-pending 
  8287. conditions. 
  8288.  
  8289. Syntax 
  8290.  
  8291. #include <types.h>
  8292. #include <unistd.h>
  8293. int os2_select(s, noreads, nowrites, noexcepts, timeout)
  8294. int *s;
  8295. int noreads;
  8296. int nowrites;
  8297. int noexcepts;
  8298. long timeout;
  8299.  
  8300. Parameters 
  8301.  
  8302.   Pointer to an array of socket numbers where the read socket numbers are 
  8303.   followed by the write socket numbers, and then followed by the exception 
  8304.   socket numbers. 
  8305.  
  8306. noreads 
  8307.   Number of sockets to be checked for readability. 
  8308.  
  8309. nowrites 
  8310.   Number of sockets to be checked for readiness for writing. 
  8311.  
  8312. noexcepts 
  8313.   Number of sockets to be checked for exception-pending conditions. The only 
  8314.   exception-pending condition is out-of-band data in the receive buffer. 
  8315.  
  8316. timeout 
  8317.   Maximum interval, in milliseconds, to wait for the selection to complete. 
  8318.  
  8319. Description 
  8320.  
  8321. This call monitors activity on a set of different sockets until a timeout 
  8322. expires, to see if any sockets are ready for reading or writing, or if any 
  8323. exceptional conditions are pending. 
  8324.  
  8325. If the timeout value is 0, select() does not wait before returning. If the 
  8326. timeout value is -1, select() does not time out, but returns when a socket 
  8327. becomes ready. If the timeout value is a number of milliseconds, select() waits 
  8328. for the specified interval before returning. The select() call checks all 
  8329. indicated sockets at the same time and returns when any of them is ready. 
  8330.  
  8331. Reinitializing the socket array every time select() is called is required. 
  8332.  
  8333. Return Values 
  8334.  
  8335. The number of ready sockets is returned. The value -1 indicates an error. The 
  8336. value 0 indicates an expired time limit. If the return value is greater than 0, 
  8337. the socket numbers in s that were not ready are set to -1. You can get the 
  8338. specific error code by calling sock_errno() or psock_errno(). 
  8339.  
  8340. Error Code         Description
  8341. SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  8342. SOCEFAULT          The address is not valid. 
  8343. SOCEINVAL          Invalid argument. 
  8344. SOCEINTR           Interrupted system call. 
  8345.  
  8346. Examples 
  8347.  
  8348. The following is an example of the os2_select() call. 
  8349.  
  8350. #define MAX_TIMEOUT  1000
  8351. /* input_ready(insock)- Check to see if there is available input on
  8352.  * socket insock.
  8353.  * Returns 1 if input is available.
  8354.  *         0 if input is not available.
  8355.  *        -1 on error.
  8356.  */
  8357.  
  8358. int input_ready(insock)
  8359. int insock;                 /* input socket descriptor */
  8360.  
  8361. {
  8362.   int socks[1];    /* array of sockets */
  8363.   long timeout = MAX_TIMEOUT;
  8364.  
  8365.   /* put socket to check in socks[] */
  8366.   socks[0] = insock;
  8367.  
  8368.   /* check for READ availability on this socket */
  8369.   return os2_select(socks, 1, 0, 0, timeout);
  8370. }
  8371.  
  8372. Related Calls 
  8373.  
  8374.      accept() 
  8375.      accept_and_recv() 
  8376.      connect() 
  8377.      recv() 
  8378.      select() 
  8379.      send() 
  8380.      sock_errno() 
  8381.      socket() 
  8382.  
  8383.  
  8384. ΓòÉΓòÉΓòÉ 13.13. psock_errno() ΓòÉΓòÉΓòÉ
  8385.  
  8386. The psock_errno() socket call writes a short error message to the standard 
  8387. error device. 
  8388.  
  8389. Syntax 
  8390.  
  8391. #include <sys/socket.h>
  8392. void psock_errno(s)
  8393. char *s;
  8394.  
  8395. Parameters 
  8396.  
  8397.   Pointer to a buffer. 
  8398.  
  8399. Description 
  8400.  
  8401. This call writes a short error message to the standard error display describing 
  8402. the last error encountered during a call to a socket library function. If s is 
  8403. not a NULL pointer and does not point to a null string, the string it points to 
  8404. is printed, followed by a colon, followed by a space, followed by the message. 
  8405. If s is a NULL pointer or points to a null string, only the message is printed. 
  8406.  
  8407. The error code is acquired by calling sock_errno().  The error code is set when 
  8408. errors occur.  Subsequent socket calls do not clear the error code. 
  8409.  
  8410. Related Calls 
  8411.  
  8412.      sock_errno() 
  8413.  
  8414.  
  8415. ΓòÉΓòÉΓòÉ 13.14. readv() ΓòÉΓòÉΓòÉ
  8416.  
  8417. The readv() socket call receives data on a socket into a set of buffers. 
  8418.  
  8419. Syntax 
  8420.  
  8421. #include <types.h>
  8422. #include <sys/uio.h>
  8423. int readv(s, iov, iovcnt)
  8424. int s;
  8425. struct iovec *iov;
  8426. int iovcnt;
  8427.  
  8428. Parameters 
  8429.  
  8430.   Socket descriptor. 
  8431.  
  8432. iov 
  8433.   Pointer to an array of iovec structures. 
  8434.  
  8435. iovcnt 
  8436.   Number of iovec structures pointed to by the iov parameter. The maximum 
  8437.   number of iovec structures is 1024. 
  8438.  
  8439. Description 
  8440.  
  8441. This call reads data on a socket with descriptor s and stores it in a set of 
  8442. buffers. The data is scattered into the buffers specified by 
  8443. iov[0]...iov[iovcnt-1]. The iovec structure is defined in <SYS/UIO.H> and 
  8444. contains the following fields: 
  8445.  
  8446. Field          Description
  8447. iov_base       Points to the buffer 
  8448. iov_len        Length of the buffer 
  8449.  
  8450. The readv() call applies only to connected sockets. For information on how to 
  8451. use readv() with datagram and raw sockets, see Datagram or Raw Sockets. 
  8452.  
  8453. TCP/IP alters iov_base and iov_len for each element in the input struct iovec 
  8454. array. iov_base will point to the next character of the processed (sent or 
  8455. received) data on the original buffer, and iov_len will become (input value - 
  8456. processed length). Thus if only partial data has been sent or received and the 
  8457. application expects more data to send or receive, it can pass the same iovec 
  8458. structure back in a subsequent call. 
  8459.  
  8460. This call returns up to the number of bytes in the buffers pointed to by the 
  8461. iov parameter.  This number is the sum of all iov_len fields. If less than the 
  8462. number of bytes requested is available, the call returns the number currently 
  8463. available. If data is not available at the socket with descriptor s, the 
  8464. readv() call waits for data to arrive and blocks the caller, unless the socket 
  8465. is in nonblocking mode. See ioctl() for a description of how to set nonblocking 
  8466. mode. The UDP sockets can send and receive datagrams as large as 32739 bytes 
  8467. (32 * 1024 -1 - IP header (20 bytes) - UDP header (8 bytes)). 
  8468.  
  8469. Return Values 
  8470.  
  8471. When successful, the number of bytes of data received into the buffer is 
  8472. returned. The value -1 indicates an error. You can get the specific error code 
  8473. by calling sock_errno() or psock_errno(). 
  8474.  
  8475. sock_errno() Value       Description
  8476.  
  8477. SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  8478.  
  8479. SOCEFAULT                Using iov and iovcnt would result in an attempt to 
  8480.                          access memory outside the caller's address space. 
  8481.  
  8482. SOCEINTR                 Interrupted system call. 
  8483.  
  8484. SOCEINVAL                iovcnt was not valid, or one of the fields in the iov 
  8485.                          array was not valid. 
  8486.  
  8487. SOCEWOULDBLOCK           The s parameter is in nonblocking mode and no data is 
  8488.                          available to read, or the SO_RCVTIMEO option has been 
  8489.                          set for socket s and the timeout expired before any 
  8490.                          data arrived to read. 
  8491.  
  8492. Related Calls 
  8493.  
  8494.      accept() 
  8495.      accept_and_recv() 
  8496.      connect() 
  8497.      getsockopt() 
  8498.      ioctl() 
  8499.      recv() 
  8500.      recvfrom() 
  8501.      recvmsg() 
  8502.      select() 
  8503.      send() 
  8504.      sendto() 
  8505.      setsockopt() 
  8506.      so_cancel() 
  8507.      sock_errno() 
  8508.      socket() 
  8509.      writev() 
  8510.  
  8511.  
  8512. ΓòÉΓòÉΓòÉ 13.15. recv() ΓòÉΓòÉΓòÉ
  8513.  
  8514. The socket call receives data on a connected socket. 
  8515.  
  8516. Syntax 
  8517.  
  8518. #include <types.h>
  8519. #include <sys\socket.h>
  8520. int recv(s, buf, len, flags)
  8521. int s;
  8522. char *buf;
  8523. int len;
  8524. int flags;
  8525.  
  8526. Parameters 
  8527.  
  8528.   Socket descriptor. 
  8529.  
  8530. buf 
  8531.   Pointer to the buffer that receives the data. 
  8532.  
  8533. len 
  8534.   Length of the buffer in bytes pointed to by the buf parameter. 
  8535.  
  8536. flags 
  8537.   Permits the call to exercise control over the reception of messages. Set this 
  8538.   parameter by specifying one or more of the following flags. If you specify 
  8539.   more than one flag, use the logical OR operator (|) to separate them. Setting 
  8540.   this parameter is supported only for sockets in the internet domain. 
  8541.  
  8542.   MSG_DONTWAIT      Do not wait for resources or data during this call. 
  8543.  
  8544.   MSG_OOB           Reads any out-of-band data on the socket. 
  8545.  
  8546.   MSG_PEEK          Peeks at the data present on the socket; the data is 
  8547.                     returned but not consumed, so that a subsequent receive 
  8548.                     operation sees the same data. 
  8549.  
  8550.   MSG_WAITALL       Wait for data to fill all buffers before returning. 
  8551.  
  8552. Description 
  8553.  
  8554. This call receives data on a socket with descriptor s and stores it in the 
  8555. buffer pointed to by buf. The recv() call applies only to connected sockets. 
  8556. For information on how to use recv() with datagram and raw sockets, see 
  8557. Datagram or Raw Sockets. 
  8558.  
  8559. The recv() call returns the length of the incoming data. If a datagram or 
  8560. sequenced packet is too long to fit in the buffer, the excess is discarded. No 
  8561. data is discarded for stream or sequenced packet sockets. If data is not 
  8562. available at the socket with descriptor s, the recv() call waits for data to 
  8563. arrive and blocks the caller, unless the socket is in nonblocking mode. See 
  8564. ioctl() for a description of how to set nonblocking mode. 
  8565.  
  8566. Use the select() call to determine when more data arrives. 
  8567.  
  8568. Return Values 
  8569.  
  8570. When successful, the number of bytes of data received into the buffer is 
  8571. returned.  The value 0 indicates that the connection is closed. The value -1 
  8572. indicates an error. You can get the specific error code by calling sock_errno() 
  8573. or psock_errno(). 
  8574.  
  8575. Error Code           Description
  8576.  
  8577. SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  8578.  
  8579. SOCEFAULT            Using the buf and len parameters would result in an 
  8580.                      attempt to access memory outside the caller's address 
  8581.                      space. 
  8582.  
  8583. SOCEINTR             Interrupted system call. 
  8584.  
  8585. SOCEINVAL            Invalid argument. 
  8586.  
  8587. SOCEWOULDBLOCK       The s parameter is in nonblocking mode and no data is 
  8588.                      available to receive, or the SO_RCVTIMEO option has been 
  8589.                      set for socket s and the timeout expired before any data 
  8590.                      arrived to receive. 
  8591.  
  8592. Related Calls 
  8593.  
  8594.      connect() 
  8595.      getsockopt() 
  8596.      ioctl() 
  8597.      readv() 
  8598.      recvfrom() 
  8599.      recvmsg() 
  8600.      select() 
  8601.      send() 
  8602.      sendmsg() 
  8603.      sendto() 
  8604.      setsockopt() 
  8605.      shutdown() 
  8606.      sock_errno() 
  8607.      socket() 
  8608.      writev() 
  8609.  
  8610.  
  8611. ΓòÉΓòÉΓòÉ 13.16. recvfrom() ΓòÉΓòÉΓòÉ
  8612.  
  8613. The socket call receives data on a socket. 
  8614.  
  8615. Syntax 
  8616.  
  8617. #include <types.h>
  8618. #include <sys\socket.h>
  8619. int recvfrom(s, buf, len, flags, name, namelen)
  8620. int s;
  8621. char *buf;
  8622. int len;
  8623. int flags;
  8624. struct sockaddr *name;
  8625. int *namelen;
  8626.  
  8627. Parameters 
  8628.  
  8629.   Socket descriptor. 
  8630.  
  8631. buf 
  8632.   Pointer to the buffer that receives the data. 
  8633.  
  8634. len 
  8635.   Length of the buffer in bytes pointed to by the buf parameter. 
  8636.  
  8637. flags 
  8638.   Permits the call to exercise control over the reception of messages. Set this 
  8639.   parameter by specifying one or more of the following flags. If you specify 
  8640.   more than one flag, use the logical OR operator (|) to separate them. Setting 
  8641.   this parameter is supported only for sockets in the internet domain. 
  8642.  
  8643.   MSG_DONTWAIT        Do not wait for resources or data during this call. 
  8644.  
  8645.   MSG_OOB             Reads any out-of-band data on the socket. 
  8646.  
  8647.   MSG_PEEK            Peeks at the data present on the socket; the data is 
  8648.                       returned but not consumed, so that a subsequent receive 
  8649.                       operation sees the same data. 
  8650.  
  8651.   MSG_WAITALL         Wait for data to fill all buffers before returning. 
  8652.  
  8653. name 
  8654.   Pointer to a sockaddr structure (buffer) that data is received from. If name 
  8655.   is a nonzero value, the source address is returned. 
  8656.  
  8657. namelen 
  8658.   Pointer to the size in bytes of the buffer pointed to by name. 
  8659.  
  8660. Description 
  8661.  
  8662. The recvfrom() call receives data on a socket with descriptor s and stores it 
  8663. in a buffer. The recvfrom() call applies to any socket type, whether connected 
  8664. or not. 
  8665.  
  8666. If name is nonzero, the address of the data sender is returned. The namelen 
  8667. parameter is first initialized to the size of the buffer associated with name; 
  8668. on return, it is modified to indicate the actual number of bytes stored there. 
  8669.  
  8670. The recvfrom() call returns the length of the incoming message or data. If a 
  8671. datagram or sequenced packet is too long to fit in the supplied buffer, the 
  8672. excess is discarded. No data is discarded for stream or sequenced packet 
  8673. sockets. If data is not available at the socket with descriptor s, the 
  8674. recvfrom() call waits for data to arrive and blocks the caller, unless the 
  8675. socket is in nonblocking mode.  See ioctl() for a description of how to set 
  8676. nonblocking mode. 
  8677.  
  8678. Return Values 
  8679.  
  8680. When successful, the number of bytes of data received into the buffer is 
  8681. returned. The value -1 indicates an error. You can get the specific error code 
  8682. by calling sock_errno() or psock_errno(). 
  8683.  
  8684. Error Code            Description
  8685.  
  8686. SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  8687.  
  8688. SOCEFAULT             Using the buf and len parameters would result in an 
  8689.                       attempt to access memory outside the caller's address 
  8690.                       space. 
  8691.  
  8692. SOCEWOULDBLOCK        The s parameter is in nonblocking mode and no data is 
  8693.                       available to receive, or the SO_RCVTIMEO option has been 
  8694.                       set for socket s and the timeout expired before any data 
  8695.                       arrived to receive. 
  8696.  
  8697. SOCEINVAL             Invalid argument. 
  8698.  
  8699. Related Calls 
  8700.  
  8701.      ioctl() 
  8702.      readv() 
  8703.      recv() 
  8704.      recvmsg() 
  8705.      select() 
  8706.      send() 
  8707.      sendmsg() 
  8708.      sendto() 
  8709.      setsockopt() 
  8710.      shutdown() 
  8711.      sock_errno() 
  8712.      socket() 
  8713.      writev() 
  8714.  
  8715.  
  8716. ΓòÉΓòÉΓòÉ 13.17. recvmsg() ΓòÉΓòÉΓòÉ
  8717.  
  8718. The socket call receives data and control information on a specified socket. 
  8719.  
  8720. Syntax 
  8721.  
  8722. #include <types.h>
  8723. #include <sys\socket.h>
  8724. int recvmsg(s, msg, flags)
  8725. int s;
  8726. struct msghdr *msg;
  8727. int flags;
  8728.  
  8729. Parameters 
  8730.  
  8731.   Socket descriptor. 
  8732.  
  8733. msg 
  8734.   Pointer to a message header that receives the message. 
  8735.  
  8736. flags 
  8737.   Permits the call to exercise control over the reception of messages. Set this 
  8738.   parameter by specifying one or more of the following flags. If you specify 
  8739.   more than one flag, use the logical OR operator (|) to separate them. Setting 
  8740.   this parameter is supported only for sockets in the internet domain. 
  8741.  
  8742.   MSG_DONTWAIT      Do not wait for resources or data during this call. 
  8743.  
  8744.   MSG_OOB           Reads any out-of-band data on the socket. 
  8745.  
  8746.   MSG_PEEK          Peeks at the data present on the socket; the data is 
  8747.                     returned but not consumed, so that a subsequent receive 
  8748.                     operation will see the same data. 
  8749.  
  8750.   MSG_WAITALL       Wait for data to fill all buffers before returning. 
  8751.  
  8752. Description 
  8753.  
  8754. This call receives a message on a socket with descriptor s. 
  8755.  
  8756. Networking services supports the following msghdr structure. 
  8757.  
  8758. Note:  The fields msg_control and msg_controllen are ignored for the NetBIOS 
  8759.        and Local IPC domains. 
  8760.  
  8761.               struct msghdr {
  8762.                      caddr_t msg_name;             /* optional pointer to destination address buffer */
  8763.                      int     msg_namelen;          /* size of address buffer */
  8764.                      struct  iovec  *msg_iov;      /* scatter/gather array */
  8765.                      int     msg_iovlen;           /* number of elements in msg_iov, maximum 1024 */
  8766.                      caddr_t msg_control;          /* ancillary data */
  8767.                      u_int   msg_controllen;       /* ancillary data length */
  8768.                      int     msg_flags;            /* flags on receive message */
  8769.               };
  8770.  
  8771. msg_iov is a scatter/gather array of iovec structures. The iovec structure is 
  8772. defined in <SYS/UIO.H> and contains the following fields: 
  8773.  
  8774. Field          Description
  8775. iov_base       Pointer to the buffer 
  8776. iov_len        Length of the buffer 
  8777.  
  8778. TCP/IP alters iov_base and iov_len for each element in the input struct iovec 
  8779. array. iov_base will point to the next character of the processed (sent or 
  8780. received) data on the original buffer, and iov_len will become (input value - 
  8781. processed length). Thus if only partial data has been sent or received and the 
  8782. application expects more data to send or receive, it can pass the same iovec 
  8783. structure back in a subsequent call. 
  8784.  
  8785. The recvmsg() call applies to connection-oriented or connectionless sockets. 
  8786.  
  8787. This call returns the length of the data received. If a datagram or sequenced 
  8788. packet is too long to fit in the supplied buffer, the excess is discarded.  No 
  8789. data is discarded for stream sockets. If data is not available at the socket 
  8790. with descriptor s, the recvmsg() call waits for a message to arrive and blocks 
  8791. the caller, unless the socket is in nonblocking mode. See ioctl() for a 
  8792. description of how to set nonblocking mode. 
  8793.  
  8794. Return Values 
  8795.  
  8796. When successful, the number of bytes of data received into the buffer is 
  8797. returned. The value 0 indicates the connection is closed; the value -1 
  8798. indicates an error. You can get the specific error code by calling sock_errno() 
  8799. or psock_errno(). 
  8800.  
  8801. Error Code           Description
  8802.  
  8803. SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  8804.  
  8805. SOCEFAULT            Using msg would result in an attempt to access memory 
  8806.                      outside the caller's address space. 
  8807.  
  8808. SOCEINTR             Interrupted system call. 
  8809.  
  8810. SOCENOTCONN          The socket is not connected. 
  8811.  
  8812. SOCEWOULDBLOCK       The s parameter is in nonblocking mode, and no data is 
  8813.                      available to receive. 
  8814.  
  8815. Examples 
  8816.  
  8817. The following is an example of using recvmsg() call to receive token ring 
  8818. routing information in the msg_control buffers: 
  8819.  
  8820.  
  8821. Example of recvmsg() Call
  8822.  
  8823. char buf[50], control_buf[100];
  8824. main(int argc, char *argv[])
  8825. {
  8826.     struct sockaddr_in  server;
  8827.     int optlen, smsg, byterecv,rv,i, ip_recvtrri;
  8828.     struct msghdr msg;
  8829.     struct cmsghdr *cmsg;
  8830.     struct iovec iov;
  8831.     struct timeval tv;
  8832.  
  8833.     if ((smsg = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
  8834.         psock_errno("Socket()");
  8835.  
  8836.     server.sin_len    = sizeof(struct sockaddr);
  8837.     server.sin_family = AF_INET;
  8838.     server.sin_port   = htons(atoi(argv[1]));         /* port number */
  8839.     server.sin_addr.s_addr = INADDR_ANY;
  8840.  
  8841.     if (bind(smsg, (struct sockaddr *)&server , sizeof(server)) < 0)
  8842.        psock_errno("bind()");
  8843.  
  8844.     iov.iov_base = buf;
  8845.     iov.iov_len  = sizeof(buf)-1;
  8846.  
  8847.     msg.msg_name       = NULL;
  8848.     msg.msg_namelen    = sizeof(struct sockaddr);
  8849.     msg.msg_iov        = &iov
  8850.     msg.msg_iovlen     = 1;
  8851.     msg.msg_control    = control_buf;
  8852.     msg.msg_controllen = sizeof(struct cmsghdr)+4+18;/*4 byte ipaddr + 18 TRRI*/
  8853.  
  8854.     ip_recvtrri  = 1;
  8855.     if (setsockopt(smsg,IPPROTO_IP,IP_RECVTRRI,(char *)&ip_recvtrri ,
  8856.               sizeof(ip_recvtrri)) < 0)
  8857.         psock_errno("setsockopt() IP_RECVTRRI");
  8858.  
  8859.     /* Set another IP socket options for timeout so we do not block waiting */
  8860.     tv.tv_sec  = 10;  /* Wait for max 10 sec on recvmsg */
  8861.     tv.tv_usec = 0;
  8862.     rv = setsockopt(smsg, SOL_SOCKET, SO_RCVTIMEO, (char *) &tv,
  8863.              sizeof(struct timeval));
  8864.     if (rv < 0) psock_errno("Set SO_RCVTIMEO");
  8865.  
  8866.     if((byterecv=recvmsg(smsg, &msg, 0))<0)
  8867.        psock_errno("recvmsg()");
  8868.     else {
  8869.       cmsg = (struct cmsghdr *) msg.msg_control;
  8870.  
  8871.       printf(" IP_RECV TR RI (data in network byte order): ");
  8872.       for (i=sizeof(struct cmsghdr); i < cmsg->cmsg_len;i++)
  8873.          printf(" %x",msg.msg_control[i]);
  8874.     }
  8875.  
  8876.     soclose(smsg);
  8877. }
  8878.  
  8879. Related Calls 
  8880.  
  8881.      connect() 
  8882.      getsockopt() 
  8883.      ioctl() 
  8884.      os2_ioctl() 
  8885.      recv() 
  8886.      recvfrom() 
  8887.      select() 
  8888.      send() 
  8889.      sendmsg() 
  8890.      sendto() 
  8891.      shutdown() 
  8892.      sock_errno() 
  8893.      socket() 
  8894.  
  8895.  
  8896. ΓòÉΓòÉΓòÉ 13.18. removesocketfromlist() ΓòÉΓòÉΓòÉ
  8897.  
  8898. The removesocketfromlist() call removes a socket from the list of owned sockets 
  8899. for the calling process. 
  8900.  
  8901. Syntax 
  8902.  
  8903. #include <types.h>
  8904. #include <sys\socket.h>
  8905. int removesockettolist(s)
  8906. int s;
  8907.  
  8908. Parameters 
  8909.  
  8910.   Socket descriptor. 
  8911.  
  8912. Description 
  8913.  
  8914. When a process ends, the sockets library automatically cleans up sockets by 
  8915. registering an exit list handler.  This exit routine closes all open sockets 
  8916. that are maintained in a process's socket list. When a process is initiated the 
  8917. list is empty, and whenever a socket() or soclose() call is made the list is 
  8918. updated.  The removesocketfromlist() call provides a mechanism to transfer 
  8919. socket ownership to another process: it removes the socket indicated by the s 
  8920. parameter from the calling process's socket ownership list. 
  8921.  
  8922. Return Values 
  8923.  
  8924. The value 1 indicates success; the value 0 indicates that the socket could not 
  8925. be found in the list. 
  8926.  
  8927. Related Calls 
  8928.  
  8929.      addsockettolist() 
  8930.  
  8931.  
  8932. ΓòÉΓòÉΓòÉ 13.19. select() ΓòÉΓòÉΓòÉ
  8933.  
  8934. The socket call gets read, write, and exception status on a group of sockets. 
  8935.  
  8936. The BSD version monitors the activity on sockets by specifying an array 
  8937. (fd_set) of socket numbers for which the caller wants to read the data, write 
  8938. the data, and check exception-pending conditions. The BSD version provides 
  8939. FD_SET, FD_CLR, FD_ISSET, and FD_ZERO macros to add or delete socket numbers 
  8940. from the array. 
  8941.  
  8942. Syntax 
  8943.  
  8944. #include <types.h>
  8945. #include <unistd.h>
  8946. #include <sys\time.h>
  8947. int select(nfds, readfds, writefds, exceptfds, timeout)
  8948. int nfds;
  8949. fd_set *readfds;
  8950. fd_set *writefds;
  8951. fd_set *exceptfds;
  8952. struct timeval *timeout;
  8953.  
  8954. Parameters 
  8955.  
  8956. nfds 
  8957.   This parameter is unused; it is maintained for compatibility with BSD. 
  8958.  
  8959. readfds 
  8960.   Pointer to a list of descriptors to be checked for reading. 
  8961.  
  8962. writefds 
  8963.   Pointer to a list of descriptors to be checked for writing. 
  8964.  
  8965. exceptfds 
  8966.   Pointer to a list of descriptors to be checked for exception-pending 
  8967.   conditions. For networking services sockets, the only exception-pending 
  8968.   condition is out-of-band data in the receive buffer. 
  8969.  
  8970. timeout 
  8971.   Pointer to the time to wait for the select() call to complete. 
  8972.  
  8973. Description 
  8974.  
  8975. This call monitors activity on a set of different sockets until a timeout 
  8976. expires, to see if any sockets are ready for reading or writing, or if any 
  8977. exception-pending conditions are pending. 
  8978.  
  8979. Reinitializing readfds, writefds, and exceptfds every time select() is called 
  8980. is required. 
  8981.  
  8982. If timeout is a NULL pointer, the call blocks indefinitely until one of the 
  8983. requested conditions is satisfied. If timeout is non-NULL, it specifies the 
  8984. maximum time to wait for the call to complete. To poll a set of sockets, the 
  8985. timeout pointer should point to a zeroed timeval structure. The timeval 
  8986. structure is defined in the <SYS\TIME.H> header file and contains the following 
  8987. fields: 
  8988.  
  8989. struct timeval {
  8990.        long tv_sec;  /* Number of seconds */
  8991.        long tv_usec; /* Number of microseconds */
  8992. }
  8993.  
  8994. An fd_set is made up of an array of integers. Macros are provided to manipulate 
  8995. the array. 
  8996.  
  8997. Macro                                   Description
  8998.  
  8999. FD_SET(socket, array_address)           Adds the socket to the list pointed to 
  9000.                                         by array_address. 
  9001.  
  9002. FD_CLR(socket, array_address)           Removes the socket from the list. 
  9003.  
  9004. FD_ISSET(socket, array_address)         Returns true if the descriptor is part 
  9005.                                         of the array; otherwise, returns false. 
  9006.  
  9007. FD_ZERO(socket, array_address)          Clears the entire array for all socket 
  9008.                                         descriptors. 
  9009.  
  9010. Note:  For macros FD_SET, FD_CLR, FD_ISSET, and FD_ZERO, define the parameters 
  9011.        socket and array_address in the following manner: 
  9012.  
  9013.               int socket;
  9014.               struct fd_set *array_address;
  9015.  
  9016. Setting any of the descriptor pointers to zero indicates that no checks are to 
  9017. be made for the conditions. For example, setting exceptfds to be a NULL pointer 
  9018. causes the select call to check for only read and write conditions. 
  9019.  
  9020. Return Values 
  9021.  
  9022. The total number of ready sockets (in all arrays) is returned. The value -1 
  9023. indicates an error. The value 0 indicates an expired time limit. If the return 
  9024. value is greater than 0, the socket descriptors in each array that are not 
  9025. ready are removed from the array and fd_array is rearranged so that the ready 
  9026. sockets are at the top. The fd_count parameter is adjusted accordingly and 
  9027. returned. You can get the specific error code by calling sock_errno() or 
  9028. psock_errno(). 
  9029.  
  9030. sock_errno() Value       Description
  9031. SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  9032. SOCEFAULT                The address is not valid. 
  9033. SOCEINVAL                Invalid argument. 
  9034.  
  9035. Examples 
  9036.  
  9037. Following is an example of the select() call. 
  9038.  
  9039. ...
  9040. fd_set readsocks;
  9041. fd_set writesocks;
  9042. fd_set exceptsocks;
  9043. struct timeval timeout;
  9044. int number_found;
  9045. ...
  9046. /* add socket to read/write/except arrays.  To add descriptor s use
  9047.  *   FD_SET (s, &readsocks);
  9048.  *
  9049.  */
  9050. ...
  9051. number_found = select(0,&readsocks, &writesocks,
  9052.                       &exceptsocks, &timeout);
  9053.  
  9054. Related Calls 
  9055.  
  9056.      accept() 
  9057.      accept_and_recv() 
  9058.      connect() 
  9059.      os2_select() 
  9060.      recv() 
  9061.      send() 
  9062.      sock_errno() 
  9063.      socket() 
  9064.  
  9065.  
  9066. ΓòÉΓòÉΓòÉ 13.20. send() ΓòÉΓòÉΓòÉ
  9067.  
  9068. The socket call sends data on a connected socket. 
  9069.  
  9070. Syntax 
  9071.  
  9072. #include <types.h>
  9073. #include <sys\socket.h>
  9074. int send(s, msg, len, flags)
  9075. int s;
  9076. char *msg;
  9077. int len;
  9078. int flags;
  9079.  
  9080. Parameters 
  9081.  
  9082.   Socket descriptor. 
  9083.  
  9084. msg 
  9085.   Pointer to a buffer containing the message to transmit. 
  9086.  
  9087. len 
  9088.   Length of the message pointed to by the msg parameter. 
  9089.  
  9090. flags 
  9091.   Allows the sender to control the transmission of the message. Set this 
  9092.   parameter by specifying one or more of the following flags. If you specify 
  9093.   more than one flag, use the logical OR operator (|) to separate them. Setting 
  9094.   this parameter is supported only for sockets in the internet domain. 
  9095.  
  9096.   MSG_DONTROUTE           The SO_DONTROUTE socket option is turned on for the 
  9097.                           duration of the operation.  This is usually used only 
  9098.                           by diagnostic or routing programs. 
  9099.  
  9100.   MSG_DONTWAIT            Do not wait for resources during this call. 
  9101.  
  9102.   MSG_EOF                 Indicates that the sending of data on the connection 
  9103.                           is complete. This flag is effective on T/TCP 
  9104.                           connections only. 
  9105.  
  9106.   MSG_OOB                 Sends out-of-band data on sockets that support 
  9107.                           SOCK_STREAM communication. 
  9108.  
  9109. Description 
  9110.  
  9111. This call sends data on the socket with descriptor s. The send() call applies 
  9112. to connected sockets. For information on how to use send() with datagram and 
  9113. raw sockets, see Datagram or Raw Sockets. The sendto() and sendmsg() calls can 
  9114. be used with unconnected or connected sockets. 
  9115.  
  9116. To broadcast on a socket, first issue a setsockopt() call using the 
  9117. SO_BROADCAST option to gain broadcast permission. 
  9118.  
  9119. Specify the length of the message with the len parameter. If the message is too 
  9120. long to pass through the underlying protocol, the system returns an error and 
  9121. does not transmit the message. 
  9122.  
  9123. No indication of failure to deliver is implied in a send() call. A return value 
  9124. of -1 indicates some locally detected errors. 
  9125.  
  9126. If buffer space is not available at the socket to hold the message to be sent, 
  9127. the send() call normally blocks, unless the socket is placed in nonblocking 
  9128. mode. See ioctl() for a description of how to set nonblocking mode. Use the 
  9129. select() call to determine when it is possible to send more data. 
  9130.  
  9131. Return Values 
  9132.  
  9133. When successful, the number of bytes of the socket with descriptor s that is 
  9134. added to the send buffer is returned. This may be less than the number of bytes 
  9135. specified in the length parameter. Successful completion does not imply that 
  9136. the data has already been delivered to the receiver. The return value -1 
  9137. indicates an error was detected on the sending side of the connection. You can 
  9138. get the specific error code by calling sock_errno() or psock_errno(). 
  9139.  
  9140. Error Code            Description
  9141.  
  9142. SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  9143.  
  9144. SOCEFAULT             Using the msg and len parameters would result in an 
  9145.                       attempt to access memory outside the caller's address 
  9146.                       space. 
  9147.  
  9148. SOCEINTR              Interrupted system call. 
  9149.  
  9150. SOCEINVAL             Invalid argument. 
  9151.  
  9152. SOCENOBUFS            No buffer space is available to send the message. 
  9153.  
  9154. SOCEWOULDBLOCK        The s parameter is in nonblocking mode and the data 
  9155.                       cannot be sent without blocking, or the SO_SNDTIMEO 
  9156.                       option has been set for socket s and the timeout expired 
  9157.                       before any data was sent. 
  9158.  
  9159. Related Calls 
  9160.  
  9161.      send_file() 
  9162.      connect() 
  9163.      getsockopt() 
  9164.      ioctl() 
  9165.      readv() 
  9166.      recv() 
  9167.      recvfrom() 
  9168.      recvmsg() 
  9169.      select() 
  9170.      sendmsg() 
  9171.      sendto() 
  9172.      setsockopt() 
  9173.      shutdown() 
  9174.      sock_errno() 
  9175.      socket() 
  9176.      writev() 
  9177.  
  9178.  
  9179. ΓòÉΓòÉΓòÉ 13.21. send_file() ΓòÉΓòÉΓòÉ
  9180.  
  9181. The send_file() function sends the file data over a connected socket. 
  9182.  
  9183. Syntax 
  9184.  
  9185. #include <types.h>
  9186. #include <sys\socket.h>
  9187. ssize_t send_file(socket_ptr, sf_struct, flags)
  9188. int * socket_ptr;
  9189. struct sf_parms * sf_struct;
  9190. int flags;
  9191.  
  9192. Parameters 
  9193.  
  9194. socket_ptr 
  9195.   Pointer to the socket descriptor of a connected socket. 
  9196.  
  9197. sf_struct 
  9198.   Pointer to a structure that contains variables needed by send_file(). 
  9199.  
  9200. flags 
  9201.   Allows the sender to control the transmission of the message. Set this 
  9202.   parameter by specifying one or more of the following flags. If you specify 
  9203.   more than one flag, use the logical OR operator (|) to separate them. Setting 
  9204.   this parameter is supported only for sockets in the Internet domain. 
  9205.  
  9206.   SF_CLOSE                Close the connection after data has been successfully 
  9207.                           sent or queued for retransmission. 
  9208.  
  9209.   SF_REUSE                Prepare the socket for reuse after the data has been 
  9210.                           successfully sent or queued for transmission and the 
  9211.                           existing connection closed. 
  9212.  
  9213. Description 
  9214.  
  9215. The send_file() function sends data from the file associated with the open file 
  9216. handle, directly from the file-system cache, over the connection associated 
  9217. with the socket. 
  9218.  
  9219. The send_file() function attempts to write header_length bytes from the buffer 
  9220. pointed to by header_data, followed by file_bytes from the file associated with 
  9221. file_descriptor, followed by trailer_length bytes from the buffer pointed to by 
  9222. trailer_data, over the connection associated with the socket pointed to by 
  9223. socket_ptr. 
  9224.  
  9225. As data is sent, the kernel updates the variables in the sf_parms structure so 
  9226. that if the send_file() is interrupted by a signal, the application simply 
  9227. needs to reissue the send_file(). If the application sets file_offset > the 
  9228. actual file size, or file_bytes > (the actual file size - file_offset), the 
  9229. return value is -1 with errno set to [EINVAL]. 
  9230.  
  9231. The flags argument is effective only after all the data has been sent 
  9232. successfully; otherwise it is ignored. The application should zero the flags 
  9233. argument before setting the appropriate value. If flags = SF_REUSE and socket 
  9234. reuse is not supported, then upon successful completion of sending the data, 
  9235. the kernel closes this socket and sets the socket pointed to by socket_ptr to 
  9236. -1. If flags = SF_CLOSE and send_file() completes successfully, the socket 
  9237. pointed to by socket_ptr is set to -1 by the kernel. 
  9238.  
  9239. Implementation Note 
  9240.  
  9241.     The send_file() API can be used only on OS/2 WARP 4.5, which supports 
  9242.      Kernel Execution Environment (KEE32), and Installable File System 
  9243.      Mechanism (IFSM32). For more information on KEE, refer to OS/2 WARP 4.5 
  9244.      related Document. 
  9245.  
  9246.     The performance of accept_and_recv() and send_file() is greatly effected 
  9247.      by the number of threads that are allowed to be active concurrently. If 
  9248.      too few threads are active and work is not done quickly enough, too many 
  9249.      threads, needless traps, and context switches can reduce performance by a 
  9250.      factor of two. The kernel should make some attempt to intelligently 
  9251.      determine  how many threads may be active concurrently. Optimally, the 
  9252.      number of threads active concurrently should be just below the saturation 
  9253.      point, that is, one or two connect request waiting on the backlog queue so 
  9254.      that when an accept_and_recv() thread completes, there is another connect 
  9255.      requests ready to be processed. 
  9256.  
  9257. Return Values 
  9258.  
  9259.  There are three possible return values from send_file() : 
  9260.  
  9261.     -1: An error has occurred, check errno for more information. 
  9262.  
  9263.     0: The command has completed successfully. 
  9264.  
  9265.     1: The command was interrupted by a signal while sending data. 
  9266.  
  9267. Error Code            Description
  9268.  
  9269. EACCESS               The calling process does not have the appropriate 
  9270.                       privileges. 
  9271.  
  9272. EBADF                 Either the socket pointed to by the socket_ptr argument, 
  9273.                       or the file_desc is not a valid descriptor. 
  9274.  
  9275. ECONNABORTED          A connection has stopped. 
  9276.  
  9277. ECONNRESET            A connection was forcibly closed by a peer. 
  9278.  
  9279. EFAULT                The data buffer pointed to by socket_ptr, file_size, 
  9280.                       header_data or trailer_data was not valid. 
  9281.  
  9282. EINTR                 The send_file() function was interrupted by a signal that 
  9283.                       was caught before any data was sent. 
  9284.  
  9285. EINVAL                The value specified by an attribute is not valid. 
  9286.  
  9287. ENOTCONN              The socket is not connected. 
  9288.  
  9289. EPIPE                 The socket is shutdown for writing, or the socket is 
  9290.                       connection-mode and no longer connected. 
  9291.  
  9292. EIO                   An I/O error occurred. 
  9293.  
  9294. ENETDOWN              The local interface used to reach the destination is 
  9295.                       down. 
  9296.  
  9297. ENETUNREACH           No route to the destination is present. 
  9298.  
  9299. ENOBUFS               No buffer space is available. 
  9300.  
  9301. ENOMEM                There was insufficient memory available to complete the 
  9302.                       operation. 
  9303.  
  9304. ENOSR                 There were insufficient STREAMS resources available for 
  9305.                       the operation to complete. 
  9306.  
  9307. ENOTSOCK              The socket pointed to by the socket_ptr argument does not 
  9308.                       refer to a socket. 
  9309.  
  9310. Examples 
  9311.  
  9312. The following is an example of using send_file() call to send a file data over 
  9313. a connected socket. 
  9314.  
  9315. #define MSG_CLOSE 0x800
  9316. #define O_RDONLY  0x4
  9317.  
  9318. #include #include #include #include #include #include #include #include
  9319. char  serveraddress[128],filename[256];
  9320. int   serverport = 6000;
  9321. int   fd,rc,s;
  9322.  
  9323. struct sf_parms
  9324.    {
  9325.         void   *header_data;      /* ptr to header data */
  9326.         size_t header_length;     /* size of header data */
  9327.         int    file_handle;       /* file handle to send from */
  9328.         size_t file_size;         /* size of file */
  9329.         int    file_offset;       /* byte offset in file to send from */
  9330.         size_t file_bytes;        /* bytes of file to be sent */
  9331.         void   *trailer_data;     /* ptr to trailer data */
  9332.         size_t trailer_length;    /* size of trailer data */
  9333.         size_t bytes_sent;        /* bytes sent in this send_file call */
  9334.    } sfp;
  9335.  
  9336. int   putfile (void);
  9337.  
  9338. int main (int argc, char *argv[])
  9339. {
  9340.  
  9341.  strcpy (serveraddress, argv[1]);   /* argv[1] is server address to which file is to be sent */
  9342.  strcpy (filename, argv[2]);        /* argv[2] is name of the file to be sent */
  9343.  
  9344.  printf ("Sending File to server\n");
  9345.    if ((rc = putfile()) != 0)
  9346.         {
  9347.           printf ("Putfile() failed rc = %d sock_errno = %d \n", rc, sock_errno());
  9348.             return(rc);
  9349.         }
  9350. }
  9351.  
  9352. int putfile ()
  9353. {
  9354.     struct sockaddr_in servername;
  9355.  
  9356.     if( (s = socket (PF_INET, SOCK_STREAM, 0)) != -1 )
  9357.     {
  9358.       servername.sin_len         = sizeof(servername);
  9359.       servername.sin_family      = AF_INET;
  9360.       servername.sin_addr.s_addr = inet_addr(serveraddress);
  9361.       servername.sin_port        = serverport;
  9362.  
  9363.     if((rc = connect(s,(struct sockaddr *)&servername,sizeof(servername))) != -1)
  9364.        {
  9365.             fd =open(filename,O_RDONLY,0);
  9366.             sfp.header_data   = 0;
  9367.             sfp.header_length = 0;
  9368.             sfp.file_handle   = fd;
  9369.             sfp.file_size     = -1;
  9370.             sfp.file_offset   = 0;
  9371.             sfp.file_bytes    = -1;
  9372.             sfp.trailer_data  = 0;
  9373.             sfp.trailer_length= 0;
  9374.             sfp.bytes_sent    = 0;
  9375.  
  9376.           if(( rc = send_file(&s,&sfp,MSG_CLOSE)) != 0)
  9377.                 printf( " ******  FILE NOT SENT  ****** ");
  9378.             close(fd);
  9379.        }
  9380.       else
  9381.         printf ("send_file :connect() failed sock_errno = %d \n",sock_errno());
  9382.     }
  9383.     else
  9384.       printf ("send_file :socket() failed rc = %d\n", sock_errno());
  9385.    return(rc);
  9386. }
  9387.  
  9388. Related Calls 
  9389.  
  9390.      send() 
  9391.      connect() 
  9392.      getsockopt() 
  9393.      ioctl() 
  9394.      readv() 
  9395.      recv() 
  9396.      recvfrom() 
  9397.      recvmsg() 
  9398.      select() 
  9399.      sendmsg() 
  9400.      sendto() 
  9401.      setsockopt() 
  9402.      shutdown() 
  9403.      sock_errno() 
  9404.      socket() 
  9405.      writev() 
  9406.  
  9407.  
  9408. ΓòÉΓòÉΓòÉ 13.22. sendmsg() ΓòÉΓòÉΓòÉ
  9409.  
  9410. The socket call sends data and control information on a specified socket. 
  9411.  
  9412. Syntax 
  9413.  
  9414. #include <types.h>
  9415. #include <sys\socket.h>
  9416. int sendmsg(s, msg, flags)
  9417. int s;
  9418. struct msghdr *msg;
  9419. int flags;
  9420.  
  9421. Parameters 
  9422.  
  9423.   Socket descriptor. 
  9424.  
  9425. msg 
  9426.   Pointer to a message header containing a message to be sent. 
  9427.  
  9428. flags 
  9429.   Allows the sender to control the message transmission. Set this parameter by 
  9430.   specifying one or more of the following flags. If you specify more than one 
  9431.   flag, use the logical OR operator (|) to separate them. Setting this 
  9432.   parameter is supported only for sockets in the internet domain. 
  9433.  
  9434.   MSG_DONTROUTE              The SO_DONTROUTE socket option is turned on for 
  9435.                              the duration of the operation.  This is usually 
  9436.                              used only by diagnostic or routing programs. 
  9437.  
  9438.   MSG_DONTWAIT               Do not wait for resources during this call. 
  9439.  
  9440.   MSG_EOF                    Indicates that the sending of data on the 
  9441.                              connection is complete. This flag is effective on 
  9442.                              T/TCP connections only. 
  9443.  
  9444.   MSG_OOB                    Sends out-of-band data on the socket. 
  9445.  
  9446. Description 
  9447.  
  9448. This call sends a msghdr structure on a socket with descriptor s. 
  9449.  
  9450. Networking services supports the following msghdr structure. 
  9451.  
  9452. Note:  The fields msg_control and msg_controllen are ignored for the NetBIOS 
  9453.        and Local IPC domains. 
  9454.  
  9455.               struct msghdr {
  9456.                      caddr_t msg_name;             /* optional pointer to destination address buffer */
  9457.                      int     msg_namelen;          /* size of address buffer */
  9458.                      struct iovec  *msg_iov;       /* scatter/gather array */
  9459.                      int     msg_iovlen;           /* number of elements in msg_iov, maximum 1024 */
  9460.                      caddr_t msg_control;          /* ancillary data */
  9461.                      u_int   msg_controllen;       /* ancillary data length */
  9462.                      int     msg_flags;            /* flags on received message */
  9463.               };
  9464.  
  9465. To broadcast on a socket, the application program must first issue a 
  9466. setsockopt() call using the SO_BROADCAST option, to gain broadcast permission. 
  9467.  
  9468. The sendmsg() call applies to connection-oriented and connectionless sockets. 
  9469.  
  9470. msg_iov is a scatter/gather array of iovec structures. The iovec structure is 
  9471. defined in <SYS/UIO.H> and contains the following fields: 
  9472.  
  9473. Field          Description
  9474. iov_base       Pointer to the buffer 
  9475. iov_len        Length of the buffer 
  9476.  
  9477. TCP/IP alters iov_base and iov_len for each element in the input struct iovec 
  9478. array. iov_base will point to the next character of the processed (sent or 
  9479. received) data on the original buffer, and iov_len will become (input value - 
  9480. processed length). Thus if only partial data has been sent or received and the 
  9481. application expects more data to send or receive, it can pass the same iovec 
  9482. structure back in a subsequent call. 
  9483.  
  9484. This call returns the length of the data sent. If the socket with descriptor s 
  9485. is not ready for sending data, the sendmsg() call waits unless the socket is in 
  9486. nonblocking mode. See ioctl() for a description of how to set nonblocking mode. 
  9487.  
  9488. Return Values 
  9489.  
  9490. When successful, the number of bytes of data sent is returned.  Successful 
  9491. completion does not guarantee delivery of the data to the receiver. The return 
  9492. value -1 indicates an error was detected on the sending side of the connection. 
  9493. You can get the specific error code by calling sock_errno() or psock_errno(). 
  9494.  
  9495. Error Code            Description
  9496.  
  9497. SOCEDESTADDRREQ       The msghdr msg_name parameter is set to NULL and a 
  9498.                       destination address is required. 
  9499.  
  9500. SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  9501.  
  9502. SOCEFAULT             Using msg would result in an attempt to access memory 
  9503.                       outside the caller's address space. 
  9504.  
  9505. SOCEINTR              Interrupted system call. 
  9506.  
  9507. SOCEINVAL             msg_namelen is not the size of a valid address for the 
  9508.                       specified address family. 
  9509.  
  9510. SOCEMSGSIZE           The message was too big to be sent as a single datagram. 
  9511.  
  9512. SOCENOBUFS            No buffer space is available to send the message. 
  9513.  
  9514. SOCENOTCONN           The socket is not connected. 
  9515.  
  9516. SOCEWOULDBLOCK        The s parameter is in nonblocking mode and the data 
  9517.                       cannot be sent without blocking. 
  9518.  
  9519. Related Calls 
  9520.  
  9521.      getsockopt() 
  9522.      ioctl() 
  9523.      readv() 
  9524.      recv() 
  9525.      recvfrom() 
  9526.      recvmsg() 
  9527.      select() 
  9528.      send() 
  9529.      sendto() 
  9530.      setsockopt() 
  9531.      shutdown() 
  9532.      sock_errno() 
  9533.      socket() 
  9534.      writev() 
  9535.  
  9536.  
  9537. ΓòÉΓòÉΓòÉ 13.23. sendto() ΓòÉΓòÉΓòÉ
  9538.  
  9539. The socket call sends data on a socket. 
  9540.  
  9541. Syntax 
  9542.  
  9543. #include <types.h>
  9544. #include <sys\socket.h>
  9545. int sendto(s, msg, len, flags, to, tolen)
  9546. int s;
  9547. char *msg;
  9548. int len;
  9549. int flags;
  9550. struct sockaddr *to;
  9551. int tolen;
  9552.  
  9553. Parameters 
  9554.  
  9555.   Socket descriptor. 
  9556.  
  9557. msg 
  9558.   Pointer to the buffer containing the message to transmit. 
  9559.  
  9560. len 
  9561.   Length of the message in the buffer pointed to by the msg parameter. 
  9562.  
  9563. flags 
  9564.   Allows the sender to control the message transmission. Set this parameter to 
  9565.   0, or to one or more of the following flags. If you specify more than one 
  9566.   flag, use the logical OR operator (|) to separate them. Setting this 
  9567.   parameter is supported only for sockets in the internet domain. 
  9568.  
  9569.   MSG_DONTROUTE            The SO_DONTROUTE socket option is turned on for the 
  9570.                            duration of the operation. This is usually used only 
  9571.                            by diagnostic or routing programs. 
  9572.  
  9573.   MSG_DONTWAIT             Do not wait for resources during this call. 
  9574.  
  9575.   MSG_EOF                  Indicates that the sending of data on the connection 
  9576.                            is complete. This flag is effective on T/TCP 
  9577.                            connections only. 
  9578.  
  9579.   MSG_OOB                  Sends out-of-band data on the socket. 
  9580.  
  9581. to 
  9582.   Pointer to a sockaddr structure (buffer) containing the destination address. 
  9583.  
  9584. tolen 
  9585.   Size in bytes of the buffer pointed to by the to parameter. 
  9586.  
  9587. Description 
  9588.  
  9589. This call sends data on the socket with descriptor s. The sendto() call applies 
  9590. to connected or unconnected sockets. For unconnected datagram and raw sockets, 
  9591. the sendto() call sends data to the specified destination address. For stream 
  9592. and sequenced packet sockets the destination address is ignored. 
  9593.  
  9594. To broadcast on a socket, first issue a setsockopt() call using the 
  9595. SO_BROADCAST option to gain broadcast permissions. 
  9596.  
  9597. Provide the address of the target using the to parameter. Specify the length of 
  9598. the message with the tolen parameter. If the message is too long to pass 
  9599. through the underlying protocol, the error SOCEMSGSIZE is returned and the 
  9600. message is not transmitted. 
  9601.  
  9602. If the sending socket has no space to hold the message to be transmitted, the 
  9603. sendto() call blocks the message, unless the socket is in a nonblocking I/O 
  9604. mode. 
  9605.  
  9606. Use the select() call to determine when it is possible to send more data. 
  9607.  
  9608. Datagram sockets are connected by calling connect().  This identifies the peer 
  9609. to send/receive the datagram.  Once a datagram socket is connected to a peer, 
  9610. you may still use the sendto() call but a destination address cannot be 
  9611. included. 
  9612.  
  9613. To change the peer address when using connected datagram sockets, issue a 
  9614. connect() call with a null address.  Specifying a null address on a connected 
  9615. datagram socket removes the peer address specification.  You can then either 
  9616. issue a sendto() call specifying a different destination address or issue a 
  9617. connect() call to connect to a different peer. For more information on 
  9618. connecting datagram sockets and specifying null addresses, see Datagram or Raw 
  9619. Sockets. 
  9620.  
  9621. If the to parameter is specified and this sendto() call was preceded by a 
  9622. connect() call, the dst parameter must be NULL. If not NULL, the error 
  9623. SOCEISCONN is returned and the message is not sent. If the to parameter is 
  9624. specified and this sendto() call was not preceded by a connect() call, this 
  9625. sendto() call results in socket s being connected to dst, the message being 
  9626. sent, and socket s being disconnected from dst. 
  9627.  
  9628. Return Values 
  9629.  
  9630. When successful, the number of bytes of data sent is returned.  Successful 
  9631. completion does not guarantee delivery of the data to the receiver. The return 
  9632. value -1 indicates an error was detected on the sending side. You can get the 
  9633. specific error code by calling sock_errno() or psock_errno(). 
  9634.  
  9635. Error Code              Description
  9636.  
  9637. SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  9638.  
  9639. SOCEFAULT               Using the msg and len parameters would result in an 
  9640.                         attempt to access memory outside the caller's address 
  9641.                         space. 
  9642.  
  9643. SOCEINVAL               The tolen parameter is not the size of a valid address 
  9644.                         for the specified address family. 
  9645.  
  9646. SOCEISCONN              This call was preceded by a connect() call, the to 
  9647.                         parameter of this call is specified, but the dst 
  9648.                         parameter is not NULL. 
  9649.  
  9650. SOCEMSGSIZE             The message was too big to be sent as a single 
  9651.                         datagram. 
  9652.  
  9653. SOCENOBUFS              No buffer space is available to send the message. 
  9654.  
  9655. SOCEWOULDBLOCK          The s parameter is in nonblocking mode and the data 
  9656.                         cannot be sent without blocking, or the SO_SNDTIMEO 
  9657.                         option has been set for socket s and the timeout 
  9658.                         expired before any data was sent. 
  9659.  
  9660. SOCENOTCONN             The socket is not connected. 
  9661.  
  9662. SOCEDESTADDRREQ         Destination address required. 
  9663.  
  9664. Related Calls 
  9665.  
  9666.      getsockopt() 
  9667.      readv() 
  9668.      recv() 
  9669.      recvfrom() 
  9670.      recvmsg() 
  9671.      select() 
  9672.      send() 
  9673.      sendmsg() 
  9674.      setsockopt() 
  9675.      shutdown() 
  9676.      sock_errno() 
  9677.      socket() 
  9678.      writev() 
  9679.  
  9680.  
  9681. ΓòÉΓòÉΓòÉ 13.24. setsockopt() ΓòÉΓòÉΓòÉ
  9682.  
  9683. The socket call sets options associated with a socket. 
  9684.  
  9685. Syntax 
  9686.  
  9687. #include <types.h>
  9688. #include <sys\socket.h>
  9689. int setsockopt(s, level, optname, optval, optlen)
  9690. int s;
  9691. int level;
  9692. int optname;
  9693. char *optval;
  9694. int optlen;
  9695.  
  9696. Parameters 
  9697.  
  9698.   Socket descriptor. 
  9699.  
  9700. level 
  9701.   Specifies which option level is being set. 
  9702.  
  9703. optname 
  9704.   Name of a specified socket option. 
  9705.  
  9706. optval 
  9707.   Pointer to the option data. 
  9708.  
  9709. optlen 
  9710.   Length of the option data. 
  9711.  
  9712. Description 
  9713.  
  9714. This call provides an application program with the means to control a socket 
  9715. communication. The setsockopt() call can be used to set options associated with 
  9716. a socket, such as enabling debugging at the socket or protocol level, 
  9717. controlling timeouts, or permitting socket data broadcasts. Options can exist 
  9718. at the socket or the protocol level; options are always present at the highest 
  9719. socket level. When setting socket options, the level of the option and the name 
  9720. of the option must be specified. The following table lists the supported 
  9721. levels: 
  9722.  
  9723. Supported Levels 
  9724.  
  9725. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9726. ΓöéSupported Level               #define in                         Γöé
  9727. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9728. ΓöéSOL_SOCKET                    <SYS\SOCKET.H>                     Γöé
  9729. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9730. ΓöéIPPROTO_IP                    <NETINET\IN.H>                     Γöé
  9731. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9732. ΓöéIPPROTO_TCP                   <NETINET\IN.H>                     Γöé
  9733. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9734. ΓöéNBPROTO_NB                    <NETNB\NB.H>                       Γöé
  9735. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9736.  
  9737. The optval and optlen parameters are used to pass data used by the particular 
  9738. set command. The optval parameter points to a buffer containing the data needed 
  9739. by the set command. The optval parameter is optional and if data is not needed 
  9740. by the command, can be set to the NULL pointer. The optlen parameter must be 
  9741. set to the size of the data or data type pointed to by optval. For socket 
  9742. options that are toggles, the option is enabled if optval is nonzero and 
  9743. disabled if optval is 0. 
  9744.  
  9745. The following tables list the supported options for setsockopt() at each level 
  9746. (SOL_SOCKET, IPPROTO_IP, IPPROTO_TCP). Detailed descriptions of the options 
  9747. follow each table. 
  9748.  
  9749. Supported setsockopt() Socket Options for SOL_SOCKET 
  9750.  
  9751. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9752. ΓöéOption Name     Description             Domains(*)  Data     Boolean Γöé
  9753. Γöé                                                    Type     or ValueΓöé
  9754. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9755. ΓöéSO_BROADCAST    Allow sending of        I, N        int      Boolean Γöé
  9756. Γöé                broadcast messages                                   Γöé
  9757. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9758. ΓöéSO_DEBUG        Turn on recording of    I, L        int      Boolean Γöé
  9759. Γöé                debugging information                                Γöé
  9760. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9761. ΓöéSO_DONTROUTE    Bypass routing tables   I           int      Boolean Γöé
  9762. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9763. ΓöéSO_KEEPALIVE    Keep connections alive  I           int      Boolean Γöé
  9764. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9765. ΓöéSO_LINGER       Linger on close if data I           struct   Value   Γöé
  9766. Γöé                present                             linger           Γöé
  9767. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9768. ΓöéSO_L_BROADCAST  Limited broadcast sent  I           int      Boolean Γöé
  9769. Γöé                on all interfaces                                    Γöé
  9770. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9771. ΓöéSO_OOBINLINE    Leave received OOB data I           int      Boolean Γöé
  9772. Γöé                in-line                                              Γöé
  9773. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9774. ΓöéSO_RCVBUF       Receive buffer size     I, L, N     int      Value   Γöé
  9775. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9776. ΓöéSO_RCVLOWAT     Receive low watermark   I, L        int      Value   Γöé
  9777. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9778. ΓöéSO_RCVTIMEO     Receive timeout         I, L        struct   Value   Γöé
  9779. Γöé                                                    timeval          Γöé
  9780. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9781. ΓöéSO_REUSEADDR    Allow local address     I, N        int      Boolean Γöé
  9782. Γöé                reuse                                                Γöé
  9783. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9784. ΓöéSO_REUSEPORT    Allow local address and I           int      Boolean Γöé
  9785. Γöé                port reuse                                           Γöé
  9786. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9787. ΓöéSO_SNDBUF       Send buffer size        I, L, N     int      Value   Γöé
  9788. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9789. ΓöéSO_SNDLOWAT     Send low watermark      I, L        int      Value   Γöé
  9790. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9791. ΓöéSO_SNDTIMEO     Send timeout            I, L        struct   Value   Γöé
  9792. Γöé                                                    timeval          Γöé
  9793. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9794. ΓöéSO_USELOOPBACK  Bypass hardware when    I           int      Value   Γöé
  9795. Γöé                possible                                             Γöé
  9796. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9797.  
  9798. Table Note  (*) This column specifies the communication domains to which this 
  9799.             option applies: I for internet, L for Local IPC, and N for NetBIOS. 
  9800.  
  9801. The following options are recognized for SOL_SOCKET: 
  9802.  
  9803. Option                 Description
  9804.  
  9805. SO_BROADCAST           (Datagram sockets only.) Enables broadcasting of 
  9806.                        messages. When this option is enabled, the application 
  9807.                        can send broadcast messages over s, if the interface 
  9808.                        specified in the destination supports broadcasting of 
  9809.                        packets. 
  9810.  
  9811. SO_DEBUG               Enables recording of debug information for a socket. 
  9812.                        This options is a prerequisite for tracing TCP debug 
  9813.                        information through the inetdbg utility. For more 
  9814.                        information enter inetcfg -?. 
  9815.  
  9816. SO_DONTROUTE           Enables the socket to bypass the routing of outgoing 
  9817.                        messages. When this option is enabled, it causes 
  9818.                        outgoing messages to bypass the standard routing 
  9819.                        algorithm and be directed to the appropriate network 
  9820.                        interface according to the network portion of the 
  9821.                        destination address. When this option is enabled, 
  9822.                        packets can be sent only to directly connected networks 
  9823.                        (networks for which this host has an interface). 
  9824.  
  9825. SO_KEEPALIVE           (Stream sockets only.) Enables the socket to send 
  9826.                        keepalive packets that will keep the connection alive. 
  9827.                        TCP uses a timer called the keepalive timer. This timer 
  9828.                        is used to monitor idle connections that might have been 
  9829.                        disconnected because of a peer crash or timeout. When 
  9830.                        this option is enabled, a keepalive packet is 
  9831.                        periodically sent to the peer. This is mainly used to 
  9832.                        allow servers to close connections that are no longer 
  9833.                        active as a result of clients going away without 
  9834.                        properly closing connections. 
  9835.  
  9836. SO_LINGER              (Stream sockets only.) Enables the socket to linger on 
  9837.                        close if data is present. When this option is enabled 
  9838.                        and there is unsent data present when soclose() is 
  9839.                        called, the calling application is blocked during the 
  9840.                        soclose() call until the data is transmitted or the 
  9841.                        connection has timed out. When this option is disabled, 
  9842.                        the soclose() call returns without blocking the caller, 
  9843.                        and TCP waits to try to send the data. Although the data 
  9844.                        transfer is usually successful, it cannot be guaranteed 
  9845.                        because TCP waits only a finite amount of time to send 
  9846.                        the data. 
  9847.  
  9848.                        The optval parameter points to a linger structure, 
  9849.                        defined in <SYS\SOCKET.H>: 
  9850.  
  9851.                                                    Field          Description
  9852.                        l_onoff             Option on/off 
  9853.                        l_linger            Linger time 
  9854.  
  9855.                        The l_onoff field is set to zero if the SO_LINGER option 
  9856.                        is being disabled. A nonzero value enables the option. 
  9857.  
  9858.                        The l_linger field specifies the amount of time in 
  9859.                        seconds to linger on close. A value of zero will cause 
  9860.                        soclose() to wait until the disconnect completes. 
  9861.  
  9862. SO_L_BROADCAST         Sets limited broadcast sent on all interfaces. 
  9863.  
  9864. SO_OOBINLINE           (Stream sockets only.) Enables the socket to receive 
  9865.                        out-of-band data. Out-of-band data is a logically 
  9866.                        separate data path using the same connection as the 
  9867.                        normal data path. 
  9868.  
  9869.                        When this option is enabled, it causes out-of-band data 
  9870.                        to be placed in the normal data input queue as it is 
  9871.                        received, making it available to recv(), and recvfrom(), 
  9872.                        without having to specify the MSG_OOB flag in those 
  9873.                        calls. When this option is disabled, it causes 
  9874.                        out-of-band data to be placed in the priority data input 
  9875.                        queue as it is received, making it available to recv() 
  9876.                        and recvfrom() only by specifying the MSG_OOB flag in 
  9877.                        those calls. 
  9878.  
  9879. SO_RCVBUF              Sets buffer size for input. This option sets the size of 
  9880.                        the receive buffer to the value contained in the buffer 
  9881.                        pointed to by optval. This allows the buffer size to be 
  9882.                        tailored for specific application needs, such as 
  9883.                        increasing the buffer size for high-volume connections. 
  9884.  
  9885.                        Use inetcfg -g tcprwinsize to see the default and 
  9886.                        maximum receive socket buffer sizes for stream (TCP) 
  9887.                        sockets or raw sockets. Use inetcfg -g udprwinsize to 
  9888.                        see the default and maximum receive socket buffer sizes 
  9889.                        for UDP sockets. 
  9890.  
  9891. SO_RCVLOWAT            Sets the receive low watemark. 
  9892.  
  9893. SO_RCVTIMEO            Sets the receive timeout. The optval parameter is a 
  9894.                        pointer to a timeval structure, which is defined in 
  9895.                        <SYS\TIME.H>. See Example of recvmsg() Call for an 
  9896.                        example of setting the socket timeout option. 
  9897.  
  9898. SO_REUSEADDR           (Stream and datagram sockets only.) Enables a socket to 
  9899.                        reuse a local address. When this option is enabled, 
  9900.                        local addresses that are already in use can be bound. 
  9901.                        This alters the normal algorithm used in the bind() 
  9902.                        call. The system checks at connect time to be sure that 
  9903.                        no local address and port have the same foreign address 
  9904.                        and port. The error SOCEADDRINUSE is returned if the 
  9905.                        association already exists. 
  9906.  
  9907.                        Multicast applications must set this socket option if 
  9908.                        they want to join the same Class D IP address and port 
  9909.                        for sending and receiving multicast packets. 
  9910.  
  9911. SO_REUSEPORT           Specifies that the rules used in validating addresses 
  9912.                        supplied by a  bind subroutine should allow reuse of a 
  9913.                        local port/address combination.  Each binding of the 
  9914.                        port/address combination must specify the SO_REUSEPORT 
  9915.                        socket option 
  9916.  
  9917. SO_SNDBUF              Sets the send buffer size. This option sets the size of 
  9918.                        the send buffer to the value contained in the buffer 
  9919.                        pointed to by optval.  This allows the send buffer size 
  9920.                        to be tailored for specific application needs, such as 
  9921.                        increasing the buffer size for high-volume connections. 
  9922.  
  9923.                        Use inetcfg -g tcpswinsize to see the default and 
  9924.                        maximum send socket buffer sizes for stream (TCP) 
  9925.                        sockets or raw sockets. Use inetcfg -g udpswinsize to 
  9926.                        see the default and maximum send socket buffer sizes for 
  9927.                        UDP sockets. 
  9928.  
  9929. SO_SNDLOWAT            Sets the send low watermark. 
  9930.  
  9931. SO_SNDTIMEO            Sets the send timeout. The optval parameter is a pointer 
  9932.                        to a timeval structure, which is defined in 
  9933.                        <SYS\TIME.H>. See Example of recvmsg() Call for an 
  9934.                        example of setting the socket timeout option. 
  9935.  
  9936. SO_USELOOPBACK         Bypasses hardware when possible. 
  9937.  
  9938. Supported setsockopt() Socket Options for IPPROTO_IP 
  9939.  
  9940. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9941. ΓöéOption Name         Description              Data Type     Boolean Γöé
  9942. Γöé                                                           or ValueΓöé
  9943. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9944. ΓöéIP_ADD_MEMBERSHIP   Join a multicast group   struct        Value   Γöé
  9945. Γöé                                             ip_mreq               Γöé
  9946. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9947. ΓöéIP_DROP_MEMBERSHIP  Leave a multicast group  struct        Value   Γöé
  9948. Γöé                                             ip_mreq               Γöé
  9949. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9950. ΓöéIP_HDRINCL          Header is included with  int           Boolean Γöé
  9951. Γöé                    data                                           Γöé
  9952. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9953. ΓöéIP_MULTICAST_IF     Default interface for    struct        Value   Γöé
  9954. Γöé                    outgoing multicasts      in_addr               Γöé
  9955. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9956. ΓöéIP_MULTICAST_LOOP   Loopback of outgoing     uchar         Boolean Γöé
  9957. Γöé                    multicast                                      Γöé
  9958. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9959. ΓöéIP_MULTICAST_TTL    Default TTL for outgoing uchar         Value   Γöé
  9960. Γöé                    multicast                                      Γöé
  9961. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9962. ΓöéIP_OPTIONS          IP options               char *        Value   Γöé
  9963. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9964. ΓöéIP_RECVDSTADDR      Queueing IP destination  int           Boolean Γöé
  9965. Γöé                    address                                        Γöé
  9966. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9967. ΓöéIP_RECVTRRI         Queueing token ring      int           Boolean Γöé
  9968. Γöé                    routing information                            Γöé
  9969. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9970. ΓöéIP_RETOPTS          IP options to be         char *        Value   Γöé
  9971. Γöé                    included in outgoing                           Γöé
  9972. Γöé                    datagrams                                      Γöé
  9973. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9974. ΓöéIP_TOS              IP type of service for   int           Value   Γöé
  9975. Γöé                    outgoing datagrams                             Γöé
  9976. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9977. ΓöéIP_TTL              IP time to live for      int           Value   Γöé
  9978. Γöé                    outgoing datagrams                             Γöé
  9979. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9980.  
  9981. The following options are recognized for IPPROTO_IP: 
  9982.  
  9983. Option                   Description
  9984.  
  9985. IP_ADD_MEMBERSHIP        Used to join a multicast group.  There can be 20 
  9986.                          groups per socket, and the maximum number of groups 
  9987.                          for the entire OS/2 TCP/IP system is 320. A multicast 
  9988.                          packet is delivered to a socket if it has joined the 
  9989.                          same group on the same interface on which the packet 
  9990.                          arrived.  More than one socket can bind() on a 
  9991.                          multicast (Class D IP) address and a common port, such 
  9992.                          as when two clients want to receive the same multicast 
  9993.                          packet.  These sockets must set the SO_REUSEADDR 
  9994.                          socket option. 
  9995.  
  9996. IP_DROP_MEMBERSHIP       Used to leave a multicast group. 
  9997.  
  9998. IP_HDRINCL               (Raw sockets only.) When set, the IP header is 
  9999.                          included with the data received on the socket. 
  10000.  
  10001. IP_MULTICAST_IF          Sets the default interface for outgoing multicasts. 
  10002.  
  10003. IP_MULTICAST_LOOP        This option is used for sending multicast packets. It 
  10004.                          enables or disables loopback of outgoing multicast 
  10005.                          packets and is enabled by default.  If loopback is 
  10006.                          disabled, outgoing multicast packets will not loopback 
  10007.                          in this system; this means that other applications 
  10008.                          running in this system will not receive outgoing 
  10009.                          multicast packets even if they have joined the same 
  10010.                          multicast group. 
  10011.  
  10012. IP_MULTICAST_TTL         Sets the default TTL for outgoing multicast packets. 
  10013.  
  10014. IP_OPTIONS               Sets IP options.  Same as IP_RETOPTS. See Example of 
  10015.                          IP_RETOPTS Socket Call for how to use IP_RETOPS. 
  10016.  
  10017. IP_RECVDSTADDR           (UDP only) Sets the queueing IP destination address. 
  10018.                          See Example of recvmsg() Call for the way to get this 
  10019.                          information through recvmsg() call. 
  10020.  
  10021. IP_RECVTRRI              (UDP packets on token ring only.) Sets queueing token 
  10022.                          ring routing information. See Example of recvmsg() 
  10023.                          Call for the way to get this information through 
  10024.                          recvmsg() call. 
  10025.  
  10026. IP_RETOPTS               Sets the IP options to be included in outgoing 
  10027.                          datagrams. See Example of IP_RETOPTS Socket Call for 
  10028.                          how to use IP_RETOPS. 
  10029.  
  10030. IP_TOS                   Sets the IP type of service for outgoing datagrams. 
  10031.  
  10032. IP_TTL                   Sets the IP time to live value for outgoing datagrams. 
  10033.  
  10034. Supported setsockopt() Socket Options for IPPROTO_TCP 
  10035.  
  10036. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10037. ΓöéOption Name       Description               Data Type     Boolean  Γöé
  10038. Γöé                                                          or Value Γöé
  10039. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10040. ΓöéTCP_CC            Connection count flag     int           Boolean  Γöé
  10041. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10042. ΓöéTCP_MAXSEG        Maximum segment size      int           Value    Γöé
  10043. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10044. ΓöéTCP_MSL           TCP MSL value             int           Value    Γöé
  10045. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10046. ΓöéTCP_NODELAY       Do not delay sending to   int           Boolean  Γöé
  10047. Γöé                  coalesce packets                                 Γöé
  10048. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10049. ΓöéTCP_TIMESTMP      TCP timestamp flag        int           Boolean  Γöé
  10050. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10051. ΓöéTCP_WINSCALE      Window scale flag         int           Boolean  Γöé
  10052. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10053.  
  10054. The following options are recognized for IPPROTO_TCP: 
  10055.  
  10056. Option                 Description
  10057.  
  10058. TCP_CC                 (T/TCP only.) Enables or disables the connection count 
  10059.                        function status flag (RFC 1644). 
  10060.  
  10061. TCP_MAXSEG             Sets the maximum segment size. 
  10062.  
  10063. TCP_MSL                Sets the TCP Maximum Segment Lifetime (MSL) value. 
  10064.  
  10065. TCP_NODELAY            (Stream sockets only.) Setting on disables the buffering 
  10066.                        algorithm so that the client's TCP sends small packets 
  10067.                        as soon as possible.  This often has no performance 
  10068.                        effects on LANs, but can degrade performance on WANs. 
  10069.  
  10070. TCP_TIMESTMP           (T/TCP only.) Enables or disables the timestamp function 
  10071.                        status flag (RFC 1323). For more information about high 
  10072.                        performance, see TCP Extensions for High Performance 
  10073.                        (RFC 1323). 
  10074.  
  10075. TCP_WINSCALE           (T/TCP only.) Enables or disables the window scale 
  10076.                        function status flag (RFC 1323). For more information 
  10077.                        about high performance, see TCP Extensions for High 
  10078.                        Performance (RFC 1323). 
  10079.  
  10080. Supported setsockopt() Socket Options for NBPROTO_NB 
  10081.  
  10082. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10083. ΓöéOption Name       Description               Data Type     Boolean  Γöé
  10084. Γöé                                                          or Value Γöé
  10085. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10086. ΓöéNB_DGRAM_TYPE     Type of datagrams to      int           Value    Γöé
  10087. Γöé                  receive                                          Γöé
  10088. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10089.  
  10090. The following option is recognized for NBPROTO_NB: 
  10091.  
  10092. Option                 Description
  10093.  
  10094. NB_DGRAM_TYPE          (Datagram sockets only.) Sets type of datagrams to be 
  10095.                        received on the socket.  The possible values are: 
  10096.  
  10097.                        NB_DGRAM               The socket is to receive normal 
  10098.                                               (unicast) datagrams only. 
  10099.  
  10100.                        NB_BROADCAST           The socket is to receive 
  10101.                                               broadcast datagrams only. 
  10102.  
  10103.                        NB_DGRAM_ANY           The socket can receive both 
  10104.                                               normal or broadcast datagrams. 
  10105.  
  10106.                        This option can be changed at any time. 
  10107.  
  10108. Return Values 
  10109.  
  10110. The value 0 indicates success; the value -1 indicates an error. You can get the 
  10111. specific error code by calling sock_errno() or psock_errno(). 
  10112.  
  10113. sock_errno() Value       Description
  10114.  
  10115. SOCEADDRINUSE            The address is already in use. 
  10116.  
  10117. SOCENOTSOCK              The s parameter is not a valid socket descriptor. 
  10118.  
  10119. SOCEFAULT                Using optval and optlen parameters would result in an 
  10120.                          attempt to access memory outside the caller's address 
  10121.                          space. 
  10122.  
  10123. SOCENOPROTOOPT           The optname parameter is unrecognized. 
  10124.  
  10125. SOCEINVAL                Invalid argument. 
  10126.  
  10127. SOCENOBUFS               No buffer space is available. 
  10128.  
  10129. Examples 
  10130.  
  10131. The following are examples of the setsockopt() call. See getsockopt() for 
  10132. examples of how the options are queried. 
  10133.  
  10134. int rc;
  10135. int s;
  10136. int optval;
  10137. struct linger lstruct;
  10138. /* extracted from sys/socket.h */
  10139. int setsockopt(int s, int level, int optname, char *optval, int optlen);
  10140. ...
  10141. /* I want out of band data in the normal input queue */
  10142. optval = 1;
  10143. rc = setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *) &optval, sizeof(int));
  10144. ...
  10145. /* I want to linger on close */
  10146. lstruct.l_onoff  = 1;
  10147. lstruct.l_linger = 100;
  10148. rc = setsockopt(s, SOL_SOCKET, SO_LINGER, (char *) &lstruct, sizeof(lstruct));
  10149.  
  10150. Related Calls 
  10151.  
  10152.      bind() 
  10153.      endprotoent() 
  10154.      getprotobyname() 
  10155.      getprotobynumber() 
  10156.      getprotoent() 
  10157.      getsockopt() 
  10158.      ioctl() 
  10159.      setprotoent() 
  10160.      sock_errno() 
  10161.      socket() 
  10162.  
  10163.  
  10164. ΓòÉΓòÉΓòÉ 13.25. shutdown() ΓòÉΓòÉΓòÉ
  10165.  
  10166. The socket call shuts down all or part of a full-duplex connection. 
  10167.  
  10168. Syntax 
  10169.  
  10170. #include <sys\socket.h>
  10171. int shutdown(s, howto)
  10172. int s;
  10173. int howto;
  10174.  
  10175. Parameters 
  10176.  
  10177.   Socket descriptor. 
  10178.  
  10179. howto 
  10180.   Condition of the shutdown. 
  10181.  
  10182. Description 
  10183.  
  10184. This call shuts down all or part of a full-duplex connection. Since data flows 
  10185. in one direction are independent of data flows in the other direction, the 
  10186. shutdown call allows you to independently stop data flow in either direction or 
  10187. all data flows with one API call. For example, you may want to stop the 
  10188. sender(s) from sending data to you, but you still want to send data. 
  10189.  
  10190. Using the shutdown() call is optional. 
  10191.  
  10192. The howto parameter sets the condition for shutting down the connection to 
  10193. socket s. It can be set to one of the following: 
  10194.  
  10195.     0 - no more data can be received on socket s. 
  10196.     1 - no more output to be allowed on the socket s. 
  10197.     2 - no more data can be sent or received on socket s. 
  10198.  
  10199. Note:  In the NetBIOS domain, the shutdown() call has no effect.  When called, 
  10200.        shutdown() will return a successful return code, but no shutdown occurs. 
  10201.  
  10202. Return Values 
  10203.  
  10204. The value 0 indicates success; the value -1 indicates an error. You can get the 
  10205. specific error code by calling sock_errno() or psock_errno(). 
  10206.  
  10207. Error Code         Description
  10208. SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  10209. SOCEINVAL          The howto parameter was not set to one of the valid values. 
  10210.  
  10211. Related Calls 
  10212.  
  10213.      accept() 
  10214.      connect() 
  10215.      getsockopt() 
  10216.      readv() 
  10217.      recv() 
  10218.      recvfrom() 
  10219.      recvmsg() 
  10220.      select() 
  10221.      send() 
  10222.      sendto() 
  10223.      setsockopt() 
  10224.      sock_errno() 
  10225.      soclose() 
  10226.      socket() 
  10227.      writev() 
  10228.  
  10229.  
  10230. ΓòÉΓòÉΓòÉ 13.26. so_cancel() ΓòÉΓòÉΓòÉ
  10231.  
  10232. The socket call cancels a pending blocking sockets API call on a socket. 
  10233.  
  10234. Syntax 
  10235.  
  10236. #include <types.h>
  10237. #include <sys\socket.h>
  10238. int so_cancel (s)
  10239. int s;
  10240.  
  10241. Parameters 
  10242.  
  10243.   Socket descriptor. 
  10244.  
  10245. Description 
  10246.  
  10247. The so_cancel() call is used in multithreaded applications where one thread 
  10248. needs to 'wake up' another thread which is blocked in a sockets API call. 
  10249.  
  10250. The thread that has been 'awakened' will return a value of -1 from the sockets 
  10251. API call, and the error will be set to SOCEINTR.  If multiple threads are 
  10252. blocked on the same socket and so_cancel() is issued for that socket, only one 
  10253. of the threads will be 'awakened.' 
  10254.  
  10255. When a socket is in blocking mode, if no threads are blocking on the socket 
  10256. when so_cancel() is issued, the next sockets API call to be issued on that 
  10257. socket will return SOCEINTR.  When a socket is in nonblocking mode and no 
  10258. threads are blocking on the socket when so_cancel() is issued, the next call to 
  10259. select() that includes the socket will return SOCEINTR. 
  10260.  
  10261. Return Values 
  10262.  
  10263. The value 0 indicates success; the value -1 indicates an error. You can get the 
  10264. specific error code by calling sock_errno() or psock_errno(). 
  10265.  
  10266. Error Code         Description
  10267. SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  10268.  
  10269.  
  10270. ΓòÉΓòÉΓòÉ 13.27. sock_errno() ΓòÉΓòÉΓòÉ
  10271.  
  10272. The socket call returns error code set by a socket call. 
  10273.  
  10274. Syntax 
  10275.  
  10276. #include <sys/socket.h>
  10277. int sock_errno()
  10278.  
  10279. Description 
  10280.  
  10281. The sock_errno() call returns the last error code set by a socket call in the 
  10282. current thread. Subsequent socket API calls do not reset this error code. 
  10283.  
  10284. Related Calls 
  10285.  
  10286.      ioctl() 
  10287.      os2_ioctl() 
  10288.      psock_errno() 
  10289.  
  10290.  
  10291. ΓòÉΓòÉΓòÉ 13.28. socket() ΓòÉΓòÉΓòÉ
  10292.  
  10293. The socket call creates an endpoint for communication and returns a socket 
  10294. descriptor representing the endpoint. 
  10295.  
  10296. Syntax 
  10297.  
  10298. #include <types.h>
  10299. #include <sys\socket.h>
  10300. int socket(domain, type, protocol)
  10301. int domain;
  10302. int type;
  10303. int protocol;
  10304.  
  10305. Parameters 
  10306.  
  10307. domain 
  10308.   Communication domain requested. 
  10309.  
  10310. type 
  10311.   Type of socket created. 
  10312.  
  10313. protocol 
  10314.   Protocol requested. 
  10315.  
  10316. Description 
  10317.  
  10318. This call creates an endpoint for communication and returns a socket descriptor 
  10319. representing the endpoint. Each socket type provides a different communication 
  10320. service. 
  10321.  
  10322. Sockets are deallocated with the soclose() call. 
  10323.  
  10324. The domain parameter specifies a communications domain where communication is 
  10325. to take place. This parameter specifies the protocol family which is used. 
  10326.  
  10327. Protocol Family          Description
  10328.  
  10329. PF_OS2 or PF_UNIX        Use addresses in the Local IPC format which take the 
  10330.                          form of OS/2 Warp file and path names. 
  10331.  
  10332. PF_INET                  Use addresses in the internet address format. 
  10333.  
  10334. PF_NETBIOS or PF_NB      Use addresses in the NetBIOS address format. 
  10335.  
  10336. PF_ROUTE                 A routing socket can be created with PF_ROUTE as the 
  10337.                          domain name and SOCK_RAW as the type. A process can 
  10338.                          use a routing socket to send and receive routing 
  10339.                          messages. 
  10340.  
  10341. The type parameter specifies the type of socket created.  These socket type 
  10342. constants are defined in the <SYS\SOCKET.H> header file. See Socket Types for 
  10343. additional details. The types supported are: 
  10344.  
  10345. Type                Description
  10346.  
  10347. SOCK_STREAM         Provides sequenced, two-way byte streams that are reliable 
  10348.                     and connection-oriented. It supports a mechanism for 
  10349.                     out-of-band data. 
  10350.  
  10351.                     Stream sockets are supported by the internet (PF_INET) 
  10352.                     communication domain and local IPC (PF_OS2, PF_UNIX, or 
  10353.                     PF_LOCAL). 
  10354.  
  10355. SOCK_DGRAM          Provides datagrams, which are connectionless messages of a 
  10356.                     fixed length whose reliability is not guaranteed. Datagrams 
  10357.                     can be received out of order, lost, or delivered multiple 
  10358.                     times. 
  10359.  
  10360.                     Datagram sockets are supported by the internet (PF_INET), 
  10361.                     local IPC (PF_OS2, PF_UNIX, or PF_LOCAL), and NetBIOS 
  10362.                     (PF_NETBIOS or PF_NB) communication domains. 
  10363.  
  10364. SOCK_RAW            Provides the interface to internal protocols (such as IP 
  10365.                     and ICMP).  Raw sockets are supported by the internet 
  10366.                     (PF_INET) communication domain. 
  10367.  
  10368. SOCK_SEQPACKET      Provides sequenced byte streams that are reliable and 
  10369.                     connection-oriented.  Data is sent without error or 
  10370.                     duplication and is received in the same order as it was 
  10371.                     sent. Sequenced packet sockets are supported by the NetBIOS 
  10372.                     (PF_NETBIOS or PF_NB) communication domain. 
  10373.  
  10374. The protocol parameter specifies a particular protocol to be used with the 
  10375. socket. If the protocol field is set to 0 (default), the system selects the 
  10376. default protocol number for the domain and socket type requested. Default and 
  10377. valid protocol number-protocol family combinations are in the section Socket 
  10378. Protocol Families. The getprotobyname() call can be used to get the protocol 
  10379. number for a protocol with a well-known name. 
  10380.  
  10381. Return Values 
  10382.  
  10383. A non-negative socket descriptor return value indicates success. The return 
  10384. value -1 indicates an error. You can get the specific error code by calling 
  10385. sock_errno() or psock_errno(). 
  10386.  
  10387. sock_errno() Value              Description
  10388.  
  10389. SOCEMFILE                       The maximum number of sockets are currently in 
  10390.                                 use. 
  10391.  
  10392. SOCEPROTONOSUPPORT              The protocol is not supported in the specified 
  10393.                                 domain or the protocol is not supported for the 
  10394.                                 specified socket type. 
  10395.  
  10396. SOCEPFNOSUPPORT                 The protocol family is not supported. 
  10397.  
  10398. SOCESOCKTNOSUPPORT              The socket type is not supported. 
  10399.  
  10400. Examples 
  10401.  
  10402. Following are examples of the socket() call. 
  10403.  
  10404. int s;
  10405. struct protoent *p;
  10406. struct protoent *getprotobyname(char *name);
  10407. int socket(int domain, int type, int protocol); /* extracted from sys/socket.h */
  10408. ...
  10409. /* Get stream socket in internet domain with default protocol */
  10410. s = socket(PF_INET, SOCK_STREAM, 0);
  10411. ...
  10412. /* Get raw socket in internet domain for ICMP protocol */
  10413. p = getprotobyname("icmp");
  10414. s = socket(PF_INET, SOCK_RAW, p->p_proto);
  10415.  
  10416. Related Calls 
  10417.  
  10418.      accept() 
  10419.      accept_and_recv() 
  10420.      bind() 
  10421.      connect() 
  10422.      getsockname() 
  10423.      getsockopt() 
  10424.      ioctl() 
  10425.      listen() 
  10426.      os2_ioctl() 
  10427.      os2_select() 
  10428.      readv() 
  10429.      recv() 
  10430.      recvfrom() 
  10431.      recvmsg() 
  10432.      select() 
  10433.      send() 
  10434.      sendmsg() 
  10435.      sendto() 
  10436.      setsockopt() 
  10437.      shutdown() 
  10438.      sock_errno() 
  10439.      soclose() 
  10440.      writev() 
  10441.  
  10442.  
  10443. ΓòÉΓòÉΓòÉ 13.29. soclose() ΓòÉΓòÉΓòÉ
  10444.  
  10445. The socket call shuts down a socket and frees resources allocated to the 
  10446. socket. 
  10447.  
  10448. Syntax 
  10449.  
  10450. #include <types.h>
  10451. #include <unistd.h>
  10452. int soclose(s)
  10453. int s;
  10454.  
  10455. Parameters 
  10456.  
  10457.   Socket descriptor. 
  10458.  
  10459. Description 
  10460.  
  10461. This call shuts down the socket associated with the socket descriptor s, and 
  10462. frees resources allocated to the socket.  If s refers to a connected socket, 
  10463. the connection is closed. 
  10464.  
  10465. If the SO_LINGER socket option is enabled (see setsockopt() for additional 
  10466. information), then the task will try to send any queued data. If the SO_LINGER 
  10467. socket option is disabled, then the task will flush any data queued to be sent. 
  10468.  
  10469. Return Values 
  10470.  
  10471. The value 0 indicates success; the value -1 indicates an error. You can get the 
  10472. specific error code by calling sock_errno() or psock_errno(). 
  10473.  
  10474. Error Code         Description
  10475. SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  10476. SOCEALREADY        The socket s is marked nonblocking, and a previous 
  10477.                    connection attempt has not completed. 
  10478.  
  10479. Related Calls 
  10480.  
  10481.      accept() 
  10482.      getsockopt() 
  10483.      setsockopt() 
  10484.      sock_errno() 
  10485.      socket() 
  10486.  
  10487.  
  10488. ΓòÉΓòÉΓòÉ 13.30. sysctl() ΓòÉΓòÉΓòÉ
  10489.  
  10490. The sysctl() call performs special operations on the TCP/IP stack. Unlike 
  10491. getsockopt() or setsockopt(), sysctl() accesses and modifies systemwide 
  10492. parameter values for the entire TCP/IP stack. 
  10493.  
  10494. Syntax 
  10495.  
  10496. #include <types.h>
  10497. #include <netinet\in.h>
  10498. #include <netinet\ip_var.h>
  10499. #include <sys\socket.h>
  10500. #include <sys\sysctl.h>
  10501. int sysctl(mib, namelen, oldp, oldenp, newp, newlen)
  10502. int *mib;
  10503. u_int namelen;
  10504. void *oldp;
  10505. size_t newlen;
  10506. size_t *oldlenp;
  10507. void   *newp;
  10508.  
  10509. Parameters 
  10510.  
  10511. mib 
  10512.   Array of integers consisting of command, protocol, and control functions. 
  10513.  
  10514. namelen 
  10515.   Length of mib array. 
  10516.  
  10517. oldp 
  10518.   Data pointer or xxx_ctl structure pointer pointing to data to be sent. 
  10519.  
  10520. oldenp 
  10521.   Pointer to length of oldp. 
  10522.  
  10523. newp 
  10524.   Data pointer or xxx_ctl structure pointer pointing to location where data is 
  10525.   to be received. 
  10526.  
  10527. newlen 
  10528.   Length of newp. 
  10529.  
  10530. Description 
  10531.  
  10532. The sysctl() call is functionally similar to the ioctl() call but does not need 
  10533. a socket to carry the options to and from the stack. 
  10534.  
  10535. The sysctl() function retrieves stack parameters and allows them to be set. The 
  10536. information available from sysctl() consists of integers, strings, and tables. 
  10537. Unless explicitly noted below, sysctl() returns a consistent snapshot of the 
  10538. data requested. Consistency is achieved by locking the destination buffer into 
  10539. memory so that the data may be copied without blocking. 
  10540.  
  10541. Calls to sysctl() are serialized to avoid deadlock. The state is described 
  10542. using a Management Information Base (MIB) style name, listed below, which is a 
  10543. namelen length array of integers. The information is copied into the buffer 
  10544. specified by oldp. The size of the buffer is given by the location specified by 
  10545. oldlenp before the call, and that location gives the amount of data copied 
  10546. after a successful call. If the amount of data available is greater than the 
  10547. size of the buffer supplied, the call supplies as much data as fits in the 
  10548. buffer provided and returns with the error code SOCENOMEM. 
  10549.  
  10550. If the old value is not desired, oldp and oldlenp should be set to NULL. The 
  10551. size of the available data can be determined by calling sysctl() with a NULL 
  10552. parameter for oldp. 
  10553.  
  10554. The size of the available data will be returned in the location pointed to by 
  10555. oldenp. For some operations, the amount of space may change often. For these 
  10556. operations, the system attempts to round up so that the returned size is large 
  10557. enough for a call to return the data shortly thereafter. 
  10558.  
  10559. To set a new value, newp is set to point to a buffer of length newlen from 
  10560. which the requested value is to be taken. If a new value is not to be set, newp 
  10561. should be set to NULL and newlen set to 0. 
  10562.  
  10563. An Inetcfg sysctl needs a fifth mib argument, mib[4], to specify the actual 
  10564. inet configuration command. 
  10565.  
  10566. All route sysctl() calls use another additional argument to be carried in 
  10567. mib[5] for rt_flags.   The old newp may be pointing to a single integer or char 
  10568. buffer. Also, there are two special control structures (inetver_ctl and 
  10569. intecfg_ctl) used as oldp/newp structures. Similarly, for statistics the 
  10570. xxxstat structures should be used. 
  10571.  
  10572. An application uses the OS2_MEMMAPIO sysctl() call to request the TCP/IP stack 
  10573. to provide kernel memory for performing High Performance Send (HPS). One such 
  10574. call can return up to 60K (as 15 4K buffers) of memory. The calling application 
  10575. provides an array named oldp of up to 15 pointers (to char). On return from 
  10576. this call, these pointers point to the 4K buffers. The memory acquired in this 
  10577. way is now owned by the application, and it resides in the address space of 
  10578. this application. As a result, the application is now responsible for the 
  10579. management of this memory from a reusability point of view. Applications can 
  10580. use either semaphores or the OS2_QUERY_MEMMAPIO sysctl() call for this purpose. 
  10581. Typically, before calling the next high performance send (which may use one of 
  10582. these buffers), the application needs to verify that the buffers are free to be 
  10583. reused. Sysctl() supports a maximum of 64 such calls. Thus, the kernel can 
  10584. provide up to 64 times 60K of high speed send memory to an application. An 
  10585. ENOMEM error code is returned to any sysctl() call beyond this limit. A sample 
  10586. of usage of this call for supporting HPS is contained in High Performance Send. 
  10587.  
  10588. An application uses the OS2_QUERY_MEMMAPIO sysctl() call to verify the 
  10589. reusability of the buffers provided by the kernel through the OS2_MEMMAPIO 
  10590. sysctl() call. This call sends the oldp array of pointers which were filled in 
  10591. by the kernel during the OS2_MEMMAPIO sysctl() call. oldenp is used to pass the 
  10592. number of 4K buffers referred to in the oldp array. If a particular pointer in 
  10593. the oldp array is left unchanged on return from this call, that buffer has been 
  10594. freed for reuse. Conversely, if a particular pointer in this array is returned 
  10595. as NULL, this buffer is not yet freed and may not be reused. It is the 
  10596. responsibility of the application to make these checks. Alternatively, an 
  10597. application may use semaphores to manage the reusability of these buffers. The 
  10598. oldp array can be passed with any number of HPS buffers in a single call and 
  10599. this number of buffers (oldenp) need not be an integer multiple of 15. The HPS 
  10600. buffers in oldp need not be arranged in the same order in which they were 
  10601. obtained. Applications should save a copy of the obtained HPS buffer pointers 
  10602. before calling OS2_QUERY_MEMMAPIO, so that the pointers are not lost if the 
  10603. buffers are not available. 
  10604.  
  10605. Values 
  10606.  
  10607. The values that are supported for different categories of mib values are listed 
  10608. in the following tables. 
  10609.  
  10610. The generic mib array has the following structure 
  10611.  
  10612. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10613. Γöémib Index        Description                                      Γöé
  10614. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10615. Γöé0                Top Level identifier                             Γöé
  10616. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10617. Γöé1                Protocol Family                                  Γöé
  10618. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10619. Γöé2                Protocol                                         Γöé
  10620. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10621. Γöé3                Address Family or Control Command                Γöé
  10622. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10623. Γöé4                Control Command                                  Γöé
  10624. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10625. Γöé5                Flags, etc.                                      Γöé
  10626. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10627.  
  10628. The mib[0] Top Level values are: 
  10629.  
  10630. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10631. ΓöéValue                            Description                     Γöé
  10632. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10633. ΓöéCTL_KERN                         Sockets (kernel) domain.        Γöé
  10634. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10635. ΓöéCTL_NET                          Routing domain.                 Γöé
  10636. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10637. ΓöéCTL_OS2                          Local Interprocess CommunicationΓöé
  10638. Γöé                                 (afos2) domain.                 Γöé
  10639. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10640.  
  10641. The mib[1] Protocol Family values are: 
  10642.  
  10643. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10644. ΓöéValue                            Description                     Γöé
  10645. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10646. ΓöéPF_INET                          Internet protocol family.       Γöé
  10647. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10648. ΓöéPF_OS2                           LIPC (afos2) protocol family.   Γöé
  10649. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10650. ΓöéPF_ROUTE                         Route protocol family.          Γöé
  10651. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10652. ΓöéKERN_HOSTID                                                      Γöé
  10653. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10654.  
  10655. The mib[2] Protocols values are: 
  10656.  
  10657. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10658. ΓöéValue                            Description                     Γöé
  10659. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10660. ΓöéIPPROTO_IP                       Internet Protocol.              Γöé
  10661. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10662. ΓöéIPPROTO_TCP                      Transmission Control Protocol.  Γöé
  10663. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10664. ΓöéIPPROTO_UDP                      User Datagram Protocol.         Γöé
  10665. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10666.  
  10667. The mib[3] Control Command values for inetcfg are: 
  10668.  
  10669. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10670. ΓöéValue                            Description                     Γöé
  10671. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10672. ΓöéIPCTL_INETCFG                    IP inet configuration.          Γöé
  10673. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10674. ΓöéTCPCTL_INETCFG                   TCP inet configuration.         Γöé
  10675. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10676. ΓöéUDPCTL_INETCFG                   UDP inet configuration.         Γöé
  10677. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10678. ΓöéLIPCCTL_INETCFG                  LIPC inet configuration.        Γöé
  10679. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10680.  
  10681. The following table is an overview of the sysctl() calls structure, with links 
  10682. to the descriptions of the mib values. The table is the calling tree to get to 
  10683. individual leaves, which are the supported mib values. You read the table by 
  10684. looking on the right-hand side for the leaf for the value you are seeking, then 
  10685. taking the link to the table that defines that value and describes the function 
  10686. of the value. For example, the first leaf, KERNCTL_INETVER, will get you to the 
  10687. table for mib[0]=CTL_KERN, mib[1]=KERN_HOSTID, and mib[2]=IPPROTO_IP. 
  10688.  
  10689.        mib numbers
  10690. [0] [1] [2] [3] [4] [5]
  10691. CTL_KERN
  10692. ....KERN_HOSTID
  10693. ........IPPROTO_IP
  10694. ............KERNCTL_INETVER on page mibs for INET Version (sockets.sys).
  10695. CTL_OS2
  10696. ....PF_OS2
  10697. ........IPPROTO_IP
  10698. ............LIPCCTL_INETVER on page mibs for INET Version (afos2.sys).
  10699. ............LIPCCTL_INETCFG
  10700. ................LIPCCTL_DG_RECVSPACE on page mibs for afos2 inetconfig.
  10701. ................LIPCCTL_DG_SENDSPACE on page mibs for afos2 inetconfig.
  10702. ................LIPCCTL_ST_RECVSPACE on page mibs for afos2 inetconfig.
  10703. ................LIPCCTL_ST_SENDSPACE on page mibs for afos2 inetconfig.
  10704. ....PF_INET
  10705. ........IPPROTO_IP
  10706. ............OS2_MEMMAPIO on page mibs for High Performance Memory.
  10707. ............OS2_QUERY_MEMMAPIO on page mibs for High Performance Memory.
  10708. CTL_NET
  10709. ....PF_INET
  10710. ........IPPROTO_TCP
  10711. ............TCPCTL_INETCFG
  10712. ................TCPCTL_CC on page mibs for TCPCTL inetconfig.
  10713. ................TCPCTL_KEEPCNT on page mibs for TCPCTL inetconfig.
  10714. ................TCPCTL_LINGERTIME on page mibs for TCPCTL inetconfig.
  10715. ................TCPCTL_MSL on page mibs for TCPCTL inetconfig.
  10716. ................TCPCTL_MTU on page mibs for TCPCTL inetconfig.
  10717. ................TCPCTL_REALSLOW on page mibs for TCPCTL inetconfig.
  10718. ................TCPCTL_TCPRWIN on page mibs for TCPCTL inetconfig.
  10719. ................TCPCTL_TCPSWIN on page mibs for TCPCTL inetconfig.
  10720. ................TCPCTL_TIMESTMP on page mibs for TCPCTL inetconfig.
  10721. ................TCPCTL_TTL on page mibs for TCPCTL inetconfig.
  10722. ................TCPCTL_WINSCALE on page mibs for TCPCTL inetconfig.
  10723. ............TCPCTL_MSSDFLT on page mibs for TCPCTL.
  10724. ............TCPCTL_RTTDFLT on page mibs for TCPCTL.
  10725. ............TCPCTL_STATS on page mibs for TCPCTL.
  10726. ........IPPROTO_UDP
  10727. ............UDPCTL_INETCFG
  10728. ................UDPCTL_TTL on page mibs for UDPCTL inetconfig.
  10729. ................UDPCTL_UDPRWIN on page mibs for UDPCTL inetconfig.
  10730. ................UDPCTL_UDPSWIN on page mibs for UDPCTL inetconfig.
  10731. ............UDPCTL_CHECKSUM on page mibs for UDPCTL.
  10732. ............UDPCTL_STATS on page mibs for UDPCTL.
  10733. ........IPPROTO_IP
  10734. ............IPCTL_INETVER on page mibs for IPCTL.
  10735. ............IPCTL_FORWARDING on page mibs for IPCTL.
  10736. ............IPCTL_SENDREDIRECTS on page mibs for IPCTL.
  10737. ............IPCTL_INETCFG
  10738. ................FRAGCTL_TTL on page mibs for IPCTL inetconfig.
  10739. ................ICMPCTL_TTL on page mibs for IPCTL inetconfig.
  10740. ................IPCTL_ARPTKILLC on page mibs for IPCTL inetconfig.
  10741. ................IPCTL_ARPTKILLI on page mibs for IPCTL inetconfig.
  10742. ................IPCTL_FIREWALL on page mibs for IPCTL inetconfig.
  10743. ................IPCTL_FORWARD on page mibs for IPCTL inetconfig.
  10744. ................IPCTL_MULTIDEFROUTES on page mibs for IPCTL inetconfig.
  10745. ................IPCTL_SYNATTACK on page mibs for IPCTL inetconfig.
  10746. ........IPPROTO_ICMP
  10747. ............ICMPCTL_ECHOREPL on page mibs for ICMPCTL.
  10748. ............ICMPCTL_MASKREPL on page mibs for ICMPCTL.
  10749. ............ICMPCTL_STATS on page mibs for ICMPCTL.
  10750. ....PF_ROUTE
  10751. ........0 (wildcard)
  10752. ............0 (wildcard)
  10753. ................NET_RT_DUMP on page mibs for ROUTE.
  10754. ....................NET_RT_LLINFO on page mibs for ROUTE with Flags.
  10755. ................NET_RT_FLAGS on page mibs for ROUTE.
  10756. ................NET_RT_IFLIST on page mibs for ROUTE.
  10757. [0] [1] [2] [3] [4] [5]
  10758.        mib numbers
  10759.  
  10760. Return Values 
  10761.  
  10762. The requested values are returned in the newp parameter. The sysctl() call 
  10763. itself returns the number of bytes copied, if the call is successful. 
  10764. Otherwise, -1 is returned and the errno value is set appropriately. 
  10765.  
  10766. Error Code               Description
  10767. SOCENOPROTOOPT           The protocol specified in mib[1] is not valid. 
  10768. SOCENOTDIR               The length specified in namelen is not valid. 
  10769. SOCEOPNOTSUPP            The option specified in mib[3] is not supported. 
  10770. SOCEINVAL                Insufficient mib parameters were supplied. 
  10771. SOCENOMEM                Memory allocation failed. This error value is returned 
  10772.                          by High Performance Send (HPS) sysctl (OS2_MEMMAPIO). 
  10773. SOCEPERM                 This parameter cannot be set, it can only be 
  10774.                          retrieved. Therefore, newp must be set to NULL. 
  10775.  
  10776. Related Calls 
  10777.  
  10778.      ioctl() 
  10779.      os2_ioctl() 
  10780.  
  10781.  
  10782. ΓòÉΓòÉΓòÉ 13.30.1. mibs for INET Version (sockets.sys) ΓòÉΓòÉΓòÉ
  10783.  
  10784. This table shows the mib[3] values supported for 
  10785.  
  10786. mib[0]=CTL_KERN
  10787. mib[1]=KERN_HOSTID
  10788. mib[2]=0
  10789.  
  10790. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10791. Γöémib[3] Values       Data Type     Description                     Γöé
  10792. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10793. ΓöéKERNCTL_INETVER     struct        Get (no set) the SOCKETS.SYS    Γöé
  10794. Γöé                    inetver_ctl   version number.                 Γöé
  10795. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10796.  
  10797.  
  10798. ΓòÉΓòÉΓòÉ 13.30.2. mibs for INET Version (afos2.sys) ΓòÉΓòÉΓòÉ
  10799.  
  10800. This table shows the mib[3] values supported for 
  10801.  
  10802. mib[0]=CTL_OS2
  10803. mib[1]=PF_OS2
  10804. mib[2]=0
  10805.  
  10806. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10807. Γöémib[3] Values       Data Type     Description                     Γöé
  10808. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10809. ΓöéLIPCCTL_INETVER     struct        Get (no set) the AFOS2.SYS      Γöé
  10810. Γöé                    inetvers_ctl  (LIPC) version number.          Γöé
  10811. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10812.  
  10813.  
  10814. ΓòÉΓòÉΓòÉ 13.30.3. mibs for afos2 inetconfig ΓòÉΓòÉΓòÉ
  10815.  
  10816. This table shows the mib[4] values supported for 
  10817.  
  10818. mib[0]=CTL_OS2
  10819. mib[1]=PF_OS2
  10820. mib[2]=0
  10821. mib[3]=LIPCCTL_INETCFG
  10822.  
  10823. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10824. Γöémib[4] Values           Data Type    Description                  Γöé
  10825. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10826. ΓöéLIPCCTL_DG_RECVSPACE    int          Get or set the datagram      Γöé
  10827. Γöé                                     recieve space.               Γöé
  10828. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10829. ΓöéLIPCCTL_DG_SENDSPACE    int          Get or set the datagram send Γöé
  10830. Γöé                                     space.                       Γöé
  10831. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10832. ΓöéLIPCCTL_ST_RECVSPACE    int          Get or set the stream receiveΓöé
  10833. Γöé                                     space.                       Γöé
  10834. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10835. ΓöéLIPCCTL_ST_SENDSPACE    int          Get or set the stream send   Γöé
  10836. Γöé                                     space.                       Γöé
  10837. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10838.  
  10839.  
  10840. ΓòÉΓòÉΓòÉ 13.30.4. mibs for High Performance Memory ΓòÉΓòÉΓòÉ
  10841.  
  10842. This table shows the mib[3] values supported for 
  10843.  
  10844. mib[0]=CTL_OS2
  10845. mib[1]=PF_INET
  10846. mib[2]=0
  10847.  
  10848. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10849. Γöémib[3] Values       Data Type     Description                     Γöé
  10850. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10851. ΓöéOS2_MEMMAPIO        long *        Get (no set) high performance   Γöé
  10852. Γöé                                  memory.                         Γöé
  10853. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10854. ΓöéOS2_QUERY_MEMMAPIO  long *        Get (no set) high performance   Γöé
  10855. Γöé                                  memory reusability status.      Γöé
  10856. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10857.  
  10858.  
  10859. ΓòÉΓòÉΓòÉ 13.30.5. mibs for TCPCTL inetconfig ΓòÉΓòÉΓòÉ
  10860.  
  10861. This table shows the mib[4] values supported for 
  10862.  
  10863. mib[0]=CTL_NET
  10864. mib[1]=PF_INET
  10865. mib[2]=IPPROTO_TCP
  10866. mib[3]=TCPCTL_INETCFG
  10867.  
  10868. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10869. Γöémib[4] Values       Data Type     Description                     Γöé
  10870. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10871. ΓöéTCPCTL_CC           int           Get or set the CC, CCnew and    Γöé
  10872. Γöé                                  echo flag on or off.            Γöé
  10873. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10874. ΓöéTCPCTL_KEEPCNT      int           Get or set the number of        Γöé
  10875. Γöé                                  keepalive probes.               Γöé
  10876. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10877. ΓöéTCPCTL_LINGERTIME   int           Get or set the linger on close  Γöé
  10878. Γöé                                  time.                           Γöé
  10879. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10880. ΓöéTCPCTL_MSL          int           Get or set the TCP maximum      Γöé
  10881. Γöé                                  segment lifetime value.         Γöé
  10882. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10883. ΓöéTCPCTL_MTU          int           Get or set the path maximum     Γöé
  10884. Γöé                                  transmission unit (MTU)         Γöé
  10885. Γöé                                  discovery flag on or off.       Γöé
  10886. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10887. ΓöéTCPCTL_REALSLOW     int           Get or set the real slow timer  Γöé
  10888. Γöé                                  value for the time wait queue.  Γöé
  10889. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10890. ΓöéTCPCTL_TCPRWIN      int           Get or set the TCP receive      Γöé
  10891. Γöé                                  window size.                    Γöé
  10892. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10893. ΓöéTCPCTL_TCPSWIN      int           Get or set the TCP send window  Γöé
  10894. Γöé                                  size.                           Γöé
  10895. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10896. ΓöéTCPCTL_TIMESTMP     int           Get or set the TCP timestamp    Γöé
  10897. Γöé                                  flag on or off.                 Γöé
  10898. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10899. ΓöéTCPCTL_TTL          int           Get or set the time to live     Γöé
  10900. Γöé                                  (TTL) for TCP packets.          Γöé
  10901. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10902. ΓöéTCPCTL_WINSCALE     int           Get or set the window scale (fatΓöé
  10903. Γöé                                  pipe) flag on or off.           Γöé
  10904. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10905.  
  10906.  
  10907. ΓòÉΓòÉΓòÉ 13.30.6. mibs for TCPCTL ΓòÉΓòÉΓòÉ
  10908.  
  10909. This table shows the mib[3] values supported for 
  10910.  
  10911. mib[0]=CTL_NET
  10912. mib[1]=PF_INET
  10913. mib[2]=IPPROTO_TCP
  10914.  
  10915. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10916. Γöémib[3] Values         Data Type   Description                     Γöé
  10917. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10918. ΓöéTCPCTL_MSSDFLT        int         Get or set the TCP maximum      Γöé
  10919. Γöé                                  segment size (MSS) default.     Γöé
  10920. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10921. ΓöéTCPCTL_RTTDFLT        int         Get or set the round trip time  Γöé
  10922. Γöé                                  (RTT) default.                  Γöé
  10923. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10924. ΓöéTCPCTL_STATS          struct      Get (no set) the TCP statistics.Γöé
  10925. Γöé                      tcpstat                                     Γöé
  10926. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10927.  
  10928.  
  10929. ΓòÉΓòÉΓòÉ 13.30.7. mibs for UDPCTL inetconfig ΓòÉΓòÉΓòÉ
  10930.  
  10931. This table shows the mib[4] values supported for 
  10932.  
  10933. mib[0]=CTL_NET
  10934. mib[1]=PF_INET
  10935. mib[2]=IPPROTO_UDP
  10936. mib[3]=UDPCTL_INETCFG
  10937.  
  10938. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10939. Γöémib[4] Values       Data Type     Description                     Γöé
  10940. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10941. ΓöéUDPCTL_TTL          int           Get or set the time to live     Γöé
  10942. Γöé                                  (TTL) for UDP packets.          Γöé
  10943. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10944. ΓöéUDPCTL_UDPRWIN      int           Get or set the UDP receive      Γöé
  10945. Γöé                                  window size.                    Γöé
  10946. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10947. ΓöéUDPCTL_UDPSWIN      int           Get or set the UDP send window  Γöé
  10948. Γöé                                  size.                           Γöé
  10949. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10950.  
  10951.  
  10952. ΓòÉΓòÉΓòÉ 13.30.8. mibs for UDPCTL ΓòÉΓòÉΓòÉ
  10953.  
  10954. This table shows the mib[3] values supported for 
  10955.  
  10956. mib[0]=CTL_NET
  10957. mib[1]=PF_INET
  10958. mib[2]=IPPROTO_UDP
  10959.  
  10960. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10961. Γöémib[3] Values         Data Type   Description                     Γöé
  10962. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10963. ΓöéUDPCTL_CHECKSUM       int         Get or set the UDP checksum     Γöé
  10964. Γöé                                  computing on or off.            Γöé
  10965. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10966. ΓöéUDPCTL_STATS          struct      Get (no set) the UDP statistics.Γöé
  10967. Γöé                      udpstat                                     Γöé
  10968. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10969.  
  10970.  
  10971. ΓòÉΓòÉΓòÉ 13.30.9. mibs for IPCTL ΓòÉΓòÉΓòÉ
  10972.  
  10973. This table shows the mib[3] values supported for 
  10974.  
  10975. mib[0]=CTL_NET
  10976. mib[1]=PF_INET
  10977. mib[2]=IPPROTO_IP
  10978.  
  10979. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10980. Γöémib[3] Values       Data Type     Description                     Γöé
  10981. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10982. ΓöéIPCTL_INETVER       struct        Get (no set) the AFINET.SYS     Γöé
  10983. Γöé                    inetvers_ctl  version number.                 Γöé
  10984. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10985. ΓöéIPCTL_FORWARDING    int           Get or set  the IP forwarding   Γöé
  10986. Γöé                                  flag on or off.                 Γöé
  10987. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10988. ΓöéIPCTL_SENDREDIRECTS int           Get set the Send Redirects flag Γöé
  10989. Γöé                                  on or off.                      Γöé
  10990. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10991.  
  10992.  
  10993. ΓòÉΓòÉΓòÉ 13.30.10. mibs for IPCTL inetconfig ΓòÉΓòÉΓòÉ
  10994.  
  10995. This table shows the mib[4] values supported for 
  10996.  
  10997. mib[0]=CTL_NET
  10998. mib[1]=PF_INET
  10999. mib[2]=IPPROTO_IP
  11000. mib[3]=IPCTL_INETCFG
  11001.  
  11002. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11003. Γöémib[4] Values         Data Type   Description                     Γöé
  11004. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11005. ΓöéFRAGCTL_TTL           int         Get or set the fragment time to Γöé
  11006. Γöé                                  live (TTL).                     Γöé
  11007. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11008. ΓöéICMPCTL_TTL           int         Get or set the ICMP packet time Γöé
  11009. Γöé                                  to live (TTL).                  Γöé
  11010. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11011. ΓöéIPCTL_ARPTKILLC       int         Get or set the ARP cache        Γöé
  11012. Γöé                                  completed entry timeout.        Γöé
  11013. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11014. ΓöéIPCTL_ARPTKILLI       int         Get or set the ARP cache        Γöé
  11015. Γöé                                  incompleted entry timeout.      Γöé
  11016. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11017. ΓöéIPCTL_FIREWALL        int         Get or set the IP firewall flag Γöé
  11018. Γöé                                  on or off.                      Γöé
  11019. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11020. ΓöéIPCTL_FORWARD         int         Get or set the IP forwarding    Γöé
  11021. Γöé                                  flag on or off.                 Γöé
  11022. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11023. ΓöéIPCTL_MULTIDEFROUTES  int         Get or set the multiple default Γöé
  11024. Γöé                                  routes function on or off.      Γöé
  11025. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11026. ΓöéIPCTL_SYNATTACK       int         Get or set the SYN attack flag  Γöé
  11027. Γöé                                  on or off.                      Γöé
  11028. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11029.  
  11030.  
  11031. ΓòÉΓòÉΓòÉ 13.30.11. mibs for ICMPCTL ΓòÉΓòÉΓòÉ
  11032.  
  11033. This table shows the mib[3] values supported for 
  11034.  
  11035. mib[0]=CTL_NET
  11036. mib[1]=PF_INET
  11037. mib[2]=IPPROTO_ICMP
  11038.  
  11039. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11040. Γöémib[3] Values         Data Type   Description                     Γöé
  11041. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11042. ΓöéICMPCTL_ECHOREPL      int         Get or set the ICMP echo flag onΓöé
  11043. Γöé                                  or off.                         Γöé
  11044. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11045. ΓöéICMPCTL_MASKREPL      int         Get or set the flag to check if Γöé
  11046. Γöé                                  the system should respond to    Γöé
  11047. Γöé                                  ICMP address mask requests on orΓöé
  11048. Γöé                                  off.                            Γöé
  11049. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11050. ΓöéICMPCTL_STATS         struct      Get (no set) the ICMP           Γöé
  11051. Γöé                      icmpstat    statistics.                     Γöé
  11052. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11053.  
  11054.  
  11055. ΓòÉΓòÉΓòÉ 13.30.12. mibs for ROUTE ΓòÉΓòÉΓòÉ
  11056.  
  11057. This table shows the mib[4] values supported for 
  11058.  
  11059. mib[0]=CTL_NET
  11060. mib[1]=PF_ROUTE
  11061. mib[2]=0
  11062. mib[3]=any valid address family or 0
  11063.  
  11064. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11065. Γöémib[4] Values         Data Type   Description                     Γöé
  11066. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11067. ΓöéNET_RT_DUMP           char *      Dump the routing table entries  Γöé
  11068. Γöé                                  corresponding to the address    Γöé
  11069. Γöé                                  family specified in mib[5]. If  Γöé
  11070. Γöé                                  the address family is zero, thenΓöé
  11071. Γöé                                  all routing tables are returned.Γöé
  11072. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11073. ΓöéNET_RT_FLAGS          char *      Dump the routing table entries  Γöé
  11074. Γöé                                  corresponding to the routing    Γöé
  11075. Γöé                                  flag RTF_xxx specified in       Γöé
  11076. Γöé                                  mib[5].                         Γöé
  11077. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11078. ΓöéNET_RT_IFLIST         char *      Return information for all      Γöé
  11079. Γöé                                  configured interfaces if mib[5] Γöé
  11080. Γöé                                  is zero. A nonzero mib[5] value Γöé
  11081. Γöé                                  specifies the index for a       Γöé
  11082. Γöé                                  particular interface, and       Γöé
  11083. Γöé                                  interface information for only  Γöé
  11084. Γöé                                  that interface is returned.     Γöé
  11085. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11086.  
  11087.  
  11088. ΓòÉΓòÉΓòÉ 13.30.13. mibs for ROUTE with Flags ΓòÉΓòÉΓòÉ
  11089.  
  11090. This table shows the mib[5] values supported for 
  11091.  
  11092. mib[0]=CTL_NET
  11093. mib[1]=PF_ROUTE
  11094. mib[2]=0
  11095. mib[3]=any valid address family of 0
  11096. mib[4]=NET_RT_DUMP
  11097.  
  11098. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11099. Γöémib[5] Values         Data Type   Description                     Γöé
  11100. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11101. ΓöéNET_RT_LLINFO         int         Dump the routing table          Γöé
  11102. Γöé                                  corresponding to the address    Γöé
  11103. Γöé                                  family specified in mib[3]. If  Γöé
  11104. Γöé                                  the address family is zero,     Γöé
  11105. Γöé                                  return all route tables. It     Γöé
  11106. Γöé                                  carries the RFT_xxx flags or    Γöé
  11107. Γöé                                  interface index.                Γöé
  11108. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11109.  
  11110.  
  11111. ΓòÉΓòÉΓòÉ 13.30.14. Examples ΓòÉΓòÉΓòÉ
  11112.  
  11113. The following examples illustrate the sysctl() call. 
  11114.  
  11115. This example uses the sysctl() call to get the protocol driver version. 
  11116.  
  11117. # include  < stdio . h >
  11118. # include  < types . h >
  11119. # include  < netinet \ in . h >
  11120. # include  < sys \ socket . h >
  11121. # include  < netinet \ ip _ var . h >
  11122. # include  < sys \ sysctl . h >
  11123.  
  11124. int  main ( void )
  11125. {
  11126.         int  mib [ 4 ] , i ;
  11127.         unsigned  int   oldenp = 0 ,  newlen = 0 ;
  11128.         struct  inetvers _ ctl   uap _ old ,  * uap _ new ;
  11129.  
  11130.         mib [ 0 ] =  CTL _ KERN ;         / *  cmd              * /
  11131.         mib [ 1 ] =  KERN _ HOSTID ;      / *  Protocol  Family . * /
  11132.         mib [ 2 ] =  IPPROTO _ IP ;       / *  Protocol         * /
  11133.         mib [ 3 ] =  KERNCTL _ INETVER ;  / *  Control  command  for  sysctl  * /
  11134.  
  11135.  
  11136.         uap _ new  =  NULL ;
  11137.         oldenp   =  sizeof ( struct  inetvers _ ctl ) ;
  11138.  
  11139.         if  ( sysctl ( mib , 4 , ( void  * ) & uap _ old , & oldenp , ( void  * ) uap _ new , newlen )  >  0 )
  11140.            printf  ( "    SOCKETS . SYS :  % s \ n " , uap _ old . versionstr ) ;
  11141.  
  11142. }
  11143.  
  11144. The next example shows an inetcfg sysctl() call that uses a fifth mib argument 
  11145. to specify the actual inet config command. This example sets then gets the 
  11146. value. 
  11147.  
  11148. # include  < stdio . h >
  11149. # include  < types . h >
  11150. # include  < sys / socket . h >
  11151. # include  < netinet / in . h >
  11152. # include  < netinet / tcp _ var . h >
  11153. # include  < sys / sysctl . h >
  11154. void   main ( void )
  11155. {
  11156.         int  mib [ 5 ] ;
  11157.         unsigned  int   oldenp = 0 ,  newlen ;
  11158.         struct  inetcfg _ ctl  uap _ old ,  uap _ new ;
  11159.  
  11160.         mib [ 0 ] =  CTL _ NET ;          / *  Top  level  idetifier  * /
  11161.         mib [ 1 ] =  PF _ INET ;          / *  Protocol  Family  * /
  11162.         mib [ 2 ] =  IPPROTO _ TCP ;      / *  Protocol  * /
  11163.         mib [ 3 ] =  TCPCTL _ INETCFG ;   / *  Control  command  for  tcp _ sysctl  * /
  11164.         mib [ 4 ] =  TCPCTL _ KEEPCNT ;   / *  Particular  Inetcfg  cmd  for  sysctl _ inetcfg  * /
  11165.  
  11166.         / *  Set  the  Value  in  stack  * /
  11167.         uap _ new . var _ cur _ val  =  4 ;   / *  Send  4  Keepalive  probes ,  rather  than  8  * /
  11168.         newlen   =  sizeof ( struct  inetcfg _ ctl ) ;
  11169.         if  ( sysctl ( mib , 5 , ( void  * ) NULL ,  & oldenp ,  ( void  * ) & uap _ new ,  newlen )  <  0 )
  11170.             printf ( " sysctl  failed  for  requested  parameter \ n " ) ;
  11171.  
  11172.         / *  Get  the  Value  from  stack  * /
  11173.         oldenp   =  sizeof ( struct  inetcfg _ ctl ) ;
  11174.         if  ( sysctl ( mib , 5 , ( void  * ) & uap _ old ,  & oldenp ,  ( void  * ) NULL ,  0 )  <  0 )
  11175.             printf ( " sysctl  failed  for  requested  parameter \ n " ) ;
  11176.         else
  11177.             printf ( " Current  stack  parameter  value  is  % d \ n " , uap _ old . var _ cur _ val ) ;
  11178. }
  11179.  
  11180. This example illustrates a sysctl() call that uses the route mib. 
  11181.  
  11182. # include  < stdio . h >
  11183. # include  < string . h >
  11184. # include  < types . h >
  11185. # include  < netinet \ in . h >
  11186. # include  < sys \ socket . h >
  11187. # include  < netinet \ ip _ var . h >
  11188. # include  < sys \ sysctl . h >
  11189. # include  < net \ route . h >
  11190. # include  < net \ if . h >
  11191.  
  11192. void  main ( void )
  11193. {
  11194.         size _ t    needed ;
  11195.         int       mib [ 6 ] ;
  11196.         char      * buf ,  * next ,  * lim ;
  11197.         struct    rt _ msghdr  * rtm ;
  11198.  
  11199.         mib [ 0 ]  =  CTL _ NET ;
  11200.         mib [ 1 ]  =  PF _ ROUTE ;
  11201.         mib [ 2 ]  =  0 ;             / *  Wildcard  Protocol  * /
  11202.         mib [ 3 ]  =  0 ;             / *  Wildcard  Address  Family  * /
  11203.         mib [ 4 ]  =  NET _ RT _ IFLIST ;
  11204.         mib [ 5 ]  =  0 ;             / *  All  interfaces  * /
  11205.  
  11206.         if  ( sysctl ( mib ,  6 ,  NULL ,  & needed ,  NULL ,  0 )  <  0 )
  11207.                  psock _ errno ( " route - sysctl - estimate " ) ;
  11208.  
  11209.         if  ( needed  = =  0 )  {
  11210.             printf ( " no  routes  defined \ n " ) ;
  11211.             return  0 ;
  11212.         }
  11213.  
  11214.         buf  =  malloc ( needed ) ;
  11215.         if  ( sysctl ( mib ,  6 ,  buf ,  & needed ,  NULL ,  0 )  <  0 )
  11216.                 psock _ errno ( " sysctl  if  table " ) ;
  11217.         lim   =  buf  +  needed ;
  11218.         for  ( next  =  buf ;  next  <  lim ;  next  + =  rtm - > rtm _ msglen )  {
  11219.            rtm  =  ( struct  rt _ msghdr  * ) next ;
  11220.            switch ( rtm - > rtm _ type ) {
  11221.               case  RTM _ IFINFO :
  11222.                 {  struct  if _ msghdr  * ifm  =  ( struct  if _ msghdr  * )  rtm ;
  11223.                   printf ( " if #   % d  , flags  0x % x \ n " , ifm - > ifm _ index , ifm - > ifm _ flags ) ;
  11224.                 }
  11225.                   break ;
  11226.               case  RTM _ NEWADDR :
  11227.                   / *  Add  code  for  this  and  for  RTM _ DELADDR  etc . . . . . * /
  11228.                   break ;
  11229.            }  / *  switch  * /
  11230.         }  / *  for  * /
  11231. }
  11232.  
  11233.  
  11234. ΓòÉΓòÉΓòÉ 13.31. writev() ΓòÉΓòÉΓòÉ
  11235.  
  11236. The socket call writes data from a set of specified buffers on a socket. 
  11237.  
  11238. Syntax 
  11239.  
  11240. #include <types.h>
  11241. #include <sys/uio.h>
  11242. int writev(s, iov, iovcnt)
  11243. int s;
  11244. struc iovec *iov;
  11245. int iovcnt;
  11246.  
  11247. Parameters 
  11248.  
  11249.   Socket descriptor. 
  11250.  
  11251. iov 
  11252.   Pointer to an array of iovec structures. 
  11253.  
  11254. iovcnt 
  11255.   Number of iovec structures pointed to by the iov parameter. The maximum value 
  11256.   is 1024. 
  11257.  
  11258. Description 
  11259.  
  11260. This call writes data on a socket with descriptor s. The data is gathered from 
  11261. the buffers specified by iov[0]...iov[iovcnt-1]. The iovec structure is defined 
  11262. in <SYS/UIO.H> and contains the following fields: 
  11263.  
  11264. Field          Description
  11265. iov_base       Pointer to the buffer 
  11266. iov_len        Length of the buffer 
  11267.  
  11268. This call writes iov_len bytes of data. If there is not enough available buffer 
  11269. space to hold the socket data to be transmitted and the socket is in blocking 
  11270. mode, writev() blocks the caller until additional buffer space becomes 
  11271. available. If the socket is in a nonblocking mode, writev() returns -1 and sets 
  11272. return code to SOCEWOULDBLOCK. See ioctl() for a description of how to set 
  11273. nonblocking mode. 
  11274.  
  11275. TCP/IP alters iov_base and iov_len for each element in the input struct iovec 
  11276. array. iov_base will point to the next character of the processed (sent or 
  11277. received) data on the original buffer, and iov_len will become (input value - 
  11278. processed length). Thus if only partial data has been sent or received and the 
  11279. application expects more data to send or receive, it can pass the same iovec 
  11280. back in a subsequent call. 
  11281.  
  11282. For datagram sockets, this call sends the entire datagram, provided the 
  11283. datagram fits into the protocol buffers.  Stream sockets act like streams of 
  11284. information with no boundaries separating data.  For example, if an application 
  11285. sends 1000 bytes, each call to this function can send 1 byte, 10 bytes, or the 
  11286. entire 1000 bytes. For a stream socket, an application can place this call in a 
  11287. loop, calling this function until all data has been sent. 
  11288.  
  11289. Return Values 
  11290.  
  11291. When successful, the number of bytes of data written is returned. Successful 
  11292. completion does not guarantee the data is written. The return value -1 
  11293. indicates an error was detected on the sending side of the connection. You can 
  11294. get the specific error code by calling sock_errno() or psock_errno(). 
  11295.  
  11296. sock_errno() Value       Description
  11297.  
  11298. SOCENOTSOCK              s is not a valid socket descriptor. 
  11299.  
  11300. SOCEFAULT                Using the iov and iovcnt parameters would result in an 
  11301.                          attempt to access memory outside the caller's address 
  11302.                          space. 
  11303.  
  11304. SOCEINTR                 Interrupted system call. 
  11305.  
  11306. SOCEINVAL                Invalid argument. 
  11307.  
  11308. SOCENOBUFS               Buffer space is not available to send the message. 
  11309.  
  11310. SOCEWOULDBLOCK           The s parameter is in nonblocking mode and the data 
  11311.                          cannot be written without blocking, or the SO_SNDTIMEO 
  11312.                          option has been set for socket s and the timeout 
  11313.                          expired before any data was sent. 
  11314.  
  11315. SOCEMSGSIZE              The message was too big to be sent as a single 
  11316.                          datagram. 
  11317.  
  11318. SOCEDESTADDRREQ          A destination address is required. 
  11319.  
  11320. Related Calls 
  11321.  
  11322.      connect() 
  11323.      getsockopt() 
  11324.      ioctl() 
  11325.      readv() 
  11326.      recv() 
  11327.      recvfrom() 
  11328.      recvmsg() 
  11329.      select() 
  11330.      send() 
  11331.      sendmsg() 
  11332.      sendto() 
  11333.      setsockopt() 
  11334.      sock_errno() 
  11335.      socket() 
  11336.  
  11337.  
  11338. ΓòÉΓòÉΓòÉ 14. TCP/IP Network Utility Routines API ΓòÉΓòÉΓòÉ
  11339.  
  11340. The following table briefly describes each sockets utility function call 
  11341. supported by networking services and identifies where you can find the syntax, 
  11342. parameters, and other appropriate information. The network utility calls 
  11343. described in this section can be used to access services only for the internet 
  11344. communication domain. 
  11345.  
  11346. TCP/IP Network Utility Routines Quick Reference 
  11347.  
  11348. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11349. ΓöéSocket Call               Description                             Γöé
  11350. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11351. Γöédn_comp()                 Compresses the expanded domain name     Γöé
  11352. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11353. Γöédn_expand()               Expands a compressed domain name to a   Γöé
  11354. Γöé                          full domain name                        Γöé
  11355. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11356. Γöédn_find()                 Searches for an expanded name from a    Γöé
  11357. Γöé                          list of previously compressed names     Γöé
  11358. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11359. Γöédn_skipname()             Skips over a compressed domain name     Γöé
  11360. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11361. Γöéendhostent()              Closes the ETC\HOSTS file               Γöé
  11362. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11363. Γöéendnetent()               Closes the ETC\NETWORKS file            Γöé
  11364. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11365. Γöéendprotoent()             Closes the ETC\PROTOCOL file, which     Γöé
  11366. Γöé                          contains information about known        Γöé
  11367. Γöé                          protocols                               Γöé
  11368. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11369. Γöéendservent()              Closes the ETC\SERVICES file            Γöé
  11370. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11371. Γöégethostbyaddr()           Returns a pointer to information about aΓöé
  11372. Γöé                          host specified by an Internet address   Γöé
  11373. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11374. Γöégethostbyname()           Returns a pointer to information about aΓöé
  11375. Γöé                          host specified by a host name           Γöé
  11376. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11377. Γöégethostent()              Returns a pointer to the next entry in  Γöé
  11378. Γöé                          the ETC\HOSTS file                      Γöé
  11379. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11380. Γöégethostid()               Returns the unique identifier of the    Γöé
  11381. Γöé                          current host                            Γöé
  11382. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11383. Γöégethostname()             Gets the standard host name for the     Γöé
  11384. Γöé                          local host machine                      Γöé
  11385. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11386. Γöé_getlong()                Retrieves long byte quantities          Γöé
  11387. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11388. Γöégetnetbyaddr()            Returns a pointer to the ETC\NETWORKS   Γöé
  11389. Γöé                          file entry that contains the specified  Γöé
  11390. Γöé                          network address                         Γöé
  11391. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11392. Γöégetnetbyname()            Returns a pointer to the ETC\NETWORKS   Γöé
  11393. Γöé                          file entry that contains the specified  Γöé
  11394. Γöé                          network name                            Γöé
  11395. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11396. Γöégetnetent()               Returns a pointer to the next entry in  Γöé
  11397. Γöé                          the ETC\NETWORKS file                   Γöé
  11398. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11399. Γöégetprotobyname()          Returns a pointer to the ETC\PROTOCOL   Γöé
  11400. Γöé                          file entry specified by a protocol name Γöé
  11401. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11402. Γöégetprotobynumber()        Returns a pointer to the ETC\PROTOCOL   Γöé
  11403. Γöé                          file entry specified by a protocol      Γöé
  11404. Γöé                          number                                  Γöé
  11405. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11406. Γöégetprotoent()             Returns a pointer to the next entry in  Γöé
  11407. Γöé                          the ETC\PROTOCOL file                   Γöé
  11408. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11409. Γöégetservbyname()           Returns a pointer to the ETC\SERVICES   Γöé
  11410. Γöé                          file entry specified by a service name  Γöé
  11411. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11412. Γöégetservbyport()           Returns a pointer to the ETC\SERVICES   Γöé
  11413. Γöé                          file entry specified by a port number   Γöé
  11414. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11415. Γöégetservent()              Returns a pointer to the next entry in  Γöé
  11416. Γöé                          the ETC\SERVICES file                   Γöé
  11417. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11418. Γöé_getshort()               Retrieves short byte quantities         Γöé
  11419. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11420. Γöéh_errno                   Returns the TCP/IP error code           Γöé
  11421. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11422. Γöéhtonl()                   Translates byte order from host to      Γöé
  11423. Γöé                          network for a long integer              Γöé
  11424. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11425. Γöéhtons()                   Translates byte order from host to      Γöé
  11426. Γöé                          network for a short integer             Γöé
  11427. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11428. Γöéinet_addr()               Constructs an internet address from     Γöé
  11429. Γöé                          character strings representing numbers  Γöé
  11430. Γöé                          expressed in standard dotted-decimal    Γöé
  11431. Γöé                          notation                                Γöé
  11432. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11433. Γöéinet_lnaof()              Returns the local network portion of an Γöé
  11434. Γöé                          internet address                        Γöé
  11435. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11436. Γöéinet_makeaddr()           Constructs an internet address from a   Γöé
  11437. Γöé                          network number and a local address      Γöé
  11438. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11439. Γöéinet_netof()              Returns the network portion of the      Γöé
  11440. Γöé                          internet address in network-byte order  Γöé
  11441. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11442. Γöéinet_network()            Constructs a network number from        Γöé
  11443. Γöé                          character strings representing numbers  Γöé
  11444. Γöé                          expressed in standard dotted-decimal    Γöé
  11445. Γöé                          notation                                Γöé
  11446. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11447. Γöéinet_ntoa()               Returns a pointer to a string in        Γöé
  11448. Γöé                          dotted-decimal notation                 Γöé
  11449. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11450. Γöéntohl()                   Translates byte order from network to   Γöé
  11451. Γöé                          host for a long integer                 Γöé
  11452. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11453. Γöéntohs()                   Translates byte order from network to   Γöé
  11454. Γöé                          host for a short integer                Γöé
  11455. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11456. Γöéputlong()                 Places long byte quantities into the    Γöé
  11457. Γöé                          byte stream                             Γöé
  11458. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11459. Γöéputshort()                Places short byte quantities into the   Γöé
  11460. Γöé                          byte stream                             Γöé
  11461. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11462. ΓöéRaccept()                 Accepts a connection request from a     Γöé
  11463. Γöé                          SOCKS server                            Γöé
  11464. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11465. ΓöéRbind()                   Binds a local name to the socket        Γöé
  11466. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11467. ΓöéRconnect()                Requests a connection to a remote host  Γöé
  11468. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11469. Γöéres_init()                Reads the RESOLV file for the default   Γöé
  11470. Γöé                          domain name                             Γöé
  11471. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11472. Γöéres_mkquery()             Makes a query message for the name      Γöé
  11473. Γöé                          servers in the internet domain          Γöé
  11474. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11475. Γöéres_query()               Provides an interface to the server     Γöé
  11476. Γöé                          query mechanism                         Γöé
  11477. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11478. Γöéres_querydomain()         Queries the concatenation of name and   Γöé
  11479. Γöé                          domain                                  Γöé
  11480. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11481. Γöéres_search()              Makes a query and awaits a response     Γöé
  11482. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11483. Γöéres_send()                Sends a query to a local name server    Γöé
  11484. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11485. Γöérexec()                   Allows command processing on a remote   Γöé
  11486. Γöé                          host                                    Γöé
  11487. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11488. ΓöéRgethostbyname()          Returns a pointer to information about aΓöé
  11489. Γöé                          host specified by a host name           Γöé
  11490. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11491. ΓöéRgetsockname()            Gets the socket name from the SOCKS     Γöé
  11492. Γöé                          server                                  Γöé
  11493. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11494. ΓöéRlisten()                 Completes the binding necessary for a   Γöé
  11495. Γöé                          socket to accept connections and createsΓöé
  11496. Γöé                          a connection request queue for incoming Γöé
  11497. Γöé                          requests                                Γöé
  11498. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11499. Γöésethostent()              Opens and rewinds the ETC\HOSTS file    Γöé
  11500. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11501. Γöésetnetent()               Opens and rewinds the ETC\NETWORKS file Γöé
  11502. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11503. Γöésetprotoent()             Opens and rewinds the ETC\PROTOCOL file Γöé
  11504. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11505. Γöésetservent()              Opens and rewinds the ETC\SERVICES file Γöé
  11506. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11507.  
  11508.  
  11509. ΓòÉΓòÉΓòÉ 14.1. dn_comp() ΓòÉΓòÉΓòÉ
  11510.  
  11511. The dn_comp() call compresses the expanded domain name. 
  11512.  
  11513. Syntax 
  11514.  
  11515. #include <types.h>
  11516. #include <netinet\in.h>
  11517. #include <arpa\nameser.h>
  11518. #include <resolv.h>
  11519. int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
  11520. u_char *exp_dn;
  11521. u_char *comp_dn;
  11522. int length;
  11523. u_char **dnptrs;
  11524. u_char **lastdnptr;
  11525.  
  11526. Parameters 
  11527.  
  11528. exp_dn 
  11529.   Pointer to the location of an expanded domain name. 
  11530.  
  11531. comp_dn 
  11532.   Pointer to an array containing the compressed domain name. 
  11533.  
  11534. length 
  11535.   Length of the array in bytes pointed to by the comp_dn parameter. 
  11536.  
  11537. dnptrs 
  11538.   Pointer to a list of pointers to previously compressed names in the current 
  11539.   message. 
  11540.  
  11541. lastdnptr 
  11542.   Pointer to the end of the array pointed to by dnptrs. 
  11543.  
  11544. Description 
  11545.  
  11546. The dn_comp() call compresses a domain name to conserve space. When compressing 
  11547. names, the client process must keep a record of suffixes that have appeared 
  11548. previously. The dn_comp() call compresses a full domain name by comparing 
  11549. suffixes to a list of previously used suffixes and removing the longest 
  11550. possible suffix. 
  11551.  
  11552. The dn_comp() call compresses the domain name pointed to by the exp_dn 
  11553. parameter and stores it in the area pointed to by the comp_dn parameter. The 
  11554. dn_comp() call inserts labels into the message as the name is compressed. The 
  11555. dn_comp() call also maintains a list of pointers to the message labels and 
  11556. updates the list of label pointers. 
  11557.  
  11558.     If the value of the dnptrs parameter is null, the dn_comp() call does not 
  11559.      compress any names. The dn_comp() call translates a domain name from ASCII 
  11560.      to internal format without removing suffixes (compressing). Otherwise, the 
  11561.      dnptrs parameter is the address of pointers to previously compressed 
  11562.      suffixes. 
  11563.  
  11564.     If the lastdnptr parameter is null, the dn_comp() call does not update the 
  11565.      list of label pointers. 
  11566.  
  11567. The dn_comp() call is one of a group of calls that form the resolver. The 
  11568. resolver is a set of functions that perform a translation between domain names 
  11569. and network addresses. Global information used by the resolver calls resides in 
  11570. the _res data structure. The <RESOLV.H> file contains the _res data structure 
  11571. definition. (See The _res Data Structure for more on the _res data structure.) 
  11572.  
  11573. Return Values 
  11574.  
  11575. When successful, the dn_comp() call returns the size of the compressed domain 
  11576. name. When unsuccessful, the call returns a value of -1. 
  11577.  
  11578. Related Calls 
  11579.  
  11580.      dn_expand() 
  11581.      dn_find() 
  11582.      dn_skipname() 
  11583.      _getlong() 
  11584.      _getshort() 
  11585.      putlong() 
  11586.      putshort() 
  11587.      res_init() 
  11588.      res_mkquery() 
  11589.      res_query() 
  11590.      res_search() 
  11591.      res_send() 
  11592.  
  11593.  
  11594. ΓòÉΓòÉΓòÉ 14.2. dn_expand() ΓòÉΓòÉΓòÉ
  11595.  
  11596. The dn_expand() call expands a compressed domain name to a full domain name. 
  11597.  
  11598. Syntax 
  11599.  
  11600. #include <types.h>
  11601. #include <netinet\in.h>
  11602. #include <arpa\nameser.h>
  11603. #include <resolv.h>
  11604. int dn_expand(msg, eomorig, comp_dn, exp_dn, length)
  11605. u_char *msg;
  11606. u_char *eomorig;
  11607. u_char *comp_dn;
  11608. u_char *exp_dn;
  11609. int length;
  11610.  
  11611. Parameters 
  11612.  
  11613. msg 
  11614.   Pointer to the beginning of a message. 
  11615.  
  11616. eomorig 
  11617.   Pointer to the end of the original message that contains the compressed 
  11618.   domain name. 
  11619.  
  11620. comp_dn 
  11621.   Pointer to the compressed domain name. 
  11622.  
  11623. exp_dn 
  11624.   Pointer to a buffer that holds the resulting expanded domain name. 
  11625.  
  11626. length 
  11627.   Length of the buffer in bytes pointed to by the exp_dn parameter. 
  11628.  
  11629. Description 
  11630.  
  11631. The dn_expand() call expands a compressed domain name to a full domain name, 
  11632. converting the expanded names to all uppercase letters. A client process 
  11633. compresses domain names to conserve space. Compression consists of removing the 
  11634. longest possible previously occurring suffixes. The dn_expand() call restores a 
  11635. domain name compressed by the dn_comp() call to its full size. 
  11636.  
  11637. The dn_expand() call is one of a set of calls that form the resolver. The 
  11638. resolver is a group of functions that perform a translation between domain 
  11639. names and network addresses. Global information used by the resolver calls 
  11640. resides in the _res data structure. The <RESOLV.H> file contains the _res data 
  11641. structure definition. (See The _res Data Structure for more on the _res data 
  11642. structure.) 
  11643.  
  11644. Return Values 
  11645.  
  11646. When successful, the dn_expand() call returns the size of the expanded domain 
  11647. name. When unsuccessful, the call returns a value of -1. 
  11648.  
  11649. Related Calls 
  11650.  
  11651.      dn_comp() 
  11652.      dn_find() 
  11653.      dn_skipname() 
  11654.      _getlong() 
  11655.      _getshort() 
  11656.      putlong() 
  11657.      putshort() 
  11658.      res_init() 
  11659.      res_mkquery() 
  11660.      res_query() 
  11661.      res_search() 
  11662.      res_send() 
  11663.  
  11664.  
  11665. ΓòÉΓòÉΓòÉ 14.3. dn_find() ΓòÉΓòÉΓòÉ
  11666.  
  11667. The dn_find() call searches for an expanded name from a list of previously 
  11668. compressed names. 
  11669.  
  11670. Syntax 
  11671.  
  11672. #include <types.h>
  11673. #include <netinet\in.h>
  11674. #include <arpa\nameser.h>
  11675. #include <resolv.h>
  11676. int dn_find(exp_dn, msg, dnptrs, lastdnptr)
  11677. u_char *exp_dn;
  11678. u_char *msg;
  11679. u_char **dnptrs;
  11680. u_char **lastdnptr;
  11681.  
  11682. Parameters 
  11683.  
  11684. exp_dn 
  11685.   Pointer to the expanded name to search for. 
  11686.  
  11687. msg 
  11688.   Pointer to the start of a messag.e 
  11689.  
  11690. dnptrs 
  11691.   Pointer to the location of the first name on the list to search, not the 
  11692.   pointer to the start of the message. 
  11693.  
  11694. lastdnptr 
  11695.   Pointer to the end of the array pointed to by dnptrs. 
  11696.  
  11697. Description 
  11698.  
  11699. The dn_find() call is one of a group of calls that form the resolver. The 
  11700. resolver is a set of functions that perform a translation between domain names 
  11701. and network addresses. Global information used by the resolver calls resides in 
  11702. the _res data structure. The <RESOLV.H> file contains the _res data structure 
  11703. definition. (See The _res Data Structure for more on the _res data structure.) 
  11704.  
  11705. Return Values 
  11706.  
  11707. When successful, the dn_find() call returns the offset from msg. When 
  11708. unsuccessful, the call returns a value of -1. 
  11709.  
  11710. Related Calls 
  11711.  
  11712.      dn_comp() 
  11713.      dn_expand() 
  11714.      dn_skipname() 
  11715.      _getlong() 
  11716.      _getshort() 
  11717.      putlong() 
  11718.      putshort() 
  11719.      res_init() 
  11720.      res_mkquery() 
  11721.      res_query() 
  11722.      res_search() 
  11723.      res_send() 
  11724.  
  11725.  
  11726. ΓòÉΓòÉΓòÉ 14.4. dn_skipname() ΓòÉΓòÉΓòÉ
  11727.  
  11728. The dn_skipname() call skips over the compressed domain name pointed to by the 
  11729. comp_dn parameter. 
  11730.  
  11731. Syntax 
  11732.  
  11733. #include <types.h>
  11734. #include <netinet\in.h>
  11735. #include <arpa\nameser.h>
  11736. #include <resolv.h>
  11737. int dn_skipname(comp_dn, eom)
  11738. u_char *comp_dn;
  11739. u_char *eom;
  11740.  
  11741. Parameters 
  11742.  
  11743. comp_dn 
  11744.   Pointer to the compressed domain name. 
  11745.  
  11746. eom 
  11747.   Pointer to the end of the original message that contains the compressed 
  11748.   domain name. 
  11749.  
  11750. Return Values 
  11751.  
  11752. When successful, the dn_skipname() call returns the size of the compressed 
  11753. name. When unsuccessful, the call returns a value of -1. 
  11754.  
  11755. Related Calls 
  11756.  
  11757.      dn_comp() 
  11758.      dn_expand() 
  11759.      dn_find() 
  11760.      _getlong() 
  11761.      _getshort() 
  11762.      putlong() 
  11763.      putshort() 
  11764.      res_init() 
  11765.      res_mkquery() 
  11766.      res_query() 
  11767.      res_search() 
  11768.      res_send() 
  11769.  
  11770.  
  11771. ΓòÉΓòÉΓòÉ 14.5. endhostent() ΓòÉΓòÉΓòÉ
  11772.  
  11773. The endhostent() call closes the ETC\HOSTS file, which contains information 
  11774. about known hosts. 
  11775.  
  11776. Syntax 
  11777.  
  11778. #include <netdb.h>
  11779. void endhostent()
  11780.  
  11781. Description 
  11782.  
  11783. The endhostent() call closes the ETC\HOSTS file. 
  11784.  
  11785. When using the endhostent() call in DNS/BIND name service resolution, 
  11786. endhostent() closes the TCP connection which the sethostent() call set up. 
  11787.  
  11788. Related Calls 
  11789.  
  11790.      gethostbyaddr() 
  11791.      gethostbyname() 
  11792.      gethostent() 
  11793.      sethostent() 
  11794.  
  11795.  
  11796. ΓòÉΓòÉΓòÉ 14.6. endnetent() ΓòÉΓòÉΓòÉ
  11797.  
  11798. The endnetent() call closes the ETC\NETWORKS file, which contains information 
  11799. about known networks. 
  11800.  
  11801. Note:  Calls made to the getnetent(), getnetbyaddr(), or getnetbyname() call 
  11802.        open the ETC\NETWORKS file. 
  11803.  
  11804. Syntax 
  11805.  
  11806. #include <netdb.h>
  11807. void endnetent()
  11808.  
  11809. Related Calls 
  11810.  
  11811.      getnetbyaddr() 
  11812.      getnetbyname() 
  11813.      getnetent() 
  11814.      setnetent() 
  11815.  
  11816.  
  11817. ΓòÉΓòÉΓòÉ 14.7. endprotoent() ΓòÉΓòÉΓòÉ
  11818.  
  11819. The endprotoent() call closes the ETC\PROTOCOL file, which contains information 
  11820. about known protocols. 
  11821.  
  11822. Note:  Calls made to the getprotoent(), getprotobyname(), or getnetbynumber() 
  11823.        call open the ETC\PROTOCOL file. 
  11824.  
  11825. Syntax 
  11826.  
  11827. #include <netdb.h>
  11828. void endprotoent()
  11829.  
  11830. Related Calls 
  11831.  
  11832.      getprotobyname() 
  11833.      getprotobynumber() 
  11834.      getprotoent() 
  11835.      setprotoent() 
  11836.  
  11837.  
  11838. ΓòÉΓòÉΓòÉ 14.8. endservent() ΓòÉΓòÉΓòÉ
  11839.  
  11840. The endservent() call closes the ETC\SERVICES file, which contains information 
  11841. about known services. 
  11842.  
  11843. Note:  Calls made to the getservent(), getservbyname(), or getservbyport() call 
  11844.        open the ETC\SERVICES file. 
  11845.  
  11846. Syntax 
  11847.  
  11848. #include <netdb.h>
  11849. void endservent()
  11850.  
  11851. Related Calls 
  11852.  
  11853.      endprotoent() 
  11854.      getprotobyname() 
  11855.      getprotobynumber() 
  11856.      getprotoent() 
  11857.      getservbyname() 
  11858.      getservbyport() 
  11859.      getservent() 
  11860.      setprotoent() 
  11861.      setservent() 
  11862.  
  11863.  
  11864. ΓòÉΓòÉΓòÉ 14.9. gethostbyaddr() ΓòÉΓòÉΓòÉ
  11865.  
  11866. The gethostbyaddr() call returns a pointer to information about a host 
  11867. specified by an internet address. 
  11868.  
  11869. Syntax 
  11870.  
  11871. #include <netdb.h>
  11872. struct hostent *gethostbyaddr(addr, addrlen, addrfam)
  11873. char *addr;
  11874. int addrlen;
  11875. int addrfam;
  11876.  
  11877. Parameters 
  11878.  
  11879. addr 
  11880.   Pointer to a 32-bit internet address in network-byte order. 
  11881.  
  11882. addrlen 
  11883.   Size of addr in bytes. 
  11884.  
  11885. addrfam 
  11886.   Address family supported (AF_INET). 
  11887.  
  11888. Description 
  11889.  
  11890. This call resolves the host name through a name server, if one is present. If a 
  11891. name server is not present or cannot resolve the host name, gethostbyaddr() 
  11892. uses the default name services ordering: first it queries DNS/BIND, then it 
  11893. searches the ETC\HOSTS file in sequence until a matching host address is found 
  11894. or an end-of-file (EOF) marker is reached. This search order can be reversed by 
  11895. adding the following statement in your CONFIG.SYS file: 
  11896.  
  11897. SET USE_HOSTS_FIRST=1
  11898.  
  11899. When using DNS/BIND name service resolution, if the ETC\RESOLV file exists the 
  11900. gethostbyaddr() call queries the domain name server. The gethostbyaddr() call 
  11901. recognizes domain name servers as described in RFC 883. 
  11902.  
  11903. The gethostbyaddr() call also searches the local ETC\HOSTS file when indicated 
  11904. to do so. 
  11905.  
  11906. The gethostbyaddr() call returns a pointer to a hostent structure, which 
  11907. contains information obtained from one of the name resolutions services. The 
  11908. hostent structure is defined in the <NETDB.H> file. 
  11909.  
  11910. Return Values 
  11911.  
  11912. The return value points to static data that subsequent API calls can modify. 
  11913. This call returns a pointer to a hostent structure for the host address 
  11914. specified on the call and indicates success. A NULL pointer indicates an error. 
  11915.  
  11916. The <NETDB.H> header file defines the hostent structure and contains the 
  11917. following elements: 
  11918.  
  11919. Element        Description
  11920. h_name         Official name of the host 
  11921. h_aliases      Zero-terminated array of alternative names for the host 
  11922. h_addrtype     The address family of the network address being returned, always 
  11923.                set to AF_INET 
  11924. h_length       Length of the address in bytes 
  11925. h_addr         Pointer to the network address of the host 
  11926.  
  11927. The value of h_errno indicates the specific error. 
  11928.  
  11929.  
  11930.  h_errno Value   Code  Description
  11931.  
  11932.  NETDB_INTERNAL   -1   Generic error value. Call sock_errno() or
  11933.                        psock_errno() to get a more detailed error
  11934.                        code (or error message).
  11935.  
  11936.  HOST_NOT_FOUND   1    The host specified by the addr parameter is
  11937.                        not found.
  11938.  
  11939.  TRY_AGAIN        2    The local server does not receive a response
  11940.                        from an authorized server. Try again later.
  11941.  
  11942.  NO_RECOVERY      3    This error code indicates an unrecoverable
  11943.                        error.
  11944.  
  11945.  NO_DATA          4    The requested addr is valid, but does not
  11946.                        have an Internet address at the name server.
  11947.  
  11948.  NO_ADDRESS       4    The requested addr is valid, but does not
  11949.                        have an Internet address at the name server.
  11950.  
  11951. Related Calls 
  11952.  
  11953.      endhostent() 
  11954.      gethostbyname() 
  11955.      gethostent() 
  11956.      inet_addr() 
  11957.      sethostent() 
  11958.  
  11959.  
  11960. ΓòÉΓòÉΓòÉ 14.10. gethostbyname() ΓòÉΓòÉΓòÉ
  11961.  
  11962. The gethostbyname() call returns a pointer to information about a host 
  11963. specified by a host name. 
  11964.  
  11965. Syntax 
  11966.  
  11967. #include <netdb.h>
  11968. struct hostent *gethostbyname(name)
  11969. char *name;
  11970.  
  11971. Parameters 
  11972.  
  11973. name 
  11974.   Pointer to the name of the host being queried. 
  11975.  
  11976. Description: 
  11977.  
  11978. The following diagram illustrates gethostbyname() processing: 
  11979.  
  11980.  
  11981. gethostbyname() Processing
  11982.  
  11983. If you are using a SOCKS server, gethostbyname() calls Rgethostbyname(). To 
  11984. avoid having to change your applications should there be changes in SOCKS 
  11985. support, it is recommended you use gethostbyname() rather than 
  11986. Rgethostbyname(). 
  11987.  
  11988. See Socket Secure Support for information about SOCKS. 
  11989.  
  11990. The gethostbyname() call resolves the host name through a name server, if one 
  11991. is present. If a name server is not present or is unable to resolve the host 
  11992. name, gethostbyname() searches the ETC\HOSTS file in sequence until a matching 
  11993. host name is found or an EOF marker is reached. This search order can be 
  11994. reversed by the following statement in your CONFIG.SYS file: 
  11995.  
  11996. SET USE_HOSTS_FIRST=1
  11997.  
  11998. Return Values 
  11999.  
  12000. The return value points to static data that subsequent API calls can modify. 
  12001. This call returns a pointer to a hostent structure for the host address 
  12002. specified on the call and indicates success. A NULL pointer indicates an error. 
  12003.  
  12004. The <NETDB.H> header file defines the hostent structure and contains the 
  12005. following elements: 
  12006.  
  12007. Element        Description
  12008. h_name         Official name of the host 
  12009. h_aliases      Zero-terminated array of alternative names for the host 
  12010. h_addrtype     The address family of the network address being returned, always 
  12011.                set to AF_INET 
  12012. h_length       Length of the address in bytes 
  12013. h_addr         Pointer to the network address of the host 
  12014.  
  12015. The value of h_errno indicates the specific error. 
  12016.  
  12017.  
  12018.  h_errno Value   Code  Description
  12019.  
  12020.  NETDB_INTERNAL   -1   Generic error value. Call sock_errno() or
  12021.                        psock_errno()  to get a more detailed error
  12022.                        code (or error message).
  12023.  
  12024.  HOST_NOT_FOUND   1    The host specified by the name parameter is
  12025.                        not found.
  12026.  
  12027.  TRY_AGAIN        2    The local server does not receive a response
  12028.                        from an authorized server. Try again later.
  12029.  
  12030.  NO_RECOVERY      3    This error code indicates an unrecoverable
  12031.                        error.
  12032.  
  12033.  NO_DATA          4    The requested name is valid, but does not
  12034.                        have an Internet address at the name server.
  12035.  
  12036.  NO_ADDRESS       4    The requested name is valid, but does not
  12037.                        have an Internet address at the name server.
  12038.  
  12039. Related Calls 
  12040.  
  12041.      endhostent() 
  12042.      gethostbyaddr() 
  12043.      gethostent() 
  12044.      inet_addr() 
  12045.      sethostent() 
  12046.  
  12047.  
  12048. ΓòÉΓòÉΓòÉ 14.11. gethostent() ΓòÉΓòÉΓòÉ
  12049.  
  12050. The gethostent() call returns a pointer to the next entry in the ETC\HOSTS 
  12051. file. 
  12052.  
  12053. Syntax 
  12054.  
  12055. #include <netdb.h>
  12056. struct hostent *gethostent()
  12057.  
  12058. Description 
  12059.  
  12060. This call returns a pointer to a hostent structure, which contains the 
  12061. equivalent fields for a host description line in the ETC\HOSTS file. The 
  12062. hostent structure is defined in the <NETDB.H> file. 
  12063.  
  12064. Return Values 
  12065.  
  12066. The return value points to static data that subsequent API calls can modify. 
  12067. This call returns a pointer to a hostent structure for the host address 
  12068. specified on the call and indicates success. A NULL pointer indicates an error 
  12069. or EOF. 
  12070.  
  12071. The <NETDB.H> header file defines the hostent structure and contains the 
  12072. following elements: 
  12073.  
  12074. Element        Description
  12075. h_name         Official name of the host 
  12076. h_aliases      Zero-terminated array of alternative names for the host 
  12077. h_addrtype     The address family of the network address being returned, always 
  12078.                set to AF_INET 
  12079. h_length       Length of the address in bytes 
  12080. h_addr         Pointer to the network address of the host 
  12081.  
  12082. Related Calls 
  12083.  
  12084.      endhostent() 
  12085.      gethostbyaddr() 
  12086.      gethostbyname() 
  12087.      sethostent() 
  12088.  
  12089.  
  12090. ΓòÉΓòÉΓòÉ 14.12. gethostid() ΓòÉΓòÉΓòÉ
  12091.  
  12092. The gethostid() call returns the unique 32-bit identifier of the current host. 
  12093.  
  12094. Syntax 
  12095.  
  12096. #include <unistd.h>
  12097. u_long gethostid()
  12098.  
  12099. Return Values 
  12100.  
  12101. The gethostid() call returns the 32-bit identifier, in host-byte order of the 
  12102. current host, which should be unique across all hosts. This identifier is 
  12103. usually the IP address of the primary interface. The default primary interface 
  12104. is lan0.  For a slip only or PPP only configuration, the sl0 or ppp0 is the 
  12105. primary interface.  If no primary interface exists, the call returns a 
  12106. hexadecimal of X'FFFFFFFF'. 
  12107.  
  12108. Related Calls 
  12109.  
  12110.      gethostname() 
  12111.  
  12112.  
  12113. ΓòÉΓòÉΓòÉ 14.13. gethostname() ΓòÉΓòÉΓòÉ
  12114.  
  12115. The gethostname() call gets the standard host name for the local host machine. 
  12116.  
  12117. Syntax 
  12118.  
  12119. #include <unistd.h>
  12120. int gethostname(name, namelen)
  12121. char *name;
  12122. int namelen;
  12123.  
  12124. Parameters 
  12125.  
  12126. name 
  12127.   Pointer to a buffer. 
  12128.  
  12129. namelen 
  12130.   Length of the buffer. 
  12131.  
  12132. Description 
  12133.  
  12134. This call copies the standard host name for the local host into the buffer 
  12135. specified by the name parameter. The returned name is a null-terminated string. 
  12136. If insufficient space is provided, the returned name is truncated to fit the 
  12137. given space. System host names are limited to 256 characters. 
  12138.  
  12139. The gethostname() call allows a calling process to determine the internal host 
  12140. name for a machine on a network. 
  12141.  
  12142. Return Values 
  12143.  
  12144. The value 0 indicates success; the value -1 indicates an error. 
  12145.  
  12146. Related Calls 
  12147.  
  12148.      gethostbyaddr() 
  12149.      gethostbyname() 
  12150.      gethostid() 
  12151.  
  12152.  
  12153. ΓòÉΓòÉΓòÉ 14.14. _getlong() ΓòÉΓòÉΓòÉ
  12154.  
  12155. The _getlong() call retrieves long byte quantities. 
  12156.  
  12157. Syntax 
  12158.  
  12159. #include <sys\types.h>
  12160. #include <netinet\in.h>
  12161. #include <arpa\nameser.h>
  12162. #include <resolv.h>
  12163. u_long _getlong (msgp)
  12164. u_char *msgp;
  12165.  
  12166. Parameters 
  12167.  
  12168. msgp 
  12169.   Specifies a pointer into the byte stream. 
  12170.  
  12171. Description 
  12172.  
  12173. The _getlong() call gets long quantities from the byte stream or arbitrary byte 
  12174. boundaries. 
  12175.  
  12176. The _getlong() call is one of a group of calls that form the resolver, a set of 
  12177. functions that resolves domain names. Global information used by the resolver 
  12178. calls is kept in the _res data structure. The <RESOLV.H> file contains the _res 
  12179. structure definition. (See The _res Data Structure for more on the _res data 
  12180. structure.) 
  12181.  
  12182. Return Values 
  12183.  
  12184. The _getlong() call returns an unsigned long (32-bit) value. 
  12185.  
  12186. Related Calls 
  12187.  
  12188.      dn_comp() 
  12189.      dn_expand() 
  12190.      dn_find() 
  12191.      dn_skipname() 
  12192.      _getshort() 
  12193.      putlong() 
  12194.      putshort() 
  12195.      res_init() 
  12196.      res_mkquery() 
  12197.      res_query() 
  12198.      res_search() 
  12199.      res_send() 
  12200.  
  12201.  
  12202. ΓòÉΓòÉΓòÉ 14.15. getnetbyaddr() ΓòÉΓòÉΓòÉ
  12203.  
  12204. The getnetbyaddr() call returns a pointer to the ETC\NETWORKS file entry that 
  12205. contains the specified network address. 
  12206.  
  12207. Syntax 
  12208.  
  12209. #include <netdb.h>
  12210. struct netent *getnetbyaddr(net, type)
  12211. u_long net;
  12212. int type;
  12213.  
  12214. Parameters 
  12215.  
  12216. net 
  12217.   Network address. 
  12218.  
  12219. type 
  12220.   Address family supported (AF_INET). 
  12221.  
  12222. Description 
  12223.  
  12224. The getnetbyaddr() call searches the ETC\NETWORKS file for the specified 
  12225. network address. 
  12226.  
  12227. The getnetbyaddr() call retrieves information from the ETC\NETWORKS file using 
  12228. the network address as a search key. The getnetbyaddr() call searches the file 
  12229. sequentially from the start of the file until it encounters a matching net 
  12230. number and type or until it reaches the end of the file. 
  12231.  
  12232. The getnetbyaddr() call returns a pointer to a netent structure, which contains 
  12233. the equivalent fields for a network description line in the ETC\NETWORKS file. 
  12234. The netent structure is defined in the <NETDB.H> file. 
  12235.  
  12236. Use the endnetent() call to close the ETC\NETWORKS file. 
  12237.  
  12238. Return Values 
  12239.  
  12240. The return value points to static data that subsequent API calls can modify. A 
  12241. pointer to a netent structure indicates success.  A NULL pointer indicates an 
  12242. error or EOF. 
  12243.  
  12244.  The netent structure is defined in the <NETDB.H> header file and contains the 
  12245. following elements: 
  12246.  
  12247. Element        Description
  12248. n_name         Official name of the network 
  12249. n_aliases      An array, terminated with a NULL pointer, of alternative names 
  12250.                for the network 
  12251. n_addrtype     The address family of the network address being returned, always 
  12252.                set to AF_INET 
  12253. n_net          Network number, returned in host-byte order 
  12254.  
  12255. Related Calls 
  12256.  
  12257.      endnetent() 
  12258.      getnetbyname() 
  12259.      getnetent() 
  12260.      setnetent() 
  12261.  
  12262.  
  12263. ΓòÉΓòÉΓòÉ 14.16. getnetbyname() ΓòÉΓòÉΓòÉ
  12264.  
  12265. The getnetbyname() call returns a pointer to the ETC\NETWORKS file entry that 
  12266. contains the specified network name. 
  12267.  
  12268. Syntax 
  12269.  
  12270. #include <netdb.h>
  12271. struct netent *getnetbyname(name)
  12272. char *name;
  12273.  
  12274. Parameters 
  12275.  
  12276. name 
  12277.   Pointer to a network name. 
  12278.  
  12279. Description 
  12280.  
  12281. This call searches the ETC\NETWORKS file for the specified network name. 
  12282.  
  12283. The getnetbyname() call retrieves information from the ETC\NETWORKS file using 
  12284. the name parameter as a search key. The getnetbyname() call searches the file 
  12285. sequentially from the start of the file until it encounters a matching net name 
  12286. or until it reaches the end of the file. 
  12287.  
  12288. The getnetbyname() call returns a pointer to a netent structure, which contains 
  12289. the equivalent fields for a network description line in the ETC\NETWORKS file. 
  12290. The netent structure is defined in the <NETDB.H> file. 
  12291.  
  12292. Use the endnetent() call to close the ETC\NETWORKS file. 
  12293.  
  12294. Return Values 
  12295.  
  12296. The getnetbyname() call returns a pointer to a netent structure for the network 
  12297. name specified on the call. The return value points to static data that 
  12298. subsequent API calls can modify.  A pointer to a netent structure indicates 
  12299. success.  A NULL pointer indicates an error or EOF. 
  12300.  
  12301.  The netent structure is defined in the <NETDB.H> header file and contains the 
  12302. following elements: 
  12303.  
  12304. Element        Description
  12305. n_name         Official name of the network 
  12306. n_aliases      An array, terminated with a NULL pointer, of alternative names 
  12307.                for the network 
  12308. n_addrtype     The address family of the network address being returned, always 
  12309.                set to AF_INET 
  12310. n_net          Network number, returned in host-byte order 
  12311.  
  12312. Related Calls 
  12313.  
  12314.      endnetent() 
  12315.      getnetbyaddr() 
  12316.      getnetent() 
  12317.      setnetent() 
  12318.  
  12319.  
  12320. ΓòÉΓòÉΓòÉ 14.17. getnetent() ΓòÉΓòÉΓòÉ
  12321.  
  12322. The getnetent() call returns a pointer to the next entry in the ETC\NETWORKS 
  12323. file. 
  12324.  
  12325. Syntax 
  12326.  
  12327. #include <netdb.h>
  12328. struct netent *getnetent()
  12329.  
  12330. Description 
  12331.  
  12332. This call, by opening and sequentially reading the ETC\NETWORKS file, returns a 
  12333. pointer to the next entry in the file. 
  12334.  
  12335. The getnetent() call returns a pointer to a netent structure, which contains 
  12336. the equivalent fields for a network description line in the ETC\NETWORKS file. 
  12337. The netent structure is defined in the <NETDB.H> file. 
  12338.  
  12339. Use the endnetent() call to close the ETC\NETWORKS file. 
  12340.  
  12341. Return Values 
  12342.  
  12343. The getnetent() call returns a pointer to the next entry in the ETC\NETWORKS 
  12344. file. The return value points to static data that subsequent API calls can 
  12345. modify. A pointer to a netent structure indicates success. A NULL pointer 
  12346. indicates an error or EOF. 
  12347.  
  12348.  The netent structure is defined in the <NETDB.H> header file and contains the 
  12349. following elements: 
  12350.  
  12351. Element        Description
  12352. n_name         Official name of the network 
  12353. n_aliases      An array, terminated with a NULL pointer, of alternative names 
  12354.                for the network 
  12355. n_addrtype     The address family of the network address being returned, always 
  12356.                set to AF_INET 
  12357. n_net          Network number, returned in host-byte order 
  12358.  
  12359. Related Calls 
  12360.  
  12361.      endnetent() 
  12362.      getnetbyaddr() 
  12363.      getnetbyname() 
  12364.      setnetent() 
  12365.  
  12366.  
  12367. ΓòÉΓòÉΓòÉ 14.18. getprotobyname() ΓòÉΓòÉΓòÉ
  12368.  
  12369. The getprotobyname() call returns a pointer to the ETC\PROTOCOL file entry 
  12370. specified by a protocol name. 
  12371.  
  12372. Syntax 
  12373.  
  12374. #include <netdb.h>
  12375. struct protoent *getprotobyname(name)
  12376. char *name;
  12377.  
  12378. Parameters 
  12379.  
  12380. name 
  12381.   Pointer to the specified protocol name string. 
  12382.  
  12383. Description 
  12384.  
  12385. This call searches the ETC\PROTOCOL file for the specified protocol name. 
  12386.  
  12387. The getprotobyname() call retrieves protocol information from the ETC\PROTOCOL 
  12388. file using the name parameter as a search key. An application program can use 
  12389. this call to access a protocol name, its aliases, and protocol number. 
  12390.  
  12391. The getprotobyname() call searches the file sequentially from the start of the 
  12392. file until it encounters a matching protocol name, or until it reaches the end 
  12393. of the file. 
  12394.  
  12395. The getprotobyname() call returns a pointer to a protoent structure, which 
  12396. contains fields for a line of information in the ETC\PROTOCOL file. The 
  12397. protoent structure is defined in the <NETDB.H> file. 
  12398.  
  12399. Use the endprotoent() call to close the ETC\PROTOCOL file. 
  12400.  
  12401. Return Values 
  12402.  
  12403. The getprotobyname() call returns a pointer to a protoent structure for the 
  12404. network protocol specified on the call. The return value points to static data 
  12405. that subsequent API calls can modify. A pointer to a protoent structure 
  12406. indicates success. A NULL pointer indicates an error or EOF. 
  12407.  
  12408. The protoent structure is defined in the <NETDB.H> header file and contains the 
  12409. following elements: 
  12410.  
  12411. Element        Description
  12412. p_name         Official name of the protocol 
  12413. p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12414.                the protocol 
  12415. p_proto        Protocol number 
  12416.  
  12417. Related Calls 
  12418.  
  12419.      endprotoent() 
  12420.      getprotobynumber() 
  12421.      getprotoent() 
  12422.      setprotoent() 
  12423.  
  12424.  
  12425. ΓòÉΓòÉΓòÉ 14.19. getprotobynumber() ΓòÉΓòÉΓòÉ
  12426.  
  12427. The getprotobynumber() call returns a pointer to the ETC\PROTOCOL file entry 
  12428. specified by a protocol number. 
  12429.  
  12430. Syntax 
  12431.  
  12432. #include <netdb.h>
  12433. struct protoent * getprotobynumber(proto)
  12434. int proto;
  12435.  
  12436. Parameters 
  12437.  
  12438. proto 
  12439.   Protocol number. 
  12440.  
  12441. Description 
  12442.  
  12443. This call searches the ETC\PROTOCOL file for the specified protocol number. 
  12444.  
  12445. The getprotobynumber() call retrieves the protocol information from the 
  12446. ETC\PROTOCOL file using the specified proto parameter as a search key. An 
  12447. application program can use this call to access a protocol name, its aliases, 
  12448. and protocol number. 
  12449.  
  12450. The getprotobynumber() call searches the file sequentially from the start of 
  12451. the file until it encounters a matching protocol number, or until it reaches 
  12452. the end of the file. 
  12453.  
  12454. The getprotobynumber() call returns a pointer to a protoent structure, which 
  12455. contains fields for a line of information in the ETC\PROTOCOL file. The 
  12456. protoent structure is defined in the <NETDB.H> file. 
  12457.  
  12458. Use the endprotoent() call to close the ETC\PROTOCOL file. 
  12459.  
  12460. Return Values 
  12461.  
  12462. The getprotobynumber() call returns a pointer to a protoent structure for the 
  12463. network protocol specified on the call. The return value points to static data 
  12464. that subsequent API calls can modify. A pointer to a protoent structure 
  12465. indicates success. A NULL pointer indicates an error or EOF. 
  12466.  
  12467. The protoent structure is defined in the <NETDB.H> header file and contains the 
  12468. following elements: 
  12469.  
  12470. Element        Description
  12471. p_name         Official name of the protocol 
  12472. p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12473.                the protocol 
  12474. p_proto        Protocol number 
  12475.  
  12476. Related Calls 
  12477.  
  12478.      endprotoent() 
  12479.      getprotobyname() 
  12480.      getprotoent() 
  12481.      setprotoent() 
  12482.  
  12483.  
  12484. ΓòÉΓòÉΓòÉ 14.20. getprotoent() ΓòÉΓòÉΓòÉ
  12485.  
  12486. The getprotoent() call returns a pointer to the next entry in the ETC\PROTOCOL 
  12487. file. 
  12488.  
  12489. Syntax 
  12490.  
  12491. #include <netdb.h>
  12492. struct protoent *getprotoent()
  12493.  
  12494. Description 
  12495.  
  12496. This call searches for the next entry in the ETC\PROTOCOL file. 
  12497.  
  12498. The getprotoent() call retrieves the protocol information from the ETC\PROTOCOL 
  12499. file. An application program can use this call to access a protocol name, its 
  12500. aliases, and protocol number. 
  12501.  
  12502. The getprotoent() call opens and performs a sequential read of the ETC\PROTOCOL 
  12503. file. The getprotoent() call returns a pointer to a protoent structure, which 
  12504. contains fields for a line of information in the ETC\PROTOCOL file. The 
  12505. protoent structure is defined in the <NETDB.H> file. 
  12506.  
  12507. Use the endprotoent() call to close the ETC\PROTOCOL file. 
  12508.  
  12509. Return Values 
  12510.  
  12511. The getprotoent() call returns a pointer to the next entry in the file, 
  12512. ETC\PROTOCOL. The return value points to static data that subsequent API calls 
  12513. can modify. A pointer to a protoent structure indicates success. A NULL pointer 
  12514. indicates an error or EOF. 
  12515.  
  12516. The protoent structure is defined in the <NETDB.H> header file and contains the 
  12517. following elements: 
  12518.  
  12519. Element        Description
  12520. p_name         Official name of the protocol 
  12521. p_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12522.                the protocol 
  12523. p_proto        Protocol number 
  12524.  
  12525. Related Calls 
  12526.  
  12527.      endprotoent() 
  12528.      getprotobyname() 
  12529.      getprotobynumber() 
  12530.      setprotoent() 
  12531.  
  12532.  
  12533. ΓòÉΓòÉΓòÉ 14.21. getservbyname() ΓòÉΓòÉΓòÉ
  12534.  
  12535. The getservbyname() call returns a pointer to the ETC\SERVICES file entry 
  12536. specified by a service name. 
  12537.  
  12538. Syntax 
  12539.  
  12540. #include <netdb.h>
  12541. struct servent *getservbyname(name, proto)
  12542. char *name;
  12543. char *proto;
  12544.  
  12545. Parameters 
  12546.  
  12547. name 
  12548.   Pointer to the service name. 
  12549.  
  12550. proto 
  12551.   Pointer to the specified protocol. 
  12552.  
  12553. Description 
  12554.  
  12555. This call searches the ETC\SERVICES file for the specified service name, which 
  12556. must match the protocol if a protocol is stated. 
  12557.  
  12558. The getservbyname() call retrieves an entry from the ETC\SERVICES file using 
  12559. the name parameter as a search key. 
  12560.  
  12561. An application program can use this call to access a service, service aliases, 
  12562. the protocol for the service, and a protocol port number for the service. 
  12563.  
  12564. The getservbyname() call searches the ETC\SERVICES file sequentially from the 
  12565. start of the file until it finds one of the following: 
  12566.  
  12567.     Matching name and protocol number 
  12568.     Matching name when the proto parameter is set to 0 
  12569.     End of the file 
  12570.  Upon locating a matching name and protocol, the getservbyname() call returns a 
  12571. pointer to the servent structure, which contains fields for a line of 
  12572. information from the ETC\SERVICES file. The <NETDB.H> file defines the servent 
  12573. structure and structure fields. 
  12574.  
  12575. Use the endservent() call to close the ETC\SERVICES file. 
  12576.  
  12577. Return Values 
  12578.  
  12579. The call returns a pointer to a servent structure for the network service 
  12580. specified on the call. The return value points to static data that subsequent 
  12581. API calls can modify. A pointer to a servent structure indicates success. A 
  12582. NULL pointer indicates an error or EOF. 
  12583.  
  12584. The servent structure is defined in the <NETDB.H> header file and contains the 
  12585. following elements: 
  12586.  
  12587. Element        Description
  12588. s_name         Official name of the service 
  12589. s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12590.                the service 
  12591. s_port         Port number of the service 
  12592. s_proto        Required protocol to contact the service 
  12593.  
  12594. Related Calls 
  12595.  
  12596.      endprotoent() 
  12597.      endservent() 
  12598.      getprotobyname() 
  12599.      getprotobynumber() 
  12600.      getprotoent() 
  12601.      getservbyport() 
  12602.      getservent() 
  12603.      setprotoent() 
  12604.      setservent() 
  12605.  
  12606.  
  12607. ΓòÉΓòÉΓòÉ 14.22. getservbyport() ΓòÉΓòÉΓòÉ
  12608.  
  12609. The getservbyport() call returns a pointer to the ETC\SERVICES file entry 
  12610. specified by a port number. 
  12611.  
  12612. Syntax 
  12613.  
  12614. #include <netdb.h>
  12615. struct servent *getservbyport(port, proto)
  12616. int port;
  12617. char *proto;
  12618.  
  12619. Parameters 
  12620.  
  12621. port 
  12622.   Specified port. 
  12623.  
  12624. proto 
  12625.   Pointer to the specified protocol. 
  12626.  
  12627. Description 
  12628.  
  12629. This call sequentially searches the ETC\SERVICES file for the specified port 
  12630. number, which must match the protocol if a protocol is stated. 
  12631.  
  12632. The getservbyport() call retrieves an entry from the ETC\SERVICES file using 
  12633. the port parameter as a search key. 
  12634.  
  12635. An application program can use this call to access a service, service aliases, 
  12636. the protocol for the service, and a protocol port number for the service. 
  12637.  
  12638. The getservbyname() call searches the ETC\SERVICES file sequentially from the 
  12639. start of the file until it finds one of the following: 
  12640.  
  12641.     Matching protocol and port number 
  12642.     Matching protocol when the port parameter is set to 0 
  12643.     End of the file 
  12644.  Upon locating a matching protocol and port number-or upon locating a matching 
  12645. protocol only (if the port parameter equals 0-the getservbyport() call returns 
  12646. a pointer to the servent structure. This structure contains fields for a line 
  12647. of information from the ETC\SERVICES file. The <NETDB.H> file defines the 
  12648. servent structure and structure fields. 
  12649.  
  12650. Use the endservent() call to close the ETC\SERVICES file. 
  12651.  
  12652. Return Values 
  12653.  
  12654. The getservbyport() call returns a pointer to a servent structure for the port 
  12655. number specified on the call. The return value points to static data that 
  12656. subsequent API calls can modify. A pointer to a servent structure indicates 
  12657. success. A NULL pointer indicates an error or EOF. 
  12658.  
  12659. The servent structure is defined in the <NETDB.H> header file and contains the 
  12660. following elements: 
  12661.  
  12662. Element        Description
  12663. s_name         Official name of the service 
  12664. s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12665.                the service 
  12666. s_port         Port number of the service 
  12667. s_proto        Required protocol to contact the service 
  12668.  
  12669. Related Calls 
  12670.  
  12671.      endprotoent() 
  12672.      endservent() 
  12673.      getprotobyname() 
  12674.      getprotoent() 
  12675.      getservbyname() 
  12676.      getservent() 
  12677.      setprotoent() 
  12678.      setservent() 
  12679.  
  12680.  
  12681. ΓòÉΓòÉΓòÉ 14.23. getservent() ΓòÉΓòÉΓòÉ
  12682.  
  12683. The getservent() call returns a pointer to the next entry in the ETC\SERVICES 
  12684. file. 
  12685.  
  12686. Syntax 
  12687.  
  12688. #include <netdb.h>
  12689. struct servent *getservent()
  12690.  
  12691. Description 
  12692.  
  12693. This call searches for the next line in the ETC\SERVICES file. An application 
  12694. program can use the getservent() call to retrieve information about network 
  12695. services and the protocol ports they use. 
  12696.  
  12697. The getservent() call returns a pointer to a servent structure, which contains 
  12698. fields for a line of information from the ETC\SERVICES file. The servent 
  12699. structure is defined in the <NETDB.H> file. 
  12700.  
  12701. The ETC\SERVICES file remains open after a call by getservent(). To close the 
  12702. ETC\SERVICES file after each call, use setservent(). Otherwise, use 
  12703. endservent() to close the file. 
  12704.  
  12705. Return Values 
  12706.  
  12707. The getservent() call returns a pointer to the next entry in the ETC\SERVICES 
  12708. file. The return value points to static data that subsequent API calls can 
  12709. modify. A pointer to a servent structure indicates success. A NULL pointer 
  12710. indicates an error or EOF. 
  12711.  
  12712. The servent structure is defined in the <NETDB.H> header file and contains the 
  12713. following elements: 
  12714.  
  12715. Element        Description
  12716. s_name         Official name of the service 
  12717. s_aliases      Array, terminated with a NULL pointer, of alternative names for 
  12718.                the service 
  12719. s_port         Port number of the service 
  12720. s_proto        Required protocol to contact the service 
  12721.  
  12722. Related Calls 
  12723.  
  12724.      endprotoent() 
  12725.      endservent() 
  12726.      getprotobyname() 
  12727.      getprotobynumber() 
  12728.      getprotoent() 
  12729.      getservbyname() 
  12730.      getservbyport() 
  12731.      setprotoent() 
  12732.      setservent() 
  12733.  
  12734.  
  12735. ΓòÉΓòÉΓòÉ 14.24. _getshort() ΓòÉΓòÉΓòÉ
  12736.  
  12737. The _getshort() call retrieves short byte quantities. 
  12738.  
  12739. Syntax 
  12740.  
  12741. #include <sys\types.h>
  12742. #include <netinet\in.h>
  12743. #include <arpa\nameser.h>
  12744. #include <resolv.h>
  12745. u_short _getshort (msgp)
  12746. u_char *msgp;
  12747.  
  12748. Parameters 
  12749.  
  12750. msgp 
  12751.   Specifies a pointer into the byte stream. 
  12752.  
  12753. Description 
  12754.  
  12755. The _getshort() call gets quantities from the byte stream or arbitrary byte 
  12756. boundaries. 
  12757.  
  12758. The _getshort() call is one of a group of calls that form the resolver, a set 
  12759. of functions that resolve domain names. Global information used by the resolver 
  12760. calls is kept in the _res data structure. The <RESOLV.H> file contains the _res 
  12761. structure definition. (See The _res Data Structure for more on the _res data 
  12762. structure.) 
  12763.  
  12764. Return Values 
  12765.  
  12766. The _getshort() call returns an unsigned short (16-bit) value. 
  12767.  
  12768. Related Calls 
  12769.  
  12770.      dn_comp() 
  12771.      dn_expand() 
  12772.      dn_find() 
  12773.      dn_skipname() 
  12774.      _getlong() 
  12775.      putlong() 
  12776.      putshort() 
  12777.      res_init() 
  12778.      res_mkquery() 
  12779.  
  12780.  
  12781. ΓòÉΓòÉΓòÉ 14.25. h_errno ΓòÉΓòÉΓòÉ
  12782.  
  12783. The h_errno variable returns the last name resolution error that occurred in 
  12784. the current thread. 
  12785.  
  12786. Syntax 
  12787.  
  12788. #include <netdb.h>
  12789. int h_errno
  12790.  
  12791. Description 
  12792.  
  12793. The h_errno variable returns the last name resolution error that occurred in 
  12794. the current thread. These error codes are set by gethostname(), res_send(), 
  12795. res_query(), res_querydomain(), and res_search(). 
  12796.  
  12797. Return Values 
  12798.  
  12799. The value -1 indicates an error code is unavailable.  A non-zero, non-negative 
  12800. returned value is the TCP/IP error code. 
  12801.  
  12802. Error Code              Description
  12803. HOST_NOT_FOUND          The host cannot be found. 
  12804. TRY_AGAIN               Server failure. 
  12805. NO_RECOVERY             Non-recoverable error. 
  12806. NO_DATA                 Valid name; no data record of requested type. 
  12807. NO_ADDRESS              No address; look for MX record (mail exchange record 
  12808.                         used by DNS). 
  12809.  
  12810. Related Calls 
  12811.  
  12812.      gethostname() 
  12813.      res_query() 
  12814.      res_querydomain() 
  12815.      res_search() 
  12816.      res_send() 
  12817.  
  12818.  
  12819. ΓòÉΓòÉΓòÉ 14.26. htonl() ΓòÉΓòÉΓòÉ
  12820.  
  12821. The socket call translates a long integer from host-byte order to network-byte 
  12822. order. 
  12823.  
  12824. Syntax 
  12825.  
  12826. #include <types.h>
  12827. u_long htonl(a)
  12828. u_long a;
  12829.  
  12830. Parameters 
  12831.  
  12832.   Unsigned long integer to be put into network-byte order. 
  12833.  
  12834. Description 
  12835.  
  12836. The htonl() call converts an unsigned long (32-bit) integer from host-byte 
  12837. order to internet network-byte order. 
  12838.  
  12839. The internet network requires addresses and ports in network standard-byte 
  12840. order. Use the htonl() call to convert the host integer representation of 
  12841. addresses and ports to internet network-byte order. 
  12842.  
  12843. Return Values 
  12844.  
  12845. Returns the translated long integer. 
  12846.  
  12847. Related Calls 
  12848.  
  12849.      htons() 
  12850.      ntohl() 
  12851.      ntohs() 
  12852.  
  12853.  
  12854. ΓòÉΓòÉΓòÉ 14.27. htons() ΓòÉΓòÉΓòÉ
  12855.  
  12856. The socket call translates a short integer from host-byte order to network-byte 
  12857. order. 
  12858.  
  12859. Syntax 
  12860.  
  12861. #include <types.h>
  12862. u_short htons(a)
  12863. u_short a;
  12864.  
  12865. Parameters 
  12866.  
  12867.   Unsigned short integer to be put into network-byte order. 
  12868.  
  12869. Description 
  12870.  
  12871. The htons() call converts an unsigned short (16-bit) integer from host-byte 
  12872. order to internet network-byte order. 
  12873.  
  12874. The internet network requires addresses and ports in network standard-byte 
  12875. order. Use the htons() call to convert ports from their host integer 
  12876. representation to internet network-byte order. 
  12877.  
  12878. Return Values 
  12879.  
  12880. Returns the translated short integer. 
  12881.  
  12882. Related Calls 
  12883.  
  12884.      htonl() 
  12885.      ntohl() 
  12886.      ntohs() 
  12887.  
  12888.  
  12889. ΓòÉΓòÉΓòÉ 14.28. inet_addr() ΓòÉΓòÉΓòÉ
  12890.  
  12891. The inet_addr() call constructs an internet address from character strings 
  12892. representing numbers expressed in standard dotted-decimal notation. 
  12893.  
  12894. Syntax 
  12895.  
  12896. #include <arpa\inet.h>
  12897. u_long inet_addr(cp)
  12898. char *cp;
  12899.  
  12900. Parameters 
  12901.  
  12902. cp 
  12903.   A character string in standard dotted-decimal notation 
  12904.  
  12905. Description 
  12906.  
  12907. The inet_addr() call converts an ASCII string containing a valid internet 
  12908. address using dotted-decimal notation into an internet address number typed as 
  12909. an unsigned long value. An example of dotted-decimal notation is 120.121.5.123. 
  12910. The inet_addr() call returns an error value if the internet address notation in 
  12911. the ASCII string supplied by the application is not valid. 
  12912.  
  12913. Note: 
  12914.  
  12915.      Although inet_addr() call and inet_network() call both convert internet 
  12916.      addresses in dotted-decimal notation, they process ASCII strings 
  12917.      differently. When an application gives the inet_addr() call a string 
  12918.      containing an internet address value without a delimiter, the call returns 
  12919.      the logical product of the value represented by the string and 0xFFFFFFFF. 
  12920.      For any other internet address, if the value of the fields exceeds the 
  12921.      previously defined limits, the inet_addr() call returns an error value of 
  12922.      -1. 
  12923.  
  12924.      When an application gives the inet_network() call a string containing an 
  12925.      internet address value without a delimiter, the inet_network() call 
  12926.      returns the logical product of the value represented by the string and 
  12927.      0xFF. For any other internet address, the call returns an error value of 
  12928.      -1 if the value of the fields exceeds the previously defined limits. 
  12929.  
  12930.      Sample return values for each call are as follows: 
  12931.  
  12932.  
  12933.            Application string       inet_addr() returns   inet_network()
  12934.                                                           returns
  12935.  
  12936.            0x1234567890abcdef       0x090abcdef           0x000000ef
  12937.  
  12938.            0x1234567890abcdef       0xFFFFFFFF (= -1)     0x0000ef00
  12939.  
  12940.            256.257.258.259          0xFFFFFFFF (= -1)     0x00010203
  12941.  
  12942.  
  12943. The ASCII string for the inet_addr() call must conform to the following format: 
  12944.  
  12945. string::= field | field delimited_field^1-3 | delimited_field^1-3
  12946. delimited_field::= delimiter field | delimiter
  12947. delimiter::= .
  12948. field::= 0X | 0x | 0Xhexadecimal* | 0x hexadecimal* | decimal* | 0 octal
  12949. hexadecimal::= decimal |a|b|c|d|e|f|A|B|C|D|E|F
  12950. decimal::= octal |8|9
  12951. octal::= 0|1|2|3|4|5|6|7
  12952.  
  12953. Notes: 
  12954.  
  12955.   1. ^n indicates n repetitions of a pattern. 
  12956.  
  12957.   2. ^n-m indicates n to m repetitions of a pattern. 
  12958.  
  12959.   3. * indicates 0 or more repetitions of a pattern, up to environmental 
  12960.      limits. 
  12961.  
  12962.   4. The Backus Naur form (BNF) description states the space character, if one 
  12963.      is used. Text indicates text, not a BNF symbol. 
  12964.  
  12965. The inet_addr() call requires an application to terminate the string with a 
  12966. null terminator (0x00) or a space (0x30). The string is considered invalid if 
  12967. the application does not end it with a null terminator or a space. The call 
  12968. ignores characters trailing a space. 
  12969.  
  12970. The following describes the restrictions on the field values for the 
  12971. inet_addr() call: 
  12972.  
  12973. Format      Field Restrictions (in decimal)
  12974. a           Value_a < 4,294,967,296 
  12975. a.b         Value_a < 256; Value_b < 16,777,216 
  12976. a.b.c       Value_a < 256; Value_b < 256; Value_c < 65536 
  12977. a.b.c.d     Value_a < 256; Value_b < 256; Value_c < 256; Value_d < 256 
  12978.  
  12979. When a four-part address is specified, each part is interpreted as a byte of 
  12980. data and assigned, from left to right, to one of the 4 bytes of an internet 
  12981. address. 
  12982.  
  12983. When a three-part address is specified, the last part is interpreted as a 
  12984. 16-bit quantity and placed in the two rightmost bytes of the network address. 
  12985. This makes the three-part address format convenient for specifying Class B 
  12986. network addresses as 128.net.host. 
  12987.  
  12988. When a two-part address is specified, the last part is interpreted as a 24-bit 
  12989. quantity and placed in the three rightmost bytes of the network address. This 
  12990. makes the two-part address format convenient for specifying Class A network 
  12991. addresses as net.host. 
  12992.  
  12993. When a one-part address is specified, the value is stored directly in the 
  12994. network address space without any rearrangement of its bytes. 
  12995.  
  12996. Numbers supplied as address parts in standard dotted-decimal notation can be 
  12997. decimal, hexadecimal, or octal. Numbers are interpreted in C language syntax. A 
  12998. leading 0x implies hexadecimal; a leading 0 implies octal. A number without a 
  12999. leading 0 implies decimal. 
  13000.  
  13001. Applications that use the inet_addr() call can enter field values exceeding the 
  13002. above restrictions. The call accepts the least significant bits up to an 
  13003. integer in length, then checks whether the truncated value exceeds the maximum 
  13004. field value. For example, if an application enters a field value of 
  13005. 0x1234567890 and the system uses 16 bits per integer, then the inet_addr() call 
  13006. uses bits 0-15. The call returns 0x34567890. 
  13007.  
  13008. Applications can omit field values between delimiters. The inet_addr() call 
  13009. interprets empty fields as 0. 
  13010.  
  13011. Notes: 
  13012.  
  13013.   1. The inet_addr() call does not check the pointer to the ASCII string. The 
  13014.      user must ensure the validity of the address in the ASCII string. 
  13015.  
  13016.   2. The application must verify that the network and host IDs for the internet 
  13017.      address conform to either a Class A, B, or C internet address. The 
  13018.      inet_attr() call processes any other class of address as a Class C 
  13019.      address. 
  13020.  
  13021. Return Values 
  13022.  
  13023. The internet address is returned in network-byte order. The return value points 
  13024. to static data that subsequent API calls can modify. 
  13025.  
  13026. For valid input strings, the inet_addr() call returns an unsigned long value 
  13027. comprised of the bit patterns of the input fields concatenated together. The 
  13028. call places the first pattern in the most significant position and appends any 
  13029. subsequent patterns to the next most significant positions. 
  13030.  
  13031. The inet_addr() call returns an error value of -1 for invalid strings. 
  13032.  
  13033. Note:  An internet address with a dotted-decimal notation value of 
  13034.        255.255.255.255 or its equivalent in a different base format causes the 
  13035.        inet_addr() call to return an unsigned long value of 4294967295. This 
  13036.        value is identical to the unsigned representation of the error value. 
  13037.        Otherwise, the inet_addr() call considers 255.255.255.255 a valid 
  13038.        internet address. 
  13039.  
  13040. Related Calls 
  13041.  
  13042.      endhostent() 
  13043.      endnetent() 
  13044.      gethostbyaddr() 
  13045.      gethostbyname() 
  13046.      getnetbyaddr() 
  13047.      getnetbyname() 
  13048.      getnetent() 
  13049.      inet_lnaof() 
  13050.      inet_makeaddr() 
  13051.      inet_netof() 
  13052.      inet_network() 
  13053.      inet_ntoa() 
  13054.      sethostent() 
  13055.      setnetent() 
  13056.  
  13057.  
  13058. ΓòÉΓòÉΓòÉ 14.29. inet_lnaof() ΓòÉΓòÉΓòÉ
  13059.  
  13060. The inet_lnaof() call returns the local network portion of an internet host 
  13061. address. 
  13062.  
  13063. Syntax 
  13064.  
  13065. #include <types.h>
  13066. #include <arpa\inet.h>
  13067. u_long inet_lnaof(in)
  13068. struct in_addr in;
  13069.  
  13070. Parameters 
  13071.  
  13072. in 
  13073.   Host internet address. 
  13074.  
  13075. Description 
  13076.  
  13077. The inet_lnaof() call masks off the host ID of an internet address based on the 
  13078. internet address class. The calling application must enter the internet address 
  13079. as an unsigned long value. 
  13080.  
  13081. Note:  The application must verify that the network and host IDs for the 
  13082.        internet address conform to either a Class A, B, or C internet address. 
  13083.        The inet_lnaof() call processes any other class of address as a Class C 
  13084.        address. 
  13085.  
  13086. Return Values 
  13087.  
  13088. The local network address is returned in host-byte order. The return value 
  13089. points to static data that subsequent API calls can modify. 
  13090.  
  13091. The return values of the inet_lnaof() call depend on the class of internet 
  13092. address the application provides: 
  13093.  
  13094. Class A   The logical product of the internet address and 0x00FFFFFF 
  13095. Class B   The logical product of the internet address and 0x0000FFFF 
  13096. Class C   The logical product of the internet address and 0x000000FF 
  13097.  
  13098. Related Calls 
  13099.  
  13100.      endhostent() 
  13101.      endnetent() 
  13102.      gethostbyaddr() 
  13103.      gethostbyname() 
  13104.      getnetbyaddr() 
  13105.      getnetbyname() 
  13106.      getnetent() 
  13107.      inet_addr() 
  13108.      inet_makeaddr() 
  13109.      inet_netof() 
  13110.      inet_network() 
  13111.      inet_ntoa() 
  13112.      sethostent() 
  13113.      setnetent() 
  13114.  
  13115.  
  13116. ΓòÉΓòÉΓòÉ 14.30. inet_makeaddr() ΓòÉΓòÉΓòÉ
  13117.  
  13118. The inet_makeaddr() call constructs an internet address from a network number 
  13119. and a local network address. 
  13120.  
  13121. Syntax 
  13122.  
  13123. #include <types.h>
  13124. #include <arpa\inet.h>
  13125. struct in_addr inet_makeaddr(net, lna)
  13126. u_long net;
  13127. u_long lna;
  13128.  
  13129. Parameters 
  13130.  
  13131. net 
  13132.   Network number. 
  13133.  
  13134. lna 
  13135.   Local network address. 
  13136.  
  13137. Description 
  13138.  
  13139. The inet_makeaddr() call forms an internet address from the network ID and host 
  13140. ID provided by the application (as integer types). If the application provides 
  13141. a Class A network ID, the inet_makeaddr() call forms the internet address using 
  13142. the net ID in the highest-order byte, and the logical product of the host ID 
  13143. and 0x00FFFFFF in the 3 lowest-order bytes. If the application provides a Class 
  13144. B network ID, the inet_makeaddr() call forms the internet address using the net 
  13145. ID in the two highest-order bytes, and the logical product of the host ID and 
  13146. 0x0000FFFF in the lowest two ordered bytes. If the application does not provide 
  13147. either a Class A or Class B network ID, the inet_makeaddr() call forms the 
  13148. internet address using the network ID in the 3 highest-order bytes, and the 
  13149. logical product of the host ID and 0x0000FFFF in the lowest-ordered byte. 
  13150.  
  13151. The inet_makeaddr() call ensures that the internet address format conforms to 
  13152. network order, with the first byte representing the high-order byte. The 
  13153. inet_makeaddr() call stores the internet address in the structure as an 
  13154. unsigned long value. 
  13155.  
  13156. The application must verify that the network ID and host ID for the internet 
  13157. address conform to class A, B, or C. The inet_makeaddr() call processes any 
  13158. other class of address as a Class C address. 
  13159.  
  13160. The inet_makeaddr() call expects the in_addr structure to contain only the 
  13161. internet address field. If the application defines the in_addr structure 
  13162. otherwise, then the value returned in in_addr by the inet_makeaddr() call is 
  13163. undefined. 
  13164.  
  13165. Return Values 
  13166.  
  13167. The internet address is returned in network-byte order. The return value points 
  13168. to static data that subsequent API calls can modify. 
  13169.  
  13170. If the inet_makeaddr() call is unsuccessful, the call returns a value of -1. 
  13171.  
  13172. Related Calls 
  13173.  
  13174.      endhostent() 
  13175.      endnetent() 
  13176.      gethostbyaddr() 
  13177.      gethostbyname() 
  13178.      getnetbyaddr() 
  13179.      getnetbyname() 
  13180.      getnetent() 
  13181.      inet_addr() 
  13182.      inet_lnaof() 
  13183.      inet_netof() 
  13184.      inet_network() 
  13185.      inet_ntoa() 
  13186.      sethostent() 
  13187.      setnetent() 
  13188.  
  13189.  
  13190. ΓòÉΓòÉΓòÉ 14.31. inet_netof() ΓòÉΓòÉΓòÉ
  13191.  
  13192. The inet_netof() call returns the network number portion of the internet host 
  13193. address in network-byte order. 
  13194.  
  13195. Syntax 
  13196.  
  13197. #include <types.h>
  13198. #include <arpa\inet.h>
  13199. u_long inet_netof(in)
  13200. struct in_addr in;
  13201.  
  13202. Parameters 
  13203.  
  13204. in 
  13205.   Internet address in network-byte order. 
  13206.  
  13207. Description 
  13208.  
  13209. The inet_netof() call returns the network number from the specified internet 
  13210. address number, typed as unsigned long value. The inet_netof() call masks off 
  13211. the network number and the host number from the internet address, based on the 
  13212. internet address class. 
  13213.  
  13214. Note:  The application assumes responsibility for verifying that the network 
  13215.        number and the host number for the internet address conforms to a class 
  13216.        A or B or C internet address. The inet_netof() call processes any other 
  13217.        class of address as a class C address. 
  13218.  
  13219. Return Values 
  13220.  
  13221. The network number is returned in host-byte order. The return value points to 
  13222. static data that subsequent API calls can modify. 
  13223.  
  13224. When successful, the inet_netof() call returns a network number from the 
  13225. specified long value representing the internet address. If the application 
  13226. gives a class A internet address, the inet_lnoaf() call returns the logical 
  13227. product of the internet address and 0xFF000000. If the application gives a 
  13228. class B internet address, the inet_lnoaf() call returns the logical product of 
  13229. the internet address and 0xFFFF0000. If the application does not give a class A 
  13230. or B internet address,  the inet_lnoaf() call returns the logical product of 
  13231. the internet address and 0xFFFFFF00. 
  13232.  
  13233. Related Calls 
  13234.  
  13235.      endhostent() 
  13236.      endnetent() 
  13237.      gethostbyaddr() 
  13238.      gethostbyname() 
  13239.      getnetbyaddr() 
  13240.      getnetbyname() 
  13241.      getnetent() 
  13242.      inet_addr() 
  13243.      inet_lnaof() 
  13244.      inet_makeaddr() 
  13245.      inet_network() 
  13246.      inet_ntoa() 
  13247.      sethostent() 
  13248.      setnetent() 
  13249.  
  13250.  
  13251. ΓòÉΓòÉΓòÉ 14.32. inet_network() ΓòÉΓòÉΓòÉ
  13252.  
  13253. The inet_network() call constructs a network number from character strings 
  13254. representing numbers expressed in standard dotted-decimal notation. 
  13255.  
  13256. Syntax 
  13257.  
  13258. #include <types.h>
  13259. #include <arpa\inet.h>
  13260. u_long inet_network(cp)
  13261. char *cp;
  13262.  
  13263. Parameters 
  13264.  
  13265. cp 
  13266.   A character string in standard dotted-decimal notation. 
  13267.  
  13268. Description 
  13269.  
  13270. The inet_network() call converts an ASCII string containing a valid internet 
  13271. address using dotted-decimal notation (such as 120.121.122.123) to an internet 
  13272. address number formatted as an unsigned long value. The inet_network() call 
  13273. returns an error value if the application does not provide an ASCII string 
  13274. containing a valid internet address using dotted-decimal notation. 
  13275.  
  13276. The input ASCII string must represent a valid internet address number, as 
  13277. described in Internet Address Formats. The input string must be terminated with 
  13278. a null terminator (0x00) or a space (0x30). The inet_network() call ignores 
  13279. characters that follow the terminating character. 
  13280.  
  13281. The input string can express an internet address number in decimal, 
  13282. hexadecimal, or octal format. In hexadecimal format, the string must begin with 
  13283. 0x. The string must begin with 0 to indicate octal format. In decimal format, 
  13284. the string requires no prefix. 
  13285.  
  13286. Each octet of the input string must be delimited from another by a period. The 
  13287. application can omit values between delimiters. The inet_network() call 
  13288. interprets missing values as 0. 
  13289.  
  13290. The following examples show valid strings and their output values in both 
  13291. decimal and hexadecimal notation: 
  13292.  
  13293. Examples of Valid Strings 
  13294.  
  13295.  
  13296.  Input string           Output value (in       Output value (in hex)
  13297.                         decimal)
  13298.  
  13299.  ...1                   1                      0x00000001
  13300.  
  13301.  .1..                   65536                  0x00010000
  13302.  
  13303.  1                      256                    0x00000100
  13304.  
  13305.  0xFFFFFFFF             255                    0x000000FF
  13306.  
  13307.  1.                     16777216               0x01000000
  13308.  
  13309.  1.2.3.4                16909060               0x01020304
  13310.  
  13311.  0x01.0X2.03.004        16909060               0x01020304
  13312.  
  13313.  1.2. 3.4               16777218               0x01000002
  13314.  
  13315.  9999.1.1.1             251724033              0x0F010101
  13316.  
  13317. The following examples show invalid input strings and the reasons they are not 
  13318. valid: 
  13319.  
  13320. Examples of Invalid Strings 
  13321.  
  13322.  
  13323.  Input string     Reason string is not valid
  13324.  
  13325.  1.2.3.4.5        Excessive fields.
  13326.  
  13327.  1.2.3.4.         Excessive delimiters (and therefore fields).
  13328.  
  13329.  1,2              Bad delimiter.
  13330.  
  13331.  1p               String not terminated by null terminator nor
  13332.                   space.
  13333.  
  13334.  {empty string}   No field or delimiter present.
  13335.  
  13336. Typically, the value of each octet of an internet address cannot exceed 246. 
  13337. The inet_network() call can accept larger values, but it uses only the eight 
  13338. least significant bits for each field value. For example, if an application 
  13339. passes 0x1234567890.0xabcdef, the inet_network() call returns 37103 
  13340. (0x000090EF). 
  13341.  
  13342. The application must verify that the network ID and host ID for the internet 
  13343. address conform to class A, class B, or class C. The inet_makeaddr() call 
  13344. processes any nonconforming class of address as a class C address. 
  13345.  
  13346. The inet_network() call does not check the pointer to the ASCII input string. 
  13347. The application must verify the validity of the address of the string. 
  13348.  
  13349. Return Values 
  13350.  
  13351. The network number is returned in host-byte order. The return value points to 
  13352. static data that subsequent API calls can modify. 
  13353.  
  13354. For valid input strings, the inet_network() call returns an unsigned long value 
  13355. that comprises the bit patterns of the input fields concatenated together. The 
  13356. inet_network() call places the first pattern in the leftmost (most significant) 
  13357. position and appends subsequent patterns if they exist. 
  13358.  
  13359. For invalid input strings, the inet_network() call returns a value of -1. 
  13360.  
  13361. Related Calls 
  13362.  
  13363.      endhostent() 
  13364.      endnetent() 
  13365.      gethostbyaddr() 
  13366.      gethostbyname() 
  13367.      getnetbyaddr() 
  13368.      getnetbyname() 
  13369.      getnetent() 
  13370.      inet_addr() 
  13371.      inet_netof() 
  13372.      inet_makeaddr() 
  13373.      inet_netof() 
  13374.      inet_ntoa() 
  13375.      sethostent() 
  13376.      setnetent() 
  13377.  
  13378.  
  13379. ΓòÉΓòÉΓòÉ 14.33. inet_ntoa() ΓòÉΓòÉΓòÉ
  13380.  
  13381. The inet_ntoa() call returns a pointer to a string in dotted-decimal notation. 
  13382.  
  13383. Syntax 
  13384.  
  13385. #include <types.h>
  13386. #include <arpa\inet.h>
  13387. char *inet_ntoa(in)
  13388. struct in_addr in;
  13389.  
  13390. Parameters 
  13391.  
  13392. in 
  13393.   Host internet address. 
  13394.  
  13395. Description 
  13396.  
  13397. This call returns a pointer to a string expressed in the dotted-decimal 
  13398. notation. The inet_ntoa() call accepts an internet address expressed as a 
  13399. 32-bit quantity in network-byte order and returns a string expressed in 
  13400. dotted-decimal notation. All internet addresses are returned in network order, 
  13401. with the first byte being the high-order byte. 
  13402.  
  13403. Use C-language integers when specifying each part of a dotted-decimal notation. 
  13404.  
  13405. Return Values 
  13406.  
  13407. Returns a pointer to the internet address expressed in dotted-decimal notation. 
  13408. The return value points to static data that subsequent API calls can modify. 
  13409.  
  13410. If the inet_ntoa() call is unsuccessful, the call returns a value of -1. 
  13411.  
  13412. Related Calls 
  13413.  
  13414.      endhostent() 
  13415.      endnetent() 
  13416.      gethostbyaddr() 
  13417.      gethostbyname() 
  13418.      getnetbyaddr() 
  13419.      getnetbyname() 
  13420.      getnetent() 
  13421.      inet_addr() 
  13422.      inet_netof() 
  13423.      inet_makeaddr() 
  13424.      inet_network() 
  13425.      sethostent() 
  13426.      setnetent() 
  13427.  
  13428.  
  13429. ΓòÉΓòÉΓòÉ 14.34. ntohl() ΓòÉΓòÉΓòÉ
  13430.  
  13431. The ntohl() call translates a long integer from network-byte order to host-byte 
  13432. order. 
  13433.  
  13434. Syntax 
  13435.  
  13436. #include <types.h>
  13437. u_long ntohl(a)
  13438. u_long a;
  13439.  
  13440. Parameters 
  13441.  
  13442.   Unsigned long integer to be put into host-byte order. 
  13443.  
  13444. Description 
  13445.  
  13446. This call translates a long integer from network-byte order to host-byte order. 
  13447. Receiving hosts require addresses and ports in host-byte order.  Use the 
  13448. ntohl() call to convert internet addresses to the host integer representation. 
  13449.  
  13450. Return Values 
  13451.  
  13452. Returns the translated long integer. 
  13453.  
  13454. Related Calls 
  13455.  
  13456.      endhostent() 
  13457.      endservent() 
  13458.      gethostbyaddr() 
  13459.      gethostbyname() 
  13460.      getservbyname() 
  13461.      getservbyport() 
  13462.      getservent() 
  13463.      htonl() 
  13464.      htons() 
  13465.      ntohs() 
  13466.      sethostent() 
  13467.      setservent() 
  13468.  
  13469.  
  13470. ΓòÉΓòÉΓòÉ 14.35. ntohs() ΓòÉΓòÉΓòÉ
  13471.  
  13472. The ntohs() call translates a short integer from network-byte order to 
  13473. host-byte order. 
  13474.  
  13475. Syntax 
  13476.  
  13477. #include <types.h>
  13478. u_short ntohs(a)
  13479. u_short a;
  13480.  
  13481. Parameters 
  13482.  
  13483.   Unsigned short integer to be put into host-byte order. 
  13484.  
  13485. Description 
  13486.  
  13487. This call translates a short integer from network-byte order to host-byte 
  13488. order. Receiving hosts require addresses and ports in host-byte order.  Use the 
  13489. ntohs() call to convert ports to the host integer representation. 
  13490.  
  13491. Return Values 
  13492.  
  13493. The ntohs() call returns the translated short integer. 
  13494.  
  13495. Related Calls 
  13496.  
  13497.      endhostent() 
  13498.      endservent() 
  13499.      gethostbyaddr() 
  13500.      gethostbyname() 
  13501.      getservbyname() 
  13502.      getservbyport() 
  13503.      getservent() 
  13504.      htonl() 
  13505.      htons() 
  13506.      ntohl() 
  13507.      sethostent() 
  13508.      setservent() 
  13509.  
  13510.  
  13511. ΓòÉΓòÉΓòÉ 14.36. putlong() ΓòÉΓòÉΓòÉ
  13512.  
  13513. The putlong() call places long byte quantities into the byte stream. 
  13514.  
  13515. Syntax 
  13516.  
  13517. #include <sys\types.h>
  13518. #include <netinet\in.h>
  13519. #include <arpa\nameser.h>
  13520. #include <resolv.h>
  13521. void putlong(l, msgp)
  13522. u_long l;
  13523. u_char *msgp;
  13524.  
  13525. Parameters 
  13526.  
  13527.   Represents a 32-bit integer. 
  13528.  
  13529. msgp 
  13530.   Represents a pointer into the byte stream. 
  13531.  
  13532. Description 
  13533.  
  13534. The putlong() call places long byte quantities into the byte stream or 
  13535. arbitrary byte boundaries. 
  13536.  
  13537. The putlong() call is one of a group of calls that form the resolver, a set of 
  13538. functions that resolve domain names. Global information used by the resolver 
  13539. calls is kept in the _res data structure. The <RESOLV.H> file contains the _res 
  13540. structure definition. (See The _res Data Structure for more information.) 
  13541.  
  13542. Related Calls 
  13543.  
  13544.      dn_comp() 
  13545.      dn_expand() 
  13546.      dn_find() 
  13547.      dn_skipname() 
  13548.      _getlong() 
  13549.      _getshort() 
  13550.      putshort() 
  13551.      res_init() 
  13552.      res_mkquery() 
  13553.      res_query() 
  13554.      res_search() 
  13555.      res_send() 
  13556.  
  13557.  
  13558. ΓòÉΓòÉΓòÉ 14.37. putshort() ΓòÉΓòÉΓòÉ
  13559.  
  13560. The putshort() call places short byte quantities into the byte stream. 
  13561.  
  13562. Syntax 
  13563.  
  13564. #include <sys\types.h>
  13565. #include <netinet\in.h>
  13566. #include <arpa\nameser.h>
  13567. #include <resolv.h>
  13568. void putshort (s, msgp)
  13569. u_short s;
  13570. u_char *msgp;
  13571.  
  13572. Parameters 
  13573.  
  13574.   Represents a 16-bit integer. 
  13575.  
  13576. msgp 
  13577.   Represents a pointer into the byte stream. 
  13578.  
  13579. Description 
  13580.  
  13581. The putshort() call puts short byte quantities into the byte stream or 
  13582. arbitrary byte boundaries. 
  13583.  
  13584. The putshort() call is one of a group of calls that form the resolver, a set of 
  13585. functions that resolve domain names. Global information used by the resolver 
  13586. calls is kept in the _res data structure. The <RESOLV.H> file contains the _res 
  13587. structure definition. (See The _res Data Structure for more on the _res data 
  13588. structure.) 
  13589.  
  13590. Related Calls 
  13591.  
  13592.      dn_comp() 
  13593.      dn_expand() 
  13594.      dn_find() 
  13595.      dn_skipname() 
  13596.      _getlong() 
  13597.      _getshort() 
  13598.      putlong() 
  13599.      res_init() 
  13600.      res_mkquery() 
  13601.      res_query() 
  13602.      res_send() 
  13603.  
  13604.  
  13605. ΓòÉΓòÉΓòÉ 14.38. Raccept() ΓòÉΓòÉΓòÉ
  13606.  
  13607. The Raccept() socket call accepts a connection request from a SOCKS server. 
  13608.  
  13609. Syntax 
  13610.  
  13611. #include <types.h>
  13612. #include <sys\socket.h>
  13613. #include <netinet\in.h>
  13614. int Raccept(s, name, namelen)
  13615. int s;
  13616. sockaddr *name;
  13617. int *namelen;
  13618.  
  13619. Parameters 
  13620.  
  13621.   Socket descriptor. 
  13622.  
  13623. name 
  13624.   Pointer to a sockaddr structure that contains the socket address of the 
  13625.   connection client when the Raccept() call returns. The format of name is 
  13626.   determined by the communications domain where the client resides. This 
  13627.   parameter can be NULL if the caller is not interested in the client address. 
  13628.  
  13629. namelen 
  13630.   Must initially point to an integer that contains the size in bytes of the 
  13631.   storage pointed to by name.  On return, that integer contains the size of the 
  13632.   data returned in the storage pointed to by name. If name is NULL, namelen is 
  13633.   ignored and can be NULL. 
  13634.  
  13635. Description 
  13636.  
  13637. This call is used to accept the first pending connection on the socket. If the 
  13638. socket was bound through a SOCKS server using Rbind(), it will block until the 
  13639. SOCKS server accepts a connection on its behalf. If the socket was not bound 
  13640. through a SOCKS server, this call is equivalent to accept(). 
  13641.  
  13642. Return Values 
  13643.  
  13644. A non-negative socket descriptor indicates success; the value -1 indicates an 
  13645. error. You can get the specific error code by calling sock_errno() or 
  13646. psock_errno(). 
  13647.  
  13648. Error Code             Description
  13649.  
  13650. SOCENOTSOCK            The s parameter is not a valid socket descriptor. 
  13651.  
  13652. SOCEFAULT              Using name and namelen would result in an attempt to 
  13653.                        copy the address into a portion of the caller address 
  13654.                        space into which information cannot be written. 
  13655.  
  13656. SOCEINTR               Interrupted system call. 
  13657.  
  13658. SOCEINVAL              Listen() was not called for socket s. 
  13659.  
  13660. SOCENOBUFS             Insufficient buffer space available to create the new 
  13661.                        socket. 
  13662.  
  13663. SOCEOPNOTSUPP          The s parameter is not connection-oriented. 
  13664.  
  13665. SOCEWOULDBLOCK         The s parameter is in nonblocking mode and no 
  13666.                        connections are on the queue. 
  13667.  
  13668. SOCECONNABORTED        The software caused a connection close. 
  13669.  
  13670. Related Calls 
  13671.  
  13672.      accept() 
  13673.      connect() 
  13674.      Rbind() 
  13675.      Rconnect() 
  13676.      Rgetsockname() 
  13677.      Rlisten() 
  13678.      sock_errno() 
  13679.      socket() 
  13680.  
  13681.  
  13682. ΓòÉΓòÉΓòÉ 14.39. Rbind() ΓòÉΓòÉΓòÉ
  13683.  
  13684. The Rbind() call binds a local name to the socket. 
  13685.  
  13686. Syntax 
  13687.  
  13688. #include <types.h>
  13689. #include <sys\socket.h>
  13690. int Rbind(s, name, namelen remoteaddr)
  13691. int s;
  13692. struct sockaddr *name;
  13693. int namelen;
  13694. struct sockaddr *remoteaddr;
  13695.  
  13696. Parameters 
  13697.  
  13698.   Socket descriptor returned by a previous call to socket(). 
  13699.  
  13700. name 
  13701.   Pointer to a sockaddr structure containing the name that is to be bound to s. 
  13702.  
  13703. namelen 
  13704.   Size in bytes of the sockaddr structure pointed to by name. 
  13705.  
  13706. remoteaddr 
  13707.   Pointer to a sockaddr structure containing the address of the remote host 
  13708.   from which the connection is expected to be established. 
  13709.  
  13710. Description 
  13711.  
  13712. This call checks remoteaddr to see if it is reachable via a direct connection, 
  13713. or whether a connection through a SOCKS server is required. If the former, then 
  13714. this call is equivalent to a bind (s, name, namelen). If the latter, then a 
  13715. connection to the SOCKS server is established and a bind request is sent. 
  13716. Rgetsockname() may be called to retrieve the IP address and port number the 
  13717. SOCKS server assigned. 
  13718.  
  13719. Related Calls 
  13720.  
  13721.      bind() 
  13722.      htons() 
  13723.      inet_addr() 
  13724.      Rconnect() 
  13725.      Rgethostbyname() 
  13726.      Rgetsockname() 
  13727.      Rlisten() 
  13728.      sock_errno() 
  13729.      socket() 
  13730.  
  13731.  
  13732. ΓòÉΓòÉΓòÉ 14.40. Rconnect() ΓòÉΓòÉΓòÉ
  13733.  
  13734. The Rconnect() socket call requests a connection to a remote host. The request 
  13735. goes directly to a SOCKS server. 
  13736.  
  13737. Syntax 
  13738.  
  13739. #include <types.h>
  13740. #include <sys\socket.h>
  13741. int Rconnect(s, name, namelen)
  13742.  
  13743. Description 
  13744.  
  13745. See the "Description" section in connect() for additional information about 
  13746. connecting. (This description information also applies to the Rconnect() call). 
  13747.  
  13748. Related Calls 
  13749.  
  13750.      connect() 
  13751.      Raccept() 
  13752.      Rbind() 
  13753.      Rgetsockname() 
  13754.      send() 
  13755.      socket() 
  13756.  
  13757.  
  13758. ΓòÉΓòÉΓòÉ 14.41. res_init() ΓòÉΓòÉΓòÉ
  13759.  
  13760. The res_init() call initializes the default domain name. 
  13761.  
  13762. Syntax 
  13763.  
  13764. #include <types.h>
  13765. #include <netinet\in.h>
  13766. #include <arpa\nameser.h>
  13767. #include <resolv.h>
  13768. void res_init()
  13769.  
  13770. Description 
  13771.  
  13772. This call reads the ETC\RESOLV and ETC\RESOLV2 files for the domain name 
  13773. information and for the IP addresses of the initial hosts running the name 
  13774. server. If none of these files exist, name resolution will use the ETC\HOSTS 
  13775. file. One of these files should be operational. 
  13776.  
  13777. Note:  If the ETC\RESOLV files do not exist, the res_init() call attempts name 
  13778.        resolution using the local ETC\HOSTS file. If the system is not using a 
  13779.        domain name server, the ETC\RESOLV file should not exist. The ETC\HOSTS 
  13780.        file should be present on the system even if the system is using a name 
  13781.        server. In this instance, the file should contain the host IDs that the 
  13782.        system requires to function even if the name server is not functioning. 
  13783.  
  13784. The res_init() call is one of a group of calls that form the resolver. The 
  13785. resolver is a set of functions that perform a translation between domain names 
  13786. and network addresses. Global information used by the resolver calls resides in 
  13787. the _res data structure. The <RESOLV.H> file contains the _res data structure 
  13788. definition. (See The _res Data Structure for more on the _res data structure.) 
  13789.  
  13790. Related Calls 
  13791.  
  13792.      dn_comp() 
  13793.      dn_expand() 
  13794.      dn_find() 
  13795.      dn_skipname() 
  13796.      _getlong() 
  13797.      _getshort() 
  13798.      putlong() 
  13799.      putshort() 
  13800.      res_mkquery() 
  13801.      res_query() 
  13802.      res_search() 
  13803.      res_send() 
  13804.  
  13805.  
  13806. ΓòÉΓòÉΓòÉ 14.42. res_mkquery() ΓòÉΓòÉΓòÉ
  13807.  
  13808. The res_mkquery() call makes a query message for the name servers in the 
  13809. internet domain. 
  13810.  
  13811. Syntax 
  13812.  
  13813. #include <types.h>
  13814. #include <netinet\in.h>
  13815. #include <arpa\nameser.h>
  13816. #include <resolv.h>
  13817. int res_mkquery(op, dname, class, type, data, datalen, newrr,
  13818.             buf, buflen)
  13819. int op;
  13820. char *dname;
  13821. int class;
  13822. int type;
  13823. char *data;
  13824. int datalen;
  13825. struct rrec *newrr;
  13826. char *buf;
  13827. int buflen;
  13828.  
  13829. Parameters 
  13830.  
  13831. op 
  13832.   The usual type is QUERY, but you can set the parameter to any query type 
  13833.   defined in the <ARPA\NAMESER.H> header file. 
  13834.  
  13835. dname 
  13836.   Pointer to the domain name. If dname points to a single label and the 
  13837.   RES_DEFNAMES bit in the _res data structure (see The _res Data Structure) 
  13838.   defined in the <RESOLV.H> header file is set, the call appends dname to the 
  13839.   current domain name. The current domain name is defined in the ETC\RESOLV 
  13840.   file. 
  13841.  
  13842. class 
  13843.   One of the following values: 
  13844.  
  13845.   C_IN               ARPA Internet 
  13846.   C_CHAOS            Chaos network at MIT 
  13847.  
  13848. type 
  13849.   One of the following type values for resources and queries: 
  13850.  
  13851.   T_A            Host address 
  13852.   T_NS           Authoritative server 
  13853.   T_MD           Mail destination 
  13854.   T_MF           Mail forwarder 
  13855.   T_CNAME        Canonical name 
  13856.   T_SOA          Start of authority zone 
  13857.   T_MB           Mailbox domain name 
  13858.   T_MG           Mail group member 
  13859.   T_MR           Mail rename name 
  13860.   T_NULL         Null resource record 
  13861.   T_WKS          Well-known service 
  13862.   T_PTR          Domain name pointer 
  13863.   T_HINFO        Host information 
  13864.   T_MINFO        Mailbox information 
  13865.   T_MX           Mail routing information 
  13866.   T_UINFO        User information 
  13867.   T_UID          User ID 
  13868.   T_GID          Group ID 
  13869.  
  13870. data 
  13871.   Pointer to the data sent to the name server as a search key. 
  13872.  
  13873. datalen 
  13874.   Size of the data parameter in bytes. 
  13875.  
  13876. newrr 
  13877.   Reserved. Unused parameter. 
  13878.  
  13879. buf 
  13880.   Pointer to the query message. 
  13881.  
  13882. buflen 
  13883.   Length of the buffer in bytes pointed to by the buf parameter. 
  13884.  
  13885. Description 
  13886.  
  13887. This call creates packets for name servers in the internet domain. The call 
  13888. makes a query message for the name servers and puts that query message in the 
  13889. location pointed to by the buf parameter. 
  13890.  
  13891. The res_mkquery() call is one of a group of calls that form the resolver. The 
  13892. resolver is a set of functions that perform a translation between domain names 
  13893. and network addresses. Global information used by the resolver calls resides in 
  13894. the _res data structure. The <RESOLV.H> file contains the _res data structure 
  13895. definition. (See The _res Data Structure for more on the _res data structure.) 
  13896.  
  13897. Return Values 
  13898.  
  13899. When successful, the res_mkquery() call returns the size of the query. When the 
  13900. query is larger than the value of buflen, the call fails and returns a value of 
  13901. -1. 
  13902.  
  13903. Related Calls 
  13904.  
  13905.      dn_comp() 
  13906.      dn_expand() 
  13907.      dn_find() 
  13908.      dn_skipname() 
  13909.      _getlong() 
  13910.      _getshort() 
  13911.      putlong() 
  13912.      putshort() 
  13913.      res_init() 
  13914.      res_query() 
  13915.      res_search() 
  13916.      res_send() 
  13917.  
  13918.  
  13919. ΓòÉΓòÉΓòÉ 14.43. res_query() ΓòÉΓòÉΓòÉ
  13920.  
  13921. The res_query() call provides an interface to the server query mechanism. 
  13922.  
  13923. Syntax 
  13924.  
  13925. #include <sys\types.h>
  13926. #include <netinet\in.h>
  13927. #include <arpa\nameser.h>
  13928. #include <resolv.h>
  13929. int res_query(name, class, type, answer, anslen)
  13930. char *name;
  13931. int class;
  13932. int type;
  13933. u_char *answer;
  13934. int anslen;
  13935.  
  13936. Parameters 
  13937.  
  13938. name 
  13939.   Points to the name of the domain. If the name parameter points to a 
  13940.   single-component name and the RES_DEFNAMES structure is set, as it is by 
  13941.   default, the call appends the default domain name to the single-component 
  13942.   name. The current domain name is defined by the name server in use or is 
  13943.   specified in the ETC\RESOLV file. 
  13944.  
  13945. class 
  13946.   Specifies one of the following values: 
  13947.  
  13948.   C_IN             Specifies the ARPA Internet 
  13949.   C_CHAOS          Specifies the Chaos network at MIT 
  13950.  
  13951. type 
  13952.   Requires one of the following values: 
  13953.  
  13954.   T_A              Host address 
  13955.   T_NS             Authoritative server 
  13956.   T_MD             Mail destination 
  13957.   T_MF             Mail forwarder 
  13958.   T_CNAME          Canonical name 
  13959.   T_SOA            Start-of-authority zone 
  13960.   T_MB             Mailbox-domain name 
  13961.   T_MG             Mail-group member 
  13962.   T_MR             Mail-rename name 
  13963.   T_NULL           Null resource record 
  13964.   T_WKS            Well-known service 
  13965.   T_PTR            Domain name pointer 
  13966.   T_HINFO          Host information 
  13967.   T_MINFO          Mailbox information 
  13968.   T_MX             Mail-routing information 
  13969.   T_UINFO          User (finger command) information 
  13970.   T_UID            User ID 
  13971.   T_GID            Group ID 
  13972.  
  13973. answer 
  13974.   Points to an address where the response is stored. 
  13975.  
  13976. anslen 
  13977.   Specifies the size of the answer buffer. 
  13978.  
  13979. Description 
  13980.  
  13981. The res_query() call provides an interface to the server query mechanism. It 
  13982. constructs a query, sends it to the local server, awaits a response, and makes 
  13983. preliminary checks on the reply. The query requests information of the 
  13984. specified type and class for the fully-qualified domain name specified in the 
  13985. name parameter. The reply message is left in the answer buffer whose size is 
  13986. specified by the anslen parameter, which is supplied by the caller. 
  13987.  
  13988. The caller must parse answer and determine whether it answers the question. 
  13989.  
  13990. The res_query() call is one of a group of calls that form the resolver, a set 
  13991. of functions that resolve domain names. The _res data structure contains global 
  13992. information used by the resolver calls. The <RESOLV.H> file contains the _res 
  13993. structure definition. (See The _res Data Structure for more on the _res data 
  13994. structure.) 
  13995.  
  13996. Return Values 
  13997.  
  13998. When successful, the res_query() call returns the size of the response. When 
  13999. unsuccessful, the res_query() call returns a value of -1 and sets the h_errno 
  14000. value to the appropriate error. 
  14001.  
  14002. Related Calls 
  14003.  
  14004.      dn_comp() 
  14005.      dn_expand() 
  14006.      dn_find() 
  14007.      dn_skipname() 
  14008.      _getlong() 
  14009.      _getshort() 
  14010.      putlong() 
  14011.      putshort() 
  14012.      res_init() 
  14013.      res_mkquery() 
  14014.      res_search() 
  14015.      res_send() 
  14016.  
  14017.  
  14018. ΓòÉΓòÉΓòÉ 14.44. res_querydomain() ΓòÉΓòÉΓòÉ
  14019.  
  14020. The res_querydomain() call queries the concatenation of name and domain. 
  14021.  
  14022. Syntax 
  14023.  
  14024. #include <sys\types.h>
  14025. #include <netinet\in.h>
  14026. #include <arpa\nameser.h>
  14027. #include <resolv.h>
  14028. int res_querydomain(name, domain class, type, answer, anslen)
  14029. char *name;
  14030. char *domain;
  14031. int class;
  14032. int type;
  14033. u_char *answer;
  14034. int anslen;
  14035.  
  14036. Parameters 
  14037.  
  14038. domain 
  14039.   Domain name. 
  14040.  
  14041. name 
  14042.   Host name. 
  14043.  
  14044. class 
  14045.   Specifies one of the following values: 
  14046.  
  14047.   C_IN             Specifies the ARPA Internet. 
  14048.   C_CHAOS          Specifies the Chaos network at MIT. 
  14049.  
  14050. type 
  14051.   Requires one of the following values: 
  14052.  
  14053.   T_A              Host address 
  14054.   T_NS             Authoritative server 
  14055.   T_MD             Mail destination 
  14056.   T_MF             Mail forwarder 
  14057.   T_CNAME          Canonical name 
  14058.   T_SOA            Start-of-authority zone 
  14059.   T_MB             Mailbox-domain name 
  14060.   T_MG             Mail-group member 
  14061.   T_MR             Mail-rename name 
  14062.   T_NULL           Null resource record 
  14063.   T_WKS            Well-known service 
  14064.   T_PTR            Domain name pointer 
  14065.   T_HINFO          Host information 
  14066.   T_MINFO          Mailbox information 
  14067.   T_MX             Mail-routing information 
  14068.   T_UINFO          User (finger command) information 
  14069.   T_UID            User ID 
  14070.   T_GID            Group ID 
  14071.  
  14072. answer 
  14073.   Points to an address where the response is stored. 
  14074.  
  14075. anslen 
  14076.   Specifies the size of the answer buffer. 
  14077.  
  14078. Description 
  14079.  
  14080. The res_querydomain() call concatenates name and domain, removing a trailing 
  14081. dot from name if domain is null. The res_querydomain() call then calls 
  14082. res_query() to build and perform the query. 
  14083.  
  14084. Return Values 
  14085.  
  14086. The value 0 indicates success; the value -1 indicates an error. The h_errno() 
  14087. value is set to the appropriate error code. 
  14088.  
  14089. Related Calls 
  14090.  
  14091.      dn_comp() 
  14092.      dn_expand() 
  14093.      dn_find() 
  14094.      dn_skipname() 
  14095.      _getlong() 
  14096.      _getshort() 
  14097.      putlong() 
  14098.      putshort() 
  14099.      res_init() 
  14100.      res_mkquery() 
  14101.      res_search() 
  14102.      res_send() 
  14103.  
  14104.  
  14105. ΓòÉΓòÉΓòÉ 14.45. res_search() ΓòÉΓòÉΓòÉ
  14106.  
  14107. The res_search() call makes a query and awaits a response. 
  14108.  
  14109. Syntax 
  14110.  
  14111. #include <sys\types.h>
  14112. #include <netinet\in.h>
  14113. #include <arpa\nameser.h>
  14114. #include <resolv.h>
  14115. int res_search(name, class, type, answer, anslen)
  14116. char *name;
  14117. int class;
  14118. int type;
  14119. u_char *answer;
  14120. int anslen;
  14121.  
  14122. Parameters 
  14123.  
  14124. name 
  14125.   Points to the name of the domain. If the name parameter points to a 
  14126.   single-component name and the RES_DEFNAMES structure is set, as it is by 
  14127.   default, the call appends the default domain name to the single-component 
  14128.   name. The current domain name is defined by the name server in use or is 
  14129.   specified in the ETC\RESOLV file. 
  14130.  
  14131.   If the RES_DNSRCH bit is set, as it is by default, the res_search() call 
  14132.   searches for host names in both the current domain and in parent domains. 
  14133.  
  14134. class 
  14135.   Specifies one of the following values: 
  14136.  
  14137.   C_IN             Specifies the ARPA Internet. 
  14138.   C_CHAOS          Specifies the Chaos network at MIT. 
  14139.  
  14140. type 
  14141.   Requires one of the following values: 
  14142.  
  14143.   T_A              Host address 
  14144.   T_NS             Authoritative server 
  14145.   T_MD             Mail destination 
  14146.   T_MF             Mail forwarder 
  14147.   T_CNAME          Canonical name 
  14148.   T_SOA            Start-of-authority zone 
  14149.   T_MB             Mailbox-domain name 
  14150.   T_MG             Mail-group member 
  14151.   T_MR             Mail-rename name 
  14152.   T_NULL           Null resource record 
  14153.   T_WKS            Well-known service 
  14154.   T_PTR            Domain name pointer 
  14155.   T_HINFO          Host information 
  14156.   T_MINFO          Mailbox information 
  14157.   T_MX             Mail-routing information 
  14158.   T_UINFO          User (finger command) information 
  14159.   T_UID            User ID 
  14160.   T_GID            Group ID 
  14161.  
  14162. answer 
  14163.   Points to an address where the response is stored. 
  14164.  
  14165. anslen 
  14166.   Specifies the size of the answer buffer. 
  14167.  
  14168. Description 
  14169.  
  14170. The res_search() call makes a query and awaits a response, like the res_query() 
  14171. call. However, it also implements the default and search rules controlled by 
  14172. the RES_DEFNAMES and RES_DNSRCH options. 
  14173.  
  14174. Note:  This call is only useful for queries in the same name hierarchy as the 
  14175.        local host. 
  14176.  
  14177. The res_search() call is one of a group of calls that form the resolver, a set 
  14178. of functions that resolve domain names. The _res data structure contains global 
  14179. information used by the resolver calls. The <RESOLV.H> file contains the _res 
  14180. structure definition. (See The _res Data Structure for more on the _res data 
  14181. structure.) 
  14182.  
  14183. Return Values 
  14184.  
  14185. When successful, the res_search() call returns the size of the response. When 
  14186. unsuccessful, the res_search() call returns a value of -1 and sets the h_errno 
  14187. value to the appropriate error. 
  14188.  
  14189. Related Calls 
  14190.  
  14191.      dn_comp() 
  14192.      dn_expand() 
  14193.      dn_find() 
  14194.      dn_skipname() 
  14195.      _getlong() 
  14196.      _getshort() 
  14197.      putlong() 
  14198.      putshort() 
  14199.      res_init() 
  14200.      res_mkquery() 
  14201.      res_query() 
  14202.      res_send() 
  14203.  
  14204.  
  14205. ΓòÉΓòÉΓòÉ 14.46. res_send() ΓòÉΓòÉΓòÉ
  14206.  
  14207. The res_send() call sends a query to a local name server. 
  14208.  
  14209. Syntax 
  14210.  
  14211. #include <types.h>
  14212. #include <netinet\in.h>
  14213. #include <arpa\nameser.h>
  14214. #include <resolv.h>
  14215. int res_send(msg, msglen, ans, anslen)
  14216. char *msg;
  14217. int msglen;
  14218. char *ans;
  14219. int anslen;
  14220.  
  14221. Parameters 
  14222.  
  14223. msg 
  14224.   Pointer to the beginning of a message. 
  14225.  
  14226. msglen 
  14227.   Length of the buffer in bytes pointed to by the msg parameter. 
  14228.  
  14229. ans 
  14230.   Pointer to the location where the received response is stored. 
  14231.  
  14232. anslen 
  14233.   Length of the buffer in bytes pointed by the ans parameter. 
  14234.  
  14235. Description 
  14236.  
  14237. This call sends a query to the local name server and calls the res_init() call 
  14238. if the RES_INIT option of the global _res structure is not set. It also handles 
  14239. timeouts and retries. 
  14240.  
  14241. The res_send() call is one of a set of calls that form the resolver. The 
  14242. resolver is a group of functions that perform a translation between domain 
  14243. names and network addresses. Global information used by the resolver calls 
  14244. resides in the _res data structure. The <RESOLV.H> file contains the _res data 
  14245. structure definition. (See The _res Data Structure for more on the _res data 
  14246. structure.) 
  14247.  
  14248. Return Values 
  14249.  
  14250. When successful, the call returns the length of the message. When unsuccessful, 
  14251. the call returns a value of -1. 
  14252.  
  14253. Related Calls 
  14254.  
  14255.      dn_comp() 
  14256.      dn_expand() 
  14257.      dn_find() 
  14258.      dn_skipname() 
  14259.      _getlong() 
  14260.      _getshort() 
  14261.      putlong() 
  14262.      putshort() 
  14263.      res_init() 
  14264.      res_mkquery() 
  14265.      res_query() 
  14266.      res_search() 
  14267.  
  14268.  
  14269. ΓòÉΓòÉΓòÉ 14.47. rexec() ΓòÉΓòÉΓòÉ
  14270.  
  14271. The rexec() call allows command processing on a remote host. 
  14272.  
  14273. Syntax 
  14274.  
  14275. #include <utils.h>
  14276. int rexec(host, port, user, passwd, cmd, err_sd2p)
  14277. char **host;
  14278. int port;
  14279. char *user, *passwd, *cmd;
  14280. int *err_sd2p;
  14281.  
  14282. Parameters 
  14283.  
  14284. host 
  14285.   Contains the name of a remote host that is listed in the ETC\HOSTS file or 
  14286.   ETC\RESOLV file. If the name of the host is not found in either file, the 
  14287.   rexec() call is unsuccessful. 
  14288.  
  14289. port 
  14290.   Specifies the well-known internet port to use for the connection. A pointer 
  14291.   to the structure that contains the necessary port can be obtained by issuing 
  14292.   the following library call: 
  14293.  
  14294.     getservbyname("exec","tcp")
  14295.  
  14296.   When directly specifying an integer for the port, specify it in Network Byte 
  14297.   order, obtainable by using the htons() function call. 
  14298.  
  14299. user 
  14300.   Points to a user ID valid at the remote host. 
  14301.  
  14302. passwd 
  14303.   Points to a password valid at the remote host. 
  14304.  
  14305. cmd 
  14306.   Points to the name of the command to be processed at the remote host. 
  14307.  
  14308. err_sd2p 
  14309.   Points to an error socket descriptor. An auxiliary channel to a control 
  14310.   process is set up, and a descriptor for it is placed in the err_sd2p 
  14311.   parameter. The control process provides diagnostic output from the remote 
  14312.   command on this channel. This diagnostic information does not include remote 
  14313.   authorization failure, since this connection is set up after authorization 
  14314.   has been verified. 
  14315.  
  14316. Description 
  14317.  
  14318. The rexec() call allows the calling process to start commands on a remote host. 
  14319.  
  14320. If the rexec() connection succeeds, a socket in the internet domain of type 
  14321. SOCK_STREAM is returned to the calling process and is given to the remote 
  14322. command as standard input and standard output. 
  14323.  
  14324. Return Values 
  14325.  
  14326. When successful, the call returns a socket to the remote command. 
  14327.  
  14328. When unsuccessful, the call returns a value of -1, indicating that the 
  14329. specified host name does not exist. 
  14330.  
  14331. Examples 
  14332.  
  14333. int normsock;
  14334. char *host = NULL, *luser = NULL, *password = NULL, *cmd;
  14335. struct servent *sp;
  14336. sp = getservbyname("exec", "tcp");
  14337.  
  14338. host = "remote _host";
  14339. luser = "my _userid";
  14340. password = "my _password";
  14341. cmd = "rempte_host_cmd";
  14342.  
  14343. normsock = rexec(&host, sp->s_port, luser,password, cmd, &errsock);
  14344. if (normsock == -1)
  14345.        exit(-1);
  14346.  
  14347. Related Calls 
  14348.  
  14349.      getservbyname() 
  14350.  
  14351.  
  14352. ΓòÉΓòÉΓòÉ 14.48. Rgethostbyname() ΓòÉΓòÉΓòÉ
  14353.  
  14354. The Rgethostbyname() call returns a pointer to information about a host 
  14355. specified by a host name. The request goes directly to a SOCKS server, sockd. 
  14356.  
  14357. Syntax 
  14358.  
  14359. #include <netdb.h>
  14360. struct hostent *Rgethostbyname(name)
  14361. char *name;
  14362.  
  14363. See the "Description" section in gethostbyname() for additional information 
  14364. about this topic. (This description information also applies to the 
  14365. Rgethostbyname() call.) 
  14366.  
  14367. Related Calls 
  14368.  
  14369.      endhostent() 
  14370.      gethostbyaddr() 
  14371.      gethostent() 
  14372.      inet_addr() 
  14373.      sethostent() 
  14374.  
  14375.  
  14376. ΓòÉΓòÉΓòÉ 14.49. Rgetsockname() ΓòÉΓòÉΓòÉ
  14377.  
  14378. Rgetsockname() gets the socket name from the SOCKS server. 
  14379.  
  14380. Syntax 
  14381.  
  14382. #include <types.h>
  14383. #include <sys\socket.h>
  14384. int Rgetsockname(s, name, namelen)
  14385. int s;
  14386. struct sockaddr *name;
  14387. int *namelen;
  14388.  
  14389. Parameters 
  14390.  
  14391.   Socket descriptor. 
  14392.  
  14393. name 
  14394.   Pointer to a sockaddr structure. The name of s is returned. 
  14395.  
  14396. namelen 
  14397.   Pointer to the size in bytes of the buffer pointed to by name. 
  14398.  
  14399. Description 
  14400.  
  14401. This call returns the name the SOCKS server bound to the socket after a 
  14402. successful call to Rbind() or connect(). If the socket is not connected through 
  14403. a SOCKS server, this call is equivalent to getsockname(). 
  14404.  
  14405. Return Values 
  14406.  
  14407. The value 0 indicates success; the value -1 indicates an error. You can get the 
  14408. specific error code by calling sock_errno() or psock_errno(). 
  14409.  
  14410. Error Code        Description
  14411.  
  14412. SOCENOTSOCK       The s parameter is not a valid socket descriptor. 
  14413.  
  14414. SOCEFAULT         Using the name and namelen parameters as specified would 
  14415.                   result in an attempt to access storage outside of the address 
  14416.                   space of the caller. 
  14417.  
  14418. SOCENOBUFS        No buffer space available. 
  14419.  
  14420. Related Calls 
  14421.  
  14422.      getpeername() 
  14423.      getsockname() 
  14424.      Raccept() 
  14425.      Rbind() 
  14426.      Rconnect() 
  14427.      sock_errno() 
  14428.      socket() 
  14429.  
  14430.  
  14431. ΓòÉΓòÉΓòÉ 14.50. Rlisten() ΓòÉΓòÉΓòÉ
  14432.  
  14433. The Rlisten() socket call completes the binding necessary for a socket to 
  14434. accept connections and creates a connection request queue for incoming 
  14435. requests. This call goes directly to the SOCKS server, rather than querying the 
  14436. SOCKS flag (socks_flag). 
  14437.  
  14438. Syntax 
  14439.  
  14440. #include <types.h>
  14441. #include <sys\socket.h>
  14442. #include <netinet\in.h>
  14443. int Rlisten(s, backlog)
  14444. int s;
  14445. int backlog;
  14446.  
  14447. Parameters 
  14448.  
  14449.   Socket descriptor. 
  14450.  
  14451. backlog 
  14452.   Controls the maximum queue length for pending connections. 
  14453.  
  14454. Description 
  14455.  
  14456. This call checks to see if the socket is connected through a SOCKS server, and 
  14457. if not, calls listen(). If it is, the call has no effect. 
  14458.  
  14459. Return Values 
  14460.  
  14461. The value 0 indicates success; the value -1 indicates an error. You can get the 
  14462. specific error code by calling sock_errno() or psock_errno(). 
  14463.  
  14464. Error Code           Description
  14465. SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  14466. SOCEOPNOTSUPP        The s parameter is not a socket descriptor that supports 
  14467.                      the listen() call. 
  14468.  
  14469. Related Calls 
  14470.  
  14471.      listen() 
  14472.      Raccept() 
  14473.      Rbind() 
  14474.      Rconnect() 
  14475.      sock_errno() 
  14476.      socket() 
  14477.  
  14478.  
  14479. ΓòÉΓòÉΓòÉ 14.51. sethostent() ΓòÉΓòÉΓòÉ
  14480.  
  14481. The sethostent() call opens and rewinds the ETC\HOSTS file. 
  14482.  
  14483. Syntax 
  14484.  
  14485. #include <netdb.h>
  14486. void sethostent(stayopen)
  14487. int stayopen;
  14488.  
  14489. Parameters 
  14490.  
  14491. stayopen 
  14492.   Allows the ETC\HOSTS file to stay open after each call; specifying 0 closes 
  14493.   the file. 
  14494.  
  14495. Description 
  14496.  
  14497. This call opens and rewinds the ETC\HOSTS file. If the stayopen parameter is 
  14498. nonzero, the ETC\HOSTS file stays open after each of the gethost calls. 
  14499.  
  14500. Related Calls 
  14501.  
  14502.      endhostent() 
  14503.      gethostbyaddr() 
  14504.      gethostbyname() 
  14505.      gethostent() 
  14506.  
  14507.  
  14508. ΓòÉΓòÉΓòÉ 14.52. setnetent() ΓòÉΓòÉΓòÉ
  14509.  
  14510. The setnetent() call opens and rewinds the ETC\NETWORKS file. 
  14511.  
  14512. Syntax 
  14513.  
  14514. #include <netdb.h>
  14515. void setnetent(stayopen)
  14516. int stayopen;
  14517.  
  14518. Parameters 
  14519.  
  14520. stayopen 
  14521.   Allows the ETC\NETWORKS file to stay open after each call; specifying 0 
  14522.   closes the file. 
  14523.  
  14524. Description 
  14525.  
  14526. This call opens and rewinds the ETC\NETWORKS file, which contains information 
  14527. about known networks.  If the stayopen parameter is nonzero, the ETC\NETWORKS 
  14528. file stays open after each of the getnet calls. 
  14529.  
  14530. Related Calls 
  14531.  
  14532.      endnetent() 
  14533.      getnetbyaddr() 
  14534.      getnetbyname() 
  14535.      getnetent() 
  14536.  
  14537.  
  14538. ΓòÉΓòÉΓòÉ 14.53. setprotoent() ΓòÉΓòÉΓòÉ
  14539.  
  14540. The setprotoent() call opens and rewinds the ETC\PROTOCOL file. 
  14541.  
  14542. Syntax 
  14543.  
  14544. #include <netdb.h>
  14545. void setprotoent(stayopen)
  14546. int stayopen;
  14547.  
  14548. Parameters 
  14549.  
  14550. stayopen 
  14551.   Allows the ETC\PROTOCOL file to stay open after each call; specifying 0 
  14552.   closes the file. 
  14553.  
  14554. Description 
  14555.  
  14556. This call opens and rewinds the ETC\PROTOCOL file, which contains information 
  14557. about known protocols. If the stayopen parameter is nonzero, the ETC\PROTOCOL 
  14558. file stays open after each of the getproto calls. 
  14559.  
  14560. Related Calls 
  14561.  
  14562.      endprotoent() 
  14563.      getprotobyname() 
  14564.      getprotobynumber() 
  14565.      getprotoent() 
  14566.  
  14567.  
  14568. ΓòÉΓòÉΓòÉ 14.54. setservent() ΓòÉΓòÉΓòÉ
  14569.  
  14570. The setservent() call opens and rewinds the ETC\SERVICES file. 
  14571.  
  14572. Syntax 
  14573.  
  14574. #include <netdb.h>
  14575. void setservent(stayopen)
  14576. int stayopen;
  14577.  
  14578. Parameters 
  14579.  
  14580. stayopen 
  14581.   Allows the ETC\SERVICES file to stay open after each call; specifying 0 
  14582.   closes the file. 
  14583.  
  14584. Description 
  14585.  
  14586. This call opens and rewinds the ETC\SERVICES file, which contains information 
  14587. about known services and well-known ports. If the stayopen parameter is 
  14588. nonzero, the ETC\SERVICES file stays open after each of the getserv calls. 
  14589.  
  14590. Related Calls 
  14591.  
  14592.      endprotoent() 
  14593.      endservent() 
  14594.      getprotobyname() 
  14595.      getprotobynumber() 
  14596.      getprotoent() 
  14597.      getservbyname() 
  14598.      getservbyport() 
  14599.      getservent() 
  14600.      setprotoent() 
  14601.  
  14602.  
  14603. ΓòÉΓòÉΓòÉ 15. R0LIB32 Library ΓòÉΓòÉΓòÉ
  14604.  
  14605. The following include files are available: 
  14606.  
  14607.     r0lib.h 
  14608.  
  14609.     nerrno.h 
  14610.  
  14611. The following socket calls are available: 
  14612.  
  14613.     long sock_init(void); 
  14614.  
  14615.     long socket(long, long,long); 
  14616.  
  14617.     long bind(long,char *, long); 
  14618.  
  14619.     long connect(long, char *, long); 
  14620.  
  14621.     long listen(long,long); 
  14622.  
  14623.     long accept(long, char *, long  *); 
  14624.  
  14625.     long sendto(long, char *, long, long, char *, long); 
  14626.  
  14627.     long send(long, char  *, long, long); 
  14628.  
  14629.     long sendmsg(long, char  *, long); 
  14630.  
  14631.     long recvfrom(long, char *, long, long, char *, long *); 
  14632.  
  14633.     long recv(long, char  *, long, long); 
  14634.  
  14635.     long recvmsg(long, char  *, long); 
  14636.  
  14637.     long shutdown(long, long); 
  14638.  
  14639.     long setsockopt(long, long, long, char  *, long); 
  14640.  
  14641.     long getsockopt(long, long, long, char  *, long  *); 
  14642.  
  14643.     long getsockname(long, char  *, long *); 
  14644.  
  14645.     long getpeername(long, char  *, long  *); 
  14646.  
  14647.     ulong gethostid(void); 
  14648.  
  14649.     long soclose(long); 
  14650.  
  14651.     long ioctl(long, long, char  *, long); 
  14652.  
  14653.     long select(long  *, long, long, long, long); 
  14654.  
  14655. sock_init() returns 0 for success else failure. sock_init() must be called 
  14656. before any other socket call is made. Internally sock_init() attaches to INET$ 
  14657. and prepares the library to do socket calls. If sock_init() fails, it means 
  14658. that INET$ (sockets.sys) is not loaded. Check your config.sys "device=" 
  14659. statement, or execute the "inetver" command at OS/2 command prompt. The command 
  14660. should return a TCP/IP version greater than 3.00. Link your Ring-0 code with 
  14661. r0lib32.lib and you will be ready to use all sockets API calls. 
  14662.  
  14663. Example 
  14664.  
  14665. To test r0lib32.lib build test.sys, add an entry for the device driver in 
  14666. config.sys, and copy test.sys in \mptn\protocol directory. Reboot the machine 
  14667. so that test.sys is loaded in memory. Now compile testini.c and generate 
  14668. testini.exe. 
  14669.  
  14670. By running testini.exe the function test_server(), in driver.c is invoked, 
  14671. which acts as a server and waits for the client at port no 5000. Compile and 
  14672. run the client program (client.c) on any other machine. 
  14673.  
  14674. The test_server opens a STREAM socket in the internet domain and waits for a 
  14675. client at port no 5000. In the client program, the IP address of the server 
  14676. machine that has test.sys is to be specified while filling the structure 
  14677. sockaddr_in. To compile the client program use makefile.cli. 
  14678.  
  14679. For more information: 
  14680.  
  14681. The TCP/IP Toolkit contains a programming example in detail, which exploits the 
  14682. use of r0lib32. 
  14683.  
  14684.  
  14685. ΓòÉΓòÉΓòÉ 16. Remote Procedure and eXternal Data Representation API ΓòÉΓòÉΓòÉ
  14686.  
  14687. The following table briefly describes each remote procedure and XDR call, and 
  14688. identifies where you can find the syntax, parameters, and other appropriate 
  14689. information for these calls. 
  14690.  
  14691. Remote Procedure and XDR API Quick Reference 
  14692.  
  14693. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14694. ΓöéRPC or XDR Call                  Description                      Γöé
  14695. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14696. Γöéauth_destroy()                   Destroys authentication          Γöé
  14697. Γöé                                 information                      Γöé
  14698. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14699. Γöéauthnone_create()                Creates and returns a NULL RPC   Γöé
  14700. Γöé                                 authentication handle            Γöé
  14701. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14702. Γöéauthunix_create()                Creates and returns a UNIX-based Γöé
  14703. Γöé                                 authentication handle            Γöé
  14704. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14705. Γöéauthunix_create_default()        Calls authunix_create() with     Γöé
  14706. Γöé                                 default parameters               Γöé
  14707. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14708. Γöécallrpc()                        Calls remote procedures          Γöé
  14709. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14710. Γöéclnt_broadcast()                 Broadcasts a remote program to   Γöé
  14711. Γöé                                 all locally connected broadcast  Γöé
  14712. Γöé                                 networks                         Γöé
  14713. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14714. Γöéclnt_call()                      Calls the remote procedure (     Γöé
  14715. Γöé                                 procnum) associated with the     Γöé
  14716. Γöé                                 client handle (clnt)             Γöé
  14717. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14718. Γöéclnt_destroy()                   Destroys a client's RPC handle   Γöé
  14719. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14720. Γöéclnt_freeres()                   Deallocates resources assigned   Γöé
  14721. Γöé                                 for decoding the results of an   Γöé
  14722. Γöé                                 RPC                              Γöé
  14723. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14724. Γöéclnt_geterr()                    Copies the error structure from aΓöé
  14725. Γöé                                 client's handle to the local     Γöé
  14726. Γöé                                 structure                        Γöé
  14727. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14728. Γöéclnt_pcreateerror()              Indicates why a client handle    Γöé
  14729. Γöé                                 cannot be created                Γöé
  14730. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14731. Γöéclnt_perrno()                    Writes a message to the standard Γöé
  14732. Γöé                                 error device corresponding to theΓöé
  14733. Γöé                                 condition indicated by stat      Γöé
  14734. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14735. Γöéclnt_perror()                    Writes an error message          Γöé
  14736. Γöé                                 indicating why RPC failed        Γöé
  14737. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14738. Γöéclntraw_create()                 Creates a client transport handleΓöé
  14739. Γöé                                 to use in a single task          Γöé
  14740. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14741. Γöéclnttcp_create()                 Creates an RPC client transport  Γöé
  14742. Γöé                                 handle for the remote program    Γöé
  14743. Γöé                                 using TCP transport              Γöé
  14744. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14745. Γöéclntudp_create()                 Creates an RPC client transport  Γöé
  14746. Γöé                                 handle for the remote program    Γöé
  14747. Γöé                                 using UDP transport              Γöé
  14748. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14749. Γöéget_myaddress()                  Returns the local host's internetΓöé
  14750. Γöé                                 address                          Γöé
  14751. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14752. Γöégetrpcbyname()                   Returns an RPC program entry     Γöé
  14753. Γöé                                 specified by a name in the RPC   Γöé
  14754. Γöé                                 file                             Γöé
  14755. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14756. Γöégetrpcbynumber()                 Returns an RPC program entry     Γöé
  14757. Γöé                                 specified by a number in the RPC Γöé
  14758. Γöé                                 file                             Γöé
  14759. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14760. Γöégetrpcent()                      Returns the next entry in the    Γöé
  14761. Γöé                                 TCPIP\ETC\RPC file               Γöé
  14762. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14763. Γöépmap_getmaps()                   Returns a list of current        Γöé
  14764. Γöé                                 program-to-port mappings on a    Γöé
  14765. Γöé                                 specified remote host's          Γöé
  14766. Γöé                                 Portmapper                       Γöé
  14767. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14768. Γöépmap_getport()                   Returns the port number          Γöé
  14769. Γöé                                 associated with the remote       Γöé
  14770. Γöé                                 program, the version, and the    Γöé
  14771. Γöé                                 transport protocol               Γöé
  14772. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14773. Γöépmap_rmtcall()                   Instructs Portmapper to make an  Γöé
  14774. Γöé                                 RPC call to a procedure on a hostΓöé
  14775. Γöé                                 on your behalf                   Γöé
  14776. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14777. Γöépmap_set()                       Sets the mapping of the program  Γöé
  14778. Γöé                                 to port on the local machine's   Γöé
  14779. Γöé                                 Portmapper                       Γöé
  14780. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14781. Γöépmap_unset()                     Removes the mappings associated  Γöé
  14782. Γöé                                 with prognum and versnum on the  Γöé
  14783. Γöé                                 local machine's Portmapper       Γöé
  14784. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14785. Γöéregisterrpc()                    Registers a procedure with the   Γöé
  14786. Γöé                                 local Portmapper and creates a   Γöé
  14787. Γöé                                 control structure to remember theΓöé
  14788. Γöé                                 server procedure and its XDR     Γöé
  14789. Γöé                                 routine                          Γöé
  14790. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14791. Γöérpc_createerr                    A global variable that is set    Γöé
  14792. Γöé                                 when any RPC client creation     Γöé
  14793. Γöé                                 routine fails                    Γöé
  14794. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14795. Γöésvc_destroy()                    Deletes the RPC service transportΓöé
  14796. Γöé                                 handle xprt, which becomes       Γöé
  14797. Γöé                                 undefined after this routine is  Γöé
  14798. Γöé                                 called                           Γöé
  14799. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14800. Γöésvc_freeargs()                   Frees storage allocated to decodeΓöé
  14801. Γöé                                 the arguments received by        Γöé
  14802. Γöé                                 svc_getargs()                    Γöé
  14803. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14804. Γöésvc_getargs()                    Uses the XDR routine inproc to   Γöé
  14805. Γöé                                 decode the arguments of an RPC   Γöé
  14806. Γöé                                 request associated with the RPC  Γöé
  14807. Γöé                                 service transport handle xprt    Γöé
  14808. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14809. Γöésvc_getcaller()                  Gets the network address of the  Γöé
  14810. Γöé                                 client associated with the       Γöé
  14811. Γöé                                 service transport handle         Γöé
  14812. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14813. Γöésvc_getreq()                     Implements asynchronous event    Γöé
  14814. Γöé                                 processing and returns control toΓöé
  14815. Γöé                                 the program after all sockets    Γöé
  14816. Γöé                                 have been serviced               Γöé
  14817. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14818. Γöésvc_register()                   Registers procedures on the localΓöé
  14819. Γöé                                 Portmapper                       Γöé
  14820. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14821. Γöésvc_run()                        Accepts RPC requests and calls   Γöé
  14822. Γöé                                 the appropriate service using    Γöé
  14823. Γöé                                 svc_getreq()                     Γöé
  14824. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14825. Γöésvc_sendreply()                  Sends the results of an RPC to   Γöé
  14826. Γöé                                 the caller                       Γöé
  14827. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14828. Γöésvc_socks[ ]                     An array of socket descriptors   Γöé
  14829. Γöé                                 being serviced                   Γöé
  14830. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14831. Γöésvc_unregister()                 Removes all local mappings of    Γöé
  14832. Γöé                                 prognum versnum to dispatch      Γöé
  14833. Γöé                                 routines (prognum, versnum, *)   Γöé
  14834. Γöé                                 and to port numbers              Γöé
  14835. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14836. Γöésvcerr_auth()                    Sends an error reply when the    Γöé
  14837. Γöé                                 service dispatch routine cannot  Γöé
  14838. Γöé                                 execute an RPC request because ofΓöé
  14839. Γöé                                 authentication errors            Γöé
  14840. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14841. Γöésvcerr_decode()                  Sends an error reply when the    Γöé
  14842. Γöé                                 service dispatch routine cannot  Γöé
  14843. Γöé                                 decode its parameters            Γöé
  14844. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14845. Γöésvcerr_noproc()                  Sends an error reply when the    Γöé
  14846. Γöé                                 service dispatch routine cannot  Γöé
  14847. Γöé                                 call the procedure requested     Γöé
  14848. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14849. Γöésvcerr_noprog()                  Sends an error code when the     Γöé
  14850. Γöé                                 requested program is not         Γöé
  14851. Γöé                                 registered                       Γöé
  14852. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14853. Γöésvcerr_progvers()                Sends the low version number and Γöé
  14854. Γöé                                 high version number of RPC       Γöé
  14855. Γöé                                 service when the version numbers Γöé
  14856. Γöé                                 of two RPC programs do not match Γöé
  14857. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14858. Γöésvcerr_systemerr()               Sends an error reply when the    Γöé
  14859. Γöé                                 service dispatch routine detects Γöé
  14860. Γöé                                 a system error that has not been Γöé
  14861. Γöé                                 handled                          Γöé
  14862. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14863. Γöésvcerr_weakauth()                Sends an error reply when the    Γöé
  14864. Γöé                                 service dispatch routine cannot  Γöé
  14865. Γöé                                 run an RPC because of weak       Γöé
  14866. Γöé                                 authentication parameters        Γöé
  14867. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14868. Γöésvcraw_create()                  Creates a local RPC service      Γöé
  14869. Γöé                                 transport handle to simulate RPC Γöé
  14870. Γöé                                 programs within one host         Γöé
  14871. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14872. Γöésvctcp_create()                  Creates a TCP-based service      Γöé
  14873. Γöé                                 transport                        Γöé
  14874. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14875. Γöésvcudp_create()                  Creates a UDP-based service      Γöé
  14876. Γöé                                 transport                        Γöé
  14877. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14878. Γöéxdr_accepted_reply()             Translates between an RPC reply  Γöé
  14879. Γöé                                 message and its external         Γöé
  14880. Γöé                                 representation                   Γöé
  14881. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14882. Γöéxdr_array()                      Translates between an array and  Γöé
  14883. Γöé                                 its external representation      Γöé
  14884. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14885. Γöéxdr_authunix_parms()             Translates between UNIX-based    Γöé
  14886. Γöé                                 authentication information and   Γöé
  14887. Γöé                                 its external representation      Γöé
  14888. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14889. Γöéxdr_bool()                       Translates between a Boolean and Γöé
  14890. Γöé                                 its external representation      Γöé
  14891. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14892. Γöéxdr_bytes()                      Translates between byte strings  Γöé
  14893. Γöé                                 and their external               Γöé
  14894. Γöé                                 representations                  Γöé
  14895. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14896. Γöéxdr_callhdr()                    Translates between an RPC messageΓöé
  14897. Γöé                                 header and its external          Γöé
  14898. Γöé                                 representation                   Γöé
  14899. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14900. Γöéxdr_callmsg()                    Translates between RPC call      Γöé
  14901. Γöé                                 messages (header and             Γöé
  14902. Γöé                                 authentication, not argument     Γöé
  14903. Γöé                                 data) and their external         Γöé
  14904. Γöé                                 representations                  Γöé
  14905. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14906. Γöéxdr_destroy()                    Destroys the XDR stream pointed  Γöé
  14907. Γöé                                 to by the xdrs parameter         Γöé
  14908. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14909. Γöéxdr_double()                     Translates between C             Γöé
  14910. Γöé                                 double-precision numbers and     Γöé
  14911. Γöé                                 their external representations   Γöé
  14912. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14913. Γöéxdr_enum()                       Translates between C-enumerated  Γöé
  14914. Γöé                                 groups and their external        Γöé
  14915. Γöé                                 representations                  Γöé
  14916. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14917. Γöéxdr_float()                      Translates between C             Γöé
  14918. Γöé                                 floating-point numbers and their Γöé
  14919. Γöé                                 external representations         Γöé
  14920. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14921. Γöéxdr_getpos()                     Starts the get-position routine  Γöé
  14922. Γöé                                 associated with the XDR stream,  Γöé
  14923. Γöé                                 xdrs                             Γöé
  14924. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14925. Γöéxdr_inline()                     Returns a pointer to a continuousΓöé
  14926. Γöé                                 piece of the XDR stream's buffer Γöé
  14927. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14928. Γöéxdr_int()                        Translates between C integers andΓöé
  14929. Γöé                                 their external representations   Γöé
  14930. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14931. Γöéxdr_long()                       Translates between C long        Γöé
  14932. Γöé                                 integers and their external      Γöé
  14933. Γöé                                 representations                  Γöé
  14934. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14935. Γöéxdr_opaque()                     Translates between fixed-size    Γöé
  14936. Γöé                                 opaque data and its external     Γöé
  14937. Γöé                                 representation                   Γöé
  14938. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14939. Γöéxdr_opaque_auth()                Translates between RPC message   Γöé
  14940. Γöé                                 authentications and their        Γöé
  14941. Γöé                                 external representations         Γöé
  14942. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14943. Γöéxdr_pmap()                       Translates an RPC procedure      Γöé
  14944. Γöé                                 identification, such as is used  Γöé
  14945. Γöé                                 in calls to Portmapper           Γöé
  14946. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14947. Γöéxdr_pmaplist()                   Translates a variable number of  Γöé
  14948. Γöé                                 RPC procedure identifications,   Γöé
  14949. Γöé                                 such as those Portmapper creates Γöé
  14950. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14951. Γöéxdr_reference()                  Provides pointer chasing within  Γöé
  14952. Γöé                                 structures                       Γöé
  14953. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14954. Γöéxdr_rejected_reply()             Translates between rejected RPC  Γöé
  14955. Γöé                                 reply messages and their externalΓöé
  14956. Γöé                                 representations                  Γöé
  14957. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14958. Γöéxdr_replymsg()                   Translates between RPC reply     Γöé
  14959. Γöé                                 messages and their external      Γöé
  14960. Γöé                                 representations                  Γöé
  14961. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14962. Γöéxdr_setpos()                     Starts the set-position routine  Γöé
  14963. Γöé                                 associated with a XDR stream,    Γöé
  14964. Γöé                                 xdrs                             Γöé
  14965. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14966. Γöéxdr_short()                      Translates between C short       Γöé
  14967. Γöé                                 integers and their external      Γöé
  14968. Γöé                                 representations                  Γöé
  14969. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14970. Γöéxdr_string()                     Translates between C strings and Γöé
  14971. Γöé                                 their external representations   Γöé
  14972. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14973. Γöéxdr_u_int()                      Translates between C unsigned    Γöé
  14974. Γöé                                 integers and their external      Γöé
  14975. Γöé                                 representations                  Γöé
  14976. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14977. Γöéxdr_u_long()                     Translates between C unsigned    Γöé
  14978. Γöé                                 long integers and their external Γöé
  14979. Γöé                                 representations                  Γöé
  14980. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14981. Γöéxdr_u_short()                    Translates between C unsigned    Γöé
  14982. Γöé                                 short integers and their externalΓöé
  14983. Γöé                                 representations                  Γöé
  14984. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14985. Γöéxdr_union()                      Translates between a             Γöé
  14986. Γöé                                 discriminated C union and its    Γöé
  14987. Γöé                                 external representation          Γöé
  14988. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14989. Γöéxdr_vector()                     Translates between a fixed-lengthΓöé
  14990. Γöé                                 array and its external           Γöé
  14991. Γöé                                 representation                   Γöé
  14992. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14993. Γöéxdr_void()                       Returns a value of 1             Γöé
  14994. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14995. Γöéxdr_wrapstring()                 Translates between strings and   Γöé
  14996. Γöé                                 their external representations   Γöé
  14997. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14998. Γöéxdrmem_create()                  Initializes the XDR stream       Γöé
  14999. Γöé                                 pointed to by xdrs               Γöé
  15000. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15001. Γöéxdrrec_create()                  Initializes the XDR stream       Γöé
  15002. Γöé                                 pointed to by xdrs               Γöé
  15003. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15004. Γöéxdrrec_endofrecord()             Marks the data in the output     Γöé
  15005. Γöé                                 buffer as a completed record     Γöé
  15006. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15007. Γöéxdrrec_eof()                     Marks the end of the file, after Γöé
  15008. Γöé                                 using the rest of the current    Γöé
  15009. Γöé                                 record in the XDR stream         Γöé
  15010. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15011. Γöéxdrrec_skiprecord()              Discards the rest of the XDR     Γöé
  15012. Γöé                                 stream's current record in the   Γöé
  15013. Γöé                                 input buffer                     Γöé
  15014. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15015. Γöéxdrstdio_create()                Initializes the XDR stream       Γöé
  15016. Γöé                                 pointed to by xdrs               Γöé
  15017. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15018. Γöéxprt_register()                  Registers service transport      Γöé
  15019. Γöé                                 handles with the RPC service     Γöé
  15020. Γöé                                 package; also modifies the globalΓöé
  15021. Γöé                                 variable svc_socks[ ]            Γöé
  15022. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15023. Γöéxprt_unregister()                Unregisters the RPC service      Γöé
  15024. Γöé                                 transport handle                 Γöé
  15025. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15026.  
  15027.  
  15028. ΓòÉΓòÉΓòÉ 16.1. auth_destroy() ΓòÉΓòÉΓòÉ
  15029.  
  15030. The auth_destroy() call destroys authentication information. 
  15031.  
  15032. Syntax 
  15033.  
  15034. #include <rpc\rpc.h>
  15035.  
  15036. void
  15037. auth_destroy(auth)
  15038. AUTH *auth;
  15039.  
  15040. Parameters 
  15041.  
  15042. auth 
  15043.   Pointer to authentication information. 
  15044.  
  15045. Description 
  15046.  
  15047. The auth_destroy() call deletes the authentication information for auth. After 
  15048. you call this procedure, auth is undefined. 
  15049.  
  15050. Related Calls 
  15051.  
  15052.      authnone_create() 
  15053.      authunix_create() 
  15054.      authunix_create_default() 
  15055.  
  15056.  
  15057. ΓòÉΓòÉΓòÉ 16.2. authnone_create() ΓòÉΓòÉΓòÉ
  15058.  
  15059. The authnone_create() call creates and returns a NULL RPC authentication 
  15060. handle. 
  15061.  
  15062. Syntax 
  15063.  
  15064. #include <rpc\rpc.h>
  15065.  
  15066. AUTH *
  15067. authnone_create()
  15068.  
  15069. Description 
  15070.  
  15071. The authnone_create() call creates and returns an RPC authentication handle. 
  15072. The handle passes the NULL authentication on each call. 
  15073.  
  15074. Related Calls 
  15075.  
  15076.      auth_destroy() 
  15077.      authunix_create() 
  15078.      authunix_create_default() 
  15079.  
  15080.  
  15081. ΓòÉΓòÉΓòÉ 16.3. authunix_create() ΓòÉΓòÉΓòÉ
  15082.  
  15083. The authunix_create() call creates and returns a UNIX-based authentication 
  15084. handle. 
  15085.  
  15086. Syntax 
  15087.  
  15088. #include <rpc\rpc.h>
  15089.  
  15090. AUTH *
  15091. authunix_create(host, uid, gid, len, aup_gids)
  15092. char *host;
  15093. int uid;
  15094. int gid;
  15095. int len;
  15096. int *aup_gids;
  15097.  
  15098. Parameters 
  15099.  
  15100. host 
  15101.   Pointer to the symbolic name of the host where the desired server is located. 
  15102.  
  15103. uid 
  15104.   User's user ID. 
  15105.  
  15106. gid 
  15107.   User's group ID. 
  15108.  
  15109. len 
  15110.   Length of the information pointed to by aup_gids. 
  15111.  
  15112. aup_gids 
  15113.   Pointer to an array of groups to which the user belongs. 
  15114.  
  15115. Description 
  15116.  
  15117. The authunix_create() call creates and returns an authentication handle that 
  15118. contains UNIX-based authentication information. 
  15119.  
  15120. Related Calls 
  15121.  
  15122.      auth_destroy() 
  15123.      authnone_create() 
  15124.      authunix_create_default() 
  15125.  
  15126.  
  15127. ΓòÉΓòÉΓòÉ 16.4. authunix_create_default() ΓòÉΓòÉΓòÉ
  15128.  
  15129. The authunix_create_default() call calls authunix_create() with default 
  15130. parameters. 
  15131.  
  15132. Syntax 
  15133.  
  15134. #include <rpc\rpc.h>
  15135.  
  15136. AUTH *
  15137. authunix_create_default()
  15138.  
  15139. Description 
  15140.  
  15141. The authunix_create_default() call calls authunix_create() with default 
  15142. parameters. 
  15143.  
  15144. Related Calls 
  15145.  
  15146.      auth_destroy() 
  15147.      authnone_create() 
  15148.      authunix_create() 
  15149.  
  15150.  
  15151. ΓòÉΓòÉΓòÉ 16.5. callrpc() ΓòÉΓòÉΓòÉ
  15152.  
  15153. The callrpc() call calls remote procedures. 
  15154.  
  15155. Syntax 
  15156.  
  15157. #include <rpc\rpc.h>
  15158.  
  15159. enum clnt_stat
  15160. callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
  15161. char *host;
  15162. u_long prognum;
  15163. u_long versnum;
  15164. u_long procnum;
  15165. xdrproc_t inproc;
  15166. char *in;
  15167. xdrproc_t outproc;
  15168. char *out;
  15169.  
  15170. Parameters 
  15171.  
  15172. host 
  15173.   Pointer to the symbolic name of the host where the desired server is located. 
  15174.  
  15175. prognum 
  15176.   Program number of the remote procedure. 
  15177.  
  15178. versnum 
  15179.   Version number of the remote procedure. 
  15180.  
  15181. procnum 
  15182.   Procedure number of the remote procedure. 
  15183.  
  15184. inproc 
  15185.   XDR procedure used to encode the arguments of the remote procedure. 
  15186.  
  15187. in 
  15188.   Pointer to the arguments of the remote procedure. 
  15189.  
  15190. outproc 
  15191.   XDR procedure used to decode the results of the remote procedure. 
  15192.  
  15193. out 
  15194.   Pointer to the results of the remote procedure. 
  15195.  
  15196. Description 
  15197.  
  15198. The callrpc() call calls the remote procedure described by prognum, versnum, 
  15199. and procnum running on the host system.  It encodes and decodes the parameters 
  15200. for transfer. 
  15201.  
  15202. Notes: 
  15203.  
  15204.   1. You can use clnt_perrno() to translate the return code into messages. 
  15205.  
  15206.   2. callrpc() cannot call the procedure xdr_enum. See xdr_enum() for more 
  15207.      information. 
  15208.  
  15209.   3. This procedure uses UDP as its transport layer. See clntudp_create() for 
  15210.      more information. 
  15211.  
  15212. Return Values 
  15213.  
  15214. RPC_SUCCESS indicates success; otherwise, an error has occurred. The results of 
  15215. the remote procedure call return to out. 
  15216.  
  15217. Examples 
  15218.  
  15219. #define RMTPROGNUM (u_long)0x3fffffffL
  15220. #define RMTPROGVER (u_long)0x1
  15221. #define RMTPROCNUM (u_long)0x1
  15222.  
  15223. int inproc=100, outproc, rstat;
  15224. ...
  15225. /* service request to host RPCSERVER_HOST */
  15226. if (rstat = callrpc("RPCSERVER_HOST", RMTPROGNUM, RMTPROGVER, RMTPROCNUM,
  15227.                     xdr_int, (char *)&inproc, xdr_int,
  15228.                     (char *)&outproc)!= 0)
  15229.     {
  15230.      clnt_perrno(rstat);
  15231.      exit(1);
  15232.     }
  15233. ...
  15234.  
  15235. Related Calls 
  15236.  
  15237.      clnt_call() 
  15238.      clnt_perrno() 
  15239.      clntudp_create() 
  15240.  
  15241.  
  15242. ΓòÉΓòÉΓòÉ 16.6. clnt_broadcast() ΓòÉΓòÉΓòÉ
  15243.  
  15244. The clnt_broadcast() call broadcasts a remote program to all locally connected 
  15245. broadcast networks. 
  15246.  
  15247. Syntax 
  15248.  
  15249. #include <rpc\rpc.h>
  15250.  
  15251. enum clnt_stat
  15252. clnt_broadcast(prognum, versnum, procnum, inproc, in, outproc, out, eachresult)
  15253. u_long prognum;
  15254. u_long versnum;
  15255. u_long procnum;
  15256. xdrproc_t inproc;
  15257. caddr_t in;
  15258. xdrproc_t outproc;
  15259. caddr_t out;
  15260. resultproc_t eachresult;
  15261.  
  15262. Parameters 
  15263.  
  15264. prognum 
  15265.   Program number of the remote procedure. 
  15266.  
  15267. versnum 
  15268.   Version number of the remote procedure. 
  15269.  
  15270. procnum 
  15271.   Procedure number of the remote procedure. 
  15272.  
  15273. inproc 
  15274.   XDR procedure used to encode the arguments of the remote procedure. 
  15275.  
  15276. in 
  15277.   Pointer to the arguments of the remote procedure. 
  15278.  
  15279. outproc 
  15280.   XDR procedure used to decode the results of the remote procedure. 
  15281.  
  15282. out 
  15283.   Pointer to the results of the remote procedure. 
  15284.  
  15285. eachresult 
  15286.   Procedure called after each response. 
  15287.  
  15288. Note:  resultproc_t is a type definition: 
  15289.  
  15290.               typedef bool_t (*resultproc_t) ();
  15291.  
  15292. Description 
  15293.  
  15294. The clnt_broadcast() call broadcasts a remote program described by prognum, 
  15295. versnum, and procnum to all locally connected broadcast networks. Each time 
  15296. clnt_broadcast() receives a response, it calls eachresult(). 
  15297.  
  15298. The syntax and parameters of eachresult() are: 
  15299.  
  15300.           #include <netinet\in.h>
  15301.           #include <rpc\rpctypes.h>
  15302.  
  15303.           bool_t eachresult(out, addr)
  15304.           char *out;
  15305.           struct sockaddr_in *addr;
  15306.  
  15307.      out 
  15308.             Has the same function as it does for clnt_broadcast(), except that 
  15309.             the output of the remote procedure is decoded 
  15310.  
  15311.      addr 
  15312.             Pointer to the address of the machine that sent the results 
  15313.  
  15314. Return Values 
  15315.  
  15316. If eachresult() returns 0, clnt_broadcast() waits for more replies; otherwise, 
  15317. eachresult() returns the appropriate status. 
  15318.  
  15319. Note:  Broadcast sockets are limited in size to the maximum transfer unit of 
  15320.        the data link. 
  15321.  
  15322. Examples 
  15323.  
  15324. enum clnt_stat cs;
  15325. u_long prognum, versnum;
  15326. ...
  15327. cs = clnt_broadcast(prognum, versnum, NULLPROC, xdr_void,
  15328.                     (char *)NULL, xdr_void, (char *)NULL, eachresult);
  15329. if ((cs != RPC_SUCCESS) && (cs != RPC_TIMEDOUT))
  15330.   {
  15331.    fprintf( " broadcast failed: \n");
  15332.    exit(-1);
  15333.   }
  15334. ...
  15335. bool_t
  15336. eachresult(out, addr)
  15337. void *out;                                    /* Nothing comes back */
  15338. struct sockaddr_in *addr;                        /* Reply from whom */
  15339. {
  15340.     register struct hostent *hp;
  15341.     ...
  15342.     hp = gethostbyaddr((char *) &addr->sin_addr, sizeof addr->sin_addr,
  15343.         AF_INET);
  15344.     printf("%s %s\n", inet_ntoa(addr->sin_addr), hp->h_name);
  15345.     ...
  15346.     return(FALSE);
  15347. }
  15348.  
  15349. Related Calls 
  15350.  
  15351.      callrpc() 
  15352.      clnt_call() 
  15353.  
  15354.  
  15355. ΓòÉΓòÉΓòÉ 16.7. clnt_call() ΓòÉΓòÉΓòÉ
  15356.  
  15357. The clnt_call() call calls the remote procedure (procnum) associated with the 
  15358. client handle (clnt). 
  15359.  
  15360. Syntax 
  15361.  
  15362. #include <rpc\rpc.h>
  15363.  
  15364. enum clnt_stat
  15365. clnt_call(clnt, procnum, inproc, in, outproc, out, tout)
  15366. CLIENT *clnt;
  15367. u_long procnum;
  15368. xdrproc_t inproc;
  15369. char *in;
  15370. xdrproc_t outproc;
  15371. char *out;
  15372. struct timeval tout;
  15373.  
  15374. Parameters 
  15375.  
  15376. clnt 
  15377.   Pointer to a client handle that was previously obtained using 
  15378.   clntraw_create(), clnttcp_create(), or clntudp_create(). 
  15379.  
  15380. procnum 
  15381.   Remote procedure number. 
  15382.  
  15383. inproc 
  15384.   XDR procedure used to encode procnum's arguments. 
  15385.  
  15386. in 
  15387.   Pointer to the remote procedure's arguments. 
  15388.  
  15389. outproc 
  15390.   XDR procedure used to decode the remote procedure's results. 
  15391.  
  15392. out 
  15393.   Pointer to the remote procedure's results. 
  15394.  
  15395. tout 
  15396.   Time allowed for the server to respond, in units of 0.1 seconds. 
  15397.  
  15398. Return Values 
  15399.  
  15400. RPC_SUCCESS indicates success; otherwise, an error has occurred. The results of 
  15401. the remote procedure call are returned to out. 
  15402.  
  15403. Examples 
  15404.  
  15405. u_long procnum;
  15406. register CLIENT *clnt;
  15407. enum clnt_stat cs;
  15408. struct timeval  total_timeout;
  15409. int intsend, intrecv;
  15410.  
  15411. cs=clnt_call(clnt, procnum, xdr_int, &intsend,
  15412.    xdr_int, &intrecv, total_timeout);
  15413. if ( cs != RPC_SUCCESS)
  15414.     printf("*Error* clnt_call fail :\n");
  15415.  
  15416. Related Calls 
  15417.  
  15418.      callrpc() 
  15419.      clnt_perror() 
  15420.      clntraw_create() 
  15421.      clnttcp_create() 
  15422.      clntudp_create() 
  15423.  
  15424.  
  15425. ΓòÉΓòÉΓòÉ 16.8. clnt_destroy() ΓòÉΓòÉΓòÉ
  15426.  
  15427. The clnt_destroy() call destroys a client's RPC handle. 
  15428.  
  15429. Syntax 
  15430.  
  15431. #include <rpc\rpc.h>
  15432.  
  15433. void
  15434. clnt_destroy(clnt)
  15435. CLIENT *clnt;
  15436.  
  15437. Parameters 
  15438.  
  15439. clnt 
  15440.   Pointer to a client handle that was previously created using 
  15441.   clntudp_create(), clnttcp_create(), or clntraw_create(). 
  15442.  
  15443. Description 
  15444.  
  15445. The clnt_destroy() call deletes a client RPC transport handle. This procedure 
  15446. involves the deallocation of private data resources, including clnt. After you 
  15447. use this procedure, clnt is undefined. Open sockets associated with clnt must 
  15448. be closed. 
  15449.  
  15450. Related Calls 
  15451.  
  15452.      clntraw_create() 
  15453.      clnttcp_create() 
  15454.      clntudp_create() 
  15455.  
  15456.  
  15457. ΓòÉΓòÉΓòÉ 16.9. clnt_freeres() ΓòÉΓòÉΓòÉ
  15458.  
  15459. The clnt_freeres() call deallocates resources assigned for decoding the results 
  15460. of an RPC. 
  15461.  
  15462. Syntax 
  15463.  
  15464. #include <rpc\rpc.h>
  15465.  
  15466. bool_t
  15467. clnt_freeres(clnt, outproc, out)
  15468. CLIENT *clnt;
  15469. xdrproc_t outproc;
  15470. char *out;
  15471.  
  15472. Parameters 
  15473.  
  15474. clnt 
  15475.   Pointer to a client handle that was previously obtained using 
  15476.   clntraw_create(), clnttcp_create(), or clntudp_create(). 
  15477.  
  15478. outproc 
  15479.   XDR procedure used to decode the remote procedure's results. 
  15480.  
  15481. out 
  15482.   Pointer to the results of the remote procedure. 
  15483.  
  15484. Return Values 
  15485.  
  15486. The value 1 indicates success; the value 0 indicates an error. 
  15487.  
  15488. Related Calls 
  15489.  
  15490.      clntraw_create() 
  15491.      clnttcp_create() 
  15492.      clntudp_create() 
  15493.  
  15494.  
  15495. ΓòÉΓòÉΓòÉ 16.10. clnt_geterr() ΓòÉΓòÉΓòÉ
  15496.  
  15497. The clnt_geterr() call copies the error structure from a client's handle to the 
  15498. local structure. 
  15499.  
  15500. Syntax 
  15501.  
  15502. #include <rpc\rpc.h>
  15503.  
  15504. void
  15505. clnt_geterr(clnt, errp)
  15506. CLIENT *clnt;
  15507. struct rpc_err *errp;
  15508.  
  15509. Parameters 
  15510.  
  15511. clnt 
  15512.   Pointer to a client handle that was previously obtained using 
  15513.   clntraw_create(), clnttcp_create(), or clntudp_create(). 
  15514.  
  15515. errp 
  15516.   Pointer to the address into which the error structure is copied. 
  15517.  
  15518. Examples 
  15519.  
  15520. u_long procnum;
  15521. register CLIENT *clnt;
  15522. enum clnt_stat cs;
  15523. struct timeval  total_timeout;
  15524. int intsend = 100, intrecv;
  15525. struct rpc_err error;
  15526. ...
  15527. total_timeout.tv_sec = 20;
  15528. total_timeout.tv_usec = 0;
  15529. ...
  15530. cs=clnt_call(clnt, procnum, xdr_int, &intsend,
  15531.    xdr_int, &intrecv, total_timeout);
  15532. if ( cs != RPC_SUCCESS)
  15533.      {
  15534.            clnt_geterr(clnt, &error);
  15535.            clnt_perror(clnt, "recv from server");
  15536.      }
  15537. ...
  15538.  
  15539. Related Calls 
  15540.  
  15541.      clnt_call() 
  15542.      clnt_pcreateerror() 
  15543.      clnt_perrno() 
  15544.      clnt_perror() 
  15545.      clntraw_create() 
  15546.      clnttcp_create() 
  15547.      clntudp_create() 
  15548.  
  15549.  
  15550. ΓòÉΓòÉΓòÉ 16.11. clnt_pcreateerror() ΓòÉΓòÉΓòÉ
  15551.  
  15552. The clnt_pcreateerror() call indicates why a client handle cannot be created. 
  15553.  
  15554. Syntax 
  15555.  
  15556. #include <rpc\rpc.h>
  15557.  
  15558. void
  15559. clnt_pcreateerror(s)
  15560. char *s;
  15561.  
  15562. Parameters 
  15563.  
  15564.   Pointer to a string that is to be printed in front of the message. The string 
  15565.   is followed by a colon. 
  15566.  
  15567. Description 
  15568.  
  15569. The clnt_pcreateerror() call writes a message to the standard error device, 
  15570. indicating why a client handle cannot be created. Use this procedure after the 
  15571. clntraw_create(), clnttcp_create(), or clntudp_create() call fails. 
  15572.  
  15573. For an example of the clnt_pcreateerror() call, see clnttcp_create(). 
  15574.  
  15575. Related Calls 
  15576.  
  15577.      clnt_geterr() 
  15578.      clnt_perrno() 
  15579.      clnt_perror() 
  15580.      clntraw_create() 
  15581.      clnttcp_create() 
  15582.      clntudp_create() 
  15583.  
  15584.  
  15585. ΓòÉΓòÉΓòÉ 16.12. clnt_perrno() ΓòÉΓòÉΓòÉ
  15586.  
  15587. The clnt_perrno() call writes a message to the standard error device 
  15588. corresponding to the condition indicated by stat. 
  15589.  
  15590. Syntax 
  15591.  
  15592. #include <rpc\rpc.h>
  15593.  
  15594. void
  15595. clnt_perrno(stat)
  15596. enum clnt_stat stat;
  15597.  
  15598. Parameters 
  15599.  
  15600. stat 
  15601.   The client status. 
  15602.  
  15603. Description 
  15604.  
  15605. The clnt_perrno() call writes a message to the standard error device 
  15606. corresponding to the condition indicated by stat. Use this procedure after 
  15607. callrpc() and clnt_broadcast() if there is an error. 
  15608.  
  15609. Related Calls 
  15610.  
  15611.      callrpc() 
  15612.      clnt_geterr() 
  15613.      clnt_pcreateerror() 
  15614.      clnt_perror() 
  15615.  
  15616.  
  15617. ΓòÉΓòÉΓòÉ 16.13. clnt_perror() ΓòÉΓòÉΓòÉ
  15618.  
  15619. The clnt_perror() call writes an error message indicating why RPC failed. 
  15620.  
  15621. Syntax 
  15622.  
  15623. #include <rpc\rpc.h>
  15624.  
  15625. void
  15626. clnt_perror(clnt, s)
  15627. CLIENT *clnt;
  15628. char *s;
  15629.  
  15630. Parameters 
  15631.  
  15632. clnt 
  15633.   Pointer to a client handle that was previously obtained using 
  15634.   clntudp_create(), clnttcp_create(), or clntraw_create(). 
  15635.  
  15636.   Pointer to a string that is to be printed in front of the message. The string 
  15637.   is followed by a colon. 
  15638.  
  15639. Description 
  15640.  
  15641. The clnt_perror() call writes a message to the standard error device, 
  15642. indicating why an RPC failed. Use this procedure after clnt_call() if there is 
  15643. an error. 
  15644.  
  15645. For an example of the clnt_perror() call, see clnt_geterr(). 
  15646.  
  15647. Related Calls 
  15648.  
  15649.      clnt_call() 
  15650.      clnt_geterr() 
  15651.      clnt_pcreateerror() 
  15652.      clnt_perrno() 
  15653.      clntraw_create() 
  15654.      clnttcp_create() 
  15655.      clntudp_create() 
  15656.  
  15657.  
  15658. ΓòÉΓòÉΓòÉ 16.14. clntraw_create() ΓòÉΓòÉΓòÉ
  15659.  
  15660. The clntraw_create() call creates a client transport handle to use in a single 
  15661. task. 
  15662.  
  15663. Syntax 
  15664.  
  15665. #include <rpc\rpc.h>
  15666.  
  15667. CLIENT *
  15668. clntraw_create(prognum, versnum)
  15669. u_long prognum;
  15670. u_long versnum;
  15671.  
  15672. Parameters 
  15673.  
  15674. prognum 
  15675.   Remote program number. 
  15676.  
  15677. versnum 
  15678.   Version number of the remote program. 
  15679.  
  15680. Description 
  15681.  
  15682. The clntraw_create() call creates a dummy client for the remote double 
  15683. (prognum, versnum). Because messages are passed using a buffer within the 
  15684. address space of the local process, the server should also use the same address 
  15685. space, which simulates RPC programs within one address space. See 
  15686. svcraw_create() for more information. 
  15687.  
  15688. Return Values 
  15689.  
  15690. NULL indicates failure. 
  15691.  
  15692. Related Calls 
  15693.  
  15694.      clnt_call() 
  15695.      clnt_destroy() 
  15696.      clnt_pcreateerror() 
  15697.      clnttcp_create() 
  15698.      clntudp_create() 
  15699.      svcraw_create() 
  15700.  
  15701.  
  15702. ΓòÉΓòÉΓòÉ 16.15. clnttcp_create() ΓòÉΓòÉΓòÉ
  15703.  
  15704. The clnttcp_create() call creates an RPC client transport handle for the remote 
  15705. program using TCP transport. 
  15706.  
  15707. Syntax 
  15708.  
  15709. #include <rpc\rpc.h>
  15710.  
  15711. CLIENT *
  15712. clnttcp_create(addr, prognum, versnum, sockp, sendsz, recvsz)
  15713. struct sockaddr_in *addr;
  15714. u_long prognum;
  15715. u_long versnum;
  15716. int *sockp;
  15717. u_int sendsz;
  15718. u_int recvsz;
  15719.  
  15720. Parameters 
  15721.  
  15722. addr 
  15723.   Pointer to the internet address of the remote program. If addr points to a 
  15724.   port number of 0, addr is set to the port on which the remote program is 
  15725.   receiving. 
  15726.  
  15727. prognum 
  15728.   Remote program number. 
  15729.  
  15730. versnum 
  15731.   Version number of the remote program. 
  15732.  
  15733. sockp 
  15734.   Pointer to the socket. If sockp is RPC_ANYSOCK, then this routine opens a new 
  15735.   socket and sets sockp. 
  15736.  
  15737. sendsz 
  15738.   Size of the send buffer.  Specify 0 to have clnttcp_create() pick a suitable 
  15739.   default size. 
  15740.  
  15741. recvsz 
  15742.   Size of the receive buffer.  Specify 0 to have clnttcp_create() pick a 
  15743.   suitable default size. 
  15744.  
  15745. Description 
  15746.  
  15747. The clnttcp_create() call creates an RPC client transport handle for the remote 
  15748. program specified by (prognum, versnum).  The client uses TCP as the transport 
  15749. layer. 
  15750.  
  15751. Return Values 
  15752.  
  15753. NULL indicates failure. 
  15754.  
  15755. Examples 
  15756.  
  15757. #define RMTPROGNUM   (u_long)0x3fffffffL
  15758. #define RMTPROGVER   (u_long)0x1L
  15759.  
  15760. register CLIENT *clnt;
  15761. int sock = RPC_ANYSOCK; /* can be also valid socket descriptor */
  15762. struct hostent *hp;
  15763. struct sockaddr_in server_addr;
  15764.  
  15765. /* get the internet address of RPC server */
  15766. if ((hp = gethostbyname("RPCSERVER_HOST") == NULL)
  15767.   {
  15768.    fprintf(stderr,"Can't get address for %s\n",argv[2]);
  15769.    exit (-1);
  15770.   }
  15771.  
  15772. bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr, hp->h_length);
  15773. server_addr.sin_family = AF_INET;
  15774. server_addr.sin_port = 0;
  15775.  
  15776. /* create TCP handle */
  15777. if ((clnt = clnttcp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  15778.                             &sock, 1024*10, 1024*10)) == NULL)
  15779.    {
  15780.     clnt_pcreateerror("clnttcp_create");
  15781.     exit(-1);
  15782.    }
  15783.  
  15784. Related Calls 
  15785.  
  15786.      clnt_destroy() 
  15787.      clnt_pcreateerror() 
  15788.      clntraw_create() 
  15789.      clntudp_create() 
  15790.  
  15791.  
  15792. ΓòÉΓòÉΓòÉ 16.16. clntudp_create() ΓòÉΓòÉΓòÉ
  15793.  
  15794. The clntudp_create() call creates an RPC client transport handle for the remote 
  15795. program using UDP transport. 
  15796.  
  15797. Syntax 
  15798.  
  15799. #include <rpc\rpc.h>
  15800. #include <netdb.h>
  15801.  
  15802. CLIENT *
  15803. clntudp_create(addr, prognum, versnum, wait, sockp)
  15804. struct sockaddr_in *addr;
  15805. u_long prognum;
  15806. u_long versnum;
  15807. struct timeval wait;
  15808. int *sockp;
  15809.  
  15810. Parameters 
  15811.  
  15812. addr 
  15813.   Pointer to the internet address of the remote program. If addr points to a 
  15814.   port number of 0, addr is set to the port on which the remote program is 
  15815.   receiving. The remote PORTMAP service is used for this. 
  15816.  
  15817. prognum 
  15818.   Remote program number. 
  15819.  
  15820. versnum 
  15821.   Version number of the remote program. 
  15822.  
  15823. wait 
  15824.   Interval at which UDP resends the call request, until either a response is 
  15825.   received or the call times out. Set the time-out length using the clnt_call() 
  15826.   procedure. 
  15827.  
  15828. sockp 
  15829.   Pointer to the socket. If sockp is RPC_ANYSOCK, this routine opens a new 
  15830.   socket and sets sockp. 
  15831.  
  15832. Description 
  15833.  
  15834. The clntudp_create() call creates a client transport handle for the remote 
  15835. program (prognum) with version (versnum).  UDP is used as the transport layer. 
  15836.  
  15837. Note:  Do not use this procedure with procedures that use large arguments or 
  15838.        return large results. UDP RPC messages can contain only 2K bytes of 
  15839.        encoded data. 
  15840.  
  15841. Return Values 
  15842.  
  15843. NULL indicates failure. 
  15844.  
  15845. Examples 
  15846.  
  15847. #define RMTPROGNUM   (u_long)0x3fffffffL
  15848. #define RMTPROGVER   (u_long)0x1L
  15849.  
  15850. register CLIENT *clnt;
  15851. int sock = RPC_ANYSOCK; /* can be also valid socket descriptor */
  15852. struct hostent *hp;
  15853. struct timeval pertry_timeout;
  15854. struct sockaddr_in server_addr;
  15855.  
  15856. /* get the internet address of RPC server */
  15857. if ((hp = gethostbyname("RPC_HOST") == NULL)
  15858.   {
  15859.    fprintf(stderr,"Can't get address for %s\n",argv[2]);
  15860.    exit (-1);
  15861.   }
  15862.  
  15863. pertry_timeout.tv_sec = 3;
  15864. pertry_timeout.tv_usec = 0;
  15865. bcopy(hp->h_addr, (caddr_t)&server_addr.sin_addr.s_addr, hp->h_length);
  15866. server_addr.sin_family = AF_INET;
  15867. server_addr.sin_port = 0;
  15868.  
  15869. /* create UDP handle */
  15870. if ((clnt = clntudp_create(&server_addr, RMTPROGNUM, RMTPROGVER,
  15871.                                 pertry_timeout, &sock)) == NULL)
  15872.    {
  15873.     clnt_pcreateerror("clntudp_create");
  15874.     exit(-1);
  15875.    }
  15876.  
  15877. Related Calls 
  15878.  
  15879.      clnt_destroy() 
  15880.      clnt_pcreateerror() 
  15881.      clntraw_create() 
  15882.      clnttcp_create() 
  15883.  
  15884.  
  15885. ΓòÉΓòÉΓòÉ 16.17. get_myaddress() ΓòÉΓòÉΓòÉ
  15886.  
  15887. The get_myaddress() call returns the local host's internet address. 
  15888.  
  15889. Syntax 
  15890.  
  15891. #include <rpc\rpc.h>
  15892.  
  15893. void
  15894. get_myaddress(addr)
  15895. struct sockaddr_in *addr;
  15896.  
  15897. Parameters 
  15898.  
  15899. addr 
  15900.   Pointer to the location where the local internet address is placed. 
  15901.  
  15902. Description 
  15903.  
  15904. The get_myaddress() call puts the local host's internet address into addr. The 
  15905. port number (addr->sin_port) is set to htons (PMAPPORT), which is 111. 
  15906.  
  15907.  
  15908. ΓòÉΓòÉΓòÉ 16.18. getrpcbyname() ΓòÉΓòÉΓòÉ
  15909.  
  15910. The getrpcbyname() call returns an RPC program entry specified by a name in the 
  15911. RPC file. 
  15912.  
  15913. Syntax 
  15914.  
  15915. #include <rpcnetdb.h>
  15916.  
  15917. struct rpcent *getrpcbyname(name)
  15918. char  *name;
  15919.  
  15920. Parameters 
  15921.  
  15922. name 
  15923.   Pointer to the specified RPC program. 
  15924.  
  15925. Description 
  15926.  
  15927. The getrpcbyname() call sequentially searches from the beginning of the 
  15928. TCPIP\ETC\RPC file until it finds a matching RPC program name or encounters 
  15929. EOF. 
  15930.  
  15931. Return Values 
  15932.  
  15933. The getrpcbyname() call returns a pointer to an object with the rpcent 
  15934. structure for the RPC program specified on the call. The rpcent structure is 
  15935. defined in the <RPC\RPCNETDB.H> header file and contains the following 
  15936. elements: 
  15937.  
  15938. Element       Description
  15939. r_name        The name of the server for this RPC program 
  15940. r_aliases     A zero terminated list of alternate names for the RPC program 
  15941. r_number      The RPC program number for this service 
  15942.  
  15943. The return value points to static data that later calls overwrite. A pointer to 
  15944. an rpcent structure indicates success. A NULL pointer indicates an error or 
  15945. EOF. 
  15946.  
  15947. Related Calls 
  15948.  
  15949.      getrpcbynumber() 
  15950.      getrpcent() 
  15951.  
  15952.  
  15953. ΓòÉΓòÉΓòÉ 16.19. getrpcbynumber() ΓòÉΓòÉΓòÉ
  15954.  
  15955. The getrpcbynumber() call returns an RPC program entry specified by a number in 
  15956. the RPC file. 
  15957.  
  15958. Syntax 
  15959.  
  15960. #include <rpcnetdb.h>
  15961.  
  15962. struct rpcent *getrpcbynumber(number)
  15963. u_long number;
  15964.  
  15965. Parameters 
  15966.  
  15967. number 
  15968.   RPC program number. 
  15969.  
  15970. Description 
  15971.  
  15972. The getrpcbynumber() call sequentially searches from the beginning of the 
  15973. TCPIP\ETC\RPC file until it finds a matching RPC program number or encounters 
  15974. EOF. 
  15975.  
  15976. Return Values 
  15977.  
  15978. The getrpcbynumber() call returns a pointer to an object with the rpcent 
  15979. structure for the RPC program specified on the call. The rpcent structure is 
  15980. defined in <RPC\RPCNETDB.H> header file and contains the following elements: 
  15981.  
  15982. Element       Description
  15983. r_name        The name of the server for this RPC program 
  15984. r_aliases     A zero terminated list of alternate names for the RPC program 
  15985. r_number      The RPC program number for this service 
  15986.  
  15987. The return value points to static data that later calls overwrite. A pointer to 
  15988. an rpcent structure indicates success. A NULL pointer indicates an error or 
  15989. EOF. 
  15990.  
  15991. Related Calls 
  15992.  
  15993.      getrpcbyname() 
  15994.      getrpcent() 
  15995.  
  15996.  
  15997. ΓòÉΓòÉΓòÉ 16.20. getrpcent() ΓòÉΓòÉΓòÉ
  15998.  
  15999. The getrpcent() call returns the next entry in the TCPIP\ETC\RPC file. 
  16000.  
  16001. Syntax 
  16002.  
  16003. #include <rpcnetdb.h>
  16004.  
  16005. struct rpcent *getrpcent()
  16006.  
  16007. Return Values 
  16008.  
  16009. The getrpcent() call returns a pointer to the next entry in the TCPIP\ETC\RPC 
  16010. file. The rpcent structure is defined in the <RPC\RPCNETDB.H> header file and 
  16011. contains the following elements: 
  16012.  
  16013. Element       Description
  16014. r_name        The name of the server for this RPC program 
  16015. r_aliases     A zero terminated list of alternate names for the RPC program 
  16016. r_number      The RPC program number for this service 
  16017.  
  16018. The return value points to static data that later calls overwrite. A pointer to 
  16019. an rpcent structure indicates success. A NULL pointer indicates an error or 
  16020. EOF. 
  16021.  
  16022. Related Calls 
  16023.  
  16024.      getrpcbyname() 
  16025.      getrpcbynumber() 
  16026.  
  16027.  
  16028. ΓòÉΓòÉΓòÉ 16.21. pmap_getmaps() ΓòÉΓòÉΓòÉ
  16029.  
  16030. The pmap_getmaps() call returns a list of current program-to-port mappings on a 
  16031. specified remote host's Portmapper. 
  16032.  
  16033. Syntax 
  16034.  
  16035. #include <rpc\rpc.h>
  16036.  
  16037. struct pmaplist *
  16038. pmap_getmaps(addr)
  16039. struct sockaddr_in *addr;
  16040.  
  16041. Parameters 
  16042.  
  16043. addr 
  16044.   Pointer to the internet address of the remote host. 
  16045.  
  16046. Description 
  16047.  
  16048. The pmap_getmaps() call returns a list of current program-to-port mappings on 
  16049. the remote host's Portmapper specified by addr. 
  16050.  
  16051. Examples 
  16052.  
  16053. struct hostent *hp;
  16054. struct sockaddr_in pmapper_addr;
  16055. struct pmaplist *my_pmaplist = NULL;
  16056.  
  16057. if ((hp = gethostbyname("PMAP_HOST") == NULL)
  16058.   {
  16059.    fprintf(stderr,"Can't get address for %s\n","PMAP_HOST");
  16060.    exit (-1);
  16061.   }
  16062.  
  16063. bcopy(hp->h_addr, (caddr_t)&pmapper_addr.sin_addr.s_addr, hp->h_length);
  16064. pmapper_addr.sin_family = AF_INET;
  16065. pmapper_addr.sin_port = 0;
  16066.  
  16067. /*
  16068.  *  get the list of program, version, protocol and port number
  16069.  *  from remote portmapper
  16070.  *
  16071.  *     struct pmap {
  16072.  *              long unsigned pm_prog;
  16073.  *              long unsigned pm_vers;
  16074.  *              long unsigned pm_prot;
  16075.  *              long unsigned pm_port;
  16076.  *             };
  16077.  
  16078.  *     struct pmaplist {
  16079.  *             struct pmap     pml_map;
  16080.  *             struct pmaplist *pml_next;
  16081.  *            };
  16082.  */
  16083.  my_pmaplist = pmap_getmaps(&pmapper_addr);
  16084.  ...
  16085.  
  16086. Related Calls 
  16087.  
  16088.      pmap_getport() 
  16089.      pmap_rmtcall() 
  16090.      pmap_set() 
  16091.      pmap_unset() 
  16092.  
  16093.  
  16094. ΓòÉΓòÉΓòÉ 16.22. pmap_getport() ΓòÉΓòÉΓòÉ
  16095.  
  16096. The pmap_getport() call returns the port number associated with the remote 
  16097. program (prognum), the version (versnum), and the transport protocol 
  16098. (protocol). 
  16099.  
  16100. Syntax 
  16101.  
  16102. #include <rpc\rpc.h>
  16103.  
  16104. u_short
  16105. pmap_getport(addr, prognum, versnum, protocol)
  16106. struct sockaddr_in *addr;
  16107. u_long prognum;
  16108. u_long versnum;
  16109. u_long protocol;
  16110.  
  16111. Parameters 
  16112.  
  16113. addr 
  16114.   Pointer to the internet address of the remote host. 
  16115.  
  16116. prognum 
  16117.   Program number to be mapped. 
  16118.  
  16119. versnum 
  16120.   Version number of the program to be mapped. 
  16121.  
  16122. protocol 
  16123.   Transport protocol used by the program. 
  16124.  
  16125. Return Values 
  16126.  
  16127. The value 0 indicates that the mapping does not exist or that the remote 
  16128. PORTMAP could not be contacted. If Portmapper cannot be contacted, 
  16129. rpc_createerr contains the RPC status. 
  16130.  
  16131. Related Calls 
  16132.  
  16133.      pmap_getmaps() 
  16134.      pmap_rmtcall() 
  16135.      pmap_set() 
  16136.      pmap_unset() 
  16137.  
  16138.  
  16139. ΓòÉΓòÉΓòÉ 16.23. pmap_rmtcall() ΓòÉΓòÉΓòÉ
  16140.  
  16141. The pmap_rmtcall() call instructs Portmapper to make an RPC call to a procedure 
  16142. on a host on your behalf. Use this procedure only for ping-type functions. 
  16143.  
  16144. Syntax 
  16145.  
  16146. #include <rpc\rpc.h>
  16147. #include <netdb.h>
  16148.  
  16149. enum clnt_stat
  16150. pmap_rmtcall(addr, prognum, versnum, procnum , inproc, in,
  16151.              outproc, out, tout, portp)
  16152. struct sockaddr_in *addr;
  16153. u_long prognum;
  16154. u_long versnum;
  16155. u_long procnum;
  16156. xdrproc_t inproc;
  16157. char *in;
  16158. xdrproc_t outproc;
  16159. char *out;
  16160. struct timeval tout;
  16161. u_long *portp;
  16162.  
  16163. Parameters 
  16164.  
  16165. addr 
  16166.   Pointer to the internet address of the foreign host. 
  16167.  
  16168. prognum 
  16169.   Remote program number. 
  16170.  
  16171. versnum 
  16172.   Version number of the remote program. 
  16173.  
  16174. procnum 
  16175.   Procedure to be called. 
  16176.  
  16177. inproc 
  16178.   XDR procedure that encodes the arguments of the remote procedure. 
  16179.  
  16180. in 
  16181.   Pointer to the arguments of the remote procedure. 
  16182.  
  16183. outproc 
  16184.   XDR procedure that decodes the results of the remote procedure. 
  16185.  
  16186. out 
  16187.   Pointer to the results of the remote procedure. 
  16188.  
  16189. tout 
  16190.   Time-out period for the remote request. 
  16191.  
  16192. portp 
  16193.   Port number of the triple (prognum, versnum, procnum), if the call from the 
  16194.   remote PORTMAP service succeeds. 
  16195.  
  16196. Return Values 
  16197.  
  16198. RPC_SUCCESS indicates success; otherwise, an error has occurred. The results of 
  16199. the remote procedure call return to out. 
  16200.  
  16201. Examples 
  16202.  
  16203. int inproc, outproc,rc;
  16204. u_long portp;
  16205. struct timeval total_timeout;
  16206. struct sockaddr_in *addr;
  16207. ...
  16208. get_myaddress(addr);
  16209. ...
  16210. total_timeout.tv_sec = 20;
  16211. total_timeout.tv_usec = 0;
  16212.  
  16213. rc = pmap_rmtcall(addr,RMTPROGNUM,RMTPROGVER,RMTPROCNUM,xdr_int,
  16214. &inproc,xdr_int,&outproc,total_timeout,&portp);
  16215. if (rc != 0)
  16216.  {
  16217.   fprintf(stderr,"error: pmap_rmtcall() failed: %d \n",rc);
  16218.   clnt_perrno(rc);
  16219.   exit(1);
  16220.  }
  16221.  
  16222. Related Calls 
  16223.  
  16224.      pmap_getmaps() 
  16225.      pmap_getport() 
  16226.      pmap_set() 
  16227.      pmap_unset() 
  16228.  
  16229.  
  16230. ΓòÉΓòÉΓòÉ 16.24. pmap_set() ΓòÉΓòÉΓòÉ
  16231.  
  16232. The pmap_set() call sets the mapping of the program (specified by prognum, 
  16233. versnum, and protocol) to port on the local machine's Portmapper. This 
  16234. procedure is automatically called by the svc_register() procedure. 
  16235.  
  16236. Syntax 
  16237.  
  16238. #include <rpc\rpc.h>
  16239.  
  16240. bool_t
  16241. pmap_set(prognum, versnum, protocol, port)
  16242. u_long prognum;
  16243. u_long versnum;
  16244. u_long protocol;
  16245. u_short port;
  16246.  
  16247. Parameters 
  16248.  
  16249. prognum 
  16250.   Local program number. 
  16251.  
  16252. versnum 
  16253.   Version number of the local program. 
  16254.  
  16255. protocol 
  16256.   Transport protocol used by the local program. 
  16257.  
  16258. port 
  16259.   Port to which the local program is mapped. 
  16260.  
  16261. Return Values 
  16262.  
  16263. The value 1 indicates success; the value 0 indicates an error. 
  16264.  
  16265. Related Calls 
  16266.  
  16267.      pmap_getmaps() 
  16268.      pmap_getport() 
  16269.      pmap_rmtcall() 
  16270.      pmap_unset() 
  16271.  
  16272.  
  16273. ΓòÉΓòÉΓòÉ 16.25. pmap_unset() ΓòÉΓòÉΓòÉ
  16274.  
  16275. The pmap_unset() call removes the mappings associated with prognum and versnum 
  16276. on the local machine's Portmapper. All ports for each transport protocol 
  16277. currently mapping the prognum and versnum are removed from the PORTMAP service. 
  16278.  
  16279. Syntax 
  16280.  
  16281. #include <rpc\rpc.h>
  16282.  
  16283. bool_t
  16284. pmap_unset(prognum, versnum)
  16285. u_long prognum;
  16286. u_long versnum;
  16287.  
  16288. Parameters 
  16289.  
  16290. prognum 
  16291.   Local program number. 
  16292.  
  16293. versnum 
  16294.   Version number of the local program. 
  16295.  
  16296. Return Values 
  16297.  
  16298. The value 1 indicates success; the value 0 indicates an error. 
  16299.  
  16300. Examples 
  16301.  
  16302. #define RMTPROGNUM   (u_long)0x3fffffffL
  16303. #define RMTPROGVER   (u_long)0x1L
  16304. ...
  16305. /* remove the mapping of remote program */
  16306. /* and its port from local Portmapper   */
  16307. pmap_unset(RMTPROGNUM, RMTPROGVER);
  16308. ...
  16309.  
  16310. Related Calls 
  16311.  
  16312.      pmap_getmaps() 
  16313.      pmap_getport() 
  16314.      pmap_rmtcall() 
  16315.      pmap_set() 
  16316.  
  16317.  
  16318. ΓòÉΓòÉΓòÉ 16.26. registerrpc() ΓòÉΓòÉΓòÉ
  16319.  
  16320. The registerrpc() call registers a procedure with the local Portmapper and 
  16321. creates a control structure to remember the server procedure and its XDR 
  16322. routine. The svc_run() call uses the control structure. Procedures registered 
  16323. using registerrpc() are accessed using the UDP transport layer. 
  16324.  
  16325. Syntax 
  16326.  
  16327. #include <rpc\rpc.h>
  16328.  
  16329. int
  16330. registerrpc(prognum, versnum, procnum, procname, inproc, outproc)
  16331. u_long prognum;
  16332. u_long versnum;
  16333. u_long procnum;
  16334. char *(*procname) ();
  16335. xdrproc_t inproc;
  16336. xdrproc_t outproc;
  16337.  
  16338. Parameters 
  16339.  
  16340. prognum 
  16341.   Program number to register. 
  16342.  
  16343. versnum 
  16344.   Version number to register. 
  16345.  
  16346. procnum 
  16347.   Procedure number to register. 
  16348.  
  16349. procname 
  16350.   Procedure that is called when the registered program is requested. procname 
  16351.   must accept a pointer to its arguments and return a static pointer to its 
  16352.   results. 
  16353.  
  16354. inproc 
  16355.   XDR procedure that decodes the arguments. 
  16356.  
  16357. outproc 
  16358.   XDR procedure that encodes the results. 
  16359.  
  16360. Note:  You cannot use xdr_enum() as an argument to registerrpc(). See 
  16361.        xdr_enum() for more information. 
  16362.  
  16363. Return Values 
  16364.  
  16365. The value 0 indicates success; the value -1 indicates an error. 
  16366.  
  16367. Examples 
  16368.  
  16369. #define RMTPROGNUM (u_long)0x3fffffffL
  16370. #define RMTPROGVER (u_long)0x1
  16371. #define RMTPROCNUM (u_long)0x1
  16372.  
  16373. main()
  16374.  {
  16375.   int *rmtprog();
  16376.  
  16377.   /* register remote program with Portmapper */
  16378.   registerrpc(RMTPROGNUM, RMTPROGVER, RMTPROCNUM, rmtprog,
  16379.   xdr_int, xdr_int);
  16380.  
  16381.   /* infinite loop, waits for RPC request from client */
  16382.   svc_run();
  16383.   printf("Error: svc_run should never reach this point \n");
  16384.   exit(1);
  16385.  }
  16386.  
  16387. int *
  16388. rmtprog(inproc)          /* remote program */
  16389. int *inproc;
  16390.  
  16391. {
  16392.  int *outproc;
  16393.  ...
  16394.  /* Process request */
  16395.  ...
  16396.  return (outproc);
  16397. }
  16398.  
  16399. Related Calls 
  16400.  
  16401.      svc_register() 
  16402.      svc_run() 
  16403.  
  16404.  
  16405. ΓòÉΓòÉΓòÉ 16.27. rpc_createerr ΓòÉΓòÉΓòÉ
  16406.  
  16407. The rpc_createerr global variable is set when any RPC client creation routine 
  16408. fails. Use clnt_pcreateerror() to print the message. 
  16409.  
  16410. Syntax 
  16411.  
  16412. #include <rpc\rpc.h>
  16413.  
  16414. struct  rpc_createerr rpc_createerr;
  16415.  
  16416.  
  16417. ΓòÉΓòÉΓòÉ 16.28. svc_destroy() ΓòÉΓòÉΓòÉ
  16418.  
  16419. The svc_destroy() call deletes the RPC service transport handle xprt, which 
  16420. becomes undefined after this routine is called. 
  16421.  
  16422. Syntax 
  16423.  
  16424. #include <rpc\rpc.h>
  16425.  
  16426. void
  16427. svc_destroy(xprt)
  16428. SVCXPRT *xprt;
  16429.  
  16430. Parameter 
  16431.  
  16432. xprt 
  16433.   Pointer to the service transport handle. 
  16434.  
  16435. Related Calls 
  16436.  
  16437.      svcraw_create() 
  16438.      svctcp_create() 
  16439.      svcudp_create() 
  16440.  
  16441.  
  16442. ΓòÉΓòÉΓòÉ 16.29. svc_freeargs() ΓòÉΓòÉΓòÉ
  16443.  
  16444. The svc_freeargs() call frees storage allocated to decode the arguments 
  16445. received by svc_getargs(). 
  16446.  
  16447. Syntax 
  16448.  
  16449. #include <rpc\rpc.h>
  16450.  
  16451. bool_t
  16452. svc_freeargs(xprt, inproc, in)
  16453. SVCXPRT *xprt;
  16454. xdrproc_t inproc;
  16455. char *in;
  16456.  
  16457. Parameters 
  16458.  
  16459. xprt 
  16460.   Pointer to the service transport handle. 
  16461.  
  16462. inproc 
  16463.   XDR routine that decodes the arguments. 
  16464.  
  16465. in 
  16466.   Pointer to the input arguments. 
  16467.  
  16468. Return Values 
  16469.  
  16470. The value 1 indicates success; the value 0 indicates an error. 
  16471.  
  16472. Related Calls 
  16473.  
  16474.      svc_getargs() 
  16475.  
  16476.  
  16477. ΓòÉΓòÉΓòÉ 16.30. svc_getargs() ΓòÉΓòÉΓòÉ
  16478.  
  16479. The svc_getargs() call uses the XDR routine inproc to decode the arguments of 
  16480. an RPC request associated with the RPC service transport handle xprt. The 
  16481. results are placed at address in. 
  16482.  
  16483. Syntax 
  16484.  
  16485. #include <rpc\rpc.h>
  16486.  
  16487. bool_t
  16488. svc_getargs(xprt, inproc, in)
  16489. SVCXPRT *xprt;
  16490. xdrproc_t inproc;
  16491. char *in;
  16492.  
  16493. Parameters 
  16494.  
  16495. xprt 
  16496.   Pointer to the service transport handle. 
  16497.  
  16498. inproc 
  16499.   XDR routine that decodes the arguments. 
  16500.  
  16501. in 
  16502.   Pointer to the decoded arguments. 
  16503.  
  16504. Return Values 
  16505.  
  16506. The value 1 indicates success; the value 0 indicates an error. 
  16507.  
  16508. Examples 
  16509.  
  16510. #define RMTPROGNUM   (u_long)0x3fffffffL
  16511. #define RMTPROGVER   (u_long)0x1L
  16512.  
  16513. ...
  16514.  
  16515. SVCXPRT *transp;
  16516.  
  16517. transp = svcudp_create(RPC_ANYSOCK);
  16518. if (transp == NULL)
  16519.    {
  16520.     fprintf(stderr, "can't create an RPC server transport\n");
  16521.     exit(-1);
  16522.    }
  16523. pmap_unset(RMTPROGNUM, RMTPROGVER);
  16524. if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  16525.    {
  16526.     fprintf(stderr, "can't register rmtprog() service\n");
  16527.     exit(-1);
  16528.    }
  16529. printf("rmtprog() service registered.\n");
  16530.  
  16531. svc_run();
  16532. printf("Error:svc_run should never reach this point \n");
  16533. exit(1);
  16534. ...
  16535.  
  16536. rmtprog(rqstp, transp)
  16537. struct svc_req *rqstp;
  16538. SVCXPRT *transp;
  16539. {
  16540.     int intrecv;
  16541.  
  16542.     switch((int)rqstp->rq_proc)
  16543.        {
  16544.            case PROCNUM1:
  16545.                     svc_getargs(transp, xdr_int, &intrecv);
  16546.                       ...
  16547.                     return;
  16548.            case PROCNUM2:
  16549.              ...
  16550.        }
  16551. ...
  16552. }
  16553.  
  16554. Related Calls 
  16555.  
  16556.      svc_freeargs() 
  16557.  
  16558.  
  16559. ΓòÉΓòÉΓòÉ 16.31. svc_getcaller() ΓòÉΓòÉΓòÉ
  16560.  
  16561. The svc_getcaller() call gets the network address of the client associated with 
  16562. the service transport handle. 
  16563.  
  16564. Syntax 
  16565.  
  16566. #include <rpc\rpc.h>
  16567.  
  16568. struct sockaddr_in *
  16569. svc_getcaller(xprt)
  16570. SVCXPRT *xprt;
  16571.  
  16572. Parameters 
  16573.  
  16574. xprt 
  16575.   Pointer to the service transport handle. 
  16576.  
  16577.  
  16578. ΓòÉΓòÉΓòÉ 16.32. svc_getreq() ΓòÉΓòÉΓòÉ
  16579.  
  16580. The svc_getreq() call implements asynchronous event processing and returns 
  16581. control to the program after all sockets have been serviced. 
  16582.  
  16583. Syntax 
  16584.  
  16585. #include <rpc\rpc.h>
  16586.  
  16587. void
  16588. svc_getreq(socks, noavail)
  16589. int socks[];
  16590. int noavail;
  16591.  
  16592. Parameters 
  16593.  
  16594. socks 
  16595.   Array of socket descriptors. 
  16596.  
  16597. noavail 
  16598.   Integer specifying the number of socket descriptors in the array. 
  16599.  
  16600. Description 
  16601.  
  16602. Use the svc_getreq() call rather than svc_run() to do asynchronous event 
  16603. processing. The routine returns control to the program when all sockets in the 
  16604. socks array have been serviced. 
  16605.  
  16606. Related Calls 
  16607.  
  16608.      svc_run() 
  16609.      svc_socks[ ] 
  16610.  
  16611.  
  16612. ΓòÉΓòÉΓòÉ 16.33. svc_register() ΓòÉΓòÉΓòÉ
  16613.  
  16614. The svc_register() call registers procedures on the local Portmapper. 
  16615.  
  16616. Syntax 
  16617.  
  16618. #include <rpc\rpc.h>
  16619. #include <netdb.h>
  16620.  
  16621. bool_t
  16622. svc_register(xprt, prognum, versnum, dispatch, protocol)
  16623. SVCXPRT *xprt;
  16624. u_long prognum;
  16625. u_long versnum;
  16626. void (*dispatch) ();
  16627. int protocol;
  16628.  
  16629. Parameters 
  16630.  
  16631. xprt 
  16632.   Pointer to the service transport handle. 
  16633.  
  16634. prognum 
  16635.   Program number to be registered. 
  16636.  
  16637. versnum 
  16638.   Version number of the program to be registered. 
  16639.  
  16640. dispatch 
  16641.   Dispatch routine associated with prognum and versnum. The structure of the 
  16642.   dispatch routine is as follows: 
  16643.  
  16644.     dispatch(request, xprt)
  16645.     struct svc_req *request;
  16646.     SVCXPRT *xprt;
  16647.  
  16648. protocol 
  16649.   Protocol used. The value is generally one of the following: 
  16650.  
  16651.       0 (zero) 
  16652.       IPPROTO_UDP 
  16653.       IPPROTO_TCP 
  16654.  
  16655.   When you use a value of 0, the service is not registered with Portmapper. 
  16656.  
  16657. Description 
  16658.  
  16659. The svc_register() call associates the specified program with the service 
  16660. dispatch routine dispatch. 
  16661.  
  16662. Note:  When you use a toy RPC service transport created with svcraw_create(), 
  16663.        make a call to xprt_register() immediately after a call to 
  16664.        svc_register(). 
  16665.  
  16666. Return Values 
  16667.  
  16668. The value 1 indicates success; the value 0 indicates an error. 
  16669.  
  16670. Examples 
  16671.  
  16672. #define RMTPROGNUM   (u_long)0x3fffffffL
  16673. #define RMTPROGVER   (u_long)0x1L
  16674.  
  16675. SVCXPRT *transp;
  16676.  
  16677. /* register the remote program with local Portmapper */
  16678. if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  16679.       {
  16680.        fprintf(stderr, "can't register rmtprog() service\n");
  16681.        exit(-1);
  16682.       }
  16683.  
  16684. /* code for remote program; rmtprog  */
  16685. rmtprog(rqstp, transp)
  16686. struct svc_req *rqstp;
  16687. SVCXPRT *transp;
  16688.   {
  16689.      ...
  16690.   }
  16691.  
  16692. Related Calls 
  16693.  
  16694.      registerrpc() 
  16695.      svc_unregister() 
  16696.      xprt_register() 
  16697.  
  16698.  
  16699. ΓòÉΓòÉΓòÉ 16.34. svc_run() ΓòÉΓòÉΓòÉ
  16700.  
  16701. The svc_run() call accepts RPC requests and calls the appropriate service using 
  16702. svc_getreq(). The svc_run() call does not return control to the caller. 
  16703.  
  16704. Syntax 
  16705.  
  16706. #include <rpc\rpc.h>
  16707.  
  16708. void
  16709. svc_run()
  16710.  
  16711. Examples 
  16712.  
  16713. #define RMTPROGNUM   (u_long)0x3fffffffL
  16714. #define RMTPROGVER   (u_long)0x1L
  16715.  
  16716. ...
  16717.  
  16718. SVCXPRT *transp;
  16719.  
  16720. transp = svcudp_create(RPC_ANYSOCK);
  16721. if (transp == NULL)
  16722.    {
  16723.     fprintf(stderr, "can't create an RPC server transport\n");
  16724.     exit(-1);
  16725.    }
  16726. pmap_unset(RMTPROGNUM, RMTPROGVER);
  16727. if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  16728.    {
  16729.     fprintf(stderr, "can't register rmtprog() service\n");
  16730.     exit(-1);
  16731.    }
  16732. printf("rmtprog() service registered.\n");
  16733.  
  16734. svc_run();
  16735.  
  16736. printf("Error:svc_run should never reach this point \n");
  16737. exit(1);
  16738. ...
  16739.  
  16740. rmtprog(rqstp, transp)
  16741. struct svc_req *rqstp;
  16742. SVCXPRT *transp;
  16743.  {
  16744.  ...
  16745.  }
  16746.  
  16747. Related Calls 
  16748.  
  16749.      registerrpc() 
  16750.      svc_getreq() 
  16751.  
  16752.  
  16753. ΓòÉΓòÉΓòÉ 16.35. svc_sendreply() ΓòÉΓòÉΓòÉ
  16754.  
  16755. The svc_sendreply() call sends the results of an RPC to the caller. 
  16756.  
  16757. Syntax 
  16758.  
  16759. #include <rpc\rpc.h>
  16760.  
  16761. bool_t
  16762. svc_sendreply(xprt, outproc, out)
  16763. SVCXPRT *xprt;
  16764. xdrproc_t outproc;
  16765. char *out;
  16766.  
  16767. Parameters 
  16768.  
  16769. xprt 
  16770.   Pointer to the caller's transport handle. 
  16771.  
  16772. outproc 
  16773.   XDR procedure that encodes the results. 
  16774.  
  16775. out 
  16776.   Pointer to the results. 
  16777.  
  16778. Description 
  16779.  
  16780. The service dispatch routine calls the svc_sendreply() call to send the results 
  16781. of the call to the caller. 
  16782.  
  16783. Return Values 
  16784.  
  16785. The value 1 indicates success; the value 0 indicates an error. 
  16786.  
  16787. Examples 
  16788.  
  16789. #define RMTPROGNUM   (u_long)0x3fffffffL
  16790. #define RMTPROGVER   (u_long)0x1L
  16791.  
  16792. ...
  16793.  
  16794. SVCXPRT *transp;
  16795.  
  16796. transp = svcudp_create(RPC_ANYSOCK);
  16797. if (transp == NULL)
  16798.    {
  16799.     fprintf(stderr, "can't create an RPC server transport\n");
  16800.     exit(-1);
  16801.    }
  16802. pmap_unset(RMTPROGNUM, RMTPROGVER);
  16803. if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP))
  16804.    {
  16805.     fprintf(stderr, "can't register rmtprog() service\n");
  16806.     exit(-1);
  16807.    }
  16808. printf("rmtprog() service registered.\n");
  16809.  
  16810. svc_run();
  16811.  
  16812. printf("Error:svc_run should never reach this point \n");
  16813. exit(1);
  16814. ...
  16815.  
  16816.  
  16817. rmtprog(rqstp, transp)
  16818. struct svc_req *rqstp;
  16819. SVCXPRT *transp;
  16820. {
  16821.  
  16822.     int intrecv;
  16823.     int replysend;
  16824.     switch((int)rqstp->rq_proc)
  16825.      {
  16826.         case PROCNUM0:
  16827.            svc_getargs(transp, xdr_int, &intrecv);
  16828.                       ...
  16829.            /* process intrecv parameter */
  16830.            replysend = ( intrecv * 1000) + 100;
  16831.            /*  send reply to client */
  16832.            if (!svc_sendreply(transp, xdr_int, &replysend))
  16833.               {
  16834.                fprintf(stderr,"can't reply to RPC call\n");
  16835.                exit(-1);
  16836.               }
  16837.            return;
  16838.         case PROCNUM1:
  16839.            ...
  16840.      }
  16841. ...
  16842. }
  16843.  
  16844.  
  16845. ΓòÉΓòÉΓòÉ 16.36. svc_socks[ ] ΓòÉΓòÉΓòÉ
  16846.  
  16847. The array svc_socks[ ] is an array of socket descriptors being serviced. The 
  16848. integer noregistered specifies the number of socket descriptors in 
  16849. svc_socks[ ]. 
  16850.  
  16851. Syntax 
  16852.  
  16853. #include <rpc\rpc.h>
  16854.  
  16855. int svc_socks[ ];
  16856.  
  16857. #include <rpc\rpc.h>
  16858.  
  16859. int noregistered;
  16860.  
  16861. Related Calls 
  16862.  
  16863.      svc_getreq() 
  16864.  
  16865.  
  16866. ΓòÉΓòÉΓòÉ 16.37. svc_unregister() ΓòÉΓòÉΓòÉ
  16867.  
  16868. The svc_unregister() call removes all local mappings of prognum versnum to 
  16869. dispatch routines (prognum, versnum, *) and to port numbers. 
  16870.  
  16871. Syntax 
  16872.  
  16873. #include <rpc\rpc.h>
  16874.  
  16875. void
  16876. svc_unregister(prognum, versnum)
  16877. u_long prognum;
  16878. u_long versnum;
  16879.  
  16880. Parameters 
  16881.  
  16882. prognum 
  16883.   Program number of the removed program. 
  16884.  
  16885. versnum 
  16886.   Version number of the removed program. 
  16887.  
  16888. Examples 
  16889.  
  16890. #define RMTPROGNUM   (u_long)0x3fffffffL
  16891. #define RMTPROGVER   (u_long)0x1L
  16892. ...
  16893.   /* unregister remote program from local Portmapper */
  16894.   svc_unregister(RMTPROGNUM, RMTPROGVER);
  16895. ...
  16896.  
  16897. Related Calls 
  16898.  
  16899.      svc_register() 
  16900.  
  16901.  
  16902. ΓòÉΓòÉΓòÉ 16.38. svcerr_auth() ΓòÉΓòÉΓòÉ
  16903.  
  16904. The svcerr_auth() call sends an error reply when the service dispatch routine 
  16905. cannot execute an RPC request because of authentication errors. 
  16906.  
  16907. Syntax 
  16908.  
  16909. #include <rpc\rpc.h>
  16910.  
  16911. void
  16912. svcerr_auth(xprt, why)
  16913. SVCXPRT *xprt;
  16914. enum auth_stat why;
  16915.  
  16916. Parameters 
  16917.  
  16918. xprt 
  16919.   Pointer to the service transport handle. 
  16920.  
  16921. why 
  16922.   Reason why the call is refused. 
  16923.  
  16924. Description 
  16925.  
  16926. A service dispatch routine that refuses to run an RPC request because of 
  16927. authentication errors calls svcerr_auth(). 
  16928.  
  16929. Related Calls 
  16930.  
  16931.      svcerr_decode() 
  16932.      svcerr_noproc() 
  16933.      svcerr_noprog() 
  16934.      svcerr_progvers() 
  16935.      svcerr_systemerr() 
  16936.      svcerr_weakauth() 
  16937.  
  16938.  
  16939. ΓòÉΓòÉΓòÉ 16.39. svcerr_decode() ΓòÉΓòÉΓòÉ
  16940.  
  16941. The svcerr_decode() call sends an error reply when the service dispatch routine 
  16942. cannot decode its parameters. 
  16943.  
  16944. Syntax 
  16945.  
  16946. #include <rpc\rpc.h>
  16947.  
  16948. void
  16949. svcerr_decode(xprt)
  16950. SVCXPRT *xprt;
  16951.  
  16952. Parameters 
  16953.  
  16954. xprt 
  16955.   Pointer to the service transport handle. 
  16956.  
  16957. Description 
  16958.  
  16959. A service dispatch routine that cannot decode its parameters calls 
  16960. svcerr_decode(). 
  16961.  
  16962. Related Calls 
  16963.  
  16964.      svcerr_auth() 
  16965.      svcerr_noproc() 
  16966.      svcerr_noprog() 
  16967.      svcerr_progvers() 
  16968.      svcerr_systemerr() 
  16969.      svcerr_weakauth() 
  16970.  
  16971.  
  16972. ΓòÉΓòÉΓòÉ 16.40. svcerr_noproc() ΓòÉΓòÉΓòÉ
  16973.  
  16974. The svcerr_noproc() call sends an error reply when the service dispatch routine 
  16975. cannot call the procedure requested. 
  16976.  
  16977. Syntax 
  16978.  
  16979. #include <rpc\rpc.h>
  16980.  
  16981. void
  16982. svcerr_noproc(xprt)
  16983. SVCXPRT *xprt;
  16984.  
  16985. Parameters 
  16986.  
  16987. xprt 
  16988.   Pointer to the service transport handle. 
  16989.  
  16990. Description 
  16991.  
  16992. A service dispatch routine that does not implement the requested procedure 
  16993. calls the svcerr_noproc() call. 
  16994.  
  16995. Related Calls 
  16996.  
  16997.      svcerr_auth() 
  16998.      svcerr_decode() 
  16999.      svcerr_noprog() 
  17000.      svcerr_progvers() 
  17001.      svcerr_systemerr() 
  17002.      svcerr_weakauth() 
  17003.  
  17004.  
  17005. ΓòÉΓòÉΓòÉ 16.41. svcerr_noprog() ΓòÉΓòÉΓòÉ
  17006.  
  17007. The svcerr_noprog() call sends an error code when the requested program is not 
  17008. registered. 
  17009.  
  17010. Syntax 
  17011.  
  17012. #include <rpc\rpc.h>
  17013.  
  17014. void
  17015. svcerr_noprog(xprt)
  17016. SVCXPRT *xprt;
  17017.  
  17018. Parameters 
  17019.  
  17020. xprt 
  17021.   Pointer to the service transport handle. 
  17022.  
  17023. Description 
  17024.  
  17025. Use the svcerr_noprog() call when the desired program is not registered. 
  17026.  
  17027. Related Calls 
  17028.  
  17029.      svcerr_auth() 
  17030.      svcerr_decode() 
  17031.      svcerr_noproc() 
  17032.      svcerr_progvers() 
  17033.      svcerr_systemerr() 
  17034.      svcerr_weakauth() 
  17035.  
  17036.  
  17037. ΓòÉΓòÉΓòÉ 16.42. svcerr_progvers() ΓòÉΓòÉΓòÉ
  17038.  
  17039. The svcerr_progvers() call sends the low version number and high version number 
  17040. of RPC service when the version numbers of two RPC programs do not match. 
  17041.  
  17042. Syntax 
  17043.  
  17044. #include <rpc\rpc.h>
  17045.  
  17046. void
  17047. svcerr_progvers(xprt, low_vers, high_vers)
  17048. SVCXPRT *xprt;
  17049. u_long low_vers;
  17050. u_long high_vers;
  17051.  
  17052. Parameters 
  17053.  
  17054. xprt 
  17055.   Pointer to the service transport handle. 
  17056.  
  17057. low_vers 
  17058.   Low version number. 
  17059.  
  17060. high_vers 
  17061.   High version number. 
  17062.  
  17063. Description 
  17064.  
  17065. A service dispatch routine calls the svcerr_progvers() call when the version 
  17066. numbers of two RPC programs do not match. The call sends the supported low 
  17067. version and high version of RPC service. 
  17068.  
  17069. Related Calls 
  17070.  
  17071.      svcerr_decode() 
  17072.      svcerr_noproc() 
  17073.      svcerr_noprog() 
  17074.      svcerr_systemerr() 
  17075.      svcerr_weakauth() 
  17076.  
  17077.  
  17078. ΓòÉΓòÉΓòÉ 16.43. svcerr_systemerr() ΓòÉΓòÉΓòÉ
  17079.  
  17080. The svcerr_systemerr() call sends an error reply when the service dispatch 
  17081. routine detects a system error that has not been handled. 
  17082.  
  17083. Syntax 
  17084.  
  17085. #include <rpc\rpc.h>
  17086.  
  17087. void
  17088. svcerr_systemerr(xprt)
  17089. SVCXPRT *xprt;
  17090.  
  17091. Parameters 
  17092.  
  17093. xprt 
  17094.   Pointer to the service transport handle. 
  17095.  
  17096. Description 
  17097.  
  17098. A service dispatch routine calls the svcerr_systemerr() call when it detects a 
  17099. system error that is not handled by the protocol. 
  17100.  
  17101. Related Calls 
  17102.  
  17103.      svcerr_auth() 
  17104.      svcerr_decode() 
  17105.      svcerr_noproc() 
  17106.      svcerr_noprog() 
  17107.      svcerr_progvers() 
  17108.      svcerr_weakauth() 
  17109.  
  17110.  
  17111. ΓòÉΓòÉΓòÉ 16.44. svcerr_weakauth() ΓòÉΓòÉΓòÉ
  17112.  
  17113. The svcerr_weakauth() call sends an error reply when the service dispatch 
  17114. routine cannot run an RPC because of weak authentication parameters. 
  17115.  
  17116. Syntax 
  17117.  
  17118. #include <rpc\rpc.h>
  17119.  
  17120. void
  17121. svcerr_progvers(xprt)
  17122. SVCXPRT *xprt;
  17123.  
  17124. Parameters 
  17125.  
  17126. xprt 
  17127.   Pointer to the service transport handle. 
  17128.  
  17129. Description 
  17130.  
  17131. A service dispatch routine calls the svcerr_weakauth() call when it cannot run 
  17132. an RPC because of correct but weak authentication parameters 
  17133.  
  17134. Note:  This is the equivalent of svcerr_auth(xprt, AUTH_TOOWEAK). 
  17135.  
  17136. Related Calls 
  17137.  
  17138.      svcerr_auth() 
  17139.      svcerr_decode() 
  17140.      svcerr_noproc() 
  17141.      svcerr_noprog() 
  17142.      svcerr_progvers() 
  17143.      svcerr_systemerr() 
  17144.  
  17145.  
  17146. ΓòÉΓòÉΓòÉ 16.45. svcraw_create() ΓòÉΓòÉΓòÉ
  17147.  
  17148. The svcraw_create() call creates a local RPC service transport handle to 
  17149. simulate RPC programs within one host. 
  17150.  
  17151. Syntax 
  17152.  
  17153. #include <rpc\rpc.h>
  17154.  
  17155. SVCXPRT *
  17156. svcraw_create()
  17157.  
  17158. Description 
  17159.  
  17160. The svcraw_create() call creates a local RPC service transport used for 
  17161. timings, to which it returns a pointer. Because messages are passed using a 
  17162. buffer within the address space of the local process, the client process must 
  17163. also use the same address space. This allows the simulation of RPC programs 
  17164. within one host. See clntraw_create() for more information. 
  17165.  
  17166. Return Values 
  17167.  
  17168. NULL indicates failure. 
  17169.  
  17170. Related Calls 
  17171.  
  17172.      clntraw_create() 
  17173.      svc_destroy() 
  17174.      svctcp_create() 
  17175.      svcudp_create() 
  17176.  
  17177.  
  17178. ΓòÉΓòÉΓòÉ 16.46. svctcp_create() ΓòÉΓòÉΓòÉ
  17179.  
  17180. The svctcp_create() call creates a TCP-based service transport. 
  17181.  
  17182. Syntax 
  17183.  
  17184. #include <rpc\rpc.h>
  17185.  
  17186. SVCXPRT *
  17187. svctcp_create(sock, send_buf_size, recv_buf_size)
  17188. int sock;
  17189. u_int send_buf_size;
  17190. u_int recv_buf_size;
  17191.  
  17192. Parameters 
  17193.  
  17194. sock 
  17195.   Socket descriptor. If sock is RPC_ANYSOCK, a new socket is created. If the 
  17196.   socket is not bound to a local TCP port, it is bound to an arbitrary port. 
  17197.  
  17198. send_buf_size 
  17199.   Size of the send buffer. Specify 0 if you want the call to pick a suitable 
  17200.   default value. 
  17201.  
  17202. recv_buf_size 
  17203.   Size of the receive buffer. Specify 0 if you want the call to pick a suitable 
  17204.   default value. 
  17205.  
  17206. Description 
  17207.  
  17208. The svctcp_create() call creates a TCP-based service transport to which it 
  17209. returns a pointer. xprt->xp_sock contains the transport's socket descriptor; 
  17210. xprt->xp_port contains the transport's port number. 
  17211.  
  17212. Return Values 
  17213.  
  17214. NULL indicates failure. 
  17215.  
  17216. Examples 
  17217.  
  17218. ...
  17219. SVCXPRT *transp;
  17220.  
  17221. transp = svctcp_create(RPC_ANYSOCK, 1024*10, 1024*10);
  17222. ...
  17223.  
  17224. Related Calls 
  17225.  
  17226.      svc_destroy() 
  17227.      svcraw_create() 
  17228.      svcudp_create() 
  17229.  
  17230.  
  17231. ΓòÉΓòÉΓòÉ 16.47. svcudp_create() ΓòÉΓòÉΓòÉ
  17232.  
  17233. The svcudp_create() call creates a UDP-based service transport. 
  17234.  
  17235. Syntax 
  17236.  
  17237. #include <rpc\rpc.h>
  17238.  
  17239. SVCXPRT *
  17240. svcudp_create(sockp)
  17241. int sockp;
  17242.  
  17243. Parameters 
  17244.  
  17245. sockp 
  17246.   The socket number associated with the service transport handle. If sockp is 
  17247.   RPC_ANYSOCK, a new socket is created.  If the socket is not bound to a local 
  17248.   port, it is bound to an arbitrary port. 
  17249.  
  17250. Description 
  17251.  
  17252. The svcudp_create() call creates a UDP-based service transport to which it 
  17253. returns a pointer. xprt->xp_sock contains the transport's socket descriptor. 
  17254. xprt->xp_port contains the transport's port number. 
  17255.  
  17256. Return Values 
  17257.  
  17258. NULL indicates failure. 
  17259.  
  17260. Examples 
  17261.  
  17262. ...
  17263. SVCXPRT *transp;
  17264.  
  17265. transp = svcudp_create(RPC_ANYSOCK);
  17266. ...
  17267.  
  17268. Related Calls 
  17269.  
  17270.      svc_destroy() 
  17271.      svcraw_create() 
  17272.      svctcp_create() 
  17273.  
  17274.  
  17275. ΓòÉΓòÉΓòÉ 16.48. xdr_accepted_reply() ΓòÉΓòÉΓòÉ
  17276.  
  17277. The xdr_accepted_reply() call translates between an RPC reply message and its 
  17278. external representation. 
  17279.  
  17280. Syntax 
  17281.  
  17282. #include <rpc\rpc.h>
  17283.  
  17284. bool_t
  17285. xdr_accepted_reply(xdrs, ar)
  17286. XDR *xdrs;
  17287. struct accepted_reply *ar;
  17288.  
  17289. Parameters 
  17290.  
  17291. xdrs 
  17292.   Pointer to an XDR stream. 
  17293.  
  17294. ar 
  17295.   Pointer to the reply to be represented. 
  17296.  
  17297. Return Values 
  17298.  
  17299. The value 1 indicates success; the value 0 indicates an error. 
  17300.  
  17301.  
  17302. ΓòÉΓòÉΓòÉ 16.49. xdr_array() ΓòÉΓòÉΓòÉ
  17303.  
  17304. The xdr_array() call translates between an array and its external 
  17305. representation. 
  17306.  
  17307. Syntax 
  17308.  
  17309. #include <rpc\rpc.h>
  17310.  
  17311. bool_t
  17312. xdr_array(xdrs, arrp, sizep, maxsize, elsize, elproc)
  17313. XDR *xdrs;
  17314. char **arrp;
  17315. u_int *sizep;
  17316. u_int maxsize;
  17317. u_int elsize;
  17318. xdrproc_t elproc;
  17319.  
  17320. Parameters 
  17321.  
  17322. xdrs 
  17323.   Pointer to an XDR stream. 
  17324.  
  17325. arrp 
  17326.   Address of the pointer to the array. 
  17327.  
  17328. sizep 
  17329.   Pointer to the element count of the array. 
  17330.  
  17331. maxsize 
  17332.   Maximum number of elements accepted. 
  17333.  
  17334. elsize 
  17335.   Size of each of the array's elements, found using sizeof(). 
  17336.  
  17337. elproc 
  17338.   XDR routine that translates an individual array element. 
  17339.  
  17340. Return Values 
  17341.  
  17342. The value 1 indicates success; the value 0 indicates an error. 
  17343.  
  17344. Examples 
  17345.  
  17346. struct myarray
  17347.    {
  17348.     int  *arrdata;
  17349.     u_int   arrlength;
  17350.    };
  17351.  
  17352. void
  17353. xdr_myarray(xdrsp,arrp)
  17354. XDR  *xdrsp;
  17355. struct myarray *arrp;
  17356. {
  17357.   xdr_array(xdrsp,(caddr_t *)&arrp->arrdata,&arrp->arrlength,
  17358.                                     MAXLEN,sizeof(int),xdr_int);
  17359. }
  17360.  
  17361. ...
  17362. static int arrc_in[10],arrc_out[10];
  17363. ...
  17364. u_long procnum;
  17365. register CLIENT *clnt;
  17366. enum clnt_stat cs;
  17367. struct timeval  total_timeout;
  17368. ...
  17369. total_timeout.tv_sec = 20;
  17370. total_timeout.tv_usec = 0;
  17371. ...
  17372. myarrc_in.arrdata =  & arrc_in&lbrk.0&rbrk.;
  17373. myarrc_in.arrlength = ( sizeof(arrc_in) / sizeof (int) );
  17374. myarrc_out.arrdata = & arrc_out&lbrk.0&rbrk.;
  17375. myarrc_out.arrlength = ( sizeof(arrc_out) / sizeof (int) );
  17376.  
  17377. cs=clnt_call(clnt, procnum, xdr_myarray, (char *) &myarrc_in, xdr_myarray,
  17378.                                  (char *)&myarrc_out, total_timeout);
  17379. if ( cs != RPC_SUCCESS)
  17380.         printf("*Error* clnt_call fail :\n");
  17381. ...
  17382.  
  17383.  
  17384. ΓòÉΓòÉΓòÉ 16.50. xdr_authunix_parms() ΓòÉΓòÉΓòÉ
  17385.  
  17386. The xdr_authunix_parms() call translates between UNIX-based authentication 
  17387. information and its external representation. 
  17388.  
  17389. Syntax 
  17390.  
  17391. #include <rpc\rpc.h>
  17392.  
  17393. bool_t
  17394. xdr_authunix_parms(xdrs, aupp)
  17395. XDR *xdrs;
  17396. struct authunix_parms *aupp;
  17397.  
  17398. Parameters 
  17399.  
  17400. xdrs 
  17401.   Pointer to an XDR stream. 
  17402.  
  17403. aupp 
  17404.   Pointer to the authentication information. 
  17405.  
  17406. Return Values 
  17407.  
  17408. The value 1 indicates success; the value 0 indicates an error. 
  17409.  
  17410.  
  17411. ΓòÉΓòÉΓòÉ 16.51. xdr_bool() ΓòÉΓòÉΓòÉ
  17412.  
  17413. The xdr_bool() call translates between a Boolean and its external 
  17414. representation. 
  17415.  
  17416. Syntax 
  17417.  
  17418. #include <rpc\rpc.h>
  17419.  
  17420. bool_t
  17421. xdr_bool(xdrs, bp)
  17422. XDR *xdrs;
  17423. bool_t *bp;
  17424.  
  17425. Parameters 
  17426.  
  17427. xdrs 
  17428.   Pointer to an XDR stream. 
  17429.  
  17430. bp 
  17431.   Pointer to the Boolean. 
  17432.  
  17433. Return Values 
  17434.  
  17435. The value 1 indicates success; the value 0 indicates an error. 
  17436.  
  17437.  
  17438. ΓòÉΓòÉΓòÉ 16.52. xdr_bytes() ΓòÉΓòÉΓòÉ
  17439.  
  17440. The xdr_bytes() call translates between byte strings and their external 
  17441. representations. 
  17442.  
  17443. Syntax 
  17444.  
  17445. #include <rpc\rpc.h>
  17446.  
  17447. bool_t
  17448. xdr_bytes(xdrs, sp, sizep, maxsize)
  17449. XDR *xdrs;
  17450. char **sp;
  17451. u_int *sizep;
  17452. u_int maxsize;
  17453.  
  17454. Parameters 
  17455.  
  17456. xdrs 
  17457.   Pointer to an XDR stream. 
  17458.  
  17459. sp 
  17460.   Pointer to a pointer to the byte string. 
  17461.  
  17462. sizep 
  17463.   Pointer to the byte string size. 
  17464.  
  17465. maxsize 
  17466.   Maximum size of the byte string. 
  17467.  
  17468. Return Values 
  17469.  
  17470. The value 1 indicates success; the value 0 indicates an error. 
  17471.  
  17472. Examples 
  17473.  
  17474. struct mybytes
  17475.    {
  17476.     char    *bytdata;
  17477.     u_int   bytlength;
  17478.    };
  17479.  
  17480. void
  17481. xdr_mybytes(xdrsp,arrp)
  17482. XDR  *xdrsp;
  17483. struct mybytes *arrp;
  17484. {
  17485.    xdr_bytes(xdrsp,(caddr_t *)&arrp->bytdata,&arrp->bytlength,MAXLEN);
  17486. }
  17487.  
  17488. ...
  17489. char *bytc_in ,*bytc_out;
  17490. ...
  17491. u_long procnum;
  17492. register CLIENT *clnt;
  17493. enum clnt_stat cs;
  17494. struct timeval  total_timeout;
  17495. ...
  17496. total_timeout.tv_sec = 20;
  17497. total_timeout.tv_usec = 0;
  17498. ...
  17499.  
  17500. mybytc_in.bytdata =  bytc_in;
  17501. mybytc_in.bytlength = strlen(bytc_in)+1;
  17502. cs=clnt_call(clnt, procnum, xdr_mybytes, (caddr_t *) &mybytc_in,
  17503.             xdr_mybytes, (caddr_t *)&mybytc_out, total_timeout);
  17504. if ( cs != RPC_SUCCESS)
  17505.    printf("*Error* clnt_call fail :\n");
  17506.  
  17507.  
  17508. ΓòÉΓòÉΓòÉ 16.53. xdr_callhdr() ΓòÉΓòÉΓòÉ
  17509.  
  17510. The xdr_callhdr() call translates between an RPC message header and its 
  17511. external representation. 
  17512.  
  17513. Syntax 
  17514.  
  17515. #include <rpc\rpc.h>
  17516.  
  17517. void
  17518. xdr_callhdr(xdrs, chdr)
  17519. XDR *xdrs;
  17520. struct rpc_msg *chdr;
  17521.  
  17522. Parameters 
  17523.  
  17524. xdrs 
  17525.   Pointer to the XDR stream. 
  17526.  
  17527. chdr 
  17528.   Pointer to the call header. 
  17529.  
  17530.  
  17531. ΓòÉΓòÉΓòÉ 16.54. xdr_callmsg() ΓòÉΓòÉΓòÉ
  17532.  
  17533. The xdr_callmsg() call translates between RPC call messages (header and 
  17534. authentication, not argument data) and their external representations. 
  17535.  
  17536. Syntax 
  17537.  
  17538. #include <rpc\rpc.h>
  17539.  
  17540. void
  17541. xdr_callmsg(xdrs, cmsg)
  17542. XDR *xdrs;
  17543. struct rpc_msg *cmsg;
  17544.  
  17545. Parameters 
  17546.  
  17547. xdrs 
  17548.   Pointer to the XDR stream. 
  17549.  
  17550. cmsg 
  17551.   Pointer to the call message. 
  17552.  
  17553.  
  17554. ΓòÉΓòÉΓòÉ 16.55. xdr_destroy() ΓòÉΓòÉΓòÉ
  17555.  
  17556. The xdr_destroy() call destroys the XDR stream pointed to by the xdrs 
  17557. parameter. 
  17558.  
  17559. Syntax 
  17560.  
  17561. #include <rpc\rpc.h>
  17562.  
  17563. void xdr_destroy(xdrs)
  17564. XDR *xdrs;
  17565.  
  17566. Parameters 
  17567.  
  17568. xdrs 
  17569.   Pointer to the XDR stream. 
  17570.  
  17571. Description 
  17572.  
  17573. The xdr_destroy() call invokes the destroy routine associated with the eXternal 
  17574. Data Representation stream pointed to by the xdrs parameter, and frees the 
  17575. private data structures allocated to the stream. 
  17576.  
  17577.  
  17578. ΓòÉΓòÉΓòÉ 16.56. xdr_double() ΓòÉΓòÉΓòÉ
  17579.  
  17580. The xdr_double() call translates between C double-precision numbers and their 
  17581. external representations. 
  17582.  
  17583. Syntax 
  17584.  
  17585. #include <rpc\rpc.h>
  17586.  
  17587. bool_t
  17588. xdr_double(xdrs, dp)
  17589. XDR *xdrs;
  17590. double *dp;
  17591.  
  17592. Parameters 
  17593.  
  17594. xdrs 
  17595.   Pointer to the XDR stream. 
  17596.  
  17597. dp 
  17598.   Pointer to a double-precision number. 
  17599.  
  17600. Return Values 
  17601.  
  17602. The value 1 indicates success; the value 0 indicates an error. 
  17603.  
  17604.  
  17605. ΓòÉΓòÉΓòÉ 16.57. xdr_enum() ΓòÉΓòÉΓòÉ
  17606.  
  17607. The xdr_enum() call translates between C-enumerated groups and their external 
  17608. representations. 
  17609.  
  17610. Syntax 
  17611.  
  17612. #include <rpc\rpc.h>
  17613.  
  17614. bool_t
  17615. xdr_enum(xdrs, ep)
  17616. XDR *xdrs;
  17617. enum_t *ep;
  17618.  
  17619. Parameters 
  17620.  
  17621. xdrs 
  17622.   Pointer to the XDR stream. 
  17623.  
  17624. ep 
  17625.   Pointer to the enumerated number. 
  17626.  
  17627. Description 
  17628.  
  17629. The xdr_enum() call translates between C-enumerated groups and their external 
  17630. representations. When you call the procedures callrpc() and registerrpc(), 
  17631. create a stub procedure for both the server and the client before the procedure 
  17632. of the application program using xdr_enum(). Verify that this procedure looks 
  17633. like the following: 
  17634.  
  17635. #include <rpc\rpc.h>
  17636.  
  17637. void
  17638. static xdr_enum_t(xdrs, ep)
  17639. XDR *xdrs;
  17640. enum_t *ep;
  17641. {
  17642.        xdr_enum(xdrs, ep)
  17643. }
  17644. The xdr_enum_t procedure is used as the inproc and outproc in both the client 
  17645. and server RPCs. 
  17646.  
  17647. For example, an RPC client would contain the following lines: 
  17648.  
  17649.                          ...
  17650.  
  17651. error = callrpc(argv[1],ENUMRCVPROG,VERSION,ENUMRCVPROC,
  17652.                      xdr_enum_t,&innumber,xdr_enum_t,&outnumber);
  17653.  
  17654.                          ...
  17655.  
  17656. An RPC server would contain the following line: 
  17657.  
  17658.  
  17659. registerrpc(ENUMRCVPROG,VERSION,ENUMRCVPROC,xdr_enum_t,
  17660.                     xdr_enum_t);
  17661.  
  17662.                          ...
  17663.  
  17664. Return Values 
  17665.  
  17666. The value 1 indicates success; the value 0 indicates an error. 
  17667.  
  17668.  
  17669. ΓòÉΓòÉΓòÉ 16.58. xdr_float() ΓòÉΓòÉΓòÉ
  17670.  
  17671. The xdr_float() call translates between C floating-point numbers and their 
  17672. external representations. 
  17673.  
  17674. Syntax 
  17675.  
  17676. #include <rpc\rpc.h>
  17677.  
  17678. bool_t
  17679. xdr_float(xdrs, fp)
  17680. XDR *xdrs;
  17681. float *fp;
  17682.  
  17683. Parameters 
  17684.  
  17685. xdrs 
  17686.   Pointer to the XDR stream. 
  17687.  
  17688. fp 
  17689.   Pointer to the floating-point number. 
  17690.  
  17691. Return Values 
  17692.  
  17693. The value 1 indicates success; the value 0 indicates an error. 
  17694.  
  17695.  
  17696. ΓòÉΓòÉΓòÉ 16.59. xdr_getpos() ΓòÉΓòÉΓòÉ
  17697.  
  17698. The xdr_getpos() call starts the get-position routine associated with the XDR 
  17699. stream, xdrs. 
  17700.  
  17701. Syntax 
  17702.  
  17703. #include <rpc\rpc.h>
  17704.  
  17705. u_int
  17706. xdr_getpos(xdrs)
  17707. XDR *xdrs;
  17708.  
  17709. Parameters 
  17710.  
  17711. xdrs 
  17712.   Pointer to the XDR stream. 
  17713.  
  17714. Return Values 
  17715.  
  17716. The xdr_getpos() call returns an unsigned integer, which indicates the position 
  17717. of the XDR byte stream. 
  17718.  
  17719. Related Calls 
  17720.  
  17721.      xdr_setpos() 
  17722.  
  17723.  
  17724. ΓòÉΓòÉΓòÉ 16.60. xdr_inline() ΓòÉΓòÉΓòÉ
  17725.  
  17726. The xdr_inline() call returns a pointer to a continuous piece of the XDR 
  17727. stream's buffer. 
  17728.  
  17729. Syntax 
  17730.  
  17731. #include <rpc\rpc.h>
  17732.  
  17733. long *
  17734. xdr_inline(xdrs, len)
  17735. XDR *xdrs;
  17736. int len;
  17737.  
  17738. Parameters 
  17739.  
  17740. xdrs 
  17741.   Pointer to the XDR stream. 
  17742.  
  17743. len 
  17744.   Length in bytes of the desired buffer. 
  17745.  
  17746. Description 
  17747.  
  17748. The xdr_inline() call returns a pointer to a continuous piece of the XDR 
  17749. stream's buffer. The value is long * rather than char *, because the external 
  17750. data representation of any object is always an integer multiple of 32 bits. 
  17751.  
  17752. Note:  xdr_inline() might return NULL if there is not enough space in the 
  17753.        stream buffer to satisfy the request. 
  17754.  
  17755. Return Values 
  17756.  
  17757. The value 1 indicates success; the value 0 indicates an error. 
  17758.  
  17759.  
  17760. ΓòÉΓòÉΓòÉ 16.61. xdr_int() ΓòÉΓòÉΓòÉ
  17761.  
  17762. The xdr_int() call translates between C integers and their external 
  17763. representations. 
  17764.  
  17765. Syntax 
  17766.  
  17767. #include <rpc\rpc.h>
  17768.  
  17769. bool_t
  17770. xdr_int(xdrs, ip)
  17771. XDR *xdrs;
  17772. int *ip;
  17773.  
  17774. Parameters 
  17775.  
  17776. xdrs 
  17777.   Pointer to the XDR stream. 
  17778.  
  17779. ip 
  17780.   Pointer to the integer. 
  17781.  
  17782. Return Values 
  17783.  
  17784. The value 1 indicates success; the value 0 indicates an error. 
  17785.  
  17786.  
  17787. ΓòÉΓòÉΓòÉ 16.62. xdr_long() ΓòÉΓòÉΓòÉ
  17788.  
  17789. The xdr_long() call translates between C long integers and their external 
  17790. representations. 
  17791.  
  17792. Syntax 
  17793.  
  17794. #include <rpc\rpc.h>
  17795.  
  17796. bool_t
  17797. xdr_long(xdrs, lp)
  17798. XDR *xdrs;
  17799. long *lp;
  17800.  
  17801. Parameters 
  17802.  
  17803. xdrs 
  17804.   Pointer to an XDR stream. 
  17805.  
  17806. lp 
  17807.   Pointer to the long integer. 
  17808.  
  17809. Return Values 
  17810.  
  17811. The value 1 indicates success; the value 0 indicates an error. 
  17812.  
  17813.  
  17814. ΓòÉΓòÉΓòÉ 16.63. xdr_opaque() ΓòÉΓòÉΓòÉ
  17815.  
  17816. The xdr_opaque() call translates between fixed-size opaque data and its 
  17817. external representation. 
  17818.  
  17819. Syntax 
  17820.  
  17821. #include <rpc\rpc.h>
  17822.  
  17823. bool_t
  17824. xdr_opaque(xdrs, cp, cnt)
  17825. XDR *xdrs;
  17826. char *cp;
  17827. u_int cnt;
  17828.  
  17829. Parameters 
  17830.  
  17831. xdrs 
  17832.   Pointer to an XDR stream. 
  17833.  
  17834. cp 
  17835.   Pointer to the opaque object. 
  17836.  
  17837. cnt 
  17838.   Size of the opaque object. 
  17839.  
  17840. Return Values 
  17841.  
  17842. The value 1 indicates success; the value 0 indicates an error. 
  17843.  
  17844.  
  17845. ΓòÉΓòÉΓòÉ 16.64. xdr_opaque_auth() ΓòÉΓòÉΓòÉ
  17846.  
  17847. The xdr_opaque_auth() call translates between RPC message authentications and 
  17848. their external representations. 
  17849.  
  17850. Syntax 
  17851.  
  17852. #include <rpc\rpc.h>
  17853.  
  17854. bool_t
  17855. xdr_opaque_auth(xdrs, ap)
  17856. XDR *xdrs;
  17857. struct opaque_auth *ap;
  17858.  
  17859. Parameters 
  17860.  
  17861. xdrs 
  17862.   Pointer to an XDR stream. 
  17863.  
  17864. ap 
  17865.   Pointer to the opaque authentication information. 
  17866.  
  17867. Return Values 
  17868.  
  17869. The value 1 indicates success; the value 0 indicates an error. 
  17870.  
  17871.  
  17872. ΓòÉΓòÉΓòÉ 16.65. xdr_pmap() ΓòÉΓòÉΓòÉ
  17873.  
  17874. The xdr_pmap() call translates an RPC procedure identification, such as is used 
  17875. in calls to Portmapper. 
  17876.  
  17877. Syntax 
  17878.  
  17879. #include <rpc\rpc.h>
  17880.  
  17881. bool_t
  17882. xdr_pmap(xdrs, regs)
  17883. XDR *xdrs;
  17884. struct pmap *regs;
  17885.  
  17886. Parameters 
  17887.  
  17888. xdrs 
  17889.   Pointer to an XDR stream. 
  17890.  
  17891. regs 
  17892.   Pointer to the PORTMAP parameters. 
  17893.  
  17894. Return Values 
  17895.  
  17896. The value 1 indicates success; the value 0 indicates an error. 
  17897.  
  17898.  
  17899. ΓòÉΓòÉΓòÉ 16.66. xdr_pmaplist() ΓòÉΓòÉΓòÉ
  17900.  
  17901. The xdr_pmaplist() call translates a variable number of RPC procedure 
  17902. identifications, such as those Portmapper creates. 
  17903.  
  17904. Syntax 
  17905.  
  17906. #include <rpc\rpc.h>
  17907.  
  17908. bool_t
  17909. xdr_pmaplist(xdrs, rp)
  17910. XDR *xdrs;
  17911. struct pmaplist **rp;
  17912.  
  17913. Parameters 
  17914.  
  17915. xdrs 
  17916.   Pointer to an XDR stream. 
  17917.  
  17918. rp 
  17919.   Pointer to a pointer to the PORTMAP data array. 
  17920.  
  17921. Return Values 
  17922.  
  17923. The value 1 indicates success; the value 0 indicates an error. 
  17924.  
  17925.  
  17926. ΓòÉΓòÉΓòÉ 16.67. xdr_reference() ΓòÉΓòÉΓòÉ
  17927.  
  17928. The xdr_reference() call provides pointer chasing within structures. 
  17929.  
  17930. Syntax 
  17931.  
  17932. #include <rpc\rpc.h>
  17933.  
  17934. bool_t
  17935. xdr_reference(xdrs, pp, size, proc)
  17936. XDR *xdrs;
  17937. char **pp;
  17938. u_int size;
  17939. xdrproc_t proc;
  17940.  
  17941. Parameters 
  17942.  
  17943. xdrs 
  17944.   Pointer to an XDR stream. 
  17945.  
  17946. pp 
  17947.   Pointer to a pointer. 
  17948.  
  17949. size 
  17950.   Size of the target. 
  17951.  
  17952. proc 
  17953.   XDR procedure that translates an individual element of the type addressed by 
  17954.   the pointer. 
  17955.  
  17956. Return Values 
  17957.  
  17958. The value 1 indicates success; the value 0 indicates an error. 
  17959.  
  17960.  
  17961. ΓòÉΓòÉΓòÉ 16.68. xdr_rejected_reply() ΓòÉΓòÉΓòÉ
  17962.  
  17963. The xdr_rejected_reply() call translates between rejected RPC reply messages 
  17964. and their external representations. 
  17965.  
  17966. Syntax 
  17967.  
  17968. #include <rpc\rpc.h>
  17969.  
  17970. bool_t
  17971. xdr_rejected_reply(xdrs, rr)
  17972. XDR *xdrs;
  17973. struct rejected_reply *rr;
  17974.  
  17975. Parameters 
  17976.  
  17977. xdrs 
  17978.   Pointer to an XDR stream. 
  17979.  
  17980. rr 
  17981.   Pointer to the rejected reply. 
  17982.  
  17983. Return Values 
  17984.  
  17985. The value 1 indicates success; the value 0 indicates an error. 
  17986.  
  17987.  
  17988. ΓòÉΓòÉΓòÉ 16.69. xdr_replymsg() ΓòÉΓòÉΓòÉ
  17989.  
  17990. The xdr_replymsg() call translates between RPC reply messages and their 
  17991. external representations. 
  17992.  
  17993. Syntax 
  17994.  
  17995. #include <rpc\rpc.h>
  17996.  
  17997. bool_t
  17998. xdr_replymsg(xdrs, rmsg)
  17999. XDR *xdrs;
  18000. struct rpc_msg *rmsg;
  18001.  
  18002. Parameters 
  18003.  
  18004. xdrs 
  18005.   Pointer to an XDR stream. 
  18006.  
  18007. rmsg 
  18008.   Pointer to the reply message. 
  18009.  
  18010. Return Values 
  18011.  
  18012. The value 1 indicates success; the value 0 indicates an error. 
  18013.  
  18014.  
  18015. ΓòÉΓòÉΓòÉ 16.70. xdr_setpos() ΓòÉΓòÉΓòÉ
  18016.  
  18017. The xdr_setpos() starts the set-position routine associated with a XDR stream, 
  18018. xdrs. 
  18019.  
  18020. Syntax 
  18021.  
  18022. #include <rpc\rpc.h>
  18023.  
  18024. int
  18025. xdr_setpos(xdrs, pos)
  18026. XDR *xdrs;
  18027. u_int pos;
  18028.  
  18029. Parameters 
  18030.  
  18031. xdrs 
  18032.   Pointer to an XDR stream. 
  18033.  
  18034. pos 
  18035.   Position value obtained from xdr_getpos(). 
  18036.  
  18037. Return Values 
  18038.  
  18039. The value 1 indicates success; the value 0 indicates an error. 
  18040.  
  18041. Related Calls 
  18042.  
  18043.      xdr_getpos() 
  18044.  
  18045.  
  18046. ΓòÉΓòÉΓòÉ 16.71. xdr_short() ΓòÉΓòÉΓòÉ
  18047.  
  18048. The xdr_short() call translates between C short integers and their external 
  18049. representations. 
  18050.  
  18051. Syntax 
  18052.  
  18053. #include <rpc\rpc.h>
  18054.  
  18055. bool_t
  18056. xdr_short(xdrs, sp)
  18057. XDR *xdrs;
  18058. short *sp;
  18059.  
  18060. Parameters 
  18061.  
  18062. xdrs 
  18063.   Pointer to an XDR stream. 
  18064.  
  18065. sp 
  18066.   Pointer to the short integer. 
  18067.  
  18068. Return Values 
  18069.  
  18070. The value 1 indicates success; the value 0 indicates an error. 
  18071.  
  18072.  
  18073. ΓòÉΓòÉΓòÉ 16.72. xdr_string() ΓòÉΓòÉΓòÉ
  18074.  
  18075. The xdr_string() call translates between C strings and their external 
  18076. representations. 
  18077.  
  18078. Syntax 
  18079.  
  18080. #include <rpc\rpc.h>
  18081.  
  18082. bool_t
  18083. xdr_string(xdrs, sp, maxsize)
  18084. XDR *xdrs;
  18085. char **sp;
  18086. u_int maxsize;
  18087.  
  18088. Parameters 
  18089.  
  18090. xdrs 
  18091.   Pointer to an XDR stream. 
  18092.  
  18093. sp 
  18094.   Pointer to a pointer to the string. 
  18095.  
  18096. maxsize 
  18097.   Maximum size of the string. 
  18098.  
  18099. Return Values 
  18100.  
  18101. The value 1 indicates success; the value 0 indicates an error. 
  18102.  
  18103.  
  18104. ΓòÉΓòÉΓòÉ 16.73. xdr_u_int() ΓòÉΓòÉΓòÉ
  18105.  
  18106. The xdr_u_int() call translates between C unsigned integers and their external 
  18107. representations. 
  18108.  
  18109. Syntax 
  18110.  
  18111. #include <rpc\rpc.h>
  18112.  
  18113. bool_t
  18114. xdr_u_int(xdrs, up)
  18115. XDR *xdrs;
  18116. unsigned *up;
  18117.  
  18118. Parameters 
  18119.  
  18120. xdrs 
  18121.   Pointer to an XDR stream. 
  18122.  
  18123. up 
  18124.   Pointer to the unsigned integer. 
  18125.  
  18126. Return Values 
  18127.  
  18128. The value 1 indicates success; the value 0 indicates an error. 
  18129.  
  18130.  
  18131. ΓòÉΓòÉΓòÉ 16.74. xdr_u_long() ΓòÉΓòÉΓòÉ
  18132.  
  18133. The xdr_u_long() call translates between C unsigned long integers and their 
  18134. external representations. 
  18135.  
  18136. Syntax 
  18137.  
  18138. #include <rpc\rpc.h>
  18139.  
  18140. bool_t
  18141. xdr_u_long(xdrs, ulp)
  18142. XDR *xdrs;
  18143. u_long *ulp;
  18144.  
  18145. Parameters 
  18146.  
  18147. xdrs 
  18148.   Pointer to an XDR stream. 
  18149.  
  18150. ulp 
  18151.   Pointer to the unsigned long integer. 
  18152.  
  18153. Return Values 
  18154.  
  18155. The value 1 indicates success; the value 0 indicates an error. 
  18156.  
  18157.  
  18158. ΓòÉΓòÉΓòÉ 16.75. xdr_u_short() ΓòÉΓòÉΓòÉ
  18159.  
  18160. The xdr_u_short() call translates between C unsigned short integers and their 
  18161. external representations. 
  18162.  
  18163. Syntax 
  18164.  
  18165. #include <rpc\rpc.h>
  18166.  
  18167. bool_t
  18168. xdr_u_short(xdrs, usp)
  18169. XDR *xdrs;
  18170. u_short *usp;
  18171.  
  18172. Parameters 
  18173.  
  18174. xdrs 
  18175.   Pointer to an XDR stream. 
  18176.  
  18177. usp 
  18178.   Pointer to the unsigned short integer. 
  18179.  
  18180. Return Values 
  18181.  
  18182. The value 1 indicates success; the value 0 indicates an error. 
  18183.  
  18184.  
  18185. ΓòÉΓòÉΓòÉ 16.76. xdr_union() ΓòÉΓòÉΓòÉ
  18186.  
  18187. The xdr_union() call translates between a discriminated C union and its 
  18188. external representation. 
  18189.  
  18190. Syntax 
  18191.  
  18192. #include <rpc\rpc.h>
  18193.  
  18194. bool_t
  18195. xdr_union(xdrs, dscmp, unp, choices, dfault)
  18196. XDR *xdrs;
  18197. int *dscmp;
  18198. char *unp;
  18199. struct xdr_discrim *choices;
  18200. xdrproc_t dfault;
  18201.  
  18202. Parameters 
  18203.  
  18204. xdrs 
  18205.   Pointer to an XDR stream. 
  18206.  
  18207. dscmp 
  18208.   Pointer to the union's discriminant. 
  18209.  
  18210. unp 
  18211.   Pointer to the union. 
  18212.  
  18213. choices 
  18214.   Pointer to an array detailing the XDR procedure to use on each arm of the 
  18215.   union. 
  18216.  
  18217. dfault 
  18218.   Default XDR procedure to use. 
  18219.  
  18220. Return Values 
  18221.  
  18222. The value 1 indicates success; the value 0 indicates an error. 
  18223.  
  18224.  
  18225. ΓòÉΓòÉΓòÉ 16.77. xdr_vector() ΓòÉΓòÉΓòÉ
  18226.  
  18227. The xdr_vector() call translates between a fixed-length array and its external 
  18228. representation. 
  18229.  
  18230. Syntax 
  18231.  
  18232. #include <rpc\rpc.h>
  18233.  
  18234. bool_t
  18235. xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
  18236. XDR *xdrs;
  18237. char *basep;
  18238. u_int nelem;
  18239. u_int elemsize;
  18240. xdrproc_t xdr_elem
  18241.  
  18242. Parameters 
  18243.  
  18244. xdrs 
  18245.   Pointer to the XDR stream. 
  18246.  
  18247. basep 
  18248.   Pointer to the base of the array. 
  18249.  
  18250. nelem 
  18251.   Element count of the array. 
  18252.  
  18253. elemsize 
  18254.   Size of each of the array's elements, found by using the sizeof() operator. 
  18255.  
  18256. xdr_elem 
  18257.   Pointer to the XDR routine that translates an individual array element. 
  18258.  
  18259. Description 
  18260.  
  18261. The xdr_vector() call translates between a fixed-length array and its external 
  18262. representation. Unlike variable-length arrays, the storage of fixed-length 
  18263. arrays is static and unfreeable. 
  18264.  
  18265. Return Values 
  18266.  
  18267. The value 1 indicates success; the value 0 indicates an error. 
  18268.  
  18269.  
  18270. ΓòÉΓòÉΓòÉ 16.78. xdr_void() ΓòÉΓòÉΓòÉ
  18271.  
  18272. The xdr_void() call returns a value of 1. 
  18273.  
  18274. Syntax 
  18275.  
  18276. #include <rpc\rpc.h>
  18277.  
  18278. bool_t
  18279. xdr_void()
  18280.  
  18281. Description 
  18282.  
  18283. The xdr_void() call is used like a command that does not require any other XDR 
  18284. functions. You can place this call in the inproc or outproc parameter of the 
  18285. clnt_call() function when you do not need to move data. 
  18286.  
  18287. Return Values 
  18288.  
  18289. The xdr_void() call always returns a value of 1. 
  18290.  
  18291. Related Calls 
  18292.  
  18293.      callrpc() 
  18294.      clnt_broadcast() 
  18295.      clnt_call() 
  18296.      clnt_freeres() 
  18297.      pmap_rmtcall() 
  18298.      registerrpc() 
  18299.      svc_freeargs() 
  18300.      svc_getargs() 
  18301.      svc_sendreply() 
  18302.  
  18303.  
  18304. ΓòÉΓòÉΓòÉ 16.79. xdr_wrapstring() ΓòÉΓòÉΓòÉ
  18305.  
  18306. The xdr_wrapstring() call translates between strings and their external 
  18307. representations. 
  18308.  
  18309. Syntax 
  18310.  
  18311. #include <rpc\rpc.h>
  18312.  
  18313. bool_t
  18314. xdr_wrapstring(xdrs, sp)
  18315. XDR *xdrs;
  18316. char **sp;
  18317.  
  18318. Parameters 
  18319.  
  18320. xdrs 
  18321.   Pointer to an XDR stream. 
  18322.  
  18323. sp 
  18324.   Pointer to a pointer to the string. 
  18325.  
  18326. Description 
  18327.  
  18328. The xdr_wrapstring() call is the same as calling xdr_string() with a maximum 
  18329. size of MAXUNSIGNED. It is useful because many RPC procedures implicitly start 
  18330. two-parameter XDR routines, and xdr_string() is a three-parameter routine. 
  18331.  
  18332. Return Values 
  18333.  
  18334. The value 1 indicates success; the value 0 indicates an error. 
  18335.  
  18336.  
  18337. ΓòÉΓòÉΓòÉ 16.80. xdrmem_create() ΓòÉΓòÉΓòÉ
  18338.  
  18339. The xdrmem_create() call initializes the XDR stream pointed to by xdrs. Data is 
  18340. written to, or read from, addr. 
  18341.  
  18342. Syntax 
  18343.  
  18344. #include <rpc\rpc.h>
  18345.  
  18346. void
  18347. xdrmem_create(xdrs, addr, size, op)
  18348. XDR *xdrs;
  18349. char *addr;
  18350. u_int size;
  18351. enum xdr_op op;
  18352.  
  18353. Parameters 
  18354.  
  18355. xdrs 
  18356.   Pointer to an XDR stream. 
  18357.  
  18358. addr 
  18359.   Pointer to the memory location. 
  18360.  
  18361. size 
  18362.   Maximum size of addr, in multiples of 4. 
  18363.  
  18364. op 
  18365.   The direction of the XDR stream (either XDR_ENCODE, XDR_DECODE, or XDR_FREE). 
  18366.  
  18367.  
  18368. ΓòÉΓòÉΓòÉ 16.81. xdrrec_create() ΓòÉΓòÉΓòÉ
  18369.  
  18370. The xdrrec_create() call initializes the XDR stream pointed to by xdrs. 
  18371.  
  18372. Syntax 
  18373.  
  18374. #include <rpc\rpc.h>
  18375.  
  18376. void
  18377. xdrrec_create(xdrs, sendsize, recvsize, handle, readit, writeit)
  18378. XDR *xdrs;
  18379. u_int sendsize;
  18380. u_int recvsize;
  18381. char *handle;
  18382. int (*readit)();
  18383. int (*writeit)();
  18384.  
  18385. Parameters 
  18386.  
  18387. xdrs 
  18388.   Pointer to an XDR stream. 
  18389.  
  18390. sendsize 
  18391.   Size of the send buffer.  Specify 0 to choose the default. 
  18392.  
  18393. recvsize 
  18394.   Size of the receive buffer.  Specify 0 to choose the default. 
  18395.  
  18396. handle 
  18397.   First parameter passed to readit() and writeit(). 
  18398.  
  18399. readit() 
  18400.   Called when a stream's input buffer is empty. 
  18401.  
  18402. writeit() 
  18403.   Called when a stream's output buffer is full. 
  18404.  
  18405. Description 
  18406.  
  18407. The xdrrec_create() call initializes the XDR stream pointed to by xdrs. 
  18408.  
  18409. Note:  The caller must set the op field in the xdrs structure. 
  18410.  
  18411. Attention: 
  18412.  
  18413.  This XDR procedure implements an intermediate record string. Additional bytes 
  18414. in the XDR stream provide record boundary information. 
  18415.  
  18416.  
  18417. ΓòÉΓòÉΓòÉ 16.82. xdrrec_endofrecord() ΓòÉΓòÉΓòÉ
  18418.  
  18419. The xdrrec_endofrecord() call marks the data in the output buffer as a 
  18420. completed record. 
  18421.  
  18422. Syntax 
  18423.  
  18424. #include <rpc\rpc.h>
  18425.  
  18426. bool_t
  18427. xdrrec_endofrecord(xdrs, sendnow)
  18428. XDR *xdrs;
  18429. int sendnow;
  18430.  
  18431. Parameters 
  18432.  
  18433. xdrs 
  18434.   Pointer to an XDR stream. 
  18435.  
  18436. sendnow 
  18437.   Specifies nonzero to write out data in the output buffer. 
  18438.  
  18439. Description 
  18440.  
  18441. You can start the xdrrec_endofrecord() call only on streams created by 
  18442. xdrrec_create(). Data in the output buffer is marked as a complete record. 
  18443.  
  18444. Return Values 
  18445.  
  18446. The value 1 indicates success; the value 0 indicates an error. 
  18447.  
  18448.  
  18449. ΓòÉΓòÉΓòÉ 16.83. xdrrec_eof() ΓòÉΓòÉΓòÉ
  18450.  
  18451. The xdrrec_eof() call marks the end of the file, after using the rest of the 
  18452. current record in the XDR stream. 
  18453.  
  18454. Syntax 
  18455.  
  18456. #include <rpc\rpc.h>
  18457.  
  18458. bool_t
  18459. xdrrec_eof(xdrs)
  18460. XDR *xdrs;
  18461. int empty;
  18462.  
  18463. Parameters 
  18464.  
  18465. xdrs 
  18466.   Pointer to an XDR stream. 
  18467.  
  18468. Description 
  18469.  
  18470. You can start the xdrrec_eof() call only on streams created by xdrrec_create(). 
  18471.  
  18472. Return Values 
  18473.  
  18474. The value 1 indicates the current record has been consumed; the value 0 
  18475. indicates continued input on the stream. 
  18476.  
  18477.  
  18478. ΓòÉΓòÉΓòÉ 16.84. xdrrec_skiprecord() ΓòÉΓòÉΓòÉ
  18479.  
  18480. The xdrrec_skiprecord() call discards the rest of the XDR stream's current 
  18481. record in the input buffer. 
  18482.  
  18483. Syntax 
  18484.  
  18485. #include <rpc\rpc.h>
  18486.  
  18487. bool_t
  18488. xdrrec_skiprecord(xdrs)
  18489. XDR *xdrs;
  18490.  
  18491. Parameters 
  18492.  
  18493. xdrs 
  18494.   Pointer to an XDR stream. 
  18495.  
  18496. Description 
  18497.  
  18498. You can start the xdrrec_skiprecord() call only on streams created by 
  18499. xdrrec_create(). The XDR implementation is instructed to discard the remaining 
  18500. data in the input buffer. 
  18501.  
  18502. Return Values 
  18503.  
  18504. The value 1 indicates success; the value 0 indicates an error. 
  18505.  
  18506. Related Calls 
  18507.  
  18508.      xdrrec_create() 
  18509.  
  18510.  
  18511. ΓòÉΓòÉΓòÉ 16.85. xdrstdio_create() ΓòÉΓòÉΓòÉ
  18512.  
  18513. The xdrstdio_create() call initializes the XDR stream pointed to by xdrs. Data 
  18514. is written to or read from the standard I/O stream or file. 
  18515.  
  18516. Syntax 
  18517.  
  18518. #include <rpc\rpc.h>
  18519. #include <stdio.h>
  18520.  
  18521. void
  18522. xdrstdio_create(xdrs, file, op)
  18523. XDR *xdrs;
  18524. FILE *file;
  18525. enum xdr_op op;
  18526.  
  18527. Parameters 
  18528.  
  18529. xdrs 
  18530.   Pointer to an XDR stream. 
  18531.  
  18532. file 
  18533.   File name for the input and output stream. 
  18534.  
  18535. op 
  18536.   The direction of the XDR stream (either XDR_ENCODE, XDR_DECODE, or XDR_FREE). 
  18537.  
  18538.  
  18539. ΓòÉΓòÉΓòÉ 16.86. xprt_register() ΓòÉΓòÉΓòÉ
  18540.  
  18541. The xprt_register() call registers service transport handles with the RPC 
  18542. service package. This routine also modifies the global variable svc_socks[ ]. 
  18543.  
  18544. Syntax 
  18545.  
  18546. #include <rpc\rpc.h>
  18547.  
  18548. void
  18549. xprt_register(xprt)
  18550. SVCXPRT *xprt;
  18551.  
  18552. Parameters 
  18553.  
  18554. xprt 
  18555.   Pointer to the service transport handle. 
  18556.  
  18557. Related Calls 
  18558.  
  18559.      svc_register() 
  18560.  
  18561.  
  18562. ΓòÉΓòÉΓòÉ 16.87. xprt_unregister() ΓòÉΓòÉΓòÉ
  18563.  
  18564. The xprt_unregister() call unregisters the RPC service transport handle. 
  18565.  
  18566. Syntax 
  18567.  
  18568. #include <rpc\rpc.h>
  18569.  
  18570. void
  18571. xprt_unregister(xprt)
  18572. SVCXPRT *xprt;
  18573.  
  18574. Parameters 
  18575.  
  18576. xprt 
  18577.   Pointer to the service transport handle. 
  18578.  
  18579. Description 
  18580.  
  18581. The xprt_unregister() call unregisters an RPC service transport handle. A 
  18582. transport handle should be unregistered with the RPC service package before it 
  18583. is destroyed. This routine also modifies the global variable svc_socks[ ]. 
  18584.  
  18585.  
  18586. ΓòÉΓòÉΓòÉ 17. File Transfer Protocol API ΓòÉΓòÉΓòÉ
  18587.  
  18588. The following table briefly describes each FTP API call, and identifies where 
  18589. you can find the syntax, parameters, and other appropriate information for 
  18590. these calls. 
  18591.  
  18592. File Transfer Protocol API Quick Reference 
  18593.  
  18594. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18595. ΓöéFTP Call                Description                              Γöé
  18596. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18597. Γöéftpappend()             Appends information to a remote file     Γöé
  18598. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18599. Γöéftpcd()                 Changes the current working directory on Γöé
  18600. Γöé                        a host                                   Γöé
  18601. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18602. Γöéftpdelete()             Deletes files on a remote host           Γöé
  18603. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18604. Γöéftpdir()                Gets a directory in wide format from a   Γöé
  18605. Γöé                        host                                     Γöé
  18606. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18607. Γöéftpget()                Gets a file from an FTP server           Γöé
  18608. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18609. Γöéftplogoff()             Closes all current connections           Γöé
  18610. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18611. Γöéftpls()                 Gets directory information in short      Γöé
  18612. Γöé                        format from a remote host and writes it  Γöé
  18613. Γöé                        to a local file                          Γöé
  18614. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18615. Γöéftpmkd()                Creates a new directory on a target      Γöé
  18616. Γöé                        machine                                  Γöé
  18617. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18618. Γöéftpping()               Resolves a host name and sends a ping to Γöé
  18619. Γöé                        the remote host to determine if the host Γöé
  18620. Γöé                        is responding                            Γöé
  18621. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18622. Γöéftpproxy()              Transfers a file between two remote      Γöé
  18623. Γöé                        servers without sending the file to the  Γöé
  18624. Γöé                        local host                               Γöé
  18625. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18626. Γöéftpput()                Transfers a file to an FTP server        Γöé
  18627. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18628. Γöéftpputunique()          Transfers a file to a host and ensures itΓöé
  18629. Γöé                        is created with a unique name            Γöé
  18630. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18631. Γöéftppwd()                Stores the string containing the FTP     Γöé
  18632. Γöé                        server description of the current workingΓöé
  18633. Γöé                        directory on the host to the buffer      Γöé
  18634. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18635. Γöéftprename()             Renames a file on a remote host          Γöé
  18636. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18637. Γöéftpquote()              Sends a string to the server verbatim    Γöé
  18638. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18639. Γöéftpremsize()            returns the size of a file on the remote Γöé
  18640. Γöé                        server.                                  Γöé
  18641. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18642. Γöéftprestart()            The ftprestart() call restarts an abortedΓöé
  18643. Γöé                        transaction from the point of            Γöé
  18644. Γöé                        interruption.                            Γöé
  18645. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18646. Γöéftprmd()                Removes a directory on a target machine  Γöé
  18647. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18648. Γöéftpsite()               Executes the site command                Γöé
  18649. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18650. Γöéftpsys()                Stores the string containing the FTP     Γöé
  18651. Γöé                        server description of the operating      Γöé
  18652. Γöé                        system running on the host in a buffer   Γöé
  18653. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18654. Γöéftptrcoff()             Closes the trace file, and stops tracing Γöé
  18655. Γöé                        of the command and reply sequences that  Γöé
  18656. Γöé                        were sent over the control connection    Γöé
  18657. Γöé                        between the local and remote hosts       Γöé
  18658. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18659. Γöéftptrcon()              Opens the trace file specified and startsΓöé
  18660. Γöé                        tracing                                  Γöé
  18661. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18662. Γöéftpver()                Stores the string containing the FTP API Γöé
  18663. Γöé                        version                                  Γöé
  18664. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18665. ΓöéKeep_File_Date()        Maintain the original date/time of files Γöé
  18666. Γöé                        received.                                Γöé
  18667. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18668. Γöéping()                  Sends a ping to the remote host to       Γöé
  18669. Γöé                        determine if the host is responding      Γöé
  18670. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18671.  
  18672.  
  18673. ΓòÉΓòÉΓòÉ 17.1. Return Values ΓòÉΓòÉΓòÉ
  18674.  
  18675. Most functions return a value of -1 to indicate failure and a value of 0 to 
  18676. indicate success.  Two functions do not return 0 and -1 values: ftplogoff(), 
  18677. which is of type void, and ftpping(), which returns an error code rather than 
  18678. storing the return value in ftperrno.  When the value is -1, the global integer 
  18679. variable ftperrno is set to one of the following codes: 
  18680.  
  18681. Return Code         Description
  18682. FTPSERVICE          Unknown service. 
  18683. FTPHOST             Unknown host. 
  18684. FTPSOCKET           Unable to obtain socket. 
  18685. FTPCONNECT          Unable to connect to server. 
  18686. FTPLOGIN            Login failed. 
  18687. FTPABORT            Transfer aborted. 
  18688. FTPLOCALFILE        Problem opening the local file. 
  18689. FTPDATACONN         Problem initializing data connection. 
  18690. FTPCOMMAND          Command failed. 
  18691. FTPPROXYTHIRD       Proxy server does not support third party. 
  18692. FTPNOPRIMARY        No primary connection for proxy transfer. 
  18693.  
  18694.  
  18695. ΓòÉΓòÉΓòÉ 17.2. ftpappend() ΓòÉΓòÉΓòÉ
  18696.  
  18697. The ftpappend() call appends information to a remote file. 
  18698.  
  18699. Syntax 
  18700.  
  18701. #include <ftpapi.h>
  18702.  
  18703. int ftpappend(host, userid, passwd, acct,  local,
  18704.           remote, transfertype)
  18705. char *host;
  18706. char *userid;
  18707. char *passwd;
  18708. char *acct;
  18709. char *local;
  18710. char *remote;
  18711. int transfertype;
  18712.  
  18713. Parameters 
  18714.  
  18715. host 
  18716.   Host running the FTP server. 
  18717.  
  18718.   To specify the port number (other than the well-know port) used by the FTP 
  18719.   server,  code the host name, followed by a blank, then the port number. For 
  18720.   example, specify ftpappend ("server1 1234",...) 
  18721.  
  18722. userid 
  18723.   ID used for logon. 
  18724.  
  18725. passwd 
  18726.   Password of the user ID. 
  18727.  
  18728. acct 
  18729.   Account (when needed); can be NULL. 
  18730.  
  18731. local 
  18732.   Local file name. 
  18733.  
  18734. remote 
  18735.   Remote file name. 
  18736.  
  18737. transfertype 
  18738.   Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  18739.   binary. 
  18740.  
  18741. Return Values 
  18742.  
  18743. The value 0 indicates success; the value -1 indicates an error.  The value of 
  18744. ftperrno indicates the specific error.  See Return Values for a description of 
  18745. the return codes. 
  18746.  
  18747. Examples 
  18748.  
  18749. int rc;
  18750. rc=ftpappend("conypc","jason","ehgr1",NULL,"abc.doc","new.doc",T_ASCII);
  18751.  
  18752. The local ASCII file abc.doc is appended to the file new.doc in the current 
  18753. working directory at the host conypc. 
  18754.  
  18755.  
  18756. ΓòÉΓòÉΓòÉ 17.3. ftpcd() ΓòÉΓòÉΓòÉ
  18757.  
  18758. The ftpcd() call changes the current working directory on a host. 
  18759.  
  18760. Syntax 
  18761.  
  18762. #include <ftpapi.h>
  18763.  
  18764. int ftpcd(host, userid, passwd, acct, dir)
  18765. char *host;
  18766. char *userid;
  18767. char *passwd;
  18768. char *acct,
  18769. char *dir;
  18770.  
  18771. Parameters 
  18772.  
  18773. host 
  18774.   Host running the FTP server. 
  18775.  
  18776.   To specify the port number (other than the well-know port) used by the FTP 
  18777.   server,  code the host name, followed by a blank, then the port number. For 
  18778.   example, specify ftpcd ("server1 1234",...) 
  18779.  
  18780. userid 
  18781.   ID used for logon. 
  18782.  
  18783. passwd 
  18784.   Password of the user ID. 
  18785.  
  18786. acct 
  18787.   Account (when needed); can be NULL. 
  18788.  
  18789. dir 
  18790.   New working directory. 
  18791.  
  18792. Return Values 
  18793.  
  18794. The value 0 indicates success; the value -1 indicates an error.  The value of 
  18795. ftperrno indicates the specific error.  See Return Values for a description of 
  18796. the return codes. 
  18797.  
  18798. Examples 
  18799.  
  18800. int rc;
  18801. rc=ftpcd("conypc","jason","ehgr1",NULL,"mydir");
  18802.  
  18803. The current working directory is changed to mydir on the host conypc using the 
  18804. user ID jason and the password ehgr1. 
  18805.  
  18806.  
  18807. ΓòÉΓòÉΓòÉ 17.4. ftpdelete() ΓòÉΓòÉΓòÉ
  18808.  
  18809. The ftpdelete() call deletes files on a remote host. 
  18810.  
  18811. Syntax 
  18812.  
  18813. #include <ftpapi.h>
  18814.  
  18815. int ftpdelete(host, userid, passwd, acct, name)
  18816. char *host;
  18817. char *userid;
  18818. char *passwd;
  18819. char *acct;
  18820. char *name;
  18821.  
  18822. Parameters 
  18823.  
  18824. host 
  18825.   Host running the FTP server. 
  18826.  
  18827.   To specify the port number (other than the well-know port) used by the FTP 
  18828.   server,  code the host name, followed by a blank, then the port number. For 
  18829.   example, specify ftpdelete ("server1 1234",...) 
  18830.  
  18831. userid 
  18832.   ID used for logon. 
  18833.  
  18834. passwd 
  18835.   Password of the user ID. 
  18836.  
  18837. acct 
  18838.   Account (when needed); can be NULL. 
  18839.  
  18840. name 
  18841.   File to be deleted. 
  18842.  
  18843. Return Values 
  18844.  
  18845. The value 0 indicates success; the value -1 indicates an error.  The value of 
  18846. ftperrno indicates the specific error.  See Return Values for a description of 
  18847. the return codes. 
  18848.  
  18849. Examples 
  18850.  
  18851. int rc;
  18852. rc=ftpdelete("conypc","jason","ehgr1",NULL,"abc.1");
  18853.  
  18854. The file abc.1 is deleted on the host conypc using the user ID jason and the 
  18855. password ehgr1. 
  18856.  
  18857.  
  18858. ΓòÉΓòÉΓòÉ 17.5. ftpdir() ΓòÉΓòÉΓòÉ
  18859.  
  18860. The ftpdir() call gets a directory in wide format from a host. 
  18861.  
  18862. Syntax 
  18863.  
  18864. #include <ftpapi.h>
  18865.  
  18866. int ftpdir(host, userid, passwd, acct, local, pattern,)
  18867. char *host;
  18868. char *userid;
  18869. char *passwd;
  18870. char *acct;
  18871. char *local;
  18872. char *pattern;
  18873.  
  18874. Parameters 
  18875.  
  18876. host 
  18877.   Host running the FTP server. 
  18878.  
  18879.   To specify the port number (other than the well-know port) used by the FTP 
  18880.   server,  code the host name, followed by a blank, then the port number. For 
  18881.   example, specify ftpdir ("server1 1234",...) 
  18882.  
  18883. userid 
  18884.   ID used for logon. 
  18885.  
  18886. passwd 
  18887.   Password of the user ID. 
  18888.  
  18889. acct 
  18890.   Account (when needed); can be NULL. 
  18891.  
  18892. local 
  18893.   Local file name. 
  18894.  
  18895. pattern 
  18896.   The file name or pattern of the files to be listed on the foreign host. 
  18897.   Patterns are any combination of ASCII characters.  The following two 
  18898.   characters have special meaning: 
  18899.  
  18900.   *        Shows that any character or group of characters can occupy that 
  18901.            position in the pattern. 
  18902.  
  18903.   ?        Shows that any single character can occupy that position in the 
  18904.            pattern. 
  18905.  
  18906. Return Values 
  18907.  
  18908. The value 0 indicates success; the value -1 indicates an error.  The value of 
  18909. ftperrno indicates the specific error.  See Return Values for a description of 
  18910. the return codes. 
  18911.  
  18912. Examples 
  18913.  
  18914. int rc;
  18915. rc=ftpdir("conypc","jason","ehgr1",NULL,"conypc.dir","*.c");
  18916.  
  18917. ftpdir() gets a directory of *.c files in wide format, and stores the directory 
  18918. in a local file, conypc.dir. 
  18919.  
  18920.  
  18921. ΓòÉΓòÉΓòÉ 17.6. ftpget() ΓòÉΓòÉΓòÉ
  18922.  
  18923. The ftpget() call gets a file from an FTP server. 
  18924.  
  18925. Syntax 
  18926.  
  18927. #include <ftpapi.h>
  18928.  
  18929. int ftpget(host, userid, passwd, acct,  local, remote,
  18930.        mode, transfertype)
  18931. char *host;
  18932. char *userid;
  18933. char *passwd;
  18934. char *acct;
  18935. char *local;
  18936. char *remote;
  18937. char *mode;
  18938. int transfertype;
  18939.  
  18940. Parameters 
  18941.  
  18942. host 
  18943.   Host running the FTP server. 
  18944.  
  18945.   To specify the port number (other than the well-know port) used by the FTP 
  18946.   server,  code the host name, followed by a blank, then the port number. For 
  18947.   example, specify ftpget ("server1 1234",...) 
  18948.  
  18949. userid 
  18950.   ID used for logon. 
  18951.  
  18952. passwd 
  18953.   Password of the user ID. 
  18954.  
  18955. acct 
  18956.   Account (when needed); can be NULL. 
  18957.  
  18958. local 
  18959.   Local file name. 
  18960.  
  18961. remote 
  18962.   Remote file name. 
  18963.  
  18964. mode 
  18965.   Either w for write or a for append. 
  18966.  
  18967. transfertype 
  18968.   Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  18969.   binary. 
  18970.  
  18971. Return Values 
  18972.  
  18973. The value 0 indicates success; the value -1 indicates an error.  The value of 
  18974. ftperrno indicates the specific error.  See Return Values for a description of 
  18975. the return codes. 
  18976.  
  18977. Examples 
  18978.  
  18979. int rc;
  18980. rc=ftpget("conypc","jason","ehgr1",NULL,"new.doc","abc.doc","w",T_ASCII);
  18981.  
  18982. The system copies the ASCII file abc.doc on the host conypc into the local 
  18983. current working directory as the file new.doc.  If the file new.doc already 
  18984. exists in the local current working directory, the contents of the file abc.doc 
  18985. overwrite the file new.doc. 
  18986.  
  18987.  
  18988. ΓòÉΓòÉΓòÉ 17.7. ftplogoff() ΓòÉΓòÉΓòÉ
  18989.  
  18990. The ftplogoff() call closes all current connections. An application must call 
  18991. this before terminating. 
  18992.  
  18993. Syntax 
  18994.  
  18995. #include <ftpapi.h>
  18996.  
  18997. void ftplogoff()
  18998.  
  18999.  
  19000. ΓòÉΓòÉΓòÉ 17.8. ftpls() ΓòÉΓòÉΓòÉ
  19001.  
  19002. The ftpls() call gets directory information in short format from a remote host 
  19003. and writes it to a local file. 
  19004.  
  19005. Syntax 
  19006.  
  19007. #include <ftpapi.h>
  19008.  
  19009. int ftpls(host, userid, passwd, acct, local, pattern)
  19010. char *host;
  19011. char *userid;
  19012. char *passwd;
  19013. char *acct;
  19014. char *local;
  19015. char *pattern;
  19016.  
  19017. Parameters 
  19018.  
  19019. host 
  19020.   Host running the FTP server. 
  19021.  
  19022.   To specify the port number (other than the well-know port) used by the FTP 
  19023.   server,  code the host name, followed by a blank, then the port number. For 
  19024.   example, specify ftpls ("server1 1234",...) 
  19025.  
  19026. userid 
  19027.   ID used for logon. 
  19028.  
  19029. passwd 
  19030.   Password of the user ID. 
  19031.  
  19032. acct 
  19033.   Account (when needed); can be NULL. 
  19034.  
  19035. local 
  19036.   Local file into which the information is placed. 
  19037.  
  19038. pattern 
  19039.   The file name or pattern of the files to be listed on the foreign host. 
  19040.   Patterns are any combination of ASCII characters.  The following two 
  19041.   characters have special meaning: 
  19042.  
  19043.   *        Shows that any character or group of characters can occupy that 
  19044.            position in the pattern. 
  19045.  
  19046.   ?        Shows that any single character can occupy that position in the 
  19047.            pattern. 
  19048.  
  19049. Return Values 
  19050.  
  19051. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19052. ftperrno indicates the specific error.  See Return Values for a description of 
  19053. the return codes. 
  19054.  
  19055. Examples 
  19056.  
  19057. int rc;
  19058. rc=ftpls("conypc","jason","ehgr1",NULL,"conypc.dir","*.c");
  19059.  
  19060. ftpls() gets a directory of *.c files in short format and stores the names in 
  19061. the local file conypc.dir. 
  19062.  
  19063.  
  19064. ΓòÉΓòÉΓòÉ 17.9. ftpmkd() ΓòÉΓòÉΓòÉ
  19065.  
  19066. The ftpmkd() call creates a new directory on a target machine. 
  19067.  
  19068. Syntax 
  19069.  
  19070. #include <ftpapi.h>
  19071.  
  19072. int ftpmkd(host, userid, passwd, acct, dir)
  19073. char *host;
  19074. char *userid;
  19075. char *passwd;
  19076. char *acct;
  19077. char *dir;
  19078.  
  19079. Parameters 
  19080.  
  19081. host 
  19082.   Host running the FTP server 
  19083.  
  19084.   To specify the port number (other than the well-know port) used by the FTP 
  19085.   server,  code the host name, followed by a blank, then the port number. For 
  19086.   example, specify ftpmkd ("server1 1234",...) 
  19087.  
  19088. userid 
  19089.   ID used for logon. 
  19090.  
  19091. passwd 
  19092.   Password of the user ID. 
  19093.  
  19094. acct 
  19095.   Account (when needed); can be NULL. 
  19096.  
  19097. dir 
  19098.   Directory to be created. 
  19099.  
  19100. Return Values 
  19101.  
  19102. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19103. ftperrno indicates the specific error.  See Return Values for a description of 
  19104. the return codes. 
  19105.  
  19106. Examples 
  19107.  
  19108. int rc;
  19109. rc=ftpmkd("conypc","jason","ehgr1",NULL,"mydir");
  19110.  
  19111. The directory mydir is created on the host conypc, using the user ID jason and 
  19112. the password ehgr1. 
  19113.  
  19114.  
  19115. ΓòÉΓòÉΓòÉ 17.10. ftpping() ΓòÉΓòÉΓòÉ
  19116.  
  19117. The ftpping() call resolves a host name and sends a ping to the remote host to 
  19118. determine if the host is responding. 
  19119.  
  19120. Syntax 
  19121.  
  19122. #include <ftpapi.h>
  19123.  
  19124. int ftpping(host, len, addr)
  19125. char *host;
  19126. int len;
  19127. unsigned long *addr;
  19128.  
  19129. Parameters 
  19130.  
  19131. host 
  19132.   Host running the FTP server. 
  19133.  
  19134. len 
  19135.   Length of the ping packets. 
  19136.  
  19137. addr 
  19138.   Buffer in which to return the host internet address. 
  19139.  
  19140. Description 
  19141.  
  19142. The ftpping() call tries to resolve the host name through a name server. If the 
  19143. name server is not present, ftpping() searches the TCPIP\ETC\HOSTS file for a 
  19144. matching host name.  Unlike the ping() call, ftpping() could take several 
  19145. seconds because it must resolve the host name before it sends a ping. For this 
  19146. reason, use ftpping() only in the first try to determine if the host is 
  19147. responding.  The ftpping() call sets the addr parameter to the internet address 
  19148. of the host.  After the first try, use this address value to call ping. 
  19149.  
  19150. If the ftpping() return value is positive, the return value is the number of 
  19151. milliseconds it took for the echo to return.  If the return value is negative, 
  19152. it contains an error code.  The parameter len specifies the length of the ping 
  19153. packet(s). 
  19154.  
  19155. Return Values 
  19156.  
  19157. The following are ftpping() call return codes and their corresponding 
  19158. descriptions: 
  19159.  
  19160. Return Code         Description
  19161. PINGREPLY           Host does not reply 
  19162. PINGSOCKET          Unable to obtain socket 
  19163. PINGPROTO           Unknown protocol ICMP 
  19164. PINGSEND            Send failed 
  19165. PINGRECV            Recv() failed 
  19166. PINGHOST            Unknown host 
  19167.  
  19168. Examples 
  19169.  
  19170. int              rc;
  19171. unsigned long    addr;
  19172.  
  19173. rc = ftpping("conypc", 256, &addr);
  19174.  
  19175. The ftpping() call sends a 256-byte ping packet to the host conypc. 
  19176.  
  19177.  
  19178. ΓòÉΓòÉΓòÉ 17.11. ftpproxy() ΓòÉΓòÉΓòÉ
  19179.  
  19180. The ftpproxy() call transfers a file between two remote servers without sending 
  19181. the file to the local host. 
  19182.  
  19183. Syntax 
  19184.  
  19185. #include <ftpapi.h>
  19186.  
  19187. int ftpproxy(host1, userid1, passwd1, acct1, host2, userid2,
  19188.          passwd2, acct2, fn1, fn2, transfertype)
  19189. char *host1;
  19190. char *userid1;
  19191. char *passwd1;
  19192. char *acct1;
  19193. char *host2;
  19194. char *userid2;
  19195. char *passwd2;
  19196. char *acct2;
  19197. char *fn1;
  19198. char *fn2;
  19199. int transfertype;
  19200.  
  19201. Parameters 
  19202.  
  19203. host1 
  19204.   Target host running the FTP server. 
  19205.  
  19206.   To specify the port number (other than the well-know port) used by the FTP 
  19207.   server,  code the host name, followed by a blank, then the port number. For 
  19208.   example, specify ftpproxy ("server1 1234",...) 
  19209.  
  19210. userid1 
  19211.   ID used for logon on host 1. 
  19212.  
  19213. passwd1 
  19214.   Password of the user ID on host 1. 
  19215.  
  19216. acct1 
  19217.   Account for host 1 (when needed); can be NULL. 
  19218.  
  19219. host2 
  19220.   Source host running the FTP server. 
  19221.  
  19222.   To specify the port number (other than the well-know port) used by the FTP 
  19223.   server,  code the host name, followed by a blank, then the port number. For 
  19224.   example, specify ftpproxy (host1,..."server2 1234",...) 
  19225.  
  19226. userid2 
  19227.   ID used for logon on host 2. 
  19228.  
  19229. passwd2 
  19230.   Password of the user ID on host 2. 
  19231.  
  19232. acct2 
  19233.   Account for host 2 (when needed); can be NULL. 
  19234.  
  19235. fn1 
  19236.   File to be written on host 1. 
  19237.  
  19238. fn2 
  19239.   File to be copied from host 2. 
  19240.  
  19241. transfertype 
  19242.   Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  19243.   binary. 
  19244.  
  19245. Description 
  19246.  
  19247. The ftpproxy() call copies a file on a specified source host directly to a 
  19248. specified target host, without involving the requesting host in the file 
  19249. transfer.  This call is functionally the same as the FTP client subcommand 
  19250. proxy put. 
  19251.  
  19252. Notes: 
  19253.  
  19254.   1. For ftpproxy() to complete successfully, both the source and the target 
  19255.      hosts must be running the FTP servers. In addition, ftpproxy() does not 
  19256.      support connections through a firewall. 
  19257.  
  19258.   2. You can specify port number for either host1 or host2, or for both. 
  19259.  
  19260. Return Values 
  19261.  
  19262. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19263. ftperrno indicates the specific error.  See Return Values for a description of 
  19264. the return codes. 
  19265.  
  19266. Examples 
  19267.  
  19268. int rc;
  19269. rc=ftpproxy("pc1","oleg","erst",NULL,   /* target host information*/
  19270.             "pc2","yan", "dssa1", NULL, /* source host information*/
  19271.             "\tmp\newdoc.1",            /* target file name */
  19272.             "\tmp\doc.1",               /* source file name */
  19273.             T_ASCII);                   /* ASCII transfer */
  19274.  
  19275. The ASCII file \tmp\doc.1 on the host pc2 is copied to host pc1 as the file 
  19276. \tmp\newdoc.1. 
  19277.  
  19278.  
  19279. ΓòÉΓòÉΓòÉ 17.12. ftpput() ΓòÉΓòÉΓòÉ
  19280.  
  19281. The ftpput() call transfers a file to an FTP server. 
  19282.  
  19283. Syntax 
  19284.  
  19285. #include <ftpapi.h>
  19286.  
  19287. int ftpput(host, userid, passwd, acct, local, remote,
  19288.        transfertype)
  19289. char *host;
  19290. char *userid;
  19291. char *passwd;
  19292. char *acct;
  19293. char *local;
  19294. char *remote;
  19295. int transfertype;
  19296.  
  19297. Parameters 
  19298.  
  19299. host 
  19300.   Host running the FTP server. 
  19301.  
  19302.   To specify the port number (other than the well-know port) used by the FTP 
  19303.   server,  code the host name, followed by a blank, then the port number. For 
  19304.   example, specify ftpput ("server1 1234",...) 
  19305.  
  19306. userid 
  19307.   ID used for logon. 
  19308.  
  19309. passwd 
  19310.   Password of the user ID. 
  19311.  
  19312. acct 
  19313.   Account (when needed); can be NULL. 
  19314.  
  19315. local 
  19316.   Local file name. 
  19317.  
  19318. remote 
  19319.   Remote file name. 
  19320.  
  19321. transfertype 
  19322.   Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  19323.   binary. 
  19324.  
  19325. Return Values 
  19326.  
  19327. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19328. ftperrno indicates the specific error.  See Return Values for a description of 
  19329. the return codes. 
  19330.  
  19331. Examples 
  19332.  
  19333. int rc;
  19334. rc=ftpput("conypc","jason","ehgr1",NULL,"abc.doc","new.doc",T_ASCII);
  19335.  
  19336. The system copies the ASCII file abc.doc on the local current working directory 
  19337. to the current working directory of the host conypc as file new.doc.  If the 
  19338. file new.doc already exists, the contents of the file abc.doc overwrite the 
  19339. file new.doc. 
  19340.  
  19341.  
  19342. ΓòÉΓòÉΓòÉ 17.13. ftpputunique() ΓòÉΓòÉΓòÉ
  19343.  
  19344. The ftpputunique() call transfers a file to a host and ensures it is created 
  19345. with a unique name. 
  19346.  
  19347. Syntax 
  19348.  
  19349. #include <ftpapi.h>
  19350.  
  19351. int ftpputunique(host, userid, passwd, acct, local, remote,
  19352.                  transfertype)
  19353. char *host;
  19354. char *userid;
  19355. char *passwd;
  19356. char *acct;
  19357. char *local;
  19358. char *remote;
  19359. int transfertype;
  19360.  
  19361. Parameters 
  19362.  
  19363. host 
  19364.   Host running the FTP server. 
  19365.  
  19366.   To specify the port number (other than the well-know port) used by the FTP 
  19367.   server,  code the host name, followed by a blank, then the port number. For 
  19368.   example, specify ftpputunique ("server1 1234",...) 
  19369.  
  19370. userid 
  19371.   ID used for logon. 
  19372.  
  19373. passwd 
  19374.   Password of the user ID. 
  19375.  
  19376. acct 
  19377.   Account (when needed); can be NULL. 
  19378.  
  19379. local 
  19380.   Local file name. 
  19381.  
  19382. remote 
  19383.   Remote file name. 
  19384.  
  19385. transfertype 
  19386.   Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  19387.   binary. 
  19388.  
  19389. Description 
  19390.  
  19391. The ftpputunique() call copies a local file to a file on a specified host. It 
  19392. guarantees that the new file will have a unique name and that the new file will 
  19393. not overwrite a file with the same name. If the file already exists on the 
  19394. host, a new and unique file name is created and used as the target of the file 
  19395. transfer. 
  19396.  
  19397. Return Values 
  19398.  
  19399. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19400. ftperrno indicates the specific error.  See Return Values for a description of 
  19401. the return codes. 
  19402.  
  19403. Examples 
  19404.  
  19405. int rc;
  19406. rc=ftpputunique(
  19407.        "conypc","jason","ehgr1",NULL,"abc.doc", "new.doc",T_ASCII);
  19408.  
  19409. The ASCII file abc.doc is copied to the current working directory of the host 
  19410. conypc as file new.doc, unless the file new.doc already exists.  If the file 
  19411. new.doc already exists, the file new.doc is given a new name unique within the 
  19412. current working directory on the host conypc.  The name of the new file is 
  19413. displayed upon successful completion of the file transfer. 
  19414.  
  19415.  
  19416. ΓòÉΓòÉΓòÉ 17.14. ftppwd() ΓòÉΓòÉΓòÉ
  19417.  
  19418. The ftppwd() call stores the string containing the FTP server description of 
  19419. the current working directory on the host to the buffer. 
  19420.  
  19421. Syntax 
  19422.  
  19423. #include <ftpapi.h>
  19424.  
  19425. int ftppwd(host, userid, passwd, acct, buf, buflen)
  19426. char *host;
  19427. char *userid;
  19428. char *passwd;
  19429. char *acct,
  19430. char *buf;
  19431. crt *buflen;
  19432.  
  19433. Parameters 
  19434.  
  19435. host 
  19436.   Host running the FTP server. 
  19437.  
  19438.   To specify the port number (other than the well-know port) used by the FTP 
  19439.   server,  code the host name, followed by a blank, then the port number. For 
  19440.   example, specify ftppwd ("server1 1234",...) 
  19441.  
  19442. userid 
  19443.   ID used for logon. 
  19444.  
  19445. passwd 
  19446.   Password of the user ID. 
  19447.  
  19448. acct 
  19449.   Account (when needed); can be NULL. 
  19450.  
  19451. buf 
  19452.   Buffer to store the string returned by the FTP server. 
  19453.  
  19454. buflen 
  19455.   Length of buf. 
  19456.  
  19457. Description 
  19458.  
  19459. The ftppwd() call stores the string containing the FTP server description of 
  19460. the current working directory on the host to the buffer buf. The string 
  19461. describing the current working directory is truncated to fit buf if it is 
  19462. longer than buflen.  The returned string is always null-terminated. 
  19463.  
  19464. Return Values 
  19465.  
  19466. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19467. ftperrno indicates the specific error.  See Return Values for a description of 
  19468. the return codes. 
  19469.  
  19470. Examples 
  19471.  
  19472. int rc;
  19473. rc=ftppwd("conypc","jason","ehgr1","dirbuf", sizeof dirbuf);
  19474.  
  19475. After the ftppwd() call, the buffer dirbuf contains the following: 
  19476.  
  19477. "C:\" is current directory.
  19478.  
  19479. The server reply describing the current working directory on host conypc using 
  19480. user ID jason with password eghr1 is stored to dirbuf. 
  19481.  
  19482.  
  19483. ΓòÉΓòÉΓòÉ 17.15. ftpquote() ΓòÉΓòÉΓòÉ
  19484.  
  19485. The ftpquote() call sends a string to the server verbatim. 
  19486.  
  19487. Syntax 
  19488.  
  19489. #include <ftpapi.h>
  19490.  
  19491. int ftpquote(host, userid, passwd, acct, quotestr)
  19492. char *host;
  19493. char *userid;
  19494. char *passwd;
  19495. char *acct;
  19496. char *quotestr;
  19497.  
  19498. Parameters 
  19499.  
  19500. host 
  19501.   Host running the FTP server. 
  19502.  
  19503.   To specify the port number (other than the well-know port) used by the FTP 
  19504.   server,  code the host name, followed by a blank, then the port number. For 
  19505.   example, specify ftpquote ("server1 1234",...) 
  19506.  
  19507. userid 
  19508.   ID used for logon. 
  19509.  
  19510. passwd 
  19511.   Password of the user ID. 
  19512.  
  19513. acct 
  19514.   Account (when needed); can be NULL. 
  19515.  
  19516. quotestr 
  19517.   Quote string to be passed to the FTP server verbatim. 
  19518.  
  19519. Return Values 
  19520.  
  19521. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19522. ftperrno indicates the specific error.  See Return Values for a description of 
  19523. the return codes. 
  19524.  
  19525. Examples 
  19526.  
  19527. int rc;
  19528. rc=ftpquote("conypc","jason","ehgr1",NULL,"site idle 2000");
  19529.  
  19530. The idle is set to time out in 2000 seconds. Your server might not support that 
  19531. amount of idle time. 
  19532.  
  19533.  
  19534. ΓòÉΓòÉΓòÉ 17.16. ftpremsize() ΓòÉΓòÉΓòÉ
  19535.  
  19536. The ftpremsize() call returns the size of a file on the remote server. 
  19537.  
  19538. Syntax 
  19539.  
  19540. #include <ftpapi.h>
  19541.  
  19542. int ftpget(host, userid, passwd, acct,  local, remote,
  19543.        mode, transfertype)
  19544. char *host;
  19545. char *userid;
  19546. char *passwd;
  19547. char *acct;
  19548. char *local;
  19549. char *remote;
  19550. char *mode;
  19551. int transfertype;
  19552.  
  19553. Parameters 
  19554.  
  19555. host 
  19556.   Host running the FTP server. 
  19557.  
  19558.   To specify the port number (other than the well-know port) used by the FTP 
  19559.   server,  code the host name, followed by a blank, then the port number. For 
  19560.   example, specify ftpget ("server1 1234",...) 
  19561.  
  19562. userid 
  19563.   ID used for logon. 
  19564.  
  19565. passwd 
  19566.   Password of the user ID. 
  19567.  
  19568. acct 
  19569.   Account (when needed); can be NULL. 
  19570.  
  19571. local 
  19572.   Local file name. 
  19573.  
  19574. remote 
  19575.   Remote file name. 
  19576.  
  19577. mode 
  19578.   Either w for write or a for append. 
  19579.  
  19580. transfertype 
  19581.   Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  19582.   binary. 
  19583.  
  19584. Return Values 
  19585.  
  19586. Value greater than zero indicates success which is the size of the remote file, 
  19587. the value -1 indicates error. 
  19588.  
  19589.  
  19590. ΓòÉΓòÉΓòÉ 17.17. ftprename() ΓòÉΓòÉΓòÉ
  19591.  
  19592. The ftprename() call renames a file on a remote host. 
  19593.  
  19594. Syntax 
  19595.  
  19596. #include <ftpapi.h>
  19597.  
  19598. int ftprename(host, userid, passwd, acct, namefrom, nameto)
  19599. char *host;
  19600. char *userid;
  19601. char *passwd;
  19602. char *acct;
  19603. char *namefrom;
  19604. char *nameto;
  19605.  
  19606. Parameters 
  19607.  
  19608. host 
  19609.   Host running the FTP server. 
  19610.  
  19611.   To specify the port number (other than the well-know port) used by the FTP 
  19612.   server,  code the host name, followed by a blank, then the port number. For 
  19613.   example, specify ftprename ("server1 1234",...) 
  19614.  
  19615. userid 
  19616.   ID used for logon. 
  19617.  
  19618. passwd 
  19619.   Password of the user ID. 
  19620.  
  19621. acct 
  19622.   Account (when needed); can be NULL. 
  19623.  
  19624. namefrom 
  19625.   Original file name. 
  19626.  
  19627. nameto 
  19628.   New file name. 
  19629.  
  19630. Return Values 
  19631.  
  19632. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19633. ftperrno indicates the specific error.  See Return Values for a description of 
  19634. the return codes. 
  19635.  
  19636. Examples 
  19637.  
  19638. int rc;
  19639. rc=ftprename("conypc","jason","ehgr1",NULL,"abc.1","cd.fg");
  19640.  
  19641. The file abc.1 is renamed to cd.fg on host conypc, using user ID jason, with 
  19642. password ehgr1. 
  19643.  
  19644.  
  19645. ΓòÉΓòÉΓòÉ 17.18. ftprestart() ΓòÉΓòÉΓòÉ
  19646.  
  19647. The ftprestart() call restarts an aborted transaction from the point of 
  19648. interruption. 
  19649.  
  19650. Syntax 
  19651.  
  19652. #include <ftpapi.h>
  19653.  
  19654. int ftprestart(host, userid, passwd, acct,  local, remote,
  19655.        mode, transfertype,
  19656.        rest)
  19657. char *host;
  19658. char *userid;
  19659. char *passwd;
  19660. char *acct;
  19661. char *local;
  19662. char *remote;
  19663. char *mode;
  19664. int transfertype;
  19665. int rest;
  19666.  
  19667. Parameters 
  19668.  
  19669. host 
  19670.   Host running the FTP server. 
  19671.  
  19672.   To specify the port number (other than the well-know port) used by the FTP 
  19673.   server,  code the host name, followed by a blank, then the port number. For 
  19674.   example, specify ftpget ("server1 1234",...) 
  19675.  
  19676. userid 
  19677.   ID used for logon. 
  19678.  
  19679. passwd 
  19680.   Password of the user ID. 
  19681.  
  19682. acct 
  19683.   Account (when needed); can be NULL. 
  19684.  
  19685. local 
  19686.   Local file name. 
  19687.  
  19688. remote 
  19689.   Remote file name. 
  19690.  
  19691. mode 
  19692.   Either w for write or a for append. 
  19693.  
  19694. transfertype 
  19695.   Specifies a binary or ASCII transfer.  T_ASCII is for ASCII, T_BINARY is for 
  19696.   binary. 
  19697.  
  19698. rest 
  19699.   Flag to indicate whether, it is the restart of a GET trransaction or a PUT 
  19700.   transaction. 
  19701.  
  19702. Return Values 
  19703.  
  19704. Value greater than zero indicates success, the value -1 indicates error. 
  19705.  
  19706.  
  19707. ΓòÉΓòÉΓòÉ 17.19. ftprmd() ΓòÉΓòÉΓòÉ
  19708.  
  19709. The ftprmd() call removes a directory on a target machine. 
  19710.  
  19711. Syntax 
  19712.  
  19713. #include <ftpapi.h>
  19714.  
  19715. int ftprmd(host, userid, passwd, acct, dir)
  19716. char *host;
  19717. char *userid;
  19718. char *passwd;
  19719. char *acct;
  19720. char *dir;
  19721.  
  19722. Parameters 
  19723.  
  19724. host 
  19725.   Host running the FTP server. 
  19726.  
  19727.   To specify the port number (other than the well-know port) used by the FTP 
  19728.   server,  code the host name, followed by a blank, then the port number. For 
  19729.   example, specify ftprmd ("server1 1234",...) 
  19730.  
  19731. userid 
  19732.   ID used for logon. 
  19733.  
  19734. passwd 
  19735.   Password of the user ID. 
  19736.  
  19737. acct 
  19738.   Account (when needed); can be NULL. 
  19739.  
  19740. dir 
  19741.   Directory to be removed. 
  19742.  
  19743. Return Values 
  19744.  
  19745. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19746. ftperrno indicates the specific error.  See Return Values for a description of 
  19747. the return codes. 
  19748.  
  19749. Examples 
  19750.  
  19751. int rc;
  19752. rc=ftprmd("conypc","jason","ehgr1",NULL,"mydir");
  19753.  
  19754. The directory, mydir, is removed on the host, conypc, using the user ID, jason, 
  19755. and the password, ehgr1. 
  19756.  
  19757.  
  19758. ΓòÉΓòÉΓòÉ 17.20. ftpsite() ΓòÉΓòÉΓòÉ
  19759.  
  19760. The ftpsite() call executes the site command. (For more information about the 
  19761. site command, see the TCP/IP Command Reference .) 
  19762.  
  19763. Note:  ftpsite() does not support connections through a firewall. 
  19764.  
  19765. Syntax 
  19766.  
  19767. #include <ftpapi.h>
  19768.  
  19769. int ftpsite(host, userid, passwd, acct, sitestr)
  19770. char *host;
  19771. char *userid;
  19772. char *passwd;
  19773. char *acct;
  19774. char *sitestr;
  19775.  
  19776. Parameters 
  19777.  
  19778. host 
  19779.   Host running the FTP server. 
  19780.  
  19781.   To specify the port number (other than the well-know port) used by the FTP 
  19782.   server,  code the host name, followed by a blank, then the port number. For 
  19783.   example, specify ftpsite ("server1 1234",...) 
  19784.  
  19785. userid 
  19786.   ID used for logon. 
  19787.  
  19788. passwd 
  19789.   Password of the user ID. 
  19790.  
  19791. acct 
  19792.   Account (when needed); can be NULL. 
  19793.  
  19794. sitestr 
  19795.   Site string to be executed. 
  19796.  
  19797. Return Values 
  19798.  
  19799. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19800. ftperrno indicates the specific error.  See Return Values for a description of 
  19801. the return codes. 
  19802.  
  19803. Examples 
  19804.  
  19805. int rc;
  19806. rc=ftpsite("conypc","jason","ehgr1",NULL,"idle 2000");
  19807.  
  19808. The idle is set to time out in 2000 seconds. Your server might not support that 
  19809. amount of idle time. 
  19810.  
  19811.  
  19812. ΓòÉΓòÉΓòÉ 17.21. ftpsys() ΓòÉΓòÉΓòÉ
  19813.  
  19814. The ftpsys() call stores the string containing the FTP server description of 
  19815. the operating system running on the host in a buffer. 
  19816.  
  19817. Syntax 
  19818.  
  19819. #include <ftpapi.h>
  19820.  
  19821. int ftpsys(host, userid, passwd, acct, buf, buflen)
  19822. char *host;
  19823. char *userid;
  19824. char *passwd;
  19825. char *acct,
  19826. char *buf;
  19827. int *buflen;
  19828.  
  19829. Parameters 
  19830.  
  19831. host 
  19832.   Host running the FTP server. 
  19833.  
  19834.   To specify the port number (other than the well-know port) used by the FTP 
  19835.   server,  code the host name, followed by a blank, then the port number. For 
  19836.   example, specify ftpsys ("server1 1234",...) 
  19837.  
  19838. userid 
  19839.   ID used for logon. 
  19840.  
  19841. passwd 
  19842.   Password of the user ID. 
  19843.  
  19844. acct 
  19845.   Account (when needed); can be NULL. 
  19846.  
  19847. buf 
  19848.   Buffer to store the string returned by the FTP server. 
  19849.  
  19850. buflen 
  19851.   Length of buf. 
  19852.  
  19853. Description 
  19854.  
  19855. The ftpsys() call stores the string containing the FTP server description of 
  19856. the operating system running on the host in the buffer buf. The string 
  19857. describing the operating system of the host is truncated to fit buf if it is 
  19858. longer than buflen.  The returned string is always null-terminated. 
  19859.  
  19860. Return Values 
  19861.  
  19862. The value 0 indicates success; the value -1 indicates an error.  The value of 
  19863. ftperrno indicates the specific error.  See Return Values for a description of 
  19864. the return codes. 
  19865.  
  19866. Examples 
  19867.  
  19868. int rc;
  19869. rc=ftpsys("ralvmm","jason","ehgr1",hostsysbuf, sizeof hostsysbuf);
  19870.  
  19871. After the ftpsys() call the buffer hostsysbuf contains the following: 
  19872.  
  19873. VM is the operating system of this server.
  19874.  
  19875. The FTP server reply describing the operating system of host ralvmm using user 
  19876. ID jason with password eghr1 is stored to hostsysbuf. 
  19877.  
  19878.  
  19879. ΓòÉΓòÉΓòÉ 17.22. ftptrcoff() ΓòÉΓòÉΓòÉ
  19880.  
  19881. The ftptrcoff() closes the trace file, and stops tracing of the command and 
  19882. reply sequences that were sent over the control connection between the local 
  19883. and remote hosts. 
  19884.  
  19885. Syntax 
  19886.  
  19887. #include <ftpapi.h>
  19888.  
  19889. int ftptrcoff(void)
  19890.  
  19891. Return Values 
  19892.  
  19893. The ftptrcoff() always return a value of 0. 
  19894.  
  19895. Examples 
  19896.  
  19897. int rc;
  19898. rc = ftptrcoff();
  19899.  
  19900.  
  19901. ΓòÉΓòÉΓòÉ 17.23. ftptrcon() ΓòÉΓòÉΓòÉ
  19902.  
  19903. The ftptrcon() call opens the trace file specified and starts tracing. 
  19904.  
  19905. Syntax 
  19906.  
  19907. #include <ftpapi.h>
  19908.  
  19909. int ftptrcon(fileSpec, mode)
  19910. char *fileSpec;
  19911. int mode;
  19912.  
  19913. Parameters 
  19914.  
  19915. fileSpec 
  19916.   Identifies the name of the trace file. 
  19917.  
  19918. mode 
  19919.   Specifies the trace mode as overwrite or append.  Use M_OVERLAY for trace 
  19920.   data which overwrites previous information.  Use M_APPEND for trace data 
  19921.   which appends to previous information. 
  19922.  
  19923. Description 
  19924.  
  19925. The ftptrcon() call opens the trace file specified and starts tracing of the 
  19926. command and reply sequences sent over the control connection between the local 
  19927. and remote hosts.  The trace file can be written over or appended to. 
  19928.  
  19929. No notification is provided if writing of trace data fails. 
  19930.  
  19931. Telnet command and reply sequences are not traced nor are command and reply 
  19932. sequences between the local host and a proxy host. 
  19933.  
  19934. Return Values 
  19935.  
  19936. There are three possible return values for ftptrcon(): 
  19937.  
  19938.     0 when successful 
  19939.     TRCMODE indicates the value set into mode was not valid 
  19940.     TRCOPEN indicates the trace file could not be opened 
  19941.  
  19942. Examples 
  19943.  
  19944. To write the trace data into a file named api.trc in the C:\WORK directory, use 
  19945.  
  19946. int rc;
  19947. rc = ftptrcon("c\\work\\api.trc", M_OVERLAY);
  19948.  
  19949. If the file already existed, the new trace data overwrites the previous trace 
  19950. data (overlay mode). 
  19951.  
  19952.  
  19953. ΓòÉΓòÉΓòÉ 17.24. ftpver() ΓòÉΓòÉΓòÉ
  19954.  
  19955. The ftpver() call stores the string containing the FTP API version. 
  19956.  
  19957. Syntax 
  19958.  
  19959. #include <ftpapi.h>
  19960.  
  19961. int ftpver(buf, buflen)
  19962. char *buf;
  19963. int buflen;
  19964.  
  19965. Parameters 
  19966.  
  19967. buf 
  19968.   Identifies the buffer to store the version string. 
  19969.  
  19970. buflen 
  19971.   Specifies the length of the buffer. 
  19972.  
  19973. Description 
  19974.  
  19975. The ftpver() call stores the string containing the FTP API version. The string 
  19976. is truncated to fit into the buffer if it is longer than the buffer length. 
  19977. The returned string is always null-terminated. 
  19978.  
  19979. Return Values 
  19980.  
  19981. The value of 0 when successful.  The value of -1  when the complete version 
  19982. string could not be copied because the buffer length was too small. 
  19983.  
  19984. Examples 
  19985.  
  19986. int rc;
  19987. rc = ftpver(verBuf, bufLen);
  19988.  
  19989. After the ftpver() call, the buffer contains the version number. 
  19990.  
  19991.  
  19992. ΓòÉΓòÉΓòÉ 17.25. Keep_File_Date() ΓòÉΓòÉΓòÉ
  19993.  
  19994. Maintains the original date/time of files received.  This utilises the MDTM 
  19995. command which returns gmt YYYYMMDDHHMMSS format. 
  19996.  
  19997. Syntax 
  19998.  
  19999. #include <ftpapi.h>
  20000.  
  20001. BOOL Keep_File_Date( localfile, remotefile,)
  20002. char *localfile;
  20003. char *remotefile;
  20004.  
  20005. Parameters 
  20006.  
  20007. localfile 
  20008.   Name of the file on the local machine to which the date/time of the 
  20009.   remotefile has to be assigned. 
  20010.  
  20011. remotefile 
  20012.   Name of the file on the server, for which, the date is to be maintained. 
  20013.  
  20014. Return Values 
  20015.  
  20016. The value TRUE indicates Success, Value FALSE indicates failure implying that 
  20017. the original date/time could not be maintained. 
  20018.  
  20019.  
  20020. ΓòÉΓòÉΓòÉ 17.26. ping() ΓòÉΓòÉΓòÉ
  20021.  
  20022. The ping() call sends a ping to the remote host to determine if the host is 
  20023. responding. 
  20024.  
  20025. Syntax 
  20026.  
  20027. #include <ftpapi.h>
  20028.  
  20029. int ping(addr, len)
  20030. unsigned long addr;
  20031. int len;
  20032.  
  20033. Parameters 
  20034.  
  20035. addr 
  20036.   Internet address of the host in network byte order. 
  20037.  
  20038. len 
  20039.   Length of the ping packets. 
  20040.  
  20041. Description 
  20042.  
  20043. The ping() call sends a ping to the host with ICMP Echo Request.  The ping() 
  20044. call is useful to determine whether the host is alive before attempting FTP 
  20045. transfers, because time-out on regular connections is more than a minute. The 
  20046. ping() call returns within 3 seconds, at most, if the host is not responding. 
  20047.  
  20048. Return Values 
  20049.  
  20050. If the return value is positive, the return value is the number of milliseconds 
  20051. it took for the echo to return.  If the return value is negative, it contains 
  20052. an error code. 
  20053.  
  20054. The following are ping() call return codes and their corresponding 
  20055. descriptions: 
  20056.  
  20057. Return Code       Description
  20058. PINGREPLY         Host does not reply 
  20059. PINGSOCKET        Unable to obtain socket 
  20060. PINGPROTO         Unknown protocol ICMP 
  20061. PINGSEND          Send failed 
  20062. PINGRECV          Recv() failed 
  20063.  
  20064. Examples 
  20065.  
  20066. #include <stdio.h>
  20067. #include <netdb.h>
  20068. #include <ftpapi.h>
  20069.  
  20070. struct hostent *hp;     /* Pointer to host info */
  20071.  
  20072. main(int argc, char *argv[], char *envp[])
  20073. {
  20074.    int i;
  20075.    unsigned long addr;
  20076.  
  20077.    if (argc!=2) {
  20078.      printf("Usage: p <host>\n");
  20079.      exit(1);
  20080.    }
  20081.  
  20082.    hp = gethostbyname(argv[1]);
  20083.  
  20084. if (hp) {
  20085.         memcpy( (char *)&addr, hp->h_addr, hp->h_length);
  20086.         i = ping(addr,256);
  20087.         printf("ping reply in %d milliseconds\n",i);
  20088. } else {
  20089.         printf("unknown host\n");
  20090.         exit(2);
  20091.        }
  20092.        ftplogoff(); /* close all connections */
  20093. }
  20094.  
  20095.  
  20096. ΓòÉΓòÉΓòÉ 18. Resource ReSerVation Protocol API ΓòÉΓòÉΓòÉ
  20097.  
  20098. This table briefly describes each RSVP API call, and provides links to the 
  20099. syntax, parameters, and other appropriate information for these calls: 
  20100.  
  20101. RSVP API Quick Reference 
  20102.  
  20103. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  20104. ΓöéRSVP Call                Description                              Γöé
  20105. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20106. Γöérapi_dispatch()          Dispatches an RSVP event                 Γöé
  20107. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20108. Γöérapi_fmt_adspec()        Formats adspec information for printng   Γöé
  20109. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20110. Γöérapi_fmt_filtspec()      Formats filterspec information for       Γöé
  20111. Γöé                         printing                                 Γöé
  20112. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20113. Γöérapi_fmt_flowspec()      Formats flowspec information for printingΓöé
  20114. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20115. Γöérapi_fmt_tspec()         Formats tspec information for printing   Γöé
  20116. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20117. Γöérapi_getfd()             Gets the alert socket for a session      Γöé
  20118. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20119. Γöérapi_release()           Ends an RSVP session                     Γöé
  20120. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20121. Γöérapi_reserve()           Makes a reservation to be a receiver     Γöé
  20122. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20123. Γöérapi_sender()            Specifies parameters to become a sender  Γöé
  20124. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20125. Γöérapi_session()           Starts an RSVP session                   Γöé
  20126. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20127. Γöérapi_version()           Gets the RSVP version                    Γöé
  20128. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  20129. Γöéuser_rapi_callback()     Initializes the user callback function   Γöé
  20130. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  20131.  
  20132.  
  20133. ΓòÉΓòÉΓòÉ 18.1. Return Values and Definitions ΓòÉΓòÉΓòÉ
  20134.  
  20135. These return values have these meanings for RSVP calls: 
  20136.  
  20137. RAPI_ERR_OK No error. 
  20138. RAPI_ERR_INVAL Parameter not valid. 
  20139. RAPI_ERR_MAXSESS Too many sessions. 
  20140. RAPI_ERR_BADSID Session identifier out of valid range. 
  20141. RAPI_ERR_N_FFS Wrong n_filter or n_flow for this style. 
  20142. RAPI_ERR_BADSTYLE Illegal reservation style. 
  20143. RAPI_ERR_SYSCALL System error. See errno. 
  20144. RAPI_ERR_OVERFLOW Parameter list overflow. 
  20145. RAPI_ERR_MEMFULL Not enough memory. 
  20146. RAPI_ERR_NORSVP Daemon does not respond or does not exist. 
  20147. RAPI_ERR_OBJTYPE Object type error. 
  20148. RAPI_ERR_OBJLEN Object length error. 
  20149. RAPI_ERR_NOTSPEC No sender tspec in rapi_sender. 
  20150. RAPI_ERR_INTSERV Intserv format error. 
  20151. RAPI_ERR_BADSEND Sender interface does not exist. 
  20152. RAPI_ERR_BADRECV Receiver interface does not exist. 
  20153. RAPI_ERR_UNSUPPORTED Unsupported return code. 
  20154. RAPI_ERR_UNKNOWN Unknown return code. 
  20155.  
  20156.  
  20157. ΓòÉΓòÉΓòÉ 18.2. rapi_dispatch() ΓòÉΓòÉΓòÉ
  20158.  
  20159. The rapi_dispatch() call dispatches an RSVP event. 
  20160.  
  20161. Syntax 
  20162.  
  20163. #include <rsvprapi.h>
  20164.  
  20165. int rapi_dispatch(void);
  20166.  
  20167. Parameters: None. 
  20168.  
  20169. Description 
  20170.  
  20171. The rapi_getfd() call returns a socket for the session.  The socket may be used 
  20172. with the select() call as a read socket. When select() indicates that there is 
  20173. some data to read, call rapi_dispatch() call to read and process the data from 
  20174. the socket.  Typically rapi_dispatch() will call user_rapi_callback() to 
  20175. provide the program with information.  The user program should only process 
  20176. data from the socket by calling rapi_dispatch(). 
  20177.  
  20178. Return Values and Descriptions 
  20179.  
  20180. These return values indicate the specific errors for rapi_dispatch(): 
  20181.  
  20182. RAPI_ERR_INVAL           Conversion from RSVP daemon structures to API 
  20183.                          structures encountered data values that are not valid 
  20184.                          or not supported. 
  20185.  
  20186. RAPI_ERR_MEMFULL         Could not allocate memory. 
  20187.  
  20188. RAPI_ERR_NORSVP          Could not connect to the RSVP daemon.  It may not be 
  20189.                          running. 
  20190.  
  20191. Related Calls 
  20192.  
  20193.      rapi_getfd() 
  20194.      select() 
  20195.      user_rapi_callback() 
  20196.  
  20197.  
  20198. ΓòÉΓòÉΓòÉ 18.3. rapi_fmt_adspec() ΓòÉΓòÉΓòÉ
  20199.  
  20200. The rapi_fmt_adspec() call formats adspec information as a printable string. 
  20201.  
  20202. Syntax 
  20203.  
  20204. #include <rsvprapi.h>
  20205.  
  20206. void rapi_fmt_adspec(
  20207.        rapi_adspec_t *padspec,
  20208.        char          *buffer,
  20209.        int            length);
  20210.  
  20211. Parameters 
  20212.  
  20213. padspec 
  20214.           Pointer to an adspec. 
  20215.  
  20216. buffer 
  20217.           Pointer to a buffer where the information will be put for printing. 
  20218.  
  20219. length 
  20220.           The number of characters the buffer can hold. 
  20221.  
  20222. Description 
  20223.  
  20224. The rapi_fmt_adspec() call formats the information in an adspec into the 
  20225. buffer, in a form suitable for printing.  The output information is truncated 
  20226. if the buffer is too small. 
  20227.  
  20228. Return Values 
  20229.  
  20230. None. 
  20231.  
  20232. Related Calls 
  20233.  
  20234.      rapi_fmt_filtspec() 
  20235.      rapi_fmt_flowspec() 
  20236.      rapi_fmt_tspec() 
  20237.  
  20238.  
  20239. ΓòÉΓòÉΓòÉ 18.4. rapi_fmt_filtspec() ΓòÉΓòÉΓòÉ
  20240.  
  20241. The rapi_fmt_filtspec() call formats filterspec information as a printable 
  20242. string. 
  20243.  
  20244. Syntax 
  20245.  
  20246. #include <rsvprapi.h>
  20247.  
  20248. void rapi_fmt_filtspec (
  20249.         rapi_filter_t *pfilter,
  20250.         char          *buffer
  20251.         int            length);
  20252.  
  20253. Parameters 
  20254.  
  20255. pfilter 
  20256.           Pointer to a filterspec. 
  20257.  
  20258. buffer 
  20259.           Pointer to a buffer where the information will be put for printing. 
  20260.  
  20261. length 
  20262.           The number of characters the buffer can hold. 
  20263.  
  20264. Description 
  20265.  
  20266. The rapi_fmt_filtspec() call formats the information in a filterspec into the 
  20267. buffer, in a form suitable for printing.  The output information is truncated 
  20268. if the buffer is too small. 
  20269.  
  20270. Return Values 
  20271.  
  20272. None. 
  20273.  
  20274. Related Calls 
  20275.  
  20276.      rapi_fmt_adspec() 
  20277.      rapi_fmt_flowspec() 
  20278.      rapi_fmt_tspec() 
  20279.  
  20280.  
  20281. ΓòÉΓòÉΓòÉ 18.5. rapi_fmt_flowspec() ΓòÉΓòÉΓòÉ
  20282.  
  20283. The rapi_fmt_flowspec() call formats flowspec information as a printable 
  20284. string. 
  20285.  
  20286. Syntax 
  20287.  
  20288. #include <rsvprapi.h>
  20289.  
  20290. void rapi_fmt_flowspec(
  20291.        rapi_flowspec_t *pflowspec,
  20292.        char            *buffer,
  20293.        int              length);
  20294.  
  20295. Parameters 
  20296.  
  20297. pflowspec 
  20298.           Pointer to a flowspec. 
  20299.  
  20300. buffer 
  20301.           Pointer to a buffer where the information will be put for printing. 
  20302.  
  20303. length 
  20304.           The number of characters the buffer can hold. 
  20305.  
  20306. Description 
  20307.  
  20308. The rapi_fmt_flowspec() call formats the information in a flowspec into the 
  20309. buffer, in a form suitable for printing.  The output information is truncated 
  20310. if the buffer is too small. 
  20311.  
  20312. Return Values 
  20313.  
  20314. None. 
  20315.  
  20316. Related Calls 
  20317.  
  20318.      rapi_fmt_adspec() 
  20319.      rapi_fmt_filtspec() 
  20320.      rapi_fmt_tspec() 
  20321.  
  20322.  
  20323. ΓòÉΓòÉΓòÉ 18.6. rapi_fmt_tspec() ΓòÉΓòÉΓòÉ
  20324.  
  20325. The rapi_fmt_tspec() call formats tspec information as a printable string. 
  20326.  
  20327. Syntax 
  20328.  
  20329. #include <rsvprapi.h>
  20330.  
  20331. void rapi_fmt_tspec(
  20332.        rapi_tspec_t *ptspec,
  20333.        char         *buffer,
  20334.        int           length);
  20335.  
  20336. Parameters 
  20337.  
  20338. ptspec 
  20339.           Pointer to a tspec. 
  20340.  
  20341. buffer 
  20342.           Pointer to a buffer where the information will be put for printing. 
  20343.  
  20344. length 
  20345.           The number of characters the buffer can hold. 
  20346.  
  20347. Description 
  20348.  
  20349. The rapi_fmt_tspec() call formats the information in a tspec into the buffer, 
  20350. in a form suitable for printing.  The output information is truncated if the 
  20351. buffer is too small. 
  20352.  
  20353. Return Values 
  20354.  
  20355. None. 
  20356.  
  20357. Related Calls 
  20358.  
  20359.      rapi_fmt_adspec() 
  20360.      rapi_fmt_filtspec() 
  20361.      rapi_fmt_flowspec() 
  20362.  
  20363.  
  20364. ΓòÉΓòÉΓòÉ 18.7. rapi_getfd() ΓòÉΓòÉΓòÉ
  20365.  
  20366. The rapi_getfd() call obtains the alert socket for a session. 
  20367.  
  20368. Syntax 
  20369.  
  20370. #include <rsvprapi.h>
  20371.  
  20372. int  rapi_getfd(
  20373.        rapi_sid_t sid);
  20374.  
  20375. Parameters 
  20376.  
  20377. sid 
  20378.           Session identifier. 
  20379.  
  20380. Description 
  20381.  
  20382. The rapi_getfd() call formats the information in a tspec into the buffer, in a 
  20383. form suitable for printing.  The output information is truncated if the buffer 
  20384. is too small. 
  20385.  
  20386. Return Values 
  20387.  
  20388. A socket number is returned, or -1.  The value -1 indicates an invalid session 
  20389. ID was used as an argument. 
  20390.  
  20391. Related Calls 
  20392.  
  20393.      rapi_dispatch() 
  20394.      rapi_session() 
  20395.      select() 
  20396.      user_rapi_callback() 
  20397.  
  20398.  
  20399. ΓòÉΓòÉΓòÉ 18.8. rapi_release() ΓòÉΓòÉΓòÉ
  20400.  
  20401. The rapi_release() call ends an RSVP session. 
  20402.  
  20403. Syntax 
  20404.  
  20405. #include <rsvprapi.h>
  20406.  
  20407. int  rapi_release(
  20408.        rapi_sid_t sid);
  20409.  
  20410. Parameters 
  20411.  
  20412. sid 
  20413.           Session identifier of an open session. 
  20414.  
  20415. Description 
  20416.  
  20417. The rapi_release() call closes an open session.  The session ID will no longer 
  20418. be valid. 
  20419.  
  20420. Return Values and Descriptions 
  20421.  
  20422. RAPI_ERR_BADSID          The session identifier is invalid, or the session is 
  20423.                          not open 
  20424.  
  20425. RAPI_ERR_NORSVP          The API could not communicate with the RSVP daemon. 
  20426.  
  20427. RAPI_ERR_OK              The session was closed successfully. 
  20428.  
  20429. Related Calls 
  20430.  
  20431.      rapi_session() 
  20432.  
  20433.  
  20434. ΓòÉΓòÉΓòÉ 18.9. rapi_reserve() ΓòÉΓòÉΓòÉ
  20435.  
  20436. The rapi_reserve() call makes a reservation to be a receiver. 
  20437.  
  20438. Syntax 
  20439.  
  20440. #include <rsvprapi.h>
  20441.  
  20442. int  rapi_reserve(
  20443.        rapi_sid_t         sid,
  20444.        int                flag,
  20445.        struct sockaddr   *phost,
  20446.        rapi_sytleid_t     style,
  20447.        rapi_stylex_t     *pstyle,
  20448.        rapi_policy_t     *ppolicy,
  20449.        int                numFilters,
  20450.        rapi_filter_t     *pfilter,
  20451.        int                numFlows,
  20452.        rapi_flowspec_t   *pflow);
  20453.  
  20454. Parameters 
  20455.  
  20456. sid 
  20457.           Session identifier. 
  20458.  
  20459. flag 
  20460.           Only the optional RAPI_REQ_CONFIRM flag can be used, or a zero. 
  20461.           Using this flag requests a RAPI_RESV_CONFIRM event be provided to the 
  20462.           callback function when the reservation is complete.  This indicates 
  20463.           merely a high probability that the reservation was completed, not 
  20464.           that it is certain. 
  20465.  
  20466. phost 
  20467.           Receive host address and port, or NULL. For this implementation, this 
  20468.           is a pointer to a sockaddr_in structure. If the address is 
  20469.           INADDR_ANY, or if phost is NULL, the default interface will be used. 
  20470.  
  20471. style 
  20472.           The reservation style may be RAPI_RSTYLE_WILDCARD, RAPI_RSTYLE_FIXED, 
  20473.           or RAPI_RSTYLE_SE. 
  20474.  
  20475. pstyle 
  20476.           Style extension (not supported). 
  20477.  
  20478. ppolicy 
  20479.           Receiver policy (not supported). 
  20480.  
  20481. numFilters 
  20482.           Number of filterspecs pointed to by pfilter. 
  20483.  
  20484. pfilter 
  20485.           An array of filterspecs. 
  20486.  
  20487. numFlows 
  20488.           The number of flowspecs pointed to by pflow.  If 0, the current 
  20489.           reservation for the session is removed, if there is one. 
  20490.  
  20491. pflow 
  20492.           An array of flowspecs. 
  20493.  
  20494. Description 
  20495.  
  20496. The rapi_reserve() call establishes the user of the session as a receiver. It 
  20497. specifies a reservation style and a filterspec array and flowspec array. If 
  20498. there is a previous reservation still in effect, and the rapi_reserve() call 
  20499. specifies a different one, the new reservation replaces the previous one.  If 
  20500. the number of flowspecs is 0, the current reservation is deleted but no new 
  20501. reservation is made. 
  20502.  
  20503. After successfully calling rapi_reserve(), the application callback function 
  20504. can be called with RAPI_RESV_ERROR or RAPI_RESV_CONFIRM events. 
  20505.  
  20506. There are three reservation styles: 
  20507.  
  20508.     Fixed filter (RAPI_RSTYLE_FIXED) specifies one or more senders in the 
  20509.      array of filterspecs, and an equal number of flowspecs. The i-th flowspec 
  20510.      is associated with the i-th filterspec. 
  20511.  
  20512.     Shared explicit filter (RAPI_RSTYLE_SE) specifies one or more senders in 
  20513.      the array of filterspecs, and one flowspec. All the senders are expected 
  20514.      to match the flowspec. 
  20515.  
  20516.     Wildcard filter (RAPI_RSTYLE_WILDCARD) specifies a single flowspec, and 
  20517.      either no filterspec, or a single filterspec with appropriate wildcard(s). 
  20518.      If no sender is specified with a filterspec, any sender that matches the 
  20519.      flowspec is a valid sender. 
  20520.  
  20521. Filterspecs have two formats: 
  20522.  
  20523.     RAPI_FILTERFORM_1 allows for a wildcard specification of allowable 
  20524.      senders.  This format is not supported in this implementation of the RSVP 
  20525.      API. 
  20526.  
  20527.     RAPI_FILTERFORM_BASE has a sockaddr_in structure that specifies a sender 
  20528.      IP address and port. 
  20529.  
  20530. Flowspecs have the following formats: 
  20531.  
  20532.     RAPI_FORMAT_IS_CL specifies a controlled load flowspec. 
  20533.  
  20534.     RAPI_FORMAT_IS_GUAR specifies a guarenteed flowspec. 
  20535. The flowspec data fields relate to rapi_reserve(). 
  20536.  
  20537. Return Values and Descriptions 
  20538.  
  20539. RAPI_ERR_BADSID          The session identifier is not valid, or the session is 
  20540.                          not open. 
  20541.  
  20542. RAPI_ERR_INVAL           The argument is not valid. 
  20543.  
  20544. RAPI_ERR_OK              The daemon accepted the reservation. Asynchronous 
  20545.                          callbacks may report further status. 
  20546.  
  20547. Related Calls 
  20548.  
  20549.      rapi_sender() 
  20550.  
  20551.  
  20552. ΓòÉΓòÉΓòÉ 18.10. rapi_sender() ΓòÉΓòÉΓòÉ
  20553.  
  20554. The rapi_sender() call provides information required to become a sender. 
  20555.  
  20556. Syntax 
  20557.  
  20558.        #include <rsvprapi.h>
  20559.  
  20560. int  rapi_sender(
  20561.        rapi_sid_t          sid,
  20562.        int                 flags,
  20563.        struct sockaddr    *plocal,
  20564.        rapi_filter_t      *pfilter,
  20565.        rapi_tspec_t       *ptraffic,
  20566.        rapi_adspec_t      *padvert,
  20567.        rapi_policy_t      *ppolicy,
  20568.        int                 ttl);
  20569.  
  20570. Parameters 
  20571.  
  20572. sid 
  20573.           Session identifier. 
  20574.  
  20575. flags 
  20576.           No flags are supported; specify 0. 
  20577.  
  20578. plocal 
  20579.           Local host (src addr, port).  This argument points to a structure 
  20580.           that specifies the interface that will be used to send the data.  For 
  20581.           this implementation, this should be a sockaddr_in structure. If the 
  20582.           IP source address is INADDR_ANY, the default IP address of the host 
  20583.           will be used.  If plocal is NULL, the program is withdrawing its 
  20584.           registration as a sender for the session and the other arguments will 
  20585.           be ignored. 
  20586.  
  20587. pfilter 
  20588.           Sender template. This parameter is not supported. Specify NULL. 
  20589.  
  20590. ptraffic 
  20591.           Sender tspec. This parameter is a pointer to the traffic 
  20592.           specification for the data flow that this sender will send. 
  20593.  
  20594. padvent 
  20595.           Sender adspec. This parameter is not supported; specify NULL. 
  20596.  
  20597. ppolicy 
  20598.           Sender policy data. This parameter is not supported; specify NULL. 
  20599.  
  20600. ttl 
  20601.           Time to live of the multicast data. If sending data to a multicast 
  20602.           group, specify the TTL used to send to that group, as specified with 
  20603.           setsockopt() option IP_MULTICAST_TTL. 
  20604.  
  20605. Description 
  20606.  
  20607. The rapi_sender() call establishes the program as a sender for the specified 
  20608. session. After checking the arguments for validity, this call sends an 
  20609. appropriate message to the destination. 
  20610.  
  20611. After successfully calling rapi_sender(), the application callback function may 
  20612. receive RAPI_RESV_EVENT or RAPI_PATH_ERROR events. 
  20613.  
  20614. Return Values and Descriptions 
  20615.  
  20616. RAPI_ERR_BADSID          The session identifier is not valid, or the session is 
  20617.                          not open. 
  20618.  
  20619. RAPI_ERR_INVAL           An argument is not valid. 
  20620.  
  20621. RAPI_ERR_NORSVP          The RSVP daemon in not running. 
  20622.  
  20623. RAPI_ERR_NOTSPEC         No traffic spec (tspec) was specified. 
  20624.  
  20625. RAPI_ERR_OK              The call succeeded. 
  20626.  
  20627. Related Calls 
  20628.  
  20629.      rapi_reserve() 
  20630.  
  20631.  
  20632. ΓòÉΓòÉΓòÉ 18.11. rapi_session() ΓòÉΓòÉΓòÉ
  20633.  
  20634. The rapi_session() call starts an RSVP session. 
  20635.  
  20636. Syntax 
  20637.  
  20638.        #include <rsvprapi.h>
  20639.        #include <netinet\in.h>
  20640.  
  20641. rapi_sid_t  rapi_session(
  20642.             struct sockaddr *pdest,
  20643.             int              protoId,
  20644.             int              flags,
  20645.             rapi_event_rtn_t caller,
  20646.             void            *pClientArg,
  20647.             int             *perror);
  20648.  
  20649. Parameters 
  20650.  
  20651. pdest 
  20652.           A pointer to a sockaddr structure that defines an address and port 
  20653.           for the destination.  The sockaddr structure should be sockaddr_in. 
  20654.           For multicast, this should be the multicast group and port. 
  20655.           Otherwise, it should be the address and port of the receiver of the 
  20656.           unicast data stream. 
  20657.  
  20658. protoId 
  20659.           Protocol to be used for the data stream.  For example, IPPROTO_UDP 
  20660.           can be used for UDP (unicast or multicast), or IPPROTO_TCP can be 
  20661.           used for TCP (unicast). If protoId is 0, it is set by default to 
  20662.           IPPROTO_UPD. 
  20663.  
  20664. flags 
  20665.           No flags are defined at this time; specify 0. 
  20666.  
  20667. caller 
  20668.           A pointer to a callback function to be used for asynchronous events. 
  20669.           The pointer may be NULL, indicating that there is no such routine. 
  20670.  
  20671. pClientArg 
  20672.           A user supplied parameter that will be passed to the callback 
  20673.           function. The parameter may be NULL. 
  20674.  
  20675. perror 
  20676.           A pointer to a variable in which error codes are passed. 
  20677.  
  20678. Description 
  20679.  
  20680. The rapi_session() call creates an RSVP API session.  The session ID is an 
  20681. opaque non-zero value that refers to the session until it is released with 
  20682. rapi_release().  It is not useful to compare session IDs from different 
  20683. processes or from different hosts on the network. 
  20684.  
  20685. After rapi_session() is successfully called, the application callback function 
  20686. may receive RAPI_PATH_EVENT messages. 
  20687.  
  20688. Return Values and Descriptions 
  20689.  
  20690. A non-zero return value is a new session ID which is used as a handle in 
  20691. subsequent calls to the API.  A zero return value (NULL_SID) indicates an 
  20692. error, in which case an error code is in the error code variable pointed to by 
  20693. the perror parameter. 
  20694.  
  20695. If the return code is zero, rapi_session() stores these values in the error 
  20696. code variable: 
  20697.  
  20698. RAPI_ERR_NORSVP          The RSVP daemon in not running. 
  20699.  
  20700. RAPI_ERR_SYSCALL         System call error; see errno. 
  20701.  
  20702. RAPI_ERR_MAXSESS         Too many sessions. 
  20703.  
  20704. RAPI_ERR_OK              No error. 
  20705.  
  20706. Related Calls 
  20707.  
  20708.      rapi_release() 
  20709.      user_rapi_callback() 
  20710.  
  20711.  
  20712. ΓòÉΓòÉΓòÉ 18.12. rapi_version() ΓòÉΓòÉΓòÉ
  20713.  
  20714. The rapi_version() call gets the RSVP version. 
  20715.  
  20716. Syntax 
  20717.  
  20718. #include <rsvprapi.h>
  20719.  
  20720. int rapi_version(void);
  20721.  
  20722. Return Values 
  20723.  
  20724. The rapi_version() call returns the version of the RSVP API.  The integer value 
  20725. is encoded as major*100 + minor.  The major number of this release is 4. 
  20726.  
  20727.  
  20728. ΓòÉΓòÉΓòÉ 18.13. user_rapi_callback() ΓòÉΓòÉΓòÉ
  20729.  
  20730. The user_rapi_callback() call provides the RSVP callback function. 
  20731.  
  20732. Syntax 
  20733.  
  20734.        #include <rsvprapi.h>
  20735.  
  20736. int  _System user_rapi_callback(
  20737.        rapi_sid_t         sid,
  20738.        rapi_eventinfo_t   eventType,
  20739.        rapi_styleid_t     styleID,
  20740.        int                errorCode,
  20741.        int                errorValue,
  20742.        struct sockaddr   *pErrorNodeAddr,
  20743.        u_char             errorFlags,
  20744.        int                nFilterSpecs,
  20745.        rapi_filter_t     *pFilterSpec,
  20746.        int                nFlowSpecs,
  20747.        rapi_flowspec_t   *pFlowSpec,
  20748.        int                nAdSpecs,
  20749.        rapi_adspec_t     *pAdSpec,
  20750.        void              *pClientArg);
  20751.  
  20752. Parameters 
  20753.  
  20754. sid 
  20755.           Session identifier of the session that generated the event. 
  20756.  
  20757. eventType 
  20758.           One of these event types: 
  20759.  
  20760.           RAPI_PATH_EVENT A path event is generated by a rapi_sender() call for 
  20761.                          the session.  This can be received by a program that 
  20762.                          has called rapi_session().  A non-zero value of 
  20763.                          nFlowSpecs indicates that a path exists from a sender 
  20764.                          to a potential receiver. A zero value of nFlowSpecs 
  20765.                          indicates that a previous path may have gone away. 
  20766.  
  20767.           RAPI_RESV_EVENT A reservation event is generated by a rapi_reserve() 
  20768.                          call for the session.  This is received by a sender to 
  20769.                          which the reservation applies. A zero value of 
  20770.                          nFlowSpecs indicates that a previous reservation may 
  20771.                          have gone away. 
  20772.  
  20773.           RAPI_PATH_ERROR There has been an error associated with the path 
  20774.                          event. See errorCode for the type of error. 
  20775.  
  20776.           RAPI_RESV_ERROR There has been an error associated with the 
  20777.                          reservation event.  See errorCode for the type of 
  20778.                          error. 
  20779.  
  20780.           RAPI_RESV_CONFIRM When a rapi_reserve() call specifies that 
  20781.                          confirmation of the reservation is requested, this 
  20782.                          event can be generated to confirm (with a very high 
  20783.                          probability) that the reservation has been made from 
  20784.                          receiver to sender. 
  20785.  
  20786. styleID 
  20787.           Reservation style. This is non-zero only for RAPI_RESV_EVENT and 
  20788.           RAPI_RESV_ERROR. 
  20789.  
  20790. errorCode 
  20791.           Type of error that occurred, for a RAPI_PATH_ERROR or RAPI_RESV_ERROR 
  20792.           event. 
  20793.  
  20794. errorValue 
  20795.           Extra error value for a RAPI_PATH_ERROR or RAPI_RESV_ERROR event. 
  20796.           This parameter is used if it is necessary for RSVP to report an extra 
  20797.           error. An example might be an "errno" value. 
  20798.  
  20799. pErrorNodeAddr 
  20800.           A pointer to the IP address and port of the node that detected an 
  20801.           error. For this implementation, this is a pointer to a sockaddr_in 
  20802.           structure. This is set only for a RAPI_PATH_ERROR or RAPI_RESV_ERROR 
  20803.           event. 
  20804.  
  20805. errorFlags 
  20806.  
  20807.           Error flag for a RAPI_PATH_ERROR event. Set to one of these values: 
  20808.  
  20809.           RAPI_ERRF_InPlace This value indicates that the reservation failed, 
  20810.                          but another probably smaller reservation was left in 
  20811.                          place at the failing node address. 
  20812.  
  20813.           RAPI_ERRF_NotGuilty This value indicates that the flowspec that was 
  20814.                          requested by this receiver was not the cause of the 
  20815.                          error, even though the reservation failed. Presumably 
  20816.                          the failure was due to a larger reservation that this 
  20817.                          one was merged with. 
  20818.  
  20819. nFilterSpecs 
  20820.           The number of filterspecs or sender templates pointed to by 
  20821.           pFilterSpec. 
  20822.  
  20823. pFilterSpec 
  20824.           A pointer to an array of filterspecs or sender templates, or NULL. 
  20825.  
  20826. nFlowSpecs 
  20827.           The number of flowspecs or tspecs pointed to by pFlowSpec. 
  20828.  
  20829. pFlowSpec 
  20830.           A pointer to an array of flowspecs or tspecs, or NULL. 
  20831.  
  20832. nAdSpecs 
  20833.           The number of adspecs pointed to by pAdSpec. 
  20834.  
  20835. pAdSpec 
  20836.           A pointer to an array of adspecs, or NULL. 
  20837.  
  20838. pClientArg 
  20839.           The client-supplied argument that was provided when rapi_session() 
  20840.           was called. 
  20841.  
  20842. Description 
  20843.  
  20844. The user_rapi_callback() call processes asynchronous events from the RSVP API. 
  20845. A pointer to the function is passed to rapi_session(). The callback function 
  20846. must be declared as shown above.  The name of the function is chosen by the 
  20847. user, but is shown above as user_rapi_callback(). 
  20848.  
  20849. The rapi_getfd() call returns a socket for the session.  The socket may be used 
  20850. with the select() call as a read socket.  When a select() call indicates that 
  20851. there is some data to read, a rapi_dispatch() call should be issued to read and 
  20852. process the data from the socket.  Typically the rapi_dispatch() call will 
  20853. invoke the user callback function to provide the program with information, if 
  20854. the user supplied such a function in the rapi_session() call. 
  20855.  
  20856. The user callback function should copy any information that it wants to save, 
  20857. because the storage that is pointed to by the pErrorNodeAddr, pFilterSpec, 
  20858. pFlowSpec, and pAdSpec will be freed as soon as the callback function returns. 
  20859.  
  20860. Return Values 
  20861.  
  20862. The function is declared to have an integer return value, but nothing is done 
  20863. with the value currently.  It is recommended that the user always return 0. 
  20864.  
  20865. Related Calls 
  20866.  
  20867.      rapi_dispatch() 
  20868.      rapi_getfd() 
  20869.      rapi_session() 
  20870.      select() 
  20871.  
  20872.  
  20873. ΓòÉΓòÉΓòÉ 19. Appendixes ΓòÉΓòÉΓòÉ
  20874.  
  20875. This section describes: 
  20876.  
  20877.     NETWORKS File Structure 
  20878.  
  20879.      Provides examples of network names contained in the TCPIP\ETC\NETWORKS 
  20880.      file. 
  20881.  
  20882.     Socket Error Constants 
  20883.  
  20884.      Provides the socket error codes and descriptions. 
  20885.  
  20886.     Well-Known Port Assignments 
  20887.  
  20888.      Provides a list of the well-known ports supported by TCP/IP. 
  20889.  
  20890.     Notices 
  20891.  
  20892.      Contains copyright notices, disclaimers, and trademarks relating to TCP/IP 
  20893.      for OS/2 Warp. 
  20894.  
  20895.  
  20896. ΓòÉΓòÉΓòÉ 20. NETWORKS File Structure ΓòÉΓòÉΓòÉ
  20897.  
  20898. The NETWORKS file contains the network name, number, and alias or aliases of 
  20899. known networks. The NETWORKS file must reside in the directory specified by the 
  20900. ETC environment variable. The NETWORKS file is used only by the following 
  20901. socket calls: 
  20902.  
  20903.     endnetent() 
  20904.     getnetbyaddr() 
  20905.     getnetbyname() 
  20906.     getnetent() 
  20907.     setnetent() 
  20908.  
  20909. The following table lists examples of network names contained in the NETWORKS 
  20910. file. 
  20911.  
  20912. Name Structures of Known Networks 
  20913.  
  20914.  
  20915.  Name of File           Contents of File       Sample File Entries
  20916.  ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  20917.  NETWORKS               official_network_name  ne-region 128.1
  20918.                         network_number alias   classb.net1 at1-region
  20919.                                                128.2 classb.net2
  20920.                                                lab-net 192.5.1
  20921.                                                classc.net5
  20922.  
  20923.  
  20924. ΓòÉΓòÉΓòÉ 21. Socket Error Constants ΓòÉΓòÉΓòÉ
  20925.  
  20926. The following table provides the error constants set by socket calls. This 
  20927. table can be found in the <NERRNO.H> header file. 
  20928.  
  20929.  
  20930. /*
  20931. * The redefinition of error constants is necessary to avoid conflict with
  20932. * standard compiler error constants.
  20933. *
  20934. * All OS/2 SOCKETS API error constants are biased by SOCBASEERR from the "normal"
  20935. *
  20936. */
  20937.  
  20938. #define SOCBASEERR              10000
  20939.  
  20940. /*
  20941. * OS/2 SOCKETS  API definitions of regular Microsoft C 6.0 error constants
  20942. */
  20943.  
  20944. #define SOCEPERM           (SOCBASEERR+1)   /*Not owner*/
  20945. #define SOCESRCH           (SOCBASEERR+3)   /*No such process*/
  20946. #define SOCEINTR           (SOCBASEERR+4)   /*Interrupted system call*/
  20947. #define SOCENXIO           (SOCBASEERR+6)   /*No such device or address*/
  20948. #define SOCEBADF           (SOCBASEERR+9)   /*Bad file number*/
  20949. #define SOCEACCES          (SOCBASEERR+13)  /*Permission denied*/
  20950. #define SOCEFAULT          (SOCBASEERR+14)  /*Bad address*/
  20951. #define SOCEINVAL          (SOCBASEERR+22)  /*Invalid argument*/
  20952. #define SOCEMFILE          (SOCBASEERR+24)  /*Too many open files*/
  20953. #define SOCEPIPE           (SOCBASEERR+32)  /*Broken pipe*/
  20954.  
  20955. #define SOCEOS2ERR         (SOCBASEERR+100) /*OS/2 Error*/
  20956.  
  20957. /*
  20958. * OS/2 SOCKETS API definitions of regular BSD error constants
  20959. */
  20960.  
  20961. #define SOCEWOULDBLOCK     (SOCBASEERR+35)  /*Operation would block*/
  20962. #define SOCEINPROGRESS     (SOCBASEERR+36)  /*Operation now in progress*/
  20963. #define SOCEALREADY        (SOCBASEERR+37)  /*Operation already in progress*/
  20964. #define SOCENOTSOCK        (SOCBASEERR+38)  /*Socket operation on non-socket*/
  20965. #define SOCEDESTADDRREQ    (SOCBASEERR+39)  /*Destination address required*/
  20966. #define SOCEMSGSIZE        (SOCBASEERR+40)  /*Message too long*/
  20967. #define SOCEPROTOTYPE      (SOCBASEERR+41)  /*Protocol wrong type for socket*/
  20968. #define SOCENOPROTOOPT     (SOCBASEERR+42)  /*Protocol not available*/
  20969. #define SOCEPROTONOSUPPORT (SOCBASEERR+43)  /*Protocol not supported*/
  20970. #define SOCESOCKTNOSUPPORT (SOCBASEERR+44)  /*Socket type not supported*/
  20971. #define SOCEOPNOTSUPP      (SOCBASEERR+45)  /*Operation not supported on socket*/
  20972. #define SOCEPFNOSUPPORT    (SOCBASEERR+46)  /*Protocol family not supported*/
  20973. #define SOCEAFNOSUPPORT    (SOCBASEERR+47)  /*Address family not supported by protocol family*/
  20974. #define SOCEADDRINUSE      (SOCBASEERR+48)  /*Address already in use*/
  20975. #define SOCEADDRNOTAVAIL   (SOCBASEERR+49)  /*Can't assign requested address*/
  20976. #define SOCENETDOWN        (SOCBASEERR+50)  /*Network is down*/
  20977. #define SOCENETUNREACH     (SOCBASEERR+51)  /*Network is unreachable*/
  20978. #define SOCENETRESET       (SOCBASEERR+52)  /*Network dropped connection on reset*/
  20979. #define SOCECONNABORTED    (SOCBASEERR+53)  /*Software caused connection abort*/
  20980. #define SOCECONNRESET      (SOCBASEERR+54)  /*Connection reset by peer*/
  20981. #define SOCENOBUFS         (SOCBASEERR+55)  /*No buffer space available*/
  20982. #define SOCEISCONN         (SOCBASEERR+56)  /*Socket is already connected*/
  20983. #define SOCENOTCONN        (SOCBASEERR+57)  /*Socket is not connected*/
  20984. #define SOCESHUTDOWN       (SOCBASEERR+58)  /*Can't send after socket shutdown*/
  20985. #define SOCETOOMANYREFS    (SOCBASEERR+59)  /*Too many references: can't splice*/
  20986. #define SOCETIMEDOUT       (SOCBASEERR+60)  /*Connection timed out*/
  20987. #define SOCECONNREFUSED    (SOCBASEERR+61)  /*Connection refused*/
  20988. #define SOCELOOP           (SOCBASEERR+62)  /*Too many levels of symbolic links*/
  20989. #define SOCENAMETOOLONG    (SOCBASEERR+63)  /*File name too long*/
  20990. #define SOCEHOSTDOWN       (SOCBASEERR+64)  /*Host is down*/
  20991. #define SOCEHOSTUNREACH    (SOCBASEERR+65)  /*No route to host*/
  20992. #define SOCENOTEMPTY       (SOCBASEERR+66)  /*Directory not empty*/
  20993.  
  20994. /*
  20995. * OS/2 SOCKETS API errors redefined as regular BSD error constants
  20996. */
  20997.  
  20998. #define EWOULDBLOCK         SOCEWOULDBLOCK
  20999. #define EINPROGRESS         SOCEINPROGRESS
  21000. #define EALREADY            SOCEALREADY
  21001. #define ENOTSOCK            SOCENOTSOCK
  21002. #define EDESTADDRREQ        SOCEDESTADDRREQ
  21003. #define EMSGSIZE            SOCEMSGSIZE
  21004. #define EPROTOTYPE          SOCEPROTOTYPE
  21005. #define ENOPROTOOPT         SOCENOPROTOOPT
  21006. #define EPROTONOSUPPORT     SOCEPROTONOSUPPORT
  21007. #define ESOCKTNOSUPPORT     SOCESOCKTNOSUPPORT
  21008. #define EOPNOTSUPP          SOCEOPNOTSUPP
  21009. #define EPFNOSUPPORT        SOCEPFNOSUPPORT
  21010. #define EAFNOSUPPORT        SOCEAFNOSUPPORT
  21011. #define EADDRINUSE          SOCEADDRINUSE
  21012. #define EADDRNOTAVAIL       SOCEADDRNOTAVAIL
  21013. #define ENETDOWN            SOCENETDOWN
  21014. #define ENETUNREACH         SOCENETUNREACH
  21015. #define ENETRESET           SOCENETRESET
  21016. #define ECONNABORTED        SOCECONNABORTED
  21017. #define ECONNRESET          SOCECONNRESET
  21018. #define ENOBUFS             SOCENOBUFS
  21019. #define EISCONN             SOCEISCONN
  21020. #define ENOTCONN            SOCENOTCONN
  21021. #define ESHUTDOWN           SOCESHUTDOWN
  21022. #define ETOOMANYREFS        SOCETOOMANYREFS
  21023. #define ETIMEDOUT           SOCETIMEDOUT
  21024. #define ECONNREFUSED        SOCECONNREFUSED
  21025. #define ELOOP               SOCELOOP
  21026. #define ENAMETOOLONG        SOCENAMETOOLONG
  21027. #define EHOSTDOWN           SOCEHOSTDOWN
  21028. #define EHOSTUNREACH        SOCEHOSTUNREACH
  21029. #define ENOTEMPTY           SOCENOTEMPTY
  21030.  
  21031.  
  21032. ΓòÉΓòÉΓòÉ 22. Well-Known Port Assignments ΓòÉΓòÉΓòÉ
  21033.  
  21034. The following table is a list of the common well-known ports supported by 
  21035. TCP/IP. It provides the port number, keyword, and a description of the reserved 
  21036. port assignment. Port numbers of less than 1024 are reserved for system 
  21037. applications. You can also find a complete list of well-known port numbers in 
  21038. the ETC\SERVICES file. 
  21039.  
  21040. TCP Well-Known Port Assignments 
  21041.  
  21042. TCP Well-Known Port Assignments 
  21043.  
  21044. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  21045. ΓöéPort Number    Keyword           Reserved for      Services        Γöé
  21046. Γöé                                                   Description     Γöé
  21047. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21048. Γöé0                                reserved                          Γöé
  21049. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21050. Γöé5              rje               remote job entry  remote job entryΓöé
  21051. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21052. Γöé7              echo              echo              echo            Γöé
  21053. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21054. Γöé9              discard           discard           sink null       Γöé
  21055. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21056. Γöé11             systat            active users      active users    Γöé
  21057. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21058. Γöé13             daytime           daytime           daytime         Γöé
  21059. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21060. Γöé15             netstat           Netstat           who is up or    Γöé
  21061. Γöé                                                   Netstat         Γöé
  21062. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21063. Γöé19             chargen           ttytst source     character       Γöé
  21064. Γöé                                                   generator       Γöé
  21065. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21066. Γöé21             ftp               FTP               File Transfer   Γöé
  21067. Γöé                                                   Protocol        Γöé
  21068. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21069. Γöé23             telnet            Telnet            Telnet          Γöé
  21070. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21071. Γöé25             smtp              mail              Simple Mail     Γöé
  21072. Γöé                                                   Transfer        Γöé
  21073. Γöé                                                   Protocol        Γöé
  21074. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21075. Γöé37             time              timeserver        timeserver      Γöé
  21076. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21077. Γöé39             rlp               resource          Resource        Γöé
  21078. Γöé                                                   Location        Γöé
  21079. Γöé                                                   Protocol        Γöé
  21080. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21081. Γöé42             nameserver        name              host name serverΓöé
  21082. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21083. Γöé43             nicname           who is            who is          Γöé
  21084. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21085. Γöé53             domain            name server       domain name     Γöé
  21086. Γöé                                                   server          Γöé
  21087. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21088. Γöé57             mtp               private terminal  private terminalΓöé
  21089. Γöé                                 access            access          Γöé
  21090. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21091. Γöé67             bootps            bootps dhcps      bootp server    Γöé
  21092. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21093. Γöé68             bootpc            bootpc dhcpc      bootp client    Γöé
  21094. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21095. Γöé69             tftp              TFTP              Trivial File    Γöé
  21096. Γöé                                                   Transfer        Γöé
  21097. Γöé                                                   Protocol        Γöé
  21098. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21099. Γöé70             gopher            gopher            Gopher          Γöé
  21100. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21101. Γöé77                               netrjs            any private RJE Γöé
  21102. Γöé                                                   service         Γöé
  21103. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21104. Γöé79             finger            finger            finger          Γöé
  21105. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21106. Γöé80             www-http          www-http          World Wide Web  Γöé
  21107. Γöé                                                   HTTP            Γöé
  21108. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21109. Γöé87             link              ttylink           any private     Γöé
  21110. Γöé                                                   terminal link   Γöé
  21111. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21112. Γöé95             supdup            supdup            SUPDUP Protocol Γöé
  21113. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21114. Γöé101            hostname          hostname          nic hostname    Γöé
  21115. Γöé                                                   server, usually Γöé
  21116. Γöé                                                   from SRI-NIC    Γöé
  21117. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21118. Γöé109            pop               postoffice        Post Office     Γöé
  21119. Γöé                                                   Protocol        Γöé
  21120. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21121. Γöé111            sunrpc            sunrpc            Sun remote      Γöé
  21122. Γöé                                                   procedure call  Γöé
  21123. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21124. Γöé113            auth              authentication    authentication  Γöé
  21125. Γöé                                                   service         Γöé
  21126. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21127. Γöé115            sftp              sftp              Simple File     Γöé
  21128. Γöé                                                   Transfer        Γöé
  21129. Γöé                                                   Protocol        Γöé
  21130. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21131. Γöé117            uucp-path         UUCP path service UUCP path       Γöé
  21132. Γöé                                                   service         Γöé
  21133. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21134. Γöé119            untp              readnews untp     USENET News     Γöé
  21135. Γöé                                                   Transfer        Γöé
  21136. Γöé                                                   Protocol        Γöé
  21137. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21138. Γöé123            ntp               NTP               Network Time    Γöé
  21139. Γöé                                                   Protocol        Γöé
  21140. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21141. Γöé160                              reserved                          Γöé
  21142. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21143. Γöé163-223                          reserved                          Γöé
  21144. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21145. Γöé449            AS-SVRMAP         mapper function   servers for     Γöé
  21146. Γöé                                 for AS/400        sign-on, centralΓöé
  21147. Γöé                                 servers           management,     Γöé
  21148. Γöé                                                   network print,  Γöé
  21149. Γöé                                                   database, streamΓöé
  21150. Γöé                                                   file, data      Γöé
  21151. Γöé                                                   queue, and      Γöé
  21152. Γöé                                                   remote command  Γöé
  21153. Γöé                                                   and distributed Γöé
  21154. Γöé                                                   program calls.  Γöé
  21155. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21156. Γöé712            vexec             vice-exec         Andrew File     Γöé
  21157. Γöé                                                   System          Γöé
  21158. Γöé                                                   authenticated   Γöé
  21159. Γöé                                                   service         Γöé
  21160. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21161. Γöé713            vlogin            vice-login        Andrew File     Γöé
  21162. Γöé                                                   System          Γöé
  21163. Γöé                                                   authenticated   Γöé
  21164. Γöé                                                   service         Γöé
  21165. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21166. Γöé714            vshell            vice-shell        Andrew File     Γöé
  21167. Γöé                                                   System          Γöé
  21168. Γöé                                                   authenticated   Γöé
  21169. Γöé                                                   service         Γöé
  21170. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21171. Γöé2001           filesrv                             Andrew File     Γöé
  21172. Γöé                                                   System service  Γöé
  21173. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21174. Γöé2106           venus.itc                           Andrew File     Γöé
  21175. Γöé                                                   System service, Γöé
  21176. Γöé                                                   for the Venus   Γöé
  21177. Γöé                                                   process         Γöé
  21178. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  21179.  
  21180. UDP Well-Known Port Assignments 
  21181.  
  21182. UDP Well-Known Port Assignments 
  21183.  
  21184. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  21185. ΓöéPort Number    Keyword           Reserved for      Services        Γöé
  21186. Γöé                                                   Description     Γöé
  21187. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21188. Γöé0                                reserved                          Γöé
  21189. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21190. Γöé5              rje               remote job entry  remote job entryΓöé
  21191. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21192. Γöé7              echo              echo              echo            Γöé
  21193. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21194. Γöé9              discard           discard           sink null       Γöé
  21195. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21196. Γöé11             users             active users      active users    Γöé
  21197. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21198. Γöé13             daytime           daytime           daytime         Γöé
  21199. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21200. Γöé15             netstat           Netstat           Netstat         Γöé
  21201. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21202. Γöé19             chargen           ttytst source     character       Γöé
  21203. Γöé                                                   generator       Γöé
  21204. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21205. Γöé37             time              timeserver        timeserver      Γöé
  21206. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21207. Γöé39             rlp               resource          Resource        Γöé
  21208. Γöé                                                   Location        Γöé
  21209. Γöé                                                   Protocol        Γöé
  21210. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21211. Γöé42             nameserver        name              host name serverΓöé
  21212. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21213. Γöé43             nicname           who is            who is          Γöé
  21214. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21215. Γöé53             domain            name server       domain name     Γöé
  21216. Γöé                                                   server          Γöé
  21217. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21218. Γöé67             bootps            bootps dhcps      bootp server    Γöé
  21219. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21220. Γöé68             bootpc            bootpc dhcpc      bootp client    Γöé
  21221. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21222. Γöé69             tftp              TFTP              Trivial File    Γöé
  21223. Γöé                                                   Transfer        Γöé
  21224. Γöé                                                   Protocol        Γöé
  21225. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21226. Γöé70             gopher            gopher            Gopher          Γöé
  21227. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21228. Γöé75                                                 any private dialΓöé
  21229. Γöé                                                   out service     Γöé
  21230. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21231. Γöé77                               netrjs            any private RJE Γöé
  21232. Γöé                                                   service         Γöé
  21233. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21234. Γöé79             finger            finger            finger          Γöé
  21235. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21236. Γöé80             www-http          www-http          World Wide Web  Γöé
  21237. Γöé                                                   HTTP            Γöé
  21238. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21239. Γöé111            sunrpc            sunrpc            Sun remote      Γöé
  21240. Γöé                                                   procedure call  Γöé
  21241. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21242. Γöé123            ntp               NTP               Network Time    Γöé
  21243. Γöé                                                   Protocol        Γöé
  21244. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21245. Γöé135            llbd              NCS LLBD          NCS local       Γöé
  21246. Γöé                                                   location broker Γöé
  21247. Γöé                                                   daemon          Γöé
  21248. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21249. Γöé160-223                          reserved                          Γöé
  21250. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21251. Γöé531            rvd-control                         rvd control portΓöé
  21252. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21253. Γöé2001           rauth2                              Andrew File     Γöé
  21254. Γöé                                                   System service, Γöé
  21255. Γöé                                                   for the Venus   Γöé
  21256. Γöé                                                   process         Γöé
  21257. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21258. Γöé2002           rfilebulk                           Andrew File     Γöé
  21259. Γöé                                                   System service, Γöé
  21260. Γöé                                                   for the Venus   Γöé
  21261. Γöé                                                   process         Γöé
  21262. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21263. Γöé2003           rfilesrv                            Andrew File     Γöé
  21264. Γöé                                                   System service, Γöé
  21265. Γöé                                                   for the Venus   Γöé
  21266. Γöé                                                   process         Γöé
  21267. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21268. Γöé2018           console                             Andrew File     Γöé
  21269. Γöé                                                   System service  Γöé
  21270. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21271. Γöé2115           ropcons                             Andrew File     Γöé
  21272. Γöé                                                   System service, Γöé
  21273. Γöé                                                   for the Venus   Γöé
  21274. Γöé                                                   process         Γöé
  21275. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21276. Γöé2131           rupdsrv                             assigned in     Γöé
  21277. Γöé                                                   pairs; bulk mustΓöé
  21278. Γöé                                                   be srv +1       Γöé
  21279. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21280. Γöé2132           rupdbulk                            assigned in     Γöé
  21281. Γöé                                                   pairs; bulk mustΓöé
  21282. Γöé                                                   be srv +1       Γöé
  21283. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21284. Γöé2133           rupdsrv1                            assigned in     Γöé
  21285. Γöé                                                   pairs; bulk mustΓöé
  21286. Γöé                                                   be srv +1       Γöé
  21287. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  21288. Γöé2134           rupdbulk1                           assigned in     Γöé
  21289. Γöé                                                   pairs; bulk mustΓöé
  21290. Γöé                                                   be srv +1       Γöé
  21291. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  21292.  
  21293.  
  21294. ΓòÉΓòÉΓòÉ 23. Notices ΓòÉΓòÉΓòÉ
  21295.  
  21296. Fourth Edition (February 1999) 
  21297.  
  21298. The following paragraph does not apply to the United Kingdom or any country 
  21299. where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS 
  21300. MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY 
  21301. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  21302. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states 
  21303. do not allow disclaimer of express or implied warranties in certain 
  21304. transactions; therefore, this statement may not apply to you. 
  21305.  
  21306. This publication might include technical inaccuracies or typographical errors. 
  21307. Changes are periodically made to the information herein; these changes will be 
  21308. incorporated in new editions of the publication. IBM may make improvements 
  21309. and/or changes in the product(s) and/or the program(s) described in this 
  21310. publication at any time. 
  21311.  
  21312. This publication was developed for products and services offered in the United 
  21313. States of America. IBM may not offer the products, services, or features 
  21314. discussed in this document in other countries, and the information is subject 
  21315. to change without notice. Consult your local IBM representative for information 
  21316. on the products, services, and features available in your area. 
  21317.  
  21318. Requests for technical information about IBM products should be made to your 
  21319. IBM reseller or IBM marketing representative. 
  21320.  
  21321.  
  21322. ΓòÉΓòÉΓòÉ 23.1. Copyright Notices ΓòÉΓòÉΓòÉ
  21323.  
  21324. COPYRIGHT LICENSE: This publication contains printed sample application 
  21325. programs in source language, which illustrate OS/2 programming techniques. You 
  21326. may copy, modify, and distribute these sample programs in any form without 
  21327. payment to IBM, for the purposes of developing, using, marketing or 
  21328. distributing application programs conforming to the OS/2 application 
  21329. programming interface. 
  21330.  
  21331. Each copy of any portion of these sample programs or any derivative work that 
  21332. is distributed to others must include a copyright notice as follows: "(C)(your 
  21333. company name) (year). All rights reserved." 
  21334.  
  21335. (C) Copyright International Business Machines Corporation 1997, 1998. All 
  21336. rights reserved. 
  21337.  
  21338. Note to U.S. government Users - Documentation related to restricted rights - 
  21339. Use, duplication or disclosure is subject to restrictions set forth in GSA ADP 
  21340. Schedule Contract with IBM Corp. 
  21341.  
  21342. IBM is required to include the following statements in order to distribute 
  21343. portions of this document and the software described herein. 
  21344.  
  21345. __________________________________ 
  21346.  
  21347. Sun RPC is a product of Sun Microsystems, Inc. and is provided for unrestricted 
  21348. use provided that this legend is included on all tape media and as a part of 
  21349. the software program in whole or part.  Users may copy or modify Sun RPC 
  21350. without charge, but are not authorized to license or distribute it to anyone 
  21351. else except as part of a product or program developed by the user. 
  21352.  
  21353. SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 
  21354. WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, OR 
  21355. ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 
  21356.  
  21357. Sun RPC is provided with no support and without any obligation on the part of 
  21358. Sun Microsystems, Inc. to assist in its use, correction, modification or 
  21359. enhancement. 
  21360.  
  21361. SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT 
  21362. OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC OR ANY PART THEREOF. 
  21363.  
  21364. In no event will Sun Microsystems, Inc. be liable for any lost revenue or 
  21365. profits or other special, indirect and consequential damages, even if Sun has 
  21366. been advised of the possibility of such damages. 
  21367.  
  21368. __________________________________ 
  21369.  
  21370. Copyright (c) 1983, 1995 Eric P. Allman 
  21371.  
  21372. Copyright (c) 1988, 1993 The Regents of the University of California. All 
  21373. rights reserved. 
  21374.  
  21375. Redistribution and use in source and binary forms, with or without 
  21376. modification, are permitted provided that the following conditions are met: 
  21377.  
  21378.     Redistributions of source code must retain the above copyright notice, 
  21379.      this list of conditions and the following disclaimer. 
  21380.     Redistributions in binary form must reproduce the above copyright notice, 
  21381.      this list of conditions and the following disclaimer in the documentation 
  21382.      and/or other materials provided with the distribution. 
  21383.     All advertising materials mentioning features or use of this software must 
  21384.      display the following acknowledgement: This product includes software 
  21385.      developed by the University of California, Berkeley and its contributors. 
  21386.     Neither the name of the University nor the names of its contributors may 
  21387.      be used to endorse or promote products derived from this software without 
  21388.      specific prior written permission. 
  21389.  
  21390. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY 
  21391. EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  21392. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
  21393. DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY 
  21394. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
  21395. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
  21396. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
  21397. ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
  21398. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
  21399. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  21400.  
  21401. __________________________________ 
  21402.  
  21403. Copyright (c) 1993 The Australian National University. All rights reserved. 
  21404.  
  21405. Redistribution and use in source and binary forms are permitted provided that 
  21406. the above copyright notice and this paragraph are duplicated in all such forms 
  21407. and that any documentation, advertising materials, and other materials related 
  21408. to such distribution and use acknowledge that the software was developed by the 
  21409. Australian National University.  The name of the University may not be used to 
  21410. endorse or promote products derived from this software without specific prior 
  21411. written permission. 
  21412.  
  21413. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 
  21414. WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
  21415. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
  21416.  
  21417. __________________________________ 
  21418.  
  21419. Copyright (c) 1989 Carnegie Mellon University. All rights reserved. 
  21420.  
  21421. Redistribution and use in source and binary forms are permitted provided that 
  21422. the above copyright notice and this paragraph are duplicated in all such forms 
  21423. and that any documentation, advertising materials, and other materials related 
  21424. to such distribution and use acknowledge that the software was developed by 
  21425. Carnegie Mellon University.  The name of the University may not be used to 
  21426. endorse or promote products derived from this software without specific prior 
  21427. written permission. 
  21428.  
  21429. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 
  21430. WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
  21431. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
  21432.  
  21433. __________________________________ 
  21434.  
  21435. Copyright (c) CERN 1994 
  21436.  
  21437. The copyright and all other rights relating to this computer software, in 
  21438. whatever form, including but not limited to the source code, the object code 
  21439. and user documentation, are vested in CERN. 
  21440.  
  21441. CERN, on a royalty-free and non-exclusive basis, hereby grants permission to 
  21442. use, copy, change, modify, translate, display, distribute and make available 
  21443. this computer software, subject to the following conditions: 
  21444.  
  21445.     This computer software is provided on an as-is basis and CERN provides no 
  21446.      express or implied warranties of any kind, including but not limited to 
  21447.      those of merchantability, fitness for a particular purpose and 
  21448.      non-infringement of the proprietary rights, such as copyrights, patents 
  21449.      and trade secrets, of third parties. CERN accepts no liability whatsoever 
  21450.      for or in connection with the use of this computer software. 
  21451.     All copies made of this computer software or of parts thereof shall 
  21452.      include this copyright statement in full. 
  21453.     However, if this computer software or parts thereof are made available in 
  21454.      any other form than their original form, or are included in any other 
  21455.      computer software, the following short acknowledgement only must be 
  21456.      mentioned in the copyright statement and in the user documentation (or, in 
  21457.      the absence thereof, in any other appropriate place) concerning the 
  21458.      computer software thus made available or created. 
  21459.  
  21460.      "This product includes computer software created and made available by 
  21461.      CERN.  This acknowledgement shall be mentioned in full in any product 
  21462.      which includes the CERN computer software included herein or parts 
  21463.      thereof". 
  21464.  
  21465. __________________________________ 
  21466.  
  21467. Portions Copyright (C) 1993, 1994 by NEC Systems Laboratory. 
  21468.  
  21469. Permission to use, copy, modify, and distribute this software for any purpose 
  21470. with or without fee is hereby granted, provided that the above copyright notice 
  21471. and this permission notice appear in all copies, and that the name of NEC 
  21472. Systems Laboratory not be used in advertising or publicity pertaining to 
  21473. distribution of the document or software without specific, prior permission. 
  21474.  
  21475. THE SOFTWARE IS PROVIDED 'AS IS' AND NEC SYSTEMS LABORATORY DISCLAIMS ALL 
  21476. WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF 
  21477. MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NEC SYSTEMS LABORATORY BE LIABLE 
  21478. FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
  21479. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OR 
  21480. CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
  21481. WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
  21482.  
  21483. __________________________________ 
  21484.  
  21485. Some portions of this publication relating to X Window System are Copyright (C) 
  21486. 1987, 1988 by the Massachusetts Institute of Technology, Cambridge, 
  21487. Massachusetts; by Digital Equipment Corporation, Maynard, Massachusetts; and by 
  21488. Hewlett-Packard Corporation. All Rights Reserved. 
  21489.  
  21490. Permission to use, copy, modify, and distribute the M.I.T., Digital Equipment 
  21491. Corporation, and Hewlett-Packard Corporation portions of this software and its 
  21492. documentation for any purpose without fee is hereby granted, provided that the 
  21493. above copyright notice appears in all copies and that both that copyright 
  21494. notice and this permission notice appear in supporting documentation, and that 
  21495. the names of M.I.T., Digital, and Hewlett-Packard make no representation about 
  21496. the suitability of this software for any purpose. It is provided "as is" 
  21497. without express or implied warranty. 
  21498.  
  21499. __________________________________ 
  21500.  
  21501. Copyright 1994, 1995 Massachusetts Institute of Technology 
  21502.  
  21503. Permission to use, copy, modify, and distribute this software and its 
  21504. documentation for any purpose and without fee is hereby granted, provided that 
  21505. both the above copyright notice and this permission notice appear in all 
  21506. copies, that both the above copyright notice and this permission notice appear 
  21507. in all supporting documentation, and that the name of M.I.T. not be used in 
  21508. advertising or publicity pertaining to distribution of the software without 
  21509. specific, written prior permission.  M.I.T. makes no representations about the 
  21510. suitability of this software for any purpose.  It is provided "as is" without 
  21511. express or implied warranty. 
  21512.  
  21513. THIS SOFTWARE IS PROVIDED BY M.I.T. "AS IS".  M.I.T. DISCLAIMS ALL EXPRESS OR 
  21514. IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING, BUT NOT LIMITED TO, 
  21515. THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
  21516. IN NO EVENT SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  21517. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
  21518. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
  21519. BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
  21520. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
  21521. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
  21522. POSSIBILITY OF SUCH DAMAGE. 
  21523.  
  21524.  
  21525. ΓòÉΓòÉΓòÉ 23.2. Disclaimers ΓòÉΓòÉΓòÉ
  21526.  
  21527. References in this publication to IBM products, programs, or services do not 
  21528. imply that IBM intends to make these available in all countries in which IBM 
  21529. operates. Any reference to an IBM product, program or service is not intended 
  21530. to state or imply that only IBM's product, program, or service may be used. 
  21531. Subject to IBM's valid intellectual property or other legally protectable 
  21532. rights, any functionally equivalent product, program, or service may be used 
  21533. instead of the IBM product, program, or service. Evaluation and verification of 
  21534. operation in conjunction with other products, programs, or services, except 
  21535. those expressly designated by IBM, are the user's responsibility. 
  21536.  
  21537. IBM may have patents or pending patent applications covering subject matter in 
  21538. this document. The furnishing of this document does not give you any license to 
  21539. these patents. You can send license inquiries, in writing, to: 
  21540.  
  21541.   IBM Director of Licensing
  21542.   IBM Corporation
  21543.   500 Columbus Avenue
  21544.   Thornwood, NY 10594
  21545.   U.S.A.
  21546.  
  21547. Licensees of this program who wish to have information about it for the purpose 
  21548. of enabling:  (i) the exchange of information between independently created 
  21549. programs and other programs (including this one) and (ii) the mutual use of the 
  21550. information which has been exchanged, should contact IBM Corporation, 
  21551. Department LZKS, 11400 Burnet Road, Austin, TX 78758, U.S.A.  Such information 
  21552. may be available, subject to appropriate terms and conditions, including in 
  21553. some cases, payment of a fee. 
  21554.  
  21555.  
  21556. ΓòÉΓòÉΓòÉ 23.3. Acknowledgments ΓòÉΓòÉΓòÉ
  21557.  
  21558. TCP/IP for OS/2 incorporates compression code by the Info-ZIP group.  There are 
  21559. no extra charges or costs due to the use of this code, and the original 
  21560. compression sources are freely available from Compuserve in the OS2USER forum 
  21561. and by anonymous ftp from the Internet site ftp.uu.net:/pub/archiving/zip. 
  21562.  
  21563.  
  21564. ΓòÉΓòÉΓòÉ 23.4. Trademarks ΓòÉΓòÉΓòÉ
  21565.  
  21566. The following terms are trademarks of the IBM Corporation in the United States 
  21567. or other countries or both: 
  21568.  
  21569.     AIX 
  21570.     AS/400 
  21571.     IBM 
  21572.     Operating System/2 
  21573.     OS/2 
  21574.     RT 
  21575.     VisualAge 
  21576.  
  21577. The following terms are trademarks of other companies: 
  21578.  
  21579. Microsoft, Windows, and the Windows 95 logo are trademarks or registered 
  21580. trademarks of Microsoft Corporation. 
  21581.  
  21582. UNIX is a trademark of UNIX System Laboratories, Inc. 
  21583.  
  21584. Other company, product, and service names which may be denoted by a double 
  21585. asterisk (**), may be trademarks or service marks of others.