bird

package
v0.0.0-...-265eb5a Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BfdSpec

type BfdSpec interface {
	// BFD monitoring.
	// Valid values are:
	// - false: no BFD monitoring;
	// - true: turns on the BFD monitoring.
	// When left empty, there is no BFD monitoring.
	GetSwitch() *bool

	// Min-tx timer of bfd session. Please refere to BFD material to understand what this implies.
	// The value must be a valid duration format. For example, 300ms, 90s, 1m, 1h.
	// The duration will be rounded by millisecond.
	GetMinTx() string

	// Min-rx timer of bfd session. Please refere to BFD material to understand what this implies.
	// The value must be a valid duration format. For example, 300ms, 90s, 1m, 1h.
	// The duration will be rounded by millisecond.
	GetMinRx() string

	// Multiplier of bfd session.
	// When this number of bfd packets failed to receive, bfd session will go down.
	GetMultiplier() *uint16
}

Bfd defines the parameters to configure the BFD session. The static gateways shares the same interface shall define the same bfd configuration.

type BgpSpec

type BgpSpec interface {
	// The ASN number of the Gateway Router
	GetRemoteASN() *uint32

	// The ASN number of the system where the Attractor FrontEnds locates
	GetLocalASN() *uint32

	// BFD monitoring of BGP session.
	GetBfdSpec() BfdSpec

	// Hold timer of the BGP session. Please refere to BGP material to understand what this implies.
	// The value must be a valid duration format. For example, 90s, 1m, 1h.
	// The duration will be rounded by second
	// Minimum duration is 3s.
	GetHoldTime() string

	// BGP listening port of the Gateway Router.
	GetRemotePort() *uint16

	// BGP listening port of the Attractor FrontEnds.
	GetLocalPort() *uint16
}

BgpSpec defines the parameters to set up a BGP session.

type Bird

type Bird struct {
	// SocketPath is the full path with filename to communicate with birdc
	SocketPath string
	// configuration file (with path)
	ConfigFile string
	// Add important bird log snippets to bird logs
	LogEnabled bool
	// Size of the file for the bird logs
	LogFileSize   int
	LogFile       string
	LogFileBackup string
	// contains filtered or unexported fields
}

Bird represents the bird configuration.

func New

func New() *Bird

New is the bird constructor.

func (*Bird) Configure

func (b *Bird) Configure(ctx context.Context, vips []string, gateways []Gateway) error

Configure writes the bird configuration file, sets the policy routes and configures bird if it is running.

func (*Bird) Run

func (b *Bird) Run(ctx context.Context) error

Run starts bird with the current bird configuration. Bird will be stopped when the context in parameter will be cancelled.

type Gateway

type Gateway interface {
	GetName() string

	// Address of the Gateway Router
	GetAddress() string

	// Interface used to access the Gateway Router
	GetInterface() string

	GetProtocol() v1alpha1.RoutingProtocol

	// Parameters to set up the BGP session to specified Address.
	// If the Protocol is static, this property must be empty.
	// If the Protocol is bgp, the minimal parameters to be defined in bgp properties
	// are RemoteASN and LocalASN
	GetBgpSpec() BgpSpec

	// Parameters to work with the static routing configured on the Gateway Router with specified Address.
	// If the Protocol is bgp, this property must be empty.
	GetStatic() StaticSpec
}

GatewaySpec defines the desired state of Gateway.

type StaticSpec

type StaticSpec interface {
	// BFD monitoring of Static session.
	GetBfdSpec() BfdSpec
}

StaticSpec defines the parameters to set up static routes.

Jump to

Keyboard shortcuts

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