]> icculus.org git repositories - btb/d2x.git/blob - arch/linux/include/ipx_drv.h
remove rcs tags
[btb/d2x.git] / arch / linux / include / ipx_drv.h
1 /*
2  *
3  * IPX driver interface
4  *
5  * parts from:
6  * ipx.h header file for IPX for the DOS emulator
7  *              Tim Bird, tbird@novell.com
8  *
9  */
10
11 #ifndef _IPX_DRV_H
12 #define _IPX_DRV_H
13 #include <sys/types.h>
14
15 #define IPX_MANUAL_ADDRESS
16
17 #define MAX_PACKET_DATA         1500
18
19 typedef struct IPXAddressStruct {
20         u_char Network[4] __attribute__((packed));
21         u_char Node[6] __attribute__((packed));
22         u_char Socket[2] __attribute__((packed));
23 } IPXAddress_t;
24
25 typedef struct IPXPacketStructure {
26         u_short Checksum __attribute__((packed));
27         u_short Length __attribute__((packed));
28         u_char TransportControl __attribute__((packed));
29         u_char PacketType __attribute__((packed));
30         IPXAddress_t Destination __attribute__((packed));
31         IPXAddress_t Source __attribute__((packed));
32 } IPXPacket_t;
33
34 typedef struct ipx_socket_struct {
35 #ifdef DOSEMU
36         struct ipx_socket_struct *next;
37         far_t listenList;
38         int listenCount;
39         far_t AESList;
40         int AESCount;
41         u_short PSP;
42 #endif
43         u_short socket;
44         int fd;
45 } ipx_socket_t;
46
47 struct ipx_recv_data {
48         /* all network order */
49         u_char src_network[4];
50         u_char src_node[6];
51         u_short src_socket;
52         u_short dst_socket;
53         int pkt_type;
54 };
55
56 struct ipx_driver {
57         int (*GetMyAddress)(void);
58         int (*OpenSocket)(ipx_socket_t *sk, int port);
59         void (*CloseSocket)(ipx_socket_t *mysock);
60         int (*SendPacket)(ipx_socket_t *mysock, IPXPacket_t *IPXHeader,
61                           u_char *data, int dataLen);
62         int (*ReceivePacket)(ipx_socket_t *s, char *buffer, int bufsize,
63                              struct ipx_recv_data *rec);
64         int (*PacketReady)(ipx_socket_t *s);
65         void (*InitNetgameAuxData)(ipx_socket_t *s, u_char buf[]);
66         int (*HandleNetgameAuxData)(ipx_socket_t *s, const u_char buf[]);
67         void (*HandleLeaveGame)(ipx_socket_t *s);
68         int (*SendGamePacket)(ipx_socket_t *s, u_char *data, int dataLen);
69 };
70
71 int ipx_general_PacketReady(ipx_socket_t *s);
72
73 extern unsigned char ipx_MyAddress[10];
74
75 #endif /* _IPX_DRV_H */