Documentation ¶
Index ¶
- Constants
- func NewProtocolMap() protocolMap
- func NewRoutingConfig(path string) *routingConfig
- func ParseProtocols(input string, out *string, f func(name string, options ...Option))
- func ParseRouteCount(input string) (uint64, error)
- func ProtocolDown(p *Protocol) bool
- type Option
- func WithBfd(use bool) Option
- func WithBfdSessions(bfd string) Option
- func WithInfo(info string) Option
- func WithInterface(itf string) Option
- func WithName(name string) Option
- func WithNeighbor(ip string) Option
- func WithOutLog(log *string) Option
- func WithProto(proto string) Option
- func WithState(state string) Option
- type Protocol
- func (p *Protocol) Bfd() bool
- func (p *Protocol) BfdSessions() string
- func (p *Protocol) Info() string
- func (p *Protocol) Interface() string
- func (p *Protocol) Log(out string)
- func (p *Protocol) Name() string
- func (p *Protocol) Neighbor() string
- func (p *Protocol) Proto() string
- func (p *Protocol) State() string
- type RoutingService
- func (b *RoutingService) CheckCli(ctx context.Context, lp string) error
- func (b *RoutingService) CliCmd(ctx context.Context, lp string, arg ...string) (string, error)
- func (b *RoutingService) Configure(ctx context.Context, lp string) (string, error)
- func (b *RoutingService) LookupCli() (string, error)
- func (b *RoutingService) Run(ctx context.Context, monitorLogs bool) error
- func (b *RoutingService) ShowBfdSessions(ctx context.Context, lp, name string) (string, error)
- func (b *RoutingService) ShowMemory(ctx context.Context, lp string) (string, error)
- func (b *RoutingService) ShowProtocolSessions(ctx context.Context, lp, pattern string) (string, error)
- func (b *RoutingService) ShowRouteCount(ctx context.Context, lp string) (string, error)
- func (b *RoutingService) ShutDown(ctx context.Context, lp string) error
- func (b *RoutingService) Verify(ctx context.Context, lp string) (string, error)
Constants ¶
const ( NoProtocolsLog string = "No protocols match" ReconfigInProgress string = "Reconfiguration in progress" Reconfigured string = "Reconfigured" ConfigurationOk string = "Configuration OK" )
const ( BGP string = "BGP" STATIC string = "Static" )
const ( BGPTemplateIPv4 string = "LINK4" // name of BGP template for IPv4 to generate BGPTemplateIPv6 string = "LINK6" // name of BGP template for IPv6 to generate )
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 ¶
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 ProtocolDown ¶
ProtocolDown - Determines if protocol is down
Types ¶
type Option ¶
type Option func(o *protoOptions)
Option is an option pattern for NewProtocol
func WithBfdSessions ¶
WithBfdSessions sets known bfd sessions
func WithInterface ¶
WithInterface sets protocol interface (e.g. ext-vlan)
func WithNeighbor ¶
WithNeighbor sets protocol neighbor (e.g. 169.254.100.254)
type Protocol ¶
type Protocol struct {
// contains filtered or unexported fields
}
func NewProtocol ¶
func (*Protocol) BfdSessions ¶
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) Configure ¶ added in v0.9.0
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
ShowProtocolSessions - Retrieves information on the available BFD sessions (for the given BFD protocol name if any)
func (*RoutingService) ShowMemory ¶ added in v1.0.12
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
ShowRouteCount - Retrieves number of routes from default BIRD routing tables (master4, master6) Note: using filters significantly increases CPU usage