bird

package
v0.0.0-...-9affa2a Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MoveCacheAndReconfigure

func MoveCacheAndReconfigure(birdDirectory string, cacheDirectory string, birdSocket string, noConfigure bool)

MoveCacheAndReconfigure moves cached files to the production BIRD directory and reconfigures

func Read

func Read(r io.Reader) (string, error)

Read reads the full BIRD response as a string

func ReadClean

func ReadClean(r io.Reader)

ReadClean reads from the provided reader and trims unneeded whitespace and bird 4-digit numbers

func Reformat

func Reformat(input string) string

Reformat takes a BIRD config file as a string and outputs a nicely formatted version as a string

func RunCommand

func RunCommand(command string, socket string) (string, string, error)

RunCommand runs a BIRD command and returns the output, version, and error

func Validate

func Validate(binary string, cacheDir string)

Validate checks if the cached configuration is syntactically valid

Types

type BGPState

type BGPState struct {
	NeighborAddress string
	NeighborAS      int
	LocalAS         int
	NeighborID      string
}

type ProtocolState

type ProtocolState struct {
	Name   string
	Proto  string
	Table  string
	State  string
	Since  string
	Info   string
	Routes *Routes
	BGP    *BGPState
}

func ParseProtocol

func ParseProtocol(p string) (*ProtocolState, error)

ParseProtocol parses a single protocol

func ParseProtocols

func ParseProtocols(p string) ([]*ProtocolState, error)

ParseProtocols parses a list of protocols

type Routes

type Routes struct {
	Imported  int
	Filtered  int
	Exported  int
	Preferred int
}

Jump to

Keyboard shortcuts

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