home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / mptsref.zip / MPTSPREF.INF (.txt) < prev   
OS/2 Help File  |  1996-04-04  |  202KB  |  7,908 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Version Notice ΓòÉΓòÉΓòÉ
  3.  
  4. First Edition (August 1994) 
  5.  
  6. The following paragraph does not apply to the United Kingdom or any country 
  7. where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS 
  8. MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY 
  9. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
  10. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  Some states 
  11. do not allow disclaimer of express or implied warranties in certain 
  12. transactions; therefore, this statement may not apply to you. 
  13.  
  14. This publication could include technical inaccuracies or typographical errors. 
  15. Changes are periodically made to the information herein; these changes will be 
  16. incorporated in new editions of the publication.  IBM may make improvements 
  17. and/or changes in the product(s) and/or the program(s) described in this 
  18. publication at any time. 
  19.  
  20. It is possible that this publication may contain reference to, or information 
  21. about, IBM products (machines and programs), programming, or services that are 
  22. not announced in your country.  Such references or information must not be 
  23. construed to mean that IBM intends to announce such IBM products, programming, 
  24. or services in your country. 
  25.  
  26. Requests for copies of this publication and for technical information about IBM 
  27. products should be made to your IBM Authorized Dealer or your IBM Marketing 
  28. Representative. 
  29.  
  30.  
  31. ΓòÉΓòÉΓòÉ 2. Notices ΓòÉΓòÉΓòÉ
  32.  
  33. The licensed program described in this document and all licensed material 
  34. available for it are provided by IBM under terms of the Agreement for IBM 
  35. Licensed Programs. 
  36.  
  37. Any reference to an IBM licensed program in this document is not intended to 
  38. state or imply that only the IBM program may be used. 
  39.  
  40. IBM may have patents or pending patent applications covering subject matter 
  41. described in this document. The furnishing of this document does not give you 
  42. any license to these patents. You can send inquiries, in writing, to the IBM 
  43. Director of Commercial Relations, International Business Machines Corporation, 
  44. Purchase, New York, 10577. 
  45.  
  46. Asia-Pacific users can inquire, in writing, to the IBM Director of Intellectual 
  47. Property and Lisensing, IBM World Trade Asia Corporation, 2-31, Roppongi 
  48. 3-chome, Minato-ku, Tokyo 106, Japan. 
  49.  
  50. References in this publication to IBM products, programs, or services do not 
  51. imply that IBM intends to make them available in all countries in which IBM 
  52. operates. 
  53.  
  54. This document is not intended for production use and is furnished as is without 
  55. any warranty of any kind, and all warranties are hereby disclaimed including 
  56. the warranties of merchantability and fitness for a particular purpose. 
  57.  
  58. Portions herein (C) Copyright 1979, 1980, 1983, 1986, Regents of the University 
  59. of California. Reproduced by permission. Portions herein were developed at the 
  60. Electrical Engineering and Computer Sciences Department at the Berkeley campus 
  61. of the University of California under the auspices of the Regents of the 
  62. University of California. 
  63.  
  64.  
  65. ΓòÉΓòÉΓòÉ 2.1. Trademarks ΓòÉΓòÉΓòÉ
  66.  
  67. The following terms, denoted by an asterisk (*) at their first occurrences in 
  68. this publication, are trademarks of IBM Corporation in the United States or 
  69. other countries: 
  70.  
  71. ┤БББББББББББББББББББББББББСББББББББББББББББББББББББББСБББББББББББББББББББББББББЖ
  72. ╨Æ AIX           ╨Æ AnyNet          ╨Æ IBM           ╨Æ
  73. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББТБББББББББББББББББББББББББЙ
  74. ╨Æ Operating System/2    ╨Æ OS/2           ╨Æ PC AT          ╨Æ
  75. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББТБББББББББББББББББББББББББЙ
  76. ╨Æ Presentation Manager   ╨Æ PS/2           ╨Æ RISC System/6000     ╨Æ
  77. БББББББББББББББББББББББББ╔ББББББББББББББББББББББББББ╔БББББББББББББББББББББББББД
  78.  
  79. The following terms, denoted by a double asterisk (**) at their first 
  80. occurrences in this publication, are trademarks of other companies: 
  81.  
  82. Trademark                     Owned By 
  83. AppleTalk                     Apple Computer, Inc. 
  84. Hayes                         Hayes Microcomputer Products, Inc. 
  85. Intel                         Intel Corporation 
  86. Microsoft C                   Microsoft Corporation 
  87. Motorola                      Motorola 
  88. NCS                           Apollo Computer, Inc. 
  89. Network Computing System      Apollo Computer, Inc. 
  90. NDIS                          3Com Corporation/Microsoft Corporation 
  91. Network File System           Sun Microsystems, Inc. 
  92. NFS                           Sun Microsystems, Inc. 
  93. Portmapper                    Sun Microsystems, Inc. 
  94. PostScript                    Adobe Systems, Inc. 
  95. Sun                           Sun Microsystems, Inc. 
  96. UNIX                          UNIX System Laboratories, Inc. 
  97. X Window System               Massachusetts Institute of Technology. 
  98.  
  99.  
  100. ΓòÉΓòÉΓòÉ 3. About This Book ΓòÉΓòÉΓòÉ
  101.  
  102. IBM Multi-Protocol Transport Services - AnyNet for OS/2:  Programmer's 
  103. Reference describes the Socket programming interface in an multi-protocol 
  104. transport services (MPTS) environment for Operating System/2 software on a 
  105. personal computer (PC). 
  106.  
  107. The MPTS Sockets over NetBIOS code and this MPTS publication are provided to 
  108. encourage users who want to start writing Sockets applications while 
  109. maintaining their use of NetBIOS applications on the LAN.  Users are hereby 
  110. advised, however, that this code is due to be replaced with equivalent code 
  111. within a relatively short time. The Socket API will not be affected. It is 
  112. suggested that only applications of a developmental nature be written to these 
  113. interfaces.  Such applications should not be used in high stress environments 
  114. until the replacement code has been delivered. 
  115.  
  116. Note:  In this book, the abbreviation PC refers to a personal computer that can 
  117.        run IBM OS/2 Version 2.0 or later.  The abbreviation OS/2 refers to 
  118.        Operating System/2, Version 2.0. 
  119.  
  120.  
  121. ΓòÉΓòÉΓòÉ 3.1. Who Should Use This Book ΓòÉΓòÉΓòÉ
  122.  
  123. This book is intended for system programmers writing Socket applications for a 
  124. PC. 
  125.  
  126. You should have a working knowledge of the transport protocols (such as TCP/IP 
  127. and NetBIOS).  In this book, the term protocol refers to a set of rules for 
  128. handling communication tasks. 
  129.  
  130. If you are not familiar with TCP/IP concepts, see Internetworking with TCP/IP 
  131. Volume I:  Principles, Protocols, and Architectures, and Internetworking with 
  132. TCP/IP Volume II: Implementation and Internals. 
  133.  
  134. If you are not familiar with LAN and NetBIOS protocol, see the IBM OS/2 LAN 
  135. Technical Reference. 
  136.  
  137.  
  138. ΓòÉΓòÉΓòÉ 3.2. How to Use This Book ΓòÉΓòÉΓòÉ
  139.  
  140. You should read this book before you start writing Socket applications on MPTS. 
  141.  
  142.  
  143. ΓòÉΓòÉΓòÉ 3.2.1. How This Book Is Organized ΓòÉΓòÉΓòÉ
  144.  
  145. This book is organized into the following chapters and appendixes.  Read the 
  146. beginning of each chapter to familiarize yourself with the topics that you need 
  147. to know to plan and install this product. 
  148.  
  149. General Programming Information, contains fundamental, technical information 
  150. about the application program interfaces (API) provided with MPTS for OS/2. 
  151.  
  152. Sockets, describes the socket interface and how to use the socket routines in a 
  153. user-written application. 
  154.  
  155. Sample Socket Programs provides sample TCP and UDP client and server C socket 
  156. communications programs. 
  157.  
  158. System Return Codes provides the system error messages, along with codes and 
  159. descriptions. 
  160.  
  161. Socket Quick Reference describes each socket call supported by MPTS for OS/2. 
  162.  
  163. This book also includes a glossary, a bibliography, and an index. 
  164.  
  165.  
  166. ΓòÉΓòÉΓòÉ 3.2.2. How the Term "internet" is Used ΓòÉΓòÉΓòÉ
  167.  
  168. In this book, an internet is a logical collection of networks supported by 
  169. gateways, routers, hosts, and various layers of protocols that permit the 
  170. network to function as a large, virtual network. 
  171.  
  172. Note:  The term internet is used as a generic term for a TCP/IP network and 
  173. should not be confused with the Internet (note capital I), which consists of 
  174. large national backbone networks (such as MILNET, NSFNet, and CREN) and a 
  175. myriad of regional and local campus networks all over the world. 
  176.  
  177.  
  178. ΓòÉΓòÉΓòÉ 3.2.3. How Numbers Are Used in This Book ΓòÉΓòÉΓòÉ
  179.  
  180. In this book, numbers over four digits are represented in metric style. A space 
  181. is used rather than a comma to separate groups of three digits. For example, 
  182. the number sixteen thousand one hundred forty-seven is written 16 147. 
  183.  
  184.  
  185. ΓòÉΓòÉΓòÉ 3.3. Related Books ΓòÉΓòÉΓòÉ
  186.  
  187. The following is a list of related publications that you might want to read for 
  188. more information about MPTN: 
  189.  
  190. o IBM TCP/IP Tutorial and Technical Overview 
  191.  
  192. o Internetworking with TCP/IP Volume I:  Principles, Protocols, and 
  193.   Architectures 
  194.  
  195. o Internetworking with TCP/IP Volume II:  Implementation and Internals 
  196.  
  197. o IBM Operating System/2 Extended Edition Version 1.3 System Administrator's 
  198.   Guide for Communications 
  199.  
  200. o Introducing IBM's TCP/IP Products for OS/2, VM, and MVS 
  201.  
  202. o IBM TCP/IP Version 2.0 for OS/2: Programmer's Reference 
  203.  
  204. o IBM TCP/IP Version 2.0 for OS/2: User's Guide 
  205.  
  206. o IBM TCP/IP Version 2.0 for OS/2: Quick Reference Guide. 
  207.  
  208. o IBM Local Area Network Technical Reference 
  209.  
  210. o IBM MPTS - AnyNet for OS/2: Configuration Guide. 
  211. For more information about related publications, see the Bibliography at the 
  212. back of this book. 
  213.  
  214.  
  215. ΓòÉΓòÉΓòÉ 4. General Programming Information ΓòÉΓòÉΓòÉ
  216.  
  217. This chapter contains technical information that you need to know before you 
  218. attempt to work with the Socket application program interfaces (API) provided 
  219. with the Socket/MPTS for OS/2, which are described in this book. 
  220.  
  221. You should have installed the MPTS for OS/2 product and application programming 
  222. interfaces (APIs) in the MPTN directory. 
  223.  
  224.  
  225. ΓòÉΓòÉΓòÉ 4.1. Header Files ΓòÉΓòÉΓòÉ
  226.  
  227. The following are some of the Socket application header files located on MPTS - 
  228. Disk 3. 
  229.  
  230. ARPA\NAMESER.H      NERRNO.H 
  231.  
  232. NET\IF_ARP.H        NETDB.H 
  233.  
  234. NET\IF.H            NETINET\IN.H 
  235.  
  236. NET\ROUTE.H         NETLIB.H 
  237.  
  238. SYS\SELECT.H        SYS\SOCKET.H 
  239.  
  240. SYS\TIME.H          TYPES.H 
  241.  
  242. UTILS.H             NETNB\NB.H 
  243.  
  244. SYS\DOMAIN.H        SYS\PROTOSW.H 
  245.  
  246. SYS\UN.H            SYS\IOCTL.H 
  247.  
  248.  
  249. ΓòÉΓòÉΓòÉ 4.2. Library Files ΓòÉΓòÉΓòÉ
  250.  
  251. Library Files and Their Application and DLL Files and Their Application list 
  252. library files to which an application must link. These files are in the 
  253. <mptn\lib> directory and the <mptn\dll> directory. 
  254.  
  255. ┤ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  256. ╨Æ Table 1. Library Files and Their Application                                     ╨Æ
  257. ╙БББББББББББББББББББББББББББББББББББББББСББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  258. ╨Æ LIBRARY FILE              ╨Æ APPLICATION                                  ╨Æ
  259. ╙БББББББББББББББББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  260. ╨Æ SO32DLL.LIB              ╨Æ Dynamic 32-bit protocol-independent Socket calls               ╨Æ
  261. ╙БББББББББББББББББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  262. ╨Æ TCPIPDLL.LIB              ╨Æ Dynamic 16-bit Socket calls                          ╨Æ
  263. ╙БББББББББББББББББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  264. ╨Æ TCP32DLL.LIB              ╨Æ Dynamic 32-bit protocol-dependent Socket calls                ╨Æ
  265. БББББББББББББББББББББББББББББББББББББББ╔ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББД
  266.  
  267. ┤ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  268. ╨Æ Table 2. DLL Files and Their Application                                       ╨Æ
  269. ╙БББББББББББББББББББББББББББББББББББББББСББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  270. ╨Æ DLL FILE                ╨Æ APPLICATION                                  ╨Æ
  271. ╙БББББББББББББББББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  272. ╨Æ TCPIPDLL.DLL              ╨Æ Executable 16-bit Socket calls                        ╨Æ
  273. ╙БББББББББББББББББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  274. ╨Æ SO32DLL.DLL              ╨Æ Executable 32-bit protocol-independent Socket calls              ╨Æ
  275. ╙БББББББББББББББББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  276. ╨Æ TCP32DLL.DLL              ╨Æ Executable 32-bit protocol-dependent Socket calls               ╨Æ
  277. БББББББББББББББББББББББББББББББББББББББ╔ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББД
  278.  
  279. Note:  All DLL files must reside in a directory listed in the LIBPATH system 
  280.        variable for the program to run. 
  281.  
  282.  
  283. ΓòÉΓòÉΓòÉ 4.3. Porting Considerations ΓòÉΓòÉΓòÉ
  284.  
  285. You should be aware of the following when you port your application: 
  286.  
  287. o To access system return values, you need to use only the errno.h include 
  288.   statement supplied with the compiler. 
  289.  
  290. o To access network return values, you must add the following include 
  291.   statement: 
  292.  
  293.     #include <nerrno.h>
  294.  
  295. o To access system and network return values from Socket APIs, you must use 
  296.   sock_errno() or psock_errno() rather than errno or perror() to return the 
  297.   errno information. 
  298.  
  299. For more information about porting a specific application, see the chapter for 
  300. that application. 
  301.  
  302.  
  303. ΓòÉΓòÉΓòÉ 4.4. 16-Bit Application Compiling and Linking ΓòÉΓòÉΓòÉ
  304.  
  305. Although 16-bit application compiling and linking are not supported in this 
  306. MPTS package, a 16-bit application can still run. 
  307.  
  308.  
  309. ΓòÉΓòÉΓòÉ 4.5. 32-Bit Application Compiling and Linking ΓòÉΓòÉΓòÉ
  310.  
  311. The Socket/MPTS support for 32-bit applications is compatible with TCP/IP 2.0. 
  312. The following steps describe the compiling and linking procedure for an 
  313. Application Programming Interface (API) using the IBM C Set/2 compiler. 
  314.  
  315.  1. Set your environment variables to find the following: 
  316.  
  317.    o Executable programs 
  318.    o Link libraries 
  319.    o Header files 
  320.  
  321.     You can set the environment variables interactively, or you can include 
  322.     them in your CONFIG.SYS file. The following is an example of the entries 
  323.     you may have in your CONFIG.SYS file. 
  324.  
  325.            SET PATH=C:\IBMC\BIN;%PATH%
  326.            SET DPATH=C:\IBMC\LOCALE;C:\IBMC\HELP;%DPATH%
  327.            SET LIB=C:\IBMC\LIB;C:\MPTN\LIB;%LIB%
  328.            SET INCLUDE=C:\IBMC\INCLUDE;C:\MPTN\INCLUDE;%INCLUDE%
  329.            SET HELP=C:\IBMC\HELP;%HELP%
  330.            SET BOOKSHELF=C:\IBMC\HELP;%BOOKSHELF%
  331.            SET TZ=EST5EDT,0,0,0,0,0,0,0,0,0
  332.  
  333.  2. To compile your program, enter the following command: 
  334.  
  335.              icc /C+ /DMPTN /DSO32 /DOS2 myprog
  336.  
  337.    o For a dynamically linked, single-threaded program: 
  338.  
  339.              LINK386 myprog.obj,,DDE4SBS.LIB DDE4SBM.LIB SO32DLL.LIB TCP32DLL.LIB
  340.              OS2386.LIB
  341.  
  342.    o For a dynamically linked, multithreaded program: 
  343.  
  344.              LINK386 myprog.obj,,DDE4MBS.LIB DDE4MBM.LIB SO32DLL.LIB TCP32DLL.LIB
  345.              OS2386.LIB
  346.  
  347. Note: 
  348.  
  349.  1. For information about compiling and linking a particular application 
  350.     program interface, see the chapter on that interface. 
  351.  
  352.  2. When running an application that is built using DLL, the LIBPATH 
  353.     environment variable in your CONFIG.SYS file must point to the MPTN\DLL 
  354.     directory. 
  355.  
  356.  3. For more information about the compile and link option, multithreaded 
  357.     libraries, and dynamic link libraries, see the IBM C Set/2 User's Guide. 
  358.  
  359.  4. You must include the Socket/MPTS library header files to ensure that proper 
  360.     function declaration and parameter types are used. 
  361.  
  362.  
  363. ΓòÉΓòÉΓòÉ 5. Sockets ΓòÉΓòÉΓòÉ
  364.  
  365. This chapter describes the C socket application programming interface (API), 
  366. which is provided with Socket/MPTS for OS/2.  Use the socket routines to 
  367. interface with the Local IPC, NetBIOS, TCP/IP over NetBIOS, TCP, UDP, ICMP, and 
  368. IP protocols. These socket routines allow a program to communicate across 
  369. networks with other programs.  You can, for example, make use of socket 
  370. routines when you write a client program that must communicate with a server 
  371. program running on another computer. 
  372.  
  373. To use the sockets, you must know C language programming. 
  374.  
  375.  
  376. ΓòÉΓòÉΓòÉ 5.1. Programming with Sockets ΓòÉΓòÉΓòÉ
  377.  
  378. The OS/2 socket API provides a standard interface to the transport and 
  379. internetwork layer interfaces of MPTN.  It supports four socket types:  stream, 
  380. sequence packet, datagram, and raw.  Stream, sequence packet, and datagram 
  381. sockets interface to the transport layer protocols, and raw sockets interface 
  382. to the TCP/IP network layer protocols. You should choose the most appropriate 
  383. interface for an application. 
  384.  
  385.  
  386. ΓòÉΓòÉΓòÉ 5.1.1. Socket Programming Concepts ΓòÉΓòÉΓòÉ
  387.  
  388. Before programming with the socket API, it is helpful to consider some 
  389. important concepts. 
  390.  
  391.  
  392. ΓòÉΓòÉΓòÉ 5.1.1.1. What is a Socket ΓòÉΓòÉΓòÉ
  393.  
  394. A socket is an endpoint for communication that can be named and addressed in a 
  395. network.  From an application program perspective, it is a resource allocated 
  396. by the operating system.  It is represented by an integer called a socket 
  397. descriptor. 
  398.  
  399. The socket interface is designed to provide applications with a network 
  400. interface that hides the details of the physical network. The interface is 
  401. differentiated by the different services that are provided.  Stream, datagram, 
  402. and raw sockets each define a different service available to applications. 
  403.  
  404.  
  405. ΓòÉΓòÉΓòÉ 5.1.1.2. Socket Types ΓòÉΓòÉΓòÉ
  406.  
  407. The stream socket (SOCK_STREAM) interface defines a reliable 
  408. connection-oriented service.  Data is sent without errors or duplication and is 
  409. received in the same order as it is sent. Flow control is built in to avoid 
  410. data overruns.  No boundaries are imposed on the data; it is considered to be a 
  411. stream of bytes. An example of an application that uses stream sockets is the 
  412. File Transfer Protocol (FTP). 
  413.  
  414. The sequence packet (SOCK_SEQPACKET) interface defines a reliable 
  415. connection-oriented service.  Data is sent without error or duplication and is 
  416. received in the same order as it was sent.  Flow control is built in to avoid 
  417. data overruns.  Every sequence packet is sent and received as a complete 
  418. record. 
  419.  
  420. The datagram socket (SOCK_DGRAM) interface defines a connectionless service. 
  421. Datagrams are sent as independent packets. The service provides no guarantees; 
  422. data can be lost or duplicated, and datagrams can arrive out of order.  The 
  423. size of a datagram is limited to the size that an underlying protocol supports. 
  424. For UDP, the maximum datagram size (that can be sent in a single transaction) 
  425. is 32 767.  The default is 8192.  No packet disassembly and reassembly is 
  426. performed.  An example of an application that uses datagram sockets is the 
  427. Network File System (NFS). 
  428.  
  429. The raw socket (SOCK_RAW) interface allows direct access to lower layer 
  430. protocols such as IP and Internet Control Message Protocol (ICMP).  The 
  431. interface is often used for testing new protocol implementations or gaining 
  432. access to some of the more advanced facilities of an existing protocol. 
  433.  
  434. The socket types are defined in the <SYS\SOCKET.H> header file. 
  435.  
  436. The socket interface can be extended; therefore, you can define new socket 
  437. types to provide additional services.  An example of this is the transaction 
  438. type sockets defined for interfacing to the versatile message transfer protocol 
  439. (VMTP). ╨¥David R. Cheriton and Carey L. Williamson, "VMTP as the Transport 
  440. Layer for High-Performance Distributed Systems," IEEE Communications, June 
  441. 1989, Vol. 27, No. 6. Γöÿ 
  442.  
  443. Transaction-type sockets are not supported by MPTN for OS/2.  Because socket 
  444. interfaces isolate you from the communication functions of the different 
  445. protocol layers, the interfaces are largely independent of the underlying 
  446. network.  In the OS/2 implementation of sockets, stream sockets interface to 
  447. TCP, sequence packet socket interface to native NetBIOS, datagram sockets 
  448. interface to UDP, and raw sockets interface to ICMP and IP.  In the future, the 
  449. underlying protocols may change, but the socket interface will remain the same. 
  450. For example, stream sockets may eventually interface to the International 
  451. Standards Organization (ISO) Open System Interconnection (OSI) transport class 
  452. 4 protocol.  This means that applications will not have to be rewritten as 
  453. underlying protocols change. ╨¥This does not imply an IBM statement of 
  454. direction. Γöÿ 
  455.  
  456.  
  457. ΓòÉΓòÉΓòÉ 5.1.2. Guidelines for Using Socket Types ΓòÉΓòÉΓòÉ
  458.  
  459. The following considerations help you choose the appropriate socket type for an 
  460. application. 
  461.  
  462. If you are communicating with an existing application, you must use the same 
  463. protocols as the existing application.  For example, if you interface to an 
  464. application that uses NetBIOS or LIPC, you must use stream sockets. For other 
  465. applications, you should consider the following factors: 
  466.  
  467. o Reliability.  Stream sockets provide the most reliable connection.  Datagram, 
  468.   or raw sockets, are unreliable, because packets can be discarded, corrupted, 
  469.   or duplicated during transmission. This may be acceptable if the application 
  470.   does not require reliability, or if the application implements the 
  471.   reliability on top of the socket's interface.  The trade-off is the increased 
  472.   performance available over stream sockets. 
  473.  
  474. o Performance.  The overhead associated with reliability, flow control, packet 
  475.   reassembly, and connection maintenance degrades the performance of stream 
  476.   sockets so that they do not perform as well as datagram sockets. 
  477.  
  478. o Amount of data to be transferred.  Datagram sockets impose a limit on the 
  479.   amount of data transferred, depending on the protocol.  If you send less than 
  480.   4089 bytes at a time, use datagram sockets.  As the amount of data in a 
  481.   single transaction increases, it is preferable to use stream sockets. 
  482.  
  483. If you are writing a new protocol on top of IP or wish to use the ICMP 
  484. protocol, then you must choose raw sockets. 
  485.  
  486.  
  487. ΓòÉΓòÉΓòÉ 5.1.2.1. Address Families ΓòÉΓòÉΓòÉ
  488.  
  489. or communication domains.  All hosts in the same address family understand and 
  490. use the same scheme of address socket endpoints.  MPTN for OS/2 supports three 
  491. address families: 
  492.  
  493. o AF_INET - Defines addresses in the internet domain. 
  494. o AF_NETBIOS - Defines addresses in the NetBIOS LAN. 
  495. o AF_OS2 - Defines addresses in the Local IPC. 
  496.  
  497. The AF_INET domain defines address in the internet domain.  The AF_NETBIOS 
  498. defines addresses in the NetBIOS LAN and the AF_OS2 defines addresses in the 
  499. Local IPC.  The address families are defined in the <SYS\SOCKET.H> header file. 
  500.  
  501.  
  502. ΓòÉΓòÉΓòÉ 5.1.2.2. Socket Address ΓòÉΓòÉΓòÉ
  503.  
  504. A socket address is defined by the sockaddr structure in the <SYS\SOCKET.H> 
  505. header file. It has two fields, as shown in the following example: 
  506.  
  507. struct sockaddr
  508. {
  509.     u_short sa_family;     /* address family */
  510.     char    sa_data╨¥14Γöÿ;     /* up to 14 bytes of direct address */
  511. };
  512.  
  513. The sa_family field contains the address family. It is AF_INET for the internet 
  514. domain. The sa_data field is different for each address family. Each address 
  515. family defines its own structure, which can be overlaid on the sockaddr 
  516. structure. 
  517.  
  518. Addressing within a NetBIOS/LAN 
  519.  
  520. A socket address in a NetBIOS address family is comprised of four fields:  the 
  521. address family (AF_NETBIOS), the address type, NetBIOS netid and NetBIOS name. 
  522. The structure of a NetBIOS socket address is defined by the following 
  523. sockaddr_nb structure, which is found in the <NETNB\NB.H> header file: 
  524.  
  525. struct sockaddr_nb
  526. {
  527.     short snb_family;               /* netbios protocol family */
  528.     short snb_type;                /* unique or multicast  */
  529.     char  snb_netid╨¥NB_NETIDLENΓöÿ;   /* netbios netid */
  530.     char  snb_name╨¥NB_NAMELENΓöÿ;     /* netbios name */
  531. };
  532.  
  533. Addressing within a Local Socket (LIPC) 
  534.  
  535. A socket address in a local system is comprised of two fields: the address 
  536. family (AF_OS2) and the path name.  The structure of a local IPC socket address 
  537. is defined by the following sockaddr_un structure, which is found in the 
  538. <SYS\UN.H> header file: 
  539.  
  540. struct sockaddr_un
  541. {
  542.     short sun_family;        /* AF_UNIX or AF_OS2 */
  543.     char  sun_path╨¥108Γöÿ;     /* path name */
  544. };
  545.  
  546. Addressing within an Internet Domain 
  547.  
  548. A socket address in an internet address family comprises four fields:  the 
  549. address family (AF_INET), an internet address, a port, and a character array. 
  550. The structure of an internet socket address is defined by the following 
  551. sockaddr_in structure, which is found in the <NETINET\IN.H> header file: 
  552.  
  553. struct in_addr
  554. {
  555.         u_long s_addr;
  556. };
  557.  
  558. struct sockaddr_in
  559. {
  560.         short   sin_family;
  561.         u_short sin_port;
  562.         struct  in_addr sin_addr;
  563.         char    sin_zero╨¥8Γöÿ;
  564. };
  565.  
  566. The sin_family field is set to AF_INET. The sin_port field is the port used by 
  567. the application, in network-byte order.  The sin_addr field is the internet 
  568. address of the network interface used by the application.  It is also in 
  569. network-byte order. The sin_zero field should be set to all zeros. 
  570.  
  571.  
  572. ΓòÉΓòÉΓòÉ 5.1.2.3. Internet Addresses ΓòÉΓòÉΓòÉ
  573.  
  574. Internet addresses are 32-bit quantities that represent a network interface. 
  575. Every internet address within an administered AF_INET domain must be unique.  A 
  576. common misunderstanding is that every host must have only one internet address. 
  577. In fact, a host has as many internet addresses as it has network interfaces. 
  578. For more information about internet address formats, see Internetworking with 
  579. TCP/IP Volume I:  Principles, Protocols, and Architectures, and Volume II: 
  580. Implementation and Internals. 
  581.  
  582.  
  583. ΓòÉΓòÉΓòÉ 5.1.2.4. Ports ΓòÉΓòÉΓòÉ
  584.  
  585. A port is used to differentiate between different applications using the same 
  586. protocol (TCP or UDP).  It is an additional qualifier used by the system 
  587. software to get data to the correct application. Physically, a port is a 16-bit 
  588. integer.  Some ports are reserved for particular applications and are called 
  589. well-known ports. 
  590.  
  591.  
  592. ΓòÉΓòÉΓòÉ 5.1.2.5. Network-Byte Order ΓòÉΓòÉΓòÉ
  593.  
  594. using the network-byte ordering convention. Network-byte order is also known as 
  595. big endian byte ordering, as in Motorola╨¥**Γöÿ microprocessors (compared with 
  596. little endian byte ordering in Intel╨¥**Γöÿ microprocessors). Using network-byte 
  597. ordering for data exchanged between hosts allows hosts using different 
  598. architectures to exchange address information. See pages Main Socket Calls, 
  599. Main Socket Calls, and Main Socket Calls for examples of using the htons() call 
  600. to put ports into network-byte order. For more information about network-byte 
  601. order, see accept(), bind(), htonl(), htons(), ntohl(), and ntohs(). 
  602.  
  603. Note:  The socket interface does not handle application data byte ordering 
  604.        differences. Application writers must handle byte order differences 
  605.        themselves or use higher-level interfaces, such as Remote Procedure 
  606.        Calls (RPC) or Network Computing System (NCS). 
  607.  
  608.  
  609. ΓòÉΓòÉΓòÉ 5.1.3. Main Socket Calls ΓòÉΓòÉΓòÉ
  610.  
  611. With few socket calls, you can write a very powerful network application. 
  612.  
  613.  1. First, an application must be initialized with sockets using the 
  614.     sock_init() call, as in the example listed in An Application Uses the 
  615.     sock_init() Call. For a more detailed description, see  sock_init(). 
  616.  
  617.  
  618.         An Application Uses the sock_init() Call
  619.  
  620.         int rc;
  621.         int sock_init();
  622.         .
  623.         .
  624.         .
  625.         rc = sock_init();
  626.  
  627.     The code fragment in An Application Uses the sock_init() Call initializes 
  628.     the process with the socket library and checks whether MPTN.SYS is running. 
  629.  
  630.  2. Next, an application must get a socket descriptor example listed in An 
  631.     Application Uses the socket() Call. For a more detailed description, see 
  632.     socket(). 
  633.  
  634.  
  635.         An Application Uses the socket() Call
  636.  
  637.         int socket(int domain, int type, int protocol);
  638.         .
  639.         .
  640.         .
  641.         int s;
  642.         .
  643.         .
  644.         .
  645.         s = socket(AF_INET, SOCK_STREAM, 0);
  646.  
  647.     The code fragment in An Application Uses the socket() Call allocates a 
  648.     socket descriptor s in the internet address family.  The domain parameter 
  649.     is a constant that specifies the domain where the communication is taking 
  650.     place. A domain is the collection of applications using the same naming 
  651.     convention. Socket/MPTS supports three address families:  AF_INET, 
  652.     AF_NETBIOS, and AF_OS2. The type parameter is a constant that specifies the 
  653.     type of socket, which can be SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM, or 
  654.     SOCK_RAW. protocol parameter is a constant that specifies the protocol to 
  655.     use. Passing 0 chooses the default protocol. If successful, socket() 
  656.     returns a positive integer called socket descriptor. 
  657.  
  658.  3. After an application has a socket descriptor, it can explicitly bind() a 
  659.     unique name to the socket, as in the example listed in An Application Uses 
  660.     the bind() Call. For a more detailed description, seebind(). 
  661.  
  662.  
  663.         An Application Uses the bind() Call
  664.  
  665.         int rc;
  666.         int s;
  667.         struct sockaddr_in myname;
  668.         int bind(int s, struct sockaddr *name, int namelen);
  669.  
  670.         /* clear the structure to be sure that the sin_zero field is clear */
  671.         memset(&myname, 0 sizeof(myname));
  672.         myname.sin_family = AF_INET;
  673.         myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  674.         myname.sin_port = htons(1024);
  675.         .
  676.         .
  677.         .
  678.         rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  679.  
  680.     This example binds myname to socket s. The name specifies that the 
  681.     application is in the internet domain (AF_INET) at internet address 
  682.     129.5.24.1, and is bound to port 1024. Servers must bind a name to become 
  683.     accessible from the network. The example in An Application Uses the bind() 
  684.     Call shows two useful utility routines: 
  685.  
  686.    o inet_addr() takes an internet address in dotted decimal form and returns 
  687.      it in network-byte order. For a more detailed description, see 
  688.      inet_addr(). 
  689.  
  690.    o htons() takes a port number in host-byte order and returns the port in 
  691.      network-byte order.  For a more detailed description, see htons(). 
  692.  
  693.  4. After binding a name to a socket, a server using stream sockets must 
  694.     indicate its readiness to accept connections from clients. The server does 
  695.     this with the listen() call, as illustrated in the example in An 
  696.     Application Uses the listen() Call. 
  697.  
  698.  
  699.         An Application Uses the listen() Call
  700.  
  701.         int s;
  702.         int backlog;
  703.         int rc;
  704.         int listen(int s, int backlog);
  705.         .
  706.         .
  707.         .
  708.         rc = listen(s, 5);
  709.  
  710.     socket/MPTS software that the server is ready to begin accepting 
  711.     connections and that a maximum of five connection requests can be queued 
  712.     for the server. Additional requests are ignored.  For a more detailed 
  713.     description, see listen(). 
  714.  
  715.  5. Clients using stream sockets initiate a connection request by calling 
  716.     connect(), as shown in An Application Uses the connect() Call. 
  717.  
  718.  
  719.         An Application Uses the connect() Call
  720.  
  721.         int s;
  722.         struct sockaddr_in servername;
  723.         int rc;
  724.         int connect(int s, struct sockaddr *name, int namelen);
  725.         .
  726.         .
  727.         .
  728.         memset(&servername, 0,sizeof(servername));
  729.         servername.sin_family = AF_INET;
  730.         servername.sin_addr = inet_addr("129.5.24.1");
  731.         servername.sin_port = htons(1024);
  732.         .
  733.         .
  734.         .
  735.         rc = connect(s, (struct sockaddr *) &servername, sizeof(servername));
  736.  
  737.     The connect() call attempts to connect socket s to the server with name 
  738.     servername. This could be the server that was used in the previous bind() 
  739.     example. The caller optionally blocks until the connection is accepted by 
  740.     the server.  On successful return, the socket s is associated with the 
  741.     connection to the server.  For a more detailed description, see connect(). 
  742.  
  743.  
  744.         An Application Uses the gethostbyname() Call
  745.  
  746.         int s;
  747.         struct sockaddr_in servername;
  748.         char *hostname = "serverhost";
  749.         int rc;
  750.         int connect(int s, struct sockaddr_in *name, int namelen);
  751.         struct servent *sp;
  752.         struct hostent *hp;
  753.         .
  754.         .
  755.         .
  756.  
  757.         hp = gethostbyname(hostname);
  758.  
  759.         /* clear the structure to be sure that the sin_zero field is clear */
  760.         memset(&servername,0,sizeof(servername));
  761.         servername.sin_family = AF_INET;
  762.         servername.sin_addr.s_addr = *((u_long *)hp->h_addr);
  763.         servername.sin_port = 1024;
  764.         .
  765.         .
  766.         .
  767.         rc = connect(s,(struct sockaddr *)&servername,sizeof(servername));
  768.     An Application Uses the gethostbyname() Call shows an example of a network 
  769.     utility routine, gethostbyname() call, to find out the internet address of 
  770.     serverhost from the name server or the \ETC\HOSTS file. 
  771.  
  772.  6. Servers using stream sockets accept a connection request with the accept() 
  773.     call, as shown in the example in An Application Uses the accept() Call. 
  774.  
  775.  
  776.         An Application Uses the accept() Call
  777.  
  778.         int clientsocket;
  779.         int s;
  780.         struct sockaddr clientaddress;
  781.         int addrlen;
  782.         int accept(int s, struct sockaddr *addr, int *addrlen);
  783.         .
  784.         .
  785.         .
  786.         addrlen = sizeof(clientaddress);
  787.         .
  788.         .
  789.         .
  790.         clientsocket = accept(s, &clientaddress, &addrlen);
  791.  
  792.     If connection requests are not pending on socket s, the accept() call 
  793.     optionally blocks the server.  When a connection request is accepted on 
  794.     socket s, the name of the client and length of the client name are 
  795.     returned, along with a new socket descriptor.  The new socket descriptor is 
  796.     associated with the client that initiated the connection and s is again 
  797.     available to accept new connections.  For a more detailed description, 
  798.     seeaccept(). 
  799.  
  800.  7. Clients and servers have many calls from which to choose for data transfer. 
  801.     The readv() and writev(), and send() and recv() calls can be used only on 
  802.     sockets that are in the connected state. The sendto() and recvfrom() calls 
  803.     can be used at any time.  The example in An Application Uses the send() and 
  804.     recv() Calls illustrates the use of send() and recv(). 
  805.  
  806.  
  807.         An Application Uses the send() and recv() Calls
  808.  
  809.         int bytes_sent;
  810.         int bytes_received;
  811.         char data_sent╨¥256Γöÿ;
  812.         char data_received╨¥256Γöÿ;
  813.         int send(int socket, char *buf, int buflen, int flags);
  814.         int recv(int socket, char *buf, int buflen, int flags);
  815.         int s;
  816.         .
  817.         .
  818.         .
  819.         bytes_sent = send(s, data_sent, sizeof(data_sent), 0);
  820.         .
  821.         .
  822.         .
  823.         bytes_received = recv(s, data_received, sizeof(data_received), 0);
  824.  
  825.     The example in An Application Uses the send() and recv() Calls shows an 
  826.     application sending data on a connected socket and receiving data in 
  827.     response. The flags field can be used to specify additional options to 
  828.     send() or recv(), such as sending out-of-band data. See readv(), recv(), 
  829.     send(), and writev() for more information about these routines. 
  830.  
  831.  8. If the socket is not in a connected state, additional address information 
  832.     must be passed to sendto() and may be optionally returned from recvfrom(). 
  833.     An example of the use of the sendto() and recvfrom() calls is shown in An 
  834.     Application Uses the sendto() and recvfrom() Call. 
  835.  
  836.  
  837.         An Application Uses the sendto() and recvfrom() Call
  838.  
  839.         int bytes_sent;
  840.         int bytes_received;
  841.         char data_sent╨¥256Γöÿ;
  842.         char data_received╨¥256Γöÿ;
  843.         struct sockaddr_in to;
  844.         struct sockaddr from;
  845.         int addrlen;
  846.         int sendto(int socket, char *buf, int buflen, int flags,
  847.                    struct sockaddr *addr, int addrlen);
  848.         int recvfrom(int socket, char *buf, int buflen, int flags,
  849.                    struct sockaddr *addr, int *addrlen);
  850.         int s;
  851.         .
  852.         .
  853.         .
  854.         to.sin_family = AF_INET;
  855.         to.sin_addr   = inet_addr("129.5.24.1");
  856.         to.sin_port   = htons(1024);
  857.         .
  858.         .
  859.         .
  860.         bytes_sent = sendto(s, data_sent, sizeof(data_sent), 0, &to, sizeof(to));
  861.         .
  862.         .
  863.         .
  864.         addrlen = sizeof(from); /* must be initialized */
  865.         bytes_received = recvfrom(s, data_received,
  866.            sizeof(data_received), 0, &from, &addrlen);
  867.  
  868.     The sendto() and recvfrom() calls take additional parameters that allow the 
  869.     caller to specify the recipient of the data or to be notified of the sender 
  870.     of the data. See recvfrom(), and sendto(), for more information about these 
  871.     additional parameters. Usually, sendto() and recvfrom() are used for 
  872.     datagram sockets, and send() and recv() are used for stream sockets. 
  873.  
  874.  9. The writev(), and readv() calls provide the additional features of scatter 
  875.     and gather data. Scattered data can be located in multiple data buffers. 
  876.     The writev() call gathers the scattered data and sends it. The readv() call 
  877.     receives data and scatters it into multiple buffers. 
  878.  
  879. 10. Applications can handle multiple sockets. In such situations, use the 
  880.     select() call to determine the sockets that have data to be read, those 
  881.     that are ready for data to be written, and the sockets that have pending 
  882.     exceptional conditions. An example of how the BSD version select() call is 
  883.     used is shown in An Application Uses the BSD Version select() Call. 
  884.  
  885.  
  886.         An Application Uses the BSD Version select() Call
  887.  
  888.         #define BSD_SELECT
  889.  
  890.         fd_set readsocks;
  891.         fd_set writesocks;
  892.         fd_set exceptsocks;
  893.         struct timeval timeout;
  894.         int number_of_sockets;
  895.         int number_found;
  896.         .
  897.         .
  898.         .
  899.         /* set bits in read write except bit masks.  To set mask for a descriptor s use
  900.         *   readsocks |= fd_set(s);
  901.         *
  902.         * set number of sockets to be checked
  903.         * number_of_sockets = x;
  904.         */
  905.         .
  906.         .
  907.         .
  908.         number_found = select(number_of_sockets,
  909.                               &readsocks, &writesocks, &exceptsocks, &timeout);
  910.  
  911.     In this example, the application sets bit masks to indicate the sockets 
  912.     being tested for certain conditions and also indicates a time-out. If the 
  913.     time-out parameter is NULL, the call does not wait for any socket to become 
  914.     ready on these conditions. If the time-out parameter is nonzero, select() 
  915.     waits up to this amount of time for at least one socket to become ready on 
  916.     the indicated conditions. This is useful for applications servicing 
  917.     multiple connections that cannot afford to block, waiting for data on one 
  918.     connection. For a more detailed description, see BSD Version. 
  919.  
  920. 11. In addition to select(), applications can use the ioctl() call to help 
  921.     perform asynchronous (nonblocking) socket operations.  An example of the 
  922.     use of the ioctl() call is shown in An Application Uses the ioctl() Call. 
  923.  
  924.  
  925.         An Application Uses the ioctl() Call
  926.  
  927.         int s;
  928.         int dontblock;
  929.         char buf╨¥256Γöÿ;
  930.         int rc;
  931.         int ioctl(int s, unsigned long command, char *command_data, int datasize);
  932.         .
  933.         .
  934.         .
  935.         dontblock = 1;
  936.         .
  937.         .
  938.         .
  939.         rc = ioctl(s, FIONBIO, (char *) &dontblock, sizeof(dontblock));
  940.         .
  941.         .
  942.         .
  943.         if (recv(s, buf, sizeof(buf), 0) == -1 && errno == EWOULDBLOCK)
  944.            /* no data available */
  945.         else
  946.            /* either got data or some other error occurred */
  947.  
  948.     s to be placed in nonblocking mode.  When this socket is passed as a 
  949.     parameter to calls that would block, such as recv() when data is not 
  950.     present, it causes the call to return with an error code, and sets the 
  951.     error value to SOCEWOULDBLOCK.  Setting the mode of the socket to be 
  952.     nonblocking allows an application to continue processing without becoming 
  953.     blocked. For a more detailed description, seeioctl(). 
  954.  
  955. 12. A socket descriptor, s, is deallocated with the soclose() call. For a more 
  956.     detailed description, see soclose(). An example of the soclose() call is 
  957.     shown in An Application Uses the soclose() Call. 
  958.  
  959.  
  960.         An Application Uses the soclose() Call
  961.  
  962.         .
  963.         .
  964.         .
  965.         /* close the socket */
  966.         soclose(s);
  967.         .
  968.         .
  969.         .
  970.  
  971.  
  972. ΓòÉΓòÉΓòÉ 5.1.3.1. A Typical Stream or Sequence Packet Socket Session ΓòÉΓòÉΓòÉ
  973.  
  974. You can use TCP sockets for both passive (server) and active (client) 
  975. processes. While some commands are necessary for both types, some are 
  976. role-specific.  See Sample Socket Programs, for sample C socket communication 
  977. client and server programs. 
  978.  
  979. After you make a connection, it exists until you close the socket. During the 
  980. connection, data is either delivered or an error code is returned by 
  981. Socket/MPTS. 
  982.  
  983. See A Typical Socket Session for the general sequence of calls to be followed 
  984. for most socket routines using TCP sockets. 
  985.  
  986.  
  987. ΓòÉΓòÉΓòÉ 5.1.3.2. A Typical Datagram Socket Session ΓòÉΓòÉΓòÉ
  988.  
  989. UDP socket processes, unlike TCP socket processes, are not clearly 
  990. distinguished by server and client roles. Instead, the distinction is between 
  991. connected and unconnected sockets. An unconnected socket can be used to 
  992. communicate with any host; but a connected socket, because it has a dedicated 
  993. destination, can send data to, and receive data from, only one host. 
  994.  
  995. Both connected and unconnected sockets send their data over the network without 
  996. verification. Consequently, after a packet has been accepted by the UDP 
  997. interface, the arrival of the packet and the integrity of the packet cannot be 
  998. guaranteed. 
  999.  
  1000. See A Typical UDP Socket Session for the general sequence of calls to be 
  1001. followed for most socket routines using UDP sockets. 
  1002.  
  1003.                CLIENT                            SERVER
  1004.  
  1005.     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û    Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1006.     ╨Æ                         ╨Æ    ╨Æ                         ╨Æ
  1007.     ╨Æ   Create stream socket s with the socket()   ╨Æ    ╨Æ   Create stream socket s with the socket()   ╨Æ
  1008.     ╨Æ   call.                    ╨Æ    ╨Æ   call.                     ╨Æ
  1009.     ╨Æ                         ╨Æ    ╨Æ                         ╨Æ
  1010.     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö    ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1011.                 ╨Æ                             ╨Æ
  1012.     Γöñ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æΓòö╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ╨æ╨û     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1013.      (optional)                       ╨Æ                         ╨Æ
  1014.      Bind socket s to a local address with the        ╨Æ  Bind socket s to a local address with the   ╨Æ
  1015.      bind() call.                      ╨Æ  bind() call.                  ╨Æ
  1016.                                  ╨Æ                         ╨Æ
  1017.     ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨í╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ╨æ╨ö     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1018.                 ╨Æ                             ╨Æ
  1019.                 ╨Æ                 Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1020.                 ╨Æ                 ╨Æ                         ╨Æ
  1021.                 ╨Æ                 ╨Æ  With the listen() call, alert the        ╨Æ
  1022.                 ╨Æ                 ╨Æ  machine of your willingness to accept      ╨Æ
  1023.                 ╨Æ                 ╨Æ  connections.                  ╨Æ
  1024.                 ╨Æ                 ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1025.                 ╨Æ                             ╨Æ
  1026.     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û                 ╨Æ
  1027.     ╨Æ                         ╨Æ                 ╨Æ
  1028.     ╨Æ  Connect socket s to a foreign host with the   ╨Æ                 ╨Æ
  1029.     ╨Æ  connect() call.                 ╨Æ                 ╨Æ
  1030.     ╨Æ                         ╨Æ                 ╨Æ
  1031.     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö                 ╨Æ
  1032.                 ╨Æ                             ╨Æ
  1033.                 ╨Æ                 Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1034.                 ╨Æ                 ╨Æ  Accept the connection and receive a second   ╨Æ
  1035.                 ╨Æ                 ╨Æ  socket, for example ns, with the accept()   ╨Æ
  1036.                 ╨Æ                 ╨Æ  call.                     ╨Æ
  1037.                 ╨Æ                 ╨Æ                         ╨Æ
  1038.                 ╨Æ                 ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1039.                 ╨Æ                             ╨Æ
  1040.                 ╨Æ     For the server, socket s remains available    ╨Æ
  1041.                 ╨Æ      to accept new connections.  Socket ns      ╨Æ
  1042.                 ╨Æ        is dedicated to the client.        ╨Æ
  1043.                 ╨Æ                             ╨Æ
  1044.                 ╨Æ                             ╨Æ
  1045.     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û    Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1046.     ╨Æ  Read and write data on socket s, using the   ╨Æ    ╨Æ  Read and write data on socket ns, using the   ╨Æ
  1047.     ╨Æ  send() and recv() calls, until all data has   ╨Æ ╨æ╨æ╨æ╨æ╨æ╨Æ  send() and recv() calls, until all data has   ╨Æ
  1048.     ╨Æ  been exchanged.                 ╨Æ ╨æ╨æ╨æ╨æ ╨Æ  been exchanged.                 ╨Æ
  1049.     ╨Æ                         ╨Æ    ╨Æ                         ╨Æ
  1050.     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö    ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1051.                 ╨Æ                             ╨Æ
  1052.     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û    Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1053.     ╨Æ                         ╨Æ    ╨Æ                         ╨Æ
  1054.     ╨Æ  Close socket s and end the session       ╨Æ    |  Close socket ns with the soclose() call.    ╨Æ
  1055.     ╨Æ  with the soclose() call.            ╨Æ    ╨Æ                         ╨Æ
  1056.     ╨Æ                         ╨Æ    ╨Æ                         ╨Æ
  1057.     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö    ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1058.                                              ╨Æ
  1059.                                  Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1060.                                  ╨Æ Accept another connection from a client, or   ╨Æ
  1061.                                  ╨Æ close the original socket s with the soclose()  ╨Æ
  1062.                                  ╨Æ call.                      ╨Æ
  1063.                                  ╨Æ                         ╨Æ
  1064.                                  ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1065.  
  1066.  
  1067. A Typical Socket Session 
  1068.  
  1069.                CLIENT                            SERVER
  1070.  
  1071.     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1072.     ╨Æ                         ╨Æ     ╨Æ                         ╨Æ
  1073.     ╨Æ  Create datagram socket s with the socket()   ╨Æ     ╨Æ   Create datagram socket s with the socket()  ╨Æ
  1074.     ╨Æ  call.                      ╨Æ     ╨Æ   call.                     ╨Æ
  1075.     ╨Æ                         ╨Æ     ╨Æ                         ╨Æ
  1076.     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1077.                 ╨Æ                              ╨Æ
  1078.     Γöñ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æΓòö╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨û     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1079.      (optional)                        ╨Æ                         ╨Æ
  1080.      Bind socket s to a local address with the        ╨Æ  Bind socket s to a local address with the    ╨Æ
  1081.      bind() call.                       ╨Æ  bind() call.                  ╨Æ
  1082.                                  ╨Æ                         ╨Æ
  1083.     ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨í╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨ö     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1084.                 ╨Æ                              ╨Æ
  1085.     Γöñ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æΓòö╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨û     Γöñ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æΓòö╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨û
  1086.      (optional)                         (optional)
  1087.      Connect socket s using the connect() call to        Connect socket s using the connect() call to
  1088.      associate s with the server address.            associate s with the client address.
  1089.  
  1090.     ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨í╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨ö     ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨í╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨æ ╨æ╨ö
  1091.                 ╨Æ                              ╨Æ
  1092.     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1093.     ╨Æ  Send and receive data on socket s, using the  ╨Æ     ╨Æ  Send and receive data on socket s, using the  ╨Æ
  1094.     ╨Æ  sendto() and recvfrom() calls, until all data  ╨Æ ╨æ╨æ╨æ╨æ╨æ╨æ╨Æ  sendto() and recvfrom() calls, until all data  ╨Æ
  1095.     ╨Æ  has been exchanged.  Use the send() and recv() ╨Æ╨æ╨æ╨æ╨æ╨æ╨æ ╨Æ  has been exchanged.  Use the send() and recv() ╨Æ
  1096.     ╨Æ  calls if connect() was called.         ╨Æ     ╨Æ  calls if connect() was called.         ╨Æ
  1097.     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨í╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1098.                 ╨Æ                              ╨Æ
  1099.     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æΓòö╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û     Γöñ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨û
  1100.     ╨Æ                         ╨Æ     ╨Æ                         ╨Æ
  1101.     ╨Æ  Close socket s and end the session with the   ╨Æ     ╨Æ  Close socket s and end the session with the   ╨Æ
  1102.     ╨Æ  soclose() call.                 ╨Æ     ╨Æ  soclose() call.                 ╨Æ
  1103.     ╨Æ                         ╨Æ     ╨Æ                         ╨Æ
  1104.     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö     ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨æ╨ö
  1105.  
  1106. A Typical UDP Socket Session 
  1107.  
  1108.  
  1109. ΓòÉΓòÉΓòÉ 5.1.3.3. TCP/IP Specific Network Utility Routines ΓòÉΓòÉΓòÉ
  1110.  
  1111. The OS/2 socket API also provides a set of network utility routines to perform 
  1112. useful tasks such as internet address translation, domain name resolution, 
  1113. network-byte order translation, and access to the database of useful network 
  1114. information.  Network utility routines are discribed in the following pages. 
  1115.  
  1116. Host Names Information 
  1117.  
  1118. The following is a list of host calls. 
  1119.  
  1120. o gethostbyname() 
  1121. o gethostbyaddr() 
  1122.  
  1123. The gethostbyname() call takes an internet host name and returns a hostent 
  1124. structure, which contains the name of the host, aliases, host address family 
  1125. and host address. The hostent structure is defined in the <NETDB.H> header 
  1126. file. The gethostbyaddr() call maps the internet host address into a hostent 
  1127. structure. 
  1128.  
  1129. The database for these calls is provided by the name server or the \ETC\HOSTS 
  1130. file if a name server is not present or is unable to resolve the host name. 
  1131. Because of the differences in the databases and their access protocols, the 
  1132. information returned can differ. 
  1133.  
  1134. Network-Byte Order Translation 
  1135.  
  1136. using the network-byte ordering convention.  The following calls translate 
  1137. integers from host- to network-byte order and from network- to host-byte order. 
  1138.  
  1139. htonl()     Translates host to network, long integer(32-bit) 
  1140. htons()     Translates host to network, short integer(16-bit) 
  1141. ntohl()     Translates network to host, long integer(32-bit) 
  1142. ntohs()     Translates network to host, short integer(16-bit) 
  1143.  
  1144. Internet Address Manipulation 
  1145.  
  1146. The following calls convert internet addresses and decimal notation, and 
  1147. manipulate the network number and local network address portions of an internet 
  1148. address. 
  1149.  
  1150. inet_addr()         Translates dotted decimal notation to a 32-bit internet 
  1151.                     address (network-byte order). 
  1152.  
  1153. inet_network()      Translates dotted decimal notation to a network number 
  1154.                     (host-byte order), and zeros in the host part. 
  1155.  
  1156. inet_ntoa()         Translates 32-bit internet address (network-byte order) to 
  1157.                     dotted decimal notation. 
  1158.  
  1159. inet_netof()        Extracts network number (host-byte order) from 32-bit 
  1160.                     internet address (network-byte order). 
  1161.  
  1162. inet_lnaof()        Extracts local network address (host-byte order) from 
  1163.                     32-bit internet address (network-byte order). 
  1164.  
  1165. inet_makeaddr()     Constructs internet address (network-byte order) from 
  1166.                     network number and local network address. 
  1167.  
  1168.  
  1169. ΓòÉΓòÉΓòÉ 5.2. Porting a Socket API Application ΓòÉΓòÉΓòÉ
  1170.  
  1171. The IBM OS/2 socket implementation differs from the Berkeley socket 
  1172. implementation as follows: 
  1173.  
  1174. o Sockets are not OS/2 files or devices. Socket numbers have no relationship to 
  1175.   OS/2 file handles. Therefore, read(), write(), and close() do not work for 
  1176.   sockets. Using read(), write(), or close() gives incorrect results. Use the 
  1177.   recv(), send(), and soclose() functions instead. 
  1178.  
  1179. o Some socket calls require that you call the sock_init() routine before you 
  1180.   call them. Therefore, always call sock_init() at the beginning of programs 
  1181.   using the socket interface. 
  1182.  
  1183. o Error codes set by the MPTS sockets implementation are not made available 
  1184.   through the global errno variable. Instead, error codes are accessed by using 
  1185.   the sock_errno() API described on page sock_errno(). Use psock_errno(), 
  1186.   instead of perror(), to write a short error message to the standard error 
  1187.   device describing the last error encountered during a call to a socket 
  1188.   library function.  It is not possible for an application to assign new values 
  1189.   to error codes. 
  1190.  
  1191.   This is intended to obtain per-thread error codes in a multithreaded 
  1192.   application environment and to avoid conflict with standard IBM C Set/2 V1.0 
  1193.   error constants. 
  1194.  
  1195.   For compatibility with BSD, an application can choose to define: 
  1196.  
  1197.     #define errno sock_errno()
  1198.     #define perror psock_errno()
  1199.   If a source file includes code that checks errno for both OS/2 socket and 
  1200.   OS/2 nonsocket functions, this mechanism cannot be used. 
  1201.  
  1202.   BSD-style error checking is as follows: 
  1203.  
  1204.     rt = recv(s, buf, sizeof(buf), 0);
  1205.     if (rt == -1 && errno == EWOULDBLOCK)
  1206.        {...}
  1207.  
  1208.     if (recv(s, buf, sizeof(buf), 0) < 0)
  1209.     {
  1210.         perror("Recv()");
  1211.         exit(1);
  1212.     }
  1213.  
  1214.   The preferred OS/2-style error checking is as follows: 
  1215.  
  1216.     rt = recv(s, buf, sizeof(buf), 0);
  1217.     if (rt == -1 && sock_errno() == SOCEWOULDBLOCK)
  1218.        {...}
  1219.  
  1220.     if (recv(s, buf, sizeof(buf), 0) < 0)
  1221.     {
  1222.         psock_errno("Recv()");
  1223.         exit(1);
  1224.     }
  1225.  
  1226.   Error constants consistent with BSD sockets are provided for compatibility 
  1227.   purposes; your application can use the error constant EWOULDBLOCK, instead of 
  1228.   SOCEWOULDBLOCK. Refer to System Return Codes, or the <NERRNO.H> file for 
  1229.   definitions of error constants. 
  1230.  
  1231. o The select() call has a different interface. Unlike the Berkeley select() 
  1232.   call, you cannot use the OS/2 select() call to wait for activity on devices 
  1233.   other than sockets. See select() for more information. 
  1234.  
  1235. o ioctl() implementation might differ from the current Berkeley ioctl() 
  1236.   implementation. For example, IBM has added a lendata parameter, which the 
  1237.   current Berkeley ioctl() implementation does not support. Other functions of 
  1238.   the IBM ioctl() call might also differ from the current Berkeley ioctl() 
  1239.   implementation. In addition, the getsockopt() and setsockopt() might provide 
  1240.   different support. See ioctl(), getsockopt(), and setsockopt() for more 
  1241.   information. 
  1242.  
  1243. You must define the variable OS2 by doing one of the following: 
  1244.  
  1245. o Place #define OS2 at the top of each file that includes MPTS header files. 
  1246.  
  1247. o Use the /DOS2 option when compiling the source for your application. 
  1248.  
  1249. For a summary of each socket call supported by MPTS, see Socket Quick 
  1250. Reference. 
  1251.  
  1252.  
  1253. ΓòÉΓòÉΓòÉ 5.3. C Socket Calls ΓòÉΓòÉΓòÉ
  1254.  
  1255. This section provides the syntax, parameters, and other appropriate information 
  1256. for each C socket call supported by MPTS. 
  1257.  
  1258. If you are uing TCP/IP protocol or non-native INET over NetBIOS, you can make 
  1259. all these socket calls. However, if you are using sockets to access the NetBIOS 
  1260. protocol natively, then you can only use the calls that are in the 
  1261. protocol-independent set. 
  1262.  
  1263. The following is a list of the protocol-independent socket calls that can be 
  1264. used to access services for all protocols: 
  1265.  
  1266. accept() 
  1267. bind() 
  1268. connect() 
  1269. getpeername() 
  1270. getsockname() 
  1271. getsockopt() 
  1272. ioctl() 
  1273. listen() 
  1274. psock_errno() 
  1275. readv() 
  1276. recv() 
  1277. recvfrom() 
  1278. recvmsg() 
  1279. select() 
  1280. send() 
  1281. sendmsg() 
  1282. sendto() 
  1283. setsockopt() 
  1284. shutdown() 
  1285. sock_errno () 
  1286. sock_init() 
  1287. socket() 
  1288. soclose() 
  1289. writev() 
  1290.  
  1291. The following is a list of the protocol-dependent socket calls that can be used 
  1292. to access services related to the TCP/IP protocol: 
  1293.  
  1294. bswap() 
  1295. dn_comp() 
  1296. dn_expand() 
  1297. endhostent() 
  1298. endnetent() 
  1299. endprotoent() 
  1300. endservent() 
  1301. gethostbyaddr() 
  1302. gethostbyname() 
  1303. gethostent() 
  1304. gethostid() 
  1305. gethostname() 
  1306. getnetbyaddr() 
  1307. getnetbyname() 
  1308. getnetent() 
  1309. getprotobyname() 
  1310. getprotobynumber() 
  1311. getprotoent() 
  1312. getservbyname() 
  1313. getservbyport() 
  1314. getservent() 
  1315. htonl() 
  1316. htons() 
  1317. inet_addr() 
  1318. inet_inaof() 
  1319. inet_makeaddr() 
  1320. inet_netof() 
  1321. inet_network() 
  1322. inet_ntoa() 
  1323. lswap() 
  1324. ntohl() 
  1325. ntohs() 
  1326. res_init() 
  1327. res_mkquery() 
  1328. res_send() 
  1329. sethostent() 
  1330. setnotent() 
  1331. setprotoent() 
  1332. setservent() 
  1333.  
  1334.  
  1335. ΓòÉΓòÉΓòÉ 5.4. Protocol-Independent Socket Calls ΓòÉΓòÉΓòÉ
  1336.  
  1337. The protocol-independent socket calls that can be used to access services for 
  1338. all protocols are described in the following text. 
  1339.  
  1340.  
  1341. ΓòÉΓòÉΓòÉ 5.4.1. accept() ΓòÉΓòÉΓòÉ
  1342.  
  1343.  
  1344.    # include< types . h >
  1345.    #include <sys\socket.h>
  1346.    #include <netinet\in.h>
  1347.    #include <netnb\nb.h>
  1348.    #include <sys\un.h>
  1349.  
  1350.    int accept(s, name, namelen)
  1351.    int s;
  1352.    union {
  1353.     short  sa_family;
  1354.     struct sockaddr_un *name1;
  1355.     struct sockaddr_nb *name2;
  1356.     struct sockaddr_in *name3;
  1357.    } name;
  1358.    int *namelen;
  1359.  
  1360. Parameter      Description 
  1361.  
  1362. s              The socket descriptor 
  1363.  
  1364. name           The socket address of the connecting client that is filled by 
  1365.                accept() before it returns. The format of name is determined by 
  1366.                the domain where the client resides. This parameter can be NULL 
  1367.                if the caller is not interested in the client address. 
  1368.  
  1369. namelen        Must initially point to an integer that contains the size in 
  1370.                bytes of the storage pointed to by name.  On return, that 
  1371.                integer contains the size of the data returned in the storage 
  1372.                pointed to by name. If name is NULL, namelen is ignored and can 
  1373.                be NULL. 
  1374.  
  1375. Description:  The accept() call is used by a server to accept a connection 
  1376. request from a client.  The call accepts the first connection on its queue of 
  1377. pending connections. The accept() call creates a new socket descriptor with the 
  1378. same properties as s and returns it to the caller. If the queue has no pending 
  1379. connection requests, accept() blocks the caller unless s is in nonblocking 
  1380. mode.  If no connection requests are queued and s is in nonblocking mode, 
  1381. accept() returns -1 and sets the return code to SOCEWOULDBLOCK. The new socket 
  1382. descriptor cannot be used to accept new connections. The original socket, s, 
  1383. remains available to accept more connection requests. 
  1384.  
  1385. Use the select() call to accept multiple incoming connections on different 
  1386. sockets.  For more information, refer to select(). 
  1387.  
  1388. The s parameter must be a stream socket descriptor created with the socket() 
  1389. call.  It is usually bound to an address with the bind() call and is made 
  1390. capable of accepting connections with the listen() call.  The listen() call 
  1391. marks the socket as one that accepts connections and allocates a queue to hold 
  1392. pending connection requests. The listen() call allows the caller to place an 
  1393. upper boundary on the size of the queue. 
  1394.  
  1395. The name parameter is a pointer to a buffer where the connection requester 
  1396. address is placed. The name parameter is optional and can be set to be the NULL 
  1397. pointer.  If set to NULL, the requester address is not copied into the buffer. 
  1398. The exact format of name depends on the addressing domain where the 
  1399. communication request originated. For example, if the connection request 
  1400. originated in the AF_INET domain, name points to a sockaddr_in structure as 
  1401. defined in the header file <NETINET\IN.H>. The namelen parameter is used only 
  1402. if name is not NULL. Before calling accept(), you must set the integer pointed 
  1403. to by namelen to the size, in bytes, of the buffer pointed to by name. On 
  1404. successful return, the integer pointed to by namelen contains the actual number 
  1405. of bytes copied into the buffer. If the buffer is not large enough to hold the 
  1406. address, up to namelen bytes of the requester address are copied. 
  1407.  
  1408. This call is used only with SOCK_STREAM or SOCK_SEQPACKET sockets. You cannot 
  1409. screen requesters without calling accept().  The application cannot tell the 
  1410. system the requesters it will accept connections from.  The caller can, 
  1411. however, choose to close a connection immediately after discovering the 
  1412. identity of the requester. 
  1413.  
  1414. Non-Native Networking:  See "Non-Native Networking" for MPTN connectivities 
  1415. provided.  The accept() call in MPTN environment can accept an inbound 
  1416. connection request from any of the locally connected native or nonnative 
  1417. networks. 
  1418.  
  1419. Return Value and Errno Value:  A non-negative socket descriptor indicates 
  1420. success; the value -1 indicates an error. Specific error values are obtained by 
  1421. calling sock_errno() or psock_(). tsize=15. 
  1422.  
  1423.    Errno Value            Description 
  1424.  
  1425.    SOCENOTSOCK            The s parameter is not a valid socket descriptor. 
  1426.  
  1427.    SOCEFAULT              Using name and namelen would result in an attempt to 
  1428.                           copy the address into a portion of the caller address 
  1429.                           space into which information cannot be written. 
  1430.  
  1431.    SOCEINVAL              Listen() was not called for socket s. 
  1432.  
  1433.    SOCENOBUFS             Insufficient buffer space available to create the new 
  1434.                           socket. 
  1435.  
  1436.    SOCEOPNOTSUPP          The s parameter is not of type SOCK_STREAM. 
  1437.  
  1438.    SOCEWOULDBLOCK         The s parameter is in nonblocking mode and no 
  1439.                           connections are on the queue. 
  1440.  
  1441.    SOCECONNABORTED        The software caused a connection abort. 
  1442.  
  1443. Examples:  The following are two examples of the accept() call.  In the first, 
  1444. the caller wants to have the requester address returned. In the second, the 
  1445. caller does not want to have the requester address returned. 
  1446.  
  1447. int clientsocket;
  1448. int s;
  1449. struct sockaddr clientaddress;
  1450. int addrlen;
  1451. int accept(int s, struct sockaddr *addr, int *addrlen);
  1452. /* socket(), bind(), and listen() have been called */
  1453. /* EXAMPLE 1: I want the address now */
  1454.  
  1455. addrlen = sizeof(clientaddress);
  1456. clientsocket = accept(s, &clientaddress, &addrlen);
  1457. /* EXAMPLE 2: I can get the address later using getpeername() */
  1458. addrlen = 0;
  1459. clientsocket = accept(s, (struct sockaddr *) 0, (int *) 0);
  1460.  
  1461. See Also:  bind(), connect(), getpeername(), listen(), and socket(). 
  1462.  
  1463.  
  1464. ΓòÉΓòÉΓòÉ 5.4.2. bind() ΓòÉΓòÉΓòÉ
  1465.  
  1466. #include <types.h>
  1467. #include <sys\socket.h>
  1468.  
  1469. int bind(s, name, namelen)
  1470. int s;
  1471. struct sockaddr *name;
  1472. int namelen;
  1473.  
  1474. Parameter      Description 
  1475.  
  1476. s              The socket descriptor returned by a previous socket() call 
  1477.  
  1478. name           Points to a sockaddr structure containing the name that is to be 
  1479.                bound to s 
  1480.  
  1481. namelen        The size of name in bytes 
  1482.  
  1483. Description:  The bind() call binds a unique local name to the socket with 
  1484. descriptor s. After calling socket(), a descriptor does not have a name 
  1485. associated with it.  However, it does belong to a particular addressing family 
  1486. as specified when socket() is called. The exact format of a name depends on the 
  1487. addressing family. 
  1488.  
  1489. The s parameter is a socket descriptor of any type created by calling socket(). 
  1490.  
  1491. The name parameter is a pointer to a buffer containing the name to be bound to 
  1492. s.  The namelen parameter is the size, in bytes, of the buffer pointed to by 
  1493. name. 
  1494.  
  1495. The format of name is determined by the domain where communication occurs. 
  1496. This parameter can be NULL if the caller is not interested in its own address. 
  1497. In local socket, the domain is AF_OS2 (or AF_UN) and the address structure is 
  1498. defined in <sys\un.h>.  If the address is NULL, the bind call binds to a unique 
  1499. local address to the socket descriptor s.  Each name is a combination of 
  1500. address family (AF_UNIX in local socket) and a character string no longer than 
  1501. 108 characters. The file/path name character string should be prefixed with the 
  1502. string \SOCKET\.... followed by any character string terminated by the ASCII 0. 
  1503. Each socket must use a unique character string as its local name. 
  1504.  
  1505.  
  1506.              struct      sockaddr_un {
  1507.                  short   sun_family;             /* AF_OS2 (AF_UNIX) */
  1508.                  char    sun_path╨¥108Γöÿ;         /* path name */
  1509.              }
  1510.  
  1511. For the NetBIOS domain (AF_NETBIOS), the address structure is defined in 
  1512. <netnb\nb.h>.  The address type field is used to specify the name as either a 
  1513. unique (NB_UNIQUE) or a group (NB_GROUP) name. The leftmost character in the 
  1514. netid field is used to select the LAN adapter number.  It can be a binary 
  1515. number or an ASCII digit, thus 0X01 and '1' bit are resolved to adapter 1.  For 
  1516. convenience, an ASCII space is also accepted as 0.  The name field contains the 
  1517. 16-byte NetBIOS name, and is used as is. 
  1518.  
  1519.              struct      sockaddr_nb {
  1520.                  short   snb_family;             /* AF_NETBIOS */
  1521.                  short   snb_type;               /* address type*/
  1522.                  char    snb_netid╨¥8Γöÿ;           /* netid */
  1523.                  char    snb_name╨¥16Γöÿ;           /* name */
  1524.              }
  1525.  
  1526. If a connect() socket call is received without an explicit bind(), an implicit 
  1527. bind is automatically performed.  In this case, the application does not care 
  1528. about its own name and is asking the system to select one for it.  A NetBIOS 
  1529. name is generated for this socket by converting the 6-byte MAC address to an 
  1530. ASCII hex string, prepended with NB, and postpended with a 2-byte number that 
  1531. increments after each use. 
  1532.  
  1533. Note that for the NetBIOS domain AF_NETBIOS (and protocols that support 
  1534. parallel connection such as SNA or OSI), more than one socket can be bound to 
  1535. the same local name/address to establish multiple connections to one or more 
  1536. remote destinations. To enable this feature, the socket option SO_REUSEADDR 
  1537. must be set.  See setsockopt(). 
  1538.  
  1539. For the INET domain (AF_INET), the address structure is defined in 
  1540. <netinet\in.h>.  The sin_port field is set to the port the application must 
  1541. bind to.  It must be specified in network-byte order.  If the sin_port is set 
  1542. to 0, the caller leaves it to the system to assign an available port.  The 
  1543. application can call getsockname() to discover the port number assigned.  The 
  1544. sin_addr field is set to the internet address and must be specified in 
  1545. network-byte order.  On hosts with more than one network interface (called 
  1546. multihomed hosts), a caller can select the interface it is to bind to. 
  1547. Subsequently, only UDP packets and TCP connection requests from this interface 
  1548. that match the bound name are routed to the application.  If this field is set 
  1549. to the constant INADDR_ANY, as defined in <netinet\in.h>, the caller is 
  1550. requesting that the socket be bound to all network interfaces on the host. 
  1551.  
  1552. Subsequently, UDP packets and TCP connections from all interfaces that match 
  1553. the bound name are routed to the application.  This becomes important when a 
  1554. server offers a service to multiple networks.  By leaving the address 
  1555. unspecified, the server can accept all UDP packets and TCP connection requests 
  1556. made for its port, regardless of the network interface where the requests 
  1557. arrived.  The sin_zero field is not used and must be set to all zeros as shown 
  1558. in the following example. 
  1559.  
  1560.              struct      sockaddr_in {
  1561.                  short   sin_family;            /* AF_INET */
  1562.                  u_short sin_port;              /* port id */
  1563.                  struct  in_addr sin_addr;      /* address */
  1564.                  char    sin_zero╨¥8Γöÿ
  1565.              }
  1566.  
  1567. For DIRECT mode user (AF_DIRECT), the address family for the local name can be 
  1568. any of the network address types except AF_OS2 (local). 
  1569.  
  1570. Non-Native Networking:  See "Non-Native Networking" for MPTN connectivities 
  1571. provided. 
  1572.  
  1573. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  1574. indicates an error. Specific error values are obtained by calling sock_errno() 
  1575. or psock_(). 
  1576.  
  1577.    Errno Value             Description 
  1578.  
  1579.    SOCEADDRINUSE           The address is already in use. 
  1580.  
  1581.    SOCEADDRNOTAVAIL        The address specified is not valid on this host. 
  1582.                            For example, if the internet address does not 
  1583.                            specify a valid network interface or if the LIPC 
  1584.                            prefix \Socket\ is missing. 
  1585.  
  1586.    SOCEAFNOSUPPORT         The address family is not supported. 
  1587.  
  1588.    SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  1589.  
  1590.    SOCEFAULT               Using name and namelen would result in an attempt to 
  1591.                            copy the address into a non-writable portion of the 
  1592.                            caller's address space. 
  1593.  
  1594.    SOCEINVAL               The socket is already bound to an address.  For 
  1595.                            example, trying to bind a name to a socket that is 
  1596.                            in the connected state.  This value is also returned 
  1597.                            if namelen is not the expected length. 
  1598.  
  1599.    SOCENOBUFS              No buffer space is available. 
  1600.  
  1601. Examples:  The following are examples of the bind() call.  Several things 
  1602. should be noted about the examples.  The internet address and port must be in 
  1603. network-byte order. To put the port into network-byte order, a utility routine, 
  1604. htons(), is called to convert a short integer from host-byte order to 
  1605. network-byte order.  The address field is set using another utility routine, 
  1606. inet_addr(), which takes a character string representing the dotted decimal 
  1607. address of an interface and returns the binary internet address representation 
  1608. in network-byte order.  Finally, note that it is a good idea to zero the 
  1609. structure before using it to ensure that the name requested does not set any 
  1610. reserved fields.  See connect() for examples of how a client might connect to 
  1611. servers. 
  1612.  
  1613. int rc;
  1614. int s;
  1615. struct sockaddr_in myname;
  1616. int bind(int s, struct sockaddr *name, int namelen);
  1617. /* Bind to a specific interface in the internet domain */
  1618.  
  1619. /* make sure the sin_zero field is cleared */
  1620. memset(&myname, 0, sizeof(myname));
  1621. myname.sin_family = AF_INET;
  1622. myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  1623. myname.sin_port = htons(1024);
  1624. .
  1625. .
  1626. .
  1627. rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  1628.  
  1629. /* Bind to all network interfaces in the internet domain */
  1630. /* make sure the sin_zero field is cleared */
  1631. memset(&myname, 0, sizeof(myname));
  1632. myname.sin_family = AF_INET;
  1633. myname.sin_addr.s_addr = INADDR_ANY; /* all interfaces */
  1634. myname.sin_port = htons(1024);
  1635. .
  1636. .
  1637. .
  1638. rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  1639.  
  1640. /* Bind to a specific interface in the internet domain.
  1641.    Let the system choose a port                        */
  1642. /* make sure the sin_zero field is cleared */
  1643. memset(&myname, 0, sizeof(myname));
  1644. myname.sin_family = AF_INET;
  1645. myname.sin_addr = inet_addr("129.5.24.1"); /* specific interface */
  1646. myname.sin_port = 0;
  1647. .
  1648. .
  1649. .
  1650. rc = bind(s, (struct sockaddr *) &myname, sizeof(myname));
  1651.  
  1652. The binding of a stream socket is not complete until a successful call to 
  1653. bind(), listen(), or connect() is made. Applications using stream sockets 
  1654. should check the return values of bind(), listen(), and connect() before using 
  1655. any function that requires a bound stream socket. 
  1656.  
  1657. See Also:  connect(), gethostbyname(), getsockname(), htons(), inet_addr(), 
  1658. listen(), and socket(). 
  1659.  
  1660.  
  1661. ΓòÉΓòÉΓòÉ 5.4.3. connect() ΓòÉΓòÉΓòÉ
  1662.  
  1663. #include <types.h>
  1664. #include <sys\socket.h>
  1665.  
  1666. int connect(s, name, namelen)
  1667. int s;
  1668. struct sockaddr *name;
  1669. int namelen;
  1670.  
  1671. Parameter      Description 
  1672.  
  1673. s              The socket descriptor 
  1674.  
  1675. name           The pointer to a socket address structure containing the address 
  1676.                of the socket to which a connection will be attempted 
  1677.  
  1678. namelen        The size of the socket address pointed to by name in bytes 
  1679.  
  1680. Description:  For stream or sequenced_packet sockets, the connect() call 
  1681. attempts to establish a connection between two sockets. For datagram sockets, 
  1682. the connect() call specifies the peer for a socket.  The s parameter is the 
  1683. socket used to originate the connection request.  The connect() socket call 
  1684. performs two tasks when called for a stream or sequenced_packet socket:  1) it 
  1685. completes the binding necessary for a socket, and 2) it attempts to create a 
  1686. connection with a foreign socket. 
  1687.  
  1688. The connect() call for a stream socket or a sequenced_packet socket is used by 
  1689. the client side of socket-based applications to establish a connection with a 
  1690. server.  The server must have a passive open pending. If the server is using 
  1691. sockets, this means the server must successfully call bind() and listen() 
  1692. before a connection can be accepted by the server with accept().  Otherwise, 
  1693. the connection returns -1 and the error value is set to SOECONNREFUSED. 
  1694.  
  1695. If s is in blocking mode, the connect() call blocks the caller until connection 
  1696. is set up or until an error is received.  If the socket is in nonblocking mode, 
  1697. connect() returns -1 and sets the error value to SOCEINPROGRESS if the 
  1698. connection can be initiated (no other errors occurred).  The caller can test 
  1699. the completion of the connection setup by calling select() and testing for the 
  1700. ability to write to the socket. 
  1701.  
  1702. When called for a datagram or raw socket, connect() specifies the peer with 
  1703. which this socket is associated.  This gives the application the ability to use 
  1704. data transfer calls reserved for sockets that are in the connected state.  In 
  1705. this case, readv(), writev(), send(), recv() are then available in addition to 
  1706. sendto(), recvfrom(), sendmsg(), and recvmsg(). Stream or sequenced_packet 
  1707. sockets can call connect() only once, but datagram sockets can call connect() 
  1708. multiple times to change their association.  Datagram sockets can dissolve 
  1709. their association by connecting to an invalid address such as the null address 
  1710. (all fields zeroed). 
  1711.  
  1712. The name parameter is a pointer to a buffer containing the name of the peer to 
  1713. which the application needs to connect.  The namelen parameter is the size, in 
  1714. bytes, of the buffer pointed to by name. 
  1715.  
  1716. See bind() for the format of the name field. 
  1717.  
  1718. Non-Native Networking:  See "Non-Native Networking" for MPTN connectivities 
  1719. provided. The connect() call attempts to locate the remote destination using 
  1720. any of the locally connected native and non-native networks. The search order 
  1721. is based on the configuration setup and a cache with information of the remote 
  1722. destinations saved from previous locate calls. 
  1723.  
  1724. For other address format, see the description of bind(). 
  1725.  
  1726. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  1727. indicates an error. Specific error values are obtained by calling sock_errno() 
  1728. or psock_(). 
  1729.  
  1730.    Errno Value             Description 
  1731.  
  1732.    SOCEADDRNOTAVAIL        The calling host cannot reach the specified 
  1733.                            destination. 
  1734.  
  1735.    SOCEAFNOSUPPORT         The address family is not supported. 
  1736.  
  1737.    SOCEALREADY             The socket s is marked nonblocking, and a previous 
  1738.                            connection attempt has not completed. 
  1739.  
  1740.    SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  1741.  
  1742.    SOCECONNREFUSED         The connection request was rejected by the 
  1743.                            destination host. 
  1744.  
  1745.    SOCEFAULT               Using name and namelen would result in an attempt to 
  1746.                            copy the address into a portion of the caller's 
  1747.                            address space to which data cannot be written. 
  1748.  
  1749.    SOCEINPROGRESS          The socket s is marked nonblocking, and the 
  1750.                            connection cannot be completed immediately. The 
  1751.                            EINPROGRESS value does not indicate an error 
  1752.                            condition. 
  1753.  
  1754.    SOCEINVAL               The namelen parameter is not a valid length. 
  1755.  
  1756.    SOCEISCONN              The socket s is already connected. 
  1757.  
  1758.    SOCENETUNREACH          The network cannot be reached from this host. 
  1759.  
  1760.    SOCETIMEDOUT            The connection establishment timed out before a 
  1761.                            connection was made. 
  1762.  
  1763.    SOCENOBUFS              No buffer space is available. 
  1764.  
  1765.    SOCEOPNOTSUPP           The operation is not supported on socket. 
  1766.  
  1767.  
  1768. ΓòÉΓòÉΓòÉ 5.4.4. getpeername() ΓòÉΓòÉΓòÉ
  1769.  
  1770. #include <types.h>
  1771. #include <sys\socket.h>
  1772.  
  1773. int getpeername(s, name, namelen)
  1774. int s;
  1775. struct sockaddr *name;
  1776. int *namelen;
  1777.  
  1778. Parameter      Description 
  1779.  
  1780. s              The socket descriptor. 
  1781.  
  1782. name           The internet address of the connected socket that is filled by 
  1783.                getpeername() before it returns.  The exact format of name is 
  1784.                determined by the domain where communication occurs. 
  1785.  
  1786. namelen        The size of the address structure pointed to by name in bytes. 
  1787. Description:  The getpeername() call returns the name of the peer connected to 
  1788. socket s. The namelen parameter must be initialized to indicate the size of the 
  1789. space pointed to by name and is set to the number of bytes copied into the 
  1790. space before the call returns.  The size of the peer name is returned in bytes. 
  1791. If the buffer of the local host is too small, the peer name is truncated. 
  1792.  
  1793. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  1794. indicates an error. Specific error values are obtained by calling sock_errno() 
  1795. or psock_(). 
  1796.  
  1797.    Errno Value         Description 
  1798.  
  1799.    SOCENOTSOCK         The s parameter is not a valid socket descriptor. 
  1800.  
  1801.    SOCEFAULT           Using the name and namelen parameters as specified would 
  1802.                        result in an attempt to access storage outside of the 
  1803.                        address space of the caller. 
  1804.  
  1805.    SOCENOTCONN         The socket is not in the connected state. 
  1806.  
  1807.    SOCENOBUFS          No buffer space is available. 
  1808.  
  1809. See Also:  accept(), connect(), getsockname(), and socket(). 
  1810.  
  1811.  
  1812. ΓòÉΓòÉΓòÉ 5.4.5. getsockname() ΓòÉΓòÉΓòÉ
  1813.  
  1814. #include <types.h>
  1815. #include <sys\socket.h>
  1816.  
  1817. int getsockname(s, name, namelen)
  1818. int s;
  1819. struct sockaddr *name;
  1820. int *namelen;
  1821.  
  1822. Parameter      Description 
  1823.  
  1824. s              The socket descriptor. 
  1825.  
  1826. name           The address of the buffer getsockname() copies the name of s 
  1827.                into. 
  1828.  
  1829. namelen        Must initially point to an integer that contains the size in 
  1830.                bytes of the storage pointed to by name.  Upon return, that 
  1831.                integer contains the size of the data returned in the storage 
  1832.                pointed to by name. 
  1833. Description:  The getsockname() call stores the current name for the socket 
  1834. specified by the s parameter into the structure pointed to by the name 
  1835. parameter.  It returns the address to the socket that has been bound.  If the 
  1836. socket is not bound to an address, the call returns with the family set and the 
  1837. rest of the structure is set to zero. For example, an inbound socket in the 
  1838. internet domain would cause the name to point to a sockaddr_in structure with 
  1839. the sin_family field set to AF_INET and all other fields zeroed. 
  1840.  
  1841. Stream or sequenced_packet sockets are not assigned a name, until after a 
  1842. successful call to either bind(), connect(), or accept(). 
  1843.  
  1844. The getsockname() call is often used to discover the port assigned to a socket 
  1845. after the socket has been implicitly bound to a port.  For example, an 
  1846. application can call connect() without previously calling bind(). In this case, 
  1847. the connect() call completes the binding necessary by assigning a port to the 
  1848. socket.  This assignment can be discovered with a call to getsockname(). 
  1849.  
  1850. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  1851. indicates an error. The value of errno indicates the specific error. 
  1852.  
  1853.    Errno Value       Description 
  1854.  
  1855.    SOCENOTSOCK       The s parameter is not a valid socket descriptor. 
  1856.  
  1857.    SOCEFAULT         Using the name and namelen parameters as specified would 
  1858.                      result in an attempt to access storage outside of the 
  1859.                      address space of the caller. 
  1860.  
  1861.    SOCENOBUFS        No buffer space available. 
  1862.  
  1863. See Also:  accept(), bind(), connect(), getpeername(), and socket(). 
  1864.  
  1865.  
  1866. ΓòÉΓòÉΓòÉ 5.4.6. getsockopt() ΓòÉΓòÉΓòÉ
  1867.  
  1868. #include <types.h>
  1869. #include <sys\socket.h>
  1870.  
  1871. int getsockopt(s, level, optname, optval, optlen)
  1872. int s;
  1873. int level;
  1874. int optname;
  1875. char *optval;
  1876. int *optlen;
  1877.  
  1878. Parameter      Description 
  1879.  
  1880. s              The socket descriptor. 
  1881.  
  1882. level          The level the option is set for. Only SOL_SOCKET is supported. 
  1883.  
  1884. optname        The name of a specified socket option. 
  1885.  
  1886. optval         Points to option data. 
  1887.  
  1888. optlen         Points to the length of the option data. 
  1889.  
  1890. Description:  The getsockopt() call returns the values of socket options at 
  1891. various protocol levels. It can be called for sockets of all AF domain types. 
  1892. Some options are supported only for specific address families and/or network 
  1893. protocols installed with TCP/IP. 
  1894.  
  1895. When manipulating socket options, you must specify the level where the option 
  1896. resides and the name of the option.  To manipulate options at the socket level, 
  1897. the level parameter must be set to SOL_SOCKET, as defined in <sys\socket.h>. To 
  1898. manipulate protocol-specific options at any other level, such as the TCP 
  1899. (IPROTO_TCP) or IP(IPROTO_IP) supply the appropriate protocol number for the 
  1900. installed protocol controlling the option.  For example, The getprotobyname() 
  1901. call from the TCP/IP product can be used to return the protocol number for a 
  1902. named protocol in TCP/IP. Currently, only the SOL_SOCKET level is supported. 
  1903.  
  1904. The optval and optlen parameters are used to return data used by the particular 
  1905. get command. The optval parameter points to a buffer that is to receive the 
  1906. data requested by the get command. The optlen parameter points to the size of 
  1907. the buffer pointed to by the optval parameter.  The optlen parameter must be 
  1908. initially set to the size of the buffer before calling getsockopt().  On 
  1909. return, the optlen parameter is set to the actual size of the data returned. 
  1910.  
  1911. All of the socket level options except SO_LINGER, SO_SNDBUF, and SO_RCVBUF 
  1912. expect optval to point to an integer and optlen to be set to the size of an 
  1913. integer. When the integer is nonzero, the option is enabled. When it is zero, 
  1914. the option is disabled. The SO_LINGER option expects optval to point to a 
  1915. linger structure, as defined in <SYS\SOCKET.H>. The SO_SNDBUF and SO_RCVBUF 
  1916. options expect optval to point to a long. This structure is defined in the 
  1917. following example: 
  1918.  
  1919. struct  linger
  1920. {
  1921.        int     l_onoff;                /* option on/off */
  1922.        int     l_linger;               /* linger time *  /
  1923. };
  1924.  
  1925. The l_onoff field is set to zero if the SO_LINGER option is being disabled.  A 
  1926. nonzero value enables the option. The l_linger field specifies the amount of 
  1927. time to linger on close. 
  1928.  
  1929. The following options are recognized at the socket level: 
  1930.  
  1931. Option                Description 
  1932.  
  1933. SO_BROADCAST          Toggles the ability to broadcast messages. If this option 
  1934.                       is enabled, it allows the application to send broadcast 
  1935.                       messages over s, if the interface specified in the 
  1936.                       destination supports broadcasting of packets. This option 
  1937.                       has no meaning for stream or sequenced_packet sockets. 
  1938.  
  1939. SO_DEBUG              Toggles recording of debugging information. 
  1940.  
  1941. SO_DONTROUTE          Toggles the routing bypass for outgoing messages. When 
  1942.                       this option is enabled, it causes outgoing messages to 
  1943.                       bypass the standard routing algorithm and be directed to 
  1944.                       the appropriate network interface, according to the 
  1945.                       network portion of the destination address. When enabled, 
  1946.                       packets can be sent only to directly connected networks 
  1947.                       (networks this host has an interface for).  This option 
  1948.                       has no meaning for stream sockets. 
  1949.  
  1950. SO_ERROR              Returns any pending error on the socket and clears the 
  1951.                       error status.  It can be used to check for asynchronous 
  1952.                       errors on connected datagram sockets or for other 
  1953.                       asynchronous errors (errors that are not returned 
  1954.                       explicitly by one of the socket calls). 
  1955.  
  1956. SO_KEEPALIVE          Toggles keep connection alive.  TCP uses a timer called 
  1957.                       the keepalive timer.  This timer is used to monitor idle 
  1958.                       connections that might have been disconnected because of 
  1959.                       a peer crash or timeout. If this option is toggled, a 
  1960.                       keepalive packet is periodically sent to the peer.  This 
  1961.                       is used mainly to allow servers to close connections that 
  1962.                       have already disappeared as a result of clients going 
  1963.                       away without closing connections. This option has meaning 
  1964.                       only for stream sockets. 
  1965.  
  1966. SO_LINGER             Lingers on close if data is present.  When this option is 
  1967.                       enabled and there is unsent data present when soclose() 
  1968.                       is called, the calling application is blocked during the 
  1969.                       soclose() call until the data is transmitted or the 
  1970.                       connection has timed out. If this option is disabled, 
  1971.                       INET waits to try to send the data. Although the data 
  1972.                       transfer is usually successful, it cannot be guaranteed, 
  1973.                       because INET waits only a finite amount of time trying to 
  1974.                       send the data. The soclose() call returns without 
  1975.                       blocking the caller. This option has meaning only for 
  1976.                       stream or sequenced_packet sockets. 
  1977.  
  1978. SO_OOBINLINE          Toggles reception of out-of-band data. When this option 
  1979.                       is enabled, it causes out-of-band data to be placed in 
  1980.                       the normal data input queue as it is received, making it 
  1981.                       available to recv(), and recvfrom() without having to 
  1982.                       specify the MSG_OOB flag in those calls.  When this 
  1983.                       option is disabled, it causes out-of-band data to be 
  1984.                       placed in the priority data input queue as it is 
  1985.                       received, making it available to recv(), and recvfrom(), 
  1986.                       only by specifying the MSG_OOB flag in those calls. This 
  1987.                       option has meaning only for stream sockets. 
  1988.  
  1989. SO_RCVBUF             Sets buffer size for input.  This option sets the size of 
  1990.                       the receive buffer to the value contained in the buffer 
  1991.                       pointed to by optval. This allows the buffer size to be 
  1992.                       tailored for specific application needs, such as 
  1993.                       increasing the buffer size for high-volume connections. 
  1994.  
  1995. SO_RCVLOWAT           Retrieves receive low-water mark information. 
  1996.  
  1997. SO_RCVTIMEO           Retrieves receive timeout information. 
  1998.  
  1999. SO_REUSEADDR          Toggles local address reuse.  When enabled, this option 
  2000.                       allows local addresses that are already in use to be 
  2001.                       bound. This alters the normal algorithm used in the 
  2002.                       bind() call. The system checks at connect time to be sure 
  2003.                       that no local address and port have the same foreign 
  2004.                       address and port. The error EADDRINUSE is returned if the 
  2005.                       association already exists. 
  2006.  
  2007. SO_SNDBUF             Sets buffer size for output.  This option sets the size 
  2008.                       of the send buffer to the value contained in the buffer 
  2009.                       pointed to by optval.  This allows the send buffer size 
  2010.                       to be tailored for specific application needs such as 
  2011.                       increasing the buffer size for high-volume connections. 
  2012.  
  2013. SO_SNDLOWAT           Retrieves send low-water mark information. 
  2014.  
  2015. SO_SNDTIMEO           Retrieves send timeout information. 
  2016.  
  2017. SO_TYPE               Returns the type of the socket.  On return, the integer 
  2018.                       pointed to by optval is set to one of the following: 
  2019.                       SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM, or SOCK_RAW. 
  2020.  
  2021. SO_USELOOPBACK        Bypasses hardware when possible. 
  2022.  
  2023. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  2024. indicates an error. Specified error values are obtained by calling sock_errno() 
  2025. or psock_errno(). 
  2026.  
  2027.    Errno Value           Description 
  2028.  
  2029.    SOCEADDRINUSE         The address is already in use. 
  2030.  
  2031.    SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  2032.  
  2033.    SOCEFAULT             Using optval and optlen parameters results in an 
  2034.                          attempt to access memory outside the caller's address 
  2035.                          space. 
  2036.  
  2037.    SOCENOPROTOOPT        The optname parameter is unrecognized, or the level 
  2038.                          parameter is not SOL_SOCKET. 
  2039.  
  2040. Examples:  The following are examples of the getsockopt() call. See 
  2041. setsockopt() for examples of how the setsockopt() call options are set. 
  2042.  
  2043. int rc;
  2044. int s;
  2045. int optval;
  2046. int optlen;
  2047. struct linger l;
  2048. int getsockopt(int s, int level, int optname, char *optval, int *optlen);
  2049.  
  2050. .
  2051. .
  2052. .
  2053. /* Is out of band data in the normal input queue? */
  2054. optlen = sizeof(int);
  2055. rc = getsockopt(
  2056.         s, SOL_SOCKET, SO_OOBINLINE, (char *) &optval, &optlen);
  2057. if (rc == 0)
  2058. {
  2059.     if (optlen == sizeof(int))
  2060.     {
  2061.          if (optval)
  2062.             /* yes it is in the normal queue */
  2063.          else
  2064.             /* no it is not                  */
  2065.     }
  2066. }
  2067.  
  2068. .
  2069. .
  2070. .
  2071. /* Do I linger on close? */
  2072. optlen = sizeof(l);
  2073. rc = getsockopt(
  2074.         s, SOL_SOCKET, SO_LINGER, (char *) &l, &optlen);
  2075. if (rc == 0)
  2076. {
  2077.     if (optlen == sizeof(l))
  2078.     {
  2079.          if (l.l_onoff)
  2080.             /* yes I linger */
  2081.          else
  2082.             /* no I do not  */
  2083.     }
  2084. }
  2085.  
  2086. See Also:  getprotobyname(), setsockopt(), and socket(). 
  2087.  
  2088.  
  2089. ΓòÉΓòÉΓòÉ 5.4.7. ioctl() ΓòÉΓòÉΓòÉ
  2090.  
  2091. #include <types.h>
  2092. #include <sys\socket.h>
  2093. #include <sys\ioctl.h>
  2094. #include <net\route.h>
  2095. #include <net\if.h>
  2096.  
  2097. int ioctl(s, cmd, data, lendata)
  2098. int s;
  2099. int cmd;
  2100. caddr_t data;
  2101. int lendata;
  2102.  
  2103. Parameter      Description 
  2104.  
  2105. s              The socket descriptor 
  2106.  
  2107. cmd            The command to perform 
  2108.  
  2109. data           A pointer to the data associated with cmd 
  2110.  
  2111. lendata        The length of the data in bytes 
  2112. Description:  The operating characteristics of sockets can be controlled with 
  2113. ioctl() requests.  The operations to be controlled are determined by cmd.  The 
  2114. data parameter is a pointer to data associated with the particular command, and 
  2115. its format depends on the command that is requested. In the following 
  2116. descriptions, (AF_INET on TCP/IP) indicates that this option applies to INET 
  2117. native networking only. (AF_INET) indicates that this option applies to INET 
  2118. native networking and INET over non-native NetBIOS LAN. The following are valid 
  2119. ioctl() commands: 
  2120.  
  2121. Option               Description 
  2122.  
  2123. FIOASYNC             Sets or clears asynchronous input-output for a socket. 
  2124.                      data is a pointer to an integer.  If the integer is 0, 
  2125.                      asynchronous input-output on the socket is cleared. 
  2126.                      Otherwise, the socket is set for asynchronous 
  2127.                      input-output. 
  2128.  
  2129. FIONBIO              Sets or clears nonblocking input-output for a socket. The 
  2130.                      data parameter is a pointer to an integer. If the integer 
  2131.                      is 0, nonblocking input-output on the socket is cleared. 
  2132.                      Otherwise, the socket is set for nonblocking input-output. 
  2133.  
  2134. FIONREAD             Gets the number of immediately readable bytes for the 
  2135.                      socket. The data parameter is a pointer to an integer. 
  2136.                      Sets the value of the integer to the number of immediately 
  2137.                      readable characters for the socket. 
  2138.  
  2139. SIOCADDRT            (AF_INET on TCP/IP) Adds a routing table entry. data is a 
  2140.                      pointer to a rtentry structure, as defined in 
  2141.                      <NET\ROUTE.H>. The routing table entry, passed as an 
  2142.                      argument, is added to the routing tables. 
  2143.  
  2144. SIOCATMARK           Queries whether the current location in the data input is 
  2145.                      pointing to out-of-band data. The data parameter is a 
  2146.                      pointer to an integer. Sets the argument to 1 if the 
  2147.                      socket points to a mark in the data stream for out-of-band 
  2148.                      data.  Otherwise, sets the argument to 0. 
  2149.  
  2150. SIOCDARP             (AF_INET on TCP/IP) Deletes an arp table entry.  data is a 
  2151.                      pointer to a arpreq as defined in <NET\IF_ARP.H>. The arp 
  2152.                      table entry passed as an argument is deleted from the arp 
  2153.                      tables, if it exists. 
  2154.  
  2155. SIOCDELRT            (AF_INET on TCP/IP) Deletes a routing table entry.  data 
  2156.                      is a pointer to a rtentry structure, as defined in 
  2157.                      <NET\ROUTE.H>. If it exists, the routing table entry 
  2158.                      passed as an argument is deleted from the routing tables. 
  2159.  
  2160. SIOCGARP             (AF_INET on TCP/IP) Get the arp table entries.  data is a 
  2161.                      pointer to an arpreq, as defined in <NET\IF_ARP.H>. The 
  2162.                      arp table entry passed as an argument is returned from the 
  2163.                      arp tables if it exists. 
  2164.  
  2165. SIOCGIFADDR          (AF_INET) Gets the network interface address.  The data 
  2166.                      parameter is a pointer to an ifreq structure, as defined 
  2167.                      in <NET\IF.H>. The interface address is returned in the 
  2168.                      argument. 
  2169.  
  2170. SIOCGIFBRDADDR       (AF_INET) Gets the network interface broadcast address. 
  2171.                      The data parameter is a pointer to an ifreq structure, as 
  2172.                      defined in <NET\IF.H>. The interface broadcast address is 
  2173.                      returned in the argument. 
  2174.  
  2175. SIOCGIFCONF          (AF_INET) Gets the network interface configuration. The 
  2176.                      data parameter is a pointer to an ifconf structure, as 
  2177.                      defined in <NET\IF.H>. The interface configuration is 
  2178.                      returned in the argument. 
  2179.  
  2180. SIOCGIFDSTADDR       (AF_INET on TCP/IP) Gets the network interface destination 
  2181.                      address. The data parameter is a pointer to an ifreq 
  2182.                      structure, as defined in <NET\IF.H>. The interface 
  2183.                      destination (point-to-point) address is returned in the 
  2184.                      argument. 
  2185.  
  2186. SIOCGIFFLAGS         (AF_INET) Gets the network interface flags.  The data 
  2187.                      parameter is a pointer to an ifreq structure, as defined 
  2188.                      in <NET\IF.H>. The interface flags are returned in the 
  2189.                      argument. 
  2190.  
  2191. SIOCGIFMETRIC        (AF_INET on TCP/IP) Gets the network interface routing 
  2192.                      metric. The data parameter is a pointer to an ifreq 
  2193.                      structure, as defined in <NET\IF.H>. The interface routing 
  2194.                      metric is returned in the argument. 
  2195.  
  2196. SIOCGIFNETMASK       (AF_INET) Gets the network interface network mask. The 
  2197.                      data parameter is a pointer to an ifreq structure, as 
  2198.                      defined in <NET\IF.H>. The interface network mask is 
  2199.                      returned in the argument. 
  2200.  
  2201. SIOCSARP             (AF_INET on TCP/IP) Sets an arp table entry.  The data 
  2202.                      parameter is a pointer to an arpreq as defined in 
  2203.                      <NET\IF_ARP.H>. The arp table entry passed as an argument 
  2204.                      is added to the arp tables. 
  2205.  
  2206. SIOCSIFADDR          (AF_INET on TCP/IP) Sets the network interface address. 
  2207.                      The data parameter is a pointer to an ifreq structure, as 
  2208.                      defined in <NET\IF.H>. Set the interface address to the 
  2209.                      value passed in the argument. 
  2210.  
  2211. SIOCSIFBRDADDR       (AF_INET on TCP/IP) Sets the network interface broadcast 
  2212.                      address. The data parameter is a pointer to an ifreq 
  2213.                      structure, as defined in <NET\IF.H>. Set the interface 
  2214.                      broadcast address to the value passed in the argument. 
  2215.  
  2216. SIOCSIFDSTADDR       (AF_INET on TCP/IP) Sets the network interface destination 
  2217.                      address. The data parameter is a pointer to an ifreq 
  2218.                      structure, as defined in <NET\IF.H>. Set the interface 
  2219.                      destination (point-to-point) address to the value passed 
  2220.                      in the argument. 
  2221.  
  2222. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  2223. indicates an error. Specified error values are obtained by calling sock_errno() 
  2224. or psock_errno(). 
  2225.  
  2226.    Errno Value          Description 
  2227.  
  2228.    SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  2229.  
  2230.    SOCEINVAL            The request is not valid or not supported. 
  2231.  
  2232.    SOCEOPNOTSUPP        The operation is not supported on the socket. 
  2233.  
  2234.    SOCEFAULT            Using data and lendata would result in an attempt to 
  2235.                         access memory outside the caller address space. 
  2236.  
  2237. Example:  The following is an example of the ioctl() call. 
  2238.  
  2239. int s;
  2240. int dontblock;
  2241. int rc;
  2242. .
  2243. .
  2244. .
  2245. /* Place the socket into nonblocking mode */
  2246. dontblock = 1;
  2247. rc = ioctl(s, FIONBIO, (char *) &dontblock, sizeof(dontblock));
  2248. .
  2249. .
  2250. .
  2251.  
  2252.  
  2253. ΓòÉΓòÉΓòÉ 5.4.8. listen() ΓòÉΓòÉΓòÉ
  2254.  
  2255. #include <types.h>
  2256. #include <sys\socket.h>
  2257.  
  2258. int listen(s, backlog)
  2259. int s;
  2260. int backlog;
  2261.  
  2262. Parameter      Description 
  2263.  
  2264. s              The socket descriptor 
  2265.  
  2266. backlog        Defines the maximum length for the queue of pending connections 
  2267. Description:  The listen() call applies only to stream sockets. It performs two 
  2268. tasks:  it completes the binding necessary for a socket s, if bind() has not 
  2269. been called for s, and it creates a connection request queue of length backlog 
  2270. to queue incoming connection requests. When backlog is full, additional 
  2271. connection requests are ignored. 
  2272.  
  2273. The listen() call indicates a readiness to accept client connection requests. 
  2274. It transforms an active socket into a passive socket.  After it is called, s 
  2275. can never be used as an active socket to initiate connection requests. Calling 
  2276. listen() is the third of four steps that a server performs to accept a 
  2277. connection. Listen() is called after allocating a stream socket with socket() 
  2278. and after binding a name to s with bind().  Listen() must be called before 
  2279. calling accept(). 
  2280.  
  2281. If the backlog is less than 0, backlog is set to 0. If the backlog is greater 
  2282. than SOMAXCONN, as defined in <SYS\SOCKET.H>, backlog is set to SOMAXCONN. 
  2283.  
  2284. Non-Native Networking:  See "Non-Native Networking" for the MPTN connectivities 
  2285. provided.  In the MPTN environment, the listen() call applies to all locally 
  2286. connected native and non-native networks. 
  2287.  
  2288. Return Value and Errno Values:  The value 0 indicates success, the value -1 
  2289. indicates an error. Specified error values are obtained by calling sock_errno() 
  2290. or psock_errno(). 
  2291.  
  2292.    Errno Value          Description 
  2293.  
  2294.    SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  2295.  
  2296.    SOCEOPNOTSUPP        The s parameter is not a socket descriptor that 
  2297.                         supports the listen() call. 
  2298.  
  2299. See Also: accept(), bind(), connect(), and socket(). 
  2300.  
  2301.  
  2302. ΓòÉΓòÉΓòÉ 5.4.9. psock_errno() ΓòÉΓòÉΓòÉ
  2303.  
  2304. #include <nerrno.h>
  2305.  
  2306.  
  2307. void psock_errno(s)
  2308. char *s;
  2309.  
  2310. Parameter      Description 
  2311.  
  2312. s              Pointer to a buffer 
  2313.  
  2314. Description:  Use psock_errno() to produce short error messages on the standard 
  2315. error display describing the last error encountered during a call to a socket 
  2316. library function. If *s is not a NULL pointer and does not point to a null 
  2317. string, the string it points to is printed, followed by a colon, followed by a 
  2318. space, followed by the message.  If *s is a NULL pointer or points to a null 
  2319. string, only the message is printed. 
  2320.  
  2321. The error code is taken from calling sock_errno() call.  The error code is set 
  2322. when errors occur, but is not cleared when non-erroneous calls are made. 
  2323.  
  2324. See Also:  sock_errno(). 
  2325.  
  2326.  
  2327. ΓòÉΓòÉΓòÉ 5.4.10. readv() ΓòÉΓòÉΓòÉ
  2328.  
  2329. #include <types.h>
  2330. #include <sys\socket.h>
  2331.  
  2332. int readv(s, iov, iovcnt)
  2333. int s;
  2334. struct iovec *iov;
  2335. int iovcnt;
  2336.  
  2337. Parameter      Description 
  2338.  
  2339. s              The socket descriptor 
  2340.  
  2341. iov            A pointer to an array of iovec structure 
  2342.  
  2343. iovcnt         The number of buffers pointed to by the iov parameter 
  2344. Description:  The readv() call reads data on a socket with descriptor s and 
  2345. stores it in a set of buffers. The data is scattered into the buffers specified 
  2346. by iov╨¥0Γöÿ...iov╨¥iovcnt-1Γöÿ. The iovec structure is defined in <SYS\SOCKET.H> and 
  2347. contains the following fields: 
  2348.  
  2349. Parameter      Description 
  2350.  
  2351. iov_base       Points to the buffer 
  2352.  
  2353. iov_len        The length of the buffer 
  2354.  
  2355. The readv() call applies only to connected sockets. 
  2356.  
  2357. This call returns up to the number of bytes in the buffers pointed to by the 
  2358. iov parameter.  This number is the sum of all iov_len fields. If less than the 
  2359. number of bytes requested is available, the call returns the number currently 
  2360. available. If data is not available at the socket with descriptor s, the 
  2361. readv() call waits for data to arrive and blocks the caller, unless the socket 
  2362. is in nonblocking mode. See ioctl() for a description of how to set nonblocking 
  2363. mode. 
  2364.  
  2365. Return Value and Errno Values:  If successful, the number of bytes read into 
  2366. the buffers is returned. The value -1 indicates an error. Specified error 
  2367. values are obtained by calling sock_errno() or psock_errno(). 
  2368.  
  2369.    Errno Value           Description 
  2370.  
  2371.    SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  2372.  
  2373.    SOCEFAULT             Using iov and iovcnt would result in an attempt to 
  2374.                          access memory outside the caller's address space. 
  2375.  
  2376.    SOCEINVAL             iovcnt was not valid, or one of the fields in the iov 
  2377.                          array was not valid. 
  2378.  
  2379.    SOCEWOULDBLOCK        The s parameter is in nonblocking mode and no data is 
  2380.                          available to read. 
  2381.  
  2382. See Also:  connect(), getsockopt(), ioctl(), recv(), recvfrom(), select(), 
  2383. send(), sendto(), setsockopt(), socket(), and writev(). 
  2384.  
  2385.  
  2386. ΓòÉΓòÉΓòÉ 5.4.11. recv() ΓòÉΓòÉΓòÉ
  2387.  
  2388. #include <types.h>
  2389. #include <sys\socket.h>
  2390.  
  2391. int recv(s, buf, len, flags)
  2392. int s;
  2393. char *buf;
  2394. int len;
  2395. int flags;
  2396.  
  2397. Parameter      Description 
  2398.  
  2399. s              The socket descriptor. 
  2400.  
  2401. buf            The pointer to the buffer that receives the data. 
  2402.  
  2403. len            The length in bytes of the buffer pointed to by the buf 
  2404.                parameter. 
  2405.  
  2406. flags          The flags parameter is set by specifying one or more of the 
  2407.                following flags. If more than one flag is specified, the logical 
  2408.                OR operator ( | ) must be used to separate them. Setting this 
  2409.                parameter is supported only for sockets in the AF_INET domain. 
  2410.  
  2411.    MSG_OOB      (AF_INET)  Reads any out-of-band data on the socket. 
  2412.  
  2413.    MSG_PEEK     Peeks at the data present on the socket; the data is returned 
  2414.                 but not consumed, so that a subsequent receive operation sees 
  2415.                 the same data. 
  2416. Description:  The recv() call receives data on a socket with descriptor s and 
  2417. stores it in a buffer. The recv() call applies only to connected sockets. 
  2418.  
  2419. This call returns the length of the incoming message or data. If a datagram 
  2420. packet is too long to fit in the supplied buffer, datagram sockets discard 
  2421. excess bytes. If data is not available at the socket with descriptor s, the 
  2422. recv() call waits for a message to arrive and blocks the caller, unless the 
  2423. socket is in nonblocking mode. See ioctl() for a description of how to set 
  2424. nonblocking mode. 
  2425.  
  2426. Return Value and Errno Values:  If successful, the length, in bytes, of the 
  2427. message or datagram is returned.  The value 0 indicates that the connection is 
  2428. closed. The value -1 indicates an error. Specified error values are obtained by 
  2429. calling sock_errno() or psock_errno(). 
  2430.  
  2431.    Errno Value          Description 
  2432.  
  2433.    SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  2434.  
  2435.    SOCEFAULT            Using the buf and len parameters would result in an 
  2436.                         attempt to access memory outside the caller's address 
  2437.                         space. 
  2438.  
  2439.    SOCEWOULDBLOCK       The s parameter is in nonblocking mode and no data is 
  2440.                         available to read. 
  2441.  
  2442.    SOCEINVAL            Invalid argument. 
  2443.  
  2444. See Also:  connect(), getsockopt(), ioctl(), readv(), recvfrom(), select(), 
  2445. send(), sendto(), setsockopt(), socket(), and writev(). 
  2446.  
  2447.  
  2448. ΓòÉΓòÉΓòÉ 5.4.12. recvfrom() ΓòÉΓòÉΓòÉ
  2449.  
  2450. #include <types.h>
  2451. #include <sys\socket.h>
  2452.  
  2453. int recvfrom(s, buf, len, flags, name, namelen)
  2454. int s;
  2455. char *buf;
  2456. int len;
  2457. int flags;
  2458. struct sockaddr *name;
  2459. int *namelen;
  2460.  
  2461. Parameter      Description 
  2462.  
  2463. s              The socket descriptor. 
  2464.  
  2465. buf            The pointer to the buffer that receives the data. 
  2466.  
  2467. len            The length in bytes of the buffer pointed to by the buf 
  2468.                parameter. 
  2469.  
  2470. flags          A parameter that can be set to 0 or MSG_PEEK. Setting this 
  2471.                parameter is supported only for sockets in the AF_INET domain. 
  2472.  
  2473.    MSG_OOB        (AF_INET)  Reads any out-of-band data on the socket. 
  2474.  
  2475.    MSG_PEEK       Peeks at the data present on the socket; the data is returned 
  2476.                   but not consumed, so that a subsequent receive operation sees 
  2477.                   the same data. 
  2478.  
  2479. name           A pointer to a socket address structure data is received from. 
  2480.                If name is a nonzero value, the source address is returned. 
  2481.  
  2482. namelen        The pointer to the size of name in bytes. 
  2483. Description:  The recvfrom() call receives data on a socket with descriptor s 
  2484. and stores it in a buffer. The recvfrom() call applies to any datagram socket, 
  2485. either connected or unconnected. 
  2486.  
  2487. If name is nonzero, the source address of the message is filled. The namelen 
  2488. parameter must first be initialized to the size of the buffer associated with 
  2489. name and then modified on return to indicate the actual size of the address 
  2490. stored there. 
  2491.  
  2492. This call returns the length of the incoming message or data. If a datagram 
  2493. packet is too long to fit in the supplied buffer, datagram sockets discard 
  2494. excess bytes. If datagram packets are not available at the socket with 
  2495. descriptor s, the recvfrom() call waits for a message to arrive and blocks the 
  2496. caller, unless the socket is in nonblocking mode. See ioctl() for a description 
  2497. of how to set nonblocking mode. 
  2498.  
  2499. Return Value and Errno Values:  If successful, the length, in bytes, of the 
  2500. message or datagram is returned. The value -1 indicates an error. Specified 
  2501. error values are obtained by calling sock_errno() or psock_errno(). 
  2502.  
  2503.    Errno Value           Description 
  2504.  
  2505.    SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  2506.  
  2507.    SOCEFAULT             Using the buf and len parameters would result in an 
  2508.                          attempt to access memory outside the caller's address 
  2509.                          space. 
  2510.  
  2511.    SOCEWOULDBLOCK        The s parameter is in nonblocking mode and no data is 
  2512.                          available to read. 
  2513.  
  2514.    SOCEINVAL             Invalid argument. 
  2515.  
  2516. See Also:  getsockopt(), ioctl(), readv(), recv(), select(), send(), sendto(), 
  2517. setsockopt(), socket(), and writev(). 
  2518.  
  2519.  
  2520. ΓòÉΓòÉΓòÉ 5.4.13. recvmsg() ΓòÉΓòÉΓòÉ
  2521.  
  2522. #include <types.h>
  2523. #include <sys\socket.h>
  2524.  
  2525. int recvmsg(s, msg, flags)
  2526. int s;
  2527. struct msghdr msg╨¥Γöÿ;
  2528. int flags;
  2529.  
  2530. Parameter      Description 
  2531.  
  2532. s              The socket descriptor. 
  2533.  
  2534. msg            An array of message headers where messages are received. 
  2535.  
  2536. flags          The flags parameter is set by specifying one or more of the 
  2537.                following flags. If more than one flag is specified, the logical 
  2538.                OR operator ( | ) must be used to separate them. Setting this 
  2539.                parameter is supported only for sockets in the AF_INET domain. 
  2540.  
  2541.    MSG_OOB      (AF_INET) Reads any out-of-band data on the socket. 
  2542.  
  2543.    MSG_PEEK     Peeks at the data present on the socket; the data is returned 
  2544.                 but not consumed, so that a subsequent receive operation will 
  2545.                 see the same data. 
  2546. Description:  The recvmsg() call receives messages on a socket with descriptor 
  2547. s and stores them in an array of message headers. A message header is defined 
  2548. by a structure called msghdr. The definition of this structure can be found in 
  2549. the <SYS\SOCKET.H> header file and contains the following elements: 
  2550.  
  2551. Parameter           Description 
  2552.  
  2553. msg_name            The optional pointer to the buffer containing the recipient 
  2554.                     address 
  2555.  
  2556. msg_namelen         The size of the address buffer 
  2557.  
  2558. msg_iov             An array of iovec buffers containing the message 
  2559.  
  2560. msg_iovlen          The number of elements in the msg_iov array 
  2561.  
  2562. msg_accrights       The access rights received. This field is ignored. 
  2563.  
  2564. msg_accrightslen    The length of access rights received. This field is 
  2565.                     ignored. 
  2566.  
  2567. The recvmsg() call applies to sockets, regardless of whether or not they are in 
  2568. the connected state. 
  2569.  
  2570. This call returns the length of the data received. If data is not available at 
  2571. the socket with descriptor s, the recvmsg() call waits for a message to arrive 
  2572. and blocks the caller, unless the socket is in nonblocking mode. See ioctl() 
  2573. for a description of how to set nonblocking mode. 
  2574.  
  2575. Return Value and Errno Values:  If successful, the length of the message in 
  2576. bytes is returned. The value -1 indicates an error. 
  2577.  
  2578.    Errno Value          Description 
  2579.  
  2580.    SOCENOTSOCK          The s parameter is not a valid socket descriptor. 
  2581.  
  2582.    SOCEFAULT            Using msg would result in an attempt to access memory 
  2583.                         outside the caller's address space. 
  2584.  
  2585.    SOCEWOULDBLOCK       The s parameter is in nonblocking mode, and no data is 
  2586.                         available to read. 
  2587.  
  2588. See Also:  connect(), getsockopt(), ioctl(), readv(), recv(), recvfrom(), 
  2589. select(), send(), sendmsg(), sendto(), setsockopt(), socket(), and writev(). 
  2590.  
  2591.  
  2592. ΓòÉΓòÉΓòÉ 5.4.14. select() ΓòÉΓòÉΓòÉ
  2593.  
  2594. Socket/MPTN for OS/2 supports two versions of the select() call: 
  2595.  
  2596. o OS/2 Version 
  2597. o Berkeley Software Distributions (BSD) Version 
  2598.  
  2599.  
  2600. ΓòÉΓòÉΓòÉ 5.4.14.1. OS/2 Version ΓòÉΓòÉΓòÉ
  2601.  
  2602. In the OS/2 version, the socket numbers are specified as an array of integers, 
  2603. in which the read socket numbers are followed by write socket numbers, followed 
  2604. by the exception pending connection socket numbers. The OS/2 version monitors 
  2605. the activity on a socket by specifying the number of sockets to be checked for 
  2606. readability, readiness for writing, and exception pending conditions. 
  2607.  
  2608. #include <types.h>
  2609. #include <sys\socket.h>
  2610.  
  2611. int select(s, noreads, nowrites, noexcepts, timeout)
  2612. int *s;
  2613. int noreads;
  2614. int nowrites;
  2615. int noexcepts;
  2616. long timeout;
  2617.  
  2618. Parameter      Description 
  2619.  
  2620. s              An array of socket numbers where the read socket numbers are 
  2621.                followed by the write socket numbers, and also followed by the 
  2622.                exception socket numbers. 
  2623.  
  2624. noreads        The number of sockets to be checked for readability. 
  2625.  
  2626. nowrites       The number of sockets to be checked for readiness for writing. 
  2627.  
  2628. noexcepts      The number of sockets to be checked for exceptional pending 
  2629.                conditions. 
  2630.  
  2631. timeout        The maximum interval, in milliseconds, to wait for the selection 
  2632.                to complete. 
  2633.  
  2634. Description:  The select() call monitors activity on a set of different sockets 
  2635. until a time-out expires, to see if any sockets are ready for reading or 
  2636. writing, or if any exceptional conditions are pending. 
  2637.  
  2638. If the time-out value is 0, select() does not wait before returning. If the 
  2639. time-out value is -1, select() does not time out, but returns when a socket 
  2640. becomes ready. The time-out value is in milliseconds. 
  2641.  
  2642. The select() call checks all indicated sockets at the same time without 
  2643. becoming blocked. See Porting a Socket API Application for information on how 
  2644. the OS/2 implementation of the select() call differs from the Berkeley 
  2645. implementation. 
  2646.  
  2647. Return Value and Errno Values:  The number of ready sockets is returned. The 
  2648. value -1 indicates an error. The value 0 indicates an expired time limit. If 
  2649. the return value is greater than 0, the socket numbers in s that were not ready 
  2650. are set to -1. Specified error values are obtained by calling sock_errno() or 
  2651. psock_errno(). 
  2652.  
  2653.    Errno Value        Description 
  2654.  
  2655.    SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  2656.  
  2657.    SOCEFAULT          Bad address. 
  2658.  
  2659.    SOCEINVAL          Invalid argument. 
  2660.  
  2661. Examples:  The following is an example of the select() call. 
  2662.  
  2663. #define MAX_TIMEOUT  1000
  2664.  
  2665. /* input_ready(insock)- Check to see if there is available input on
  2666.  * socket insock.
  2667.  * Returns 1 if input is available.
  2668.  *         0 if input is not available.
  2669.  *        -1 on error.
  2670.  */
  2671.  
  2672.  int input_ready(insock)
  2673.  int insock;                 /* input socket descriptor */
  2674.  
  2675.  {
  2676.    int socks╨¥Γöÿ;    /* array of sockets */
  2677.    long timeout = MAX_TIMEOUT;
  2678.  
  2679.    /* put sockets to check in socks╨¥Γöÿ */
  2680.  
  2681.    socks╨¥0Γöÿ = insock;
  2682.  
  2683.    /* check for READ availability on this socket */
  2684.  
  2685.    return select(socks, 1, 0, 0, timeout);
  2686.  }
  2687.  
  2688. See Also:  accept(), connect(), recv(), and send(). 
  2689.  
  2690.  
  2691. ΓòÉΓòÉΓòÉ 5.4.14.2. BSD Version ΓòÉΓòÉΓòÉ
  2692.  
  2693. The BSD version monitors the activity on sockets by specifying a set mask 
  2694. (fd_set) of socket numbers for which the caller wants to read the data, write 
  2695. the data, and check exception pending conditions. The BSD version provides 
  2696. FD_SET, FD_CLR, FD_ISSET, and FD_ZERO macros to add or delete socket numbers 
  2697. from the set mask. 
  2698.  
  2699. Note:  You must define #define BSD_SELECT to access the BSD version of the 
  2700. select() call. Otherwise, the OS/2 version is assumed. 
  2701.  
  2702. #define BSD_SELECT
  2703. #include <types.h>
  2704. #include <sys\select.h>
  2705. #include <sys\time.h>
  2706.  
  2707. int select(nfds, readfds, writefds, exceptfds, timeout)
  2708. int nfds;
  2709. fd_set *readfds;
  2710. fd_set *writefds;
  2711. fd_set *exceptfds;
  2712. struct timeval *timeout;
  2713.  
  2714. Parameter      Description 
  2715.  
  2716. nfds           The highest socket descriptors to check plus 1 
  2717.  
  2718. readfds        Points to a bit mask of descriptors to check for reading 
  2719.  
  2720. writefds       Points to a bit mask of descriptors to check for writing 
  2721.  
  2722. exceptfds      Points to a bit mask of descriptors to be checked for 
  2723.                exceptional pending conditions 
  2724.  
  2725. timeout        Points to the time to wait for the select() call to complete 
  2726.  
  2727. Description:  The select() call monitors activity on a set of different sockets 
  2728. until a time-out expires, to see if any sockets are ready for reading or 
  2729. writing, or if any exceptional conditions are pending. The bit mask is made up 
  2730. of an array of integers. Macros are provided to manipulate the bit masks. 
  2731.  
  2732. Macro                                   Description 
  2733.  
  2734. FD_SET( socket, bit_mask_address)       Sets the bit for the socket in the bit 
  2735.                                         mask pointed to by bit_mask_address. 
  2736.  
  2737. FD_CLR( socket, bit_mask_address)       Clears the bit. 
  2738.  
  2739. FD_ISSET( socket, bit_mask_address)     Returns true if the bit is set for this 
  2740.                                         socket descriptor; otherwise, it 
  2741.                                         returns false. 
  2742.  
  2743. FD_ZERO( socket, bit_mask_address)      Clears the entire bit mask for all 
  2744.                                         socket descriptors. 
  2745.  
  2746. Note:  For macros FD_SET, FD_CLR, and FD_ISSET, the parameters socket and 
  2747. bit_mask_address should be defined in the following manner: 
  2748.  
  2749. int socket;
  2750. struct fd_set *bit_mask_address, bit_mask_address;
  2751.  
  2752. The first nfds descriptors in each bit mask are tested for the specified 
  2753. condition. 
  2754.  
  2755. Socket descriptors are specified by setting bits in a bit mask. If time-out is 
  2756. a NULL pointer, the call blocks indefinitely until one of the requested 
  2757. conditions is satisfied. If time-out is non-NULL, it specifies the maximum time 
  2758. to wait for the call to complete. To poll a set of sockets, the time-out 
  2759. pointer should point to a zeroed timeval structure. The timeval structure is 
  2760. defined in the <SYS\TIME.H> header file and contains the following fields: 
  2761.  
  2762. Field          Description 
  2763.  
  2764. tv_sec         The number of seconds 
  2765.  
  2766. tv_usec        The number of microseconds 
  2767.  
  2768. Setting any of the descriptor pointers to zero indicates that no checks are to 
  2769. be made for the conditions. For example, setting exceptfds to be a NULL pointer 
  2770. causes the select call to check for only read and write conditions. 
  2771.  
  2772. Return Value and Errno Values:  The total number of ready sockets (in all bit 
  2773. masks) is returned. The value -1 indicates an error. The value 0 indicates an 
  2774. expired time limit. If the return value is greater than 0, the socket 
  2775. descriptors in each bit mask that are ready are set to 1. All others are set to 
  2776. 0. Specified error values are obtained by calling sock_errno() or 
  2777. psock_errno(). 
  2778.  
  2779.    Errno Value        Description 
  2780.  
  2781.    SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  2782.  
  2783.    SOCEFAULT          Bad address. 
  2784.  
  2785.    SOCEINVAL          Invalid argument. 
  2786.  
  2787. See Also:  accept(), connect(), recv(), and send(). 
  2788.  
  2789.  
  2790. ΓòÉΓòÉΓòÉ 5.4.15. send() ΓòÉΓòÉΓòÉ
  2791.  
  2792. #include <types.h>
  2793. #include <sys\socket.h>
  2794.  
  2795. int send(s, msg, len, flags)
  2796. int s;
  2797. char *msg;
  2798. int len;
  2799. int flags;
  2800.  
  2801. Parameter      Description 
  2802.  
  2803. s              The socket descriptor. 
  2804.  
  2805. msg            Points to the buffer containing the message to transmit. 
  2806.  
  2807. len            The length of the message pointed to by the msg parameter. 
  2808.  
  2809. flags          The flags parameter is set by specifying one or more of the 
  2810.                following flags. If more than one flag is specified, the logical 
  2811.                OR operator (|) must be used to separate them. Setting this 
  2812.                parameter is supported only for sockets in the AF_INET domain. 
  2813.  
  2814.    MSG_OOB             (AF_INET)  Sends out-of-band data on sockets that 
  2815.                        support this notion.  Only SOCK_STREAM sockets created 
  2816.                        in the AF_INET address family support out-of-band data. 
  2817.  
  2818.    MSG_DONTROUTE       (AF_INET on UDP) The SO_DONTROUTE option is turned on 
  2819.                        for the duration of the operation.  This is usually used 
  2820.                        only by diagnostic or routing programs. 
  2821. Description:  The send() call sends packets on the socket with descriptor s. 
  2822. The send() call applies to all connected sockets. 
  2823.  
  2824. If buffer space is not available at the socket to hold the message to be 
  2825. transmitted, the send() call normally blocks, unless the socket is placed in 
  2826. nonblocking mode. See ioctl() for a description of how to set nonblocking mode. 
  2827. The select() call can be used to determine when it is possible to send more 
  2828. data. 
  2829.  
  2830. Return Value and Errno Values:  No indication of failure to deliver is implicit 
  2831. in a send() routine. The value -1 indicates locally detected errors. Specified 
  2832. error values are obtained by calling sock_errno() or psock_errno(). 
  2833.  
  2834.    Errno Value           Description 
  2835.  
  2836.    SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  2837.  
  2838.    SOCEFAULT             Using the msg and len parameters would result in an 
  2839.                          attempt to access memory outside the caller's address 
  2840.                          space. 
  2841.  
  2842.    SOCEINVAL             Invalid argument. 
  2843.  
  2844.    SOCENOBUFS            No buffer space is available to send the message. 
  2845.  
  2846.    SOCEWOULDBLOCK        The s parameter is in nonblocking mode and no data is 
  2847.                          available to read. 
  2848.  
  2849. See Also:  connect(), getsockopt(), ioctl(), readv(), recv(), recvfrom(), 
  2850. select(), sendto(), socket(), and writev(). 
  2851.  
  2852.  
  2853. ΓòÉΓòÉΓòÉ 5.4.16. sendmsg() ΓòÉΓòÉΓòÉ
  2854.  
  2855. #include <types.h>
  2856. #include <sys\socket.h>
  2857.  
  2858. int sendmsg(s, msg, flags)
  2859. int s;
  2860. struct msghdr msg╨¥Γöÿ;
  2861. int flags;
  2862.  
  2863. Parameter    Description 
  2864.  
  2865. s            The socket descriptor. 
  2866.  
  2867. msg          An array of message headers where messages are received. 
  2868.  
  2869. flags        The flags parameter is set by specifying one or more of the 
  2870.              following flags. If more than one flag is specified, the logical 
  2871.              OR operator (|) must be used to separate them. Setting this 
  2872.              parameter is supported only for sockets in the AF_INET domain. 
  2873.  
  2874.    MSG_OOB           (AF_INET)  Sends out-of-band data on the socket. 
  2875.  
  2876.    MSG_DONTROUTE     (AF_INET on UDP)  The SO_DONTROUTE option is turned on for 
  2877.                      the duration of the operation.  This is usually used only 
  2878.                      by diagnostic or routing programs. 
  2879. Description:  The sendmsg() call sends messages on a socket with descriptor s 
  2880. passed in an array of message headers. A message header is defined by a 
  2881. structure called msghdr. The definition of this structure can be found in the 
  2882. <SYS\SOCKET.H> header file and contains the following elements: 
  2883.  
  2884. Parameter            Description 
  2885.  
  2886. msg_name             The optional pointer to the buffer containing the 
  2887.                      recipient address. 
  2888.  
  2889. msg_namelen          The size of the address buffer. 
  2890.  
  2891. msg_iov              An array of iovec buffers containing the message. 
  2892.  
  2893. msg_iovlen           The number of elements in the msg_iov array. 
  2894.  
  2895. msg_accrights        The access rights sent. This field is ignored. 
  2896.  
  2897. msg_accrightslen     The length of the access rights sent. This field is 
  2898.                      ignored. 
  2899.  
  2900. The sendmsg() call applies to sockets regardless of whether they are in the 
  2901. connected state. 
  2902.  
  2903. This call returns the length of the data sent. If the socket with descriptor s 
  2904. is not ready for sending data, the sendmsg() call waits unless the socket is in 
  2905. nonblocking mode. See ioctl() for a description of how to set nonblocking mode. 
  2906.  
  2907. Return Value and Errno Values:  If successful, the length of the message in 
  2908. bytes is returned. The value -1 indicates an error. Specified error values are 
  2909. obtained by calling sock_errno() or psock_errno(). 
  2910.  
  2911. Errno Value           Description 
  2912.  
  2913. SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  2914.  
  2915. SOCEFAULT             Using msg results in an attempt to access memory outside 
  2916.                       the caller's address space. 
  2917.  
  2918. SOCEINVAL             msg_namelen is not the size of a valid address for the 
  2919.                       specified address family. 
  2920.  
  2921. SOCEMSGSIZE           The message was too big to be sent as a single datagram. 
  2922.                       The maximum message size is xxxx. 
  2923.  
  2924.      Note to reviewer 
  2925.  
  2926.      The message size is pending.  See Don Woods 
  2927.  
  2928. SOCENOBUFS            No buffer space is available to send the message. 
  2929.  
  2930. SOCEWOULDBLOCK        The s parameter is in nonblocking mode, and no data is 
  2931.                       available to read. 
  2932.  
  2933. See Also:  connect(), getsockopt(), ioctl(), readv(), recv(), recvfrom(), 
  2934. recvmsg(), select(), send(), sendto(), setsockopt(), socket(), and writev(). 
  2935.  
  2936.  
  2937. ΓòÉΓòÉΓòÉ 5.4.17. sendto() ΓòÉΓòÉΓòÉ
  2938.  
  2939. #include <types.h>
  2940. #include <sys\socket.h>
  2941.  
  2942. int sendto(s, msg, len, flags, to, tolen)
  2943. int s;
  2944. char *msg;
  2945. int len;
  2946. int flags;
  2947. struct sockaddr *to;
  2948. int tolen;
  2949.  
  2950. Parameter   Description 
  2951.  
  2952. s           The socket descriptor. 
  2953.  
  2954. msg         The pointer to the buffer containing the message to transmit. 
  2955.  
  2956. len         The length of the message in the buffer pointed to by the msg 
  2957.             parameter. 
  2958.  
  2959. flags       A parameter that can be set to 0 or MSG_DONTROUTE. Setting this 
  2960.             parameter is supported only for sockets in the AF_INET domain. 
  2961.  
  2962.    MSG_DONTROUTE       (AF_INET on UDP) The SO_DONTROUTE option is turned on 
  2963.                        for the duration of the operation. This is usually used 
  2964.                        only by diagnostic or routing programs. 
  2965.  
  2966. to          The address of the target. 
  2967.  
  2968. tolen       The size of the address pointed to by the to parameter. 
  2969. Description:  The sendto() call sends packets on the socket with descriptor s. 
  2970. The sendto() call applies to any datagram socket, whether connected or 
  2971. unconnected. 
  2972.  
  2973. Non-Native Networking:  See "Non-Native Networking" for the MPTN connectivities 
  2974. provided. Before sending the data, the sendto() call attempts to locate the 
  2975. remote destination through any of the locally connected native and non-native 
  2976. networks.  The search order is based on the configuration setup and a cache 
  2977. with information of the remote destinations saved from previous locate calls. 
  2978.  
  2979. Return Value and Errno Values:  If successful, the number of characters sent is 
  2980. returned. The value -1 indicates an error. Specified error values are obtained 
  2981. by calling sock_errno() or psock_errno(). No indication of failure to deliver 
  2982. is implied in the return value of this call when used with datagram sockets. 
  2983.  
  2984.    Errno Value             Description 
  2985.  
  2986.    SOCENOTSOCK             The s parameter is not a valid socket descriptor. 
  2987.  
  2988.    SOCEFAULT               Using the msg and len parameters would result in an 
  2989.                            attempt to access memory outside the caller's 
  2990.                            address space. 
  2991.  
  2992.    SOCEINVAL               The tolen parameter is not the size of a valid 
  2993.                            address for the specified address family. 
  2994.  
  2995.    SOCEMSGSIZE             The message was too big to be sent as a single 
  2996.                            datagram. The default and maximum is 8192. 
  2997.  
  2998.    SOCENOBUFS              No buffer space is available to send the message. 
  2999.  
  3000.    SOCEWOULDBLOCK          The s parameter is in nonblocking mode and no data 
  3001.                            is available to read. 
  3002.  
  3003.    SOCENOTCONN             Socket is not connected. 
  3004.  
  3005.    SOCEDESTADDRREQ         Destination address required. 
  3006.  
  3007. See Also:  readv(), recv(), recvfrom(), send(), select(), socket(), and 
  3008. writev(). 
  3009.  
  3010.  
  3011. ΓòÉΓòÉΓòÉ 5.4.18. setsockopt() ΓòÉΓòÉΓòÉ
  3012.  
  3013. #include <types.h>
  3014. #include <sys\socket.h>
  3015.  
  3016. int setsockopt(s, level, optname, optval, optlen)
  3017. int s;
  3018. int level;
  3019. int optname;
  3020. char *optval;
  3021. int optlen;
  3022.  
  3023. Parameter      Description 
  3024.  
  3025. s              The socket descriptor. 
  3026.  
  3027. level          The level the option is being set for. Only SOL_SOCKET is 
  3028.                supported. 
  3029.  
  3030. optname        The name of a specified socket option. 
  3031.  
  3032. optval         Points to option data. 
  3033.  
  3034. optlen         Specifies the length of the option data. 
  3035. Description:  The setsockopt() call sets options associated with a socket. 
  3036. Options can exist at multiple protocol levels; they are always present at the 
  3037. highest socket level. 
  3038.  
  3039. When manipulating socket options, the level where the option resides and the 
  3040. name of the option must be specified. To manipulate options at the socket 
  3041. level, the level parameter must be set to SOL_SOCKET, as defined in 
  3042. <SYS\SOCKET.H>. To manipulate options at any other level, such as the TCP or IP 
  3043. level, supply the appropriate protocol number for the protocol controlling the 
  3044. option. Currently, only the SOL_SOCKET level is supported. 
  3045.  
  3046. The optval and optlen parameters are used to pass data used by the particular 
  3047. set command. The optval parameter points to a buffer containing the data needed 
  3048. by the set command. The optval parameter is optional and can be set to the NULL 
  3049. pointer, if data is not needed by the command. The optlen parameter must be set 
  3050. to the size of the data pointed to by optval. 
  3051.  
  3052. All of the socket level options except SO_LINGER expect optval to point to an 
  3053. integer and optlen to be set to the size of an integer. When the integer is 
  3054. nonzero, the option is enabled. When it is zero, the option is disabled. The 
  3055. SO_LINGER option expects optval to point to a linger structure, as defined in 
  3056. <SYS\SOCKET.H>. This structure is defined in the following example: 
  3057.  
  3058. struct  linger
  3059. {
  3060.         int     l_onoff;                /* option on/off */
  3061.         int     l_linger;               /* linger time */
  3062. };
  3063.  
  3064. The l_onoff field is set to zero if the SO_LINGER option is being disabled. A 
  3065. nonzero value enables the option. The l_linger field specifies the amount of 
  3066. time to linger on close. The units of l_linger are seconds. 
  3067.  
  3068. The following options are recognized at the socket level: 
  3069.  
  3070. Option                 Description 
  3071.  
  3072. SO_BROADCAST           Toggles the ability to broadcast messages. If this 
  3073.                        option is enabled, it allows the application to send 
  3074.                        broadcast messages over s, if the interface specified in 
  3075.                        the destination supports broadcasting of packets. This 
  3076.                        option has no meaning for stream sockets. 
  3077.  
  3078. SO_DONTROUTE           Toggles the routing bypass for outgoing messages. When 
  3079.                        this option is enabled, it causes outgoing messages to 
  3080.                        bypass the standard routing algorithm and be directed to 
  3081.                        the appropriate network interface according to the 
  3082.                        network portion of the destination address. When 
  3083.                        enabled, packets can be sent only to directly connected 
  3084.                        networks (networks for which this host has an 
  3085.                        interface). This option has no meaning for stream 
  3086.                        sockets. 
  3087.  
  3088. SO_KEEPALIVE           Toggles keep connection alive. TCP uses a timer called 
  3089.                        the keepalive timer. This timer is used to monitor idle 
  3090.                        connections that might have been disconnected because of 
  3091.                        a peer crash or timeout. If this option is toggled, a 
  3092.                        keepalive packet is periodically sent to the peer. This 
  3093.                        is used mainly to allow servers to close connections 
  3094.                        that have already disappeared as a result of clients 
  3095.                        going away without closing connections. This option only 
  3096.                        has meaning for stream sockets. 
  3097.  
  3098. SO_LINGER              Lingers on close if data is present. When this option is 
  3099.                        enabled and there is unsent data present when soclose() 
  3100.                        is called, the calling application is blocked during the 
  3101.                        soclose() call until the data is transmitted or the 
  3102.                        connection has timed out. If this option is disabled, 
  3103.                        INET waits to try to send the data. Although the data 
  3104.                        transfer is usually successful, it cannot be guaranteed, 
  3105.                        because INET waits only a finite amount of time trying 
  3106.                        to send the data. The soclose() call returns without 
  3107.                        blocking the caller. This option has meaning only for 
  3108.                        stream sockets. 
  3109.  
  3110. SO_OOBINLINE           Toggles the reception of out-of-band data. When this 
  3111.                        option is enabled, it causes out-of-band data to be 
  3112.                        placed in the normal data input queue as it is received, 
  3113.                        making it available to recv(), and recvfrom(), without 
  3114.                        having to specify the MSG_OOB flag in those calls. When 
  3115.                        this option is disabled, it causes out-of-band data to 
  3116.                        be placed in the priority data input queue as it is 
  3117.                        received, making it available to recv(), and recvfrom(), 
  3118.                        only by specifying the MSG_OOB flag in those calls. This 
  3119.                        option has meaning only for stream sockets. 
  3120.  
  3121. SO_DEBUG               Toggles recording or debugging information. 
  3122.  
  3123. SO_RCVBUF              Sets buffer size for input. This option sets the size of 
  3124.                        the receive buffer to the value contained in the buffer 
  3125.                        pointed to by optval. This allows the buffer size to be 
  3126.                        tailored for specific application needs, such as 
  3127.                        increasing the buffer size high-volume connections. 
  3128.  
  3129. SO_RCVLOWAT            Sets receive low-water mark. 
  3130.  
  3131. SO_RCVTIMEO            Sets receive timeout. 
  3132.  
  3133. SO_REUSEADDR           Toggles local address reuse. When enabled, this option 
  3134.                        allows local addresses that are already in use to be 
  3135.                        bound. This alters the normal algorithm used in the 
  3136.                        bind() call. The system checks at connect time to be 
  3137.                        sure that no local address and port have the same 
  3138.                        foreign address and port. The error EADDRINUSE is 
  3139.                        returned if the association already exists. 
  3140.  
  3141. SO_SNDBUF              Sets buffer size for output. This option sets the size 
  3142.                        of the send buffer to the value contained in the buffer 
  3143.                        pointed to by optval.  This allows the send buffer size 
  3144.                        to be tailored for specific application needs, such as 
  3145.                        increasing the buffer size for high-volume connections. 
  3146.  
  3147. SO_SNDLOWAT            Sets send low-water mark. 
  3148.  
  3149. SO_SNDTIMEO            Sets send timeout. 
  3150.  
  3151. SO_USELOOPBACK         Bypasses when possible. 
  3152.  
  3153. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  3154. indicates an error. Specified error values are obtained by calling sock_errno() 
  3155. or psock_errno(). 
  3156.  
  3157.    Errno Value           Description 
  3158.  
  3159.    SOCEADDRINUSE         The address is already in use. 
  3160.  
  3161.    SOCENOTSOCK           The s parameter is not a valid socket descriptor. 
  3162.  
  3163.    SOCEFAULT             Using optval and optlen parameters would result in an 
  3164.                          attempt to access memory outside the caller's address 
  3165.                          space. 
  3166.  
  3167.    SOCENOPROTOOPT        The optname parameter is unrecognized, or the level 
  3168.                          parameter is not SOL_SOCKET. 
  3169.  
  3170.    SOCEINVAL             Invalid argument. 
  3171.  
  3172.    SOCENOBUFS            No buffer space is available. 
  3173.  
  3174. Examples:  The following are examples of the setsockopt() call. See 
  3175. getsockopt() for examples of how the getsockopt() options set are queried. 
  3176.  
  3177. int rc;
  3178. int s;
  3179. int optval;
  3180. struct linger l;
  3181. int setsockopt(int s, int level, int optname, char *optval, int optlen)
  3182. .
  3183. .
  3184. .
  3185. /* I want out of band data in the normal input queue */
  3186. optval = 1;
  3187. rc = setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *) &optval, sizeof(int));
  3188.  
  3189. .
  3190. .
  3191. .
  3192. /* I want to linger on close */
  3193. l.l_onoff  = 1;
  3194. l.l_linger = 100;
  3195. rc = setsockopt(s, SOL_SOCKET, SO_LINGER, (char *) &l, sizeof(l));
  3196.  
  3197. See Also:  getprotobyname(), getsockopt(), ioctl(), and socket(). 
  3198.  
  3199.  
  3200. ΓòÉΓòÉΓòÉ 5.4.19. shutdown() ΓòÉΓòÉΓòÉ
  3201.  
  3202. int shutdown(s, how)
  3203. int s;
  3204. int how;
  3205.  
  3206. Parameter       Description 
  3207.  
  3208. s               The socket descriptor. 
  3209.  
  3210. how             The condition of the shutdown. The values 0, 1, or 2 set the 
  3211.                 condition. 
  3212.  
  3213. Description:  The shutdown() call shuts down all or part of a duplex 
  3214. connection. how sets the condition for shutting down the connection to socket 
  3215. s. 
  3216.  
  3217. how can have a value of 0, 1, or 2, where: 
  3218.  
  3219. o 0 ends communication from socket s. 
  3220. o 1 ends communication to socket s. 
  3221. o 2 ends communication both to and from socket s. 
  3222.  
  3223. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  3224. indicates an error. Specified error values are obtained by calling sock_errno() 
  3225. or psock_errno(). 
  3226.  
  3227.    Errno Value        Description 
  3228.  
  3229.    SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  3230.  
  3231.    SOCEINVAL          The how parameter was not set to one of the valid values. 
  3232.                       Valid values are 0, 1, and 2. 
  3233.  
  3234. See Also:  accept(), connect(), socket(), and soclose(). 
  3235.  
  3236.  
  3237. ΓòÉΓòÉΓòÉ 5.4.20. sock_errno() ΓòÉΓòÉΓòÉ
  3238.  
  3239. #include <nerrno.h>
  3240.  
  3241.  
  3242. init sock_errno(s)
  3243.  
  3244. Description:  The sock_errno() call returns the error code set by Socket calls. 
  3245.  
  3246. See Also:  psock_errno(). 
  3247.  
  3248.  
  3249. ΓòÉΓòÉΓòÉ 5.4.21. sock_init() ΓòÉΓòÉΓòÉ
  3250.  
  3251. int sock_init()
  3252.  
  3253. Description:  There are no parameters associated with this call. The 
  3254. sock_init() call initializes the socket data structures and checks whether 
  3255. INET.SYS is running. Therefore, sock_init() should be called at the beginning 
  3256. of each program that uses socket(). 
  3257.  
  3258. Return Value:  The value 0 indicates success; the value 1 indicates an error. 
  3259.  
  3260.  
  3261. ΓòÉΓòÉΓòÉ 5.4.22. socket() ΓòÉΓòÉΓòÉ
  3262.  
  3263. #include <types.h>
  3264. #include <sys\socket.h>
  3265.  
  3266. int socket(domain, type, protocol)
  3267. int domain;
  3268. int type;
  3269. int protocol;
  3270.  
  3271. Parameter      Description 
  3272.  
  3273. domain         The address domain requested.  Either AF_INET, AF_OS2, or AF_NU. 
  3274.  
  3275. type           The type of socket created, either SOCK_STREAM, SOCK_DGRAM, 
  3276.                SOCK_RAW, or SOCK_SEQPACKET. 
  3277.  
  3278. protocol       The protocol requested. Some possible values are 0, IPPROTO_UDP, 
  3279.                IPPROTO_TCP, or IPPROTO_NB. 
  3280. Description:  The socket() call creates an endpoint for communication and 
  3281. returns a socket descriptor representing the endpoint. Different types of 
  3282. sockets provide different communication services. 
  3283.  
  3284. The domain parameter specifies a communication domain where communication is to 
  3285. take place. This parameter selects the address family (format of addresses 
  3286. within a domain) that is used. 
  3287.  
  3288. Address Family        Description 
  3289.  
  3290. AF_OS2 or AF_UNIX     Local IPC domain using OS/2 file/path naming format for 
  3291.                       high performance IPC between applications within the same 
  3292.                       node. 
  3293.  
  3294. AF_INET               INET domain using INET address format. Support of INET 
  3295.                       domain access may be via a locally connected native or 
  3296.                       non-native INET network.  See "Non-Native Networking". 
  3297.  
  3298. AF_NETBIOS or AF_NB   NetBIOS domain using NetBIOS address format. 
  3299.  
  3300. AF_DIRECT             MPTN domain using any address format for local and 
  3301.                       destination name. AF_DIRECT is used primarily by MPTN 
  3302.                       system services for commmunicating with each other over a 
  3303.                       locally connected network independent of the address 
  3304.                       format used. 
  3305.  
  3306. The type parameter specifies the type of socket created. The type is analogous 
  3307. with the semantics of the communication requested. These socket type constants 
  3308. are defined in the <sys\socket.h> header file. The types supported are: 
  3309.  
  3310. Type                Description 
  3311.  
  3312. SOCK_STREAM         Provides sequenced, two-way byte streams that are reliable 
  3313.                     and connection-oriented. They support a mechanism for 
  3314.                     out-of-band data. SOCK_STREAM is supported in AF_OS2 (or 
  3315.                     AF_UN), AF_INET, and AF_DIRECT domain. 
  3316.  
  3317. SOCK_SEQPACKET      Provides sequenced, two-way byte records that are reliable 
  3318.                     and connection-oriented. 
  3319.  
  3320.                     SOCK_SEQPACKET is supported for protocols such as NetBIOS 
  3321.                     and AF_NETBIOS  domains. When NBPROTO protocol is 
  3322.                     specified, a socket application can be used to communicate 
  3323.                     with a remote application using the NetBIOS NCB I/F. 
  3324.                     AF_DIRECT mode does not support SOCK_SEQPACKET. 
  3325.  
  3326. SOCK_DGRAM          Provides datagram, which are connectionless messages of a 
  3327.                     fixed length whose reliability is not guaranteed. Datagram 
  3328.                     can be corrupted, received out of order, lost, or delivered 
  3329.                     multiple times. 
  3330.  
  3331.                     SOCK_DGRAM is supported in AF_OS2(or AF_UNIX), AF_NETBIOS, 
  3332.                     and AF_INET. 
  3333.  
  3334. SOCK_RAW            (AF_INET) Provides the interface to internal protocols 
  3335.                     (such as IP and ICMP). 
  3336.  
  3337. The protocol parameter specifies a particular protocol to be used with the 
  3338. socket.  Only native protocol can be selected for an address family.  In most 
  3339. cases, a single protocol exists to support a particular type of socket in an 
  3340. address family (except for raw sockets or non-native networking support as 
  3341. discussed later).  If the protocol field is set to 0 (default), the system 
  3342. selects the default protocol number for the domain and socket type requested. 
  3343. How a protocol is selected is based on whether MPTN has been configured. When 
  3344. MPTN access is not configured, the protocol default is the same as BSD; that 
  3345. is, only protocols native to the requested domain and type. When MPTN access is 
  3346. configured, the protocol is expanded to include any attached native and 
  3347. non-native protocols/networks capable of supporting MPTN. 
  3348.  
  3349. In TCP/IP, native protocol value is set to IPPROTO_TCP and UDP as defined in 
  3350. the <\ETC\PROTOCOL> file.  Alternatively, the getprotobyname() call can be used 
  3351. to get the protocol number for a protocol with a known name.  However, with 
  3352. MPTN, the default protocol and locally connected native or non-native INET 
  3353. network is selected based on installation configuration. 
  3354.  
  3355. Default protocol is always used for AF_DIRECT mode. TCP/IP selects the protocol 
  3356. that supports DIRECT mode addressing. 
  3357.  
  3358. SOCK_STREAM sockets model duplex byte streams.  They provide reliable 
  3359. flow-controlled connections between peer applications.  Stream sockets are 
  3360. either active or passive.  Active sockets are used by clients who initiate 
  3361. connection requests with connect().  By default, socket() creates active 
  3362. sockets.  Passive sockets are used by servers to accept connection requests 
  3363. with the connect() call.  An active socket is transformed into a passive socket 
  3364. by binding a name to the socket with the bind() call and by indicating a 
  3365. willingness to accept connections with the listen() call.  After a socket 
  3366. becomes passive, it cannot be used to initiate connection requests. 
  3367.  
  3368. Wildcard Address:  From the AF_INET domain, the bind() call applied to a stream 
  3369. socket lets the application specify the networks it is willing to accept 
  3370. connection requests from. The application can fully specify the network 
  3371. interface by setting the internet address field in the address structure to the 
  3372. internet address of a network interface in a locally connected INET network. 
  3373. Alternatively, the application can use a wildcard to specify that it wants to 
  3374. receive connection requests from any locally connected INET networks.  This is 
  3375. done by setting the internet address field in the address structure to the 
  3376. constant INADDR_ANY as defined in <sys\socket.h>.  When INADDR_ANY is used, the 
  3377. INET_ADDR for each of the INET networks will be used. 
  3378.  
  3379. Similarly, in other domains(AF_OS2 and AF_NETBIOS), wildcard address is also 
  3380. supported. The wildcard address is specified in the corresponding include files 
  3381. <sys\un.h, netnb\nb.h>. 
  3382.  
  3383. Wildcard address is supported for the AF_DIRECT user. However, the bind() call 
  3384. must be used to specify the address family type. 
  3385.  
  3386. Non-Native Networking:  In the MPTN environment, non-native networking is the 
  3387. ability to provide networking services of one domain type to applications using 
  3388. a transport API (socket library in this case) over other locally connected 
  3389. network and protocol types. The domain used by the application is the 
  3390. non-native network, while the locally connected network actually providing the 
  3391. services is called the native network. 
  3392.  
  3393. The TCP/IP provides the necessary address/name mapping and protocol 
  3394. compensation services to support the semantics of the non-native network over 
  3395. the selected native network.  Currently, only TCP/IP over NetBIOS is supported. 
  3396.  
  3397. Non-Native INET (AF_INET) Networking over the NetBIOS LAN Network:  This 
  3398. capability allows an application to use INET addressing across a native NetBIOS 
  3399. LAN network. 
  3400.  
  3401. Non-native networking requires the TCP/IP to map non-native network addresses 
  3402. supplied by the socket application to native network addresses. Address mapping 
  3403. is either provided by an MPTN network level directory called A-B mapper or done 
  3404. locally using algorithmic mapping. Algorithmic mapping for INET domain uses the 
  3405. 4-byte IP address to map to a protocol-specific address.  The protocol-specific 
  3406. address generated is used to service all INET non-native networking connection 
  3407. requests for that non-native INET network. Each non-native connection request 
  3408. results in a separate native network connection created using this 
  3409. protocol-specific address.  INET port ID is used for local routing to the 
  3410. individual application within the node.  The non-native local and destination 
  3411. addresses are sent as part of the MPTN connect header information to be used 
  3412. for routing to the remote partner application. 
  3413.  
  3414. In NetBIOS LAN, the NetBIOS name mapped from INET address is of the form: 
  3415.  
  3416.  
  3417.   Byte:       1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
  3418. NETBIOS name "M P T N . I N . <-- ip addr -->"
  3419.  
  3420.  
  3421.           MPTN.IN. appended with an IP address converted into
  3422.              an 8-byte hexadecimal character string
  3423.  
  3424. Algorithmic mapping for non-native networking over a local socket is done by 
  3425. locating local socket users with matching local and destination address 
  3426. independent of the address family types. 
  3427.  
  3428. To invoke non-native INET networking, the application specifies the protocol 
  3429. value as 0 (when configured for MPTN access). The common MPTN manager searches 
  3430. all the connected networks to locate the destination.  The search order always 
  3431. starts with the search over local domain first, followed by a search of each of 
  3432. the connected networks as defined by the configuration until a path to the 
  3433. destination can be located. 
  3434.  
  3435. If a non-native network is selected for INET, the protocol layer generates a 
  3436. unique protocol-specific address (local and NetBIOS LAN networking) to service 
  3437. the INET non-native networking request. 
  3438.  
  3439. Wildcard addressing is also supported in non-native networking.  When 
  3440. INADDR_ANY is used in INET domain, the INET address is first generated as 
  3441. described in the preceding text.  A corresponding protocol-specific address is 
  3442. generated from this generated INET address. 
  3443.  
  3444. After a connection has been established between stream sockets or sequenced 
  3445. packets, any of the data transfer calls can be used: send(), recv(), read(), 
  3446. writev(), sendto(), recvfrom(), or recvmsg(). Usually, a send-recv pair is used 
  3447. for sending data on stream or sequenced_packet sockets. 
  3448.  
  3449. SOCK_DGRAM sockets model datagrams.  They provide connectionless message 
  3450. exchange with no guarantees on reliability.  Messages sent have a maximum size. 
  3451.  
  3452. There is no active or passive analogy to stream or sequenced_packet socket with 
  3453. datagram sockets.  Servers must still call bind() to name a socket and to 
  3454. specify the network interfaces it wants to receive packets from.  Wildcard 
  3455. addressing, as described for stream sockets, applies for datagram sockets also. 
  3456. Because datagram sockets are connectionless, the listen() call has no meaning 
  3457. for them and must not be used with them. 
  3458.  
  3459. After an application has received a datagram socket, it can exchange datagrams 
  3460. using the sendto() and recfrom() calls or the sendmsg() and recvmsg() calls. 
  3461. If the application goes one step further by calling connect() and fully 
  3462. specifying the name of the peer all messages are to be exchanged with, the 
  3463. other data transfer calls, readv(), writev(), send(), and recv(), can also be 
  3464. used. 
  3465.  
  3466. Datagram sockets allow messages to be broadcast to multiple recipients. 
  3467. Setting the destination address to be a broadcast address is network 
  3468. interface-dependent.  Only AF_NETBIOS and AF_INET support the broadcast 
  3469. function.  For INET, broadcast function is dependent on the class of address 
  3470. and whether subnets are being used.  The constant INADDR_BROADCAST, defined in 
  3471. <sys\socket.h>, can be used to broadcast to the primary network if the primary 
  3472. network configured supports broadcast.  For AF_NETBIOS, the address format has 
  3473. a type field that specifies whether the address is individual, multicast, or 
  3474. broadcast address. 
  3475.  
  3476. SOCK_RAW sockets gives the application an interface to lower-layer protocols 
  3477. such as IP and ICMP.  This interface is often used to bypass the transport 
  3478. layer when direct access to lower layer protocols is needed.  Raw sockets are 
  3479. also used to test new protocols. 
  3480.  
  3481. Raw sockets are connectionless and data transfer semantics are the same as 
  3482. those described previously for datagram sockets.  The connect() call can be 
  3483. used similarly to specify the peer. 
  3484.  
  3485. Outgoing packets have an IP header prefixed to them.  IP options can be set and 
  3486. inspected using the setsockopt() and getsockopt() calls respectively.  Incoming 
  3487. packets are received with the IP header and options intact. 
  3488.  
  3489. Sockets are deallocated with the soclose() call. 
  3490.  
  3491. Return Value and Errno Values:  A non-negative socket descriptor indicates 
  3492. success.  The value -1 indicates an error. Specified error values are obtained 
  3493. by calling sock_errno() or psock_errno(). 
  3494.  
  3495.    Errno Value                   Description 
  3496.  
  3497.    SOCEPROTONOSUPPORT            The protocol is not supported in this domain 
  3498.                                  or this protocol is not supported for this 
  3499.                                  socket type. 
  3500.  
  3501.    SOCEPROTOTYPE                 The protocol is the wrong type for the socket. 
  3502.  
  3503. Examples:  The following are examples of the socket() call. 
  3504.  
  3505. int s;
  3506. struct protoent *p;
  3507. struct protoent *getprotobyname(char *name);
  3508. int socket(int domain, int type, int protocol);
  3509. .
  3510. .
  3511. .
  3512. /* Get stream socket in internet domain with default protocol */
  3513. s = socket(AF_INET, SOCK_STREAM, 0);
  3514. .
  3515. .
  3516. .
  3517. /* Get raw socket in internet domain for ICMP protocol */
  3518. p = getprotobyname("icmp");
  3519. s = socket(AF_INET, SOCK_RAW, p->p_proto);
  3520.  
  3521. See Also:  accept(), bind(), connect(), getprotobyname(), getsockname(), 
  3522. getsockopt(), ioctl(), readv(), recv(), recvfrom(), select(), send(), sendto(), 
  3523. shutdown(), soclose(), and writev(). 
  3524.  
  3525.  
  3526. ΓòÉΓòÉΓòÉ 5.4.23. soclose() ΓòÉΓòÉΓòÉ
  3527.  
  3528. #include <types.h>
  3529. #include <sys\socket.h>
  3530.  
  3531. int soclose(s)
  3532. int s;
  3533.  
  3534. Parameter      Description 
  3535.  
  3536. s              The descriptor of the socket to discard 
  3537. Description:  The soclose() call shuts down the socket associated with the 
  3538. socket descriptor s, and frees resources allocated to the socket.  If s refers 
  3539. to an open TCP connection, the connection is closed. 
  3540.  
  3541. Return Value and Errno Values:  The value 0 indicates success; the value -1 
  3542. indicates an error. Specified error values are obtained by calling sock_errno() 
  3543. or psock_errno(). 
  3544.  
  3545.    Errno Value        Description 
  3546.  
  3547.    SOCENOTSOCK        The s parameter is not a valid socket descriptor. 
  3548.  
  3549.    SOCEALREADY        The socket s is marked nonblocking, and a previous 
  3550.                       connection attempt has not completed. 
  3551.  
  3552.    SOCENOTCONN        The socket is not connected. 
  3553.  
  3554. See Also:  accept() and socket(). 
  3555.  
  3556.  
  3557. ΓòÉΓòÉΓòÉ 5.4.24. writev() ΓòÉΓòÉΓòÉ
  3558.  
  3559. #include <types.h>
  3560. #include <sys\socket.h>
  3561.  
  3562. int writev(s, iov, iovcnt)
  3563. int s;
  3564. struc iovec *iov;
  3565. int iovcnt;
  3566.  
  3567. Parameter      Description 
  3568.  
  3569. s              The socket descriptor 
  3570.  
  3571. iov            A pointer to an array of iovec buffers 
  3572.  
  3573. iovcnt         The number of buffers pointed to by the iov parameter 
  3574. Description:  The writev() call writes data on a socket with descriptor s. The 
  3575. data is gathered from the buffers specified by iov╨¥0Γöÿ...iov╨¥iovcnt-1Γöÿ. The 
  3576. iovec structure is defined in SYS\SOCKET.H and contains the following fields: 
  3577.  
  3578. Parameter      Description 
  3579.  
  3580. iov_base       Pointer to the buffer. 
  3581.  
  3582. iov_len        Length of the buffer. 
  3583. The writev() call applies only to connected sockets. 
  3584.  
  3585. This call writes iov_len bytes of data. If there is not enough available buffer 
  3586. space to hold the socket data to be transmitted and the socket is in blocking 
  3587. mode, writev() blocks the caller until additional buffer space becomes 
  3588. available. If the socket is in a nonblocking mode, writev() returns -1 and sets 
  3589. return code to SOCWOULDBLOCK. See ioctl() for a description of how to set 
  3590. nonblocking mode. 
  3591.  
  3592. For datagram sockets, this call sends the entire datagram, provided the 
  3593. datagram fits into the TCPIP buffers.  Stream sockets act like streams of 
  3594. information with no boundaries separating data.  For example, if an application 
  3595. sends 1000 bytes, each call to this function can send 1 byte, 10 bytes, or the 
  3596. entire 1000 bytes. Therefore, applications using stream sockets must place this 
  3597. call in a loop, calling this function until all data has been sent. 
  3598.  
  3599. Return Value and Errno Values:  If successful, the number of bytes written from 
  3600. the buffer (s) is returned. The value -1 indicates an error. Specified error 
  3601. values are obtained by calling sock_errno() or psock_errno(). 
  3602.  
  3603.    Errno Value             Description 
  3604.  
  3605.    SOCENOTSOCK             s is not a valid socket descriptor. 
  3606.  
  3607.    SOCEFAULT               Using the iov and iovcnt parameters results in an 
  3608.                            attempt to access memory outside the caller's 
  3609.                            address space. 
  3610.  
  3611.    SOCEINVAL               Invalid argument. 
  3612.  
  3613.    SOCENOBUFS              Buffer space is not available to send the message. 
  3614.  
  3615.    SOCEWOULDBLOCK          s is in nonblocking mode and data is not available 
  3616.                            to read. 
  3617.  
  3618.    SOCEMSGSIZE             The message was too big to be sent as a single 
  3619.                            datagram. The default and maximum is 8192. 
  3620.  
  3621.    SOCEDESTADDRREQ         A destination address is required. 
  3622.  
  3623. See Also:  connect(), fcntl(), getsockopt(), ioctl(), write(), read(), readv(), 
  3624. recv(), recvmsg(), recvfrom(), select(), selectex(), send(), sendmsg(), 
  3625. sendto(), setsockopt(), socket(), and write(). 
  3626.  
  3627.  
  3628. ΓòÉΓòÉΓòÉ 5.5. Protocol-Dependent Socket Calls ΓòÉΓòÉΓòÉ
  3629.  
  3630. This section describes the protocol-dependent socket calls. 
  3631.  
  3632.  
  3633. ΓòÉΓòÉΓòÉ 5.5.1. bswap() ΓòÉΓòÉΓòÉ
  3634.  
  3635. #include <types.h>
  3636. #include <utils.h>
  3637.  
  3638. u_short bswap(a)
  3639. u_short a;
  3640.  
  3641. Parameter      Description 
  3642.  
  3643. a              The unsigned short integer whose bytes are to be swapped 
  3644.  
  3645. Description:  The bswap() call swaps bytes in a short integer. 
  3646.  
  3647. Return Value:  Returns the translated short integer. 
  3648.  
  3649. See Also:  htonl(), htons(), lswap(), ntohl(), and ntohs(). 
  3650.  
  3651.  
  3652. ΓòÉΓòÉΓòÉ 5.5.2. dn_comp() ΓòÉΓòÉΓòÉ
  3653.  
  3654. The dn_comp() call compresses the expanded domain name. 
  3655.  
  3656. #include <types.h>
  3657. #include <netinet\in.h>
  3658. #include <arpa\nameser.h>
  3659. #include <resolv.h>
  3660.  
  3661. int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
  3662. u_char *exp_dn;
  3663. u_char *comp_dn;
  3664. int length;
  3665. u_char **dnptrs;
  3666. u_char **lastdnptr;
  3667.  
  3668. Parameter      Description 
  3669.  
  3670. exp_dn         Pointer to the location of an expanded domain name 
  3671.  
  3672. comp_dn        Pointer to an array containing the compressed domain name 
  3673.  
  3674. length         Length in bytes of the array pointed to by the comp_dn parameter 
  3675.  
  3676. dnptrs         List of pointers to previously compressed names in the current 
  3677.                message 
  3678.  
  3679. lastdnptr      Pointer to the end of the array pointed to by dnptrs 
  3680.  
  3681. Description:  The dn_comp() call compresses the domain name pointed to by the 
  3682. exp_dn parameter and stores it in the area pointed to by the comp_dn parameter. 
  3683. It uses the global _res structure, which is defined in the <RESOLV.H> header 
  3684. file. 
  3685.  
  3686. Return Value:  When successful, the dn_comp()  call returns the size of the 
  3687. compressed domain name. See also  dn_expand(), res_init(), des_mkquery(), and 
  3688. res_send(). If it fails, the call returns a value of -1. 
  3689.  
  3690. See Also:  htonl(), htons(), lswap(), ntohl(), and ntohs(). 
  3691.  
  3692.  
  3693. ΓòÉΓòÉΓòÉ 5.5.3. dn_expand() ΓòÉΓòÉΓòÉ
  3694.  
  3695. The dn_expand() call expands a compressed domain name to a full domain name. 
  3696.  
  3697. #include <types.h>
  3698. #include <netinet\in.h>
  3699. #include <arpa\nameser.h>
  3700. #include <resolv.h>
  3701.  
  3702. int dn_expand(msg, eomorig, comp_dn, exp_dn, length)
  3703. u_char *msg;
  3704. u_char *eomorig;
  3705. u_char *comp_dn;
  3706. u_char *exp_dn;
  3707. int length;
  3708.  
  3709. Parameter      Description 
  3710.  
  3711. msg            Pointer to the beginning of a message 
  3712.  
  3713. eomorig        Pointer to the end of the original message that contains the 
  3714.                compressed domain name 
  3715.  
  3716. comp_dn        Pointer to the compressed domain name 
  3717.  
  3718. exp_dn         Pointer to a buffer that holds the resulting expanded domain 
  3719.                name 
  3720.  
  3721. length         Length in bytes of the buffer pointed to by the exp_dn parameter 
  3722.  
  3723. Description  The dn_expand() call expands a compressed domain name to a full 
  3724. domain name, converting the expanded name to all uppercase letters. It uses the 
  3725. global _res structure, which is defined in the <RESOLV.H> header file. 
  3726.  
  3727. Return Value:  If it succeeds, the dn_expand() call returns the size of the 
  3728. expanded domain name. If it fails, the call returns a value of -1. 
  3729.  
  3730. See Also:  dn_comp(), res_init(), res_mkquery(), and res_send(). 
  3731.  
  3732.  
  3733. ΓòÉΓòÉΓòÉ 5.5.4. endhostent() ΓòÉΓòÉΓòÉ
  3734.  
  3735. The endhostent() call closes the HOSTS file. 
  3736.  
  3737. void endhostent()
  3738.  
  3739. Description: The endhostent() call closes the \ETC\HOSTS file, which contains 
  3740. information about known hosts. 
  3741.  
  3742. See Also:  gethostbyaddr(), gethostbyname(), gethostent(), and sethostent(). 
  3743.  
  3744.  
  3745. ΓòÉΓòÉΓòÉ 5.5.5. endnetent() ΓòÉΓòÉΓòÉ
  3746.  
  3747. The endnetent() call closes the NETWORKS file. 
  3748.  
  3749. void endnetent()
  3750.  
  3751. Description:  The endnetent() call closes the \ETC\NETWORKS file, which 
  3752. contains information about known networks. 
  3753.  
  3754. See Also:  getnetbyaddr(), getnetbyname(), getnetent(), and setnetent(). 
  3755.  
  3756.  
  3757. ΓòÉΓòÉΓòÉ 5.5.6. endprotoent() ΓòÉΓòÉΓòÉ
  3758.  
  3759. The endprotoent() call closes the PROTOCOL file. 
  3760.  
  3761. void endprotoent()
  3762.  
  3763. Description:  The endprotoent() call closes the \ETC\PROTOCOL file, which 
  3764. contains information about known protocols. 
  3765.  
  3766. See Also:  getprotobyname(), getprotobynumber(), getprotoent(), and 
  3767. setprotoent(). 
  3768.  
  3769.  
  3770. ΓòÉΓòÉΓòÉ 5.5.7. endservent() ΓòÉΓòÉΓòÉ
  3771.  
  3772. The endservent() call closes the SERVICES file. 
  3773.  
  3774. void endservent()
  3775.  
  3776. Description:  The endservent() call closes the \ETC\SERVICES file, which 
  3777. contains information about known services. 
  3778.  
  3779. See Also:  getservbyname(), getservbyport(), getservent(), and setservent(). 
  3780.  
  3781.  
  3782. ΓòÉΓòÉΓòÉ 5.5.8. gethostbyaddr() ΓòÉΓòÉΓòÉ
  3783.  
  3784. The gethostbyaddr() call returns information about a host specified by an 
  3785. internet address. 
  3786.  
  3787. #include <netdb.h>
  3788.  
  3789. struct hostent *gethostbyaddr(addr, addrlen, domain)
  3790. char *addr;
  3791. int addrlen;
  3792. int domain;
  3793.  
  3794. Parameter      Description 
  3795.  
  3796. addr           A pointer to a 32-bit internet address in network-byte order 
  3797.  
  3798. addrlen        The size of addr in bytes 
  3799.  
  3800. domain         The address domain supported (AF_INET) 
  3801. Description:  The gethostbyaddr() call resolves the host name through a name 
  3802. server, if one is present. If a name server is not present or cannot resolve 
  3803. the host name, gethostbyaddr() searches the \ETC\HOSTS file in sequence until a 
  3804. matching host address is found or an EOF marker is reached. The gethostbyaddr() 
  3805. call returns a pointer to a hostent structure for the host address specified on 
  3806. the call. 
  3807.  
  3808. The <NETDB.H> header file defines the hostent structure, and contains the 
  3809. following elements: 
  3810.  
  3811. Element        Description 
  3812.  
  3813. h_name         Official name of the host. 
  3814.  
  3815. h_aliases      A zero-terminated array of alternative names for the host. 
  3816.  
  3817. h_addrtype     The type of address being returned; always set to AF_INET. 
  3818.  
  3819. h_length       The length of the address in bytes. 
  3820.  
  3821. h_addr         A pointer to the network address of the host. 
  3822.  
  3823. Return Value and h_errno Values:  The return value points to static data that 
  3824. is overwritten by subsequent calls. A pointer to a hostent structure indicates 
  3825. success. A NULL pointer indicates an error or end-of-file. The value of h_errno 
  3826. indicates the specific error. 
  3827.  
  3828. ┤БББББББББББББББББББББББББББББББББББББББСБББББББББББББББББББСББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  3829. ╨Æ H_ERRNO VALUE             ╨Æ CODE        ╨Æ DESCRIPTION                        ╨Æ
  3830. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3831. ╨Æ HOST_NOT_FOUND             ╨Æ  1         ╨Æ The host specified by the addr parameter is not found.  ╨Æ
  3832. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3833. ╨Æ TRY_AGAIN               ╨Æ  2         ╨Æ The local server does not receive a response from an   ╨Æ
  3834. ╨Æ                    ╨Æ          ╨Æ authorized server.  Try again later.           ╨Æ
  3835. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3836. ╨Æ NO_RECOVERY              ╨Æ  3         ╨Æ This error code indicates an unrecoverable error.     ╨Æ
  3837. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3838. ╨Æ NO_DATA                ╨Æ  4         ╨Æ The requested addr is valid, but does not have an     ╨Æ
  3839. ╨Æ                    ╨Æ          ╨Æ internet address at the name server.           ╨Æ
  3840. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3841. ╨Æ NO_ADDRESS               ╨Æ  4         ╨Æ The requested addr is valid, but does not have an     ╨Æ
  3842. ╨Æ                    ╨Æ          ╨Æ internet address at the name server.           ╨Æ
  3843. БББББББББББББББББББББББББББББББББББББББ╔БББББББББББББББББББ╔ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББД
  3844.  
  3845. See Also:  gethostbyname(). 
  3846.  
  3847.  
  3848. ΓòÉΓòÉΓòÉ 5.5.9. gethostbyname() ΓòÉΓòÉΓòÉ
  3849.  
  3850. #include <netdb.h>
  3851.  
  3852. struct hostent *gethostbyname(name)
  3853. char *name;
  3854.  
  3855. Parameter      Description 
  3856.  
  3857. name           The name of the host being queried 
  3858. Description:  The gethostbyname() call resolves the host name through a name 
  3859. server, if one is present. If a name server is not present or is unable to 
  3860. resolve the host name, gethostbyname() searches the \ETC\HOSTS file in sequence 
  3861. until a matching host name is found or an EOF marker is reached. The 
  3862. gethostbyname() call returns a pointer to a hostent structure for the host name 
  3863. specified on the call. 
  3864.  
  3865. The <NETDB.H> header file defines the hostent structure and contains the 
  3866. following elements: 
  3867.  
  3868. Element        Description 
  3869.  
  3870. h_name         Official name of the host. 
  3871.  
  3872. h_aliases      A zero-terminated array of alternative names for the host. 
  3873.  
  3874. h_addrtype     The type of address being returned; always set to AF_INET. 
  3875.  
  3876. h_length       The length of the address in bytes. 
  3877.  
  3878. h_addr         A pointer to the network address of the host. 
  3879.  
  3880. Return Value and h_errno Value:  The return value points to static data that is 
  3881. overwritten by subsequent calls. A pointer to a hostent structure indicates 
  3882. success. A NULL pointer indicates an error or end-of-file. The value of h_errno 
  3883. indicates the specific error. 
  3884.  
  3885. ┤БББББББББББББББББББББББББББББББББББББББСБББББББББББББББББББСББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  3886. ╨Æ H_ERRNO VALUE             ╨Æ CODE        ╨Æ DESCRIPTION                        ╨Æ
  3887. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3888. ╨Æ HOST_NOT_FOUND             ╨Æ  1         ╨Æ The host specified by the name parameter is not found.  ╨Æ
  3889. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3890. ╨Æ TRY_AGAIN               ╨Æ  2         ╨Æ The local server does not receive a response from an   ╨Æ
  3891. ╨Æ                    ╨Æ          ╨Æ authorized server.  Try again later.           ╨Æ
  3892. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3893. ╨Æ NO_RECOVERY              ╨Æ  3         ╨Æ This error code indicates an unrecoverable error.     ╨Æ
  3894. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3895. ╨Æ NO_DATA                ╨Æ  4         ╨Æ The requested name is valid, but does not have an     ╨Æ
  3896. ╨Æ                    ╨Æ          ╨Æ internet address at the name server.           ╨Æ
  3897. ╙БББББББББББББББББББББББББББББББББББББББТБББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  3898. ╨Æ NO_ADDRESS               ╨Æ  4         ╨Æ The requested name is valid, but does not have an     ╨Æ
  3899. ╨Æ                    ╨Æ          ╨Æ internet address at the name server.           ╨Æ
  3900. БББББББББББББББББББББББББББББББББББББББ╔БББББББББББББББББББ╔ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББД
  3901.  
  3902. See Also:  gethostbyaddr(). 
  3903.  
  3904.  
  3905. ΓòÉΓòÉΓòÉ 5.5.10. gethostent() ΓòÉΓòÉΓòÉ
  3906.  
  3907. #include <manifest.h>
  3908. #include <netdb.h>
  3909.  
  3910. struct hostent *gethostent()
  3911. The gethostent() call has no parameters. 
  3912.  
  3913. Description: The gethostent() call returns a pointer to the next entry in the 
  3914. SITEINFO data set or, if you are using BSD-formatted files, the ETC_HOSTS data 
  3915. set. The gethostent() call uses SITEINFO (ETC_HOSTS if you are using 
  3916. BSD-formatted files) to get aliases. 
  3917.  
  3918. The NETDB.H header file defines the hostent structure and contains the 
  3919. following elements: 
  3920.  
  3921. Parameter      Description 
  3922.  
  3923. h_name         The official name of the host. 
  3924.  
  3925. h_aliases      A zero-terminated array of alternative names for host. 
  3926.  
  3927. h_addrtype     The type of address returned; currently, always set to AF_INET. 
  3928.  
  3929. h_length       The length, in bytes, of the address. 
  3930.  
  3931. h_addr         A pointer to the network address of the host. 
  3932.  
  3933. Return Value:  The return value points to static data that is overwritten by 
  3934. subsequent calls. A pointer to a hostent structure indicates success. A NULL 
  3935. pointer indicates an error or end of file. Since gethostent() uses C/370 
  3936. functions, failures are reflected in errno as either a C/370 errno value or 
  3937. EIBMDYNLERR (if an error was encountered while communicating with the 
  3938. sockets-over-SNA address space). 
  3939.  
  3940. See Also:  gethostbyaddr(), gethostbyname(), sethostent(). 
  3941.  
  3942.  
  3943. ΓòÉΓòÉΓòÉ 5.5.11. gethostid() ΓòÉΓòÉΓòÉ
  3944.  
  3945. The gethostid() call returns the unique 32-bit identifier of the current host. 
  3946.  
  3947. #include <types.h>
  3948.  
  3949. u_long gethostid()
  3950.  
  3951. Description:  The gethostid() call gets the unique 32-bit identifier for the 
  3952. current host. 
  3953.  
  3954. Return Value:  The gethostid() call returns the 32-bit identifier, in 
  3955. network-byte order of the current host, which should be unique across all 
  3956. hosts. 
  3957.  
  3958.  
  3959. ΓòÉΓòÉΓòÉ 5.5.12. gethostname() ΓòÉΓòÉΓòÉ
  3960.  
  3961. The gethostname() call returns the standard host name for the local host 
  3962. machine. 
  3963.  
  3964. #include <netdb.h>
  3965.  
  3966. int gethostname(name, namelen)
  3967. char *name;
  3968. int namelen;
  3969.  
  3970. Parameter      Description 
  3971.  
  3972. name           Pointer to a buffer 
  3973.  
  3974. namelen        Length of the buffer 
  3975.  
  3976. Description:  The gethostname() call returns the standard host name for the 
  3977. local host into the buffer specified by the name parameter. The returned name 
  3978. is a null-terminated string. 
  3979.  
  3980. Return Value:  The value 0 indicates success; the value -1 indicates an error. 
  3981.  
  3982. See Also:  gethostbyaddr(), gethostbyname(), and gethostid(). 
  3983.  
  3984.  
  3985. ΓòÉΓòÉΓòÉ 5.5.13. getnetbyaddr() ΓòÉΓòÉΓòÉ
  3986.  
  3987. The getnetbyaddr() call returns the NETWORKS file entry that contains the 
  3988. specified address. 
  3989.  
  3990. #include <netdb.h>
  3991.  
  3992. struct netent *getnetbyaddr(net, type)
  3993. u_long net;
  3994. int type;
  3995.  
  3996. Parameter      Description 
  3997.  
  3998. net            Network address 
  3999.  
  4000. type           Address domain supported (AF_INET) 
  4001.  
  4002. Description:  The getnetbyaddr() call searches the \ETC\NETWORKS file for the 
  4003. specified network address. 
  4004.  
  4005. Return Value:  The return value points to static data that later calls 
  4006. overwrite. A pointer to a netent structure indicates success. A NULL pointer 
  4007. indicates an error or EOF. 
  4008.  
  4009. The netent structure is defined in the <NETDB.H> header file and contains the 
  4010. following elements: 
  4011.  
  4012. Element     Description 
  4013.  
  4014. n_name      Official name of the network. 
  4015.  
  4016. n_aliases   An array, terminated with a NULL pointer, of alternative names for 
  4017.             the network. 
  4018.  
  4019. n_addrtype  Type of network address being returned, always set to AF_INET. 
  4020.  
  4021. n_net       Network number, returned in host-byte order. 
  4022.  
  4023. See Also:  endnetent(), getnetbyname(), getnetent(), and setnetent(). 
  4024.  
  4025.  
  4026. ΓòÉΓòÉΓòÉ 5.5.14. getnetbyname() ΓòÉΓòÉΓòÉ
  4027.  
  4028. The getnetbyname() call returns the NETWORKS file entry that contains the 
  4029. specified name. 
  4030.  
  4031. #include <netdb.h>
  4032.  
  4033. struct netent *getnetbyname(name)
  4034. char *name;
  4035.  
  4036. Parameter      Description 
  4037.  
  4038. name           Pointer to a network name 
  4039.  
  4040. Description:  The getnetbyname() call searches the \ETC\NETWORKS file for the 
  4041. specified network name. 
  4042.  
  4043. Return Value:  The getnetbyname() call returns a pointer to a netent structure 
  4044. for the network name specified on the call. The netent structure is defined in 
  4045. the <NETDB.H> header file; it contains the following elements: 
  4046.  
  4047. Parameter   Description 
  4048.  
  4049. n_name      Official name of the network. 
  4050.  
  4051. n_aliases   Array, terminated with a NULL pointer, of alternative names for the 
  4052.             network. 
  4053.  
  4054. n_addrtype  Type of network address being returned, always set to AF_INET. 
  4055.  
  4056. n_net       Network number, returned in host-byte order. 
  4057.  
  4058. The return value points to static data that later calls overwrite. A pointer to 
  4059. a netent structure indicates success; a NULL pointer indicates an error or EOF. 
  4060.  
  4061. See Also:  endnetent(), getnetbyaddr(), getnetent(), and setnetent(). 
  4062.  
  4063.  
  4064. ΓòÉΓòÉΓòÉ 5.5.15. getnetent() ΓòÉΓòÉΓòÉ
  4065.  
  4066. The getnetent() call returns the next entry in the NETWORKS file. 
  4067.  
  4068. #include <netdb.h>
  4069.  
  4070. struct netent *getnetent()
  4071.  
  4072. Description:  The getnetent() call returns the next entry of the \ETC\NETWORKS 
  4073. file. 
  4074.  
  4075. Return Value:  The getnetent() call returns a pointer to the next entry in the 
  4076. \ETC\NETWORKS file. The return value points to static data that later calls 
  4077. overwrite. 
  4078.  
  4079. A pointer to a netent structure indicates success. A NULL pointer indicates an 
  4080. error or EOF. 
  4081.  
  4082. The netent structure is defined in the <NETDB.H> header file, and it contains 
  4083. the following elements: 
  4084.  
  4085. Element     Description 
  4086.  
  4087. n_name      Official name of the network. 
  4088.  
  4089. n_aliases   Array, terminated with a NULL pointer, of alternative names for the 
  4090.             network. 
  4091.  
  4092. n_addrtype  Type of network address being returned, always set to AF_INET. 
  4093.  
  4094. n_net       Network number, returned in host-byte order. 
  4095.  
  4096. See Also:  endnetent(), getnetbyaddr(), getnetbyname(), and setnetent(). 
  4097.  
  4098.  
  4099. ΓòÉΓòÉΓòÉ 5.5.16. getprotobyname() ΓòÉΓòÉΓòÉ
  4100.  
  4101. The getprotobyname() call returns a protocol entry specified by a name in the 
  4102. PROTOCOL file. 
  4103.  
  4104. #include <netdb.h>
  4105.  
  4106. struct protoent *getprotobyname(name)
  4107. char *name;
  4108.  
  4109. Parameter      Description 
  4110.  
  4111. name           Pointer to the specified protocol 
  4112.  
  4113. Description:  The getprotobyname() call searches the \ETC\PROTOCOL file for the 
  4114. specified protocol name. 
  4115.  
  4116. Return Value:  The getprotobyname() call returns a pointer to a protoent 
  4117. structure for the network protocol specified on the call. The protoent 
  4118. structure is defined in the <NETDB.H> header file and contains the following 
  4119. elements: 
  4120.  
  4121. Element     Description 
  4122.  
  4123. p_name      Official name of the protocol. 
  4124.  
  4125. p_aliases   Array, terminated with a NULL pointer, of alternative names for the 
  4126.             protocol. 
  4127.  
  4128. p_proto     Protocol number. 
  4129.  
  4130. The return value points to static data that later calls overwrite. A pointer to 
  4131. a protoent structure indicates success. A NULL pointer indicates an error or 
  4132. EOF. 
  4133.  
  4134. See Also:  endprotoent(), getprotobynumber(), getprotoent(), and setprotoent(). 
  4135.  
  4136.  
  4137. ΓòÉΓòÉΓòÉ 5.5.17. getprotobynumber() ΓòÉΓòÉΓòÉ
  4138.  
  4139. The getprotobynumber() call returns a protocol entry specified by a number in 
  4140. the PROTOCOL file. 
  4141.  
  4142. #include <netdb.h>
  4143.  
  4144. struct protoent * getprotobynumber(proto)
  4145. int proto;
  4146.  
  4147. Parameter      Description 
  4148.  
  4149. proto          Protocol number 
  4150.  
  4151. Description:  The getprotobynumber() call searches the \ETC\PROTOCOL file for 
  4152. the specified protocol number. 
  4153.  
  4154. Return Value:  The getprotobynumber() call returns a pointer to a protoent 
  4155. structure for the network protocol specified on the call.  The protoent 
  4156. structure is defined in the <NETDB.H> header file and contains the following 
  4157. elements: 
  4158.  
  4159. Element     Description 
  4160.  
  4161. p_name      Official name of the protocol. 
  4162.  
  4163. p_aliases   Array, terminated with a NULL pointer, of alternative names for the 
  4164.             protocol. 
  4165.  
  4166. p_proto     Protocol number. 
  4167.  
  4168. The return value points to static data that later calls overwrite. A pointer to 
  4169. a protoent structure indicates success. A NULL pointer indicates an error or 
  4170. EOF. 
  4171.  
  4172. See Also:, endprotoent(), getprotobyname(), getprotoent(), and setprotoent(). 
  4173.  
  4174.  
  4175. ΓòÉΓòÉΓòÉ 5.5.18. getprotoent() ΓòÉΓòÉΓòÉ
  4176.  
  4177. The getprotoent() call returns the next entry in the PROTOCOL file. 
  4178.  
  4179. #include <netdb.h>
  4180.  
  4181. struct protoent *getprotoent()
  4182.  
  4183. Description:  The getprotoent() call searches for the next line in the 
  4184. \ETC\PROTOCOL file. 
  4185.  
  4186. Return Value:  The getprotoent() call returns a pointer to the next entry in 
  4187. the file, \ETC\PROTOCOL. 
  4188.  
  4189. The protoent structure is defined in the <NETDB.H> header file and contains the 
  4190. following elements: 
  4191.  
  4192. Element     Description 
  4193.  
  4194. p_name      Official name of the protocol. 
  4195.  
  4196. p_aliases   Array, terminated with a NULL pointer, of alternative names for the 
  4197.             protocol. 
  4198.  
  4199. p_proto     Protocol number. 
  4200.  
  4201. The return value points to static data that later calls overwrite. A pointer to 
  4202. a protoent structure indicates success. A NULL pointer indicates an error or 
  4203. EOF. 
  4204.  
  4205. See Also:  endprotoent(), getprotobyname(), getprotobynumber(), and 
  4206. setprotoent(). 
  4207.  
  4208.  
  4209. ΓòÉΓòÉΓòÉ 5.5.19. getservbyname() ΓòÉΓòÉΓòÉ
  4210.  
  4211. The getservbyname() call returns a service entry specified by a name in the 
  4212. SERVICES file. 
  4213.  
  4214. #include <netdb.h>
  4215.  
  4216. struct servent *getservbyname(name, proto)
  4217. char *name;
  4218. char *proto;
  4219.  
  4220. Parameter      Description 
  4221.  
  4222. name           Pointer to the service name 
  4223.  
  4224. proto          Pointer to the specified protocol 
  4225.  
  4226. Description:  The getservbyname() call searches the \ETC\SERVICES file for the 
  4227. specified service name, which must match the protocol if a protocol is stated. 
  4228.  
  4229. Return Value:  The call returns a pointer to a servent structure for the 
  4230. network service specified on the call. The servent structure is defined in the 
  4231. <NETDB.H> header file and contains the following elements: 
  4232.  
  4233. Element     Description 
  4234.  
  4235. s_name      Official name of the service. 
  4236.  
  4237. s_aliases   Array, terminated with a NULL pointer, of alternative names for the 
  4238.             service. 
  4239.  
  4240. s_port      Port number of the service. 
  4241.  
  4242. s_proto     Required protocol to contact the service. 
  4243.  
  4244. The return value points to static data that later calls overwrite. A pointer to 
  4245. a servent structure indicates success. A NULL pointer indicates an error or 
  4246. EOF. 
  4247.  
  4248. See Also:  endservent(), getservbyport(), getservent(), and setservent(). 
  4249.  
  4250.  
  4251. ΓòÉΓòÉΓòÉ 5.5.20. getservbyport() ΓòÉΓòÉΓòÉ
  4252.  
  4253. The getservbyport() call returns a service entry specified by a port number in 
  4254. the SERVICES file. 
  4255.  
  4256. #include <netdb.h>
  4257.  
  4258. struct servent *getservbyport(port, proto)
  4259. int port;
  4260. char *proto;
  4261.  
  4262. Parameter      Description 
  4263.  
  4264. port           Specified port 
  4265.  
  4266. proto          Pointer to the specified protocol 
  4267.  
  4268. Description:  The getservbyport() call sequentially searches the \ETC\SERVICES 
  4269. file for the specified port number, which must match the protocol if a protocol 
  4270. is stated. 
  4271.  
  4272. Return Value:  The getservbyport() call returns a pointer to a servent 
  4273. structure for the port number specified on the call. The servent structure is 
  4274. defined in the <NETDB.H> header file and contains the following elements: 
  4275.  
  4276. Element     Description 
  4277.  
  4278. s_name      Official name of the service. 
  4279.  
  4280. s_aliases   Array, terminated with a NULL pointer, of alternative names for the 
  4281.             service. 
  4282.  
  4283. s_port      Port number of the service. 
  4284.  
  4285. s_proto     Required protocol to contact the service. 
  4286.  
  4287. The return value points to static data that later calls overwrite. A pointer to 
  4288. a servent structure indicates success. A NULL pointer indicates an error or 
  4289. EOF. 
  4290.  
  4291. See Also:  endservent(), getservbyname(), getservent(), and setservent(). 
  4292.  
  4293.  
  4294. ΓòÉΓòÉΓòÉ 5.5.21. getservent() ΓòÉΓòÉΓòÉ
  4295.  
  4296. The getservent() call returns the next entry in the SERVICES file. 
  4297.  
  4298. #include <netdb.h>
  4299.  
  4300. struct servent *getservent()
  4301.  
  4302. Description:  The getservent() call searches for the next line in the 
  4303. \ETC\SERVICES file. 
  4304.  
  4305. Return Value:  The getservent() call returns a pointer to the next entry in the 
  4306. \ETC\SERVICES file. The servent structure is defined in the <NETDB.H> header 
  4307. file and contains the following elements: 
  4308.  
  4309. Element     Description 
  4310.  
  4311. s_name      Official name of the service. 
  4312.  
  4313. s_aliases   Array, terminated with a NULL pointer, of alternative names for the 
  4314.             service. 
  4315.  
  4316. s_port      Port number of the service. 
  4317.  
  4318. s_proto     Required protocol to contact the service. 
  4319.  
  4320. The return value points to static data that later calls overwrite. A pointer to 
  4321. a servent structure indicates success. A NULL pointer indicates an error or 
  4322. EOF. 
  4323.  
  4324. See Also:  endservent(), getservbyname(), getservbyport(), and setservent(). 
  4325.  
  4326.  
  4327. ΓòÉΓòÉΓòÉ 5.5.22. htonl() ΓòÉΓòÉΓòÉ
  4328.  
  4329. #include <types.h>
  4330. #include <utils.h>
  4331.  
  4332. u_long htonl(a)
  4333. u_long a;
  4334.  
  4335. Parameter      Description 
  4336.  
  4337. a              The unsigned long integer to be put into network-byte order 
  4338. Description:  The htonl() call translates a long integer from host-byte order 
  4339. to network-byte order. 
  4340.  
  4341. Return Value:  Returns the translated long integer. 
  4342.  
  4343. See Also:  bswap(), htons(), lswap(), ntohl(), ntohs(). 
  4344.  
  4345.  
  4346. ΓòÉΓòÉΓòÉ 5.5.23. htons() ΓòÉΓòÉΓòÉ
  4347.  
  4348. #include <types.h>
  4349. #include <utils.h>
  4350.  
  4351. u_short htons(a)
  4352. u_short a;
  4353.  
  4354. Parameter      Description 
  4355.  
  4356. a              The unsigned short integer to be put into network-byte order 
  4357. Description:  The htons() call translates a short integer from host-byte order 
  4358. to network-byte order. 
  4359.  
  4360. Return Value:  Returns the translated short integer. 
  4361.  
  4362. See Also:  bswap(), htonl(), lswap(), ntohl(), and ntohs(). 
  4363.  
  4364.  
  4365. ΓòÉΓòÉΓòÉ 5.5.24. inet_addr() ΓòÉΓòÉΓòÉ
  4366.  
  4367. The inet_addr() call constructs an internet address from character strings 
  4368. representing numbers expressed in standard dotted-decimal notation. 
  4369.  
  4370. #include <types.h>
  4371.  
  4372. u_long inet_addr(cp)
  4373. char *cp;
  4374.  
  4375. Parameter      Description 
  4376.  
  4377. cp             A character string in standard dotted-decimal notation 
  4378. Description:  The inet_addr() call interprets character strings representing 
  4379. numbers expressed in standard dotted-decimal notation and returns numbers 
  4380. suitable for use as an internet address. 
  4381.  
  4382. Values specified in standard dotted-decimal notation take one of the following 
  4383. forms: 
  4384.  
  4385. a.b.c.d
  4386. a.b.c
  4387. a.b
  4388. a
  4389.  
  4390. When a four-part address is specified, each part is interpreted as a byte of 
  4391. data and assigned, from left to right, to one of the 4 bytes of an internet 
  4392. address. 
  4393.  
  4394. When a three-part address is specified, the last part is interpreted as a 
  4395. 16-bit quantity and placed in the two rightmost bytes of the network address. 
  4396. This makes the three-part address format convenient for specifying Class B 
  4397. network addresses as 128.net.host. 
  4398.  
  4399. When a two-part address is specified, the last part is interpreted as a 24-bit 
  4400. quantity and placed in the three rightmost bytes of the network address. This 
  4401. makes the two-part address format convenient for specifying Class A network 
  4402. addresses as net.host. 
  4403.  
  4404. When a one-part address is specified, the value is stored directly in the 
  4405. network address space without any rearrangement of its bytes. 
  4406.  
  4407. Numbers supplied as address parts in standard dotted-decimal notation can be 
  4408. decimal, hexadecimal, or octal. Numbers are interpreted in C language syntax. A 
  4409. leading 0x implies hexadecimal; a leading 0 implies octal. A number without a 
  4410. leading 0 implies decimal. 
  4411.  
  4412. Return Value:  The internet address is returned in network-byte order. 
  4413.  
  4414. See Also:  inet_lnaof(), inet_makeaddr(), inet_netof(), inet_network(), and 
  4415. inet_ntoa(). 
  4416.  
  4417.  
  4418. ΓòÉΓòÉΓòÉ 5.5.25. inet_lnaof() ΓòÉΓòÉΓòÉ
  4419.  
  4420. The inet_lnaof() call returns the local network portion of an internet address. 
  4421.  
  4422. #include <types.h>
  4423. #include <netinet\in.h>
  4424.  
  4425. u_long inet_lnaof(in)
  4426. struct in_addr in;
  4427.  
  4428. Parameter      Description 
  4429.  
  4430. in             The host internet address 
  4431. Description:  The inet_lnaof() call breaks apart the internet host address and 
  4432. returns the local network address portion. 
  4433.  
  4434. Return Value:  The local network address is returned in host-byte order. 
  4435.  
  4436. See Also:  inet_addr(), inet_makeaddr(), inet_netof(), inet_network(), and 
  4437. inet_ntoa(). 
  4438.  
  4439.  
  4440. ΓòÉΓòÉΓòÉ 5.5.26. inet_makeaddr() ΓòÉΓòÉΓòÉ
  4441.  
  4442. The inet_makeaddr() call constructs an internet address from a network number 
  4443. and a local address. 
  4444.  
  4445. #include <types.h>
  4446. #include <netinet\in.h>
  4447.  
  4448. struct in_addr inet_makeaddr(net, lna)
  4449. u_long net;
  4450. u_long lna;
  4451.  
  4452. Parameter      Description 
  4453.  
  4454. net            The network number 
  4455.  
  4456. lna            The local network address 
  4457. Description:  The inet_makeaddr() call takes a network number and a local 
  4458. network address and constructs an internet address. 
  4459.  
  4460. Return Value:  The internet address is returned in network-byte order. 
  4461.  
  4462. See Also:  inet_addr(), inet_lnaof(), inet_netof(), inet_network(), and 
  4463. inet_ntoa(). 
  4464.  
  4465.  
  4466. ΓòÉΓòÉΓòÉ 5.5.27. inet_netof() ΓòÉΓòÉΓòÉ
  4467.  
  4468. The inet_netof() call returns the network number portion of the internet host 
  4469. address. 
  4470.  
  4471. #include <types.h>
  4472. #include <netinet\in.h>
  4473.  
  4474. u_long inet_netof(in)
  4475. struct in_addr in;
  4476.  
  4477. Parameter      Description 
  4478.  
  4479. in             The internet address in network-byte order 
  4480. Description:  The inet_netof() call breaks apart the internet host address and 
  4481. returns the network number portion. 
  4482.  
  4483. Return Value:  The network number is returned in host-byte order. 
  4484.  
  4485. See Also:  inet_addr(), inet_lnaof(), inet_makeaddr(), inet_network(), and 
  4486. inet_ntoa(). 
  4487.  
  4488.  
  4489. ΓòÉΓòÉΓòÉ 5.5.28. inet_network() ΓòÉΓòÉΓòÉ
  4490.  
  4491. The inet_network() call constructs a network number from caracters strings 
  4492. representing numbers expressed in standard dotted-decimal notation. 
  4493.  
  4494. #include <types.h>
  4495.  
  4496. u_long inet_network(cp)
  4497. char *cp;
  4498.  
  4499. Parameter      Description 
  4500.  
  4501. cp             A character string in standard dotted-decimal notation 
  4502. Description:  The inet_network() call interprets character strings representing 
  4503. numbers expressed in standard dotted-decimal notation and returns numbers 
  4504. suitable for use as a network number. 
  4505.  
  4506. Return Value:  The network number is returned in host-byte order. 
  4507.  
  4508. See Also:  inet_addr(), inet_lnaof(), inet_makeaddr(), inet_netof(), and 
  4509. inet_ntoa(). 
  4510.  
  4511.  
  4512. ΓòÉΓòÉΓòÉ 5.5.29. inet_ntoa() ΓòÉΓòÉΓòÉ
  4513.  
  4514. The inet_ntoa() call returns a pointer to a string in dotted-decimal notation. 
  4515.  
  4516. #include <types.h>
  4517. #include <netinet\in.h>
  4518.  
  4519. char *inet_ntoa(in)
  4520. struct in_addr in;
  4521.  
  4522. Parameter      Description 
  4523.  
  4524. in             The host internet address 
  4525. Description:  The inet_ntoa() call returns a pointer to a string expressed in 
  4526. the dotted-decimal notation. The inet_ntoa() call accepts an internet address 
  4527. expressed as a 32-bit quantity in network-byte order and returns a string 
  4528. expressed in dotted-decimal notation. 
  4529.  
  4530. Return Value:  Returns a pointer to the internet address expressed in 
  4531. dotted-decimal notation. 
  4532.  
  4533. See Also:  inet_addr(), inet_lnaof(), inet_makeaddr(), inet_network(), and 
  4534. inet_ntoa(). 
  4535.  
  4536.  
  4537. ΓòÉΓòÉΓòÉ 5.5.30. lswap() ΓòÉΓòÉΓòÉ
  4538.  
  4539. The lswap() call constructs a network number from character strings 
  4540. representing numbers expressed in standard dotted-decimal notation. 
  4541.  
  4542. #include <types.h>
  4543. #include <utils.h>
  4544.  
  4545. u_long lswap(a)
  4546. u_long a;
  4547.  
  4548. Parameter      Description 
  4549.  
  4550. a              The unsigned long integer whose bytes are to be swapped 
  4551. Description:  The lswap() call swaps bytes in a long integer. 
  4552.  
  4553. Return Value:  Returns the translated long integer. 
  4554.  
  4555. See Also:  bswap(), htonl(), htons(), ntohl(), and ntohs(). 
  4556.  
  4557.  
  4558. ΓòÉΓòÉΓòÉ 5.5.31. ntohl() ΓòÉΓòÉΓòÉ
  4559.  
  4560. The ntohl() call translates a long integer from network-byte order to host-byte 
  4561. order. 
  4562.  
  4563. #include <types.h>
  4564. #include <utils.h>
  4565.  
  4566. u_long ntohl(a)
  4567. u_long a;
  4568.  
  4569. Parameter      Description 
  4570.  
  4571. a              The unsigned long integer to be put into host-byte order 
  4572. Description:  The ntohl() call translates a long integer from network-byte 
  4573. order to host-byte order. 
  4574.  
  4575. Return Value:  Returns the translated long integer. 
  4576.  
  4577. See Also:  bswap(), htonl(), htons(), lswap(), and ntohs(). 
  4578.  
  4579.  
  4580. ΓòÉΓòÉΓòÉ 5.5.32. ntohs() ΓòÉΓòÉΓòÉ
  4581.  
  4582. The ntohs() call translates a short integer from network-byte order to 
  4583. host-byte.order. 
  4584.  
  4585. #include <types.h>
  4586. #include <utils.h>
  4587.  
  4588. u_short ntohs(a)
  4589. u_short a;
  4590.  
  4591. Parameter      Description 
  4592.  
  4593. a              The unsigned short integer to be put into host-byte order 
  4594. Description:  The ntohs() call translates a short integer from network-byte 
  4595. order to host-byte order. 
  4596.  
  4597. Return Value:  The ntohs() call returns the translated short integer. 
  4598.  
  4599. See Also:  bswap(), htonl(), htons(), lswap(), and ntohl(). 
  4600.  
  4601.  
  4602. ΓòÉΓòÉΓòÉ 5.5.33. res_init() ΓòÉΓòÉΓòÉ
  4603.  
  4604. The res_init() call reads the RESOLV file for the default domain name. 
  4605.  
  4606. include <types.h>
  4607. #include <netinet\in.h>
  4608. #include <arpa\nameser.h>
  4609. #include <resolv.h>
  4610.  
  4611. void res_init()
  4612.  
  4613. Description:  The res_init() call reads the TCPIP\ETC\RESOLV file for the 
  4614. default domain name and for the internet address of the initial hosts running 
  4615. the name server. If that file does not exist, the call attempts name resolution 
  4616. using the TCPIP\ETC\HOSTS file. One of these files should be operational. 
  4617.  
  4618. The call stores domain name information in the global _res structure, which is 
  4619. defined in the <RESOLV.H> header file. 
  4620.  
  4621. See Also:  dn_comp(), dn_expand(), res_mkquery(), and res_send(). 
  4622.  
  4623.  
  4624. ΓòÉΓòÉΓòÉ 5.5.34. res_mkquery() ΓòÉΓòÉΓòÉ
  4625.  
  4626. The res_mkquery() call makes a query message for the name servers in the 
  4627. Internet domain. 
  4628.  
  4629. #include <types.h>
  4630. #include <netinet\in.h>
  4631. #include <arpa\nameser.h>
  4632. #include <resolv.h>
  4633.  
  4634. int re_mkquery (op, dname, class, type, data, datalen, newrr,
  4635.                 buf, buflen)
  4636. int op;
  4637. char *dname;
  4638. int class;
  4639. int type;
  4640. char *data;
  4641. int datalen;
  4642. struct rrec *newrr;
  4643. char *buf;
  4644. int buflen;
  4645.  
  4646. Parameter      Description 
  4647.  
  4648. op             The usual type is QUERY, but you can set the parameter to any 
  4649.                query type defined in the <ARPA\NAMESER.H> header file. 
  4650.  
  4651. dname          Pointer to the domain name. If dname points to a single label 
  4652.                and the RES_DEFNAMES bit in the _res structure defined in the 
  4653.                <RESOLV.H> header file is set, the call appends dname to the 
  4654.                current domain name. The current domain name is defined in the 
  4655.                TCPIP\ETC\RESOLV file. 
  4656.  
  4657. class          One of the following values: 
  4658.  
  4659.    C_IN      ARPA Internet 
  4660.    C_CHAOS   Chaos network at MIT 
  4661.  
  4662. type           One of the following type values for resources and queries: 
  4663.  
  4664.    T_A       Host address 
  4665.    T_NS      Authoritative server 
  4666.    T_MD      Mail destination 
  4667.    T_MF      Mail forwarder 
  4668.    T_CNAME   Canonical name 
  4669.    T_SOA     Start of authority zone 
  4670.    T_MB      Mailbox domain name 
  4671.    T_MG      Mail group member 
  4672.    T_MR      Mail rename name 
  4673.    T_NULL    NULL resource record 
  4674.    T_WKS     Well-known service 
  4675.    T_PTR     Domain name pointer 
  4676.    T_HINFO   Host information 
  4677.    T_MINFO   Mailbox information 
  4678.    T_MX      Mail routing information 
  4679.    T_UINFO   User information 
  4680.    T_UID     User ID 
  4681.    T_GID     Group ID 
  4682.  
  4683. data           Pointer to the data sent to the name server as a search key. 
  4684.  
  4685. datalen        Size of the parameter data in bytes. 
  4686.  
  4687. newrr          Reserved for future updates; currently an unused parameter. 
  4688.  
  4689. buf            Pointer to the query message. 
  4690.  
  4691. buflen         Length in bytes of the buffer pointed to by the buf parameter. 
  4692.  
  4693. Description:  The res_mkquery() call makes a query message for the name servers 
  4694. in the Internet domain and puts that query message in the location pointed by 
  4695. the buf parameter. It uses global _res structure, which is defined in the 
  4696. <RESOLV.H> header file. 
  4697.  
  4698. Return Value:  If it succeeds, the res_mkquery() call returns the size of the 
  4699. query.  If the query is larger than the value of buflen, the call fails and 
  4700. returns a value of -1. 
  4701.  
  4702. See Also:  dn_comp(), dn_expand(), res_init(), and res_send(). 
  4703.  
  4704.  
  4705. ΓòÉΓòÉΓòÉ 5.5.35. res_send() ΓòÉΓòÉΓòÉ
  4706.  
  4707. The res_send() call sends a query to a local name server. 
  4708.  
  4709. #include <types.h>
  4710. #include <netinet\in.h>
  4711. #include <arpa\nameser.h>
  4712. #include <resolv.h>
  4713.  
  4714. int re_send(msg, msglen, ans, anslen)
  4715. char *msg;
  4716. int msglen;
  4717. char *ans;
  4718. int anslen;
  4719.  
  4720. Parameter      Description 
  4721.  
  4722. msg            Pointer to the beginning of a message 
  4723.  
  4724. msglen         Length in bytes of the buffer pointed to by the msg parameter 
  4725.  
  4726. ans            Pointer to the location where the received response is stored 
  4727.  
  4728. anslen         Length in bytes of the buffer pointed by the ans parameter 
  4729.  
  4730. Description:  The res_send() call sends a query to the local name server and 
  4731. calls the res_init() call if the RES_INIT option of the global _res structure 
  4732. is not set. It also handles time-outs and retries. It uses the global _res 
  4733. structure, which is defined in the <RESOLV.H> header file. 
  4734.  
  4735. Return Value:  If it succeeds, the call returns the length of the message. If 
  4736. it fails, the call returns a value of -1. 
  4737.  
  4738. See Also:  dn_comp(), dn_expand(), res_init(), and res_mkquery(). 
  4739.  
  4740.  
  4741. ΓòÉΓòÉΓòÉ 5.5.36. sethostent() ΓòÉΓòÉΓòÉ
  4742.  
  4743. The sethostent() call opens and rewinds the HOSTS file. 
  4744.  
  4745. void sethostent(stayopen)
  4746. int stayopen;
  4747.  
  4748. Parameter      Description 
  4749.  
  4750. stayopen       Allows the TCPIP\ETC\HOSTS file to stay open after each call 
  4751.  
  4752. Description:  The sethostent() call opens and rewinds the \ETC\HOSTS file. If 
  4753. the stayopen parameter is nonzero, the \ETC\HOSTS file stays open after each of 
  4754. the gethost calls. 
  4755.  
  4756. Return Value:  A NULL pointer indicates an error or EOF. 
  4757.  
  4758. See Also:  endhostent(), gethostbyaddr(), gethostbyname(), and gethostent(). 
  4759.  
  4760.  
  4761. ΓòÉΓòÉΓòÉ 5.5.37. setnetent() ΓòÉΓòÉΓòÉ
  4762.  
  4763. The setnetent() call opens and rewinds the NETWORKS file. 
  4764.  
  4765. void setnetent(stayopen)
  4766. int stayopen;
  4767.  
  4768. Parameter      Description 
  4769.  
  4770. stayopen       Allows the \ETC\NETWORKS file to stay open after each call 
  4771.  
  4772. Description:  The setnetent() call opens and rewinds the \ETC\NETWORKS file, 
  4773. which contains information about known networks.  If the stayopen parameter is 
  4774. nonzero, the \ETC\NETWORKS file stays open after each of the getnet calls. 
  4775.  
  4776. Return Value:  A NULL pointer indicates an error or EOF. 
  4777.  
  4778. See Also:  endnetent(), getnetbyaddr(), getnetbyname(), and getnetent(). 
  4779.  
  4780.  
  4781. ΓòÉΓòÉΓòÉ 5.5.38. setprotoent() ΓòÉΓòÉΓòÉ
  4782.  
  4783. The setprotoent() call opens and rewinds the PROTOCOL file. 
  4784.  
  4785. void setprotoent(stayopen)
  4786. int stayopen;
  4787.  
  4788. Parameter      Description 
  4789.  
  4790. stayopen       Allows the TCPIP\ETC\PROTOCOL file to stay open after each call 
  4791.  
  4792. Description:  The setprotoent() call opens and rewinds the \ETC\PROTOCOL file, 
  4793. which contains information about known protocols. If the stayopen parameter is 
  4794. nonzero, the TCPIP\ETC\PROTOCOL file stays open after each of the getproto 
  4795. calls. 
  4796.  
  4797. Return Value:  A NULL pointer indicates an error or EOF. 
  4798.  
  4799. See Also:, endprotoent() getprotobyname(), getprotobynumber(), and 
  4800. getprotoent(). 
  4801.  
  4802.  
  4803. ΓòÉΓòÉΓòÉ 5.5.39. setservent() ΓòÉΓòÉΓòÉ
  4804.  
  4805. The setservent() call opens and rewinds the SERVICES file. 
  4806.  
  4807. void setservent(stayopen)
  4808. int stayopen;
  4809.  
  4810. Parameter      Description 
  4811.  
  4812. stayopen       Allows the TCPIP\ETC\SERVICES file to stay open after each call 
  4813.  
  4814. Description:  The setservent() call opens and rewinds the \ETC\SERVICES file, 
  4815. which contains information about known services and well-known ports. If the 
  4816. stayopen parameter is nonzero, the TCPIP\ETC\SERVICES file stays open after 
  4817. each of the getserv calls. 
  4818.  
  4819. Return Value:  A NULL pointer indicates an error or EOF. 
  4820.  
  4821. See Also:, endservent() getservbyname(), getservbyport(), and getservent(). 
  4822.  
  4823.  
  4824. ΓòÉΓòÉΓòÉ 6. Sample Socket Programs ΓòÉΓòÉΓòÉ
  4825.  
  4826. This appendix provides examples of the following C socket programs: 
  4827.  
  4828. o UDP client 
  4829. o UDP server 
  4830. o TCP client 
  4831. o TCP server 
  4832. o NB client 
  4833. o NB server 
  4834.  
  4835.  
  4836. ΓòÉΓòÉΓòÉ 6.1. C Socket UDP Client ΓòÉΓòÉΓòÉ
  4837.  
  4838. The following is an example of a C socket UDP client program: 
  4839.  
  4840. #include <stdlib.h>
  4841. #include <types.h>
  4842. #include <netinet/in.h>
  4843. #include <sys/socket.h>
  4844.  
  4845. main(argc, argv)
  4846. int argc;
  4847. char **argv;
  4848. {
  4849.  
  4850.  
  4851.    int sockint, s;
  4852.    unsigned short port;
  4853.    struct sockaddr_in server;
  4854.    char buf╨¥32Γöÿ;
  4855.  
  4856.    /* argv╨¥1Γöÿ is internet address of server argv╨¥2Γöÿ is port of server.
  4857.     * Convert the port from ascii to integer and then from host byte
  4858.     * order to network byte order.
  4859.     */
  4860.    if(argc != 3)
  4861.    {
  4862.       printf("Usage: %s <host address> <port> \n",argv╨¥0Γöÿ);
  4863.       exit(1);
  4864.    }
  4865.    port = htons(atoi(argv╨¥2Γöÿ));
  4866.  
  4867.    /* Initialize with sockets */
  4868.    if ((sockint = sock_init()!=0)
  4869.       {
  4870.        printf ("INET.SYS probably not running");
  4871.        exit (1);
  4872.    /* Create a datagram socket in the internet domain and use the
  4873.     * default protocol (UDP).
  4874.     */
  4875.    if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
  4876.    {
  4877.        psock_errno("socket()");
  4878.        exit(1);
  4879.    }
  4880.  
  4881.    /* Set up the server name */
  4882.    server.sin_family      = AF_INET;            /* Internet Domain    */
  4883.    server.sin_port        = port;               /* Server Port        */
  4884.    server.sin_addr.s_addr = inet_addr(argv╨¥1Γöÿ);
  4885.                                                 /* Server's Address   */
  4886.  
  4887.    strcpy(buf, "Hello");
  4888.  
  4889.    /* Send the message in buf to the server */
  4890.    if (sendto(s, buf, (strlen(buf)+1), 0, &server, sizeof(server)) < 0)
  4891.    {
  4892.        psock_errno("sendto()");
  4893.        exit(2);
  4894.    }
  4895.  
  4896.    /* Deallocate the socket */
  4897.    soclose(s);
  4898. }
  4899.  
  4900.  
  4901. ΓòÉΓòÉΓòÉ 6.2. C Socket UDP Server ΓòÉΓòÉΓòÉ
  4902.  
  4903. The following is an example of a C socket UDP server program: 
  4904.  
  4905. #include <stdlib.h>
  4906. #include <types.h>
  4907. #include <netinet/in.h>
  4908. #include <sys/socket.h>
  4909.  
  4910. main()
  4911. {
  4912.    int sockint, s, namelen, client_address_size;
  4913.    struct sockaddr_in client, server;
  4914.    char buf╨¥32Γöÿ;
  4915.  
  4916.    /*
  4917.     * Initialize with sockets.
  4918.     */
  4919.    if ((sockint = sock_init()!=0)
  4920.       {
  4921.        printf ("INET.SYS probably not running");
  4922.        exit (1);
  4923.  
  4924.    /*
  4925.     * Create a datagram socket in the internet domain and use the
  4926.     * default protocol (UDP).
  4927.     */
  4928.    if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
  4929.    {
  4930.        psock_errno("socket()");
  4931.        exit(1);
  4932.    }
  4933.  
  4934.    /*
  4935.     * Bind my name to this socket so that clients on the network can
  4936.     * send me messages. (This allows the operating system to demultiplex
  4937.     * messages and get them to the correct server.)
  4938.     *
  4939.     * Set up the server name. The internet address is specified as the
  4940.     * wildcard INADDR_ANY so that the server can get messages from any
  4941.     * of the physical internet connections on this host. (Otherwise, we
  4942.     * would limit the server to messages from only one network interface.)
  4943.     */
  4944.    server.sin_family      = AF_INET;   /* Server is in Internet Domain */
  4945.    server.sin_port        = 0;         /* Use any available port       */
  4946.    server.sin_addr.s_addr = INADDR_ANY;/* Server's Internet Address    */
  4947.  
  4948.    if (bind(s, &server, sizeof(server)) < 0)
  4949.    {
  4950.        psock_errno("bind()");
  4951.        exit(2);
  4952.    }
  4953.  
  4954.    /* Find out what port was really assigned and print it. */
  4955.    namelen = sizeof(server);
  4956.    if (getsockname(s, (struct sockaddr *) &server, &namelen) < 0)
  4957.    {
  4958.        psock_errno("getsockname()");
  4959.        exit(3);
  4960.    }
  4961.  
  4962.    printf("Port assigned is %d\n", ntohs(server.sin_port));
  4963.  
  4964.    /*
  4965.     * Receive a message on socket s in buf of maximum size 32
  4966.     * from a client. Because the last two parameters
  4967.     * are not null, the name of the client will be placed into the
  4968.     * client data structure and the size of the client address will
  4969.     * be placed into client_address_size.
  4970.     */
  4971.    client_address_size = sizeof(client);
  4972.  
  4973.    if(recvfrom(s, buf, sizeof(buf), 0, (struct sockaddr *) &client,
  4974.             &client_address_size) <0)
  4975.    {
  4976.        psock_errno("recvfrom()");
  4977.        exit(4);
  4978.    }
  4979.    /*
  4980.     * Print the message and the name of the client.
  4981.     * The domain should be the internet domain (AF_INET).
  4982.     * The port is received in network byte order, so we translate it to
  4983.     * host byte order before printing it.
  4984.     * The internet address is received as 32 bits in network byte order
  4985.     * so we use a utility that converts it to a string printed in
  4986.     * dotted decimal format for readability.
  4987.     */
  4988.    printf("Received message %s from domain %s port %d internet address %s\n",
  4989.        buf,
  4990.        (client.sin_family == AF_INET?"AF_INET":"UNKNOWN"),
  4991.        ntohs(client.sin_port),
  4992.        inet_ntoa(client.sin_addr));
  4993.  
  4994.    /*
  4995.     * Deallocate the socket.
  4996.     */
  4997.    soclose(s);
  4998. }
  4999.  
  5000.  
  5001. ΓòÉΓòÉΓòÉ 6.3. C Socket TCP Client ΓòÉΓòÉΓòÉ
  5002.  
  5003. The following is an example of a C socket TCP client program: 
  5004.  
  5005. /*
  5006.  * Include Files.
  5007.  */
  5008. #include <types.h>
  5009. #include <netinet\in.h>
  5010. #include <sys\socket.h>
  5011. #include <netlib.h>
  5012. #include <netdb.h>
  5013. #include <stdio.h>
  5014.  
  5015. /*
  5016.  * Client Main.
  5017.  */
  5018. main(argc, argv)
  5019. int argc;
  5020. char **argv;
  5021. {
  5022.     unsigned short port;       /* port client will connect to */
  5023.     char buf╨¥12Γöÿ;    /* data buffer for sending and receiving */
  5024.     struct hostent *hostnm;    /* server host name information */
  5025.     struct sockaddr_in server; /* server address */
  5026.     int sockint, s;                     /* client socket */
  5027.  
  5028.     /*
  5029.      * Check Arguments Passed. Should be hostname and port.
  5030.      */
  5031.     if (argc != 3)
  5032.     {
  5033.         fprintf(stderr, "Usage: %s hostname port\n", argv╨¥0Γöÿ);
  5034.         exit(1);
  5035.     }
  5036.  
  5037.     /*
  5038.      * Initialize with sockets.
  5039.      */
  5040.    if ((sockint = sock_init()!=0)
  5041.       {
  5042.        printf ("INET.SYS probably not running");
  5043.        exit (1);
  5044.  
  5045.     /*
  5046.      * The host name is the first argument. Get the server address.
  5047.      */
  5048.     hostnm = gethostbyname(argv╨¥1Γöÿ);
  5049.     if (hostnm == (struct hostent *) 0)
  5050.     {
  5051.         fprintf(stderr, "Gethostbyname failed\n");
  5052.         exit(2);
  5053.     }
  5054.  
  5055.     /*
  5056.      * The port is the second argument.
  5057.      */
  5058.     port = (unsigned short) atoi(argv╨¥2Γöÿ);
  5059.  
  5060.     /*
  5061.      * Put a message into the buffer.
  5062.      */
  5063.     strcpy(buf, "the message");
  5064.  
  5065.     /*
  5066.      * Put the server information into the server structure.
  5067.      * The port must be put into network byte order.
  5068.      */
  5069.     server.sin_family      = AF_INET;
  5070.     server.sin_port        = htons(port);
  5071.     server.sin_addr.s_addr = *((unsigned long *)hostnm->h_addr);
  5072.  
  5073.     /*
  5074.      * Get a stream socket.
  5075.      */
  5076.     if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0)
  5077.     {
  5078.         psock_errno("Socket()");
  5079.         exit(3);
  5080.     }
  5081.  
  5082.     /*
  5083.      * Connect to the server.
  5084.      */
  5085.     if (connect(s, &server, sizeof(server)) < 0)
  5086.     {
  5087.         psock_errno("Connect()");
  5088.         exit(4);
  5089.     }
  5090.  
  5091.     if (send(s, buf, sizeof(buf), 0) < 0)
  5092.     {
  5093.         psock_errno("Send()");
  5094.         exit(5);
  5095.     }
  5096.  
  5097.     /*
  5098.      * The server sends back the same message. Receive it into the buffer.
  5099.      */
  5100.     if (recv(s, buf, sizeof(buf), 0) < 0)
  5101.     {
  5102.         psock_errno("Recv()");
  5103.         exit(6);
  5104.     }
  5105.  
  5106.     /*
  5107.      * Close the socket.
  5108.      */
  5109.     soclose(s);
  5110.  
  5111.     printf("Client Ended Successfully\n");
  5112.     exit(0);
  5113.  
  5114. }
  5115.  
  5116.  
  5117. ΓòÉΓòÉΓòÉ 6.4. C Socket TCP Server ΓòÉΓòÉΓòÉ
  5118.  
  5119. The following is an example of a C socket TCP server program: 
  5120.  
  5121. /*
  5122.  * Include Files.
  5123.  */
  5124. #include <types.h>
  5125. #include <netinet\in.h>
  5126. #include <sys\socket.h>
  5127. #include <netlib.h>
  5128. #include <stdio.h>
  5129.  
  5130.  
  5131. /*
  5132.  * Server Main.
  5133.  */
  5134. main(argc, argv)
  5135. int argc;
  5136. char **argv;
  5137. {
  5138.     unsigned short port;       /* port server binds to */
  5139.     char buf╨¥12Γöÿ;    /* buffer for sending and receiving data */
  5140.     struct sockaddr_in client; /* client address information */
  5141.     struct sockaddr_in server; /* server address information */
  5142.     int sockint, s;            /* socket for accepting connections */
  5143.     int ns;                    /* socket connected to client */
  5144.     int namelen;               /* length of client name */
  5145.  
  5146.     /*
  5147.      * Check arguments. Should be only one: the port number to bind to.
  5148.      */
  5149.  
  5150.     if (argc != 2)
  5151.     {
  5152.         fprintf(stderr, "Usage: %s port\n", argv╨¥0Γöÿ);
  5153.         exit(1);
  5154.     }
  5155.  
  5156.     /*
  5157.      * Initialize with sockets.
  5158.      */
  5159.    if ((sockint = sock_init()!=0)
  5160.       {
  5161.        printf ("INET.SYS probably not running");
  5162.        exit (1);
  5163.  
  5164.     /*
  5165.      * First argument should be the port.
  5166.      */
  5167.     port = (unsigned short) atoi(argv╨¥1Γöÿ);
  5168.  
  5169.     /*
  5170.      * Get a socket for accepting connections.
  5171.      */
  5172.     if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0)
  5173.     {
  5174.         psock_errno("Socket()");
  5175.         exit(2);
  5176.     }
  5177.  
  5178.     /*
  5179.      * Bind the socket to the server address.
  5180.      */
  5181.     server.sin_family = AF_INET;
  5182.     server.sin_port   = htons(port);
  5183.     server.sin_addr.s_addr = INADDR_ANY;
  5184.  
  5185.     if (bind(s, &server, sizeof(server)) < 0)
  5186.     {
  5187.         psock_errno("Bind()");
  5188.         exit(3);
  5189.     }
  5190.  
  5191.     /*
  5192.      * Listen for connections. Specify the backlog as 1.
  5193.      */
  5194.     if (listen(s, 1) != 0)
  5195.     {
  5196.         psock_errno("Listen()");
  5197.         exit(4);
  5198.     }
  5199.  
  5200.     /*
  5201.      * Accept a connection.
  5202.      */
  5203.     namelen = sizeof(client);
  5204.     if ((ns = accept(s, &client, &namelen)) == -1)
  5205.     {
  5206.         psock_errno("Accept()");
  5207.         exit(5);
  5208.     }
  5209.  
  5210.     /*
  5211.      * Receive the message on the newly connected socket.
  5212.      */
  5213.     if (recv(ns, buf, sizeof(buf), 0) == -1)
  5214.     {
  5215.         psock_errno("Recv()");
  5216.         exit(6);
  5217.     }
  5218.  
  5219.     /*
  5220.      * Send the message back to the client.
  5221.      */
  5222.     if (send(ns, buf, sizeof(buf), 0) < 0)
  5223.     {
  5224.         psock_errno("Send()");
  5225.         exit(7);
  5226.     }
  5227.  
  5228.     soclose(ns);
  5229.     soclose(s);
  5230.  
  5231.     printf("Server ended successfully\n");
  5232.     exit(0);
  5233. }
  5234.  
  5235.  
  5236. ΓòÉΓòÉΓòÉ 6.5. C Socket NB Client ΓòÉΓòÉΓòÉ
  5237.  
  5238. The following is an example of a C socket NB Client program: 
  5239.  
  5240.  
  5241. /*
  5242.  * Include Files.
  5243.  */
  5244. #include <types.h>
  5245. #include <netnb\nb.h>
  5246. #include <sys\socket.h>
  5247. #include <netlib.h>
  5248. #include <netdb.h>
  5249. #include <stdio.h>
  5250.  
  5251.  
  5252. struct sockaddr_nb server;     /* server address */
  5253.  
  5254. /*
  5255.  * Client Main.
  5256.  */
  5257.  
  5258.  
  5259. main(int argc, char **argv) {
  5260.  
  5261.     char buf╨¥12Γöÿ;              /* data buffer for sending and receiving */
  5262.     int  s;                    /* client socket */
  5263.  
  5264.     /*
  5265.      * Check Arguments Passed. Should be server-name and adapter-id.
  5266.      */
  5267.  
  5268.     if (argc != 3) {
  5269.         fprintf(stderr, "Usage: %s server-name adapter-id\n", argv╨¥0Γöÿ);
  5270.         exit(1);
  5271.     }
  5272.  
  5273.     /*
  5274.      * Initialize with sockets.
  5275.      */
  5276.  
  5277.     sock_init();
  5278.  
  5279.     /*
  5280.      * Put a message into the buffer.
  5281.      */
  5282.  
  5283.     strcpy(buf, "the message");
  5284.  
  5285.     /*
  5286.      * Put the server information into the server structure.
  5287.      */
  5288.  
  5289.     strcpy(server.snb_name, argv╨¥1Γöÿ);      //  From first argument
  5290.     strcpy(server.snb_netid, argv╨¥2Γöÿ);     //  From second argument
  5291.     server.snb_family = AF_NB;             //  NetBIOS address family
  5292.     server.snb_type = NB_UNIQUE;           //  Unique name
  5293.  
  5294.     /*
  5295.      * Get a stream socket.
  5296.      */
  5297.  
  5298.     if ((s = socket(AF_NB, SOCK_STREAM, 0)) < 0) {
  5299.         psock_errno("Socket()");
  5300.         exit(3);
  5301.     }
  5302.  
  5303.     /*
  5304.      * Connect to the server.
  5305.      */
  5306.  
  5307.     if (connect(s, (struct sockaddr *)&server, sizeof(server)) < 0) {
  5308.         psock_errno("Connect()");
  5309.         exit(4);
  5310.     }
  5311.  
  5312.     if (send(s, buf, sizeof(buf), 0) < 0) {
  5313.         psock_errno("Send()");
  5314.         exit(5);
  5315.     }
  5316.  
  5317.     /*
  5318.      * The server sends back the same message. Receive it into the buffer.
  5319.      */
  5320.  
  5321.     if (recv(s, buf, sizeof(buf), 0) < 0) {
  5322.         psock_errno("Recv()");
  5323.         exit(6);
  5324.     }
  5325.  
  5326.     /*
  5327.      * Close the socket.
  5328.      */
  5329.  
  5330.     soclose(s);
  5331.  
  5332.     printf("Client Ended Successfully\n");
  5333.     exit(0);
  5334.  
  5335. }
  5336.  
  5337.  
  5338. ΓòÉΓòÉΓòÉ 6.6. C Socket NB Server ΓòÉΓòÉΓòÉ
  5339.  
  5340. The following is an example of a C socket NB Server program: 
  5341.  
  5342.  
  5343. /*
  5344.  * Include Files.
  5345.  */
  5346. #include <types.h>
  5347. #include <netnb\nb.h>
  5348. #include <sys\socket.h>
  5349. #include <netlib.h>
  5350. #include <stdio.h>
  5351.  
  5352.  
  5353. struct sockaddr_nb server;     /* server address information */
  5354.  
  5355. /*
  5356.  * Server Main.
  5357.  */
  5358.  
  5359. main(int argc, char **argv) {
  5360.  
  5361.     char buf╨¥12Γöÿ;              /* buffer for sending and receiving data */
  5362.     struct sockaddr_nb client; /* client address information */
  5363.     int s;                     /* socket for accepting connections */
  5364.     int ns;                    /* socket connected to client */
  5365.     int namelen;               /* length of client name */
  5366.  
  5367.  
  5368.     /*
  5369.      * Check Arguments Passed. Should be server-name and adapter-id.
  5370.      */
  5371.  
  5372.     if (argc != 3) {
  5373.         fprintf(stderr, "Usage: %s server-name adapter-id\n", argv╨¥0Γöÿ);
  5374.         exit(1);
  5375.     }
  5376.     /*
  5377.      * Initialize with sockets.
  5378.      */
  5379.  
  5380.     sock_init();
  5381.  
  5382.     /*
  5383.      * Get a socket for accepting connections.
  5384.      */
  5385.  
  5386.     if ((s = socket(AF_NB, SOCK_STREAM, 0)) < 0)  {
  5387.         psock_errno("Socket()");
  5388.         exit(2);
  5389.     }
  5390.  
  5391.     /*
  5392.      * Bind the socket to the server address.
  5393.      */
  5394.  
  5395.     strcpy(server.snb_name, argv╨¥1Γöÿ);       //  First argument
  5396.     strcpy(server.snb_netid, argv╨¥2Γöÿ);      //  Second argument
  5397.     server.snb_family = AF_NB;              //  NetBIOS address family
  5398.     server.snb_type = NB_UNIQUE;            //  Unique name type
  5399.  
  5400.     if (bind(s, (struct sockaddr *)&server, sizeof(server)) < 0) {
  5401.         psock_errno("Bind()");
  5402.         exit(3);
  5403.     }
  5404.  
  5405.     /*
  5406.      * Listen for connections. Specify the backlog as 1.
  5407.      */
  5408.  
  5409.     if (listen(s, 1) != 0) {
  5410.         psock_errno("Listen()");
  5411.         exit(4);
  5412.     }
  5413.  
  5414.     /*
  5415.      * Accept a connection.
  5416.      */
  5417.  
  5418.     namelen = sizeof(client);
  5419.     if ((ns = accept(s, (struct sockaddr *)&client, &namelen)) == -1) {
  5420.         psock_errno("Accept()");
  5421.         exit(5);
  5422.     }
  5423.  
  5424.     /*
  5425.      * Receive the message on the newly connected socket.
  5426.      */
  5427.  
  5428.     if (recv(ns, buf, sizeof(buf), 0) == -1) {
  5429.         psock_errno("Recv()");
  5430.         exit(6);
  5431.     }
  5432.  
  5433.     /*
  5434.      * Send the message back to the client.
  5435.      */
  5436.  
  5437.     if (send(ns, buf, sizeof(buf), 0) < 0) {
  5438.         psock_errno("Send()");
  5439.         exit(7);
  5440.     }
  5441.  
  5442.     soclose(ns);
  5443.     soclose(s);
  5444.  
  5445.     printf("Server ended successfully\n");
  5446.     exit(0);
  5447. }
  5448.  
  5449.  
  5450. ΓòÉΓòÉΓòÉ 7. System Return Codes ΓòÉΓòÉΓòÉ
  5451.  
  5452. TCP/IP Error Messages provides the TCPIP error message numbers set by TCPIP 
  5453. call and will be found in the <NERRNO.H>. For further system error message 
  5454. numbers, refer to the compiler <ERRNO.H> header file. 
  5455.  
  5456. ┤ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  5457. ╨Æ Table 3. TCP/IP Error Messages                        ╨Æ
  5458. ╙БББББББББББББББББББББББББСБББББББББББББСББББББББББББББББББББББББББББББББББББББЙ
  5459. ╨Æ MESSAGE         ╨Æ CODE     ╨Æ DESCRIPTION              ╨Æ
  5460. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5461. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5462. ╨Æ SOCEPERM         ╨Æ 10001    ╨Æ Not owner.              ╨Æ
  5463. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5464. ╨Æ SOCESRCH         ╨Æ 10003    ╨Æ No such process.           ╨Æ
  5465. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5466. ╨Æ SOCEINTR         ╨Æ 10004    ╨Æ Interrupted system call.       ╨Æ
  5467. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5468. ╨Æ SOCENXIO         ╨Æ 10006    ╨Æ No such device or address.      ╨Æ
  5469. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5470. ╨Æ SOCEBADF         ╨Æ 10009    ╨Æ Bad file number.           ╨Æ
  5471. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5472. ╨Æ SOCEACCES        ╨Æ 10013    ╨Æ Permission denied.          ╨Æ
  5473. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5474. ╨Æ SOCEFAULT        ╨Æ 10014    ╨Æ Bad address.             ╨Æ
  5475. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5476. ╨Æ SOCEINVAL        ╨Æ 10022    ╨Æ Argument not valid.          ╨Æ
  5477. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5478. ╨Æ SOCEMFILE        ╨Æ 10024    ╨Æ Too many open files.         ╨Æ
  5479. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5480. ╨Æ SOCEPIPE         ╨Æ 10032    ╨Æ Broken pipe.             ╨Æ
  5481. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5482. ╨Æ SOCEWOULDBLOCK      ╨Æ 10035    ╨Æ Operation would block.        ╨Æ
  5483. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5484. ╨Æ SOCEINPROGRESS      ╨Æ 10036    ╨Æ Operation now in progress.      ╨Æ
  5485. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5486. ╨Æ SOCEALREADY       ╨Æ 10037    ╨Æ Operation already in progress.    ╨Æ
  5487. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5488. ╨Æ SOCENOTSOCK       ╨Æ 10038    ╨Æ Socket operation on non-socket.    ╨Æ
  5489. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5490. ╨Æ SOCEDESTADDRREQ     ╨Æ 10039    ╨Æ Destination address required.     ╨Æ
  5491. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5492. ╨Æ SOCEMSGSIZE       ╨Æ 10040    ╨Æ Message too long.           ╨Æ
  5493. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5494. ╨Æ SOCEPROTOTYPE      ╨Æ 10041    ╨Æ Protocol wrong type for socket.    ╨Æ
  5495. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5496. ╨Æ SOCENOPROTOOPT      ╨Æ 10042    ╨Æ Protocol not available.        ╨Æ
  5497. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5498. ╨Æ SOCEPROTONOSUPPORT    ╨Æ 10043    ╨Æ Protocol not supported.        ╨Æ
  5499. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5500. ╨Æ SOCESOCKTNOSUPPORT    ╨Æ 10044    ╨Æ Socket type not supported.      ╨Æ
  5501. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5502. ╨Æ SOCEOPNOTSUPP      ╨Æ 10045    ╨Æ Operation not supported on socket.  ╨Æ
  5503. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5504. ╨Æ SOCEPFNOSUPPORT     ╨Æ 10046    ╨Æ Protocol family not supported.    ╨Æ
  5505. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5506. ╨Æ SOCEAFNOSUPPORT     ╨Æ 10047    ╨Æ Address family not supported by pro- ╨Æ
  5507. ╨Æ             ╨Æ       ╨Æ tocol family.             ╨Æ
  5508. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5509. ╨Æ SOCEADDRINUSE      ╨Æ 10048    ╨Æ Address already in use.        ╨Æ
  5510. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5511. ╨Æ SOCEADDRNOTAVAIL     ╨Æ 10049    ╨Æ Can not assign requested address.   ╨Æ
  5512. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5513. ╨Æ SOCENETDOWN       ╨Æ 10050    ╨Æ Network is down.           ╨Æ
  5514. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5515. ╨Æ SOCENETUNREACH      ╨Æ 10051    ╨Æ Network is unreachable.        ╨Æ
  5516. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5517. ╨Æ SOCENETRESET       ╨Æ 10052    ╨Æ Network dropped connection on reset. ╨Æ
  5518. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5519. ╨Æ SOCECONNABORTED     ╨Æ 10053    ╨Æ Software caused connection abort.   ╨Æ
  5520. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5521. ╨Æ SOCECONNRESET      ╨Æ 10054    ╨Æ Connection reset by peer.       ╨Æ
  5522. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5523. ╨Æ SOCENOBUFS        ╨Æ 10055    ╨Æ No buffer space available.      ╨Æ
  5524. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5525. ╨Æ SOCEISCONN        ╨Æ 10056    ╨Æ Socket is already connected.     ╨Æ
  5526. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5527. ╨Æ SOCENOTCONN       ╨Æ 10057    ╨Æ Socket is not connected.       ╨Æ
  5528. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5529. ╨Æ SOCESHUTDOWN       ╨Æ 10058    ╨Æ Cannot send after socket shutdown.  ╨Æ
  5530. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5531. ╨Æ SOCETOOMANYREFS     ╨Æ 10059    ╨Æ Too many references:  cannot splice. ╨Æ
  5532. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5533. ╨Æ SOCETIMEDOUT       ╨Æ 10060    ╨Æ Connection timed out.         ╨Æ
  5534. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5535. ╨Æ SOCECONNREFUSED     ╨Æ 10061    ╨Æ Connection refused.          ╨Æ
  5536. БББББББББББББББББББББББББ╔БББББББББББББ╔ББББББББББББББББББББББББББББББББББББББД
  5537. ┤ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  5538. ╨Æ Table 3. TCP/IP Error Messages                        ╨Æ
  5539. ╙БББББББББББББББББББББББББСБББББББББББББСББББББББББББББББББББББББББББББББББББББЙ
  5540. ╨Æ MESSAGE         ╨Æ CODE     ╨Æ DESCRIPTION              ╨Æ
  5541. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5542. ╨Æ SOCELOOP         ╨Æ 10062    ╨Æ Too many levels of symbolic links.  ╨Æ
  5543. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5544. ╨Æ SOCENAMETOOLONG     ╨Æ 10063    ╨Æ File name too long.          ╨Æ
  5545. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5546. ╨Æ SOCEHOSTDOWN       ╨Æ 10064    ╨Æ Host is down.             ╨Æ
  5547. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5548. ╨Æ SOCEHOSTUNREACH     ╨Æ 10065    ╨Æ No route to host.           ╨Æ
  5549. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5550. ╨Æ SOCENOTEMPTY       ╨Æ 10066    ╨Æ Directory not empty.         ╨Æ
  5551. ╙БББББББББББББББББББББББББТБББББББББББББТББББББББББББББББББББББББББББББББББББББЙ
  5552. ╨Æ SOCEOS2ERR        ╨Æ 10100    ╨Æ OS/2 error.              ╨Æ
  5553. БББББББББББББББББББББББББ╔БББББББББББББ╔ББББББББББББББББББББББББББББББББББББББД
  5554.  
  5555.  
  5556. ΓòÉΓòÉΓòÉ 8. Socket Quick Reference ΓòÉΓòÉΓòÉ
  5557.  
  5558. The following table describes each protocol-independent socket call supported 
  5559. by Socket/MPTS for OS/2. 
  5560.  
  5561. ┤ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  5562. ╨Æ Table 4. Socket Quick Reference                        ╨Æ
  5563. ╙БББББББББББББББББББББББББСББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5564. ╨Æ SOCKET CALL       ╨Æ DESCRIPTION                     ╨Æ
  5565. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5566. ╨Æ accept()         ╨Æ Accepts a connection request from a foreign host.  ╨Æ
  5567. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5568. ╨Æ bind()          ╨Æ Assigns a local address to the socket.       ╨Æ
  5569. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5570. ╨Æ connect()        ╨Æ Requests a connection to a foreign server.     ╨Æ
  5571. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5572. ╨Æ getpeername()      ╨Æ Returns the name of the peer connected to socket  ╨Æ
  5573. ╨Æ             ╨Æ s.                         ╨Æ
  5574. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5575. ╨Æ getsockname()mm     ╨Æ Obtains local socket name.             ╨Æ
  5576. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5577. ╨Æ getsockopt()       ╨Æ Returns values of options associated with a     ╨Æ
  5578. ╨Æ             ╨Æ socket.                       ╨Æ
  5579. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5580. ╨Æ ioctl()         ╨Æ Performs special operations on s socket       ╨Æ
  5581. ╨Æ             ╨Æ descriptor.                     ╨Æ
  5582. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5583. ╨Æ listen()         ╨Æ Indicates that a stream socket is ready for a con- ╨Æ
  5584. ╨Æ             ╨Æ nection request from a foreign client.       ╨Æ
  5585. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5586. ╨Æ psock_errno()      ╨Æ Produces sort error messages.            ╨Æ
  5587. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5588. ╨Æ readv()         ╨Æ Reads data on a socket with descriptor s.      ╨Æ
  5589. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5590. ╨Æ recv()          ╨Æ Receives messages on a connected socket.      ╨Æ
  5591. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5592. ╨Æ recvfrom()        ╨Æ Receives messages on a datagram socket, regardless ╨Æ
  5593. ╨Æ             ╨Æ of its connection status.              ╨Æ
  5594. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5595. ╨Æ recvmsg()        ╨Æ Receives messages on a socket with descriptor s.  ╨Æ
  5596. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5597. ╨Æ select()         ╨Æ Returns read, write, and exception status on a   ╨Æ
  5598. ╨Æ             ╨Æ group of sockets.                  ╨Æ
  5599. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5600. ╨Æ send()          ╨Æ Sends packets on a connected socket.        ╨Æ
  5601. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5602. ╨Æ sendmsg()        ╨Æ Sends messages on a socket with descriptor s.    ╨Æ
  5603. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5604. ╨Æ sendto()         ╨Æ Sends packets on a datagram socket, regardless of  ╨Æ
  5605. ╨Æ             ╨Æ its connection status.               ╨Æ
  5606. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5607. ╨Æ setsockopt()       ╨Æ Sets options associated with a socket.       ╨Æ
  5608. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5609. ╨Æ shutdown()        ╨Æ Shuts down all or part of a full-duplex con-    ╨Æ
  5610. ╨Æ             ╨Æ nection.                      ╨Æ
  5611. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5612. ╨Æ sock_errno()       ╨Æ Returns error code set by Socket calls.       ╨Æ
  5613. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5614. ╨Æ sock_init()       ╨Æ Initializes the socket data structures.       ╨Æ
  5615. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5616. ╨Æ socket()         ╨Æ Requests that a socket be created.         ╨Æ
  5617. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5618. ╨Æ soclose()        ╨Æ Closes the socket associated with the descriptor  ╨Æ
  5619. ╨Æ             ╨Æ s.                         ╨Æ
  5620. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5621. ╨Æ writev()         ╨Æ Writes data on a socket with descriptor s.     ╨Æ
  5622. БББББББББББББББББББББББББ╔ББББББББББББББББББББББББББББББББББББББББББББББББББББД
  5623.  
  5624. The following table describes each protocol-dependent socket call supported by 
  5625. TCP/IP for OS/2. 
  5626.  
  5627. ┤ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  5628. ╨Æ Table 5. Socket Quick Reference                        ╨Æ
  5629. ╙БББББББББББББББББББББББББСББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5630. ╨Æ SOCKET CALL       ╨Æ DESCRIPTION                     ╨Æ
  5631. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5632. ╨Æ bswap()         ╨Æ Swaps bytes in a short integer.           ╨Æ
  5633. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5634. ╨Æ dn_comp()        ╨Æ Compresses the expanded domain name.        ╨Æ
  5635. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5636. ╨Æ dn_expand()       ╨Æ Expands a compressed domain name to a full domain  ╨Æ
  5637. ╨Æ             ╨Æ name.                        ╨Æ
  5638. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5639. ╨Æ endhostent()       ╨Æ Closes the SITEINFO and ADDRINFO datasets.     ╨Æ
  5640. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5641. ╨Æ endnetent()       ╨Æ Closes the SITEINFO dataset.            ╨Æ
  5642. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5643. ╨Æ endprotoent()      ╨Æ Closes the ETC_PROTOCOLS dataset.          ╨Æ
  5644. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5645. ╨Æ endservent()       ╨Æ Closes the ETC_SERVICES dataset.          ╨Æ
  5646. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5647. ╨Æ gethostbyaddr()     ╨Æ Returns information about a host specified by an  ╨Æ
  5648. ╨Æ             ╨Æ address.                      ╨Æ
  5649. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5650. ╨Æ gethostbyname()     ╨Æ Returns information about a host specified by a   ╨Æ
  5651. ╨Æ             ╨Æ name.                        ╨Æ
  5652. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5653. ╨Æ gethostent()       ╨Æ Returns a pointer to the next entry in the     ╨Æ
  5654. ╨Æ             ╨Æ SITEINFO dataset.                  ╨Æ
  5655. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5656. ╨Æ gethostid()       ╨Æ Returns the unique identifier of the current host. ╨Æ
  5657. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5658. ╨Æ gethostname()      ╨Æ Returns the name of the host processor on which   ╨Æ
  5659. ╨Æ             ╨Æ the program is running.               ╨Æ
  5660. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5661. ╨Æ getnetbyaddr()      ╨Æ Searches the SITEINFO and ADDRINFO  datasets for  ╨Æ
  5662. ╨Æ             ╨Æ the specified network address.           ╨Æ
  5663. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5664. ╨Æ getnetbyname()      ╨Æ Searches the ADDRINFO and SITEINFO datasets for   ╨Æ
  5665. ╨Æ             ╨Æ the specified network name.             ╨Æ
  5666. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5667. ╨Æ getnetent()       ╨Æ Returns a pointer to the next entry in the     ╨Æ
  5668. ╨Æ             ╨Æ SITEINFO dataset.                  ╨Æ
  5669. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5670. ╨Æ getprotobyname()     ╨Æ Searches the ETC_PROTOCOLS dataset for the speci-  ╨Æ
  5671. ╨Æ             ╨Æ fied protocol name.                 ╨Æ
  5672. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5673. ╨Æ getprotobynumber()    ╨Æ Searches the ETC_Protocols dataset for the speci-  ╨Æ
  5674. ╨Æ             ╨Æ fied protocol number.                ╨Æ
  5675. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5676. ╨Æ getprotoent()      ╨Æ Returns a pointer to the next entry in the     ╨Æ
  5677. ╨Æ             ╨Æ ETC_PROTOCOLS dataset.               ╨Æ
  5678. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5679. ╨Æ getservbyname()     ╨Æ Searches the ETC_SERVICES dataset for the speci-  ╨Æ
  5680. ╨Æ             ╨Æ fied service name.                 ╨Æ
  5681. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5682. ╨Æ getservbyport()     ╨Æ Searches the ETC_SERVICES dataset for the speci-  ╨Æ
  5683. ╨Æ             ╨Æ fied port number.                  ╨Æ
  5684. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5685. ╨Æ getservent()       ╨Æ Returns a pointer the the next entry in the     ╨Æ
  5686. ╨Æ             ╨Æ ETC_SERVICES dataset.                ╨Æ
  5687. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5688. ╨Æ getsockopt()       ╨Æ Gets the socket options associated with a socket.  ╨Æ
  5689. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5690. ╨Æ htonl()         ╨Æ Translates byte order from host to network for a  ╨Æ
  5691. ╨Æ             ╨Æ long integer.                    ╨Æ
  5692. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5693. ╨Æ htons()         ╨Æ Translates byte order from host to network for a  ╨Æ
  5694. ╨Æ             ╨Æ short integer.                   ╨Æ
  5695. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5696. ╨Æ inet_addr()       ╨Æ Constructs an internet address from character    ╨Æ
  5697. ╨Æ             ╨Æ strings set in standard dotted-decimal notation.  ╨Æ
  5698. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5699. ╨Æ inet_lnaof()       ╨Æ Returns the local network portion of an internet  ╨Æ
  5700. ╨Æ             ╨Æ address.                      ╨Æ
  5701. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5702. ╨Æ inet_makeaddr()     ╨Æ Constructs an internet address from a network    ╨Æ
  5703. ╨Æ             ╨Æ number and a local address.             ╨Æ
  5704. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5705. ╨Æ inet_netof()       ╨Æ Returns the network portion of the internet     ╨Æ
  5706. ╨Æ             ╨Æ address in network byte order.           ╨Æ
  5707. БББББББББББББББББББББББББ╔ББББББББББББББББББББББББББББББББББББББББББББББББББББД
  5708. ┤ББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББББЖ
  5709. ╨Æ Table 5. Socket Quick Reference                        ╨Æ
  5710. ╙БББББББББББББББББББББББББСББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5711. ╨Æ SOCKET CALL       ╨Æ DESCRIPTION                     ╨Æ
  5712. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5713. ╨Æ inet_network()      ╨Æ Constructs a network number from character strings ╨Æ
  5714. ╨Æ             ╨Æ set in standard dotted-decimal notation.      ╨Æ
  5715. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5716. ╨Æ inet_ntoa()       ╨Æ Returns a pointer to a string in dotted-decimal   ╨Æ
  5717. ╨Æ             ╨Æ notation.                      ╨Æ
  5718. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5719. ╨Æ lswap()         ╨Æ Translates byte order from network to host for a  ╨Æ
  5720. ╨Æ             ╨Æ long integer.                    ╨Æ
  5721. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5722. ╨Æ ntohs()         ╨Æ Translates byte order from network to host for a  ╨Æ
  5723. ╨Æ             ╨Æ short integer.                   ╨Æ
  5724. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5725. ╨Æ res_init()        ╨Æ Reads the RESOLV file for the default domain name. ╨Æ
  5726. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5727. ╨Æ res_mkquery()      ╨Æ Makes a query messsage for the name servers in the ╨Æ
  5728. ╨Æ             ╨Æ Internet domain.                  ╨Æ
  5729. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5730. ╨Æ res_send()        ╨Æ Sends a query to a local name server.        ╨Æ
  5731. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5732. ╨Æ sethostent()       ╨Æ Opens and rewinds the SITEINFO dataset.       ╨Æ
  5733. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5734. ╨Æ setnetent()       ╨Æ Opens and rewinds the SITEINFO dataset.       ╨Æ
  5735. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5736. ╨Æ setprotoent()      ╨Æ Opens and rewinds the ETC_PROTOCOLS dataset.    ╨Æ
  5737. ╙БББББББББББББББББББББББББТББББББББББББББББББББББББББББББББББББББББББББББББББББЙ
  5738. ╨Æ setservent()       ╨Æ Opens and rewinds the ETC_SERVICES dataset.     ╨Æ
  5739. БББББББББББББББББББББББББ╔ББББББББББББББББББББББББББББББББББББББББББББББББББББД
  5740.  
  5741.  
  5742. ΓòÉΓòÉΓòÉ 9. Glossary ΓòÉΓòÉΓòÉ
  5743.  
  5744. This glossary describes the most common terms associated with TCP/IP 
  5745. communication in an internet environment, as used in this book. 
  5746.  
  5747. If you do not find the term you are looking for, see IBM Dictionary of 
  5748. Computing, SC20-1699. 
  5749.  
  5750. This glossary includes some terms from IBM Dictionary of Computing. 
  5751.  
  5752. For abbreviations, the definition usually consists only of the words 
  5753. represented by the letters; for complete definitions, see the entries for the 
  5754. words. 
  5755.  
  5756.  
  5757. ΓòÉΓòÉΓòÉ 9.1. A ΓòÉΓòÉΓòÉ
  5758.  
  5759.  
  5760. ΓòÉΓòÉΓòÉ 9.1.1. ABEND ΓòÉΓòÉΓòÉ
  5761.  
  5762. ABEND 
  5763.  
  5764. The abnormal termination of a program or task. 
  5765.  
  5766.  
  5767. ΓòÉΓòÉΓòÉ 9.1.2. accelerator key ΓòÉΓòÉΓòÉ
  5768.  
  5769. accelerator key 
  5770.  
  5771. A key or combination of keys that invokes an application-defined function. Also 
  5772. known as a function key. 
  5773.  
  5774.  
  5775. ΓòÉΓòÉΓòÉ 9.1.3. action bar ΓòÉΓòÉΓòÉ
  5776.  
  5777. action bar 
  5778.  
  5779. The highlighted area at the top of a panel that contains the choices currently 
  5780. available in the application program that a user is running. 
  5781.  
  5782.  
  5783. ΓòÉΓòÉΓòÉ 9.1.4. active open ΓòÉΓòÉΓòÉ
  5784.  
  5785. active open 
  5786.  
  5787. The state of a connection that is actively seeking a service. Contrast with 
  5788. passive open. 
  5789.  
  5790.  
  5791. ΓòÉΓòÉΓòÉ 9.1.5. adapter ΓòÉΓòÉΓòÉ
  5792.  
  5793. adapter 
  5794.  
  5795.  1. A piece of hardware that connects a computer and an external device. 
  5796.  
  5797.  2. An auxiliary device or unit used to extend the operation of another system. 
  5798.  
  5799.  
  5800. ΓòÉΓòÉΓòÉ 9.1.6. address ΓòÉΓòÉΓòÉ
  5801.  
  5802. address 
  5803.  
  5804. The unique code assigned to each device or workstation connected to a network. 
  5805. A standard internet address is a 32-bit address field. This field can be broken 
  5806. into two parts. The first part contains the network address; the second part 
  5807. contains the host number. 
  5808.  
  5809.  
  5810. ΓòÉΓòÉΓòÉ 9.1.7. Address Resolution Protocol (ARP) ΓòÉΓòÉΓòÉ
  5811.  
  5812. Address Resolution Protocol (ARP) 
  5813.  
  5814. A protocol used to dynamically bind an internet address to a hardware address. 
  5815. ARP is implemented on a single physical network and is limited to networks that 
  5816. support broadcast addressing. 
  5817.  
  5818.  
  5819. ΓòÉΓòÉΓòÉ 9.1.8. agent ΓòÉΓòÉΓòÉ
  5820.  
  5821. agent 
  5822.  
  5823. As defined in the SNMP architecture, an agent, or an SNMP server is responsible 
  5824. for performing the network management functions requested by the network 
  5825. management stations. 
  5826.  
  5827.  
  5828. ΓòÉΓòÉΓòÉ 9.1.9. American National Standard Code for Information Interchange (ASCII) ΓòÉΓòÉΓòÉ
  5829.  
  5830. American National Standard Code for Information Interchange (ASCII) 
  5831.  
  5832.  1. The standard code, using a coded character set consisting of 7-bit coded 
  5833.     characters (8 bits including parity check), used for information 
  5834.     interchange among data processing systems, data communication systems, and 
  5835.     associated equipment. The ASCII set consists of control characters and 
  5836.     graphic characters. 
  5837.  
  5838.  2. The default file transfer type for FTP, used to transfer files that contain 
  5839.     ASCII text characters. 
  5840.  
  5841.  
  5842. ΓòÉΓòÉΓòÉ 9.1.10. American National Standards Institute (ANSI) ΓòÉΓòÉΓòÉ
  5843.  
  5844. American National Standards Institute (ANSI) 
  5845.  
  5846. An organization consisting of producers, consumers, and general interest 
  5847. groups, that establishes the procedures by which accredited organizations 
  5848. create and maintain voluntary industry standards in the United States. 
  5849.  
  5850.  
  5851. ΓòÉΓòÉΓòÉ 9.1.11. ANSI ΓòÉΓòÉΓòÉ
  5852.  
  5853. ANSI 
  5854.  
  5855. American National Standards Institute 
  5856.  
  5857.  
  5858. ΓòÉΓòÉΓòÉ 9.1.12. application ΓòÉΓòÉΓòÉ
  5859.  
  5860. application 
  5861.  
  5862. The use to which an information processing system is put, for example, a 
  5863. payroll application, an airline reservation application, a network application. 
  5864.  
  5865.  
  5866. ΓòÉΓòÉΓòÉ 9.1.13. argument ΓòÉΓòÉΓòÉ
  5867.  
  5868. argument 
  5869.  
  5870. A parameter passed between a calling program and a called program. 
  5871.  
  5872.  
  5873. ΓòÉΓòÉΓòÉ 9.1.14. ARP ΓòÉΓòÉΓòÉ
  5874.  
  5875. ARP 
  5876.  
  5877. Address Resolution Protocol. 
  5878.  
  5879.  
  5880. ΓòÉΓòÉΓòÉ 9.1.15. ASCII ΓòÉΓòÉΓòÉ
  5881.  
  5882. ASCII 
  5883.  
  5884. American National Standard Code for Information Interchange. 
  5885.  
  5886.  
  5887. ΓòÉΓòÉΓòÉ 9.1.16. asynchronous ΓòÉΓòÉΓòÉ
  5888.  
  5889. asynchronous 
  5890.  
  5891. Without regular time relationship; unexpected or unpredictable with respect to 
  5892. the execution of program instruction. See synchronous. 
  5893.  
  5894.  
  5895. ΓòÉΓòÉΓòÉ 9.1.17. attribute ΓòÉΓòÉΓòÉ
  5896.  
  5897. attribute 
  5898.  
  5899. A characteristic or property. For example, the color of a line, or the length 
  5900. of a data field. 
  5901.  
  5902.  
  5903. ΓòÉΓòÉΓòÉ 9.1.18. authentication server ΓòÉΓòÉΓòÉ
  5904.  
  5905. authentication server 
  5906.  
  5907. The service that reads a Kerberos database to verify that a client making a 
  5908. request for access to an end-service is the client named in the request. The 
  5909. authentication server provides an authenticated client a ticket as permission 
  5910. to access the ticket-granting server. 
  5911.  
  5912.  
  5913. ΓòÉΓòÉΓòÉ 9.1.19. authenticator ΓòÉΓòÉΓòÉ
  5914.  
  5915. authenticator 
  5916.  
  5917. Information encrypted by a Kerberos authentication server that a client 
  5918. presents along with a ticket to an end-server as permission to access the 
  5919. service. 
  5920.  
  5921.  
  5922. ΓòÉΓòÉΓòÉ 9.1.20. authorization ΓòÉΓòÉΓòÉ
  5923.  
  5924. authorization 
  5925.  
  5926. The right granted to a user to communicate with, or to make use of, a computer 
  5927. system or service. 
  5928.  
  5929.  
  5930. ΓòÉΓòÉΓòÉ 9.2. B ΓòÉΓòÉΓòÉ
  5931.  
  5932.  
  5933. ΓòÉΓòÉΓòÉ 9.2.1. backbone ΓòÉΓòÉΓòÉ
  5934.  
  5935. backbone 
  5936.  
  5937.  1. In a local area network multiple-bridge ring configuration, a high-speed 
  5938.     link to which rings are connected by means of bridges. A backbone can be 
  5939.     configured as a bus or as a ring. 
  5940.  
  5941.  2. In a wide area network, a high-speed link to which nodes or data switching 
  5942.     exchanges (DSES) are connected. 
  5943.  
  5944.  
  5945. ΓòÉΓòÉΓòÉ 9.2.2. batch ΓòÉΓòÉΓòÉ
  5946.  
  5947. batch 
  5948.  
  5949.  1. An accumulation of data to be processed. 
  5950.  
  5951.  2. A group of records or data processing jobs brought together for processing 
  5952.     or transmission. 
  5953.  
  5954.  3. Pertaining to activity involving little or no user action. See interactive. 
  5955.  
  5956.  
  5957. ΓòÉΓòÉΓòÉ 9.2.3. block ΓòÉΓòÉΓòÉ
  5958.  
  5959. block 
  5960.  
  5961. A string of data elements recorded, processed, or transmitted as a unit. The 
  5962. elements can be characters, words, or physical records. 
  5963.  
  5964.  
  5965. ΓòÉΓòÉΓòÉ 9.2.4. Boolean ΓòÉΓòÉΓòÉ
  5966.  
  5967. Boolean 
  5968.  
  5969. A value of 0 or 1 represented internally in binary notation. 
  5970.  
  5971.  
  5972. ΓòÉΓòÉΓòÉ 9.2.5. bridge ΓòÉΓòÉΓòÉ
  5973.  
  5974. bridge 
  5975.  
  5976. A router that connects two or more networks and forwards packets among them. 
  5977. The operations carried out by a bridge are done at the physical layer and are 
  5978. transparent to TCP/IP and TCP/IP routing. 
  5979.  
  5980.  
  5981. ΓòÉΓòÉΓòÉ 9.2.6. broadcast ΓòÉΓòÉΓòÉ
  5982.  
  5983. broadcast 
  5984.  
  5985. The simultaneous transmission of data packets to all nodes on a network or 
  5986. subnetwork. 
  5987.  
  5988.  
  5989. ΓòÉΓòÉΓòÉ 9.2.7. broadcast address ΓòÉΓòÉΓòÉ
  5990.  
  5991. broadcast address 
  5992.  
  5993. An address that is common to all nodes on a network. 
  5994.  
  5995.  
  5996. ΓòÉΓòÉΓòÉ 9.2.8. bus topology ΓòÉΓòÉΓòÉ
  5997.  
  5998. bus topology 
  5999.  
  6000. A network configuration in which only one path is maintained between stations. 
  6001. Any data transmitted by a station is concurrently available to all other 
  6002. stations on the link. 
  6003.  
  6004.  
  6005. ΓòÉΓòÉΓòÉ 9.2.9. button ΓòÉΓòÉΓòÉ
  6006.  
  6007. button 
  6008.  
  6009.  1. A mechanism on a pointing device, such as a mouse, used to request or 
  6010.     initiate an action. 
  6011.  
  6012.  2. A rounded-corner rectangle with text inside, used in graphics applications 
  6013.     for actions that occur when the pushbutton is selected. 
  6014.  
  6015.  
  6016. ΓòÉΓòÉΓòÉ 9.3. C ΓòÉΓòÉΓòÉ
  6017.  
  6018.  
  6019. ΓòÉΓòÉΓòÉ 9.3.1. case-sensitive ΓòÉΓòÉΓòÉ
  6020.  
  6021. case-sensitive 
  6022.  
  6023. A condition in which entries for an entry field must conform to a specific 
  6024. lower -, upper -, or mixed-case format in order to be valid. 
  6025.  
  6026.  
  6027. ΓòÉΓòÉΓòÉ 9.3.2. checksum ΓòÉΓòÉΓòÉ
  6028.  
  6029. checksum 
  6030.  
  6031. The sum of a group of data associated with the group and used for checking 
  6032. purposes. 
  6033.  
  6034.  
  6035. ΓòÉΓòÉΓòÉ 9.3.3. Class A network ΓòÉΓòÉΓòÉ
  6036.  
  6037. Class A network 
  6038.  
  6039. An internet network in which the high-order bit of the address is 0. The host 
  6040. number occupies the three low-order octets. 
  6041.  
  6042.  
  6043. ΓòÉΓòÉΓòÉ 9.3.4. Class B network ΓòÉΓòÉΓòÉ
  6044.  
  6045. Class B network 
  6046.  
  6047. An internet network in which the high-order bit of the address is 1 and the 
  6048. next high-order bit is 0. The host number occupies the two low-order octets. 
  6049.  
  6050.  
  6051. ΓòÉΓòÉΓòÉ 9.3.5. Class C network ΓòÉΓòÉΓòÉ
  6052.  
  6053. Class C network 
  6054.  
  6055. An internet network in which the two high-order bits of the address are 1 and 
  6056. the next high-order bit is 0. The host number occupies the low-order octet. 
  6057.  
  6058.  
  6059. ΓòÉΓòÉΓòÉ 9.3.6. click ΓòÉΓòÉΓòÉ
  6060.  
  6061. click 
  6062.  
  6063. To press and release the select button on a mouse. 
  6064.  
  6065.  
  6066. ΓòÉΓòÉΓòÉ 9.3.7. client ΓòÉΓòÉΓòÉ
  6067.  
  6068. client 
  6069.  
  6070. A function that requests services from a server, and makes them available to 
  6071. the user. 
  6072.  
  6073.  
  6074. ΓòÉΓòÉΓòÉ 9.3.8. client-server relationship ΓòÉΓòÉΓòÉ
  6075.  
  6076. client-server relationship 
  6077.  
  6078. A device that provides resources or services to other devices on a network is a 
  6079. server. A device that employs the resources provided by a server is a client. 
  6080.  
  6081.  
  6082. ΓòÉΓòÉΓòÉ 9.3.9. clipboard ΓòÉΓòÉΓòÉ
  6083.  
  6084. clipboard 
  6085.  
  6086. A temporary storage area used for copying and storing data. 
  6087.  
  6088.  
  6089. ΓòÉΓòÉΓòÉ 9.3.10. CMS ΓòÉΓòÉΓòÉ
  6090.  
  6091. CMS 
  6092.  
  6093. Conversational Monitor System 
  6094.  
  6095.  
  6096. ΓòÉΓòÉΓòÉ 9.3.11. command ΓòÉΓòÉΓòÉ
  6097.  
  6098. command 
  6099.  
  6100. The name and any parameters associated with an action that can be performed by 
  6101. a program. The command is entered by the user; the computer performs the action 
  6102. requested by the command name. 
  6103.  
  6104.  
  6105. ΓòÉΓòÉΓòÉ 9.3.12. command prompt ΓòÉΓòÉΓòÉ
  6106.  
  6107. command prompt 
  6108.  
  6109. A displayed symbol, such as ╨¥C:\Γöÿ that requests input from a user. 
  6110.  
  6111.  
  6112. ΓòÉΓòÉΓòÉ 9.3.13. Communications Manager ΓòÉΓòÉΓòÉ
  6113.  
  6114. Communications Manager 
  6115.  
  6116. A component of OS/2 that allows a workstation to connect to a host computer and 
  6117. use the host resources as well as the resources of other personal computers to 
  6118. which the workstation is attached, either directly or through a host. 
  6119.  
  6120.  
  6121. ΓòÉΓòÉΓòÉ 9.3.14. community name ΓòÉΓòÉΓòÉ
  6122.  
  6123. community name 
  6124.  
  6125. The name of a group of hosts that share SNMP management network information. 
  6126.  
  6127.  
  6128. ΓòÉΓòÉΓòÉ 9.3.15. compile ΓòÉΓòÉΓòÉ
  6129.  
  6130. compile 
  6131.  
  6132.  1. To translate a program written in a high-level language into a machine 
  6133.     language program. 
  6134.  
  6135.  2. The computer actions required to transform a source file into an executable 
  6136.     object file. 
  6137.  
  6138.  
  6139. ΓòÉΓòÉΓòÉ 9.3.16. Compiler ΓòÉΓòÉΓòÉ
  6140.  
  6141. Compiler 
  6142.  
  6143. A program that translates a source program into an executable program (an 
  6144. object program). 
  6145.  
  6146.  
  6147. ΓòÉΓòÉΓòÉ 9.3.17. CONFIG.SYS ΓòÉΓòÉΓòÉ
  6148.  
  6149. CONFIG.SYS 
  6150.  
  6151. A file that contains the configuration options for an OS/2 personal computer. 
  6152.  
  6153.  
  6154. ΓòÉΓòÉΓòÉ 9.3.18. configuration file ΓòÉΓòÉΓòÉ
  6155.  
  6156. configuration file 
  6157.  
  6158. For the base operating system, the CONFIG.SYS file that describes the devices, 
  6159. system parameters, and resource options of a personal computer. 
  6160.  
  6161.  
  6162. ΓòÉΓòÉΓòÉ 9.3.19. connection ΓòÉΓòÉΓòÉ
  6163.  
  6164. connection 
  6165.  
  6166.  1. An association established between functional units for conveying 
  6167.     information. 
  6168.  
  6169.  2. The path between two protocol modules that provides reliable stream 
  6170.     delivery service. In an internet, a connection extends from a TCP module on 
  6171.     one machine to a TCP module on the other. 
  6172.  
  6173.  
  6174. ΓòÉΓòÉΓòÉ 9.3.20. conversational monitor system (CMS) ΓòÉΓòÉΓòÉ
  6175.  
  6176. conversational monitor system (CMS) 
  6177.  
  6178. A virtual machine operating system that provides general interactive time 
  6179. sharing, problem solving, and program development capabilities, and operates 
  6180. only under control of the VM/370 VM control program. 
  6181.  
  6182.  
  6183. ΓòÉΓòÉΓòÉ 9.4. D ΓòÉΓòÉΓòÉ
  6184.  
  6185.  
  6186. ΓòÉΓòÉΓòÉ 9.4.1. daemon ΓòÉΓòÉΓòÉ
  6187.  
  6188. daemon 
  6189.  
  6190. A background process usually started at system initialization that runs 
  6191. continuously and performs a function required by other processes. 
  6192.  
  6193.  
  6194. ΓòÉΓòÉΓòÉ 9.4.2. datagram ΓòÉΓòÉΓòÉ
  6195.  
  6196. datagram 
  6197.  
  6198. The basic unit of information that is passed across the internet, it consists 
  6199. of one or more data packets. 
  6200.  
  6201.  
  6202. ΓòÉΓòÉΓòÉ 9.4.3. data set ΓòÉΓòÉΓòÉ
  6203.  
  6204. data set 
  6205.  
  6206. The major unit of data storage and retrieval in MVS, consisting of a collection 
  6207. of data in one of several prescribed arrangements and described by control 
  6208. information to which the system has access. Synonymous with file in VM and 
  6209. OS/2. 
  6210.  
  6211.  
  6212. ΓòÉΓòÉΓòÉ 9.4.4. default ΓòÉΓòÉΓòÉ
  6213.  
  6214. default 
  6215.  
  6216. A value, attribute or option that is assumed when none is explicitly specified. 
  6217.  
  6218.  
  6219. ΓòÉΓòÉΓòÉ 9.4.5. destination node ΓòÉΓòÉΓòÉ
  6220.  
  6221. destination node 
  6222.  
  6223. The node to which a request or data is sent. 
  6224.  
  6225.  
  6226. ΓòÉΓòÉΓòÉ 9.4.6. dialog box ΓòÉΓòÉΓòÉ
  6227.  
  6228. dialog box 
  6229.  
  6230. A movable window, fixed in size, which provides information that is required by 
  6231. an application to continue your request. 
  6232.  
  6233.  
  6234. ΓòÉΓòÉΓòÉ 9.4.7. directory ΓòÉΓòÉΓòÉ
  6235.  
  6236. directory 
  6237.  
  6238. A named grouping of files in a file system. 
  6239.  
  6240.  
  6241. ΓòÉΓòÉΓòÉ 9.4.8. Distributed Program Interface ΓòÉΓòÉΓòÉ
  6242.  
  6243. Distributed Program Interface 
  6244.  
  6245. The SNMP DPI is a programming interface that provides an extension to the 
  6246. functionality provided by the SNMP agents. 
  6247.  
  6248.  
  6249. ΓòÉΓòÉΓòÉ 9.4.9. DLL ΓòÉΓòÉΓòÉ
  6250.  
  6251. DLL 
  6252.  
  6253. Dynamic Link Library 
  6254.  
  6255.  
  6256. ΓòÉΓòÉΓòÉ 9.4.10. DNS ΓòÉΓòÉΓòÉ
  6257.  
  6258. DNS 
  6259.  
  6260. Domain Name System 
  6261.  
  6262.  
  6263. ΓòÉΓòÉΓòÉ 9.4.11. domain ΓòÉΓòÉΓòÉ
  6264.  
  6265. domain 
  6266.  
  6267. In an internet, a part of the naming hierarchy. Syntactically, a domain name 
  6268. consists of a sequence of names (labels) separated by periods (dots). 
  6269.  
  6270.  
  6271. ΓòÉΓòÉΓòÉ 9.4.12. Domain Name System ΓòÉΓòÉΓòÉ
  6272.  
  6273. Domain Name System 
  6274.  
  6275. A system in which a resolver queries name servers for resource records about a 
  6276. host. 
  6277.  
  6278.  
  6279. ΓòÉΓòÉΓòÉ 9.4.13. domain naming ΓòÉΓòÉΓòÉ
  6280.  
  6281. domain naming 
  6282.  
  6283. A hierarchical system for naming network resources. 
  6284.  
  6285.  
  6286. ΓòÉΓòÉΓòÉ 9.4.14. dotted-decimal notation ΓòÉΓòÉΓòÉ
  6287.  
  6288. dotted-decimal notation 
  6289.  
  6290. The syntactic representation for a 32-bit integer that consists of four 8-bit 
  6291. numbers, written in base 10 and separated by periods (dots). many internet 
  6292. application programs accept dotted decimal notations in place of destination 
  6293. machine names. 
  6294.  
  6295.  
  6296. ΓòÉΓòÉΓòÉ 9.4.15. double-precision ΓòÉΓòÉΓòÉ
  6297.  
  6298. double-precision 
  6299.  
  6300. A specification that causes a floating-point value to be stored internally in 
  6301. the long format. 
  6302.  
  6303.  
  6304. ΓòÉΓòÉΓòÉ 9.4.16. DPI ΓòÉΓòÉΓòÉ
  6305.  
  6306. DPI 
  6307.  
  6308. Distributed Program Interface. 
  6309.  
  6310.  
  6311. ΓòÉΓòÉΓòÉ 9.4.17. dragging ΓòÉΓòÉΓòÉ
  6312.  
  6313. dragging 
  6314.  
  6315. Moving an object on the display screen as if it were attached to the pointer, 
  6316. or mouse; performed by holding the select button and moving the pointer. 
  6317.  
  6318.  
  6319. ΓòÉΓòÉΓòÉ 9.4.18. drive ΓòÉΓòÉΓòÉ
  6320.  
  6321. drive 
  6322.  
  6323. The device used to read and write data on disks or diskettes. 
  6324.  
  6325.  
  6326. ΓòÉΓòÉΓòÉ 9.4.19. dynamic link library (DLL) ΓòÉΓòÉΓòÉ
  6327.  
  6328. dynamic link library (DLL) 
  6329.  
  6330. A module containing dynamic link routines that is linked at load or run time. 
  6331.  
  6332.  
  6333. ΓòÉΓòÉΓòÉ 9.5. E ΓòÉΓòÉΓòÉ
  6334.  
  6335.  
  6336. ΓòÉΓòÉΓòÉ 9.5.1. EBCDIC ΓòÉΓòÉΓòÉ
  6337.  
  6338. EBCDIC 
  6339.  
  6340. Extended binary-coded decimal interchange code. 
  6341.  
  6342.  
  6343. ΓòÉΓòÉΓòÉ 9.5.2. encapsulation ΓòÉΓòÉΓòÉ
  6344.  
  6345. encapsulation 
  6346.  
  6347. A process used by layered protocols in which a lower level protocol accepts a 
  6348. message from a higher level protocol and places it in the data portion of the 
  6349. low level frame. 
  6350.  
  6351.  
  6352. ΓòÉΓòÉΓòÉ 9.5.3. entry field ΓòÉΓòÉΓòÉ
  6353.  
  6354. entry field 
  6355.  
  6356. A panel element, usually highlighted in some manner and usually with its 
  6357. boundaries indicated, where users type in information. 
  6358.  
  6359.  
  6360. ΓòÉΓòÉΓòÉ 9.5.4. Ethernet ΓòÉΓòÉΓòÉ
  6361.  
  6362. Ethernet 
  6363.  
  6364. The name given to a local area packet-switched network technology invented in 
  6365. the early 1970s by Xerox Incorporated. Ethernet uses a Carrier Sense Multiple 
  6366. Access/Collision Detection (CSMA/CD) mechanism to send packets. 
  6367.  
  6368.  
  6369. ΓòÉΓòÉΓòÉ 9.5.5. extended binary-coded decimal interchange code (EBCDIC) ΓòÉΓòÉΓòÉ
  6370.  
  6371. extended binary-coded decimal interchange code (EBCDIC) 
  6372.  
  6373. A coded character set consisting of 8-bit coded characters. 
  6374.  
  6375.  
  6376. ΓòÉΓòÉΓòÉ 9.5.6. eXternal Data Representation (XDR) ΓòÉΓòÉΓòÉ
  6377.  
  6378. eXternal Data Representation (XDR) 
  6379.  
  6380. A standard developed by SUN Microsystems Incorporated for representing data in 
  6381. machine-independent format. 
  6382.  
  6383.  
  6384. ΓòÉΓòÉΓòÉ 9.6. F ΓòÉΓòÉΓòÉ
  6385.  
  6386.  
  6387. ΓòÉΓòÉΓòÉ 9.6.1. file ΓòÉΓòÉΓòÉ
  6388.  
  6389. file 
  6390.  
  6391. In VM and OS/2, a named set of records stored or processed as a unit. 
  6392. Synonymous with data set in MVS. 
  6393.  
  6394.  
  6395. ΓòÉΓòÉΓòÉ 9.6.2. File Transfer Protocol (FTP) ΓòÉΓòÉΓòÉ
  6396.  
  6397. File Transfer Protocol (FTP) 
  6398.  
  6399. A TCP/IP protocol used for transferring files to and from foreign hosts. FTP 
  6400. also provides the capability to access directories. Password protection is 
  6401. provided as part of the protocol. 
  6402.  
  6403.  
  6404. ΓòÉΓòÉΓòÉ 9.6.3. folder ΓòÉΓòÉΓòÉ
  6405.  
  6406. folder 
  6407.  
  6408. In LaMail, a collection of mail files that share a common attribute, such as 
  6409. userid, location, or subject. 
  6410.  
  6411.  
  6412. ΓòÉΓòÉΓòÉ 9.6.4. foreign host ΓòÉΓòÉΓòÉ
  6413.  
  6414. foreign host 
  6415.  
  6416. Any host on the network including the local host. 
  6417.  
  6418.  
  6419. ΓòÉΓòÉΓòÉ 9.6.5. foreign network ΓòÉΓòÉΓòÉ
  6420.  
  6421. foreign network 
  6422.  
  6423. In an internet, any other network interconnected to the local network by one or 
  6424. more intermediate gateways or routers. 
  6425.  
  6426.  
  6427. ΓòÉΓòÉΓòÉ 9.6.6. foreign node ΓòÉΓòÉΓòÉ
  6428.  
  6429. foreign node 
  6430.  
  6431. See foreign host. 
  6432.  
  6433.  
  6434. ΓòÉΓòÉΓòÉ 9.6.7. FTAM ΓòÉΓòÉΓòÉ
  6435.  
  6436. FTAM 
  6437.  
  6438. File Transfer Access and Management. 
  6439.  
  6440.  
  6441. ΓòÉΓòÉΓòÉ 9.6.8. FTP ΓòÉΓòÉΓòÉ
  6442.  
  6443. FTP 
  6444.  
  6445. File Transfer Protocol. 
  6446.  
  6447.  
  6448. ΓòÉΓòÉΓòÉ 9.7. G ΓòÉΓòÉΓòÉ
  6449.  
  6450.  
  6451. ΓòÉΓòÉΓòÉ 9.7.1. gateway ΓòÉΓòÉΓòÉ
  6452.  
  6453. gateway 
  6454.  
  6455.  1. A functional unit that interconnects a local data network with another 
  6456.     network having different protocols. 
  6457.  
  6458.  2. A host that connects a TCP/IP network to a non-TCP/IP network at the 
  6459.     application layer. See also router. 
  6460.  
  6461.  
  6462. ΓòÉΓòÉΓòÉ 9.8. H ΓòÉΓòÉΓòÉ
  6463.  
  6464.  
  6465. ΓòÉΓòÉΓòÉ 9.8.1. handle ΓòÉΓòÉΓòÉ
  6466.  
  6467. handle 
  6468.  
  6469. A temporary data representation that identifies a file. 
  6470.  
  6471.  
  6472. ΓòÉΓòÉΓòÉ 9.8.2. header file ΓòÉΓòÉΓòÉ
  6473.  
  6474. header file 
  6475.  
  6476. A file that contains constant declarations, type declarations, and variable 
  6477. declarations and assignments. Header files are supplied with all programming 
  6478. interfaces. 
  6479.  
  6480.  
  6481. ΓòÉΓòÉΓòÉ 9.8.3. High Performance File System (HPFS) ΓòÉΓòÉΓòÉ
  6482.  
  6483. High Performance File System (HPFS) 
  6484.  
  6485. An installable file system (IFS) designed to provide better performance than 
  6486. the existing file allocation table (FAT) based file system. HPFS is designed to 
  6487. provide extremely fast access to very large disk volumes. 
  6488.  
  6489.  
  6490. ΓòÉΓòÉΓòÉ 9.8.4. hop count ΓòÉΓòÉΓòÉ
  6491.  
  6492. hop count 
  6493.  
  6494. The number of hosts through which a packet passes on its way to its 
  6495. destination. 
  6496.  
  6497.  
  6498. ΓòÉΓòÉΓòÉ 9.8.5. host computer ΓòÉΓòÉΓòÉ
  6499.  
  6500. host computer 
  6501.  
  6502.  1. In a computer network, a computer that usually performs network control 
  6503.     functions and provides end users with services such as computation and 
  6504.     database access. 
  6505.  
  6506.  2. The primary or controlling computer in a multiple computer installation. 
  6507.  
  6508.  3. A computer used to prepare programs for use on another computer or on 
  6509.     another data processing system; for example, a computer used to compile, 
  6510.     link edit, or test programs to be used on another system. 
  6511.  
  6512.  4. A computer connected to a network, which provides an access method to that 
  6513.     network. 
  6514.  
  6515.  
  6516. ΓòÉΓòÉΓòÉ 9.8.6. HPFS ΓòÉΓòÉΓòÉ
  6517.  
  6518. HPFS 
  6519.  
  6520. High Performance File System 
  6521.  
  6522.  
  6523. ΓòÉΓòÉΓòÉ 9.9. I ΓòÉΓòÉΓòÉ
  6524.  
  6525.  
  6526. ΓòÉΓòÉΓòÉ 9.9.1. ICAT (Installation Configuration Automation Tool) ΓòÉΓòÉΓòÉ
  6527.  
  6528. ICAT (Installation Configuration Automation Tool) 
  6529.  
  6530. TCP/IP for OS/2 provides this application for installing and configuring TCP/IP 
  6531. for OS/2. 
  6532.  
  6533.  
  6534. ΓòÉΓòÉΓòÉ 9.9.2. ICMP ΓòÉΓòÉΓòÉ
  6535.  
  6536. ICMP 
  6537.  
  6538. Internet Control Message Protocol. 
  6539.  
  6540.  
  6541. ΓòÉΓòÉΓòÉ 9.9.3. IEEE ΓòÉΓòÉΓòÉ
  6542.  
  6543. IEEE 
  6544.  
  6545. Institute of Electrical and Electronic Engineers. 
  6546.  
  6547.  
  6548. ΓòÉΓòÉΓòÉ 9.9.4. include file ΓòÉΓòÉΓòÉ
  6549.  
  6550. include file 
  6551.  
  6552. A file that contains preprocessor text, which is called by a program, using a 
  6553. standard programming call. Synonymous with header file. 
  6554.  
  6555.  
  6556. ΓòÉΓòÉΓòÉ 9.9.5. installation ΓòÉΓòÉΓòÉ
  6557.  
  6558. installation 
  6559.  
  6560. The process of placing one or more OS/2 components on a personal computer's 
  6561. fixed disk. 
  6562.  
  6563.  
  6564. ΓòÉΓòÉΓòÉ 9.9.6. instance ΓòÉΓòÉΓòÉ
  6565.  
  6566. instance 
  6567.  
  6568. One of the three parts of a Kerberos name. Instance specifies the machine on 
  6569. which a service is run. 
  6570.  
  6571.  
  6572. ΓòÉΓòÉΓòÉ 9.9.7. Institute of Electrical and Electronic Engineers (IEEE) ΓòÉΓòÉΓòÉ
  6573.  
  6574. Institute of Electrical and Electronic Engineers (IEEE) 
  6575.  
  6576. An electronics industry organization. 
  6577.  
  6578.  
  6579. ΓòÉΓòÉΓòÉ 9.9.8. Integrated Services Digital Network (ISDN) ΓòÉΓòÉΓòÉ
  6580.  
  6581. Integrated Services Digital Network (ISDN) 
  6582.  
  6583. A digital end-to-end telecommunication network that supports multiple services 
  6584. including, but not limited to, voice and data. 
  6585.  
  6586.  
  6587. ΓòÉΓòÉΓòÉ 9.9.9. interactive ΓòÉΓòÉΓòÉ
  6588.  
  6589. interactive 
  6590.  
  6591. Pertaining to a program or a system that alternately accepts input and then 
  6592. responds. An interactive system is conversational, that is, a continuous dialog 
  6593. exists between user and system. See batch. 
  6594.  
  6595.  
  6596. ΓòÉΓòÉΓòÉ 9.9.10. International Organization for Standardization (ISO) ΓòÉΓòÉΓòÉ
  6597.  
  6598. International Organization for Standardization (ISO) 
  6599.  
  6600. An organization of national standards bodies from various countries established 
  6601. to promote development of standards to facilitate international exchange of 
  6602. goods and services, and develop cooperation in intellectual, scientific, 
  6603. technological, and economic activity. 
  6604.  
  6605.  
  6606. ΓòÉΓòÉΓòÉ 9.9.11. internet or internetwork ΓòÉΓòÉΓòÉ
  6607.  
  6608. internet or internetwork 
  6609.  
  6610. A collection of packet switching networks interconnected by gateways, routers, 
  6611. bridges, and hosts to function as a single, coordinated, virtual network. 
  6612.  
  6613.  
  6614. ΓòÉΓòÉΓòÉ 9.9.12. internet address ΓòÉΓòÉΓòÉ
  6615.  
  6616. internet address 
  6617.  
  6618. The unique 32-bit address identifying each node in an internet. See also 
  6619. address. 
  6620.  
  6621.  
  6622. ΓòÉΓòÉΓòÉ 9.9.13. Internet Control Message Protocol (ICMP) ΓòÉΓòÉΓòÉ
  6623.  
  6624. Internet Control Message Protocol (ICMP) 
  6625.  
  6626. The part of the Internet Protocol layer that handles error messages and control 
  6627. messages. 
  6628.  
  6629.  
  6630. ΓòÉΓòÉΓòÉ 9.9.14. Internet Protocol (IP) ΓòÉΓòÉΓòÉ
  6631.  
  6632. Internet Protocol (IP) 
  6633.  
  6634. The TCP/IP layer between the higher level host-to-host protocol and the local 
  6635. network protocols. IP uses local area network protocols to carry packets, in 
  6636. the form of datagrams, to the next gateway, router, or destination host. 
  6637.  
  6638.  
  6639. ΓòÉΓòÉΓòÉ 9.9.15. interoperability ΓòÉΓòÉΓòÉ
  6640.  
  6641. interoperability 
  6642.  
  6643. The capability of different hardware and software by different vendors to 
  6644. effectively communicate together. 
  6645.  
  6646.  
  6647. ΓòÉΓòÉΓòÉ 9.9.16. IP ΓòÉΓòÉΓòÉ
  6648.  
  6649. IP 
  6650.  
  6651. Internet Protocol. 
  6652.  
  6653.  
  6654. ΓòÉΓòÉΓòÉ 9.9.17. ISDN ΓòÉΓòÉΓòÉ
  6655.  
  6656. ISDN 
  6657.  
  6658. Integrated Services Digital Network. 
  6659.  
  6660.  
  6661. ΓòÉΓòÉΓòÉ 9.9.18. ISO ΓòÉΓòÉΓòÉ
  6662.  
  6663. ISO 
  6664.  
  6665. International Organization for Standardization. 
  6666.  
  6667.  
  6668. ΓòÉΓòÉΓòÉ 9.10. K ΓòÉΓòÉΓòÉ
  6669.  
  6670.  
  6671. ΓòÉΓòÉΓòÉ 9.10.1. Kerberos Authentication System ΓòÉΓòÉΓòÉ
  6672.  
  6673. Kerberos Authentication System 
  6674.  
  6675. An authentication mechanism used to check authorization at the user level. 
  6676.  
  6677.  
  6678. ΓòÉΓòÉΓòÉ 9.11. L ΓòÉΓòÉΓòÉ
  6679.  
  6680.  
  6681. ΓòÉΓòÉΓòÉ 9.11.1. LaMail ΓòÉΓòÉΓòÉ
  6682.  
  6683. LaMail 
  6684.  
  6685. The client that communicates with the OS/2 Presentation Manager to manage mail 
  6686. on the network. 
  6687.  
  6688.  
  6689. ΓòÉΓòÉΓòÉ 9.11.2. LAN ΓòÉΓòÉΓòÉ
  6690.  
  6691. LAN 
  6692.  
  6693. Local area network. 
  6694.  
  6695.  
  6696. ΓòÉΓòÉΓòÉ 9.11.3. Line printer daemon (LPD) ΓòÉΓòÉΓòÉ
  6697.  
  6698. Line printer daemon (LPD) 
  6699.  
  6700. The remote printer server that allows other hosts to print on a printer local 
  6701. to your host. 
  6702.  
  6703.  
  6704. ΓòÉΓòÉΓòÉ 9.11.4. Line Printer Protocol ΓòÉΓòÉΓòÉ
  6705.  
  6706. Line Printer Protocol 
  6707.  
  6708. A TCP/IP protocol used for printing files on printers attached to remote hosts. 
  6709.  
  6710.  
  6711. ΓòÉΓòÉΓòÉ 9.11.5. local area network (LAN) ΓòÉΓòÉΓòÉ
  6712.  
  6713. local area network (LAN) 
  6714.  
  6715. A data network located on the user's premises in which serial transmission is 
  6716. used for direct data communication among data stations. 
  6717.  
  6718.  
  6719. ΓòÉΓòÉΓòÉ 9.11.6. local host ΓòÉΓòÉΓòÉ
  6720.  
  6721. local host 
  6722.  
  6723. In an internet, the computer to which a user's terminal is directly connected 
  6724. without using the internet. 
  6725.  
  6726.  
  6727. ΓòÉΓòÉΓòÉ 9.11.7. local network ΓòÉΓòÉΓòÉ
  6728.  
  6729. local network 
  6730.  
  6731. The portion of a network that is physically connected to the host without 
  6732. intermediate gateways or routers. 
  6733.  
  6734.  
  6735. ΓòÉΓòÉΓòÉ 9.11.8. Logical ANDing ΓòÉΓòÉΓòÉ
  6736.  
  6737. Logical ANDing 
  6738.  
  6739. When the Boolean operator AND is applied to two bits, the result is one when 
  6740. both bits are one; otherwise, the result is zero. When two bytes are ANDed, 
  6741. each pair of bits is handled separately; there is no connection from one bit 
  6742. position to another. 
  6743.  
  6744.  
  6745. ΓòÉΓòÉΓòÉ 9.11.9. Loopback ΓòÉΓòÉΓòÉ
  6746.  
  6747. Loopback 
  6748.  
  6749. The local loopback interface bypasses the network interface drivers to provide 
  6750. a direct internal connection back to the local internet protocol support. 
  6751.  
  6752.  
  6753. ΓòÉΓòÉΓòÉ 9.11.10. LPD ΓòÉΓòÉΓòÉ
  6754.  
  6755. LPD 
  6756.  
  6757. Line printer daemon. 
  6758.  
  6759.  
  6760. ΓòÉΓòÉΓòÉ 9.11.11. LPR ΓòÉΓòÉΓòÉ
  6761.  
  6762. LPR 
  6763.  
  6764. A client command that allows the local host to submit a file to be printed on a 
  6765. remote print server. 
  6766.  
  6767.  
  6768. ΓòÉΓòÉΓòÉ 9.12. M ΓòÉΓòÉΓòÉ
  6769.  
  6770.  
  6771. ΓòÉΓòÉΓòÉ 9.12.1. Management Information Base (MIB) ΓòÉΓòÉΓòÉ
  6772.  
  6773. Management Information Base (MIB) 
  6774.  
  6775. A standard used to define SNMP objects, such as packet counts and routing 
  6776. tables, that are in a TCP/IP environment. 
  6777.  
  6778.  
  6779. ΓòÉΓòÉΓòÉ 9.12.2. mapping ΓòÉΓòÉΓòÉ
  6780.  
  6781. mapping 
  6782.  
  6783. The process of relating internet addresses to physical addresses in the 
  6784. network. 
  6785.  
  6786.  
  6787. ΓòÉΓòÉΓòÉ 9.12.3. MARK ΓòÉΓòÉΓòÉ
  6788.  
  6789. MARK 
  6790.  
  6791. A Presentation Manager function that marks a section of text to be copied or 
  6792. cut. 
  6793.  
  6794.  
  6795. ΓòÉΓòÉΓòÉ 9.12.4. marshall ΓòÉΓòÉΓòÉ
  6796.  
  6797. marshall 
  6798.  
  6799. To copy data into an RPC packet. Stubs perform marshalling. See also 
  6800. unmarshall. 
  6801.  
  6802.  
  6803. ΓòÉΓòÉΓòÉ 9.12.5. mask ΓòÉΓòÉΓòÉ
  6804.  
  6805. mask 
  6806.  
  6807.  1. A pattern of characters used to control retention or elimination of 
  6808.     portions of another pattern of characters. 
  6809.  
  6810.  2. To use a pattern of characters to control retention or elimination of 
  6811.     another pattern of characters. 
  6812.  
  6813.  3. A pattern of characters that controls the keeping, deleting, or testing of 
  6814.     portions of another pattern of characters. 
  6815.  
  6816.  
  6817. ΓòÉΓòÉΓòÉ 9.12.6. menu ΓòÉΓòÉΓòÉ
  6818.  
  6819. menu 
  6820.  
  6821. A type of panel that consists of one or more selection fields. 
  6822.  
  6823.  
  6824. ΓòÉΓòÉΓòÉ 9.12.7. menu item ΓòÉΓòÉΓòÉ
  6825.  
  6826. menu item 
  6827.  
  6828. A selection item on a pull-down menu. 
  6829.  
  6830.  
  6831. ΓòÉΓòÉΓòÉ 9.12.8. MIB ΓòÉΓòÉΓòÉ
  6832.  
  6833. MIB 
  6834.  
  6835. Management Information Base. 
  6836.  
  6837.  
  6838. ΓòÉΓòÉΓòÉ 9.12.9. mouse ΓòÉΓòÉΓòÉ
  6839.  
  6840. mouse 
  6841.  
  6842. A device that is used to move a pointer on the screen and select items. 
  6843.  
  6844.  
  6845. ΓòÉΓòÉΓòÉ 9.12.10. multitasking ΓòÉΓòÉΓòÉ
  6846.  
  6847. multitasking 
  6848.  
  6849. A mode of operation that provides for the concurrent performance execution of 
  6850. two or more tasks. 
  6851.  
  6852.  
  6853. ΓòÉΓòÉΓòÉ 9.12.11. MVS ΓòÉΓòÉΓòÉ
  6854.  
  6855. MVS 
  6856.  
  6857. Multiple Virtual Storage. 
  6858.  
  6859.  
  6860. ΓòÉΓòÉΓòÉ 9.13. N ΓòÉΓòÉΓòÉ
  6861.  
  6862.  
  6863. ΓòÉΓòÉΓòÉ 9.13.1. name server ΓòÉΓòÉΓòÉ
  6864.  
  6865. name server 
  6866.  
  6867. The server that stores resource records about hosts. 
  6868.  
  6869.  
  6870. ΓòÉΓòÉΓòÉ 9.13.2. NCP ΓòÉΓòÉΓòÉ
  6871.  
  6872. NCP 
  6873.  
  6874. Network Control Program. 
  6875.  
  6876.  
  6877. ΓòÉΓòÉΓòÉ 9.13.3. NCS ΓòÉΓòÉΓòÉ
  6878.  
  6879. NCS 
  6880.  
  6881. Network Computing System. 
  6882.  
  6883.  
  6884. ΓòÉΓòÉΓòÉ 9.13.4. network ΓòÉΓòÉΓòÉ
  6885.  
  6886. network 
  6887.  
  6888. An arrangement of nodes and connecting branches. Connections are made between 
  6889. data stations. 
  6890.  
  6891.  
  6892. ΓòÉΓòÉΓòÉ 9.13.5. network adapter ΓòÉΓòÉΓòÉ
  6893.  
  6894. network adapter 
  6895.  
  6896. A physical device, and its associated software, that enables a processor or 
  6897. controller to be connected to a network. 
  6898.  
  6899.  
  6900. ΓòÉΓòÉΓòÉ 9.13.6. network administrator ΓòÉΓòÉΓòÉ
  6901.  
  6902. network administrator 
  6903.  
  6904. The person responsible for the installation, management, control, and 
  6905. configuration of a network. 
  6906.  
  6907.  
  6908. ΓòÉΓòÉΓòÉ 9.13.7. Network Computing System (NCS) ΓòÉΓòÉΓòÉ
  6909.  
  6910. Network Computing System (NCS) 
  6911.  
  6912. Network Computing System. A set of software components developed by Apollo that 
  6913. conform to the Network Computing Architecture (NCA). NCS is made up of two 
  6914. parts: the nidl Compiler and Network Computing Kernel (NCK). 
  6915.  
  6916.  
  6917. ΓòÉΓòÉΓòÉ 9.13.8. network control program (NCP) ΓòÉΓòÉΓòÉ
  6918.  
  6919. network control program (NCP) 
  6920.  
  6921. An IBM-licensed program that provides communication controller support for 
  6922. single-domain, multiple-domain, and interconnected network capability. 
  6923.  
  6924.  
  6925. ΓòÉΓòÉΓòÉ 9.13.9. network elements ΓòÉΓòÉΓòÉ
  6926.  
  6927. network elements 
  6928.  
  6929. As defined in the SNMP architecture, network elements are gateways, routers, 
  6930. and hosts that contain management agents responsible for performing the network 
  6931. management functions requested by the network management stations. 
  6932.  
  6933.  
  6934. ΓòÉΓòÉΓòÉ 9.13.10. network file system (NFS) ΓòÉΓòÉΓòÉ
  6935.  
  6936. network file system (NFS) 
  6937.  
  6938. The NFS protocol, which was developed by Sun Microsystems Incorporated, allows 
  6939. computers in a network to access each other's file systems. Once accessed, the 
  6940. file system appears to reside on the local host. 
  6941.  
  6942.  
  6943. ΓòÉΓòÉΓòÉ 9.13.11. network management stations ΓòÉΓòÉΓòÉ
  6944.  
  6945. network management stations 
  6946.  
  6947. As defined in the SNMP architecture, network management stations, or SNMP 
  6948. clients, execute management applications that monitor and control network 
  6949. elements. 
  6950.  
  6951.  
  6952. ΓòÉΓòÉΓòÉ 9.13.12. NFS ΓòÉΓòÉΓòÉ
  6953.  
  6954. NFS 
  6955.  
  6956. Network file system. 
  6957.  
  6958.  
  6959. ΓòÉΓòÉΓòÉ 9.13.13. node ΓòÉΓòÉΓòÉ
  6960.  
  6961. node 
  6962.  
  6963.  1. In a network, a point at which one or more functional units connect 
  6964.     channels or data circuits. 
  6965.  
  6966.  2. In a network topology, the point at an end of a branch. 
  6967.  
  6968.  
  6969. ΓòÉΓòÉΓòÉ 9.14. O ΓòÉΓòÉΓòÉ
  6970.  
  6971.  
  6972. ΓòÉΓòÉΓòÉ 9.14.1. octet ΓòÉΓòÉΓòÉ
  6973.  
  6974. octet 
  6975.  
  6976. A byte composed of eight binary elements. 
  6977.  
  6978.  
  6979. ΓòÉΓòÉΓòÉ 9.14.2. open system ΓòÉΓòÉΓòÉ
  6980.  
  6981. open system 
  6982.  
  6983. A system with specified standards and that therefore can be readily connected 
  6984. to other systems that comply with the same standards. 
  6985.  
  6986.  
  6987. ΓòÉΓòÉΓòÉ 9.14.3. Open Systems Interconnection (OSI) ΓòÉΓòÉΓòÉ
  6988.  
  6989. Open Systems Interconnection (OSI) 
  6990.  
  6991.  1. The interconnection of open systems in accordance with specific ISO 
  6992.     standards. 
  6993.  
  6994.  2. The use of standardized procedures to enable the interconnection of data 
  6995.     processing systems. 
  6996.  
  6997.  
  6998. ΓòÉΓòÉΓòÉ 9.14.4. OS/2 ΓòÉΓòÉΓòÉ
  6999.  
  7000. OS/2 
  7001.  
  7002. Operating System/2. 
  7003.  
  7004.  
  7005. ΓòÉΓòÉΓòÉ 9.14.5. OSI ΓòÉΓòÉΓòÉ
  7006.  
  7007. OSI 
  7008.  
  7009. Open Systems Interconnection. 
  7010.  
  7011.  
  7012. ΓòÉΓòÉΓòÉ 9.15. P ΓòÉΓòÉΓòÉ
  7013.  
  7014.  
  7015. ΓòÉΓòÉΓòÉ 9.15.1. packet ΓòÉΓòÉΓòÉ
  7016.  
  7017. packet 
  7018.  
  7019. A sequence of binary digits, including data and control signals, that is 
  7020. transmitted and switched as a composite whole. 
  7021.  
  7022.  
  7023. ΓòÉΓòÉΓòÉ 9.15.2. parameter ΓòÉΓòÉΓòÉ
  7024.  
  7025. parameter 
  7026.  
  7027. A variable that is given a constant value for a specified application. 
  7028.  
  7029.  
  7030. ΓòÉΓòÉΓòÉ 9.15.3. parse ΓòÉΓòÉΓòÉ
  7031.  
  7032. parse 
  7033.  
  7034. To analyze the operands entered with a command. 
  7035.  
  7036.  
  7037. ΓòÉΓòÉΓòÉ 9.15.4. passive open ΓòÉΓòÉΓòÉ
  7038.  
  7039. passive open 
  7040.  
  7041. The state of a connection that is prepared to provide a service on demand. 
  7042. Contrast with active open. 
  7043.  
  7044.  
  7045. ΓòÉΓòÉΓòÉ 9.15.5. path ΓòÉΓòÉΓòÉ
  7046.  
  7047. path 
  7048.  
  7049. The course or route of drives and subdirectories leading from the root 
  7050. directory and drive of an operating system to where files or data information 
  7051. are stored. 
  7052.  
  7053.  
  7054. ΓòÉΓòÉΓòÉ 9.15.6. PC ΓòÉΓòÉΓòÉ
  7055.  
  7056. PC 
  7057.  
  7058. Personal computer. 
  7059.  
  7060.  
  7061. ΓòÉΓòÉΓòÉ 9.15.7. PC Network ΓòÉΓòÉΓòÉ
  7062.  
  7063. PC Network 
  7064.  
  7065. A low-cost broadband network that allows attached IBM personal computers, such 
  7066. as IBM 5150 Personal Computers, IBM Computer ATs, IBM PC/XTs, and IBM Portable 
  7067. Personal Computers to communicate and to share resources. 
  7068.  
  7069.  
  7070. ΓòÉΓòÉΓòÉ 9.15.8. PDU ΓòÉΓòÉΓòÉ
  7071.  
  7072. PDU 
  7073.  
  7074. Protocol Data Units 
  7075.  
  7076.  
  7077. ΓòÉΓòÉΓòÉ 9.15.9. peer-to-peer ΓòÉΓòÉΓòÉ
  7078.  
  7079. peer-to-peer 
  7080.  
  7081. In network architecture, any functional unit that resides in the same layer as 
  7082. another entity. 
  7083.  
  7084.  
  7085. ΓòÉΓòÉΓòÉ 9.15.10. PING ΓòÉΓòÉΓòÉ
  7086.  
  7087. PING 
  7088.  
  7089. The command that sends an ICMP Echo Request packet to a gateway, router, or 
  7090. host with the expectation of receiving a reply. 
  7091.  
  7092.  
  7093. ΓòÉΓòÉΓòÉ 9.15.11. piping ΓòÉΓòÉΓòÉ
  7094.  
  7095. piping 
  7096.  
  7097. in advanced DOS, a feature that allows the output of a program as it is 
  7098. displayed on the screen to be used as input to another program without 
  7099. reentering the data on the keyboard. 
  7100.  
  7101.  
  7102. ΓòÉΓòÉΓòÉ 9.15.12. port ΓòÉΓòÉΓòÉ
  7103.  
  7104. port 
  7105.  
  7106.  1. An endpoint for communication between devices, generally referring to a 
  7107.     logical connection. 
  7108.  
  7109.  2. A 16-bit number identifying a particular Transmission Control Protocol or 
  7110.     User Datagram Protocol resource within a given TCP/IP node. 
  7111.  
  7112.  
  7113. ΓòÉΓòÉΓòÉ 9.15.13. Portmapper ΓòÉΓòÉΓòÉ
  7114.  
  7115. Portmapper 
  7116.  
  7117. A program that maps client programs to the port numbers of server programs. 
  7118. Portmapper is used with Remote Procedure Call (RPC) programs. 
  7119.  
  7120.  
  7121. ΓòÉΓòÉΓòÉ 9.15.14. Presentation Manager ΓòÉΓòÉΓòÉ
  7122.  
  7123. Presentation Manager 
  7124.  
  7125. A component of OS/2 that provides a complete graphics-based user interface, 
  7126. with pull-down windows, action bars, and layered menus. 
  7127.  
  7128.  
  7129. ΓòÉΓòÉΓòÉ 9.15.15. principal name ΓòÉΓòÉΓòÉ
  7130.  
  7131. principal name 
  7132.  
  7133. One of the three parts of a Kerberos name. Principal name specifies the name of 
  7134. a user or service. 
  7135.  
  7136.  
  7137. ΓòÉΓòÉΓòÉ 9.15.16. process ΓòÉΓòÉΓòÉ
  7138.  
  7139. process 
  7140.  
  7141.  1. A unique, finite course of events defined by its purpose or by its effect, 
  7142.     achieved under defined conditions. 
  7143.  
  7144.  2. Any operation or combination of operations on data. 
  7145.  
  7146.  3. A function being performed or waiting to be performed. 
  7147.  
  7148.  4. A program in operation; for example, a daemon is a system process that is 
  7149.     always running on the system. 
  7150.  
  7151.  
  7152. ΓòÉΓòÉΓòÉ 9.15.17. protocol ΓòÉΓòÉΓòÉ
  7153.  
  7154. protocol 
  7155.  
  7156. A set of semantic and syntactic rules that determines the behavior of 
  7157. functional units in achieving communication. Protocols can determine low-level 
  7158. details of machine-to-machine interfaces, such as the order in which bits from 
  7159. a byte are sent; they can also determine high-level exchanges between 
  7160. application programs, such as file transfer. 
  7161.  
  7162.  
  7163. ΓòÉΓòÉΓòÉ 9.15.18. Protocol Data Unit (PDU) ΓòÉΓòÉΓòÉ
  7164.  
  7165. Protocol Data Unit (PDU) 
  7166.  
  7167. A set of commands used by the SNMP agent to request management station data. 
  7168.  
  7169.  
  7170. ΓòÉΓòÉΓòÉ 9.15.19. protocol suite ΓòÉΓòÉΓòÉ
  7171.  
  7172. protocol suite 
  7173.  
  7174. A set of protocols that cooperate to handle the transmission tasks for a data 
  7175. communication system. 
  7176.  
  7177.  
  7178. ΓòÉΓòÉΓòÉ 9.15.20. pull-down ΓòÉΓòÉΓòÉ
  7179.  
  7180. pull-down 
  7181.  
  7182. An extension of the action bar that displays a list of choices that are 
  7183. available for a selected action bar choice. 
  7184.  
  7185.  
  7186. ΓòÉΓòÉΓòÉ 9.16. R ΓòÉΓòÉΓòÉ
  7187.  
  7188.  
  7189. ΓòÉΓòÉΓòÉ 9.16.1. RAM ΓòÉΓòÉΓòÉ
  7190.  
  7191. RAM 
  7192.  
  7193. Random Access Memory. 
  7194.  
  7195.  
  7196. ΓòÉΓòÉΓòÉ 9.16.2. Random Access Memory (RAM) ΓòÉΓòÉΓòÉ
  7197.  
  7198. Random Access Memory (RAM) 
  7199.  
  7200. A memory device into which data is entered and from which data is retrieved in 
  7201. a nonsequential manner. 
  7202.  
  7203.  
  7204. ΓòÉΓòÉΓòÉ 9.16.3. RARP ΓòÉΓòÉΓòÉ
  7205.  
  7206. RARP 
  7207.  
  7208. Reverse Address Resolution Protocol. 
  7209.  
  7210.  
  7211. ΓòÉΓòÉΓòÉ 9.16.4. realm ΓòÉΓòÉΓòÉ
  7212.  
  7213. realm 
  7214.  
  7215. One of the three parts of a Kerberos name. Realm specifies the service that 
  7216. provides authentication for the principal name. Realm can also specify the name 
  7217. of an administrative entry that is responsible for its own database on its own 
  7218. Kerberos machine. 
  7219.  
  7220.  
  7221. ΓòÉΓòÉΓòÉ 9.16.5. Remote Execution Protocol (REXEC) ΓòÉΓòÉΓòÉ
  7222.  
  7223. Remote Execution Protocol (REXEC) 
  7224.  
  7225. A protocol that allows the execution of a command or program on a foreign host. 
  7226. The local host receives the results of the command execution. This protocol 
  7227. uses the REXEC command. 
  7228.  
  7229.  
  7230. ΓòÉΓòÉΓòÉ 9.16.6. remote host ΓòÉΓòÉΓòÉ
  7231.  
  7232. remote host 
  7233.  
  7234. Any foreign host, not including the local host. 
  7235.  
  7236.  
  7237. ΓòÉΓòÉΓòÉ 9.16.7. remote logon ΓòÉΓòÉΓòÉ
  7238.  
  7239. remote logon 
  7240.  
  7241. The process by which a terminal user establishes a terminal session with a 
  7242. remote host. 
  7243.  
  7244.  
  7245. ΓòÉΓòÉΓòÉ 9.16.8. Remote Procedure Call (RPC) ΓòÉΓòÉΓòÉ
  7246.  
  7247. Remote Procedure Call (RPC) 
  7248.  
  7249. A facility that a client uses to request the execution of a procedure call from 
  7250. a server. This facility includes a library of procedures and an eXternal data 
  7251. representation. 
  7252.  
  7253.  
  7254. ΓòÉΓòÉΓòÉ 9.16.9. Request For Comments (RFC) ΓòÉΓòÉΓòÉ
  7255.  
  7256. Request For Comments (RFC) 
  7257.  
  7258. A series of documents that covers a broad range of topics affecting 
  7259. internetwork communication. Some RFCs are established as internet standards. 
  7260.  
  7261.  
  7262. ΓòÉΓòÉΓòÉ 9.16.10. resolver ΓòÉΓòÉΓòÉ
  7263.  
  7264. resolver 
  7265.  
  7266. A program or subroutine that obtains information from a name server or local 
  7267. table for use by the calling program. 
  7268.  
  7269.  
  7270. ΓòÉΓòÉΓòÉ 9.16.11. resource records ΓòÉΓòÉΓòÉ
  7271.  
  7272. resource records 
  7273.  
  7274. Individual records of data used by the Domain Name System. Examples of resource 
  7275. records include the following: a host's Internet Protocol addresses, preferred 
  7276. mail addresses, and aliases. 
  7277.  
  7278.  
  7279. ΓòÉΓòÉΓòÉ 9.16.12. return code ΓòÉΓòÉΓòÉ
  7280.  
  7281. return code 
  7282.  
  7283.  1. A code used to influence the execution of succeeding instructions. 
  7284.  
  7285.  2. A value returned to a program to indicate the results of an operation 
  7286.     requested by that program. 
  7287.  
  7288.  
  7289. ΓòÉΓòÉΓòÉ 9.16.13. Reverse Address Resolution Protocol (RARP) ΓòÉΓòÉΓòÉ
  7290.  
  7291. Reverse Address Resolution Protocol (RARP) 
  7292.  
  7293. A protocol that maintains a database of mappings between physical hardware 
  7294. addresses and IP addresses. 
  7295.  
  7296.  
  7297. ΓòÉΓòÉΓòÉ 9.16.14. REXEC ΓòÉΓòÉΓòÉ
  7298.  
  7299. REXEC 
  7300.  
  7301. Remote Execution Protocol. 
  7302.  
  7303.  
  7304. ΓòÉΓòÉΓòÉ 9.16.15. RFC ΓòÉΓòÉΓòÉ
  7305.  
  7306. RFC 
  7307.  
  7308. Request For Comments. 
  7309.  
  7310.  
  7311. ΓòÉΓòÉΓòÉ 9.16.16. RIP ΓòÉΓòÉΓòÉ
  7312.  
  7313. RIP 
  7314.  
  7315. Routing Information Protocol. 
  7316.  
  7317.  
  7318. ΓòÉΓòÉΓòÉ 9.16.17. router ΓòÉΓòÉΓòÉ
  7319.  
  7320. router 
  7321.  
  7322. A device that connects networks at the ISO Network Layer. A router is 
  7323. protocol-dependent and connects only networks operating the same protocol. 
  7324. Routers do more than transmit data; they also select the best transmission 
  7325. paths and optimum sizes for packets. In TCP/IP, routers operate at the 
  7326. Internetwork layer. See also gateway. 
  7327.  
  7328.  
  7329. ΓòÉΓòÉΓòÉ 9.16.18. Routing Information Protocol (RIP) ΓòÉΓòÉΓòÉ
  7330.  
  7331. Routing Information Protocol (RIP) 
  7332.  
  7333. The protocol that maintains routing table entries for gateways, routers, and 
  7334. hosts. 
  7335.  
  7336.  
  7337. ΓòÉΓòÉΓòÉ 9.16.19. routing table ΓòÉΓòÉΓòÉ
  7338.  
  7339. routing table 
  7340.  
  7341. A list of network numbers and the information needed to route packets to each. 
  7342.  
  7343.  
  7344. ΓòÉΓòÉΓòÉ 9.16.20. RPC ΓòÉΓòÉΓòÉ
  7345.  
  7346. RPC 
  7347.  
  7348. Remote Procedure Call. 
  7349.  
  7350.  
  7351. ΓòÉΓòÉΓòÉ 9.17. S ΓòÉΓòÉΓòÉ
  7352.  
  7353.  
  7354. ΓòÉΓòÉΓòÉ 9.17.1. Sendmail ΓòÉΓòÉΓòÉ
  7355.  
  7356. Sendmail 
  7357.  
  7358. The OS/2 mail server that uses Simple Mail Transfer Protocol to route mail from 
  7359. one host to another host on the network. 
  7360.  
  7361.  
  7362. ΓòÉΓòÉΓòÉ 9.17.2. serial line ΓòÉΓòÉΓòÉ
  7363.  
  7364. serial line 
  7365.  
  7366. A network media that is a de facto standard, not an international standard, 
  7367. commonly used for point-to-point TCP/IP connections. Generally, a serial line 
  7368. consists of an RS-232 connection into a modem and over a telephone line. 
  7369.  
  7370.  
  7371. ΓòÉΓòÉΓòÉ 9.17.3. server ΓòÉΓòÉΓòÉ
  7372.  
  7373. server 
  7374.  
  7375. A function that provides services for users. A machine can run client and 
  7376. server processes at the same time. 
  7377.  
  7378.  
  7379. ΓòÉΓòÉΓòÉ 9.17.4. Simple Mail Transfer Protocol (SMTP) ΓòÉΓòÉΓòÉ
  7380.  
  7381. Simple Mail Transfer Protocol (SMTP) 
  7382.  
  7383. A TCP/IP application protocol used to transfer mail between users on different 
  7384. systems. SMTP specifies how mail systems interact and the format of control 
  7385. messages they use to transfer mail. 
  7386.  
  7387.  
  7388. ΓòÉΓòÉΓòÉ 9.17.5. Simple Network Management Protocol (SNMP) ΓòÉΓòÉΓòÉ
  7389.  
  7390. Simple Network Management Protocol (SNMP) 
  7391.  
  7392. A protocol that allows network management by elements, such as gateways, 
  7393. routers, and hosts. This protocol provides a means of communication between 
  7394. network elements regarding network resources. 
  7395.  
  7396.  
  7397. ΓòÉΓòÉΓòÉ 9.17.6. SMI ΓòÉΓòÉΓòÉ
  7398.  
  7399. SMI 
  7400.  
  7401. Structure for Management Information. 
  7402.  
  7403.  
  7404. ΓòÉΓòÉΓòÉ 9.17.7. SMTP ΓòÉΓòÉΓòÉ
  7405.  
  7406. SMTP 
  7407.  
  7408. Simple Mail Transfer Protocol. 
  7409.  
  7410.  
  7411. ΓòÉΓòÉΓòÉ 9.17.8. SNMP ΓòÉΓòÉΓòÉ
  7412.  
  7413. SNMP 
  7414.  
  7415. Simple Network Management Protocol. 
  7416.  
  7417.  
  7418. ΓòÉΓòÉΓòÉ 9.17.9. socket ΓòÉΓòÉΓòÉ
  7419.  
  7420. socket 
  7421.  
  7422.  1. An endpoint for communication between processes or applications. 
  7423.  
  7424.  2. A pair consisting of TCP port and IP address, or UDP port and IP address. 
  7425.  
  7426.  
  7427. ΓòÉΓòÉΓòÉ 9.17.10. socket interface ΓòÉΓòÉΓòÉ
  7428.  
  7429. socket interface 
  7430.  
  7431. An application interface that allows users to write their own applications to 
  7432. supplement those supplied by TCP/IP. 
  7433.  
  7434.  
  7435. ΓòÉΓòÉΓòÉ 9.17.11. stream ΓòÉΓòÉΓòÉ
  7436.  
  7437. stream 
  7438.  
  7439. A continuous sequence of data elements being transmitted, or intended for 
  7440. transmission, in character or binary-digit form, using a defined format. 
  7441.  
  7442.  
  7443. ΓòÉΓòÉΓòÉ 9.17.12. stubs ΓòÉΓòÉΓòÉ
  7444.  
  7445. stubs 
  7446.  
  7447.  1. A program module that transfers remote procedure calls and responses 
  7448.     between a client and a server. Stubs perform marshalling, unmarshalling and 
  7449.     data format conversion. Both clients and servers have stubs. The NIDL 
  7450.     Compiler generates client and server stub code from an interface 
  7451.     definition. 
  7452.  
  7453.  2. Hooking functions used as extensions to the protocol to generate protocol 
  7454.     requests for X Window System. 
  7455.  
  7456.  
  7457. ΓòÉΓòÉΓòÉ 9.17.13. subagent ΓòÉΓòÉΓòÉ
  7458.  
  7459. subagent 
  7460.  
  7461. In the SNMP architecture, a subagent provides an extension to the functionality 
  7462. provided by the SNMP agent. 
  7463.  
  7464.  
  7465. ΓòÉΓòÉΓòÉ 9.17.14. subdirectory ΓòÉΓòÉΓòÉ
  7466.  
  7467. subdirectory 
  7468.  
  7469. A directory contained within another directory in a file system hierarchy. 
  7470.  
  7471.  
  7472. ΓòÉΓòÉΓòÉ 9.17.15. subnet ΓòÉΓòÉΓòÉ
  7473.  
  7474. subnet 
  7475.  
  7476. A networking scheme that divides a single logical network into smaller physical 
  7477. networks to simplify routing. 
  7478.  
  7479.  
  7480. ΓòÉΓòÉΓòÉ 9.17.16. subnet address ΓòÉΓòÉΓòÉ
  7481.  
  7482. subnet address 
  7483.  
  7484. The portion of the host address that identifies a subnetwork. 
  7485.  
  7486.  
  7487. ΓòÉΓòÉΓòÉ 9.17.17. subnet mask ΓòÉΓòÉΓòÉ
  7488.  
  7489. subnet mask 
  7490.  
  7491. A mask used in the IP protocol layer to separate the subnet address from the 
  7492. host portion of the address. 
  7493.  
  7494.  
  7495. ΓòÉΓòÉΓòÉ 9.17.18. subnetwork ΓòÉΓòÉΓòÉ
  7496.  
  7497. subnetwork 
  7498.  
  7499. Synonymous with subnet. 
  7500.  
  7501.  
  7502. ΓòÉΓòÉΓòÉ 9.17.19. synchronous ΓòÉΓòÉΓòÉ
  7503.  
  7504. synchronous 
  7505.  
  7506.  1. Pertaining to two or more processes that depend on the occurrences of a 
  7507.     specific event such as common timing signal. 
  7508.  
  7509.  2. Occurring with a regular or predictable time relationship. See 
  7510.     asynchronous. 
  7511.  
  7512.  
  7513. ΓòÉΓòÉΓòÉ 9.18. T ΓòÉΓòÉΓòÉ
  7514.  
  7515.  
  7516. ΓòÉΓòÉΓòÉ 9.18.1. TALK ΓòÉΓòÉΓòÉ
  7517.  
  7518. TALK 
  7519.  
  7520. An interactive messaging system that sends messages between the local host and 
  7521. a foreign host. 
  7522.  
  7523.  
  7524. ΓòÉΓòÉΓòÉ 9.18.2. task manager ΓòÉΓòÉΓòÉ
  7525.  
  7526. task manager 
  7527.  
  7528. The OS/2 function that controls the starting and stopping of programs, 
  7529. including shutting down the system. 
  7530.  
  7531.  
  7532. ΓòÉΓòÉΓòÉ 9.18.3. TCP ΓòÉΓòÉΓòÉ
  7533.  
  7534. TCP 
  7535.  
  7536. Transmission Control Protocol. 
  7537.  
  7538.  
  7539. ΓòÉΓòÉΓòÉ 9.18.4. TCP/IP ΓòÉΓòÉΓòÉ
  7540.  
  7541. TCP/IP 
  7542.  
  7543. Transmission Control Protocol/Internet Protocol. 
  7544.  
  7545.  
  7546. ΓòÉΓòÉΓòÉ 9.18.5. Telnet ΓòÉΓòÉΓòÉ
  7547.  
  7548. Telnet 
  7549.  
  7550. The Terminal Emulation Protocol, a TCP/IP application protocol for remote 
  7551. connection service. Telnet allows a user at one site to gain access to a 
  7552. foreign host as if the user's terminal were connected directly to that foreign 
  7553. host. 
  7554.  
  7555.  
  7556. ΓòÉΓòÉΓòÉ 9.18.6. TFTP ΓòÉΓòÉΓòÉ
  7557.  
  7558. TFTP 
  7559.  
  7560. Trivial File Transfer Protocol. 
  7561.  
  7562.  
  7563. ΓòÉΓòÉΓòÉ 9.18.7. ticket ΓòÉΓòÉΓòÉ
  7564.  
  7565. ticket 
  7566.  
  7567. Encrypted information obtained from a Kerberos authentication server or a 
  7568. ticket-granting server. A ticket authenticates a user and, in conjunction with 
  7569. an authenticator, serves as permission to access a service when presented by 
  7570. the authenticated user. 
  7571.  
  7572.  
  7573. ΓòÉΓòÉΓòÉ 9.18.8. ticket-granting server ΓòÉΓòÉΓòÉ
  7574.  
  7575. ticket-granting server 
  7576.  
  7577. Grants Kerberos tickets to authenticated users as permission to access an 
  7578. end-service. 
  7579.  
  7580.  
  7581. ΓòÉΓòÉΓòÉ 9.18.9. token ΓòÉΓòÉΓòÉ
  7582.  
  7583. token 
  7584.  
  7585. In a local network, the symbol of authority passed among data stations to 
  7586. indicate the station temporarily in control of the transmission medium. 
  7587.  
  7588.  
  7589. ΓòÉΓòÉΓòÉ 9.18.10. token ring network ΓòÉΓòÉΓòÉ
  7590.  
  7591. token ring network 
  7592.  
  7593. A ring network that allows unidirectional data transmission between data 
  7594. stations by a token-passing procedure over one transmission medium, so that the 
  7595. transmitted data returns to the transmitting station. 
  7596.  
  7597.  
  7598. ΓòÉΓòÉΓòÉ 9.18.11. Transmission Control Protocol (TCP) ΓòÉΓòÉΓòÉ
  7599.  
  7600. Transmission Control Protocol (TCP) 
  7601.  
  7602. The TCP/IP layer that provides reliable process-to-process data stream delivery 
  7603. between nodes in interconnected computer networks. TCP assumes that IP 
  7604. (Internet Protocol) is the underlying protocol. 
  7605.  
  7606.  
  7607. ΓòÉΓòÉΓòÉ 9.18.12. Transmission Control Protocol/Internet Protocol (TCP/IP) ΓòÉΓòÉΓòÉ
  7608.  
  7609. Transmission Control Protocol/Internet Protocol (TCP/IP) 
  7610.  
  7611. A suite of protocols designed to allow communication between networks 
  7612. regardless of the technologies implemented in each network. 
  7613.  
  7614.  
  7615. ΓòÉΓòÉΓòÉ 9.18.13. TRAP ΓòÉΓòÉΓòÉ
  7616.  
  7617. TRAP 
  7618.  
  7619. An unsolicited message that is sent by an SNMP agent to an SNMP network 
  7620. management station. 
  7621.  
  7622.  
  7623. ΓòÉΓòÉΓòÉ 9.18.14. Trivial File Transfer Protocol (TFTP) ΓòÉΓòÉΓòÉ
  7624.  
  7625. Trivial File Transfer Protocol (TFTP) 
  7626.  
  7627. A TCP/IP application primarily used to transfer files among personal computers. 
  7628. TFTP allows files to be sent and received, but does not provide any password 
  7629. protection or directory capability. 
  7630.  
  7631.  
  7632. ΓòÉΓòÉΓòÉ 9.19. U ΓòÉΓòÉΓòÉ
  7633.  
  7634.  
  7635. ΓòÉΓòÉΓòÉ 9.19.1. UDP ΓòÉΓòÉΓòÉ
  7636.  
  7637. UDP 
  7638.  
  7639. User Datagram Protocol. 
  7640.  
  7641.  
  7642. ΓòÉΓòÉΓòÉ 9.19.2. unmarshall ΓòÉΓòÉΓòÉ
  7643.  
  7644. unmarshall 
  7645.  
  7646. To copy data from an RPC packet. Stubs perform unmarshalling. See also 
  7647. marshall. 
  7648.  
  7649.  
  7650. ΓòÉΓòÉΓòÉ 9.19.3. user ΓòÉΓòÉΓòÉ
  7651.  
  7652. user 
  7653.  
  7654. A function that utilizes the services provided by a server. A host can be a 
  7655. user and a server at the same time. See client. 
  7656.  
  7657.  
  7658. ΓòÉΓòÉΓòÉ 9.19.4. User Datagram Protocol (UDP) ΓòÉΓòÉΓòÉ
  7659.  
  7660. User Datagram Protocol (UDP) 
  7661.  
  7662. A packet-level protocol built directly on the IP layer. UDP is used for 
  7663. application to application programs between TCP/IP hosts. 
  7664.  
  7665.  
  7666. ΓòÉΓòÉΓòÉ 9.20. V ΓòÉΓòÉΓòÉ
  7667.  
  7668.  
  7669. ΓòÉΓòÉΓòÉ 9.20.1. VM ΓòÉΓòÉΓòÉ
  7670.  
  7671. VM 
  7672.  
  7673. Virtual Machine. 
  7674.  
  7675.  
  7676. ΓòÉΓòÉΓòÉ 9.21. W ΓòÉΓòÉΓòÉ
  7677.  
  7678.  
  7679. ΓòÉΓòÉΓòÉ 9.21.1. WAN ΓòÉΓòÉΓòÉ
  7680.  
  7681. WAN 
  7682.  
  7683. Wide area network. 
  7684.  
  7685.  
  7686. ΓòÉΓòÉΓòÉ 9.21.2. well-known port ΓòÉΓòÉΓòÉ
  7687.  
  7688. well-known port 
  7689.  
  7690. A port number that has been preassigned for specific use by a specific protocol 
  7691. or application. Clients and servers using the same protocol communicate over 
  7692. the same well-known port. 
  7693.  
  7694.  
  7695. ΓòÉΓòÉΓòÉ 9.21.3. wide area network (WAN) ΓòÉΓòÉΓòÉ
  7696.  
  7697. wide area network (WAN) 
  7698.  
  7699. A network that provides communication services to a geographic area larger than 
  7700. that served by a local area network. 
  7701.  
  7702.  
  7703. ΓòÉΓòÉΓòÉ 9.21.4. window ΓòÉΓòÉΓòÉ
  7704.  
  7705. window 
  7706.  
  7707. An area of the screen with visible boundaries through which a panel or portion 
  7708. of a panel is displayed. 
  7709.  
  7710.  
  7711. ΓòÉΓòÉΓòÉ 9.21.5. working directory ΓòÉΓòÉΓòÉ
  7712.  
  7713. working directory 
  7714.  
  7715. The directory in which an application program is found. The working directory 
  7716. becomes the current directory when the application is started. 
  7717.  
  7718.  
  7719. ΓòÉΓòÉΓòÉ 9.22. X ΓòÉΓòÉΓòÉ
  7720.  
  7721.  
  7722. ΓòÉΓòÉΓòÉ 9.22.1. XDR ΓòÉΓòÉΓòÉ
  7723.  
  7724. XDR 
  7725.  
  7726. eXternal Data Representation. 
  7727.  
  7728.  
  7729. ΓòÉΓòÉΓòÉ 10. Bibliography ΓòÉΓòÉΓòÉ
  7730.  
  7731. This bibliography lists related publications for more information. 
  7732.  
  7733.  
  7734. ΓòÉΓòÉΓòÉ 10.1. TCP/IP for OS/2 Publications ΓòÉΓòÉΓòÉ
  7735.  
  7736. IBM TCP/IP Introduction, GC31-6080 
  7737.  
  7738. This book gives an overview of TCP/IP for OS/2, in addition to other products 
  7739. in the TCP/IP family. Written for new or prospective users, it describes 
  7740. TCP/IP's advantages, uses, installation requirements, and compatibility with 
  7741. other products. It also includes scenarios that show how TCP/IP provides a 
  7742. total interoperability solution for networks in various settings (university, 
  7743. retail, hospital, and financial networks, for example). 
  7744.  
  7745. IBM TCP/IP Version 2.0 for OS/2:  Installation and Administration, SC31-6075 
  7746.  
  7747. This book describes how to install, configure, administer, and start the TCP/IP 
  7748. for OS/2 software on a programmable workstation. The book also summarizes the 
  7749. kits that are available for TCP/IP for OS/2. 
  7750.  
  7751. IBM TCP/IP Version 2.0 for OS/2:  User's Guide, SC31-6076 
  7752.  
  7753. This book shows how to log in to a remote host in a TCP/IP network, transfer 
  7754. files between hosts, print files, send and receive electronic mail, and run 
  7755. commands on remote hosts. The book also includes a computer networking overview 
  7756. for new users, as well as advice on resolving common problems. 
  7757.  
  7758. IBM TCP/IP Version 2.0 for OS/2:  Command Reference, SX75-0070 
  7759.  
  7760. This book describes each of the TCP/IP for OS/2 commands, subcommands, and 
  7761. parameters. The descriptions include syntax diagrams and are arranged 
  7762. alphabetically by command. 
  7763.  
  7764. IBM TCP/IP Version 2.0 for OS/2:  Ultimedia Mail/2 Installation and 
  7765. Configuration Guide, SC31-7120 
  7766.  
  7767. This book introduces the Ultimedia Mail/2 (UltiMail) program for transmitting 
  7768. multimedia messages. It describes how to install and configure the UltiMail 
  7769. Kit, as well as how to start UltiMail. 
  7770.  
  7771. IBM TCP/IP Version 2.0 for OS/2:  Programmer's Reference, SC31-6077 
  7772.  
  7773. This book explains how to install the Programmer's Toolkit on a programmable 
  7774. workstation. It describes the programming interfaces provided with TCP/IP for 
  7775. OS/2, as well as the steps for using socket routines, remote procedure calls, 
  7776. file transfer protocol (FTP) routines, and simple network management protocol 
  7777. (SNMP) routines in user-written programs. 
  7778.  
  7779. IBM TCP/IP Version 2.0 for OS/2:  X Window System Client Guide, SC31-7087 
  7780.  
  7781. This book describes how to install and use the X Window System Client Kit, 
  7782. which enables users to develop and run applications that use the X Window 
  7783. System in an OS/2 environment. This book also describes how to install and use 
  7784. the OSF/Motif Kit, which enables users to port, develop, and run OSF/Motif V1.2 
  7785. applications in an OS/2 environment. 
  7786.  
  7787. IBM TCP/IP Version 2.0 for OS/2:  X Window System Server Guide, SC31-7070 
  7788.  
  7789. This book explains how to install and use an X Window System server. An X 
  7790. Window System server enables you to display and control X Window System client 
  7791. application programs in OS/2 windowed sessions. 
  7792.  
  7793. IBM TCP/IP Version 2.0 for OS/2:  Domain Name Server Guide, SC31-7174 
  7794.  
  7795. This book describes how to install the Domain Name Server Kit, and how to 
  7796. create and maintain a domain name server for your TCP/IP network. This book 
  7797. also includes conceptual information on how domain name servers and name 
  7798. resolvers operate in a network. 
  7799.  
  7800. IBM TCP/IP Version 2.0 for OS/2:  Network File System Guide, SC31-7069 
  7801.  
  7802. This book explains how to install the Network File System Kit, and how to use 
  7803. it to allow users to read, write, and run programs and files on remote systems 
  7804. as if they were local. 
  7805.  
  7806. IBM TCP/IP Version 2.0 for OS/2:  Extended Networking Guide, SC31-7071 
  7807.  
  7808. This book explains how to install the Extended Networking Kit, and how to 
  7809. configure and start an X.25 interface or a SNALINK interface. The X.25 or 
  7810. SNALINK interface can be used as a router to connect remote LANs. 
  7811.  
  7812. IBM TCP/IP Version 2.0 for OS/2:  NetBIOS Guide, SC31-6122 
  7813.  
  7814. This book explains how to install and start the IBM NetBIOS Version 1 for 
  7815. TCP/IP for OS/2 program, as well as how to write and debug application programs 
  7816. that use NetBIOS services. NetBIOS provides a simple, consistent interface for 
  7817. applications to use in accessing network resources. 
  7818.  
  7819.  
  7820. ΓòÉΓòÉΓòÉ 10.2. Other Related Publications ΓòÉΓòÉΓòÉ
  7821.  
  7822. The following are other related publications. 
  7823.  
  7824.  
  7825. ΓòÉΓòÉΓòÉ 10.2.1. OS/2 Publications ΓòÉΓòÉΓòÉ
  7826.  
  7827. The following lists shows OS/2 publications. 
  7828.  
  7829. IBM Operating System/2 User's Guide Volume 1:  Base Operating System 
  7830.  
  7831. IBM Operating System/2 User's Guide Volume 2:  Communications Manager and LAN 
  7832. Requester 
  7833.  
  7834. IBM Operating System/2 System Administrator's Guide for Communications 
  7835.  
  7836. Operating System/2 Electronic Device Driver Distribution Mechanism 
  7837.  
  7838. IBM Operating System/2 Command Reference 
  7839.  
  7840. IBM OS/2 LAN Technical Reference 
  7841.  
  7842.  
  7843. ΓòÉΓòÉΓòÉ 10.2.2. Programming Publications ΓòÉΓòÉΓòÉ
  7844.  
  7845. The following list shows selected programming publications. 
  7846.  
  7847. AIX Communications Concepts and Procedures for IBM RISC System/6000 
  7848.  
  7849. IBM AIX Operating System Technical Reference:  System Calls and Subroutines 
  7850.  
  7851. Network Computing System (NCS) Reference (010200, Rev.00), Apollo Computer, 
  7852. Inc. 
  7853.  
  7854. Networking on the Sun Workstation:  Remote Procedure Call Programming Guide 
  7855. (800-1324-03), Sun Microsystems, Inc. 
  7856.  
  7857. Network Programming (800-1779-10), Sun Microsystems, Inc. 
  7858.  
  7859. UNIX Programmer's Reference Manual (4.3 Berkeley Software Distribution, Virtual 
  7860. VAX-11 Version). Department of Electrical Engineering and Computer Science. 
  7861. University of California, Berkeley, 1988. 
  7862.  
  7863. X Protocol Reference Manual, Adrian Nye, ed.  O'Reilly & Associates, Inc., 
  7864. 1990. 
  7865.  
  7866. X Window System User's Guide, Valerie Quercia & Tim O'Reilly., O'Reilly & 
  7867. Associates, Inc., 1990. 
  7868.  
  7869. The Art of Distributed Application:  Programming Techniques for Remote 
  7870. Procedure Calls, John R. Corbin, Springer-Verlog, 1991. 
  7871.  
  7872. Jennifer G. Steiner, Clifford Neuman, and Jeffrey I. Schiller. "Kerberos:  An 
  7873. Authentication Service for Open Networks." Massachusetts Institute of 
  7874. Technology, 12 January 1988. 
  7875.  
  7876. S.P. Miller et al. "Kerberos Authentication and Authorization System," Project 
  7877. Athena Technical Plan, Section E.2.1. Massachusetts Institute of Technology, 
  7878. 21 December 1987. 
  7879.  
  7880. MVS NFS User's Guide 
  7881.  
  7882. MVS/DFP Version 3 Release 3:  Using the Network File System Server 
  7883.  
  7884.  
  7885. ΓòÉΓòÉΓòÉ 10.2.3. Network Computing System (NCS) Publications ΓòÉΓòÉΓòÉ
  7886.  
  7887. The following list shows NCS publications. 
  7888.  
  7889. Network Computing System Reference Manual, Mike Kong, (Terence H. Dineen, Paul 
  7890. J. Leach, Elizabeth A. Martin, Nathaniel W. Mishkin, Joseph N. Pato, Geoffrey 
  7891. L. Wyant), Apollo Computer Inc., a subsidiary of Hewlett-Packard Company, 
  7892. Chelmsford, Massachusetts, Prentice Hall, Englewood Cliffs, New Jersey 07632, 
  7893. 1990. 
  7894.  
  7895. Network Computing Architecture, Lisa Zahn, (Terence H. Dineen, Paul J. Leach, 
  7896. Elizabeth A. Martin, Nathaniel W. Mishkin, Joseph N. Pato, Geoffrey L. Wyant), 
  7897. Apollo Computer Inc., a subsidiary of Hewlett-Packard Company, Chelmsford, 
  7898. Massachusetts, Prentice Hall, Englewood Cliffs, New Jersey 07632, 1990. 
  7899.  
  7900. Network Computing Architecture (NCA) Protocol Specifications , Apollo Computer 
  7901. Inc.,330 Billerica Road, Chelmsford, MA 01824, (508) 256-6600, 1989.  Apollo 
  7902. Order No. 010201-A00 
  7903.  
  7904. Network Computing System (NCS) Reference, Apollo Computer Inc., 330 Billerica 
  7905. Road, Chelmsford, MA 01824, 1987. Apollo Order No. 010200, Revision 00. 
  7906.  
  7907. Managing the NCS Location Broker, Apollo Computer Inc., 330 Billerica Road, 
  7908. Chelmsford, MA 01824, 1988. Apollo Order No. 011895-A00.