simulator

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 12 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
	Observed 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) *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.SwitchPorts, error)

func (*Simulator) LookupNodeID

func (sim *Simulator) LookupNodeID(target types.SwitchPorts) (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) PathfindSNEK added in v0.2.0

func (sim *Simulator) PathfindSNEK(from, to string) error

func (*Simulator) PathfindTree added in v0.2.0

func (sim *Simulator) PathfindTree(from, to string) error
func (sim *Simulator) ReportDeadLink(source, target types.PublicKey)

func (*Simulator) ReportDistance

func (sim *Simulator) ReportDistance(a, b string, l int64)
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) 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