Notify the InterHost when routes change
This commit is contained in:
1 parent
0f888e9735
commit
a9c710211b
4 files changed
+86
-13
No files matched your search
+9
-1
@@ -9,6 +9,10 @@ type InterHost interface {
|
||||
// Start consuming forwarded packets.
|
||||
ConsumePackets(*Peer, *Peers, InterHostConsumer) error
|
||||
|
||||
// The routes have changed, so any cached information should
|
||||
// be discarded.
|
||||
InvalidateRoutes()
|
||||
|
||||
// Form a packet-forwarding connection. The remote UDPAddr
|
||||
// can be nil if unknown (in which case the implementation
|
||||
// needs to discover it).
|
||||
@@ -53,10 +57,14 @@ type InterHostForwarderListener interface {
|
||||
|
||||
type NullInterHost struct{}
|
||||
|
||||
func (NullInterHost) ConsumePackets(*Peer, *Peers, InterHostConsumer) error {
|
||||
func (NullInterHost) ConsumeInterHostPackets(*Peer, *Peers,
|
||||
InterHostConsumer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (NullInterHost) InvalidateRoutes() {
|
||||
}
|
||||
|
||||
func (NullInterHost) MakeForwarder(*Peer, net.IP, *net.UDPAddr, uint64,
|
||||
InterHostCrypto, func([]byte) error) (InterHostForwarder, error) {
|
||||
return NullInterHost{}, nil
|
||||
|
||||
Reference in new issue
Block a user