config

package
v0.0.0-...-fe0d423 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Our ASN
	LocalAS uint32 `yaml:"local_as"`

	// RouterID is the BGP router identifier of our server
	RouterID string `yaml:"router_id"`

	// Filters to match incoming (via API) routes against
	Filters []*RouteFilter `yaml:"route_filters"`

	// Sessions to BGP peers
	Sessions []*Session `yaml:"sessions"`

	Debug bool `yaml:"debug"`
}

Config respresents the server configuration

func Load

func Load(r io.Reader) (*Config, error)

Load loads a configuration from a reader

type RouteFilter

type RouteFilter struct {
	// Net is the network address to match for
	Net string

	// Length is the prefix length
	Length uint8

	// Prefix length has to be larger or equal `Min`
	Min uint8

	// Prefix length has to be less or equal `Max`
	Max uint8
}

RouteFilter defines all parameters needed to decide wether to accept or to drop a route for a prefix

type Session

type Session struct {
	// Name of session
	Name string `yaml:"name"`

	// ASN of the peer
	RemoteAS uint32 `yaml:"remote_as"`

	// Local IP address
	LocalIP string `yaml:"local_ip"`

	// IP of the peer
	PeerIP string `yaml:"peer_ip"`

	// Passive defines if bioject should initiate a connection or wait to be connected
	Passive bool `yaml:"passive,omitempty"`

	// MultiProtocol defines if IPv4 routes should be advertised using MP NLRIs
	AdvertiseIPv4MultiProtocol bool `yaml:"multiprotocol_ipv4"`
}

Session defines all parameters needed to establish a BGP session with a peer

Jump to

Keyboard shortcuts

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