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