feat(relay): add Ethernet forwarding decisions

Add socket-free relay forwarding logic for Ethernet datagrams. The future QUIC
relay loop can now ask the room registry which peer IDs should receive a frame
instead of embedding switching policy in network IO code.

Forwarding validates that the ingress peer belongs to the room, drops malformed
Ethernet frames, rejects client frames whose source MAC does not match the MAC
announced during admission, never reflects frames back to ingress, routes known
client unicasts directly, and floods broadcast/multicast or unknown unicast
frames to the other room peers. The decision reports shared observability action
and drop-reason values so the networking layer can log consistently.

This still does not send bytes over QUIC; it only defines the room-local switch
decision that the datagram loop will use.

Test Plan:
- cargo fmt --check
- cargo test --workspace
- cargo clippy --workspace --all-targets -- -D warnings

Refs: PLAN.md Switching model
This commit is contained in:
2026-05-21 17:28:17 +02:00
parent 879cb689a4
commit b3d1a9c046
4 changed files with 250 additions and 1 deletions
+2
View File
@@ -5,4 +5,6 @@ edition.workspace = true
[dependencies]
lanparty-ctrl = { path = "../lanparty-ctrl" }
lanparty-obs = { path = "../lanparty-obs" }
lanparty-proto = { path = "../lanparty-proto" }
thiserror.workspace = true