This repository was archived by the owner on Sep 6, 2022. It is now read-only.
Commit 8157087 1 parent bcf3ad5 commit 8157087 Copy full SHA for 8157087
File tree 2 files changed +26
-16
lines changed
2 files changed +26
-16
lines changed Original file line number Diff line number Diff line change 1
1
package event
2
2
3
- // EvtLocalRoutabilityPrivate is an event struct to be emitted with the local's
4
- // node routability changes to PRIVATE (i.e. not routable from the Internet).
5
- //
6
- // This event is usually emitted by the AutoNAT subsystem.
7
- type EvtLocalRoutabilityPrivate struct {}
8
-
9
- // EvtLocalRoutabilityPublic is an event struct to be emitted with the local's
10
- // node routability changes to PUBLIC (i.e. appear to routable from the
11
- // Internet).
12
- //
13
- // This event is usually emitted by the AutoNAT subsystem.
14
- type EvtLocalRoutabilityPublic struct {}
3
+ import (
4
+ "github.com/libp2p/go-libp2p-core/network"
5
+ )
15
6
16
- // EvtLocalRoutabilityUnknown is an event struct to be emitted with the local's
17
- // node routability changes to UNKNOWN (i.e. we were unable to make a
18
- // determination about our NAT status with enough confidence).
7
+ // EvtLocalRoutability is an event struct to be emitted with the local's node
8
+ // routability changes state.
19
9
//
20
10
// This event is usually emitted by the AutoNAT subsystem.
21
- type EvtLocalRoutabilityUnknown struct {}
11
+ type EvtLocalRoutability struct {
12
+ Routability network.Routability
13
+ }
Original file line number Diff line number Diff line change @@ -53,6 +53,24 @@ const (
53
53
CannotConnect
54
54
)
55
55
56
+ // Routability indicates how reachable a node is.
57
+ type Routability int
58
+
59
+ const (
60
+ // RoutabilityUnknown indicates that the routability status is unknown.
61
+ RoutabilityUnknown = iota
62
+
63
+ // RoutabilityPublic indicates that the node is reachable from the
64
+ // public internet.
65
+ RoutabilityPublic
66
+
67
+ // RoutabilityPrivate indicates that the node is not reachable from the
68
+ // public internet.
69
+ //
70
+ // NOTE: This node may _still_ be reachable via relays.
71
+ RoutabilityPrivate
72
+ )
73
+
56
74
// Stat stores metadata pertaining to a given Stream/Conn.
57
75
type Stat struct {
58
76
Direction Direction
You can’t perform that action at this time.
0 commit comments