Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MessageBridge messageBridge
MessageBridge implements registry.MessageCallback by forwarding to the active MRT Component. Registered as coordinator extra "mrt.messageCallback" so the BGP reactor factory can wire it during createReactorFromCoordinator. When no MRT config is active, OnBGPMessage returns immediately (nil check).
var PeerBridge peerBridge
PeerBridge implements registry.PeerLifecycleCallback by forwarding to the active MRT Component for FSM state change recording.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component writes MRT dump files by subscribing to BGP events. Three independent streams: updates-only, all-messages, and periodic RIB snapshots. Implements reactor.MessageObserver for raw wire byte delivery.
func (*Component) OnBGPMessage ¶
func (c *Component) OnBGPMessage(peer *plugin.PeerInfo, msgType msgtype.MessageType, sent bool, rawBytes []byte)
OnBGPMessage implements reactor.MessageObserver. Called synchronously on the session goroutine with raw wire bytes.
type Config ¶
type Config struct {
UpdatesPath string // strftime pattern for UPDATE-only stream
UpdatesInterval time.Duration // file rotation interval for updates
AllPath string // strftime pattern for all-messages stream
AllInterval time.Duration // file rotation interval for all messages
RoutesPath string // strftime pattern for periodic RIB snapshots
RoutesInterval time.Duration // dump interval for TABLE_DUMP_V2
ExtendedTimestamp bool // use BGP4MP_ET (type 17) instead of BGP4MP (type 16)
AddPath bool // force add-path subtypes even when not negotiated
PeerFilter []string // if non-empty, only dump these peer addresses
Direction string // "received", "sent", or "" for both
}
Config holds MRT dump configuration for the daemon component.
func ParseConfig ¶
func ParseConfig(data json.RawMessage) (*Config, error)
ParseConfig parses MRT config from JSON section data.
The plugin server delivers a section wrapped in the config root, e.g. {"mrt":{"updates":{...}}} (BuildPluginConfigSections keys the body by root, as static/fib/etc. all unwrap). Unwrap the "mrt" key before decoding the body; a body that is already unwrapped (no "mrt" key) is decoded as-is.
func (*Config) HasUpdates ¶
HasUpdates reports whether the update stream is configured.