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