home *** CD-ROM | disk | FTP | other *** search
/ Deathday Collection / dday.bin / serial / ipxsrc / ipxnet.h < prev    next >
C/C++ Source or Header  |  1994-01-09  |  3KB  |  110 lines

  1. // ipxnet.h
  2.  
  3. typedef struct
  4. {
  5.     char    private[512];
  6. } doomdata_t;
  7.  
  8.  
  9. #include "DoomNet.h"
  10.  
  11. //===========================================================================
  12.  
  13. #define NUMPACKETS      10            // max outstanding packets before loss
  14.  
  15.  
  16. // setupdata_t is used as doomdata_t during setup
  17. typedef struct
  18. {
  19.     short    gameid;                    // so multiple games can setup at once
  20.     short    drone;
  21.     short    nodesfound;
  22.     short    nodeswanted;
  23. } setupdata_t;
  24.  
  25.  
  26.  
  27. typedef unsigned char BYTE;
  28. typedef unsigned short WORD;
  29. typedef unsigned long LONG;
  30.  
  31. typedef struct IPXPacketStructure
  32. {
  33.     WORD    PacketCheckSum;         /* high-low */
  34.     WORD    PacketLength;           /* high-low */
  35.     BYTE    PacketTransportControl;
  36.     BYTE    PacketType;
  37.  
  38.     BYTE    dNetwork[4];            /* high-low */
  39.     BYTE    dNode[6];               /* high-low */
  40.     BYTE    dSocket[2];             /* high-low */
  41.  
  42.     BYTE    sNetwork[4];            /* high-low */
  43.     BYTE    sNode[6];               /* high-low */
  44.     BYTE    sSocket[2];             /* high-low */
  45. } IPXPacket;
  46.  
  47.  
  48. typedef struct
  49. {
  50.     BYTE    network[4];             /* high-low */
  51.     BYTE    node[6];                /* high-low */
  52. } localadr_t;
  53.  
  54. typedef struct
  55. {
  56.     BYTE    node[6];                /* high-low */
  57. } nodeadr_t;
  58.  
  59. typedef struct ECBStructure
  60. {
  61.     WORD    Link[2];                /* offset-segment */
  62.     WORD    ESRAddress[2];          /* offset-segment */
  63.     BYTE    InUseFlag;
  64.     BYTE    CompletionCode;
  65.     WORD    ECBSocket;              /* high-low */
  66.     BYTE    IPXWorkspace[4];        /* N/A */
  67.     BYTE    DriverWorkspace[12];    /* N/A */
  68.     BYTE    ImmediateAddress[6];    /* high-low */
  69.     WORD    FragmentCount;          /* low-high */
  70.  
  71.     WORD    fAddress[2];            /* offset-segment */
  72.     WORD    fSize;                  /* low-high */
  73. } ECB;
  74.  
  75.  
  76. // time is used by the communication driver to sequence packets returned
  77. // to DOOM when more than one is waiting
  78.  
  79. typedef struct
  80. {
  81.     ECB             ecb;
  82.     IPXPacket       ipx;
  83.  
  84.     long            time;
  85.     doomdata_t        data;
  86. } packet_t;
  87.  
  88.  
  89. extern    doomcom_t    doomcom;
  90. extern    int            gameid;
  91.  
  92. extern    nodeadr_t    nodeadr[MAXNETNODES+1];
  93. extern    int            localnodenum;
  94.  
  95. extern    long           localtime;        // for time stamp in packets
  96. extern    long        remotetime;        // timestamp of last packet gotten
  97.  
  98. extern    nodeadr_t    remoteadr;
  99.  
  100. void Error (char *error, ...);
  101.  
  102.  
  103. void InitNetwork (void);
  104. void ShutdownNetwork (void);
  105. void SendPacket (int destination);
  106. int GetPacket (void);
  107. int CheckParm (char *check);
  108.  
  109. void PrintAddress (nodeadr_t *adr, char *str);
  110.