netconf

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package netconf handles the network configuration of the router as described by the topology.

Multiple interfaces can share the same local addresses, so this package supplies support for determining the local address for a given interface, and for determining a list of interfaces for a given local address. (Local address is defined as an address internal to the local AS.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface struct {
	// Id is the interface ID. It is unique per AS.
	Id common.IFIDType
	// IFAddr contains both the bind address and the public address of the
	// interface. Normally these are the same, but for example in the case of
	// NAT, the bind address may differ from the address visible from outside
	// the AS.
	IFAddr *topology.TopoBRAddr
	// RemoteAddr is the public address of the border router on the other end
	// of the link.
	RemoteAddr *overlay.OverlayAddr
	// RemoteIA is the ISD-AS of the other end of the link.
	RemoteIA addr.IA
	// BW is the bandwidth of the link.
	BW int
	// MTU is the maximum packet size allowed on the link, in bytes.
	MTU int
	// Type describes the type of link, in terms of relationship between this
	// AS and the remote AS.
	Type proto.LinkType
}

Interface describes the configuration of a router interface.

type NetConf

type NetConf struct {
	// LocAddr is the local data-plane addresses from the topology.
	LocAddr *topology.TopoBRAddr
	// CtrlAddr is the local control-plane addresses from the topology.
	CtrlAddr *topology.TopoAddr
	// IFs maps interface IDs to Interfaces.
	IFs map[common.IFIDType]*Interface
	// IFAddrMap maps external public address strings to interface IDs.
	IFAddrMap map[string]common.IFIDType
}

NetConf contains the local addresses, interface config, and some maps for accessing these by different methods.

func FromTopo

func FromTopo(intfs []common.IFIDType, infomap map[common.IFIDType]topology.IFInfo) (
	*NetConf, error)

FromTopo creates a NetConf instance from the topology.

Jump to

Keyboard shortcuts

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