forked from libp2p/go-libp2p
/
nattype.go
18 lines (16 loc) · 1 KB
/
nattype.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package event
import "github.com/zbliujia/go-libp2p/core/network"
// EvtNATDeviceTypeChanged is an event struct to be emitted when the type of the NAT device changes for a Transport Protocol.
//
// Note: This event is meaningful ONLY if the AutoNAT Reachability is Private.
// Consumers of this event should ALSO consume the `EvtLocalReachabilityChanged` event and interpret
// this event ONLY if the Reachability on the `EvtLocalReachabilityChanged` is Private.
type EvtNATDeviceTypeChanged struct {
// TransportProtocol is the Transport Protocol for which the NAT Device Type has been determined.
TransportProtocol network.NATTransportProtocol
// NatDeviceType indicates the type of the NAT Device for the Transport Protocol.
// Currently, it can be either a `Cone NAT` or a `Symmetric NAT`. Please see the detailed documentation
// on `network.NATDeviceType` enumerations for a better understanding of what these types mean and
// how they impact Connectivity and Hole Punching.
NatDeviceType network.NATDeviceType
}