]> icculus.org git repositories - btb/d2x.git/blob - arch/linux/include/ipx_drv.h
bf37fbd0a4eadd9602f687327c1b36ad07e6b01b
[btb/d2x.git] / arch / linux / include / ipx_drv.h
1 /* $Id: ipx_drv.h,v 1.3 2002-08-29 19:02:34 btb Exp $ */
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 #include <sys/types.h>
16
17 #define IPX_MANUAL_ADDRESS
18
19 #define MAX_PACKET_DATA         1500
20
21 typedef struct IPXAddressStruct {
22         u_char Network[4] __attribute__((packed));
23         u_char Node[6] __attribute__((packed));
24         u_char Socket[2] __attribute__((packed));
25 } IPXAddress_t;
26
27 typedef struct IPXPacketStructure {
28         u_short Checksum __attribute__((packed));
29         u_short Length __attribute__((packed));
30         u_char TransportControl __attribute__((packed));
31         u_char PacketType __attribute__((packed));
32         IPXAddress_t Destination __attribute__((packed));
33         IPXAddress_t Source __attribute__((packed));
34 } IPXPacket_t;
35
36 typedef struct ipx_socket_struct {
37 #ifdef DOSEMU
38         struct ipx_socket_struct *next;
39         far_t listenList;
40         int listenCount;
41         far_t AESList;
42         int AESCount;
43         u_short PSP;
44 #endif
45         u_short socket;
46         int fd;
47 } ipx_socket_t;
48
49 struct ipx_recv_data {
50         /* all network order */
51         u_char src_network[4];
52         u_char src_node[6];
53         u_short src_socket;
54         u_short dst_socket;
55         int pkt_type;
56 };
57
58 struct ipx_driver {
59         int (*GetMyAddress)(void);
60         int (*OpenSocket)(ipx_socket_t *sk, int port);
61         void (*CloseSocket)(ipx_socket_t *mysock);
62         int (*SendPacket)(ipx_socket_t *mysock, IPXPacket_t *IPXHeader,
63                           u_char *data, int dataLen);
64         int (*ReceivePacket)(ipx_socket_t *s, char *buffer, int bufsize,
65                              struct ipx_recv_data *rec);
66         int (*PacketReady)(ipx_socket_t *s);
67 };
68
69 int ipx_general_PacketReady(ipx_socket_t *s);
70
71 extern unsigned char ipx_MyAddress[10];
72
73 #endif /* _IPX_DRV_H */