base

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 11 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)

Types

type EventCallbacks

type EventCallbacks struct {
	// NetworkChanged is called when a remote network was added or removed from the configuration.
	NetworkChanged NetworkChangedCb
	// 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.

Jump to

Keyboard shortcuts

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