1 /*
2  *  Copyright (C) 2002-2013  The DOSBox Team
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 #ifndef DOSBOX_IPXSERVER_H_
20 #define DOSBOX_IPXSERVER_H_
21 
22 #if C_IPX
23 
24 #include "SDL_net.h"
25 
26 struct packetBuffer {
27 	Bit8u buffer[1024];
28 	Bit16s packetSize;  // Packet size remaining in read
29 	Bit16s packetRead;  // Bytes read of total packet
30 	bool inPacket;      // In packet reception flag
31 	bool connected;		// Connected flag
32 	bool waitsize;
33 };
34 
35 #define SOCKETTABLESIZE 16
36 #define CONVIP(hostvar) hostvar & 0xff, (hostvar >> 8) & 0xff, (hostvar >> 16) & 0xff, (hostvar >> 24) & 0xff
37 #define CONVIPX(hostvar) hostvar[0], hostvar[1], hostvar[2], hostvar[3], hostvar[4], hostvar[5]
38 
39 
40 void IPX_StopServer();
41 bool IPX_StartServer(Bit16u portnum);
42 bool IPX_isConnectedToServer(Bits tableNum, IPaddress ** ptrAddr);
43 
44 Bit8u packetCRC(Bit8u *buffer, Bit16u bufSize);
45 
46 #endif
47 
48 #endif
49