bird

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 11 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"
)

Variables

This section is empty.

Functions

func NewProtocolMap

func NewProtocolMap() protocolMap

func NewRoutingConfig

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 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

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

func NewRoutingService

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

func (*RoutingService) CheckCli

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

CheckCli - Checks if birdc is available

func (*RoutingService) CliCmd

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

CliCmd - Executes birdc commands

func (*RoutingService) Configure

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

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

LookupCli - Looks up birdc path

func (*RoutingService) Run

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

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) ShowProtocolSessions

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

ShowProtocolSessions - Retrieves detailed routing protocol information via birdc

func (*RoutingService) ShutDown

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

ShutDown - Shuts BIRD down via birdc

func (*RoutingService) Verify

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