Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // parsing errors ErrEmptyLine = errors.New("empty command") ErrInvalidFormat = errors.New("invalid route command format") ErrInvalidAction = errors.New("command must start with announce or withdraw") ErrOnlyRoute = errors.New("only route commands supported") ErrMissingValue = errors.New("parameter requires value") ErrInvalidPrefix = errors.New("invalid prefix format") ErrInvalidNextHop = errors.New("invalid next-hop IP address") ErrInvalidOrigin = errors.New("invalid origin") ErrInvalidCommunity = errors.New("invalid community format") )
Functions ¶
func IsExaBytes ¶
IsExaBytes checks if the given byte slice looks like an ExaBGP command line
func IsExaString ¶
IsExaString checks if the given byte slice looks like an ExaBGP command line
Types ¶
type Exa ¶
type Exa struct {
Str string // parsed line (optional)
Tok []string // all tokens in line (optional)
Action string // announce or withdraw
Prefix string // IP prefix (e.g., "10.0.0.1/24")
NextHop string // next-hop IP address or "self"
Origin string // IGP, EGP, INCOMPLETE (optional)
ASPath []uint32 // AS path sequence (optional)
MED *uint32 // Multi-Exit Discriminator (optional)
LocalPref *uint32 // Local preference (optional)
Community []string // Community values in brackets [no-export] or [123:456]
}
Exa represents an ExaBGP route announcement/withdrawal Focuses on the most commonly used attributes (80/20 approach)
func NewExaLine ¶
NewExaLine creates a new Exa and parses the given command line
func (*Exa) IterMsg ¶
IterMsg returns an iterator that converts bgpfix Msg (UPDATE) to Exa lines. For each reachable and unreachable prefix, it returns x after updating it.
Click to show internal directories.
Click to hide internal directories.