How zzdragon-158/taplan2 works
TapLan creates a virtual IPv4 LAN over direct IPv6-reachable links, with Windows and Linux support. The main workflow parses settings, initializes a TAP device and UDP transport, then moves Ethernet frames between the TAP interface and remote peers. In server/client mode, NodeMgr uses TCP synchronization to allocate client addresses and distribute peer state; in --nosync mode, traffic goes directly to the configured peer. Optional asynchronous I/O changes the I/O implementation, while port cycling can vary UDP source ports. The graph reflects the README and sampled source; some runtime wiring is inferred only where those sources explicitly document it.
Main entry points: TapLan.cpp LAN coordinator · main.cpp CLI and runtime · NodeMgr.cpp Node registry · BsdSock.cpp UDP transport
Components 13
Application
- CLI and runtime
src/main.cpp - Runtime config
src/Config.cpp - LAN coordinator
src/TapLan.cpp
Peer Networking
- Node registry
src/NodeMgr.cpp - TCP sync socket
src/BsdSock.cpp - UDP transport
src/BsdSock.cpp - Peer and address state
src/NodeMgr.cpp
Packet I/O
- Linux I/O
src/UioIntfLinux.cpp - Windows I/O
src/UioIntfWin.cpp
Platform Services
- Virtual TAP device
src/TapDevLinux.cpp - Logging
src/LogMgr.cpp
Other components
- Operator
- Remote TapLan peers
Connections 22
- Operator → CLI and runtime: starts
- CLI and runtime → Runtime config: parses options
- CLI and runtime → Logging: starts logging
- CLI and runtime → LAN coordinator: starts runtime
- LAN coordinator → Runtime config: reads settings
- LAN coordinator → Virtual TAP device: opens device
- LAN coordinator → UDP transport: creates sockets
- LAN coordinator → Node registry: starts sync
- Node registry → TCP sync socket: connects and listens
- Node registry → Remote TapLan peers: syncs node state
- Node registry → Peer and address state: updates
- LAN coordinator → Peer and address state: reads peer routes
- Virtual TAP device → Linux I/O: supplies frames
- Linux I/O → LAN coordinator: delivers frames
- LAN coordinator → Linux I/O: requests I/O
- LAN coordinator → Windows I/O: requests I/O
- Windows I/O → Virtual TAP device: reads and writes
- LAN coordinator → UDP transport: sends and receives
- UDP transport → Remote TapLan peers: exchanges frames
- Remote TapLan peers → UDP transport: returns frames
- LAN coordinator → Logging: reports status
- CLI and runtime → Node registry: shows node status