home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / docum / novell.doc / misc_nw.arj / IPX.TXT next >
Encoding:
Text File  |  1991-07-24  |  51.8 KB  |  1,365 lines

  1.  
  2.  
  3.             File is created by
  4.                Izotov Maxim
  5.                 2:5020/10.4
  6.           with Documentation about IPX
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.               Advanced NetWare v2.0
  18.  
  19.          Internetwork Packed Exchange Protocol
  20.                   ( IPX )
  21.  
  22.                 with
  23.  
  24.  
  25.  
  26.            Asynchronous Event Sheduler
  27.                 (AES)
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.           Specifications as of March 19,1986
  38.    Copyright (c) 1986 by Novell, Inc. All Rights Reserved
  39.  
  40. NOTICE:  The  specifications  contained  in  this  document are
  41. intended to be complete and accurate. However, Novell  reserved
  42. the right to change, augment,  or diminish any or all  of these
  43. specifications without notice.
  44.  
  45.  
  46.  
  47. The scope of this document................................... 1
  48. IPX overview................................................. 1
  49. AES overview................................................. 1
  50.  
  51. IPX Internetwork packets......................................2
  52.     General Structure of IPX Packets .....................2
  53.     Structure of IPX Packet Headers ......................2
  54.     Description of Header Contents .......................3
  55.         Checksum .....................................3
  56.         Length .......................................3
  57.         Transport control ............................3
  58.         Packet type ..................................3
  59.         Destination Network ..........................4
  60.         Destination Node .............................4
  61.         Destination Socket ...........................4
  62.         Source Network ...............................5
  63.         Source Node ..................................5
  64.         Source Socket ................................6
  65.  
  66.     Events and Event control blocks ......................7
  67.         General Structure ............................8
  68.         Description of Field Contents ................8
  69.             Link .................................8
  70.             ERS Address ..........................8
  71.             In use ...............................9
  72.             Completion Code ......................9
  73.             Socket Number .......................10
  74.             IPX Workspace .......................10
  75.             Driver Workspace ....................10
  76.             Immediate Address ...................10
  77.             Fragment Count ......................11
  78.             Fragment Description List ...........11
  79.  
  80.     Event control blocks for special - purpose events ...12
  81.         General Structure ...........................12
  82.         Description of Field contents ...............12
  83.             Link.................................12
  84.             ERS address .........................12
  85.             In Use ..............................12
  86.             AES Workspace .......................12
  87.  
  88. - 1 -
  89.  
  90.            The scope of this document
  91.  
  92. This document describes the IPX and AES programming  interfaces
  93. as they have been implemented for 8088/8086-based  workstations
  94. using  MS/PC-DOS  2.x  or  3.x  and  the corrasponding Advanced
  95. Netware v2.0 Workstations Shells.
  96.  
  97.                IPX Overview
  98.  
  99. The  Advanced  Netware   Internetwork  Packet  Exchange   (IPX)
  100. Protocol  is   an  implementations   of  Xerox's   Internetwork
  101. PacketProtocol.  The  purpose  of  IPX  is to allow applicatios
  102. running  on  a  Netware  workstation  to  take advantage of the
  103. Netware network drives to communicate with other  workstations,
  104. servers, or devices on the internetwork.
  105.  
  106. IPX is a  service that provides  to applications theability  to
  107. send  and  receive  individual  packets  on  the  internetwork.
  108. Internetwork  packets  are  structured  as  defined  by   Xerox
  109. Network Standard  (XNS). In  the Advanced  NetWare internetwork
  110. environment (  a network  comprised of  one or  more LANs using
  111. Advanced  NetWare),  each  node  (a  device  attached  to   the
  112. network)  has  a  unique  internetwork  address.  Using  IPX, a
  113. NetWare workstations  may send  or receive  packets to  or from
  114. any node on  the internetwork. The  routing of packets  between
  115. nodes  which  reside  on  physically  different LANs is largely
  116. automatic and  transparent. This  transparency is  accomplished
  117. by  the  IPX  facility  in  conjunction  wich  the  services of
  118. Advanced NetWare bridges.
  119.  
  120. The network drives make  a "best effort" to  physically deliver
  121. the packets but do  not quarantee delivery. The  implementation
  122. of  reliable  delivery,  sequenced  protocols, data stream, and
  123. other higher - level interconnection protocol may be buil  upon
  124. the IPX  packet protocol  as needed  by specific  applications.
  125. The IPX protocol  is intended to  be used as  a foundation upon
  126. which a  variety of  sophisticaated applicatons  may be  built,
  127. including communicaton servers, PC-to-mainframe  concentrators,
  128. or direct interworkstations message systems.
  129.  
  130. IPX  is  fully  supported  on  all  LAN  topologies  which  are
  131. supported by Advanced NetWare  v2.0. The IPX protocol  provides
  132. full transparency and  consistency across any  Advanced NetWare
  133. internetworks.
  134.  
  135.                AES Overview
  136.  
  137. The Asynchronous  Event Sheduler  (AES) is  an auxilary service
  138. which  provides  a  means  of  measuring  elapsed  time  and/or
  139. triggering  events   at  the   conclusion  of   measured   time
  140. intervals.  Events are: the completion of an IPX send  request,
  141. the reception  of a  packet in  fulfillment of  an IPPX  listen
  142. request,  or  the  expiration  of  an  applicaton-defined  time
  143. intervals. A service  routine may be  provided for each  event;
  144. it  will  be  called  when  the  event occurs. If necessary, an
  145. event  service  routine  may   reshedule  itself  for   delayed
  146. execution after a given time interval has elapsed.
  147.  
  148. - 2 -
  149.  
  150.             IPX internetwork Packets
  151.  
  152. The packet structure of IPX packets is precisely the  structure
  153. of Xerox's  XNS packets.  The packet  structure will  be brifly
  154. outlined  below;  interessed  users  are  referred to the Xerox
  155. document "Internetwork Transport Protocol" (Xerox  Corporation,
  156. Xerox  System  Integration  Standard;  Stamford;   Connecticut;
  157. December 1981; XSIS-028112) for  a more detailed discussion  of
  158. the XNS packet protocol.
  159.  
  160.         General  Structure of IPX Packets
  161.  
  162. An IPX packet  consist of 30  bytes of header  followd by 0  to
  163. 546  bytes  of  data.  Thus,  the  minimum  packet length is 30
  164. bytes, and the maximum length is 576 bytes.
  165.  
  166. Contents  and  structure  of  the  data  portion  of packet are
  167. entirely  the  responsibility  of  the application(s) using IPX
  168. and may take format required.
  169.  
  170.          Structure of IPX Packet Headers
  171.  
  172. The IPX header (first 30 bytes of all packets) must conform  to
  173. the following format:
  174.  
  175. Offset    Field            Size      Data Type
  176. ---------------------------------------------------------------
  177. 0      Checksum             2 bytes  h-l i's comlement integer
  178. 2    Length            2 bytes  high-low unsigned integer
  179. 4    Transport Control    1 byte      unsigned integer
  180. 5    Packet Type        1 byte      unsigned integer
  181.  
  182. 6    Destination Network    4 bytes  high-low unsigned integer
  183. 10    Destination Node    6 bytes  high-low unsigned integer
  184. 16    Destination Socket    2 bytes  high-low unsigned integer
  185.  
  186. 18    Source Network    4 bytes  high-low unsigned integer
  187. 22    Source Node        6 bytes  high-low unsigned integer
  188. 28    Source Socket        2 bytes  high-low unsigned integer
  189. ---------------------------------------------------------------
  190.  
  191. Note that numeric  fields composed of  more than 1  byte can be
  192. in two opposite  formats: high-low(h-l) and  low-high. High-low
  193. numbers contain the most significant byte in the first byte  of
  194. the field, the next-most  significant byte in the  second byte,
  195. and  so  on,  with  the  least significant byte appearing last.
  196. Low-high numbers are stored in exactly the opposite order.
  197.  
  198. - 3 -
  199.  
  200.          Description of Header Contents
  201.  
  202. Following is  a basic  descriptions of  the meaning  and use of
  203. each field in an IPX packed header.
  204.  
  205.                  Checksum
  206.  
  207. This field is  a one's complement  add and left  cycle checksum
  208. of  the  16-bit  words  in  the  packed header. This fiels will
  209. contain  a  -zero  (FFFFh)  if  no  checksum  is  desired. If a
  210. calculated checksum comes to -zero  then it should be reset  to
  211. +zero (0000h).
  212.  
  213. Note that  field is  a checksumof  the 30-byte  header only. If
  214. applications wish  to checksumtheir  own data  then they should
  215. provide their own checksumin  some agreed-upon portion of  data
  216. area.
  217.  
  218. A  given  NetWareshell  implementation  may  not  verify   this
  219. checksum  when   receiving  a   packed.  If   header   checksum
  220. verification is required,  then it should  be performad by  the
  221. application to whom the packed is delivered.
  222.  
  223.                   Lenght
  224.  
  225. This field contain the  length of the complete  network packed,
  226. which is the length of the  header plus the length of the  data
  227. section.  Therefore,  the  minimum   length  of  a  packed   is
  228. 30-bytes, and the maximum length of a packet is 576 bytes.
  229.  
  230.              Transport Control
  231.  
  232. This field  is used  by Advanced  Netware Internetwork  Bridges
  233. and always set to zero before a packed is sent.
  234.  
  235.                 Packed Type
  236.  
  237. This field indicates the "type" of service offered or  required
  238. by the packet; Xerox has defined the following values:
  239.  
  240. 0    Unknown packed type
  241. 1    Routing Information Packet
  242. 2    Echo packet
  243. 3    Error packet
  244. 4    Packet Exchange Packet
  245. 5    Sequenced Packet Protocol Packet
  246. 16-31    Experimental Protocol
  247.  
  248. Users are strongly  encouraged to use  either packet type  0 or
  249. packet type 4 in all their packets.
  250.  
  251.  
  252. - 4 - 
  253.  
  254.             Destination Network
  255.  
  256. This field contain a network number of the destination  network
  257. where the node can be found to whom the packet is addressed.
  258.  
  259. Under Advanced NetWare,  networks connected on  an internetwork
  260. are   assigned   4-byte   networks   number   by   a    network
  261. administrator.  Each  network  on  a  connected internetwork is
  262. required to have a unique number.
  263.  
  264. If this field is set to  0, the destination node is assumed  to
  265. reside on the  same physical network  to which the  source node
  266. is  connected;  the  packet  will  be sent without involving an
  267. Advanced NetWare Internetwork Bridge.
  268.  
  269.              Destination Node
  270.  
  271. This  field  contain  a  6-byte  number  which  identifis   the
  272. physical address (on  the destination network)  of the node  to
  273. which the packet is destined.
  274.  
  275. Note  that  not  all  physical  LAN  topologies  use  same size
  276. address fields.  A node  on an  EtherNet network  would require
  277. all 6 bytes to specify its address, while a node on an  OmniNet
  278. network would require only 1 byte.
  279.  
  280. If a physical network needs  less than 6 bytes to  specify node
  281. addresses,  then  the  portion  of  the  address  needed should
  282. occupy the least significant  (last) portion of this  field and
  283. the first bytes of the field should be set to zeroes.
  284.  
  285. Setting all six bytes to  FFh indicates that the packet  should
  286. be broadcast to all  nodes on the specified  network. Broadcast
  287. to  all  nodes  on  a  network  may  or  may  not be supported,
  288. depending  on  the  physical  characteristics  (i.e.  broadcast
  289. support)  of  the  underlying  physical  network  to  which the
  290. packet is destined.
  291.  
  292.             Destination Socket
  293.  
  294. This fiels contains the socket address of the software  routine
  295. to which the packet is destined.
  296.  
  297. Socket numbers are used to route packets to different  software
  298. ruotines  within  a  given  node.  Xerox  has  reserved certain
  299. sockets for special use. Pre-defined sockets are as follows:
  300.  
  301. 1    Routing Information packet
  302. 2    Echo protocol packet
  303. 3    Error handler packet
  304. 32-63    Experimental
  305.  
  306. - 5 -
  307.  
  308. Sockets  with  numbers  below  3.000  (decimal)  are considered
  309. "well-known" sockets with  statically assigned meanings,  while
  310. sockets  with  numbers  above  3.000 are dynamically assignable
  311. sockets.
  312.  
  313. Applications  developers   that  wish   to  produce   a  unique
  314. well-known socket  may request  that Xerox  assign them  one. A
  315. small fee and  some amount of  processing time may  be required
  316. by Xerox.
  317.  
  318. Novell has  obtained from  Xerox a  set of  sockets for various
  319. uses in the Advanced NetWare environment. For example,  NetWare
  320. File Servers accept requests addressed to socket 0451h.
  321.  
  322. Because it  is unlickely  that NetWare  systems will frequently
  323. find  themselves  co-existing  with  bona fide Xerox networking
  324. software, Novell  has decided  to offer  an alternative  scheme
  325. for addressing socket numbers. Novell will administrate a  list
  326. of   sockets   that   will   be   well-known   in  all  NetWare
  327. environments.   Software    developers   writing    value-added
  328. packetges for NetWare should  find it simpler to  obtain socket
  329. assigments from  Novell. Numbers  assigned by  Novell begin  at
  330. 8000h (32.768 decimal). Dynamic socket numbers begin at 4000h.
  331.  
  332.               Source Network
  333.  
  334. This field contains the network number of the LAN to which  the
  335. node that originated the packet is connected.
  336.  
  337. This  field  may  contain  a  value  of  zero,  indicating   an
  338. "unknown" number for  the network to  which the source  node is
  339. physically connected.
  340.  
  341. Incidentally, all packets with a zero in this field which  pass
  342. through an Advanced NetWare Internetwork Bridge will have  this
  343. field set  with the  real source  network number.  Thus, when a
  344. packet is  received from  a node  on a  different network,  the
  345. Source  Network  field  will  always  be  set properly; packets
  346. originated by a node on the same network as the receiving  node
  347. are the only  packets which may  still contain a  value of zero
  348. in this field.
  349.  
  350.                 Source Node
  351.  
  352. This  field  contain  the  physicall  address  of the node from
  353. which the packet originated.
  354.  
  355. How many  bytes of  this address  are actually  used to address
  356. the given node is a function of the physicall network to  which
  357. the  node  is  connected.  See  the  related  discussion in the
  358. preceding definition of the Destination Node field.
  359.  
  360. - 6 -
  361.  
  362.                Source socket
  363.  
  364. This  field  contain  the  socket  address  being  used  by the
  365. software routine that originated the packet.
  366.  
  367. Although it is  not required by  the IPX protocol,  it is usual
  368. for all  stations communicating  about a  particular task  in a
  369. peer-to-peer fashion to send and receive using the same  socket
  370. number. In a client/server situation, the node which is  acting
  371. as a server (perhaps a communicating gateway) would lickely  be
  372. listening  on  a  specific  socket  for frequest to service. In
  373. such cases,  the source  socket is  not necessary  the same  or
  374. even significant; all that matters is that the server reply  to
  375. the given source socket.
  376.  
  377. For example, all  Advanced NetWare file  servers have the  same
  378. socket  address,  but  request  to  them  may  be originated by
  379. clients using any socket number.
  380.  
  381. If software developers wish to have a uniquely assigned  static
  382. socket  to  communicate  on  then  they should contact Xerox or
  383. Novell  to  have  a  socket  number  assigned  to him. (See the
  384. discussion  of  socket  number   allocation  in  the   previous
  385. description of the Destination Socket field.)
  386.  
  387. - 7 -
  388.  
  389.          Events and Event control blocks
  390.  
  391. An Event Control Block (ECB) is a data structure that  contains
  392. information  required  to   coordinate  the  sheduling   and/or
  393. activation of  certain desired  operations. Nearly  all IPX  or
  394. AES  function  act  upon  ECBs  and/or  the  information   they
  395. represent. 
  396.  
  397. There are two different kinds of events that may occur,  events
  398. related   to   an   IPX   send   or   receive   operation,  and
  399. special-purpose events sheduled  by an application.  All events
  400. have an associated Event Control Block.
  401.  
  402. For example,  when an  application desired  to transmit  an IPX
  403. packet, it must first prepare  an ECB which describes where  to
  404. obtain  the  packet  data.  The  completed  sending of a packet
  405. constitutes an "IPX send event".
  406.  
  407. Linkwise, when  an application  desires to  receive packets, it
  408. must make one or more  ECBs available to IPX to  describe where
  409. to store incoming packet data.  The reception of a packet  will
  410. cause an "IPX receive event".
  411.  
  412. Additionally,  an   application  may   define  and   shedule  a
  413. special-purpose event. An Event Control Block must be  supplied
  414. to the AES along with a time interval. The AES will  count-down
  415. the remaining time in  the given interval. When  the count-down
  416. timer reaches zero, the scheduled event occurs.
  417.  
  418. There are  two metods  by which  an event  may be  detected and
  419. acted upon by the application: polling an "in use" status  flag
  420. or  providing  a  service  routine  which  can be invoked in an
  421. interrupt-like fashion.
  422.  
  423. Every Event  Control Block  has an  "in-use" status  flag. This
  424. flag is automatically set to  a non-zero value whenever an  ECB
  425. is passed to an IPX or AES function to request an event.  While
  426. this  flag  is  non-zero,  the  application  must not alter the
  427. contents of the Event Control Block.
  428.  
  429. When  IPX  or  the  AES  has  finished  performing  the request
  430. function involving  the specified  ECB, the  "in-use" flag will
  431. automatically be set  to zero. At  this point, the  application
  432. has  total  freedom  to  manipulate  the  ECB  and  any  of its
  433. associated data.
  434.  
  435. An application may find, in  some cases, that it is  sufficient
  436. to  periodically  pool  the  status  of all outstanding ECBs to
  437. determine when the awaited events have occured.
  438.  
  439. Alternatively,  every  Event  Control  Block  provides a way to
  440. specify  the  address  of  an  Event Source Routine (ESR) which
  441. will be called in  an interrupt-like fashion when  the expected
  442. event  has  occured,  use  of  an  ESR  more readily allows for
  443. real-time, asynchronous  background operations  to occur  while
  444. the main body of the application performs some other activity.
  445.  
  446. Event Control Blocks for IPX events have a different  structure
  447. than  ECBs  intended  for  special  events;  honewer, congruent
  448. structuring of the first few  fields in each type of  ECB allow
  449. either kind  of ECB  to be  used with  the AES.  Thus, an Event
  450. Service Routine invoked by an IPX event may use its  associated
  451. ECB to re-shedule itself to "occur" at a later time.
  452.  
  453. - 8 -
  454.  
  455.           Event Control Blocks for IPX events
  456.  
  457. IPX function require  a long form  of Event Control  Block ( an
  458. "IPX-ECB"). The format  of an IPX-ECB  and the meaning  of each
  459. field will be described in this section.
  460.  
  461. General Structure
  462.  
  463. Offset    Field                 Size      Data Type
  464. ------ -----                 -----     ----------
  465. 0       Link                  4 bytes   8086 long address 
  466.                                         (offset,segment) 
  467. 4       ESR Address           4 bytes   8086 long address 
  468.                                         (offset,segment)
  469. 8       In Use                1 byte    Unsigned integer 
  470. 9       Completion Code       1 byte    Unsigned integer 
  471. 10      Socket Number         2 bytes   High-low uinteger 
  472. 12      IPX Workspace         4 bytes   N/A 
  473. 16      Driver Workspace     12 bytes   N/A
  474. 28      Immediate Address     6 bytes   High-low uns. integer
  475. 34      Fragment Count        2 bytes   Low-high uns. integer
  476. 36      Fragment Descriptor-1 6 bytes   Structure:
  477.         Address               4 bytes   8086 long address 
  478.                                         (off,seg) 
  479.         Size                  2 bytes   Low-high uns.integer 
  480. 30+n*6  Fragment Descriptor-n 6 bytes   Structure
  481.  
  482. As can  be seen  in the  above structure,  an IPX Event Control
  483. Block consist of two parts.
  484.  
  485. The   first,   fixed   portion   (36   bytes   long)   contains
  486. status/information fields  as well  as a  workspace for  use by
  487. IPX and the network hardware drivers.
  488.  
  489. The second, variable  portion is a  list of one  or more buffer
  490. fragment addresses and  lengths. This Fragment  Descriptor List
  491. defines  the  places  in  memory  from  which  a packet will be
  492. gathered for  sending of  to which  a packet  will be scattered
  493. upon reception.
  494.  
  495.           Description of Field Contents
  496.  
  497.                 Link
  498.  
  499. This field is maintained  by IPX when the  ECB is in use.  When
  500. the ECB is not in use,  the application may use this field,  if
  501. desired. Most commonly,  it would be  used as a  link field for
  502. keeping the ECB in free/ready lists or queues.
  503.  
  504.                 ESR Address
  505.  
  506. This field contains the address of an application - defined Event 
  507. Service Routine (ESR) that IPX will call when the expected event 
  508. (a packet send or receive operation) has been completed.
  509.  
  510. - 9 -
  511.  
  512. Because IPX maintains the In Use and Completion Code fields, it 
  513. is possible for a programm to simply poll the status of its 
  514. outstanding IPX request at appropriable intervals and not use a 
  515. service routine at all. If no Event Service Routine is desired, 
  516. then the ESR Address should be set to null (four bytes of zero).
  517.  
  518. For a  complete discussion of Event Service Ruotine usage, 
  519. implementation and restriction quidelines, see the section 
  520. entitled Event Service Routine Implementation.
  521.  
  522. In Use
  523.  
  524. This field contains a non-zero  value whenever the ECB is  in use
  525. by the IPX  or AES. Following  is a list  of possible values  and
  526. their meanings:
  527.  
  528. FFh    The ECB is in use for transmitting
  529. FEh    The ECB is "listening" on a certain socket for incoming 
  530.     packets
  531. FDh    The ECB has been schedulled with the AES and is awaiting 
  532.     the expiration of its time interval.
  533. FBh    A send or receive event has occured, but yhe ECB is in a 
  534.     temporary holding queue, waiting to be officially 
  535.     processed
  536.  
  537. IPX will reset this field to zero when the request action has 
  538. been completed.
  539.  
  540. Completion Code
  541.  
  542. This field is set by the IPX routines to indicate the final 
  543. status of the request represented by the Event Control Block. 
  544. This field can not be considered valid until after IPX has reset 
  545. the In Use field to zero.
  546.  
  547. When an ECB has been given to IPx for the purpose of sending a 
  548. packet, any of the following completion codes may be reported:
  549.  
  550. 00h    The send was completed successfully. This does not 
  551.     guarantee that the packet was received successfully. The 
  552.     packet may have been lost somewhere along the way, or 
  553.     even if it made it all the way to the target node there 
  554.     may have been no available receive buffers.
  555. FFh    Physically unable to send the packet (Hardware or network 
  556.     failure.)
  557. FEh    Packet Undeliverable (destination detected not to exist, 
  558.     no Internetwork Bridge available, or possible hardware 
  559.     failure).
  560. FDh    Malformed packet (total length is less than 30 bytes of 
  561.     too large, first fragment is too small for IPX header, or 
  562.     Fragment Count is zero)
  563. FCh    The send request was cancelled.
  564.  
  565. - 10 -
  566.  
  567. When an ECB has been given to IPX for the purpose of listening 
  568. for incoming packets, any of the following completion codes may 
  569. be reported:
  570.  
  571. 00h    The packet was received successfully
  572. FFh    Socket Closed. The socket that ECB was supported to 
  573.     listen on was not open.
  574. FDh    Packet overflow. A packet waas received, but the Fragment 
  575.     Count in the ECB was zero, or the available space 
  576.     described by the Fragment Descriptor was not large enough 
  577.     to contain the entire packet.
  578. FCh    The liste request for this packet was canceled.
  579.  
  580. Socket Number
  581.  
  582. This field contains the number of the socket with which this ECB 
  583. is associated. When an ECB is used for sending, this field 
  584. contains the socket that the packet was sent from; when 
  585. receiving, this field contains the socket that the packet was 
  586. received on.
  587.  
  588. IPX Workspace
  589.  
  590. This four-byte fild is reserved for use by the IPX Routines. It 
  591. does not need to be initialized to any values, and it must not be 
  592. changed while the control block is being used by the IPX 
  593. routines. When the ECB is not in use by the IPX, this area may be 
  594. used in any fashion desired.
  595.  
  596. Driver Workspace
  597.  
  598. This twelve-byte field is reserved for use by the physical 
  599. network drivers. It does not need to be initialized to any 
  600. values, and it must not be changed while the control block is 
  601. being used by the IPX routines. When the ECB is not in use by the 
  602. IPX, this ares\a may be used in any fashions desired.
  603.  
  604. Immediate Address
  605.  
  606. This six-byte field contains the address of the node to which the 
  607. packet was just sent or from which it just arrived. (this will be 
  608. the address of an Internetwork Bridge on the local network if the 
  609. packet was not to/from a node on the local network.)
  610.  
  611. - 11 -
  612.  
  613. This field contains a count of the number of buffer fragments 
  614. from which packet shiuld be built for sending, or the number of 
  615. buffers into which a received packet should be split.
  616.  
  617. The value in this field must be greater than zero. A value of 1 
  618. (one) merely indicates that the packet is to be sent/received 
  619. from/to a contuguous portion of memory. In other words, the first 
  620. fragment contains the entire packet.
  621.  
  622. Fragment Descriptor List
  623.  
  624. A Fragment Descriptor precisely identifies where to find a piece 
  625. of a packet to be sent, or where to place a piece of received 
  626. packet. A fragment Descriptor has two component fields:
  627.  
  628. Address
  629.  
  630.     An address of a bufferfrom which packet data should be 
  631.     gathered for a packet send or which packet data should be 
  632.     copied upon a packet receive.
  633.  
  634. Size
  635.  
  636.     The size of the buffer fragment pointed to by the 
  637.     preceding Address.
  638.  
  639. Any IPX Event Control Block must have at least one Fragment 
  640. Descriptor, and an arbitraly number of additional descriptors, as 
  641. necesssary. These descriptors constitute the Fragment Descriptor 
  642. List.
  643.  
  644. Allowing packet headers and data to be "gathered" from several 
  645. places or "scattered" to several locations, the IPX functions 
  646. remove the need for applications to repeatedly copy data to and 
  647. from multiple locations.
  648.  
  649. Note that sending and receiving complete packets from or into 
  650. contiguous memory may be accomplished by setting the Fragment 
  651. Count field to 1 (one) and providing only a single Fragment 
  652. Descripror.
  653.  
  654. Important
  655.  
  656. When sending a packet, IPX will "gather" the packet contents from 
  657. an arbitrary number of fragments; honewer, the buffer fragment 
  658. identified by the first entry in the Fragment Descriptor List 
  659. must be at least 30 bytes long and must contain the complete IPX 
  660. packet header. The total packet size (thw sum of all the 
  661. individual fragment sizes) must not exceed 576 bytes.
  662.  
  663. - 12 -
  664.  
  665. Event control blocks for special-purpose Events
  666.  
  667. Special-purpose events sheduled by an applicaton are included to 
  668. occur after the expiration of specified time interval.
  669.  
  670. These events are represented by a short from Event Control Block 
  671. (an "AES-ECB") and are sheduled directly through the Asynchronous 
  672. Event Sheduler.
  673.  
  674. General Structure
  675.  
  676. Offset Field         Size    Data type
  677. ------ --------      ------  ----------------
  678. 0      Link          4 bytes 8086 long address 
  679.                              (offset,segment) 
  680. 4      ESR Address   4 bytes 8086 long address 
  681. 8      In Use        1 byte  Unsigned integer
  682. 9      AES Workspace 5 bytes N/A
  683.  
  684. Description of Field Contents
  685.  
  686. Link
  687.  
  688. This field is used by the AES when the ECB is in use. When the 
  689. ECB is not in use, the application may use this field, if 
  690. desired. Most commonly, it would be used as a link field for 
  691. keeping the ECB in a free list or queue.
  692.  
  693. ERS Address
  694.  
  695. This field contains the address of an application-defined Event 
  696. Service Routine (ESR) that the AES will call when the specified 
  697. time interval has expired.
  698.  
  699. Because the AES maintains the IN Use field, it is possible for a 
  700. programm to simply pool the status of a sheduled event at 
  701. appropriate intervals and not use a service routine at all. If no 
  702. Event Service Routine is desired, then ESR Address should be set 
  703. to null (four bytes of zero).
  704.  
  705. In Use
  706.  
  707. This field contains a value of ECB while the Event Control Block 
  708. is being used by the AES to shedule a special event.
  709.  
  710. The AES will reset this field to zero when the given time 
  711. interval has expired.
  712.  
  713. AES Workspace
  714.  
  715. This field is reserved for use by the AES routines. It does not 
  716. need to be initialized to any values, but it must not be changed 
  717. while control block is in use.
  718.  
  719. - 13 -
  720.  
  721. Invoking IPX and AES function
  722.  
  723. The  remainder  of  this  document  will  detail  the IPX and AES
  724. programming   interface   that    has   been   implemented    for
  725. 8086/8088-based personal computers using MS/PC-DOS 2.x or 3.x and
  726. the  Advanced   NetWare  Workstation   Shell  v2.0   or  greater.
  727. this section will describe general implementation features of IPX
  728. and  AES  function;  how  to  request  their services, and how to
  729. monotor the status of those requests.
  730.  
  731. Access Method
  732.  
  733. The  IPX  and  AES  function  are  accessed  through the Advanced
  734. Netware  shell  by  loading  register  Bx  with  the  appropriate
  735. function  number  and  issuing  a  software  interrupt  7Ah  with
  736. registers and other informations prepared as documented for  each
  737. function.
  738.  
  739. Register Preservation
  740.  
  741. IPX and AES functions preserve only register DS,SS,SP and 
  742. processor flags.
  743.  
  744. Interrupt States & Re-entrancy
  745.  
  746. All IPX functions execute entirely in the interrupt-disabled 
  747. state except for the Send Packet, Get Local Target, and 
  748. Relinguish Control functions. If you are calling either of these 
  749. functions from inside code that is running with interrupts 
  750. disabled, you must be sure your code can survive if interrupts 
  751. are enabled temporary by IPX.
  752.  
  753. All IPX functions are re-entrant, and may even be called from 
  754. Event Service Routines, with two exceptions: function Close 
  755. Socket and Disconnect From Target can not be called from an ESR.
  756. All AES function execute with interrupts disabled and are 
  757. therefore inherently re-entrant and cause no re-entrancy concerns 
  758. at the application level. They may be called at any time, from 
  759. any code.
  760.  
  761. Use of Differency-sized ECBs
  762.  
  763. IPX  functions  will  operate  only  with  IPX style (long) Event
  764. Control Blocks.
  765.  
  766. AES functions will  operate with IPX  style (long) Event  Control
  767. Blocks  or  AES  style  (short,  special-purpose)  Event  Control
  768. Blocks.
  769.  
  770. Monitoring the Status of a Request
  771.  
  772. Whenever an Event  Control Block is  supplied for use  in a send,
  773. listen, sheduling request (IPX-ECB), or special-purpose sheduling
  774. request (AES-ECB),  the ECB's  In Use  field will  be set to FFh,
  775. FEh, FDh, or FCh respectively.
  776.  
  777. At  other  times  the  ECB's  request  cycle, there are two other
  778. temporary states that may be indicated by the ECB's In Use field.
  779. When the Driver concludes a  send or receive, the associated  ECB
  780. is  placed  in  a  holding  queue,  pending final release and the
  781. calling of its ESR,  if any. During this  time, the In Use  field
  782. will contain  a value  of FBh.  When the  Driver is  transferring
  783. packet data to or from the fragment buffers described by the ECB,
  784. the In Use field will contain a value of FAh.
  785.  
  786. While an ECB's In Use field contains a non-zero value, no 
  787. modifications can be made to either the ECB or any its associated 
  788. buffers. Naturally, the ECB may not be used concurrently for 
  789. another IPX or AES request.
  790.  
  791. An ECB that is in use will remain so until the expected event 
  792. occurs or the outstanding request is canceled. Note, however, 
  793. that ECB may shuttle from the care of IPX directly to the care of 
  794. the AES if the ECB's ESR decides to re-shedule itself. The value 
  795. in the In Use field will reflect this change. (During the 
  796. translation of ownership, the In Use field will contain a zero, 
  797. but this will never be seen by the monitoring applicatondue to 
  798. the interrupt-service nature of the ESR).
  799.  
  800. An application may check the value of the In Use field at any 
  801. time to determine when the request is no longer outstanding. An 
  802. ECB is no longer in use when after the ECB's In Use field has 
  803. been reset to zero.
  804.  
  805. An other information in an Event Control Block can not be assumed 
  806. valid until after the ECB's In Use field has been reset to zero.
  807.  
  808. Numeric Field Format Conventions
  809.  
  810. With regard to byte-ordering of numeric fields, the following 
  811. rules apply:
  812.  
  813. 1) Socket numbers are always in high-low order. Thus, when 
  814. contained in an 8086 register, xL will contain the high byte and 
  815. xH will contain the low byte.
  816.  
  817. 2) Numeric fields in the IPX packet header are always in high-low 
  818. order.
  819.  
  820. 3) Values passed/returned in registers or numeric fields in ECBs 
  821. are always in low-high order, with the exception of socket 
  822. numbers, as noted in Rule I above.
  823.  
  824. Prerequisite Conditions
  825.  
  826. The documentation for each IPX or AES function will detail a set 
  827. of conditions that are assumed to exit when the functions is 
  828. invoked. These conditions include the setting of parameters in 
  829. certain registers or the initialization of various ECB or IPX 
  830. header fields.
  831.  
  832. - 15 -
  833.  
  834. Only the conditions that are expicitly mentioned in the function 
  835. documentation's Assumes section need to be met by the programmer 
  836. before invoking the function.
  837.  
  838. Field Value Preservation
  839.  
  840. For any particular IPX or AES function, the values of all the 
  841. fields that are required to be initialised by the application 
  842. will not be altered during the execution of the function, with 
  843. one exception: when an IPX send broadcast request is canceled, 
  844. the ESR Address field of the associated ECB will not be valid.
  845. Thus, an application may initialize certain ECBs buffer areas 
  846. containing IPX headers once, are re-use those ECBs and buffers, 
  847. changing only the data portion of the packets as needed.
  848.  
  849. System Clock Ticks
  850.  
  851. System clock ticks, as referred to this document, refer to the 
  852. system clock ticks of an IBM PC. Those clock ticks occur 
  853. approximataly 18.21 times a second.
  854.  
  855. On other machines, clock ticks may only be available some other 
  856. number of times per second. For example, suppose actual clock 
  857. ticks were available only twice a second. In such a case, IPX 
  858. will still handle all timing functions in terms of IBM PC clock 
  859. tick values. A 36 tick delay will still indicate a delay of 
  860. approximately two seconds. However, that timing will only be 
  861. accurate to within plus or minus half a second.
  862.  
  863. - 16 -
  864.  
  865. IPX and AES function definition
  866.  
  867. Open Socket
  868.  
  869. Assumes
  870. -------
  871. Bx has    0h
  872. Al has    Socket Longevity Flag
  873.     00h = Stay open until closed of program terminates
  874.     FFh = Stay open until closed
  875.  
  876. Dx has    Requested Socket Number
  877.     0000h     = Let IPX dynamically assign a socket number
  878.     non-zero= Open on this socket
  879.  
  880. Returns
  881. -------
  882. Al has     Function Completion Code
  883.     00h = socket was successfully opened
  884.     FFh = socket is already open.
  885.     FEh = socket table is full. (IPX capacity is at maximum)
  886.  
  887. Dx has     Assign Socket Number
  888.  
  889. Description
  890.  
  891. This function opens a particular socket for use by the application.
  892. This function must be called before being able to send packets from or 
  893. receive packets on a particular socket. If desired, IPX will 
  894. dynamically assign you a socket number that is not already open on the 
  895. workstation.
  896.  
  897. The Requested Socket Number contained in DX is assumed to be in 
  898. high-low order, that is, DL contains the HIGH half of the socket 
  899. number, and DH contains the LOW half of the socket number that is to 
  900. be opened.
  901.  
  902. If this function is called with a Request Socket Number of zero, 
  903. a socket number will be dynamically assigned by IPX.
  904. If the open request is successful, DX will contain the Assigned 
  905. Socket Number when the function returns. This is the socket that 
  906. was actually opened, as determined by the Requested Socket Number 
  907. value.
  908.  
  909. The Socket Longevity Flag indicates whether or not the socket is 
  910. intended to remain open after the application terminates. A value 
  911. of FFh will cause the socket to remain open until it is 
  912. exclicitly closed. This feature is useful for terminate-and-stay 
  913. resident applicatons that intaract with IPX.
  914.  
  915. - 17 -
  916.  
  917. As a precautionary measure when programming transient 
  918. applications, programmers should always set the Socket Longevity 
  919. Flag to zero, so that an unexpected termination of their code (by 
  920. a control-break or control-C, for example) will cause the socket 
  921. to be closed automatically when the application terminates and 
  922. forces an end-of-job condition.
  923.  
  924. All applications (except terminate-and-stay-resident 
  925. applications) should close all of their open sockets before 
  926. terminating.
  927.  
  928. NOTE: If there are already as many open sockets open as IPX has 
  929. internal table space to keep track of, the Function Completion 
  930. Code returned in Al will be FEh. At the time of this 
  931. specification's, IPX will support up to 50 open soockets on any 
  932. workstation.
  933.  
  934. - 18 -
  935.  
  936. Close Socket 
  937.  
  938. Assumes 
  939.  
  940. Bx has    1h 
  941. Dx has    Number of socket to be closed 
  942.  
  943. Returns 
  944. Nothing
  945.  
  946. Description 
  947.  
  948. This function closes the specified socket.  
  949.  
  950. This functions cancels any IPX-ECBs associated with the indicated 
  951. socket which are in use by IPX or AES for sending, listening, or 
  952. sheduling purposes.
  953.  
  954. Whenever an outstanding IPX request is canceled (by this function 
  955. or by the Cancel Event function), the In Use field of any 
  956. affected ECB is reset to zero and the Completion Code field is 
  957. set to FCh, indicating that the request was canceled.
  958.  
  959. NOTE: The Event Service Routine of a cancelled ECB is not called. 
  960. Note that packets which arrive for a socket which is closed or 
  961. has no outstanding listen requests will simply be ignored.
  962. Attempting to close a socket that was not open has no effect.
  963.  
  964. WARNING
  965.  
  966. Transient: applications must close all of their open sockets 
  967. before terminating. Thus, only terminate-and-stay-resident 
  968. applications should ever leave sockets open, and those sockets 
  969. should be opened as "long-lived" sockets (see the description of 
  970. Open Socket).
  971.  
  972. If sockets are not closed before programm termination, a small 
  973. but finite window exests where a packet may arruve and the 
  974. service routine be called even though the program has issued an 
  975. EXIT command to DOS. In such a case, corrupted pointers could 
  976. conceivably cause the workstaton to "hang" with interrupts 
  977. disabled.
  978.  
  979. WARNING
  980.  
  981. This function can not be called from an Event Service Routine, 
  982. regardless of whether the ESR was called as the result of an IPX 
  983. and AES event.
  984.  
  985. - 19 -
  986.  
  987. Get local Target 
  988.  
  989. Assumes 
  990.  
  991. Bx has    2h 
  992. ES:SI has a pointer to a twelve-byte buffer 
  993. ES:DI has a pointer to a six-byte buffer 
  994.  
  995. Returns 
  996. Al has    Function complete code 
  997.     00h if a local target node was indentified 
  998.     FAh if there is no known path to the desired 
  999.         destination node Cx has one-way transport time to 
  1000.         target node (only if al is 00h) 
  1001.  
  1002. Description 
  1003.  
  1004. This function determines the value which should be placed in 
  1005. an ECB's immediate Address fiels prior to passing the ECB 
  1006. to function Send Packet.  
  1007.  
  1008. Registers ES:SI point to a twelve-byte buffer which contains the 
  1009. full internetwork address of a node to which the application 
  1010. would like to send a packet.
  1011.  
  1012. If there has been no prior communication with the destination 
  1013. node, then this function should be called once to determine what 
  1014. value should be placed in the Immediate Address field of each ECB 
  1015. that will be used in sending packets to the destination. The 
  1016. immediate address value will be placed in the six-byte buffer 
  1017. pointed to by ES:DI.
  1018.  
  1019. If the ultimate destination node resides on the same local 
  1020. network, then local target address will be same as the node 
  1021. address portion of the full twelve-byte target address. If, 
  1022. however, the destination node resides on another network of the 
  1023. internetwork, the local target address returned will be the 
  1024. address of an Advanced NetWare Internetwork Bridge which will 
  1025. route the packet toward its final destination.
  1026.  
  1027. Furthermore, once communicaton has been established with another 
  1028. node it is recommended that the Immediate Address field of send 
  1029. ECBs be set to the value contained the Immediate Address field of 
  1030. the ECB which was most recently used to receive a packet from the 
  1031. other node.
  1032.  
  1033. Therefore, application which never initiate communication with 
  1034. other nodes but merely respond to incoming request will never 
  1035. need to call this function they may simply send reply packets to 
  1036. the same immediate address from which the request packets 
  1037. arrived. (Whenever a packet is received, the Immediate Address 
  1038. field of the receive ECB will be set by IPX to indicate the 
  1039. address from which the packet came.)
  1040.  
  1041. - 20 -
  1042.  
  1043. The Function Complete Code returned in Al will be FAh if this 
  1044. function could not find a path to the desired destination 
  1045. network.
  1046.  
  1047. Note that the successful completion (Al returns with a 00h) of 
  1048. this function does not guarantee that the destination node 
  1049. exists; it only indicates the local address to which packet 
  1050. should be sent to start them on their journey.
  1051.  
  1052. If this function was successful, a time calue will be returned in 
  1053. register Cx. This value indicates the amount of time (in system 
  1054. clock ticks) for a 576-byte packet to be sent to the target node. 
  1055. This time is a best-case time; a packet may take longer if 
  1056. network traffic is heavy. However, short packets may take less 
  1057. time because they have fewer bytes to be transmitted.
  1058.  
  1059. Whun sending broadcasts, this function should still be called to 
  1060. determine the value to place in the send ECB's Immediate Address 
  1061. field.
  1062.  
  1063. - 21 -
  1064.  
  1065. Send Packet
  1066.  
  1067. Assumes
  1068.  
  1069. Bx has    3h
  1070. ES:DI has a pointer to an Event Control Block
  1071.  
  1072. In the ECB, the ESR Address,Socket Number, Immediate Address, Fragment 
  1073. Count, and Fragment Descriptor List fields are initialised.
  1074.  
  1075. The first buffer fragment described by the Fragment Descriptor List is 
  1076. a least 30 bytes long and contains the packet's IPX header.
  1077.  
  1078. In the IPX packet header, the Packet Type, Destination Network, 
  1079. Destination Node, and Destinaton Socket fields are initialised.
  1080.  
  1081. Returns
  1082. Nothing
  1083.  
  1084. Description
  1085.  
  1086. This function prepares the ECB and the IPX header of the associated 
  1087. packet and passes the ECB to network communication drivers to 
  1088. initialise the send operation. Having done so, this function returns 
  1089. immediality to the calling applicaton.
  1090.  
  1091. This function will complete the packet's IPX header by filling in the 
  1092. Checksum, Length, Transport Control, Source Network, Source Node, 
  1093. and Source Socket fields. The latter calue is taken from the 
  1094. Socket Number field of the supplied ECB.
  1095.  
  1096. IPX is designed to allow applications to function in fully 
  1097. asynchronous fashion with respect to the sending of internetwork 
  1098. packets; therefore, the send event can not be assumed concluded 
  1099. when this function returns.
  1100.  
  1101. Using the information provided in the ECB, the network drivers 
  1102. will attempt to transmit the packet as soon as the network 
  1103. hardware is available and any other pending send requests have 
  1104. been serviced. The packet will be sent to the node on the 
  1105. immediately connected network that is indicated by the ECB's 
  1106. Immediate Address field. To understand how to determine the 
  1107. proper value for the Immediate Address field, see the 
  1108. documentation of function Get Local Target.
  1109.  
  1110. While the packet is waiting to be transmitted, the In Use field 
  1111. in its ECB will contain a value of FFh.
  1112.  
  1113. - 22 -
  1114.  
  1115. When the drivers have finished their attempt to tramsmot the
  1116. packet, the In Use field will be reset to zero. At this point, 
  1117. the Completion Code field in the ECB will contain the final 
  1118. status of the send request and the Event Service Routine pointed 
  1119. to by the ESR Address field will be called. If no ESR is desired, 
  1120. then the ESR Address field should be set to null (zeroes).
  1121.  
  1122. If the request is cancelled by a Cancel Event or Close Socket 
  1123. function, the In Use field will be reset to zero and the 
  1124. Completion Code will be set to FCh. The ECB's Event Service 
  1125. Routine will not be called.
  1126.  
  1127. Valid Completion Code values are:
  1128.  
  1129. 00h    The send was completed successfully.
  1130. FFh    Physical unable to send the packet (Hardware or network 
  1131.     failure).
  1132. FEh    Packet Undeliverable.
  1133. FDh    Malformed packet (less that 30 or greater that 576 bytes, 
  1134.     or list fragment too small for header, or Fragment Count 
  1135.     was zero).
  1136. FCh    The send request was canceled by a Close Socket or Cancel 
  1137.     Send/Listen function call.
  1138.  
  1139. Some additional words of exlanation are necessary.
  1140.  
  1141. The 00h completion code indicates that the packet was 
  1142. successfully transmitted does not guarantee that it was 
  1143. successfully received by the destination node. There conditions 
  1144. may exist to prevent successful reception of a packet:
  1145.  
  1146. 1) The packet may be lost or garbled by the transmission media at 
  1147. any stage of its jouney; 
  1148.  
  1149. 2) The given destination node does not exist (some media 
  1150. protocols are unable to detect this condition when transmitting 
  1151. to a node that is aliegedly on the same physical network, and 
  1152. they can never detect this case if the packet must pass though an 
  1153. Internetwork Bridge);
  1154.  
  1155. 3) There are no outstanding socket listen request in the 
  1156. destination node when the packet is received.
  1157.  
  1158. The Packet Undeliverable code, FEh, can be generated in tree 
  1159. ways:
  1160.  
  1161. 1) The packet was destined for a far network and no Advanced 
  1162. NetWare Internetwork Bridge with a path to the destination 
  1163. network could be found;
  1164.  
  1165. - 23 -
  1166.  
  1167. 2) The packet is destined for a node on the local network and the 
  1168. local network hardware detects that the target address is 
  1169. nonexistent or inactive (this is hardware-dependent); some 
  1170. drivers may have no way to distinguish between a hardware failure 
  1171. and a non-existent destination node and may indicate this error 
  1172. instead of an FFh;
  1173. 3) The packet was destined for another socket on same machine 
  1174. that the packet was sent from, and that socket is not open or has 
  1175. pending listen request.
  1176.  
  1177. IPX allow packets to be sent between a source and destination 
  1178. that reside in the same physical node ("Intranode routing"); even 
  1179. the source and destination sockets may be the same. This ability 
  1180. appers both to explicitly addressed packets as well as broadcast 
  1181. packets. Thus, an application that uses the same socket address 
  1182. for sending and receiving would always receive broadcasts it had 
  1183. sent to nodes on the same network as it was physically connected 
  1184. to.
  1185.  
  1186. When an intranode packet is "sent", all related processing 
  1187. (including ESR execution) is performad in the same fashion as a 
  1188. normal transmission. Only then, if there is a listening ECB, will 
  1189. the packet be "received" and appropriately processed. The order 
  1190. of thus processing is guaranteed.
  1191.  
  1192. - 24 -
  1193. Listen for Packet 
  1194. Assumes
  1195. Bx has 4h
  1196. ES:DI has a pointer to an Event Control Block
  1197. In the ECB, the ESR Address, Socket Number, Fragment Count, and 
  1198. Fragment Descriptor List fields are initialised.
  1199.  
  1200. Returns
  1201. Nothing
  1202.  
  1203. Description
  1204.  
  1205. This function delivers an ECB  and the buffer space it  describes
  1206. to IPX the  purpose of receiving  an internetwork packet.  Having
  1207. done  so, it returns immediately to calling the application.
  1208.  
  1209. IPX is  designed to  allow applications  to function  in a  fully
  1210. asynchronous   fashion   with   respect   to   the  receiving  of
  1211. internetwork packets; therefore, this function only dedicates the
  1212. given  Event  Control  Block  for  use  in receiving packets; the
  1213. function does not wait for an actual packet to be received.
  1214.  
  1215. The ECBwill only be used to receive packets that are destined  to
  1216. the socket  given in  the ECB's  Socket Number  field. The socket
  1217. must be  open before  any listen  requests may  be made  for that
  1218. socket.  (Incidentally,  if  a  socket  is not open, any incoming
  1219. packets destined for that socket will be ignored.)
  1220.  
  1221. When an ECB is  donated to IPX for  the purpose of listening  for
  1222. internetwork packets, the In Use field is set by IPX to FEh. This
  1223. field will remain set until  a receive event occurs, the  request
  1224. is canceled, or IPX judges the ECB to be unusable.
  1225.  
  1226. After  IPx  has  reset  the  In  Use  field  to  zero, one of the
  1227. following values will be recorded  in the Completion Code   field
  1228. of the ECB:
  1229.  
  1230. 00h    Packet was received successfully.
  1231. FFh    The socket upon which the ECB was to listen was not 
  1232.     opened.
  1233. FDh    Packet overflow. A packet was received, but the ECB's 
  1234.     Fragment Count was zero, or the available space defined 
  1235.     by the 's Fragment Descriptor List was not large enough 
  1236.     to contain the entire packet.
  1237. FCh    The send request was canceled by a Close Socket or Cancel 
  1238.     Send/Listen function call.
  1239.  
  1240. - 25 -
  1241. If the request was cancelled by a Cancel Event or Close Socket 
  1242. function, the     In Use field will be reset to zero and the 
  1243. Completion Code will be set to FCh, as listed above. The ECB's 
  1244. Event Service Routine will not be called.
  1245. Otherwise, the Event Service Routine pointed to by the ECB's ESR 
  1246. Address field will be called. If no ESR is desired, then the ESR 
  1247. Address field should be set to null (zeroes).
  1248. If the Completion Code field contains a value of 00h or FDh, then 
  1249. the Immediate Address field of the ECB will contain the address 
  1250. of node on the local natwork from which the packet was received.  
  1251. IPX imposes no limit on the number of ECBs that may be used 
  1252. concurrently for listening on a given socket. Many applications 
  1253. may enormosly by having several ECBs listening on the same 
  1254. socket. Note, however, that there is no guarantee that listening 
  1255. ECBs will be utilized by IPX in the same order they were offered.  
  1256. When a packet is received, IPX checks to see if there are any 
  1257. available ECBs listening on the appropriate socket. If there are 
  1258. no available ECBs, then the packet will simply be discarded. If 
  1259. there is only one ECB available, it will be used to disburse the 
  1260. packet data.
  1261. If multiple Event Control Blocks are availablr, then IPX will 
  1262. coose one of them for use in disbusring the packet data. 
  1263. Listening ECBs are not chosen for use in receiving a packet on 
  1264. the basis of what order they were originally made available.
  1265. When a packet arrives and an available ECB is chosen by IPX, the 
  1266. address of the node on the local network from which the packet 
  1267. came will be recorded in the Immediate Address field of the ECB. 
  1268. An application that desires to make a reply to the packet can 
  1269. copy this calue to the Immediate Address field of the ECB which 
  1270. will be used to send the reply. Replies made in this fashion can 
  1271. even be made from inside Event Service Routines.
  1272. /*******@@@@@@@@
  1273.  
  1274. Shedule IPX Event
  1275. Assumes
  1276. Bx has 5h
  1277. Ax has desired delay time
  1278. ES:DI has a pointer to an IPX Event Control Block
  1279. In the ECB, the ESR adress and Socket Number fields are initialised
  1280. Return nothing
  1281. Description
  1282. This functionis used to shedule or re-shedule an IPX event to occur
  1283. when the specified time interval expired. The interval may be less 
  1284. than an 18th of a second or over an hour in length.
  1285. /**************************************************************************/
  1286.  
  1287. Cancel Event
  1288. Assumes
  1289. Bx has 6h
  1290. ES:DI has a pointer to an ECB that is in use by IPX or the AES
  1291. Returns
  1292. Al has     Function complete code
  1293.     00h    if the event was canceled
  1294.     FFh    if the given ECB was not in use by IPX or the AES
  1295.     F9h    if the given ECB was in use and unable to be canceled
  1296. Description
  1297. This function cancels the event....
  1298. /***********************/
  1299.  
  1300. Shedule special event
  1301. Bx has 7h
  1302. Ax has desired delay time
  1303. ES:DI has a pointer to an special-purpose ECB (AES-ECB)
  1304. In the ECB, the ESR Adress field is initialised
  1305. Return: nothing
  1306. Description
  1307. This function is used to shedule a special-purpose...
  1308. /***************************/
  1309.  
  1310. Get Interval Marker
  1311. Assumes
  1312. Bx has 8h
  1313. Returns
  1314. Ax has the interval marker (16-bit Unsigned integer)
  1315. Description
  1316. This function returns a timing marker.
  1317. This marker reflect the time at which this function was called. The 
  1318. value is given in units equal to the length of time between any two 
  1319. system clock ticks ( approximately 1/18.21 of a second)
  1320. This value has no relation to any real-word absolute time.. However, 
  1321. when it is compared with a time marker obtained at different time, the 
  1322. difference will yield elapsed time.
  1323. ...........
  1324. /***********************************************/
  1325.  
  1326. Get internetwork Address
  1327. Assumes
  1328. Bx has 9h
  1329. ES:DI has a pointer to a ten-byte buffer area
  1330. Returns
  1331. Four-byte Network Number and six-byte Node Address in the indicated 
  1332. buffer
  1333. Description
  1334. This function allow a programm to determine the internetwork adress of 
  1335. the node on which it is executing.
  1336. This programm-supplied buffer is filled with four-byte Network Number 
  1337. followed by the six-byte Node Address. Both fields in high-low order.
  1338. This function is especialy useful for any application that must other 
  1339. nodes of its address on the internetwork.
  1340. Note that this function does not return a socket number. When programm 
  1341. form complete tweive-byte adresses, they should append socket numbers 
  1342. appropriate to their application.
  1343.  
  1344. Rellnquish Control
  1345. Assumes
  1346. Bx has Ah
  1347. Returns
  1348. Nothing
  1349. Description
  1350. This function should be invoked whenever the applications will 
  1351. "idling", waiting for external events to provide it with serious 
  1352. processing to perform.
  1353. ............
  1354.  
  1355. Disconect from target
  1356. Assumes
  1357. BX has Bh
  1358. ES:DI point to a 12-byte buffer containing an internetwork adress
  1359. Returns
  1360. Nothing
  1361. Description
  1362. This function exists as courtesy to those network communications 
  1363. drivers which may operate strictly on point-to-point basis at physical 
  1364. transport level.
  1365. .................