/* * VWE fork: NE2000 backend that tunnels guest Ethernet frames over Steam * (`backend=steam`), so a private group can fly missions over the internet. * * Why L2 and not an ordinary L3 tunnel: the 1995 mesh (WATTCP + netnub + * L4NetworkManager) dials peers by raw IP on one flat subnet and ARPs for * them, so whole FRAMES have to cross the internet for the DOS binaries to * see the same-switch world they were built for. * * All of the transport lives in vwesteam:: (steamlink.h) and is shared * VERBATIM with the host's steam<->pcap gateway; this class is only the * EthernetConnection adapter -- config resolution, the receive-side * acceptance policy, and the log lines. Steamworks is bound at runtime in * there, exactly as the pcap backend binds WPCAP.DLL, so a build on a machine * with no SDK still runs and just fails Initialize() with a readable reason. * * Only REMOTE players run this. The session host's pod stays on * backend=pcap and reaches the tunnel through the gateway, which is what * keeps exactly one process per machine on ISteamNetworkingMessages. * * Conf: [ne2000] backend=steam, macaddr= * [ethernet, steam] peers= lobby= session= channel= * Contracts: ../steam/SESSION-CONTRACT.md (session file, env, addressing). */ #ifndef DOSBOX_ETHERNET_STEAM_H #define DOSBOX_ETHERNET_STEAM_H #include "config.h" #ifdef WIN32 #include "ethernet.h" #include /** A Steam-P2P Ethernet connection * Carries raw Ethernet frames to the other pods in the session over * SteamNetworkingMessages instead of over a host NIC. Needs Steam running, * a stable [ne2000] macaddr, and a peer roster (session file, csv or lobby). */ class SteamEthernetConnection : public EthernetConnection { public: SteamEthernetConnection(); ~SteamEthernetConnection(); bool Initialize(Section* config) override; void SendPacket(const uint8_t* packet, int len) override; void GetPackets(std::function callback) override; private: uint8_t mac[6] = {}; /*!< [ne2000] macaddr; the RX filter's "ether dst self" */ bool up = false; /*!< Init() took -- gates the refcounted Shutdown() */ }; #endif #endif