Files
ginuerzh c2c78f3279 feat(tun): install prefix routes into the p2p handler
A hub that decides which peer LANs exist is handed this handler as a
handler.Handler, so the table has to be reachable by shape: the route type
is exported and the p2p handler takes the same call the socket one does,
installing into the peerTable its packet path already reads.
2026-10-09 11:01:04 +00:00

14 lines
457 B
Go

package tun
// PrefixRoute is a LAN route the hub holds: the member that reaches the
// prefix, and the members allowed to use it (empty = everyone).
//
// It is exported because the hub that installs these routes lives in another
// module: the tun p2p handler is handed to it as a handler.Handler, so it
// names the map it passes by this type. Nothing else in x or outside it
// constructs one.
type PrefixRoute struct {
Peer string
Allow []string
}