]> icculus.org git repositories - btb/d2x.git/blob - arch/dos/ipx.h
add level component saving functions which use PhysicsFS (didn't commit properly...
[btb/d2x.git] / arch / dos / ipx.h
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
11 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13 /*
14  * $Source: /cvs/cvsroot/d2x/arch/dos/ipx.h,v $
15  * $Revision: 1.2 $
16  * $Author: schaffner $
17  * $Date: 2004-08-28 23:17:45 $
18  * 
19  * Prototype for IPX communications.
20  * 
21  */
22
23 #ifndef _IPX_H
24 #define _IPX_H
25
26 // The default socket to use.
27 #define IPX_DEFAULT_SOCKET 0x5100               // 0x869d
28                                                                                                         
29 //---------------------------------------------------------------
30 // Initializes all IPX internals. 
31 // If socket_number==0, then opens next available socket.
32 // Returns:     0  if successful.
33 //                              -1 if socket already open.
34 //                              -2      if socket table full.
35 //                              -3 if IPX not installed.
36 //                              -4 if couldn't allocate low dos memory
37 //                              -5 if error with getting internetwork address
38 extern int ipx_init( int socket_number, int show_address );
39
40 extern int ipx_change_default_socket( ushort socket_number );
41
42 // Returns a pointer to 6-byte address
43 extern ubyte * ipx_get_my_local_address();
44 // Returns a pointer to 4-byte server
45 extern ubyte * ipx_get_my_server_address();
46
47 // Determines the local address equivalent of an internetwork address.
48 void ipx_get_local_target( ubyte * server, ubyte * node, ubyte * local_target );
49
50 // If any packets waiting to be read in, this fills data in with the packet data and returns
51 // the number of bytes read.  Else returns 0 if no packets waiting.
52 extern int ipx_get_packet_data( ubyte * data );
53
54 // Sends a broadcast packet to everyone on this socket.
55 extern void ipx_send_broadcast_packet_data( ubyte * data, int datasize );
56
57 // Sends a packet to a certain address
58 extern void ipx_send_packet_data( ubyte * data, int datasize, ubyte *network, ubyte *address, ubyte *immediate_address );
59 extern void ipx_send_internetwork_packet_data( ubyte * data, int datasize, ubyte * server, ubyte *address );
60
61 #define IPX_MAX_DATA_SIZE (542)         //(546-4)
62
63 extern void ipx_read_user_file(char * filename);
64 extern void ipx_read_network_file(char * filename);
65
66 #endif
67