home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / BETA / H / WARPNET.H < prev   
Text File  |  1995-08-24  |  5KB  |  96 lines

  1.  /**************************************************************************
  2.  *
  3.  * File Name        : WARPNET.H
  4.  *
  5.  * Description      : WARPNET API Definitions.
  6.  *
  7.  *
  8.  * Concepts         :
  9.  *
  10.  * Entry Points     : See Below
  11.  *
  12.  *
  13.  * WarpNet API's       :
  14.  *
  15.  *                     WarpNetInitialize
  16.  *                     WarpNetPackSend
  17.  *                     WarpNetPackRecv
  18.  *                     WarpNetConSend
  19.  *                     WarpNetConRecv
  20.  *                     WarpNetQueryNetInfo
  21.  *                     WarpNetEstablishConnection
  22.  *
  23.  * Copyright        : COPYRIGHT IBM CORPORATION, 1991, 1995
  24.  *
  25.  *        DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  26.  *        sample code created by IBM Corporation. This sample code is not
  27.  *        part of any standard or IBM product and is provided to you solely
  28.  *        for  the purpose of assisting you in the development of your
  29.  *        applications.  The code is provided "AS IS", without
  30.  *        warranty of any kind.  IBM shall not be liable for any damages
  31.  *        arising out of your use of the sample code, even if they have been
  32.  *        advised of the possibility of such damages.
  33.  *
  34.  ****************************************************************************/
  35.  
  36. #define  GAME_PORT                                5022
  37. #define  PACKET_SIZE                              512
  38. #define  HEADER_SIZE                              60
  39. #define  DATA_SIZE                                452
  40. #define  MAX_CLIENTS                              10
  41. #define  WARPNETERR_BASE                          5000
  42. #define  WARPNETMSG_BASE                          4000
  43. #define  WARPNET_REGISTER_PLAYER                  (WARPNETMSG_BASE + 1)
  44. #define  WARPNET_REGISTERATION_COMPLETE           (WARPNETMSG_BASE + 2)
  45. #define  WARPNET_DEREGISTER_PLAYER                (WARPNETMSG_BASE + 3)
  46. #define  WARPNET_QUERY_NUMPLAYERS                 (WARPNETMSG_BASE + 4)
  47. #define  WARPNET_QUERY_PROTOCOL                   (WARPNETMSG_BASE + 5)
  48. #define  WARPNET_QUERY_PLAYERLIST                 (WARPNETMSG_BASE + 6)
  49. #define  WARPNET_CURRENT_PLAYERLIST               (WARPNETMSG_BASE + 7)
  50. #define  WARPNET_ERR_INVALID_BUFFER_SIZE          (WARPNETERR_BASE + 1)
  51. #define  WARPNET_ERR_INVALID_DESTINATION          (WARPNETERR_BASE + 2)
  52. #define  WARPNET_ERR_INVALID_BUFFER               (WARPNETERR_BASE + 3)
  53. #define  WARPNET_ERR_MEMORY_EXHAUSTED             (WARPNETERR_BASE + 4)
  54. #define  WARPNET_ERR_INVALID_SOURCEID              (WARPNETERR_BASE + 5)
  55.  
  56. typedef struct user_pack_header {
  57.    ULONG  Message;                           // WarpNet Message
  58.    ULONG  Node;                              // Packet Destination Node
  59.    ULONG  Channel;                           // Packet Destination channel
  60.    ULONG  srcPlayerId;                       // Packet source PlayerId
  61.    ULONG  tgtPlayerId;                       // Packet destination PlayerID
  62.    BOOL   fHeaderOnly;                       // Send Just The Header and no data
  63.    ULONG  DataWord1;                         // Small Data  for application
  64.    ULONG  DataWord2;                         // Small Data  for application
  65.    ULONG  DataWord3;                         // Small Data  for application
  66.    ULONG  DataWord4;                         // Small Data  for application
  67.    ULONG  DataSize;                          // Packet Data Size
  68.    CHAR   *pData;                            // Packet Data
  69.    ULONG  PackSeq;                           // Fragmented Packet Sequence
  70.    ULONG  chksum;                            // Fragmented Packet Checksum
  71.    ULONG  TimeStamp;                         // Fragmented Packet TimeStamp
  72.    ULONG  PackMarker;                        // Fragmentation/ Assembly Aide
  73.    ULONG  Reserved;                          // For System use
  74. }WarpNetPacket;
  75.  
  76. typedef struct _WarpNetDest {
  77.    BOOL   fDotted;                           // Dotted decimal address
  78.    CHAR   Destination[255];                  // Destination address
  79.    BOOL   fUsePlayerID;                      // use PlayerID  flag
  80.    ULONG  PlayerId;                          // Use the player Id
  81. }ToAddress;
  82.  
  83. APIRET APIENTRY WarpNetInitialize ( VOID);
  84.  
  85. APIRET APIENTRY WarpNetOpen (ToAddress Server,  WarpNetPacket *ppacket);
  86.  
  87. APIRET APIENTRY WarpNetClose (VOID);
  88.  
  89. APIRET APIENTRY WarpNetPackRecv (char *bufp) ;
  90.  
  91. APIRET APIENTRY WarpNetQueryNetInfo (CHAR *bufp, ULONG Msg);
  92.  
  93. APIRET EXPENTRY WarpNetPackSend (ToAddress Dest , WarpNetPacket *ppacket);
  94.  
  95. APIRET EXPENTRY WarpNetBroadcast (WarpNetPacket *ppacket);
  96.