brconf

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package brconf holds all of the global router state, for access by the router's various packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BR

type BR struct {
	// RollbackFailAction indicates the action that should be taken
	// if the rollback fails.
	RollbackFailAction FailAction `toml:"rollback_fail_action,omitempty"`
}

BR contains the border router specific parts of the configuration.

func (*BR) ConfigName

func (cfg *BR) ConfigName() string

func (*BR) InitDefaults

func (cfg *BR) InitDefaults()

func (*BR) Sample

func (cfg *BR) Sample(dst io.Writer, path config.Path, _ config.CtxMap)

func (*BR) Validate

func (cfg *BR) Validate() error

type BRConf

type BRConf struct {
	// Topo contains the names of all local infrastructure elements, a map
	// of interface IDs to routers, and the actual topology.
	Topo topology.Topology
	// IA is the current ISD-AS.
	IA addr.IA
	// BR is the topology information of this router.
	BR *topology.BRInfo
	// MasterKeys holds the local AS master keys.
	MasterKeys keyconf.Master
	// Dir is the configuration directory.
	Dir string
}

BRConf is the main config structure. It contains the dynamic configuration at runtime.

func Load

func Load(id, confDir string) (*BRConf, error)

Load sets up the configuration, loading it from the supplied config directory.

func WithNewTopo

func WithNewTopo(id string, topo topology.Topology, oldConf *BRConf) (*BRConf, error)

WithNewTopo creates config that shares all content except fields related to topology with the oldConf.

type Config

type Config struct {
	General  env.General  `toml:"general,omitempty"`
	Features env.Features `toml:"features,omitempty"`
	Logging  log.Config   `toml:"log,omitempty"`
	Metrics  env.Metrics  `toml:"metrics,omitempty"`
	BR       BR           `toml:"br,omitempty"`
}

Config is the border router configuration that is loaded from file.

func (*Config) ConfigName

func (cfg *Config) ConfigName() string

func (*Config) InitDefaults

func (cfg *Config) InitDefaults()

func (*Config) Sample

func (cfg *Config) Sample(dst io.Writer, path config.Path, _ config.CtxMap)

func (*Config) Validate

func (cfg *Config) Validate() error

type FailAction

type FailAction string
const (
	// FailActionFatal indicates that the process exits on error.
	FailActionFatal FailAction = "fatal"
	// FailActionContinue indicates that the process continues on error.
	FailActionContinue FailAction = "continue"
)

func (*FailAction) UnmarshalText

func (f *FailAction) UnmarshalText(text []byte) error

func (*FailAction) Validate

func (f *FailAction) Validate() error

type SockConf

type SockConf struct {
	Default       SockType
	LocalType     SockType
	ExternalTypes map[common.IFIDType]SockType
}

func (SockConf) Ext

func (s SockConf) Ext(ifid common.IFIDType) SockType

func (SockConf) Loc

func (s SockConf) Loc() SockType

type SockType

type SockType string

Jump to

Keyboard shortcuts

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