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