mirror of
https://github.com/go-gost/x.git
synced 2026-10-20 08:18:33 +00:00
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.
14 lines
457 B
Go
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
|
|
}
|