1
0
Fork 0

Rewrite of the ipx client code by h-a-l-9000 (Should support more games). Modified it a bit so ipx support can be runtime enabled/disabled.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2254
This commit is contained in:
Peter Veenstra 2005-07-30 10:02:39 +00:00
parent b4fb1af8a2
commit 5a46ec0241
3 changed files with 502 additions and 369 deletions

View file

@ -16,9 +16,21 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: ipx.h,v 1.6 2005-07-30 10:02:39 qbix79 Exp $ */
#ifndef DOSBOX_IPX_H
#define DOSBOX_IPX_H
// Uncomment this for a lot of debug messages:
//#define IPX_DEBUGMSG
#ifndef DOSBOX_DOSBOX_H
#include "dosbox.h"
#endif
#ifndef DOSBOX_MEM_H
#include "mem.h"
#endif
// In Use Flag codes
#define USEFLAG_AVAILABLE 0x00
#define USEFLAG_AESTEMP 0xe0
@ -31,7 +43,6 @@
#define USEFLAG_LISTENING 0xfe
#define USEFLAG_SENDING 0xff
// Completion codes
#define COMP_SUCCESS 0x00
#define COMP_REMOTETERM 0xec
@ -52,7 +63,6 @@
// For Uint8 type
#include "SDL_net.h"
struct PackedIP {
Uint32 host;
Uint16 port;
@ -78,6 +88,45 @@ struct IPXHeader {
} dest, src;
} GCC_ATTRIBUTE(packed);
struct fragmentDescriptor {
Bit16u offset;
Bit16u segment;
Bit16u size;
};
class ECBClass {
public:
RealPt ECBAddr;
bool isInESRList;
ECBClass *prevECB;
ECBClass *nextECB;
Bit8u iuflag;
#ifdef IPX_DEBUGMSG
Bitu SerialNumber;
#endif
ECBClass::ECBClass(Bit16u segment, Bit16u offset);
Bit16u getSocket(void);
Bit8u getInUseFlag(void);
void setInUseFlag(Bit8u flagval);
void setCompletionFlag(Bit8u flagval);
Bit16u getFragCount(void);
void getFragDesc(Bit16u descNum, fragmentDescriptor *fragDesc);
RealPt getESRAddr(void);
void NotifyESR(void);
void setImmAddress(Bit8u *immAddr);
~ECBClass();
};
// The following routines may not be needed on all systems. On my build of SDL the IPaddress structure is 8 octects
// and therefore screws up my IPXheader structure since it needs to be packed.

File diff suppressed because it is too large Load diff

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: ipxserver.cpp,v 1.5 2005-07-30 10:02:39 qbix79 Exp $ */
#include "dosbox.h"
#if C_IPX
@ -85,7 +87,7 @@ static void sendIPXPacket(Bit8u *buffer, Bit16s bufSize) {
if(desthost == 0xffffffff) {
// Broadcast
for(i=0;i<SOCKETTABLESIZE;i++) {
if((connBuffer[i].connected) /* && (ipconn[i].host != srchost) */) {
if(connBuffer[i].connected && (ipconn[i].host != srchost) ) {
outPacket.address = ipconn[i];
result = SDLNet_UDP_Send(ipxServerSocket,-1,&outPacket);
if(result == 0) {
@ -171,8 +173,6 @@ static void IPX_ServerLoop() {
// Check to see if echo packet
if(SDLNet_Read16(tmpHeader->dest.socket) == 0x2) {
// Null destination node means its a server registration packet
if(tmpHeader->dest.addr.byIP.host == 0x0) {
UnpackIP(tmpHeader->src.addr.byIP, &tmpAddr);
@ -197,8 +197,6 @@ static void IPX_ServerLoop() {
return;
}
}
}
}