multicast cleanup

This commit is contained in:
jdl
2026-06-12 14:08:41 +02:00
parent 991fcffa68
commit 6856727985
5 changed files with 27 additions and 176 deletions

View File

@@ -11,6 +11,7 @@ import (
"vppn/m"
"vppn/peer/control"
"vppn/peer/multicast"
"vppn/peer/wginterface"
)
@@ -27,12 +28,6 @@ type PingEvent struct {
ping control.Ping
}
// MulticastEvent carries a raw signed beacon for verification in the event loop.
type MulticastEvent struct {
signed []byte // nacl/sign signed beacon (64-byte sig || 35-byte payload)
src netip.Addr // physical LAN source address
}
// App is the peer application. All mutable state lives here and is
// accessed only from the Run goroutine.
type App struct {
@@ -58,11 +53,14 @@ type App struct {
selfV4 netip.AddrPort
selfV6 netip.AddrPort
// Reusable scratch for multicast signature verification (event loop only).
mcVerifyBuf []byte
// Event channels fed by background goroutines
hubAddCh <-chan m.Peer
hubRemoveCh <-chan wgtypes.Key
pingCh <-chan PingEvent
multicastCh <-chan MulticastEvent
multicastCh <-chan multicast.Packet
}
// Run is the main event loop. It runs until SIGTERM/SIGINT.