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