81ad7abe84cad2e1e3215e7b2cfe37c19f42652b
Add explicit room leave semantics for future relay connection tasks. Disconnect handling will need to remove peers from room membership without reaching into the room internals or leaving stale MAC indexes behind. Leaving a client now removes both its peer entry and MAC mapping so the same MAC can rejoin later. Leaving a gateway clears gateway occupancy while preserving any remaining clients. If the last peer leaves, the room is removed from the registry. The result reports which peer left and whether the room was removed so the networking layer can emit lifecycle events cleanly. Test Plan: - cargo fmt --check - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings Refs: PLAN.md relay disconnect reason and reconnect handling groundwork
softlan-vpn
Monorepo for a Layer 2 over QUIC LAN party bridge.
Workspace crates
lanparty-proto: shared frame format, MAC validation, MTU helpers.lanparty-ctrl: control-plane messages (join/hello/role/version).lanparty-obs: shared diagnostics/logging event models.lanparty-client-core: platform-agnostic client session state.lanparty-client-win: Windows TAP + route/metric handling binary.lanparty-gateway: Linux AF_PACKET gateway binary.lanparty-relay: public QUIC relay binary.
lanparty-proto
Transport-agnostic tunnel contract shared by all binaries:
- overlay datagram header encoding and decoding
- Ethernet frame header parsing
- MAC address parsing and identity validation
- QUIC datagram to TAP MTU budget helpers
lanparty-ctrl
Reliable control-plane schema shared by the QUIC stream handlers:
- endpoint hello messages with role, room, MAC, and datagram budget
- server welcome, reject, peer lifecycle, stats, and disconnect messages
- room-code, role/MAC, peer-id, and effective-MTU validation
- length-prefixed JSON control frames for reliable QUIC streams
lanparty-obs
Shared diagnostics and structured logging vocabulary:
- gateway/relay frame logs with MACs, ethertype, length, peer, and action
- tunnel counters shared by control messages and runtime diagnostics
- client connectivity/TAP diagnostics and user-facing status messages
lanparty-relay
Public relay binary and relay-owned room state:
- room admission for clients and gateways
- one gateway per room, duplicate client MAC rejection, and room limits
- stable effective room MTU chosen before Ethernet datagrams flow
- Ethernet datagram forwarding decisions with no ingress reflection
- peer leave cleanup for room membership and MAC indexes
Build
cargo check --workspace
Relay
cargo run -p lanparty-relay -- --listen 443/udp
--listen accepts either a socket address or a UDP port shorthand such as
443/udp. The relay binds a QUIC endpoint and waits for shutdown, but
connection handling is not wired yet. It currently uses a generated self-signed
development certificate; production certificate and client trust handling remain
future work.
Description
A simple one-click Layer 2 tunnel software (Windows 11 client) to bridge people who cannot participate in person at a LAN party to the LAN party. And a simple server endpoint (Linux) software that runs physically at the LAN party and bridges the tunneled traffic and the real LAN network.
Languages
Rust
100%