Unverified Commit d143201d authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #126 from libp2p/feat/single-routability-event

Switch to a single routability event
parents 2adfc211 e5f43bb5
package event
import (
"github.com/libp2p/go-libp2p-core/network"
)
// EvtLocalReachabilityChanged is an event struct to be emitted when the local's
// node reachability changes state.
//
// This event is usually emitted by the AutoNAT subsystem.
type EvtLocalReachabilityChanged struct {
Reachability network.Reachability
}
package event
// EvtLocalRoutabilityPrivate is an event struct to be emitted with the local's
// node routability changes to PRIVATE (i.e. not routable from the Internet).
//
// This event is usually emitted by the AutoNAT subsystem.
type EvtLocalRoutabilityPrivate struct{}
// EvtLocalRoutabilityPublic is an event struct to be emitted with the local's
// node routability changes to PUBLIC (i.e. appear to routable from the
// Internet).
//
// This event is usually emitted by the AutoNAT subsystem.
type EvtLocalRoutabilityPublic struct{}
// EvtLocalRoutabilityUnknown is an event struct to be emitted with the local's
// node routability changes to UNKNOWN (i.e. we were unable to make a
// determination about our NAT status with enough confidence).
//
// This event is usually emitted by the AutoNAT subsystem.
type EvtLocalRoutabilityUnknown struct{}
......@@ -53,6 +53,25 @@ const (
CannotConnect
)
// Reachability indicates how reachable a node is.
type Reachability int
const (
// ReachabilityUnknown indicates that the reachability status of the
// node is unknown.
ReachabilityUnknown = iota
// ReachabilityPublic indicates that the node is reachable from the
// public internet.
ReachabilityPublic
// ReachabilityPrivate indicates that the node is not reachable from the
// public internet.
//
// NOTE: This node may _still_ be reachable via relays.
ReachabilityPrivate
)
// Stat stores metadata pertaining to a given Stream/Conn.
type Stat struct {
Direction Direction
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment