home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / inet104.zip / inet.pas < prev    next >
Pascal/Delphi Source File  |  2001-03-17  |  36KB  |  1,054 lines

  1. unit Inet;
  2.  
  3. {
  4.   Inet & Sockets Unit v1.04.
  5.   /c/ 2000, 2001 by madded2 (madded@vao.udmnet.ru).
  6.   based on units from SIBYL & infos from Toolkit 4.0.
  7.  
  8.   for help use tcppr.inf and C samples from toolkit.
  9.  
  10.   without res_* and dh_* funcs, and have very
  11.   bad suppot for select() and ioctl() funcs
  12.  
  13.   also needed STRINGS unit for PChar <-> Pascal strings convertions..
  14.  
  15.   new in ver 1.04 : little ioctl() & iptrace support + errors SOCE* constants
  16.   new in ver 1.03 : used inet_lib.lib file for fixing VP linker bug
  17.   new in ver 1.02 : $saves sections, need for correct registers operations
  18.   new in ver 1.01 : ip header struct
  19.   }
  20.  
  21. interface
  22. {&Cdecl+,AlignRec-,AlignData-}
  23. {$R-,Q-}
  24.  
  25. {$OrgName+}
  26. {$L inet_lib.lib}
  27.  
  28. { ip.h - ip packet header struct }
  29.  
  30. {
  31.  * Structure of an internet header, naked of options.
  32. }
  33. type
  34.    ip = record
  35.       hlen_ver                   :  Byte; { lo 4 bits = header len/4
  36.                           hi 4 bits = ip ver (4) }
  37.       ip_tos                   :  Byte;      { type of service }
  38.       ip_len                   :  SmallWord; { total packet length }
  39.       ip_id                   :  SmallWord; { identification }
  40.       ip_off                   :  SmallWord; { fragment offset field }
  41.       ip_ttl                   :  Byte;      { time to live }
  42.       ip_p                   :  Byte;      { protocol (see IPPROTO_*) }
  43.       ip_sum                   :  SmallWord; { header checksum }
  44.       ip_src, ip_dst               :  Longint;   { ip from / to addr }
  45.    end;
  46.  
  47.  
  48. { in.h / inet.h const & func }
  49.  
  50. {
  51.  * Protocols
  52. }
  53. const
  54.      IPPROTO_IP          = 0;        { dummy for IP }
  55.      IPPROTO_ICMP         = 1;        { control message protocol }
  56.      IPPROTO_GGP         = 3;        { gateway^2 (deprecated) }
  57.      IPPROTO_TCP         = 6;        { tcp }
  58.      IPPROTO_EGP         = 8;        { exterior gateway protocol }
  59.      IPPROTO_PUP         = 12;        { pup }
  60.      IPPROTO_UDP         = 17;        { user datagram protocol }
  61.      IPPROTO_IDP         = 22;        { xns idp }
  62.  
  63.      IPPROTO_RAW         = 255;        { raw IP packet }
  64.      IPPROTO_MAX         = 256;
  65.  
  66. {
  67.  * Ports < IPPORT_RESERVED are reserved for
  68.  * privileged processes (e.g. root).
  69.  * Ports > IPPORT_USERRESERVED are reserved
  70.  * for servers, not necessarily privileged.
  71. }
  72. const
  73.     IPPORT_RESERVED        = 1024;
  74.     IPPORT_USERRESERVED     = 5000;
  75.  
  76. {
  77.  * Link numbers
  78. }
  79. const
  80.     IMPLINK_IP            = 155;
  81.     IMPLINK_LOWEXPER        = 156;
  82.     IMPLINK_HIGHEXPER        = 158;
  83.  
  84. {
  85.  * Definitions of bits in internet address integers.
  86.  * On subnets, the decomposition of addresses to host and net parts
  87.  * is done according to subnet mask, not the masks here.
  88. }
  89. const
  90.      IN_CLASSA_NET         = $ff000000;
  91.      IN_CLASSA_NSHIFT         = 24;
  92.      IN_CLASSA_HOST         = $00ffffff;
  93.      IN_CLASSA_MAX         = 128;
  94.  
  95.      IN_CLASSB_NET         = $ffff0000;
  96.      IN_CLASSB_NSHIFT         = 16;
  97.      IN_CLASSB_HOST         = $0000ffff;
  98.      IN_CLASSB_MAX         = 65536;
  99.  
  100.      IN_CLASSC_NET         = $ffffff00;
  101.      IN_CLASSC_NSHIFT         = 8;
  102.      IN_CLASSC_HOST         = $000000ff;
  103.  
  104.      INADDR_ANY          = $00000000;
  105.      INADDR_BROADCAST         = $ffffffff;     { must be masked }
  106.      INADDR_NONE         = $ffffffff;     { -1 return }
  107.  
  108.      IN_LOOPBACKNET         = 127;          { official! }
  109.  
  110. {
  111.  * Socket address, internet style.
  112. }
  113. type
  114.    sockaddr_in = record
  115.       sin_family               :  SmallWord;
  116.       sin_port                   :  SmallWord; { htons first!! }
  117.       sin_addr                   :  Longint; {in_addr; hist reasons :)) }
  118.       sin_zero                   :  array[0..7] of Byte; {must be zero}
  119.    end;
  120.  
  121. { * Internet address (a structure for historical reasons) }
  122. type
  123.    in_addr = record
  124.       s_addr                   :  Longint;
  125.    end;
  126.  
  127. {*
  128.  * Options for use with [gs]etsockopt at the IP level.
  129.  * }
  130. const
  131.  
  132.   IP_OPTIONS        = 1;   // buf/ip_opts; set/get IP options
  133.   IP_MULTICAST_IF    = 2;   // u_char; set/get IP multicast i/f
  134.   IP_MULTICAST_TTL    = 3;   // u_char; set/get IP multicast ttl
  135.   IP_MULTICAST_LOOP    = 4;   // u_char; set/get IP multicast loopback
  136.   IP_ADD_MEMBERSHIP    = 5;   // ip_mreq; add an IP group membership
  137.   IP_DROP_MEMBERSHIP    = 6;   // ip_mreq; drop an IP group membership
  138.   IP_HDRINCL        = 7;   // int; header is included with data
  139.   IP_TOS        = 8;   // int; IP type of service and preced.
  140.   IP_TTL        = 9;   // int; IP time to live
  141.   IP_RECVOPTS        = 10;  // bool; receive all IP opts w/dgram
  142.   IP_RECVRETOPTS    = 11;  // bool; receive IP opts for response
  143.   IP_RECVDSTADDR    = 12;  // bool; receive IP dst addr w/dgram
  144.   IP_RETOPTS        = 13;  // ip_opts; set/get IP options
  145.   IP_RECVTRRI        = 14;  // bool; receive token ring routing inf
  146.  
  147. {*
  148.  * Defaults and limits for options
  149.  * }
  150.   IP_DEFAULT_MULTICAST_TTL  = 1;    // normally limit m'casts to 1 hop
  151.   IP_DEFAULT_MULTICAST_LOOP = 1;    // normally hear sends if a member
  152.   IP_MAX_MEMBERSHIPS        = 20;   // per socket; must fit in one mbuf
  153.   MAX_IN_MULTI      = 16*IP_MAX_MEMBERSHIPS;     // 320 max per os2
  154.  
  155.  
  156. { sockets def & funcs }
  157. // * Definitions related to sockets: types, address families, options.
  158.  
  159. // * Address families.
  160. const
  161.  
  162.   AF_UNSPEC     = 0;         // unspecified
  163.   AF_LOCAL     = 1;         // local to host (pipes, portals)
  164.   AF_UNIX     = AF_LOCAL; // backward compatibility
  165.   AF_OS2     = AF_UNIX;
  166.   AF_INET     = 2;         // internetwork: UDP, TCP, etc.
  167.   AF_IMPLINK     = 3;         // arpanet imp addresses
  168.   AF_PUP     = 4;         // pup protocols: e.g. BSP
  169.   AF_CHAOS     = 5;         // mit CHAOS protocols
  170.   AF_NS      = 6;         // XEROX NS protocols
  171.   AF_ISO     = 7;         // ISO protocols
  172.   AF_OSI     = AF_ISO;
  173.   AF_ECMA     = 8;         // european computer manufacturers
  174.   AF_DATAKIT     = 9;         // datakit protocols
  175.   AF_CCITT     = 10;         // CCITT protocols, X.25 etc
  176.   AF_SNA     = 11;         // IBM SNA
  177.   AF_DECnet     = 12;         // DECnet
  178.   AF_DLI     = 13;         // DEC Direct data link interface
  179.   AF_LAT     = 14;         // LAT
  180.   AF_HYLINK     = 15;         // NSC Hyperchannel
  181.   AF_APPLETALK     = 16;         // Apple Talk
  182.   AF_NB      = 17;         // Netbios
  183.   AF_NETBIOS     = AF_NB;
  184.   AF_LINK     = 18;         // Link layer interface
  185.   pseudo_AF_XTP  = 19;         // eXpress Transfer Protocol (no AF)
  186.   AF_COIP     = 20;         // connection-oriented IP, aka ST II
  187.   AF_CNT     = 21;         // Computer Network Technology
  188.   pseudo_AF_RTIP = 22;         // Help Identify RTIP packets
  189.   AF_IPX     = 23;         // Novell Internet Protocol
  190.   AF_SIP     = 24;         // Simple Internet Protocol
  191.   AF_INET6     = 24;
  192.   pseudo_AF_PIP  = 25;         // Help Identify PIP packets
  193.   AF_ROUTE     = 39;         // Internal Routing Protocol
  194.   AF_FWIP     = 40;         // firewall support
  195.   AF_IPSEC     = 41;         // IPSEC and encryption techniques
  196.   AF_DES     = 42;         // DES
  197.   AF_MD5     = 43;
  198.   AF_CDMF     = 44;
  199.  
  200.   AF_MAX     = 45;
  201.  
  202. // * Protocol families, same as address families for now.
  203. const
  204.  
  205.   PF_UNSPEC    = AF_UNSPEC;
  206.   PF_LOCAL     = AF_LOCAL;
  207.   PF_UNIX      = PF_LOCAL;     // backward compatibility
  208.   PF_OS2       = PF_UNIX;
  209.   PF_INET      = AF_INET;
  210.   PF_IMPLINK   = AF_IMPLINK;
  211.   PF_PUP       = AF_PUP;
  212.   PF_CHAOS     = AF_CHAOS;
  213.   PF_NS        = AF_NS;
  214.   PF_ISO       = AF_ISO;
  215.   PF_OSI       = AF_OSI;
  216.   PF_ECMA      = AF_ECMA;
  217.   PF_DATAKIT   = AF_DATAKIT;
  218.   PF_CCITT     = AF_CCITT;
  219.   PF_SNA       = AF_SNA;
  220.   PF_DECnet    = AF_DECnet;
  221.   PF_DLI       = AF_DLI;
  222.   PF_LAT       = AF_LAT;
  223.   PF_HYLINK    = AF_HYLINK;
  224.   PF_APPLETALK = AF_APPLETALK;
  225.   PF_NETBIOS   = AF_NB;
  226.   PF_NB        = AF_NB;
  227.   PF_ROUTE     = AF_ROUTE;
  228.   PF_LINK      = AF_LINK;
  229.   PF_XTP       = pseudo_AF_XTP;  // really just proto family, no AF
  230.   PF_COIP      = AF_COIP;
  231.   PF_CNT       = AF_CNT;
  232.   PF_SIP       = AF_SIP;
  233.   PF_INET6     = AF_INET6;
  234.   PF_IPX       = AF_IPX;     // same format as AF_NS
  235.   PF_RTIP      = pseudo_AF_RTIP; // same format as AF_INET
  236.   PF_PIP       = pseudo_AF_PIP;
  237.  
  238.   PF_MAX       = AF_MAX;
  239.  
  240. {
  241.  SOCE* constants - socket errors from NERRNO.H
  242.  * All OS/2 SOCKET API error constants are biased by SOCBASEERR from the
  243.    "normal"
  244. }
  245. const
  246.   SOCBASEERR         = 10000;
  247.  
  248.   SOCEPERM         = (SOCBASEERR+1);        // Not owner
  249.   SOCENOENT         = (SOCBASEERR+2);        // No such file or directory
  250.   SOCESRCH         = (SOCBASEERR+3);        // No such process
  251.   SOCEINTR         = (SOCBASEERR+4);        // Interrupted system call
  252.   SOCEIO         = (SOCBASEERR+5);        // Input/output error
  253.   SOCENXIO         = (SOCBASEERR+6);        // No such device or address
  254.   SOCE2BIG         = (SOCBASEERR+7);        // Argument list too long
  255.   SOCENOEXEC         = (SOCBASEERR+8);        // Exec format error
  256.   SOCEBADF         = (SOCBASEERR+9);        // Bad file number
  257.   SOCECHILD         = (SOCBASEERR+10);     // No child processes
  258.   SOCEDEADLK         = (SOCBASEERR+11);     // Resource deadlock avoided
  259.   SOCENOMEM         = (SOCBASEERR+12);     // Cannot allocate memory
  260.   SOCEACCES         = (SOCBASEERR+13);     // Permission denied
  261.   SOCEFAULT         = (SOCBASEERR+14);     // Bad address
  262.   SOCENOTBLK         = (SOCBASEERR+15);     // Block device required
  263.   SOCEBUSY         = (SOCBASEERR+16);     // Device busy
  264.   SOCEEXIST         = (SOCBASEERR+17);     // File exists
  265.   SOCEXDEV         = (SOCBASEERR+18);     // Cross-device link
  266.   SOCENODEV         = (SOCBASEERR+19);     // Operation not supported by device
  267.   SOCENOTDIR         = (SOCBASEERR+20);     // Not a directory
  268.   SOCEISDIR         = (SOCBASEERR+21);     // Is a directory
  269.   SOCEINVAL         = (SOCBASEERR+22);     // Invalid argument
  270.   SOCENFILE         = (SOCBASEERR+23);     // Too many open files in system
  271.   SOCEMFILE         = (SOCBASEERR+24);     // Too many open files
  272.   SOCENOTTY         = (SOCBASEERR+25);     // Inappropriate ioctl for device
  273.   SOCETXTBSY         = (SOCBASEERR+26);     // Text file busy
  274.   SOCEFBIG         = (SOCBASEERR+27);     // File too large
  275.   SOCENOSPC         = (SOCBASEERR+28);     // No space left on device
  276.   SOCESPIPE         = (SOCBASEERR+29);     // Illegal seek
  277.   SOCEROFS         = (SOCBASEERR+30);     // Read-only file system
  278.   SOCEMLINK         = (SOCBASEERR+31);     // Too many links
  279.   SOCEPIPE         = (SOCBASEERR+32);     // Broken pipe
  280.  
  281. // math software
  282.   SOCEDOM         = (SOCBASEERR+33);     // Numerical argument out of domain
  283.   SOCERANGE         = (SOCBASEERR+34);     // Result too large
  284.  
  285. // non-blocking and interrupt i/o
  286.   SOCEAGAIN         = (SOCBASEERR+35);     // Resource temporarily unavailable
  287.   SOCEWOULDBLOCK     = SOCEAGAIN;        // Operation would block
  288.   SOCEINPROGRESS     = (SOCBASEERR+36);     // Operation now in progress
  289.   SOCEALREADY         = (SOCBASEERR+37);     // Operation already in progress
  290.  
  291. // ipc/network software -- argument errors
  292.   SOCENOTSOCK         = (SOCBASEERR+38);     // Socket operation on non-socket
  293.   SOCEDESTADDRREQ    = (SOCBASEERR+39);     // Destination address required
  294.   SOCEMSGSIZE         = (SOCBASEERR+40);     // Message too long
  295.   SOCEPROTOTYPE      = (SOCBASEERR+41);     // Protocol wrong type for socket
  296.   SOCENOPROTOOPT     = (SOCBASEERR+42);     // Protocol not available
  297.   SOCEPROTONOSUPPORT = (SOCBASEERR+43);     // Protocol not supported
  298.   SOCESOCKTNOSUPPORT = (SOCBASEERR+44);     // Socket type not supported
  299.   SOCEOPNOTSUPP      = (SOCBASEERR+45);     // Operation not supported
  300.   SOCEPFNOSUPPORT    = (SOCBASEERR+46);     // Protocol family not supported
  301.   SOCEAFNOSUPPORT    = (SOCBASEERR+47);     // Address family not supported by protocol family
  302.   SOCEADDRINUSE      = (SOCBASEERR+48);     // Address already in use
  303.   SOCEADDRNOTAVAIL   = (SOCBASEERR+49);     // Can't assign requested address
  304.  
  305. // ipc/network software -- operational errors
  306.   SOCENETDOWN         = (SOCBASEERR+50);     // Network is down
  307.   SOCENETUNREACH     = (SOCBASEERR+51);     // Network is unreachable
  308.   SOCENETRESET         = (SOCBASEERR+52);     // Network dropped connection on reset
  309.   SOCECONNABORTED    = (SOCBASEERR+53);     // Software caused connection abort
  310.   SOCECONNRESET      = (SOCBASEERR+54);     // Connection reset by peer
  311.   SOCENOBUFS         = (SOCBASEERR+55);     // No buffer space available
  312.   SOCEISCONN         = (SOCBASEERR+56);     // Socket is already connected
  313.   SOCENOTCONN         = (SOCBASEERR+57);     // Socket is not connected
  314.   SOCESHUTDOWN         = (SOCBASEERR+58);     // Can't send after socket shutdown
  315.   SOCETOOMANYREFS    = (SOCBASEERR+59);     // Too many references: can't splice
  316.   SOCETIMEDOUT         = (SOCBASEERR+60);     // Operation timed out
  317.   SOCECONNREFUSED    = (SOCBASEERR+61);     // Connection refused
  318.  
  319.   SOCELOOP         = (SOCBASEERR+62);     // Too many levels of symbolic links
  320.   SOCENAMETOOLONG    = (SOCBASEERR+63);     // File name too long
  321.  
  322. // should be rearranged
  323.   SOCEHOSTDOWN         = (SOCBASEERR+64);      // Host is down
  324.   SOCEHOSTUNREACH    = (SOCBASEERR+65);      // No route to host
  325.   SOCENOTEMPTY         = (SOCBASEERR+66);      // Directory not empty
  326.  
  327. // quotas & mush
  328.   SOCEPROCLIM         = (SOCBASEERR+67);      // Too many processes
  329.   SOCEUSERS         = (SOCBASEERR+68);      // Too many users
  330.   SOCEDQUOT         = (SOCBASEERR+69);      // Disc quota exceeded
  331.  
  332. // Network File System
  333.   SOCESTALE         = (SOCBASEERR+70);      // Stale NFS file handle
  334.   SOCEREMOTE         = (SOCBASEERR+71);      // Too many levels of remote in path
  335.   SOCEBADRPC         = (SOCBASEERR+72);      // RPC struct is bad
  336.   SOCERPCMISMATCH    = (SOCBASEERR+73);      // RPC version wrong
  337.   SOCEPROGUNAVAIL    = (SOCBASEERR+74);      // RPC prog. not avail
  338.   SOCEPROGMISMATCH   = (SOCBASEERR+75);      // Program version wrong
  339.   SOCEPROCUNAVAIL    = (SOCBASEERR+76);      // Bad procedure for program
  340.  
  341.   SOCENOLCK         = (SOCBASEERR+77);      // No locks available
  342.   SOCENOSYS         = (SOCBASEERR+78);      // Function not implemented
  343.  
  344.   SOCEFTYPE         = (SOCBASEERR+79);      // Inappropriate file type or format
  345.   SOCEAUTH         = (SOCBASEERR+80);      // Authentication error
  346.   SOCENEEDAUTH         = (SOCBASEERR+81);      // Need authenticator
  347.  
  348.   SOCEOS2ERR         = (SOCBASEERR+100);     // OS/2 Error
  349.   SOCELAST         = (SOCBASEERR+100);     // Must be equal largest errno
  350.  
  351.  
  352. // * Types
  353. const
  354.  
  355.   SOCK_STREAM     = 1; // stream socket
  356.   SOCK_DGRAM     = 2; // datagram socket
  357.   SOCK_RAW     = 3; // raw-protocol interface
  358.   SOCK_RDM     = 4; // reliably-delivered message
  359.   SOCK_SEQPACKET = 5; // sequenced packet stream
  360.  
  361. // * Option flags per-socket.
  362. const
  363.  
  364.   SO_DEBUG      = $0001; // turn on debugging info recording
  365.   SO_ACCEPTCONN   = $0002; // socket has had listen()
  366.   SO_REUSEADDR      = $0004; // allow local address reuse
  367.   SO_KEEPALIVE      = $0008; // keep connections alive
  368.   SO_DONTROUTE      = $0010; // just use interface addresses
  369.   SO_BROADCAST      = $0020; // permit sending of broadcast msgs
  370.   SO_USELOOPBACK  = $0040; // bypass hardware when possible
  371.   SO_LINGER      = $0080; // linger on close if data present
  372.   SO_OOBINLINE      = $0100; // leave received OOB data in line
  373.   SO_L_BROADCAST  = $0200; // limited broadcast sent on all IFs
  374.   SO_RCV_SHUTDOWN = $0400; // set if shut down called for rcv
  375.   SO_SND_SHUTDOWN = $0800; // set if shutdown called for send
  376.   SO_REUSEPORT      = $1000; // allow local address & port reuse
  377.   SO_TTCP      = $2000; // allow t/tcp on socket
  378.  
  379. // * Additional options, not kept in so_options.
  380. const
  381.  
  382.   SO_SNDBUF   = $1001; // send buffer size
  383.   SO_RCVBUF   = $1002; // receive buffer size
  384.   SO_SNDLOWAT = $1003; // send low-water mark
  385.   SO_RCVLOWAT = $1004; // receive low-water mark
  386.   SO_SNDTIMEO = $1005; // send timeout
  387.   SO_RCVTIMEO = $1006; // receive timeout
  388.   SO_ERROR    = $1007; // get error status and clear
  389.   SO_TYPE     = $1008; // get socket type
  390.   SO_OPTIONS  = $1010; // get socket options
  391.  
  392. // * Structure used for manipulating linger option.
  393. type
  394.  
  395.   linger = record
  396.      l_onoff                   :  Longint; // option on/off
  397.      l_linger                   :  Longint; // linger time
  398.   end;
  399.  
  400. // * Level number for (get/set)sockopt() to apply to socket itself.
  401. const
  402.  
  403.   SOL_SOCKET = $ffff; // options for socket level
  404.  
  405. {*
  406.  * User-settable options (used with setsockopt).
  407.  *}
  408.   TCP_NODELAY     = $01;    // don't delay send to coalesce packets
  409.   TCP_MAXSEG     = $02;    // set maximum segment size
  410.   TCP_MSL     = $03;    // MSL HACK
  411.   TCP_TIMESTMP     = $04;    // RFC 1323 (RTTM TimeStamp)
  412.   TCP_WINSCALE     = $05;    // RFC 1323 (Window Scale)
  413.   TCP_CC     = $06;    // RFC 1644 (Connection Count)
  414.  
  415.  
  416. // * Structure used by kernel to store most
  417. // * addresses.
  418. type
  419.  
  420.   sockaddr = record
  421.     sa_len:    Byte;              // total length
  422.     sa_family: Byte;              // address family
  423.     sa_data:   array [0..13] of Byte; // up to 14 bytes of direct address
  424.   end;
  425.  
  426.   psockaddr = ^sockaddr;
  427.  
  428. // * Structure used by kernel to pass protocol
  429. // * information in raw sockets.
  430. type
  431.  
  432.   sockproto = record
  433.     sp_family:     SmallWord; // address family
  434.     sp_protocol: SmallWord; // protocol
  435.   end;
  436.  
  437. // * Maximum queue length specifiable by listen.
  438. const
  439.  
  440.   SOMAXCONN = 1024;
  441.  
  442. // * Message header for recvmsg and sendmsg calls.
  443. // * Used value-result for recvmsg, value only for sendmsg.
  444. type
  445.  
  446.   iovec = record
  447.     iov_base  :  Pointer;
  448.     iov_len   :  Longint;
  449.   end;
  450.  
  451.   msghdr = record
  452.     msg_name:        pChar;     // optional address
  453.     msg_namelen:    Longint;   // size of address
  454.     msg_iov:        ^iovec;    // scatter/gather array
  455.     msg_iovlen:     Longint;   // # elements in msg_iov (max 1024)
  456.     msg_control:    pChar;     // ancillary data, see below
  457.     msg_controllen: Longint;   // ancillary data buffer len
  458.     msg_flags:        Longint;   // flags on received message
  459.   end;
  460.  
  461. const
  462.  
  463.   MSG_OOB    = $1;    // process out-of-band data
  464.   MSG_PEEK    = $2;    // peek at incoming message
  465.   MSG_DONTROUTE = $4;    // send without using routing tables
  466.   MSG_FULLREAD    = $8;    // send without using routing tables
  467.   MSG_EOR    = $10;    // data completes record
  468.   MSG_TRUNC    = $20;    // data discarded before delivery
  469.   MSG_CTRUNC    = $40;    // control data lost before delivery
  470.   MSG_WAITALL    = $80;    // wait for full request or error
  471.   MSG_DONTWAIT    = $100; // this message should be nonblocking
  472.   MSG_EOF    = $200;
  473.   MSG_MAPIO    = $400; // mem mapped io
  474.  
  475. // * Header for ancillary data objects in msg_control buffer.
  476. // * Used for additional information with/about a datagram
  477. // * not expressible by flags.    The format is a sequence
  478. // * of message elements headed by cmsghdr structures.
  479. type
  480.  
  481.   cmsghdr = record
  482.     cmsg_len:    Longint;    // data byte count, including hdr
  483.     cmsg_level: Longint;    // originating protocol
  484.     cmsg_type:    Longint;    // protocol-specific type
  485.   end;
  486.  
  487. // *** *** ***
  488.   cmsg = record
  489.     cmsg_hdr:  cmsghdr;
  490.     cmsg_data: array [0..0] of Byte;
  491.   end;
  492. // *** *** ***
  493.  
  494. // * "Socket"-level control message types:
  495. const
  496.   SCM_RIGHTS = $01; // access rights (array of int)
  497.  
  498. // * 4.3 compat sockaddr, move to compat file later
  499. type
  500.  
  501.   osockaddr = record
  502.     sa_family: SmallWord;        // address family
  503.     sa_data: array [0..13] of Byte; // up to 14 bytes of direct address
  504.   end;
  505.  
  506. // * 4.3-compat message header (move to compat file later).
  507. type
  508.  
  509.   omsghdr = record
  510.     msg_name:          pChar;   // optional address
  511.     msg_namelen:      Longint;      // size of address
  512.     msg_iov:          ^iovec;  // scatter/gather array
  513.     msg_iovlen:       Longint;      // # elements in msg_iov
  514.     msg_accrights:    pChar;   // access rights sent/received
  515.     msg_accrightslen: Longint;
  516.   end;
  517.  
  518. // * bsd select definitions
  519.  
  520. const
  521. {
  522.  * Select uses bit masks of file descriptors in longs.    These macros
  523.  * manipulate such bit fields (the filesystem macros use chars).
  524.  * FD_SETSIZE may be defined by the user, but the default here should
  525.  * be enough for most uses.
  526. }
  527.   FD_SETSIZE = 64;
  528.  
  529. type
  530.  
  531.   fd_set = record
  532.     fd_count  :  SmallWord;                  // how many are SET?
  533.     fd_array  :  array[0..FD_SETSIZE-1] of Longint;   // an array of SOCKETs
  534.   end;
  535.  
  536.   timeval = record
  537.     tv_sec   :    Longint; // Number of seconds
  538.     tv_usec  :    Longint; // Number of microseconds
  539.   end;
  540.  
  541. {
  542.  * Structures returned by network data base library.  All addresses are
  543.  * supplied in host order, and returned in network order (suitable for
  544.  * use in system calls).
  545. }
  546.  
  547. type
  548.  
  549.   PLongint = ^Longint;
  550.  
  551.   { struct for gethostbyname() and gethostbyaddr() }
  552.   hostent = record
  553.     h_name     :  PChar;     // official name of host
  554.     h_aliases     :  ^PChar;     // alias list
  555.     h_addrtype     :  Longint;     // host address type
  556.     h_length     :  Longint;     // length of address
  557.     h_addr_list  :  ^PLongint;     // list of addresses from name server
  558.   end;
  559.  
  560.   phostent = ^hostent;
  561.  
  562. {
  563.  * Error return codes from gethostbyname(), gethostbyaddr() and res_* funcs
  564.  * (left in extern int h_errno).
  565. }
  566.  
  567. const
  568.  
  569.   NETDB_INTERNAL  = -1;       // see errno
  570.   NETDB_SUCCESS   =  0;       // no problem
  571.   HOST_NOT_FOUND  =  1;       // Authoritative Answer Host not found
  572.   TRY_AGAIN      =  2;       // Non-Authoritive Host not found, or SERVERFAIL
  573.   NO_RECOVERY      =  3;       // Non recoverable errors, FORMERR, REFUSED, NOTIMP
  574.   NO_DATA      =  4;       // Valid name, no data record of requested type
  575.   NO_ADDRESS      =  NO_DATA; // no address, look for MX record
  576.  
  577. type
  578.  
  579.   { struct for getprotobyname() and getprotobynumber() }
  580.   protoent = record
  581.     p_name     :  PChar;     // official protocol name
  582.     p_aliases  :  ^PChar;     // alias list
  583.     p_proto    :  Longint;     // protocol #
  584.   end;
  585.  
  586.   pprotoent = ^protoent;
  587.  
  588. type
  589.  
  590.   { struct for getservbyname() and getservbyport() }
  591.   servent = record
  592.     s_name     :  PChar;     // official service name
  593.     s_aliases  :  ^PChar;     // alias list
  594.     s_port     :  Longint;     // port # (need ntohl() !!)
  595.     s_proto    :  PChar;     // protocol to use
  596.   end;
  597.  
  598.   pservent = ^servent;
  599.  
  600. {
  601.  * ioctl & ip trace support
  602. }
  603. const
  604.   SIOCGIFFLAGS        =  $6900 + 17;    // get interface flags
  605.  
  606.   { Interface Tracing Support }
  607.   SIOCGIFEFLAGS     =  $6900 + 150; // get interface enhanced flags
  608.   SIOCSIFEFLAGS     =  $6900 + 151; // set interface enhanced flags
  609.   SIOCGIFTRACE        =  $6900 + 152; // get interface trace data
  610.   SIOCSIFTRACE        =  $6900 + 153; // set interface trace data
  611.   { sorry, i skip other ioctl commands, see SYS\ioctl.h from toolkit for it.. }
  612.  
  613.   IFF_UP        =  $1;        // interface is up
  614.   IFF_BROADCAST     =  $2;        // broadcast address valid
  615.   IFF_DEBUG        =  $4;        // turn on debugging
  616.   IFF_LOOPBACK        =  $8;        // is a loopback net
  617.   IFF_POINTOPOINT    =  $10;     // interface is point-to-point link
  618.   IFF_LINK2        =  $20;     // was trailers, not used
  619.   IFF_NOTRAILERS    =  IFF_LINK2;
  620.   IFF_RUNNING        =  $40;     // resources allocated
  621.   IFF_NOARP        =  $80;     // no address resolution protocol
  622.   IFF_PROMISC        =  $100;    // receive all packets
  623.   IFF_ALLMULTI        =  $200;    // receive all multicast packets
  624.   IFF_BRIDGE        =  $1000;    // support token ring routine field
  625.   IFF_SNAP        =  $2000;    // support extended SAP header
  626.   IFF_DEFMTU        =  $400;    // default mtu of 1500
  627.   IFF_RFC1469_BC    =  1;        // using broadcast
  628.   IFF_RFC1469_FA    =  2;        // using functional
  629.   IFF_RFC1469_MA    =  3;        // using multicast
  630.   IFF_ETHER        =  $4000;    // Ethernet interface
  631.   IFF_LOOPBRD        =  $8000;    // loop back broadcasts
  632.   IFF_MULTICAST     =  $800;    // supports multicast
  633.  
  634.   IFF_SIMPLEX        =  $10000;    // can't hear own transmissions
  635.   IFF_OACTIVE        =  $20000;    // transmission in progress
  636.   IFF_802_3        =  $40000;
  637.   IFF_CANONICAL     =  $80000;
  638.   IFF_RUNNINGBLK    =  $100000;    // threads waited for intf running
  639.  
  640.   { Interface enhanced flags }
  641.   IFFE_PKTTRACE     =  $00000001;    // trace datalink where possible
  642.   IFFE_IPTRACE        =  $00000002;    // trace ONLY IP packets
  643.  
  644. type
  645.   { trace buffer struct }
  646.   pkt_trace_hdr = record
  647.      pt_htype        :  SmallWord;    // header type
  648.      pt_len        :  SmallWord;    // in: pt_buf len, out: packet len
  649.      pt_data        :  Pointer;    // packet
  650.      pt_tstamp        :  Longint;    // time stamp in milliseconds
  651.   end;
  652.  
  653. const
  654.   { physical protocols IDs }
  655.   HT_IP         =  $01;  // IP
  656.   HT_ETHER        =  $06;  // Ethernet
  657.   HT_ISO88023        =  $07;  // CSMA CD
  658.   HT_ISO88025        =  $09;  // Token Ring
  659.   HT_SLIP        =  $1c;  // Serial Line IP
  660.   HT_PPP        =  $18;  // PPP IP
  661.  
  662. const
  663.   IFNAMSIZ        =  16;     // interface name length
  664.  
  665. type
  666. {
  667. * Interface request structure used for socket
  668. * ioctl's.  All interface ioctl's must have parameter
  669. * definitions which begin with ifr_name.  The
  670. * remainder may be interface specific.
  671. }
  672.   ifreq = record
  673.      ifr_name        :  array[0..IFNAMSIZ-1] of Char;
  674.      case Byte of
  675.      0: (ifr_addr    :  sockaddr);  // address
  676.      1: (ifr_dstaddr    :  sockaddr);  // other end of p-to-p link
  677.      2: (ifr_broadaddr    :  sockaddr);  // broadcast address
  678.      3: (ifr_flags    :  SmallWord); // flags
  679.      4: (ifr_metric    :  Longint);   // metric
  680.      5: (ifr_data    :  Pointer);   // for use by interface
  681.      6: (ifr_eflags    :  Longint);   // eflags
  682.   end;
  683.  
  684.  
  685. { --- inet* funcs from TCP32DLL.DLL --- }
  686.  
  687. { * stupid checkings for network addrs }
  688.  
  689. function  IN_CLASSA(i:Longint):Boolean; inline;
  690. Begin
  691.    IN_CLASSA:=(((i) and $80000000) = 0);
  692. end;
  693.  
  694. function  IN_CLASSB(i:Longint):Boolean; inline;
  695. Begin
  696.    IN_CLASSB:=(((i) and $c0000000) = $80000000);
  697. end;
  698.  
  699. function  IN_CLASSC(i:Longint):Boolean; inline;
  700. Begin
  701.    IN_CLASSC:=(((i) and $e0000000) = $c0000000);
  702. end;
  703.  
  704. function  IN_CLASSD(i:Longint):Boolean; inline;
  705. Begin
  706.    IN_CLASSD:=(((i) and $f0000000) = $e0000000);
  707. end;
  708.  
  709. function  IN_MULTICAST(i:Longint):Boolean; inline;
  710. Begin
  711.    IN_MULTICAST:=(((i) and $f0000000) = $e0000000);
  712. end;
  713.  
  714. function  IN_EXPERIMENTAL(i:Longint):Boolean; inline;
  715. Begin
  716.    IN_EXPERIMENTAL:=(((i) and $e0000000) = $e0000000);
  717. end;
  718.  
  719. function  IN_BADCLASS(i:Longint):Boolean; inline;
  720. Begin
  721.    IN_BADCLASS:=(((i) and $f0000000) = $f0000000);
  722. end;
  723.  
  724.  
  725. { * convertions of inet host/strings/etc }
  726.  
  727. {$saves ebx,esi,edi}
  728. function  inet_addr(const ip_str:PChar):Longint;
  729. { ip addr str -> 4 byte ip addr }
  730.  
  731. {$saves ebx,esi,edi}
  732. procedure inet_makeaddr(var net_addr:Longint; host_addr:Longint);
  733. { fucking shit ;) see docs for more info }
  734.  
  735. {$saves ebx,esi,edi}
  736. function  inet_network(const net_str:PChar):Longint;
  737. { net addr str -> 4 byte net addr }
  738.  
  739. {$saves ebx,esi,edi}
  740. function  inet_ntoa(inet_addr:Longint):PChar;
  741. { 4 byte ip addr -> ip addr str }
  742.  
  743. {$saves ebx,esi,edi}
  744. function  inet_lnaof(inet_addr:Longint):Longint;
  745. { return local part of network addr }
  746.  
  747. {$saves ebx,esi,edi}
  748. function  inet_netof(inet_addr:Longint):Longint;
  749. { return network part of network addr }
  750.  
  751. {&Cdecl-}
  752.  
  753. {$uses none} {$saves all}
  754. function  LSwap(a:Longint):Longint;
  755. {$uses none} {$saves all}
  756. function  WSwap(a:SmallWord):SmallWord;
  757.  
  758. function  htonl(a:Longint):Longint; inline;
  759. begin    Result:=LSwap(a);   end;
  760. { host -> network for long (4 bytes) }
  761.  
  762. function  ntohl(a:Longint):Longint; inline;
  763. begin    Result:=LSwap(a);   end;
  764. { network -> host for long (4 bytes) }
  765.  
  766. function  htons(a:SmallWord):SmallWord; inline;
  767. begin    Result:=WSwap(a);   end;
  768. { host -> network for small (2 bytes) }
  769.  
  770. function  ntohs(a:SmallWord):SmallWord; inline;
  771. begin    Result:=WSwap(a);   end;
  772. { network -> host for small (2 bytes) }
  773.  
  774. {&Cdecl+}
  775.  
  776.  
  777. { --- resolver & proto/services funcs ---}
  778.  
  779. {$saves ebx,esi,edi}
  780. function  h_errno:Longint;
  781. { return last resolv error code.
  782.   only for gethostbyname(), gethostbyaddr() and res_* }
  783.  
  784. {$saves ebx,esi,edi}
  785. function  gethostbyname(const hostname:PChar):phostent;
  786. { return pointer to hostent record by name }
  787.  
  788. {$saves ebx,esi,edi}
  789. function  gethostbyaddr(var hostaddr:Longint;
  790.             addrlen, addrfam:Longint):phostent;
  791. { return pointer to hostent record by addr }
  792.  
  793. {$saves ebx,esi,edi}
  794. function  getprotobyname(const protoname:PChar):pprotoent;
  795. { return pointer to protoent by proto name }
  796.  
  797. {$saves ebx,esi,edi}
  798. function  getprotobynumber(protonumber:Longint):pprotoent;
  799. { return pointer to protoent by proto number }
  800.  
  801. {$saves ebx,esi,edi}
  802. function  getservbyname(const servname,protoname:PChar):pservent;
  803. { return pointer to servent by service name }
  804.  
  805. {$saves ebx,esi,edi}
  806. function  getservbyport(port_num:Longint; const protoname:PChar):pservent;
  807. { return pointer to servent by service port }
  808.  
  809. {$saves ebx,esi,edi}
  810. function  gethostname(var hostname; namelen:Longint):Longint;
  811. { return current hostname to buf, max lenght = namelen;
  812.   0 - ok, -1 - err }
  813.  
  814.  
  815. { --- sock* funcs from SO32DLL.DLL --- }
  816.  
  817.  
  818. { * init / misc funcs }
  819.  
  820. {$saves ebx,esi,edi}
  821. function  sock_init:Longint;
  822. { init sockets system }
  823.  
  824. {$saves ebx,esi,edi}
  825. function  getinetversion(var version):Longint;
  826. { get inet version. version - buffer of ?? size for returned string. }
  827.  
  828.  
  829. { * sockets errors reporting funcs }
  830.  
  831. {$saves ebx,esi,edi}
  832. function  sock_errno:Longint;
  833. { last err code for this thread }
  834.  
  835. {$saves ebx,esi,edi}
  836. procedure psock_errno(const str:PChar);
  837. { print last err string + str if not NIL }
  838.  
  839.  
  840. { * sockets creation / close funcs }
  841.  
  842. {$saves ebx,esi,edi}
  843. function  socket(domain,stype,protocol:Longint):Longint;
  844. { create new socket }
  845.  
  846. {$saves ebx,esi,edi}
  847. function  soclose(sock:Longint):Longint;
  848. { close socket }
  849.  
  850. {$saves ebx,esi,edi}
  851. function  so_cancel(sock:Longint):Longint;
  852. { cancel socket }
  853.  
  854. {$saves ebx,esi,edi}
  855. function  shutdown(sock,howto:Longint):Longint;
  856. { shutdown socket. howto: 0/1/2 }
  857.  
  858. {$saves ebx,esi,edi}
  859. function  soabort(sock:Longint):Longint;
  860. { abort socket. no docs found about it :( }
  861.  
  862.  
  863. { * sockets connection funcs }
  864.  
  865. {$saves ebx,esi,edi}
  866. function  accept(sock:Longint; s_addr:psockaddr;
  867.          s_addr_len:PLongint):Longint;
  868. { accept a connection from remote host.
  869.   returns s_addr & s_addr_len if not nil }
  870.  
  871. {$saves ebx,esi,edi}
  872. function  bind(sock:Longint; var s_addr:sockaddr; s_addr_len:Longint):Longint;
  873. { bind a local name to the socket }
  874.  
  875. {$saves ebx,esi,edi}
  876. function  connect(sock:Longint; var s_addr:sockaddr;
  877.           s_addr_len:Longint):Longint;
  878. { connect socket to remote host }
  879.  
  880. {$saves ebx,esi,edi}
  881. function  listen(sock,max_conn:Longint):Longint;
  882. { listen on socket. max_conn - queue size of listen. }
  883.  
  884.  
  885. { * sockets read/write funcs }
  886.  
  887. {$saves ebx,esi,edi}
  888. function  recv(sock:Longint; var buf; buf_len,flags:Longint):Longint;
  889. { read data from socket. ! return N of readed bytes, or 0 (closed) or -1 }
  890.  
  891. {$saves ebx,esi,edi}
  892. function  send(sock:Longint; var buf; buf_len,flags:Longint):Longint;
  893. { send data to socket. ! return N of sent bytes. -1 - err }
  894.  
  895. {$saves ebx,esi,edi}
  896. function  recvfrom(sock:Longint; var buf; buf_len,flags:Longint;
  897.            var s_addr:sockaddr; var s_addr_len:Longint):Longint;
  898. { read data from socket. ! return N of readed bytes, or 0 (closed) or -1 }
  899.  
  900. {$saves ebx,esi,edi}
  901. function  sendto(sock:Longint; var buf; buf_len,flags:Longint;
  902.          var s_addr:sockaddr; s_addr_len:Longint):Longint;
  903. { send data to socket. ! return N of sent bytes. -1 - err }
  904.  
  905. {$saves ebx,esi,edi}
  906. function  readv(sock:Longint; var iov:iovec; iov_count:Longint):LONGINT;
  907. { read data into iov_count number of buffers iov.
  908.   ! return N of readed bytes, or 0 (closed) or -1 }
  909.  
  910. {$saves ebx,esi,edi}
  911. function  writev(sock:Longint; var iov:iovec; iov_count:Longint):LONGINT;
  912. { write data from iov_count number of buffers iov.
  913.   ! return N of writed bytes, or -1 }
  914.  
  915. {$saves ebx,esi,edi}
  916. function  recvmsg(sock:Longint; var msgbuf:msghdr; flags:Longint):Longint;
  917. { read data + control info from socket
  918.   ! return N of readed bytes, or 0 (closed) or -1 }
  919.  
  920. {$saves ebx,esi,edi}
  921. function  sendmsg(sock:Longint; var msgbuf:msghdr; flags:Longint):Longint;
  922. { send data + control info to socket
  923.   ! return N of sended bytes, or -1 }
  924.  
  925.  
  926. { * select funcs }
  927.  
  928. {$saves ebx,esi,edi}
  929. function  os2_select(var sockets;
  930.              N_reads, N_writes, N_exepts, timeout:Longint):Longint;
  931. { OS/2 select. 0 - timeout. -1 - err. XX - N of sockets worked. }
  932.  
  933. {$saves ebx,esi,edi}
  934. function  select(nfds:Longint;
  935.          const readfds,writefds,exceptfds:fd_set;
  936.          const timeout:timeval):Longint;
  937. { bsd select here. heavy voodoo.. }
  938.  
  939.  
  940. { * misc info }
  941.  
  942. {$saves ebx,esi,edi}
  943. function  gethostid:Longint;
  944. { get host ip addr - addr of primary interface }
  945.  
  946. {$saves ebx,esi,edi}
  947. function  getpeername(sock:Longint; var s_addr:sockaddr;
  948.               var s_addr_len:Longint):Longint;
  949. { get connected to socket hostname }
  950.  
  951. {$saves ebx,esi,edi}
  952. function  getsockname(sock:Longint; var s_addr:sockaddr;
  953.               var s_addr_len:Longint):Longint;
  954. { get local socket name }
  955.  
  956.  
  957. { * options & ioctls }
  958.  
  959. {$saves ebx,esi,edi}
  960. function  getsockopt(sock,level,optname:Longint;
  961.              var buf; var buf_len:Longint):Longint;
  962. { get socket options }
  963.  
  964. {$saves ebx,esi,edi}
  965. function  setsockopt(sock,level,optname:Longint;
  966.              const buf; buf_len:Longint):Longint;
  967. { set socket options }
  968.  
  969. {$saves ebx,esi,edi}
  970. function  os2_ioctl(sock,cmd:Longint; var data; data_len:Longint):Longint;
  971. { f@$king ioctl. use sys/ioctl.h }
  972.  
  973.  
  974. { * functions only for 4.1+ ip stacks (bat also found in 4.02w ;)) }
  975.  
  976. {$saves ebx,esi,edi}
  977. function  addsockettolist(sock:Longint):Longint;
  978.  
  979. {$saves ebx,esi,edi}
  980. function  removesocketfromlist(sock:Longint):Longint;
  981.  
  982. implementation
  983.  
  984. function  LSwap(a:Longint):Longint; assembler;
  985. asm
  986.       mov   eax,a
  987.       xchg  ah,al
  988.       ror   eax,16
  989.       xchg  ah,al
  990. end;
  991.  
  992. function  WSwap(a:SmallWord):SmallWord; assembler;
  993. asm
  994.       mov   ax,a
  995.       xchg  ah,al
  996. end;
  997.  
  998. function  inet_addr; external;           { TCP32DLL@5 }
  999. function  inet_lnaof; external;        { TCP32DLL@6 }
  1000. function  inet_netof; external;        { TCP32DLL@7 }
  1001. procedure inet_makeaddr; external;     { TCP32DLL@8 }
  1002. function  inet_network; external;      { TCP32DLL@9 }
  1003. function  inet_ntoa; external;           { TCP32DLL@10 }
  1004. function  gethostbyname; external;     { TCP32DLL@11 }
  1005. function  gethostbyaddr; external;     { TCP32DLL@12 }
  1006. function  getprotobyname; external;    { TCP32DLL@21 }
  1007. function  getprotobynumber; external;  { TCP32DLL@22 }
  1008. function  getservbyport; external;     { TCP32DLL@23 }
  1009. function  getservbyname; external;     { TCP32DLL@24 }
  1010. function  gethostname; external;       { TCP32DLL@44 }
  1011. function  h_errno; external;           { TCP32DLL@51 } { TCP_H_ERRNO in real life }
  1012.  
  1013.  
  1014. function  accept; external;             { SO32DLL@1 }
  1015. function  bind; external;             { SO32DLL@2 }
  1016. function  connect; external;             { SO32DLL@3 }
  1017. function  gethostid; external;             { SO32DLL@4 }
  1018. function  getpeername; external;         { SO32DLL@5 }
  1019. function  getsockname; external;         { SO32DLL@6 }
  1020. function  getsockopt; external;          { SO32DLL@7 }
  1021. function  os2_ioctl; external;             { SO32DLL@8 }
  1022. function  listen; external;             { SO32DLL@9 }
  1023. function  recv; external;             { SO32DLL@10 }
  1024. function  recvfrom; external;             { SO32DLL@11 }
  1025. function  os2_select; external;          { SO32DLL@12 }
  1026. function  send; external;             { SO32DLL@13 }
  1027. function  sendto; external;             { SO32DLL@14 }
  1028. function  setsockopt; external;          { SO32DLL@15 }
  1029. function  socket; external;             { SO32DLL@16 }
  1030. function  soclose; external;             { SO32DLL@17 }
  1031. function  so_cancel; external;             { SO32DLL@18 }
  1032. function  soabort; external;             { SO32DLL@19 }
  1033. function  sock_errno; external;          { SO32DLL@20 }
  1034. function  recvmsg; external;             { SO32DLL@21 }
  1035. function  sendmsg; external;             { SO32DLL@22 }
  1036. function  readv; external;             { SO32DLL@23 }
  1037. function  writev; external;             { SO32DLL@24 }
  1038. function  shutdown; external;             { SO32DLL@25 }
  1039. function  sock_init; external;             { SO32DLL@26 }
  1040. function  addsockettolist; external;         { SO32DLL@27 }
  1041. function  removesocketfromlist; external;    { SO32DLL@28 }
  1042. { entry 29 not used }
  1043. procedure psock_errno; external;         { SO32DLL@30 }
  1044. function  getinetversion; external;         { SO32DLL@31 }
  1045. function  select; external;             { SO32DLL@32 }
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051. end.
  1052.  
  1053.  
  1054.