1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

366 Commits

Author SHA1 Message Date
Daniel Collins
7017d4cf94 Create missing directory under .d/ 2017-09-12 17:48:33 +01:00
Daniel Collins
7ea305fe95 Clean up warnings about comparisons of distinct pointer types. 2017-09-12 17:44:07 +01:00
Daniel Collins
bdf829766f Tidy up Makefile and rework build dependency generation. 2017-09-12 17:43:12 +01:00
Daniel Collins
ea2e61ea32 Merge remote-tracking branch 'origin/llc-support' 2017-09-12 13:45:47 +01:00
Daniel Collins
ba7fa5a77f Allow sending Novell/LLC frames up to the maximum size. 2017-08-20 22:59:49 +01:00
Daniel Collins
b58ef3eb1e getsockopt: Return correct maxpkt when using Ethernet frame types. 2017-08-20 16:44:49 +01:00
Daniel Collins
1304e84d54 Merge remote-tracking branch 'origin/master' into llc-support 2017-08-19 19:16:06 +01:00
Daniel Collins
8c55242b10 Added support for win10pcap format interface names. 2017-08-06 14:57:08 +01:00
Daniel Collins
d9133fd8dd Compile with -mno-ms-bitfields
As of GCC 4.7, the default behaviour when targetting Windows is for
packed structures to use Microsoft's broken struct packing rules.
2017-08-05 10:36:08 +01:00
Daniel Collins
79e286259f Added -static-libgcc to DLL link commands.
Newer GCCs seem to pull in libgcc when building ipxwrapper.dll
2017-08-02 22:55:19 +01:00
Daniel Collins
df41665cb2 Fiddle with sleeps in DirectPlay tests.
Some asynchronous calls didn't have pauses after them, likely to fail
when running on a heavily loaded machine.
2017-06-20 02:05:54 +01:00
Daniel Collins
4cdca80c4b Don't do any cleanup in DllMain() during process termination.
Subtle crashes are fun. I found this to cause a deadlock, but only
after adding lots of extra debug logging to diagnose a DIFFERENT bug
and only when running it on a particular machine.

But once both of those criteria are met? It crashes pretty reliably.
2017-06-18 03:12:13 +01:00
Daniel Collins
9d76f3ef00 Extended end-to-end test suite to cover LLC encapsulation. 2017-03-29 22:19:31 +01:00
Daniel Collins
bc778d9f3b Implemented support for 802.2 LLC framing. 2017-03-29 22:00:47 +01:00
Daniel Collins
323341fc0c Initialise source MAC when serialising Ethernet frames. 2017-03-29 20:35:38 +01:00
Daniel Collins
659641d436 Added unit tests for Ethernet frame (de)serialising functions. 2017-03-29 20:34:32 +01:00
Daniel Collins
b7b4a953d8 Refactored Ethernet frame (de)serialisation.
Reworked the (de)serialising of Ethernet frames into seperate functions in
preparation for supporting IEEE 802.2 LLC frames.
2017-03-28 23:29:38 +01:00
Daniel Collins
d65fb92480 Extended test suite to cover Novell "raw" Ethernet frames. 2017-03-28 00:27:11 +01:00
Daniel Collins
273bfcbbb5 Added frame type selection to ipxconfig. 2017-03-27 23:51:54 +01:00
Daniel Collins
20a636b933 Implemented support for Novell "raw" Ethernet frames.
Manual selection of frame type (defaults to Ethernet II) only, don't want to
mess with trying to guess/detect the frame type right now.
2017-03-27 23:51:54 +01:00
Daniel Collins
d7c9e10349 Implement quick 'n dirty script to generate charts from benchmarks 2015-12-15 22:54:57 +00:00
Daniel Collins
67acb100a3 Implement crude benchmarking tools
These tools can be used to measure RTT, packet loss, and sendto()/recv() call
duration on one end with a specified minimum delay between sendto() calls to
emulate some different loads.
2015-12-15 22:22:06 +00:00
Daniel Collins
1e8f89f655 Add DirectPlay test suite code to source manifest.
Missed in previous commit.
2015-12-02 00:07:26 +00:00
Daniel Collins
e5085ba1d9 Implemented basic DirectPlay test suite. 2015-11-26 00:10:49 +00:00
Daniel Collins
91c39a769f Update readme/changelog. 2015-08-23 19:36:31 +01:00
Daniel Collins
0e3713f26f DirectPlay: Increase API_HEADER_SIZE.
We don't need any memory reserved for writing out packet headers, but
DirectPlay seems to corrupt itself internally and do funky things if this goes
below a certain threshold. Value taken from the DX5 service provider.
2015-08-21 22:58:55 +01:00
Daniel Collins
c6b505fee9 DirectPlay: Move initialisation of discovery socket.
Initialise the discovery socket when SP_CreatePlayer() is called with the
CREATEPLAYER_NS flag and do nothing in SP_Open, as per the DX5 implementation.

This will correctly handle the name server moving between nodes in a session.
2015-08-21 22:58:55 +01:00
Daniel Collins
dbfdae63d2 DirectPlay: Move initialisation/destruction of main socket.
Initialise the socket when SP_Open or SP_EnumSessions is called and close it
when SP_CloseEx is called, per the DX5 implementation.
2015-08-21 22:58:55 +01:00
Daniel Collins
8ded8da35a DirectPlay: Refactor worker loop.
Hold the lock while reading to ensure the socket isn't closed during the
recvfrom() call, allow either socket to be closed and close either socket if
the recvfrom() call fails.
2015-08-21 22:58:55 +01:00
Daniel Collins
a89948c2f9 DirectPlay: Remove addr field from sp_data structure.
Resolve the address of the main socket at each use rather than holding a copy
in the sp_data structure, one less thing to become desync'd.
2015-08-21 22:58:51 +01:00
Daniel Collins
95e492f653 DirectPlay: Remove already-initialised check in SPInit()
I have no idea why I implemented this check in the first place, the Microsoft
implementation doesn't do it and I think it might cause problems.
2015-08-21 22:36:13 +01:00
Daniel Collins
a0b4abd53e DirectPlay: Initialise sp_data on stack.
SetSPData() takes a copy of the given data, so there is no need to allocate it
on the heap ourselves.
2015-08-21 22:35:03 +01:00
Daniel Collins
59a9f090d5 DirectPlay: Improve SP_Reply() diagnostics 2015-08-21 22:32:02 +01:00
Daniel Collins
384542defe DirectPlay: Store addresses in shared player data.
When there are more than two players in a session (including the host), the
message that triggers SP_CreatePlayer() may not be from the host that actually
has that player on it, copy the behaviour of the DX5 SP and make each player be
responsible for sharing their own address via the shared data.
2015-08-21 22:32:02 +01:00
Daniel Collins
a108ae80b5 DirectPlay: Remove SP_SendEx() and clean up SP_Send()
Implementing this method isn't mandatory and the Microsoft implementation
doesn't provide it. It doesn't appear to get used either, so ditching it to
reduce the number of things that can go wrong.

WIP: SP_Send cleanup
2015-08-21 22:09:10 +01:00
Daniel Collins
d582e27e3e Added missing initialisations of ipx_socket.addr.sa_family.
Field not used internally, but returned by getsockname() which can lead to
whatever we're wrapping trying to use an invalid family later.
2015-07-11 17:00:10 +01:00
Daniel Collins
3b99400f4a Updated changelog and readme 2014-10-11 20:23:37 +01:00
Daniel Collins
bc02824a8e Updated source manifest. 2014-10-04 18:46:56 +01:00
Daniel Collins
a808c52d3a Wrote some notes for developers. 2014-10-04 18:22:03 +01:00
Daniel Collins
5ff0855485 Replace test suite.
Dump most of the old "unit" tests which were more system tests and only tested
a small amount of functionality against the host.

The new test suite is a lot more thorough and tests an arbitrary Windows version
over the network rather than testing within the host's WinSock environment.

More documentation detailing how to run this will follow.
2014-10-04 14:46:11 +01:00
Daniel Collins
dcd484702e Build with newer toolchain.
Various fixups to build under win-builds.org toolchain rather than MinGW. No
longer builds under MinGW as I have removed headers/definitions that it lacks.
2014-06-26 13:22:10 +01:00
Daniel Collins
d9a82081da Fix use of sockets in address cache. 2014-06-19 19:42:09 +01:00
Daniel Collins
043ce1495e Refactor address conflict detection.
Detect multiple sockets bound to the same address within a session by creating
a named mutex. Multiple handles to a mutex may exist and closing the last one
destroys it.
2014-06-19 19:42:09 +01:00
Daniel Collins
3c13aab8e5 Accept IPX packets with a destination network of 00:00:00:00.
Unless configured otherwise, the Windows IPX driver defaults to misusing this on
the wire until it sees a packet with a different network number, at which point
it switches to using that until reboot.
2014-05-29 23:35:25 +01:00
Daniel Collins
098cb76ff4 Fix dropping of broadcast packets in some situations.
...by which I mean make it drop the packets depending on the socket options of
the receiving socket.
2014-05-29 23:32:24 +01:00
Daniel Collins
4694ce8850 Use correct WinPcap timeout value.
A timeout of zero is infinite, so was blocking for traffic on interfaces that
didn't have any in the router main loop.
2014-04-20 17:26:23 +01:00
Daniel Collins
ecda2ba0a4 Fix testing of source address in UDP-encapsulated unicast packets. 2014-04-20 17:26:23 +01:00
Daniel Collins
79d41c0001 Don't open unnecessary UDP sockets when using Ethernet encapsulation.
Don't need the shared UDP socket at all and the private is only used for sending
packets to the local emulated sockets.
2014-04-20 17:24:51 +01:00
Daniel Collins
5d9a3cb143 Allocate the UDP socket recv buffer on the stack.
Default (per-thread) stack limit on Windows is 1MB, this buffer may shrink in
the future but will never grow.
2014-04-20 14:05:21 +01:00
Daniel Collins
7c19414c37 Use appropriate MTU for packet size limits. 2014-04-18 14:45:11 +01:00