home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / NETCLB35.ZIP / NETCLB35.EXE / INCLUDE / NWIPXSPX.H < prev    next >
C/C++ Source or Header  |  1996-01-03  |  5KB  |  142 lines

  1. #ifndef NWIPXSPX_H
  2. #define NWIPXSPX_H
  3.  
  4. /*******************/
  5. /* Data Structures */
  6. /*******************/
  7.  
  8. typedef struct {
  9.                  byte   network_number[4];
  10.                  byte   node_address[6];
  11.         } INTER_NETWORK_ADDR;
  12.  
  13. typedef struct {
  14.                  INTER_NETWORK_ADDR ina;
  15.                  nw_int             socket_number;
  16.         } NETWORK_ADDR;
  17.  
  18. typedef struct {
  19.                  void FAR   *address;
  20.                  word       length;
  21.         } ECB_FRAGMENT;
  22.  
  23. /*********************/
  24. /* IPX Packet Header */
  25. /*********************/
  26.  
  27. typedef struct {
  28.                  nw_int        checksum;
  29.                  nw_int        length;
  30.                  byte          transport_control;
  31.                  byte          packet_type;           /* User Sets */
  32.                  NETWORK_ADDR  dest_addr;             /* User Sets */
  33.                  NETWORK_ADDR  srce_addr;
  34.         } IPX_HEADER;
  35.  
  36. /*********************/
  37. /* SPX Packet Header */
  38. /*********************/
  39.  
  40. typedef struct {
  41.                  IPX_HEADER    ipx;
  42.                  byte          connection_control;
  43.                  byte          datastream_type;       /* User Sets */
  44.                  nw_int        source_connection_id;
  45.                  nw_int        dest_connection_id;
  46.                  nw_int        sequence_number;
  47.                  nw_int        acknowledge_number;
  48.                  nw_int        allocation_number;
  49.         } SPX_HEADER;
  50.  
  51. /*****************************/
  52. /* Event Control Block (ECB) */
  53. /*****************************/
  54.  
  55. typedef struct {
  56.                  void FAR      *link_address;
  57.                  void          (FAR *esr)(void);      /* User Sets */
  58.                  byte          in_use;
  59.                  byte          completion_code;
  60.                  nw_int        socket_number;         /* User Sets */
  61.                  byte          IPX_workspace[4];
  62.                  byte          driver_workspace[12];
  63.                  byte          immediate_address[6];  /* User Sets */
  64.                  word          fragment_count;        /* User Sets */
  65.                  ECB_FRAGMENT  fragment[2];           /* User Sets */
  66.         } EVENT_CONTROL_BLOCK;
  67.  
  68. /******************************/
  69. /* SPX Connection status data */
  70. /******************************/
  71.  
  72. typedef struct { byte connection_state;
  73.                  byte watchdog_is_on;
  74.                  int  local_connection_id;
  75.                  int  remote_connection_id;
  76.                  int  sequence_number;
  77.                  int  local_acknowledge_number;
  78.                  int  local_allocation_number;
  79.                  int  remote_acknowledge_number;
  80.                  int  remote_allocation_number;
  81.                  int  local_socket;
  82.                  byte immediate_address[6];
  83.                  byte network_number[4];
  84.                  byte node_address[6];
  85.                  int  socket;
  86.                  int  retransmission_count;
  87.                  int  est_roundtrip_delay;
  88.                  int  retransmitted_packets;
  89.                  int  suppressed_packets;
  90.         } SPX_CONNECTION_STATUS;
  91.  
  92. /***********************/
  93. /* Function prototypes */
  94. /***********************/
  95.  
  96. #ifdef __cplusplus
  97. extern "C" {
  98. #endif
  99. word  IPXCancelEvent( EVENT_CONTROL_BLOCK *ecb );
  100. void  IPXCloseSocket( word socketNumber );
  101. void  IPXDisconnectFromTarget(
  102.                  NETWORK_ADDR *networkAddress );
  103. void  IPXGetInternetworkAddress(
  104.                  INTER_NETWORK_ADDR *networkAddress);
  105. word  IPXGetIntervalMarker( void );
  106. word  IPXGetLocalTarget(
  107.                  INTER_NETWORK_ADDR *networkAddress ,
  108.                  byte *immediateAddress,
  109.                  word *transportTime );
  110. word  IPXInitialise( void );
  111. word  IPXListenForPacket( EVENT_CONTROL_BLOCK *ecb );
  112. word  IPXOpenSocket( word *socketNumber,
  113.                  byte longevity );
  114. void  IPXRelinquishControl( void );
  115. void  IPXScheduleIPXEvent( EVENT_CONTROL_BLOCK *ecb ,
  116.                  word delayTicks );
  117. void  IPXSendPacket( EVENT_CONTROL_BLOCK *ecb );
  118.  
  119. void  SPXAbortConnection( word connectionID );
  120. word  SPXEstablishConnection( word retryCount, word watchdogFlag,
  121.                  EVENT_CONTROL_BLOCK *ecb,
  122.                  word *connectionID );
  123. word  SPXGetConnectionStatus( word connectionID ,
  124.                  SPX_CONNECTION_STATUS *connectionStatus );
  125. int   SPXInitialise( byte *majorVersion,
  126.                  byte *minorVersion,
  127.                  word *maxConnections,
  128.                  word *availableConnections );
  129. void  SPXListenForConnection( word retryCount, word watchdogFlag ,
  130.                  EVENT_CONTROL_BLOCK *ecb );
  131. void  SPXListenForSequencedPacket(
  132.                  EVENT_CONTROL_BLOCK *ecb );
  133. void  SPXSendSequencedPacket( word connectionID,
  134.                  EVENT_CONTROL_BLOCK *ecb );
  135. void  SPXTerminateConnection( word connectionID,
  136.                  EVENT_CONTROL_BLOCK *ecb );
  137. #ifdef __cplusplus
  138. }
  139. #endif
  140.  
  141. #endif       /* IPXSPX_H */
  142.