Documentation ¶
Index ¶
- Constants
- func NewProtocolMap() protocolMap
- func NewRoutingConfig(path string) *routingConfig
- func ParseProtocols(input string, out *string, f func(name string, options ...Option))
- 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) ShowProtocolSessions(ctx context.Context, lp, pattern 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" )
Variables ¶
This section is empty.
Functions ¶
func NewProtocolMap ¶
func NewProtocolMap() protocolMap
func NewRoutingConfig ¶
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 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 ¶
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) 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 ¶
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