networking works, finally
[btb/d2x.git] / arch / linux / include / ukali.h
1 /*
2  *
3  * FIXME: add description
4  *
5  */
6
7 #ifndef __UKALI_H__
8 #define __UKALI_H__
9
10 //added on 10/04/98 by Matt Mueller to show correct ver in kali
11 #include "vers_id.h"
12 //end addition -MM
13
14 // 4213 is the port that KaliNix is listening on
15 //
16 //              char code; // 1 == open, 2 == close, 3 == data, 5 == GetMyAddr
17 //      acks       // 6 == open, 7 == close                             4 == GetMyAddr
18
19 // net data packets structure for send/recv
20 // struct {
21 //              char    code; == 3
22 //              char    sa_nodenum[6];
23 //              char    dport[2];
24 //              char    sport[2];
25 //              char data[];
26 // }
27
28 // net data packets for open/close socket
29 //
30 // process_name is a null terminated 8byte string
31 // struct {
32 //              char code; // 1/6 == open, 2/7 == close
33 //              char socket[2];
34 //              char pid[4];
35 //              char    process_name[9];
36 // }
37
38 // net myaddress struct which is returned after the GetMyAddress call
39 // struct {
40 //              char    code; == 4
41 //              char    sa_nodenum[6];
42 // }
43
44 // net data for GetMyAddress call
45 // struct {
46 //              char    code; == 5
47 // }
48
49 typedef struct kaliaddr_ipx_tag {
50     short sa_family;
51     char  sa_netnum[4];
52     char  sa_nodenum[6];
53     unsigned short sa_socket;
54 } kaliaddr_ipx;
55
56 // Process name that shows up in /whois and /games list.
57 // Maximum of 8 characters.
58 //edited on 10/04/98 by Matt Mueller to show correct ver in kali
59 #define KALI_PROCESS_NAME "D1X" D1XMAJOR D1XMINOR
60 //end edit -MM
61 #define MAX_PACKET_SIZE 1500
62
63 // struct ipx_helper ipx_kali = {
64 //      ipx_kali_GetMyAddress,
65 //      ipx_kali_OpenSocket,
66 //      ipx_kali_CloseSocket,
67 //      ipx_kali_SendPacket,
68 //      ipx_kali_ReceivePacket,
69 //      ipx_general_PacketReady
70 // };
71
72 int KaliGetNodeNum(kaliaddr_ipx *myaddr);
73 int KaliOpenSocket(unsigned short port);
74 int KaliCloseSocket(int hand);
75 int KaliSendPacket(int hand, char *data, int len, kaliaddr_ipx *to);
76 int KaliReceivePacket(int hand, char *data, int len, kaliaddr_ipx *from);
77
78 #endif // __UKALI_H__