simulator

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Distance

type Distance struct {
	Real         int64
	ObservedTree int64
	ObservedSNEK int64
}

type Node

type Node struct {
	*router.Router

	ListenAddr *net.TCPAddr
	// contains filtered or unexported fields
}

type Simulator

type Simulator struct {
	// contains filtered or unexported fields
}

func NewSimulator

func NewSimulator(log *log.Logger, sockets, ping bool) *Simulator

func (*Simulator) CalculateShortestPaths

func (sim *Simulator) CalculateShortestPaths(nodes map[string]struct{}, wires map[string]map[string]bool)

func (*Simulator) ConnectNodes

func (sim *Simulator) ConnectNodes(a, b string) error

func (*Simulator) CreateNode

func (sim *Simulator) CreateNode(t string) error

func (*Simulator) DisconnectNodes

func (sim *Simulator) DisconnectNodes(a, b string) error

func (*Simulator) Distances

func (sim *Simulator) Distances() map[string]map[string]*Distance

func (*Simulator) LookupCoords

func (sim *Simulator) LookupCoords(target string) (types.Coordinates, error)

func (*Simulator) LookupNodeID

func (sim *Simulator) LookupNodeID(target types.Coordinates) (string, error)

func (*Simulator) LookupPublicKey

func (sim *Simulator) LookupPublicKey(target types.PublicKey) (string, error)

func (*Simulator) Node

func (sim *Simulator) Node(t string) *Node

func (*Simulator) Nodes

func (sim *Simulator) Nodes() map[string]*Node

func (*Simulator) PingSNEK added in v0.4.0

func (sim *Simulator) PingSNEK(from, to string) (uint16, time.Duration, error)

func (*Simulator) PingTree added in v0.4.0

func (sim *Simulator) PingTree(from, to string) (uint16, time.Duration, error)

func (*Simulator) PingingEnabled added in v0.4.0

func (sim *Simulator) PingingEnabled() bool
func (sim *Simulator) ReportDeadLink(source, target types.PublicKey)

func (*Simulator) ReportDistance

func (sim *Simulator) ReportDistance(a, b string, l int64, snek bool)
func (sim *Simulator) ReportNewLink(c net.Conn, source, target types.PublicKey)

func (*Simulator) SNEKPathConvergence added in v0.2.0

func (sim *Simulator) SNEKPathConvergence() map[string]map[string]bool

func (*Simulator) TreePathConvergence added in v0.2.0

func (sim *Simulator) TreePathConvergence() map[string]map[string]bool

func (*Simulator) Uptime added in v0.4.0

func (sim *Simulator) Uptime() time.Duration

func (*Simulator) Wires

func (sim *Simulator) Wires() map[string]map[string]net.Conn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL