From 5b39ef08c3025c1a43fa940e3a9943289cdade53 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Sat, 16 May 2015 14:37:04 -0700 Subject: [PATCH] merge win32 ipx_mcast4 and ipx_udp --- Makefile.am | 6 +- arch/linux/ipx_mcast4.c | 48 ++- arch/linux/ipx_udp.c | 60 +-- arch/win32/ipx_drv.h | 79 ---- arch/win32/ipx_mcast4.c | 346 ---------------- arch/win32/ipx_udp.c | 627 ----------------------------- arch/win32/oldinclude/ipx_mcast4.h | 14 - arch/win32/oldinclude/ipx_udp.h | 13 - d2x.xcodeproj/project.pbxproj | 6 - 9 files changed, 70 insertions(+), 1129 deletions(-) delete mode 100644 arch/win32/ipx_drv.h delete mode 100644 arch/win32/ipx_mcast4.c delete mode 100644 arch/win32/ipx_udp.c delete mode 100644 arch/win32/oldinclude/ipx_mcast4.h delete mode 100644 arch/win32/oldinclude/ipx_udp.h diff --git a/Makefile.am b/Makefile.am index 05d2e9f7..87beb5fa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -99,17 +99,19 @@ d2x_svga_LDADD = $(d2x_LDADD) -lvga -lvgagl d2x_sdl_CPPFLAGS = $(d2x_CPPFLAGS) $(SDL_CFLAGS) $(SDLMIXER_CFLAGS) _d2x_sdl_SOURCES = $(d2x_SOURCES) arch/sdl/event.c arch/sdl/key.c arch/sdl/mouse.c +_d2x_sdl_SOURCES += arch/linux/ipx_mcast4.c arch/linux/ipx_udp.c d2x_sdl_SOURCES = $(_d2x_sdl_SOURCES) arch/sdl/vid.c texmap/tmapflat.c d2x_sdl_LDFLAGS = $(d2x_LDFLAGS) d2x_sdl_LDADD = $(d2x_LDADD) $(SDL_LIBS) $(SDLIMAGE_LIBS) $(SDLMIXER_LIBS) if MINGW32 +d2x_sdl_CPPFLAGS += -I$(top_srcdir)/arch/linux/include _d2x_sdl_SOURCES += arch/win32/mingw_init.c _d2x_sdl_SOURCES += arch/sdl/joy.c arch/sdl/joydefs.c d2x_sdl_LDADD += -lwinmm if USE_NETWORK -_d2x_sdl_SOURCES += arch/win32/ipx_mcast4.c arch/win32/ipx_win.c arch/win32/ipx_udp.c arch/win32/winnet.c +_d2x_sdl_SOURCES += arch/win32/ipx_win.c arch/win32/winnet.c d2x_sdl_LDADD += -lwsock32 endif @@ -126,7 +128,7 @@ _d2x_sdl_SOURCES += arch/sdl/joy.c arch/sdl/joydefs.c endif if USE_NETWORK -_d2x_sdl_SOURCES += arch/linux/ipx_mcast4.c arch/linux/ipx_udp.c arch/linux/linuxnet.c +_d2x_sdl_SOURCES += arch/linux/linuxnet.c if USE_NATIVE_IPX _d2x_sdl_SOURCES += arch/linux/ipx_bsd.c diff --git a/arch/linux/ipx_mcast4.c b/arch/linux/ipx_mcast4.c index d9b7e3ad..b9d218d1 100644 --- a/arch/linux/ipx_mcast4.c +++ b/arch/linux/ipx_mcast4.c @@ -5,29 +5,35 @@ * */ - #ifdef HAVE_CONFIG_H #include #endif #include #include -#include -#include #include #include -#include -#include #include #include +#ifdef _WIN32 +#include +#include +#else +#include +#include +#include +#include +#define closesocket(x) close(x) +#endif + #include "pstypes.h" #include "ipx_mcast4.h" #include "args.h" #include "error.h" -#include "newmenu.h" #include "inferno.h" + //#define IPX_MCAST4_DEBUG extern unsigned char ipx_MyAddress[10]; @@ -111,26 +117,26 @@ static int ipx_mcast4_OpenSocket(ipx_socket_t *sk, int port) sin.sin_port = htons(baseport); if (bind(sk->fd, (struct sockaddr *)&sin, sizeof(sin))) { - if (close(sk->fd)) - msg("close() failed during error recovery: %m"); + if (closesocket(sk->fd)) + msg("closesocket() failed during error recovery: %m"); sk->fd = -1; FAIL("bind() to UDP port %d failed: %m", baseport); } // Set the TTL so the packets can get out of the local network. - if(setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0) + if (setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_TTL, (const void *)&ttl, sizeof(ttl)) < 0) FAIL("setsockopt() failed to set TTL to 128"); // Disable multicast loopback loop = 0; - if(setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)) < 0) + if (setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_LOOP, (const void *)&loop, sizeof(loop)) < 0) FAIL("setsockopt() failed to disable multicast loopback: %m"); // Subscribe to the game announcement address memset(&mreq, 0, sizeof(mreq)); mreq.imr_multiaddr.s_addr = DESCENT2_ANNOUNCE_ADDR; mreq.imr_interface.s_addr = INADDR_ANY; - if(setsockopt(sk->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) + if (setsockopt(sk->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const void *)&mreq, sizeof(mreq)) < 0) FAIL("setsockopt() failed to subscribe to the game announcement multicast group"); // We're not subscribed to a game address yet @@ -142,7 +148,7 @@ static int ipx_mcast4_OpenSocket(ipx_socket_t *sk, int port) static void ipx_mcast4_CloseSocket(ipx_socket_t *sk) { - if(close(sk->fd) < 0) + if(closesocket(sk->fd) < 0) msg("Close failed"); sk->fd = -1; } @@ -180,7 +186,7 @@ static int ipx_mcast4_SendPacket(ipx_socket_t *sk, IPXPacket_t *IPXHeader, u_cha puts(")."); #endif - i = (int)sendto(sk->fd, data, dataLen, 0, (struct sockaddr *)&toaddr, sizeof(toaddr)); + i = (int)sendto(sk->fd, (const void *)data, dataLen, 0, (struct sockaddr *)&toaddr, sizeof(toaddr)); return i; } @@ -188,7 +194,7 @@ static int ipx_mcast4_ReceivePacket(ipx_socket_t *sk, char *outbuf, int outbufsi { int size; struct sockaddr_in fromaddr; - uint fromaddrsize = sizeof(fromaddr); + socklen_t fromaddrsize = sizeof(fromaddr); if ((size = (int)recvfrom(sk->fd, outbuf, outbufsize, 0, (struct sockaddr*)&fromaddr, &fromaddrsize)) < 0) return -1; @@ -244,14 +250,14 @@ static int ipx_mcast4_HandleNetgameAuxData(ipx_socket_t *sk, const u_char buf[NE #endif // Set the TTL so the packets can get out of the local network. - if(setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0) + if(setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_TTL, (const void *)&ttl, sizeof(ttl)) < 0) FAIL("setsockopt() failed to set TTL to 128"); memset(&mreq, 0, sizeof(mreq)); mreq.imr_multiaddr = game_addr; mreq.imr_interface.s_addr = INADDR_ANY; - if(setsockopt(sk->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) + if(setsockopt(sk->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const void *)&mreq, sizeof(mreq)) < 0) FAIL("setsockopt() failed to subscribe to the game group"); return 0; @@ -263,13 +269,16 @@ static int ipx_mcast4_HandleNetgameAuxData(ipx_socket_t *sk, const u_char buf[NE */ static void ipx_mcast4_InitNetgameAuxData(ipx_socket_t *sk, u_char buf[NETGAME_AUX_SIZE]) { + char addr[16]; Assert(game_addr.s_addr == 0); // The first byte is the version number buf[0] = IPX_MCAST4_VERSION; // Generate a random session - game_addr = inet_makeaddr(239*256 + 255, d_rand() % 0xFFFF); +// game_addr = inet_makeaddr(239*256 + 255, d_rand() % 0xFFFF); + sprintf(addr, "%i.%i.%i.%i", 239, 255, d_rand() % 0xFF, d_rand() % 0xFF); + game_addr.s_addr = inet_addr(addr); memcpy(buf + 1, &game_addr, sizeof(game_addr)); // Since we're obviously the hosting machine, subscribe to this address @@ -291,7 +300,7 @@ static void ipx_mcast4_HandleLeaveGame(ipx_socket_t *sk) mreq.imr_multiaddr = game_addr; mreq.imr_interface.s_addr = INADDR_ANY; - if(setsockopt(sk->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) + if(setsockopt(sk->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, (const void *)&mreq, sizeof(mreq)) < 0) msg("setsockopt() failed unsubscribing from previous group!"); game_addr.s_addr = 0; } @@ -303,12 +312,13 @@ static int ipx_mcast4_SendGamePacket(ipx_socket_t *sk, ubyte *data, int dataLen) int i; memset(&toaddr, 0, sizeof(toaddr)); + toaddr.sin_family = AF_INET; toaddr.sin_addr = game_addr; toaddr.sin_port = htons(UDP_BASEPORT); msg("ipx_mcast4_SendGamePacket"); - i = (int)sendto(sk->fd, data, dataLen, 0, (struct sockaddr *)&toaddr, sizeof(toaddr)); + i = (int)sendto(sk->fd, (const void *)data, dataLen, 0, (struct sockaddr *)&toaddr, sizeof(toaddr)); return i; } diff --git a/arch/linux/ipx_udp.c b/arch/linux/ipx_udp.c index 832d331f..07009eca 100644 --- a/arch/linux/ipx_udp.c +++ b/arch/linux/ipx_udp.c @@ -72,23 +72,33 @@ #include #include -#include -#include /* for htons & co. */ #include #include -#include #include #ifdef __sun # include #endif -#include -#include #ifdef __sun__ # include #endif -#include #include +#ifdef _WIN32 +#include +#include +#include +#else +#include +#include +#include +#include +#include +#include +#define closesocket(x) close(x) +#define ioctlsocket(x) ioctl(x) +#define SOCKET int +#endif + #include "ipx_drv.h" #include "args.h" @@ -139,6 +149,7 @@ static char compatibility=0; static int have_empty_address() { int i; + for (i = 0; i < 10 && !ipx_MyAddress[i]; i++) ; return i == 10; } @@ -147,7 +158,8 @@ static int have_empty_address() { static void msg(const char *fmt,...) { -va_list ap; + va_list ap; + fputs(MSGHDR,stdout); va_start(ap,fmt); vprintf(fmt,ap); @@ -204,10 +216,11 @@ static void chkbroadsize(void) /* Stolen from my GGN */ static int addiflist(void) { -unsigned cnt=MAX_BRDINTERFACES,i,j; -struct ifconf ifconf; -int sock; -struct sockaddr_in *sinp,*sinmp; +#ifndef _WIN32 + unsigned cnt=MAX_BRDINTERFACES,i,j; + struct ifconf ifconf; + SOCKET sock; + struct sockaddr_in *sinp,*sinmp; free(broads); if ((sock=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP))<0) @@ -222,22 +235,22 @@ struct sockaddr_in *sinp,*sinmp; chk(ifconf.ifc_req=alloca((ifconf.ifc_len=cnt*sizeof(struct ifreq)))); if (ioctl(sock,SIOCGIFCONF,&ifconf)||ifconf.ifc_len%sizeof(struct ifreq)) { - close(sock); + closesocket(sock); FAIL("ioctl(SIOCGIFCONF) failure during broadcast detection: %m"); - } + } cnt=ifconf.ifc_len/sizeof(struct ifreq); chk(broads=malloc(cnt*sizeof(*broads))); broadsize=cnt; for (i=j=0;ifd = -1; FAIL("socket() creation failed on port %d: %m",port); } - if (setsockopt(sk->fd,SOL_SOCKET,SO_BROADCAST,&val_one,sizeof(val_one))) { - if (close(sk->fd)) msg("close() failed during error recovery: %m"); + if (setsockopt(sk->fd, SOL_SOCKET, SO_BROADCAST, (const void *)&val_one, sizeof(val_one))) { + if (closesocket(sk->fd)) msg("closesocket() failed during error recovery: %m"); sk->fd=-1; FAIL("setsockopt(SO_BROADCAST) failed: %m"); } @@ -450,7 +464,7 @@ struct sockaddr_in sin; sin.sin_addr.s_addr=htonl(INADDR_ANY); sin.sin_port=htons(baseport); if (bind(sk->fd,(struct sockaddr *)&sin,sizeof(sin))) { - if (close(sk->fd)) msg("close() failed during error recovery: %m"); + if (closesocket(sk->fd)) msg("closesocket() failed during error recovery: %m"); sk->fd=-1; FAIL("bind() to UDP port %d failed: %m",baseport); } @@ -469,8 +483,8 @@ static void ipx_udp_CloseSocket(ipx_socket_t *mysock) { return; } msg("CloseSocket on D1X socket port %d",mysock->socket); - if (close(mysock->fd)) - msg("close() failed on CloseSocket D1X socket port %d: %m",mysock->socket); + if (closesocket(mysock->fd)) + msg("closesocket() failed on CloseSocket D1X socket port %d: %m",mysock->socket); mysock->fd=-1; if (--open_sockets) { msg("(closesocket) %d sockets left", open_sockets); @@ -533,7 +547,7 @@ static int ipx_udp_ReceivePacket(ipx_socket_t *s, char *outbuf, int outbufsize, struct ipx_recv_data *rd) { int size; struct sockaddr_in fromaddr; - uint fromaddrsize=sizeof(fromaddr); + socklen_t fromaddrsize = sizeof(fromaddr); unsigned short ports; size_t offs; int i; diff --git a/arch/win32/ipx_drv.h b/arch/win32/ipx_drv.h deleted file mode 100644 index 6424ccb3..00000000 --- a/arch/win32/ipx_drv.h +++ /dev/null @@ -1,79 +0,0 @@ - -/* - * - * IPX driver interface - * - * parts from: - * ipx.h header file for IPX for the DOS emulator - * Tim Bird, tbird@novell.com - * - */ - -#ifndef _IPX_DRV_H -#define _IPX_DRV_H - -#define IPX_MANUAL_ADDRESS - -#include - -#include "pstypes.h" - -#define MAX_PACKET_DATA 1500 - -#ifdef _MSC_VER -#pragma pack (push, 1) -#endif - -typedef struct IPXAddressStruct { - u_char Network[4] __pack__; - u_char Node[6] __pack__; - u_char Socket[2] __pack__; -} IPXAddress_t; - -typedef struct IPXPacketStructure { - u_short Checksum __pack__; - u_short Length __pack__; - u_char TransportControl __pack__; - u_char PacketType __pack__; - IPXAddress_t Destination __pack__; - IPXAddress_t Source __pack__; -} IPXPacket_t; - -#ifdef _MSC_VER -#pragma pack (pop) -#endif - -typedef struct ipx_socket_struct { - u_short socket; - int fd; -} ipx_socket_t; - -struct ipx_recv_data { - /* all network order */ - u_char src_network[4]; - u_char src_node[6]; - u_short src_socket; - u_short dst_socket; - int pkt_type; -}; - -struct ipx_driver { - int (*GetMyAddress)(void); - int (*OpenSocket)(ipx_socket_t *sk, int port); - void (*CloseSocket)(ipx_socket_t *mysock); - int (*SendPacket)(ipx_socket_t *mysock, IPXPacket_t *IPXHeader, - u_char *data, int dataLen); - int (*ReceivePacket)(ipx_socket_t *s, char *buffer, int bufsize, - struct ipx_recv_data *rec); - int (*PacketReady)(ipx_socket_t *s); - void (*InitNetgameAuxData)(ipx_socket_t *s, u_char buf[]); - int (*HandleNetgameAuxData)(ipx_socket_t *s, const u_char buf[]); - void (*HandleLeaveGame)(ipx_socket_t *s); - int (*SendGamePacket)(ipx_socket_t *s, u_char *data, int dataLen); -}; - -int ipx_general_PacketReady(ipx_socket_t *s); - -extern unsigned char ipx_MyAddress[10]; - -#endif /* _IPX_DRV_H */ diff --git a/arch/win32/ipx_mcast4.c b/arch/win32/ipx_mcast4.c deleted file mode 100644 index 4eb1aaeb..00000000 --- a/arch/win32/ipx_mcast4.c +++ /dev/null @@ -1,346 +0,0 @@ - -/* - * - * "ipx driver" for IPv4 multicasting - * - */ - - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#ifndef _MSC_VER -#include -#endif -#include -#include - -#include -#include - -#include "ipx_mcast4.h" -#include "args.h" -#include "error.h" -#include "../../main/multi.h" -#include "../../main/newmenu.h" - -//#define IPX_MCAST4_DEBUG - -extern unsigned char ipx_MyAddress[10]; - -#define UDP_BASEPORT 28342 -#define PORTSHIFT_TOLERANCE 0x100 -#define MAX_PACKETSIZE 8192 - -/* OUR port. Can be changed by "@X[+=]..." argument (X is the shift value) - */ -static int baseport=UDP_BASEPORT; - -static struct in_addr game_addr; // The game's multicast address - -#define MSGHDR "IPX_mcast4: " - -#ifdef __GNUC__ -#ifdef IPX_MCAST4_DEBUG -static void msg(const char *fmt, ...) -{ - va_list ap; - - fputs(MSGHDR, stdout); - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - putchar('\n'); -} -#else -#define msg(m...) -#endif -#else -# ifdef IPX_MCAST4_DEBUG -# define msg printf -# else -# define msg -# endif -#endif - -#ifdef __GNUC__ -#define FAIL(m...) do{ nm_messagebox("Error", 1, "Ok", ##m); return -1; } while (0) -#else -# define FAIL() do{ nm_messagebox("Error", 1, "Ok", "IPX_mcast4 failure"); return -1; } while (0) -#endif - -#ifdef IPX_MCAST4_DEBUG -/* Dump raw form of IP address/port by fancy output to user - */ -static void dumpraddr(unsigned char *a) -{ - short port; - - printf("[%u.%u.%u.%u]", a[0], a[1], a[2], a[3]); - port=(signed short)ntohs(*(unsigned short *)(a+4)); - if (port) printf(":%+d",port); -} - -/* Like dumpraddr() but for structure "sockaddr_in" - */ -static void dumpaddr(struct sockaddr_in *sin) -{ - unsigned short ports; - unsigned char qhbuf[8]; - - memcpy(qhbuf + 0, &sin->sin_addr, 4); - ports = htons(((short)ntohs(sin->sin_port)) - UDP_BASEPORT); - memcpy(qhbuf + 4, &ports, 2); - dumpraddr(qhbuf); -} -#endif - -// The multicast address for Descent 2 game announcements. -// TODO: Pick a better address for this -#define DESCENT2_ANNOUNCE_ADDR inet_addr("239.255.1.2") - -/* Open the socket and subscribe to the multicast session */ -static int ipx_mcast4_OpenSocket(ipx_socket_t *sk, int port) -{ - u_char loop; - struct ip_mreq mreq; - struct sockaddr_in sin; - int ttl = 128; - - if((sk->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) - { - sk->fd = -1; - FAIL("socket() creation failed on port %d: %m", port); - } - - // Bind to the port - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = htonl(INADDR_ANY); - sin.sin_port = htons(baseport); - if (bind(sk->fd, (struct sockaddr *)&sin, sizeof(sin))) - { - if (closesocket(sk->fd)) - msg("close() failed during error recovery: %m"); - sk->fd = -1; - FAIL("bind() to UDP port %d failed: %m", baseport); - } - - // Set the TTL so the packets can get out of the local network. - if(setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_TTL, (const void*)&ttl, sizeof(ttl)) < 0) - FAIL("setsockopt() failed to set TTL to 128"); - - // Disable multicast loopback - loop = 0; - if(setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_LOOP, (const void*)&loop, sizeof(loop)) < 0) - FAIL("setsockopt() failed to disable multicast loopback: %m"); - - // Subscribe to the game announcement address - memset(&mreq, 0, sizeof(mreq)); - mreq.imr_multiaddr.s_addr = DESCENT2_ANNOUNCE_ADDR; - mreq.imr_interface.s_addr = INADDR_ANY; - if(setsockopt(sk->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const void*)&mreq, sizeof(mreq)) < 0) - FAIL("setsockopt() failed to subscribe to the game announcement multicast group"); - - // We're not subscribed to a game address yet - game_addr.s_addr = 0; - - sk->socket = port; - return 0; -} - -static void ipx_mcast4_CloseSocket(ipx_socket_t *sk) -{ - if(closesocket(sk->fd) < 0) - msg("Close failed"); - sk->fd = -1; -} - -static int ipx_mcast4_SendPacket(ipx_socket_t *sk, IPXPacket_t *IPXHeader, u_char *data, int dataLen) -{ - struct sockaddr_in toaddr; - int i; - - msg("SendPacket enter, dataLen=%d", dataLen); - - if(dataLen < 0 || dataLen > MAX_PACKETSIZE) - return -1; - - toaddr.sin_family = AF_INET; - memcpy(&toaddr.sin_addr, IPXHeader->Destination.Node + 0, 4); - //toaddr.sin_port = htons(((short)ntohs(*(unsigned short *)(IPXHeader->Destination.Node + 4))) + UDP_BASEPORT); - // For now, just use the same port for everything - toaddr.sin_port = htons(UDP_BASEPORT); - - // If it's the broadcast address, then we want to send it to the - // GAME ANNOUNCEMENT address. - // Data to be sent to the GAME has the destination already set by - // ipx_mcast4_SendGamePacket - if(toaddr.sin_addr.s_addr == INADDR_BROADCAST) - toaddr.sin_addr.s_addr = DESCENT2_ANNOUNCE_ADDR; - -#ifdef IPX_MCAST4_DEBUG - printf(MSGHDR "sendto((%d),Node=[4] %02X %02X,Socket=%02X %02X,s_port=%u,", - dataLen, - IPXHeader->Destination.Node[4], IPXHeader->Destination.Node[5], - IPXHeader->Destination.Socket[0], IPXHeader->Destination.Socket[1], - ntohs(toaddr.sin_port)); - dumpaddr(&toaddr); - puts(")."); -#endif - - i = sendto(sk->fd, data, dataLen, 0, (struct sockaddr *)&toaddr, sizeof(toaddr)); - return i; -} - -static int ipx_mcast4_ReceivePacket(ipx_socket_t *sk, char *outbuf, int outbufsize, struct ipx_recv_data *rd) -{ - int size; - struct sockaddr_in fromaddr; - int fromaddrsize = sizeof(fromaddr); - - if((size = recvfrom(sk->fd, outbuf, outbufsize, 0, (struct sockaddr*)&fromaddr, &fromaddrsize)) < 0) - return -1; - -#ifdef IPX_MCAST4_DEBUG - printf(MSGHDR "Got packet from "); - dumpaddr(&fromaddr); - puts(""); -#endif - - // We have the packet, now fill out the receive data. - memset(rd, 0, sizeof(*rd)); - memcpy(rd->src_node, &fromaddr.sin_addr, 4); - // TODO: Include the port like in ipx_udp.c - rd->pkt_type = 0; - - return size; -} - -/* Handle the netgame aux data - * Byte 0 is the protocol version number. - * Bytes 1-4 are the IPv4 multicast session to join, in network byte order. - */ -static int ipx_mcast4_HandleNetgameAuxData(ipx_socket_t *sk, const u_char buf[NETGAME_AUX_SIZE]) -{ - // Extract the multicast session and subscribe to it. We should - // now be getting packets intended for the players of this game. - - // Note that we stay subscribed to the game announcement session, - // so we can reply to game info requests - struct ip_mreq mreq; - int ttl = 128; - - // Check the protocol version - if(buf[0] != IPX_MCAST4_VERSION) - { - FAIL("mcast4 protocol\nversion mismatch!\nGame version is %02x,\nour version is %02x", buf[0], IPX_MCAST4_VERSION); - } - - // Get the multicast session - memcpy(&game_addr, buf + 1, sizeof(game_addr)); - -#ifdef IPX_MCAST4_DEBUG - { - struct sockaddr_in tmpaddr; - tmpaddr.sin_addr = game_addr; - tmpaddr.sin_port = 0; - - printf("Handling netgame aux data: Subscribing to "); - dumpaddr(&tmpaddr); - puts(""); - } -#endif - - // Set the TTL so the packets can get out of the local network. - if(setsockopt(sk->fd, IPPROTO_IP, IP_MULTICAST_TTL, (const void*)&ttl, sizeof(ttl)) < 0) - FAIL("setsockopt() failed to set TTL to 128"); - - memset(&mreq, 0, sizeof(mreq)); - mreq.imr_multiaddr = game_addr; - mreq.imr_interface.s_addr = INADDR_ANY; - - if(setsockopt(sk->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const void*)&mreq, sizeof(mreq)) < 0) - FAIL("setsockopt() failed to subscribe to the game group"); - - return 0; -} - -/* Create the netgame aux data. - * Byte 0 is the protcol version number. - * Bytes 1-4 hold the IPv4 multicast session for the game. - */ -static void ipx_mcast4_InitNetgameAuxData(ipx_socket_t *sk, u_char buf[NETGAME_AUX_SIZE]) -{ - char addr[16]; - Assert(game_addr.s_addr == 0); - - // The first byte is the version number - buf[0] = IPX_MCAST4_VERSION; - - // Generate a random session - // game_addr = inet_makeaddr(239*256 + 255, d_rand() % 0xFFFF); - sprintf(addr, "%i.%i.%i.%i", 239, 255, d_rand() % 0xFF, d_rand() % 0xFF); - game_addr.s_addr = inet_addr(addr); - memcpy(buf + 1, &game_addr, sizeof(game_addr)); - - // Since we're obviously the hosting machine, subscribe to this address - ipx_mcast4_HandleNetgameAuxData(sk, buf); -} - -static void ipx_mcast4_HandleLeaveGame(ipx_socket_t *sk) -{ - // We left the game, so unsubscribe from its multicast session - struct ip_mreq mreq; - - Assert(game_addr.s_addr != 0); - -#ifdef IPX_MCAST4_DEBUG - printf("Unsubscribing from game's multicast group: "); - dumpraddr(&game_addr.s_addr); - printf("\n"); -#endif - - mreq.imr_multiaddr = game_addr; - mreq.imr_interface.s_addr = INADDR_ANY; - if(setsockopt(sk->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, (const void*)&mreq, sizeof(mreq)) < 0) - msg("setsockopt() failed unsubscribing from previous group!"); - game_addr.s_addr = 0; -} - -// Send a packet to every member of the game. We can just multicast it here. -static int ipx_mcast4_SendGamePacket(ipx_socket_t *sk, ubyte *data, int dataLen) -{ - struct sockaddr_in toaddr; - int i; - - memset(&toaddr, 0, sizeof(toaddr)); - toaddr.sin_family = AF_INET; - toaddr.sin_addr = game_addr; - toaddr.sin_port = htons(UDP_BASEPORT); - - msg("ipx_mcast4_SendGamePacket"); - - i = sendto(sk->fd, data, dataLen, 0, (struct sockaddr *)&toaddr, sizeof(toaddr)); - - return i; -} - -// Pull this in from ipx_udp.c since it's the same for us. -extern int ipx_udp_GetMyAddress(); - -struct ipx_driver ipx_mcast4 = { - ipx_udp_GetMyAddress, - ipx_mcast4_OpenSocket, - ipx_mcast4_CloseSocket, - ipx_mcast4_SendPacket, - ipx_mcast4_ReceivePacket, - ipx_general_PacketReady, - ipx_mcast4_InitNetgameAuxData, - ipx_mcast4_HandleNetgameAuxData, - ipx_mcast4_HandleLeaveGame, - ipx_mcast4_SendGamePacket -}; diff --git a/arch/win32/ipx_udp.c b/arch/win32/ipx_udp.c deleted file mode 100644 index 42b174d4..00000000 --- a/arch/win32/ipx_udp.c +++ /dev/null @@ -1,627 +0,0 @@ -/* - * - * IPX driver for native Linux TCP/IP networking (UDP implementation) - * Version 0.99.2 - * Contact Jan [Lace] Kratochvil for assistance - * (no "It somehow doesn't work! What should I do?" complaints, please) - * Special thanks to Vojtech Pavlik for testing. - * - * Also you may see KIX - KIX kix out KaliNix (in Linux-Linux only): - * http://atrey.karlin.mff.cuni.cz/~short/sw/kix.c.gz - * - * Primarily based on ipx_kali.c - "IPX driver for KaliNix interface" - * which is probably mostly by Jay Cotton . - * Parts shamelessly stolen from my KIX v0.99.2 and GGN v0.100 - * - * Changes: - * -------- - * 0.99.1 - now the default broadcast list also contains all point-to-point - * links with their destination peer addresses - * 0.99.2 - commented a bit :-) - * - now adds to broadcast list each host it gets some packet from - * which is already not covered by local physical ethernet broadcast - * - implemented short-signature packet format - * - compatibility mode for old D1X releases due to the previous bullet - * - * Configuration: - * -------------- - * No network server software is needed, neither KIX nor KaliNIX. - * - * NOTE: with the change to allow the user to choose the network - * driver from the game menu, the following is not anymore precise: - * the command line argument "-udp" is only necessary to supply udp - * options! - * - * Add command line argument "-udp". In default operation D1X will send - * broadcasts too all the local interfaces found. But you may also use - * additional parameter specified after "-udp" to modify the default - * broadcasting style and UDP port numbers binding: - * - * ./d1x -udp [@SHIFT]=HOST_LIST Broadcast ONLY to HOST_LIST - * ./d1x -udp [@SHIFT]+HOST_LIST Broadcast both to local ifaces & to HOST_LIST - * - * HOST_LIST is a comma (',') separated list of HOSTs: - * HOST is an IPv4 address (so-called quad like 192.168.1.2) or regular hostname - * HOST can also be in form 'address:SHIFT' - * SHIFT sets the UDP port base offset (e.g. +2), can be used to run multiple - * clients on one host simultaneously. This SHIFT has nothing to do - * with the dynamic-sockets (PgUP/PgDOWN) option in Descent, it's another - * higher-level differentiation option. - * - * Examples: - * --------- - * ./d1x -udp - * - Run D1X to participate in normal local network (Linux only, of course) - * - * ./d1x -udp @1=localhost:2 & ./d1x -udp @2=localhost:1 - * - Run two clients simultaneously fighting each other (only each other) - * - * ./d1x -udp =192.168.4.255 - * - Run distant Descent which will participate with remote network - * 192.168.4.0 with netmask 255.255.255.0 (broadcast has 192.168.4.255) - * - You'll have to also setup hosts in that network accordingly: - * ./d1x -udp +UPPER_DISTANT_MACHINE_NAME - * - * Have fun! - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#ifndef _MSC_VER -#include -#endif -#include -#include -#include -#include - -#include - -#include "ipx_drv.h" -#include "args.h" - -extern unsigned char ipx_MyAddress[10]; - -// #define UDPDEBUG - -#define UDP_BASEPORT 28342 -#define PORTSHIFT_TOLERANCE 0x100 -#define MAX_PACKETSIZE 8192 - -/* Packet format: first is the signature { 0xD1,'X' } which can be also - * { 'D','1','X','u','d','p'} for old-fashioned packets. - * Then follows virtual socket number (as changed during PgDOWN/PgUP) - * in network-byte-order as 2 bytes (u_short). After such 4/8 byte header - * follows raw data as communicated with D1X network core functions. - */ - -// Length HAS TO BE 6! -#define D1Xudp "D1Xudp" -// Length HAS TO BE 2! -#define D1Xid "\xD1X" - -static int open_sockets = 0; -static int dynamic_socket = 0x401; -static const int val_one=1; - -/* OUR port. Can be changed by "@X[+=]..." argument (X is the shift value) - */ - -static int baseport=UDP_BASEPORT; - -/* Have we some old D1X in network and have we to maintain compatibility? - * FIXME: Following scenario is braindead: - * A (NEW) , B (OLD) , C (NEW) - * host A) We start new D1X. A-newcomm, B-none , C-none - * host B) We start OLD D1X. A-newcomm, B-oldcomm, C-none - * Now host A hears host B and switches: A-oldcomm, B-oldcomm, C-none - * host C) We start new D1X. A-oldcomm, B-oldcomm, C-newcomm - * Now host C hears host A/B and switches: A-oldcomm, B-oldcomm, C-oldcomm - * Now host B finishes: A-oldcomm, B-none , C-oldcomm - * - * But right now we have hosts A and C, both new code equipped but - * communicating wastefully by the OLD protocol! Bummer. - */ - -static char compatibility=0; - -static int have_empty_address() { - int i; - - for (i = 0; i < 10 && !ipx_MyAddress[i]; i++) ; - return i == 10; -} - -#define MSGHDR "IPX_udp: " - -static void msg(const char *fmt,...) -{ - va_list ap; - - fputs(MSGHDR,stdout); - va_start(ap,fmt); - vprintf(fmt,ap); - va_end(ap); - putchar('\n'); -} - -static void chk(void *p) -{ - if (p) return; - msg("FATAL: Virtual memory exhausted!"); - exit(EXIT_FAILURE); -} - -#ifdef _MSC_VER -#define FAIL Warning -#else -#define FAIL(m...) do { msg(#m); return -1; } while (0) -#endif - -/* Find as much as MAX_BRDINTERFACES during local iface autoconfiguration. - * Note that more interfaces can be added during manual configuration - * or host-received-packet autoconfiguration - */ - -#define MAX_BRDINTERFACES 16 - -/* We require the interface to be UP and RUNNING to accept it. - */ - -#define IF_REQFLAGS (IFF_UP|IFF_RUNNING) - -/* We reject any interfaces declared as LOOPBACK type. - */ -#define IF_NOTFLAGS (IFF_LOOPBACK) - -static struct sockaddr_in *broads,broadmasks[MAX_BRDINTERFACES]; -static int broadnum,masksnum,broadsize; - -/* We'll check whether the "broads" array of destination addresses is now - * full and so needs expanding. - */ - -static void chkbroadsize(void) -{ - if (broadnumsin_family!=AF_INET || sinmp->sin_family!=AF_INET) continue; - broads[j]=*sinp; - broads[j].sin_port=UDP_BASEPORT; //FIXME: No possibility to override from cmdline - broadmasks[j]=*sinmp; - j++; - } - broadnum=j; - masksnum=j; -#endif - return(0); -} - -#define addreq(a,b) ((a).sin_port==(b).sin_port&&(a).sin_addr.s_addr==(b).sin_addr.s_addr) - -/* Previous function addiflist() can (and probably will) report multiple - * same addresses. On some Linux boxes is present both device "eth0" and - * "dummy0" with the same IP addreesses - we'll filter it here. - */ - -static void unifyiflist(void) -{ -int d=0,s,i; - - for (s=0;s=s) broads[d++]=broads[s]; - } - broadnum=d; -} - -static unsigned char qhbuf[6]; - -/* Parse PORTSHIFT numeric parameter - */ - -static void portshift(const char *cs) -{ -long port; -unsigned short ports=0; - - port=atol(cs); - if (port<-PORTSHIFT_TOLERANCE || port>+PORTSHIFT_TOLERANCE) - msg("Invalid portshift in \"%s\", tolerance is +/-%d",cs,PORTSHIFT_TOLERANCE); - else ports=htons(port); - memcpy(qhbuf+4,&ports,2); -} - -/* Do hostname resolve on name "buf" and return the address in buffer "qhbuf". - */ -static unsigned char *queryhost(char *buf) -{ -struct hostent *he; -char *s; -char c=0; - - if ((s=strrchr(buf,':'))) { - c=*s; - *s='\0'; - portshift(s+1); - } - else memset(qhbuf+4,0,2); - he=gethostbyname((char *)buf); - if (s) *s=c; - if (!he) { - msg("Error resolving my hostname \"%s\"",buf); - return(NULL); - } - if (he->h_addrtype!=AF_INET || he->h_length!=4) { - msg("Error parsing resolved my hostname \"%s\"",buf); - return(NULL); - } - if (!*he->h_addr_list) { - msg("My resolved hostname \"%s\" address list empty",buf); - return(NULL); - } - memcpy(qhbuf,(*he->h_addr_list),4); - return(qhbuf); -} - -/* Dump raw form of IP address/port by fancy output to user - */ -static void dumpraddr(unsigned char *a) -{ -short port; - printf("[%u.%u.%u.%u]",a[0],a[1],a[2],a[3]); - port=(signed short)ntohs(*(unsigned short *)(a+4)); - if (port) printf(":%+d",port); -} - -/* Like dumpraddr() but for structure "sockaddr_in" - */ - -static void dumpaddr(struct sockaddr_in *sin) -{ -unsigned short ports; - - memcpy(qhbuf+0,&sin->sin_addr,4); - ports=htons(((short)ntohs(sin->sin_port))-UDP_BASEPORT); - memcpy(qhbuf+4,&ports,2); - dumpraddr(qhbuf); -} - -/* Startup... Uninteresting parsing... - */ - -int ipx_udp_GetMyAddress(void) { - -char buf[256]; -int i; -char *s,*s2,*ns; - - if (!have_empty_address()) - return 0; - - if (!((i=FindArg("-udp")) && (s=Args[i+1]) && (*s=='=' || *s=='+' || *s=='@'))) s=NULL; - - if (gethostname(buf,sizeof(buf))) FAIL("Error getting my hostname"); - if (!(queryhost(buf))) FAIL("Querying my own hostname \"%s\"",buf); - - if (s) while (*s=='@') { - portshift(++s); - while (isdigit(*s)) s++; - } - - memset(ipx_MyAddress+0,0,4); - memcpy(ipx_MyAddress+4,qhbuf,6); - baseport+=(short)ntohs(*(unsigned short *)(qhbuf+4)); - - if (!s || (s && !*s)) addiflist(); - else { - if (*s=='+') addiflist(); - s++; - for (;;) { -struct sockaddr_in *sin; - while (isspace(*s)) s++; - if (!*s) break; - for (s2=s;*s2 && *s2!=',';s2++); - chk(ns=malloc(s2-s+1)); - memcpy(ns,s,s2-s); - ns[s2-s]='\0'; - if (!queryhost(ns)) msg("Ignored broadcast-destination \"%s\" as being invalid",ns); - free(ns); - chkbroadsize(); - sin=broads+(broadnum++); - sin->sin_family=AF_INET; - memcpy(&sin->sin_addr,qhbuf+0,4); - sin->sin_port=htons(((short)ntohs(*(unsigned short *)(qhbuf+4)))+UDP_BASEPORT); - s=s2+(*s2==','); - } - } - - unifyiflist(); - - printf(MSGHDR "Using TCP/IP address "); - dumpraddr(ipx_MyAddress+4); - putchar('\n'); - if (broadnum) { - printf(MSGHDR "Using %u broadcast-dest%s:",broadnum,(broadnum==1?"":"s")); - for (i=0;ifd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP)) < 0) { - sk->fd = -1; - FAIL("socket() creation failed on port %d: %m",port); - } - if (setsockopt(sk->fd, SOL_SOCKET, SO_BROADCAST, (char *)&val_one, sizeof(val_one))) { - if (closesocket(sk->fd)) msg("closesocket() failed during error recovery: %m"); - sk->fd=-1; - FAIL("setsockopt(SO_BROADCAST) failed: %m"); - } - sin.sin_family=AF_INET; - sin.sin_addr.s_addr=htonl(INADDR_ANY); - sin.sin_port=htons(baseport); - if (bind(sk->fd,(struct sockaddr *)&sin,sizeof(sin))) { - if (closesocket(sk->fd)) msg("closesocket() failed during error recovery: %m"); - sk->fd=-1; - FAIL("bind() to UDP port %d failed: %m",baseport); - } - - open_sockets++; - sk->socket = port; - return 0; -} - -/* The same comment as in previous "ipx_udp_OpenSocket"... - */ - -static void ipx_udp_CloseSocket(ipx_socket_t *mysock) { - if (!open_sockets) { - msg("close w/o open"); - return; - } - msg("CloseSocket on D1X socket port %d",mysock->socket); - if (closesocket(mysock->fd)) - msg("closesocket() failed on CloseSocket D1X socket port %d: %m",mysock->socket); - mysock->fd=-1; - if (--open_sockets) { - msg("(closesocket) %d sockets left", open_sockets); - return; - } -} - -/* Here we'll send the packet to our host. If it is unicast packet, send - * it to IP address/port as retrieved from IPX address. Otherwise (broadcast) - * we'll repeat the same data to each host in our broadcasting list. - */ - -static int ipx_udp_SendPacket(ipx_socket_t *mysock, IPXPacket_t *IPXHeader, - u_char *data, int dataLen) { - struct sockaddr_in toaddr,*dest; - int i=dataLen; - int bcast; - char *buf; - -#ifdef UDPDEBUG - msg("SendPacket enter, dataLen=%d",dataLen); -#endif - if (dataLen<0 || dataLen>MAX_PACKETSIZE) return -1; - chk(buf=alloca(8+dataLen)); - if (compatibility) memcpy(buf+0,D1Xudp,6),buf+=6; - else memcpy(buf+0,D1Xid ,2),buf+=2; - memcpy(buf+0,IPXHeader->Destination.Socket,2); - memcpy(buf+2,data,dataLen); - - toaddr.sin_family=AF_INET; - memcpy(&toaddr.sin_addr,IPXHeader->Destination.Node+0,4); - toaddr.sin_port=htons(((short)ntohs(*(unsigned short *)(IPXHeader->Destination.Node+4)))+UDP_BASEPORT); - - for (bcast=(toaddr.sin_addr.s_addr==htonl(INADDR_BROADCAST)?0:-1);bcast=0) dest=broads+bcast; - else dest=&toaddr; - -#ifdef UDPDEBUG - printf(MSGHDR "sendto((%d),Node=[4] %02X %02X,Socket=%02X %02X,s_port=%u,", - dataLen, - IPXHeader->Destination.Node [4],IPXHeader->Destination.Node [5], - IPXHeader->Destination.Socket[0],IPXHeader->Destination.Socket[1], - ntohs(dest->sin_port)); - dumpaddr(dest); - puts(")."); -#endif - i=sendto(mysock->fd,buf-(compatibility?6:2),(compatibility?8:4)+dataLen, - 0,(struct sockaddr *)dest,sizeof(*dest)); - if (bcast==-1) return (i<8?-1:i-8); - } - return(dataLen); -} - -/* Here we will receive new packet to the given buffer. Both formats of packets - * are supported, we fallback to old format when first obsolete packet is seen. - * If the (valid) packet is received from unknown host, we will add it to our - * broadcasting list. FIXME: For now such autoconfigured hosts are NEVER removed. - */ - -static int ipx_udp_ReceivePacket(ipx_socket_t *s, char *outbuf, int outbufsize, - struct ipx_recv_data *rd) { - int size; - struct sockaddr_in fromaddr; - int fromaddrsize=sizeof(fromaddr); - unsigned short ports; - size_t offs; - int i; - - if ((size=recvfrom(s->fd,outbuf,outbufsize,0,(struct sockaddr *)&fromaddr,&fromaddrsize))<0) - return -1; -#ifdef UDPDEBUG - printf(MSGHDR "recvfrom((%d-8=%d),",size,size-8); - dumpaddr(&fromaddr); - puts(")."); -#endif - if (fromaddr.sin_family!=AF_INET) return -1; - if (size<4) return -1; - if (memcmp(outbuf+0,D1Xid,2)) { - if (size<8 || memcmp(outbuf+0,D1Xudp,6)) return -1; - if (!compatibility) { - compatibility=1; - fputs(MSGHDR "Received obsolete packet from ",stdout); - dumpaddr(&fromaddr); - puts(", upgrade that machine.\n" MSGHDR "Turning on compatibility mode..."); - } - offs=6; - } - else offs=2; - - /* Lace: (dst_socket & src_socket) should be network-byte-order by comment in include/ipx_drv.h */ - /* This behaviour presented here is broken. It is not used anywhere, so why bother? */ - rd->src_socket = ntohs(*(unsigned short *)(outbuf+offs)); - if (rd->src_socket != s->socket) { -#ifdef UDPDEBUG - msg(" - pkt was dropped (dst=%d,my=%d)",rd->src_socket,s->socket); -#endif - return -1; - } - rd->dst_socket = s->socket; - - // check if we already have sender of this packet in broadcast list - for (i=0;i=masksnum) { - if (addreq(fromaddr,broads[i])) break; - } - else { - if (fromaddr.sin_port==broads[i].sin_port - &&( fromaddr.sin_addr.s_addr & broadmasks[i].sin_addr.s_addr) - ==(broads[i].sin_addr.s_addr & broadmasks[i].sin_addr.s_addr)) break; - } - } - if (i>=broadnum) { // we don't have sender of this packet in our broadcast list - chkbroadsize(); - broads[broadnum++]=fromaddr; - fputs(MSGHDR "Adding host ",stdout); - dumpaddr(&fromaddr); - puts(" to broadcasting address list"); - } - - memmove(outbuf,outbuf+offs+2,size-(offs+2)); - size-=offs+2; - - memcpy(rd->src_node+0,&fromaddr.sin_addr,4); - ports=htons(ntohs(fromaddr.sin_port)-UDP_BASEPORT); - memcpy(rd->src_node+4,&ports,2); - memset(rd->src_network, 0, 4); - rd->pkt_type = 0; -#ifdef UDPDEBUG - printf(MSGHDR "ReceivePacket: size=%d,from=",size); - dumpraddr(rd->src_node); - putchar('\n'); -#endif - - return size; -} - -struct ipx_driver ipx_udp = { - ipx_udp_GetMyAddress, - ipx_udp_OpenSocket, - ipx_udp_CloseSocket, - ipx_udp_SendPacket, - ipx_udp_ReceivePacket, - ipx_general_PacketReady, - NULL, // InitNetgameAuxData - NULL, // HandleNetgameAuxData - NULL, // HandleLeaveGame - NULL // SendGamePacke -}; diff --git a/arch/win32/oldinclude/ipx_mcast4.h b/arch/win32/oldinclude/ipx_mcast4.h deleted file mode 100644 index 7901a4de..00000000 --- a/arch/win32/oldinclude/ipx_mcast4.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * - * FIXME: add description - * - */ - -#ifndef _IPX_MCAST4_H -#define _IPX_MCAST4_H -#include "ipx_drv.h" - -extern struct ipx_driver ipx_mcast4; -#define IPX_MCAST4_VERSION 0 - -#endif diff --git a/arch/win32/oldinclude/ipx_udp.h b/arch/win32/oldinclude/ipx_udp.h deleted file mode 100644 index 0335bcdb..00000000 --- a/arch/win32/oldinclude/ipx_udp.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * - * FIXME: add description - * - */ - -#ifndef _IPX_UDP_H -#define _IPX_UDP_H -#include "ipx_drv.h" - -extern struct ipx_driver ipx_udp; - -#endif diff --git a/d2x.xcodeproj/project.pbxproj b/d2x.xcodeproj/project.pbxproj index 32269378..910b8910 100644 --- a/d2x.xcodeproj/project.pbxproj +++ b/d2x.xcodeproj/project.pbxproj @@ -781,9 +781,6 @@ 146695D31A2729860070D41D /* winmain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = winmain.h; sourceTree = ""; }; 146695D41A2729860070D41D /* wsipx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wsipx.h; sourceTree = ""; }; 146695D51A2729860070D41D /* init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = ""; }; - 146695D61A2729860070D41D /* ipx_drv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ipx_drv.h; sourceTree = ""; }; - 146695D71A2729860070D41D /* ipx_mcast4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ipx_mcast4.c; sourceTree = ""; }; - 146695D81A2729860070D41D /* ipx_udp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ipx_udp.c; sourceTree = ""; }; 146695D91A2729860070D41D /* ipx_win.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ipx_win.c; sourceTree = ""; }; 146695DB1A2729860070D41D /* joyhh.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = joyhh.c; sourceTree = ""; }; 146695DC1A2729860070D41D /* key.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = key.c; sourceTree = ""; }; @@ -1613,9 +1610,6 @@ 146695C31A2729860070D41D /* vid.c */, 146695C51A2729860070D41D /* include */, 146695D51A2729860070D41D /* init.c */, - 146695D61A2729860070D41D /* ipx_drv.h */, - 146695D71A2729860070D41D /* ipx_mcast4.c */, - 146695D81A2729860070D41D /* ipx_udp.c */, 146695D91A2729860070D41D /* ipx_win.c */, 146695DB1A2729860070D41D /* joyhh.c */, 146695DC1A2729860070D41D /* key.c */, -- 2.39.2