Files
mars_nwe_pcab/WINDOWS.md

104 lines
10 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MARS 0.6 Preview – Windows IPXPKT clients (x86)
**Development preview, not a Windows-tested release.** No compiled Windows driver or EXE is supplied. The portable client protocol, the server DHCP interoperability and the frame ring have passed Linux tests. Neither the Windows SDK/DDK nor historical Windows installations were available. Kernel code may fail to build or load and can crash the OS. Use isolated VMs with snapshots first.
## Architecture
Windows TCP/IP -> virtual Ethernet adapter -> MARS Win32 bridge -> Winsock AF_IPX -> physical NIC -> MARS IPXPKT / TAP / DHCP / NAT. mTCP is not needed for Windows. The bridge transports IPv4 and ARP only. The existing Linux service remains `mars_vme.service`; no additional daemon. DOS mTCP remains unchanged. The bridge must stay running on the Windows client.
| OS | Native NDIS level | Implementation in this package |
|---|---|---|
| Windows 95 / OSR2 | 3.1 / 4.0 | Experimental Win32 bridge with external VirtNet and compatible WinpkFilter |
| Windows 98 / SE | 4.1 / 5.0 | Same external compatibility bridge |
| Windows ME | 5.0 | Same bridge; no real-mode DOS required |
| Windows NT 4.0 | 4.0 / 4.1 SP3 | Same bridge, NT-specific external driver installation |
| Windows 2000 | 5.0 | Own experimental NDIS5 miniport source + bridge; external alternatives |
| Windows XP 32-bit | 5.1 | Same NDIS5.0 miniport source + bridge; external alternatives |
The native 9x VxD and NT4 control/miniport implementations are NOT present. NDIS5 control-device APIs are not a drop-in substitute. The external bridge is not verified on any target. XP x64 is out of scope. References: [Microsoft NDIS versions](https://learn.microsoft.com/en-us/windows-hardware/drivers/network/ndis-versions-in-windows), [VirtNet](https://www.ntkernel.com/virtnet/), [WinpkFilter](https://www.ntkernel.com/windows-packet-filter/). VirtNet is freeware for private/educational use per vendor; check license for any business deployment. Obtain the historical drivers, version-matched SDK and DLL legally from the vendor; no external binaries are redistributed here. Current releases may not support the old systems.
## 1. Linux server
Upgrade the 0.5.1 server (preserves nwserv and existing settings):
```sh
make all native check check-gateway check-gateway-auto check-winclient
sudo ./install-gateway.sh
sudo systemctl start mars_vme.service
```
Enable gateway in the Web UI, auto-detect network, save and apply. Choose the actual IPX network of the clients. The virtual /24, public DNS, device approval, fixed DHCP reservations and host firewall behavior are the same as 0.5.1. Verify `/run/mars-pcap/gateway`, `ip addr show marsipx0` and `sysctl net.ipv4.ip_forward`. No changes to the global forwarding setting are automatic.
## 2. Build Windows programs
Use a licensed x86 Visual C++ 6 build environment (NT command shell) and period SDK containing `winsock.h`, `wsipx.h`, `wsnwlink.h`, `wsock32.lib`. Run from `clients\windows`:
```bat
build-vc6.bat native
build-vc6.bat filter C:\LEGACYSDK\include
build-vc6.bat tap
```
These are alternative build targets. Native -> MARSIPX.EXE (2000/XP). Filter -> MARSNET.EXE (legacy targets, external WinpkFilter Common.h SDK required). TAP -> MARSTAP.EXE (2000/XP, requires separate compatible historical TAP-Win32 driver). No need to build all three. The filter DLL must match the driver and SDK and be supplied separately in the same local directory as MARSNET.EXE.
Native driver: in a Windows 2000 DDK x86 build environment, change directory to `clients\windows\ndis5`, run `build -cZ`, locate MARSNDIS.SYS in the target object directory. Copy it with MARSNDIS.INF and MARSIPX.EXE into a staging directory. The provided INF is experimental and unsigned. Build scripts and Windows code have not been tested against actual SDK/DDK; API/INF fixes may be required. No signed drivers are supplied. Old DDKs are not included.
## 3. Central distribution
Install jq on Linux. When the desired IPX network is present in dispatcher state, publish either config only, or locally compiled files:
```sh
sudo apt install jq
sudo mars-publish-winclient /path/to/trusted/build-output
# OR, for configuration export only (no drivers or executable files):
sudo mars-publish-winclient --config-only
```
The publisher reads `nwserv.conf`, `ipxpkt.json` and `/run/mars-pcap/ipx_interface`; it creates GATEWAY.INI for each OS with the selected external network, gateway node, IP and socket 6181. Requires root-owned SYS and PUBLIC not writable by group/others. Six subfolders: WIN95, WIN98, WINME, WINNT40, WIN2000, WINXP. The native SYS/INF/EXE trio is copied only to 2000/XP. Existing CLIENTS directories are never overwritten. Back up and move aside the previous directory before republishing (including after network/gateway changes). No automatic update of already copied local INIs. The publisher checks basic file signatures, not authenticity; use only trusted builds. Keep original licenses and source offers with any distributed software; verify NetWare read/file-scan trustees and deny writes. Do not automatically execute driver installers from a NetWare login script.
NetWare login script for intended users:
```text
IF MEMBER OF "INTERNET_USERS" THEN
MAP ROOT T:=SYS:PUBLIC\CLIENTS
END
```
Copy the appropriate directory to `C:\MARSNET` locally, rather than loading kernel drivers or depending on a live network drive. The Web UI includes a new Gateway -> Windows-Clientsoftware modal with the publication instructions and clear preview status. It is not a remote installer.
## 4. Windows 2000/XP: experimental own miniport
1. Install IPX/SPX (NWLink or a compatible Winsock IPX provider) on the physical NIC. Check physical node and IPX network with `MARSIPX.EXE --ipx`. IPX frame type must match server. Providers differ; explicit binding may fail. Do not change the NetWare working settings unnecessarily.
2. Add new hardware manually, network adapter, Have Disk, choose MARSNDIS.INF; use snapshots and admin rights. The INF needs matching SYS beside it. Set advanced `Physical IPX Node` (12 hex digits, exactly the physical node, NOT the server node). Only one MARS miniport per OS is supported. The bridge refuses mismatches.
3. Configure the virtual adapter for automatic IPv4/DNS; unbind IPX, file/printer sharing, Client for Microsoft Networks and NetWare from virtual adapter where applicable. Bind IPX to physical NIC; unbind TCP/IP from it if only IPX should travel over the wire. Disable NetBIOS over TCP/IP on the virtual adapter where possible. Keep the NetWare client on physical IPX. Reboot if required.
4. Open administrator command prompt in local C:\MARSNET. Example physical node (replace with actual):
```bat
MARSIPX.EXE --ipx
MARSIPX.EXE --discover 020102030405 GATEWAY.INI
MARSIPX.EXE --run MARS 020102030405 GATEWAY.INI --confirm-virtual
```
Discover only sends an ARP probe; the Linux UI must actually show the device. Approve device, reserve IP, save and apply server changes. The run command must stay active; use another command prompt for `ipconfig /all`, DHCP renewal (`ipconfig /renew`, specify virtual adapter if needed), and test external DNS/HTTP/ping if allowed. Gateway itself does not answer ICMP from clients by policy. Windows 2000/XP does not need MTCP.CFG. The native control device is restricted to an administrator with SeLoadDriverPrivilege. If link doesn't come up, do not use production systems; inspect DDK build/driver status and bridge output.
## 5. Windows 95/98/ME/NT4: external compatibility path
Install vendor's historical VirtNet virtual adapter and matching legacy WinpkFilter driver for the OS, following vendor installation instructions (NT4 uses its legacy networking installer; Win9x/ME uses its own INF and may reboot). Use only trusted packages, verify licenses. Configure virtual MAC to equal physical IPX node, TCP/IP with DHCP bound only to the virtual adapter, IPX only on physical NIC. No mTCP or real-mode packet driver is required for this architecture. Copy matching SDK's ndisapi.dll to local executable directory. Use:
```bat
MARSNET.EXE --ipx
MARSNET.EXE --list
MARSNET.EXE --discover 020102030405 GATEWAY.INI
MARSNET.EXE --run "EXACT_VIRTUAL_ADAPTER_NAME" 020102030405 GATEWAY.INI --confirm-virtual
```
Do NOT select a physical adapter. Filter mode intercepts all selected adapter traffic. Check adapter description, MAC, and internal name. The bridge refuses non-Ethernet or an already configured filter mode. After approval and saving on Linux, use `winipcfg` on Win9x/ME or `ipconfig` on NT4 to renew virtual DHCP; external drivers and provider may not support these exact operations. Stop with Ctrl-C to restore mode; if process crashes, reset filter mode/reboot in VM. NT4/Win9x native replacement still requires development of OS-specific kernel control and install path.
## 6. Optional historical TAP-Win32 path (2000/XP)
Install a trusted, licensed TAP-Win32 driver specifically compatible with the target. Use the driver-supported MAC override (may be named MAC instead of NetworkAddress), equal physical node. Bind native TCP/IP to TAP only. Run `MARSTAP.EXE --run "{ADAPTER-GUID}" 020102030405 GATEWAY.INI --confirm-virtual`. The executable opens the old TAP device interface; exact compatibility is not verified. Reference: https://github.com/OpenVPN/tap-windows . No TAP binaries included.
## 7. Validation and security
Linux: `make check-winclient` checks both ports, reassembly, source validation and real server DHCP OFFER/ACK through the client codec plus bounded NDIS frame queue. `sudo ./tests/test_publish_winclient.sh` tests publisher with temporary fixtures. Linux C89 build and sanitizer checks have passed. A real Windows build, driver install, NDIS binding, virtual DHCP, physical packet trace (only IPX, no native IPv4), reconnect and unload tests are still required for each target. Also test DOS regression. Native miniport has no completed power/PnP/Driver Verifier qualification. The existing server TAP/NAT still needs real end-to-end tests. IPXPKT is unencrypted, MAC ACLs are spoofable, and obsolete Windows/TLS must be isolated from productive networks. Do not expose old clients directly to inbound internet traffic. Existing Linux policy permits configured services only; HTTPS transport does not make old browsers compatible with modern websites.