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

289 Commits

Author SHA1 Message Date
Daniel Collins
ce8d9be9ca Stream logs back to test script in 30-ip-ipx.t 2024-11-03 12:39:09 +00:00
Daniel Collins
e844ac5154 Fix log message interleaving on Windows 98. 2024-11-03 12:38:34 +00:00
Daniel Collins
b1ac06e3dd Optimise logging.
WriteFile() seems to be pretty slow on Windows 98 and merging
the separate calls is a noticable speedup.
2024-11-03 12:38:34 +00:00
Daniel Collins
623d2c3df4 Work around some bugs on Windows 98
- Call CreateThread() with non-NULL lpThreadId pointers.

- Ignore InitializeCriticalSectionAndSpinCount() return values.

- Skip log file locking when unimplemented.

- Add missing wsock32.dll entry points.
2024-07-04 21:45:04 +01:00
Daniel Collins
26f6511dee Replace snprintf() implementation used within DLLs.
It appears that some of the mswsock.dll functions get called on
Windows 98 in a context where calling any of the printf functions
provided by the CRT causes subtle memory corruption which doesn't
manifest until the process exits, triggering a page fault in
KERNEL32.DLL and making the system unusable.

1990s Windows makes me miss the sophistication of 1970s UNIX.
2024-07-04 21:31:17 +01:00
Daniel Collins
379f3d6eb6 Fix recursion in WSHEnumProtocols() function. 2024-06-27 23:57:34 +01:00
Daniel Collins
f503415a30 Fix out-of-bounds array access. 2024-06-27 23:55:27 +01:00
Daniel Collins
6f468a2316 Load main configuration from ipxwrapper.ini (#15). 2024-06-25 12:05:06 +01:00
Daniel Collins
5062920b1d Allow disabling logging entirely (#18). 2024-06-18 00:06:07 +01:00
Daniel Collins
5e6430ea8b Add option to enable/disable packet coalescing. 2023-12-10 13:00:16 +00:00
Daniel Collins
0dd7f08993 Receive multiple packets in the same router loop iteration. 2023-12-10 13:00:16 +00:00
Daniel Collins
d50a12a186 Use FIONREAD ioctl to check for available data in recv_pump()
This is a bit faster than using select()
2023-12-10 13:00:16 +00:00
Daniel Collins
2a3bbd06c4 Collect more profiling stats. 2023-12-10 13:00:16 +00:00
Daniel Collins
b9d25e54d3 Record more profiling data. 2023-12-10 13:00:16 +00:00
Daniel Collins
c16b73bce4 Initial packet coalescing prototype.
This introduces "packet coalescing" for the DOSBox transport - when an
application is sending an absurd number of tiny IPX packets in rapid
succession we try to batch them up into a container packet to be sent
through the DOSBox server.

This will hopefully improve how certain games behave when using the
DOSBox transport option, but will break compatibility with anything not
specifically supporting this special message framing.
2023-12-10 13:00:16 +00:00
Daniel Collins
822b307dec Record more profiling info. 2023-11-21 20:18:19 +00:00
Daniel Collins
53bfadc0e5 Add option to enable/disable profiling. 2023-11-19 21:49:52 +00:00
Daniel Collins
09b235024d Reinstate stub function logging hooks. 2023-11-19 21:12:06 +00:00
Daniel Collins
30c7556ef1 Merge branch 'master' into profiling 2023-11-19 16:00:50 +00:00
Daniel Collins
55b9793123 Log socket() and ioctlsocket() at the correct level. 2023-11-19 15:46:31 +00:00
Daniel Collins
e4dc937e44 Merge branch 'master' into profiling 2023-10-18 23:12:12 +01:00
Daniel Collins
e9c45b8ac5 Fix select(), add some tests. 2023-10-18 20:24:05 +01:00
Daniel Collins
15b53ae001 Fix handling of FIONREAD socket ioctl.
When there are no packets waiting, ioctlsocket() should return success
and set *argp to zero.

When there are multiple packets waiting, ioctlsocket() should set *argp
to the accumulated size of all received payloads.

As far as I can tell, there's no way to inspect beyond the first packet
queued on a socket, so we must receive and queue all packets from the
socket to be able to know how much is available.

The recv pipeline has been reworked to queue packets in this manner,
and select() will try to emulate the normal behaviour we previously got
for free by passing the socket fd straight through in readfds.

I don't *think* WSAAsyncSelect() needs any changes since the socket
will still raise window messages as appropriate before we have any
opportunity to shunt the packet into the receive queue.
2023-10-17 17:38:13 +01:00
Daniel Collins
056ec4b115 Split interface.[ch] into two files to fix ipxconfig link error. 2023-09-14 00:30:03 +01:00
Daniel Collins
435df05496 Support DOSBox servers using DNS names. 2023-09-13 00:24:08 +01:00
Daniel Collins
ad1023b376 Fix potential blocking of the router thread when waiting for ready. 2023-09-10 08:47:48 +01:00
Daniel Collins
8db4fb0872 Retransmit DOSBox registration request until a response is received. 2023-09-09 10:12:54 +01:00
Daniel Collins
36693ee9e0 Block certain calls momentarily when connecting to a DOSBox server.
Normally calls like bind() will immediately succeed or fail depending
on what address was requested and what addresses are assigned to the
machine, but when using a DOSBox IPX server we don't know our address
until it gets assigned to us, so block functions impacted by that to
avoid spurious errors when starting up.

If the server is down or slow then the calls will fail after a few
seconds rather than hanging indefinitely.
2023-09-05 22:43:10 +01:00
Daniel Collins
c72ef8a83a Use correct packet size limit for DOSBox encapsulation. 2023-09-05 18:21:52 +01:00
Daniel Collins
dde08ae3a9 Fix local packet delivery when using DOSBox encapsulation. 2023-09-05 18:21:52 +01:00
Daniel Collins
b987f7abc1 Fix test suite build issues. 2023-09-02 15:07:28 +01:00
Daniel Collins
46fc990971 Fix registration with DOSBox IPX server. 2023-09-02 15:04:21 +01:00
Daniel Collins
ff14b520cc Remove DOSBox net/node number settings.
The local address is assigned by the server when using a DOSBox
IPX server.
2021-08-21 22:09:17 +01:00
Daniel Collins
a0234c7459 Initial implementation of DOSBox encapsulation support.
Incomplete and completely untested at this point, beyond "it compiles".
2021-08-21 14:42:49 +01:00
Daniel Collins
0bee989d8a Fix memory leak. 2021-08-21 12:10:23 +01:00
Daniel Collins
5c65628fca Add options for DOSBox encapsulation to ipxconfig.
Been sitting on this for a while, the code to actually support
interacting with a DOSBox IPX server isn't done yet.
2021-08-19 22:28:22 +01:00
Daniel Collins
704bce5baf Add profiling for some ipxwrapper.dll functions. 2021-01-20 20:51:16 +00:00
Daniel Collins
e686e8dbe2 Implement RAII-y mechanism for profiling functions. 2021-01-20 20:48:37 +00:00
Daniel Collins
18419bb096 Fix crash in ipxconfig 2019-08-24 20:51:33 +01:00
Daniel Collins
904b60d21b Log function profiling statistics every 10 seconds. 2019-08-24 16:06:41 +01:00
Daniel Collins
7e6280b560 Record times taken within stub functions
Reporting not done yet.

Call logging broken (for now).
2019-08-23 20:25:14 +01:00
Daniel Collins
fe21cbb973 Add unit tests for address cache. 2017-09-20 00:19:58 +01:00
Daniel Collins
7ea305fe95 Clean up warnings about comparisons of distinct pointer types. 2017-09-12 17:44:07 +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
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
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