base

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEventListener

func AddEventListener(listenerName string, cbs EventCallbacks)

func NetworkChanged

func NetworkChanged(params NetworkChangedParams)

func PollReqHdlr

func PollReqHdlr()

func RemoteHealthChanged

func RemoteHealthChanged(params RemoteHealthChangedParams)

func RemoveEventListener

func RemoveEventListener(listenerName string)

func SigChanged

func SigChanged(params SigChangedParams)

Types

type EventCallbacks

type EventCallbacks struct {
	// NetworkChanged is called when a remote network was added or removed from the configuration.
	NetworkChanged NetworkChangedCb
	// SigChanged is called when a remote SIG is was added or removed from the configuration.
	// TODO(shitz): This event does not get generated yet.
	SigChanged SigChangedCb
	// RemoteHealthChanged is called when the reachability status of a remote AS changed.
	RemoteHealthChanged RemoteHealthChangedCb
}

EventCallbacks can be used by a listener to register for certain events by setting the corresponding function pointer in the struct. Note, that the callback MUST NOT BLOCK. Long running or potentially blocking operations should be executed in a separate go-routine.

type NetworkChangedCb

type NetworkChangedCb func(NetworkChangedParams)

type NetworkChangedParams

type NetworkChangedParams struct {
	// RemoteIA is the remote IA for which network information changed.
	RemoteIA addr.IA
	// IpNet contains the network prefix that was added/removed.
	IpNet net.IPNet
	// Healthy is true if the remote IA can be reached.
	Healthy bool
	// Added is true if the prefix was added, false otherwise.
	Added bool
}

NetworkChangedParams contains the parameters that are passed along with a NetworkChanged event.

type RemoteHealthChangedCb

type RemoteHealthChangedCb func(RemoteHealthChangedParams)

type RemoteHealthChangedParams

type RemoteHealthChangedParams struct {
	// RemoteIA is the IA for which the reachability status changed.
	RemoteIA addr.IA
	// Nets contains all network prefixes the remote IA announced.
	Nets []*net.IPNet
	// Healthy is true if the remote IA is reachable, false otherwise.
	Healthy bool
}

RemoteHealthChangedParams contains the parameters that are passed along with a RemoteHealthChanged event.

type SigChangedCb

type SigChangedCb func(SigChangedParams)

type SigChangedParams

type SigChangedParams struct {
	// RemoteIA is the IA for which SIG information changed.
	RemoteIA addr.IA
	// Id is the id of the SIG.
	Id siginfo.SigIdType
	// Host is the host address of the SIG.
	Host addr.HostAddr
	// CtrlPort is the port on which the SIG accepts control traffic.
	CtrlPort int
	// EncapPort is the port on which the SIG accepts encapsulated SIG-SIG frames.
	EncapPort int
	// Static is true, if this SIG was statically configured and false if it was discovered
	// dynamically.
	Static bool
	// Added is true if the SIG was added, false otherwise.
	Added bool
}

SigChangedParams contains the parameters that are passed along with a SigChanged event.

type SingleSession

type SingleSession struct {
	Session egress.Session
}

SingleSession implements egress.SessionSelector, returning the contained session on ChooseSess.

func (*SingleSession) ChooseSess

func (ss *SingleSession) ChooseSess(b common.RawBytes) egress.Session

Directories

Path Synopsis
Package core contains the tables for remote SIGs, ASes and their prefixes
Package core contains the tables for remote SIGs, ASes and their prefixes

Jump to

Keyboard shortcuts

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