multicast cleanup
This commit is contained in:
12
peer/app.go
12
peer/app.go
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user