This repository was archived by the owner on Sep 6, 2022. It is now read-only.
File tree 2 files changed +22
-22
lines changed
2 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -2,35 +2,14 @@ package event
2
2
3
3
import "github.com/libp2p/go-libp2p-core/network"
4
4
5
- // NATTransportProtocol is the transport protocol for which the NAT Device Type has been determined.
6
- type NATTransportProtocol int
7
-
8
- const (
9
- // NATTransportUDP means that the NAT Device Type has been determined for the UDP Protocol.
10
- NATTransportUDP NATTransportProtocol = iota
11
- // NATTransportTCP means that the NAT Device Type has been determined for the TCP Protocol.
12
- NATTransportTCP
13
- )
14
-
15
- func (n NATTransportProtocol ) String () string {
16
- switch n {
17
- case 0 :
18
- return "UDP"
19
- case 1 :
20
- return "TCP"
21
- default :
22
- return "unrecognized"
23
- }
24
- }
25
-
26
5
// EvtNATDeviceTypeChanged is an event struct to be emitted when the type of the NAT device changes for a Transport Protocol.
27
6
//
28
7
// Note: This event is meaningful ONLY if the AutoNAT Reachability is Private.
29
8
// Consumers of this event should ALSO consume the `EvtLocalReachabilityChanged` event and interpret
30
9
// this event ONLY if the Reachability on the `EvtLocalReachabilityChanged` is Private.
31
10
type EvtNATDeviceTypeChanged struct {
32
11
// TransportProtocol is the Transport Protocol for which the NAT Device Type has been determined.
33
- TransportProtocol NATTransportProtocol
12
+ TransportProtocol network. NATTransportProtocol
34
13
// NatDeviceType indicates the type of the NAT Device for the Transport Protocol.
35
14
// Currently, it can be either a `Cone NAT` or a `Symmetric NAT`. Please see the detailed documentation
36
15
// on `network.NATDeviceType` enumerations for a better understanding of what these types mean and
Original file line number Diff line number Diff line change @@ -35,3 +35,24 @@ func (r NATDeviceType) String() string {
35
35
return "unrecognized"
36
36
}
37
37
}
38
+
39
+ // NATTransportProtocol is the transport protocol for which the NAT Device Type has been determined.
40
+ type NATTransportProtocol int
41
+
42
+ const (
43
+ // NATTransportUDP means that the NAT Device Type has been determined for the UDP Protocol.
44
+ NATTransportUDP NATTransportProtocol = iota
45
+ // NATTransportTCP means that the NAT Device Type has been determined for the TCP Protocol.
46
+ NATTransportTCP
47
+ )
48
+
49
+ func (n NATTransportProtocol ) String () string {
50
+ switch n {
51
+ case 0 :
52
+ return "UDP"
53
+ case 1 :
54
+ return "TCP"
55
+ default :
56
+ return "unrecognized"
57
+ }
58
+ }
You can’t perform that action at this time.
0 commit comments