bird

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoProtocolsLog     string = "No protocols match"
	ReconfigInProgress string = "Reconfiguration in progress"
	Reconfigured       string = "Reconfigured"
	ConfigurationOk    string = "Configuration OK"
)
View Source
const (
	BGP    string = "BGP"
	STATIC string = "Static"
)
View Source
const (
	BGPTemplateIPv4 string = "LINK4" // name of BGP template for IPv4 to generate
	BGPTemplateIPv6 string = "LINK6" // name of BGP template for IPv6 to generate
)
View Source
const (
	LogFilePath       string = "/var/log/bird.log"                                            // file to write BIRD logs to
	BackupLogFilePath string = "/var/log/bird.log.backup"                                     // backup log file; when current log file reaches the limit, it's renamed to the backup filename
	LogClasses        string = "debug, trace, info, remote, warning, error, auth, fatal, bug" // list of log classes for which BIRD messages are logged
)

Variables

This section is empty.

Functions

func NewProtocolMap

func NewProtocolMap() protocolMap

func NewRoutingConfig added in v0.9.0

func NewRoutingConfig(path string) *routingConfig

func ParseProtocols

func ParseProtocols(input string, out *string, f func(name string, options ...Option))

ParseProtocols - Parses output of 'birdc show protocols all' to pass details of a protocol session to the provided func pointer (while also writing relevant information to out log string)

func ParseRouteCount added in v1.0.12

func ParseRouteCount(input string) (uint64, error)

func ProtocolDown

func ProtocolDown(p *Protocol) bool

ProtocolDown - Determines if protocol is down

Types

type Option

type Option func(o *protoOptions)

Option is an option pattern for NewProtocol

func WithBfd

func WithBfd(use bool) Option

WithBfd sets bfd indicating the protocol uses bfd

func WithBfdSessions

func WithBfdSessions(bfd string) Option

WithBfdSessions sets known bfd sessions

func WithInfo

func WithInfo(info string) Option

WithInfo sets protocol info (e.g. Established)

func WithInterface

func WithInterface(itf string) Option

WithInterface sets protocol interface (e.g. ext-vlan)

func WithName

func WithName(name string) Option

WithProtocolName sets protocol name

func WithNeighbor

func WithNeighbor(ip string) Option

WithNeighbor sets protocol neighbor (e.g. 169.254.100.254)

func WithOutLog

func WithOutLog(log *string) Option

WithOutLog sets out log

func WithProto

func WithProto(proto string) Option

WithProtocolName sets protocol type (e.g. BGP, Static)

func WithState

func WithState(state string) Option

WithState sets protocol state (e.g. up)

type Protocol

type Protocol struct {
	// contains filtered or unexported fields
}

func NewProtocol

func NewProtocol(options ...Option) *Protocol

func (*Protocol) Bfd

func (p *Protocol) Bfd() bool

func (*Protocol) BfdSessions

func (p *Protocol) BfdSessions() string

func (*Protocol) Info

func (p *Protocol) Info() string

func (*Protocol) Interface

func (p *Protocol) Interface() string

func (*Protocol) Log

func (p *Protocol) Log(out string)

func (*Protocol) Name

func (p *Protocol) Name() string

func (*Protocol) Neighbor

func (p *Protocol) Neighbor() string

func (*Protocol) Proto

func (p *Protocol) Proto() string

func (*Protocol) State

func (p *Protocol) State() string

type RoutingService added in v0.9.0

type RoutingService struct {
	// contains filtered or unexported fields
}

func NewRoutingService added in v0.9.0

func NewRoutingService(ctx context.Context, commSocket string, configFile string) *RoutingService

func (*RoutingService) CheckCli added in v0.9.0

func (b *RoutingService) CheckCli(ctx context.Context, lp string) error

CheckCli - Checks if birdc is available

func (*RoutingService) CliCmd added in v0.9.0

func (b *RoutingService) CliCmd(ctx context.Context, lp string, arg ...string) (string, error)

CliCmd - Executes birdc commands

func (*RoutingService) Configure added in v0.9.0

func (b *RoutingService) Configure(ctx context.Context, lp string) (string, error)

Configure - Orders BIRD via birdc to (try and) apply the config

func (*RoutingService) LookupCli added in v0.9.0

func (b *RoutingService) LookupCli() (string, error)

LookupCli - Looks up birdc path

func (*RoutingService) Run added in v0.9.0

func (b *RoutingService) Run(ctx context.Context, monitorLogs bool) error

Run - Starts BIRD process with the config file (blocks) Based on monitorLogs settings stderr of the started BIRD process can be monitored, in order to append important log snippets to the container's log

func (*RoutingService) ShowBfdSessions added in v0.9.0

func (b *RoutingService) ShowBfdSessions(ctx context.Context, lp, name string) (string, error)

ShowProtocolSessions - Retrieves information on the available BFD sessions (for the given BFD protocol name if any)

func (*RoutingService) ShowMemory added in v1.0.12

func (b *RoutingService) ShowMemory(ctx context.Context, lp string) (string, error)

ShowMemory - Retrieves memory usage information

func (*RoutingService) ShowProtocolSessions added in v0.9.0

func (b *RoutingService) ShowProtocolSessions(ctx context.Context, lp, pattern string) (string, error)

ShowProtocolSessions - Retrieves detailed routing protocol information via birdc

func (*RoutingService) ShowRouteCount added in v1.0.12

func (b *RoutingService) ShowRouteCount(ctx context.Context, lp string) (string, error)

ShowRouteCount - Retrieves number of routes from default BIRD routing tables (master4, master6) Note: using filters significantly increases CPU usage

func (*RoutingService) ShutDown added in v0.9.0

func (b *RoutingService) ShutDown(ctx context.Context, lp string) error

ShutDown - Shuts BIRD down via birdc

func (*RoutingService) Verify added in v0.9.0

func (b *RoutingService) Verify(ctx context.Context, lp string) (string, error)

Verify - Verifies content of config file via birdc

Jump to

Keyboard shortcuts

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