Help us shape the future of Go! Take the 2026 Go Developer Survey

bgp

package
v0.0.0-...-6b8ee43 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package bgp provides shared types and event parsing for the BGP subsystem.

Design: docs/architecture/plugin/rib-storage-design.md — BGP event parsing Related: route.go — Route struct used by event consumers Related: format.go — route command formatting Related: nlri.go — NLRI value parsing

Design: docs/architecture/plugin/rib-storage-design.md — route command formatting Related: route.go — Route struct formatted by this file Related: event.go — event parsing and family operations Related: nlri.go — NLRI value parsing

Design: docs/architecture/plugin/rib-storage-design.md — NLRI value parsing Related: route.go — Route struct uses parsed NLRI values Related: event.go — event parsing and family operations Related: format.go — route command formatting

Design: docs/architecture/plugin/rib-storage-design.md — BGP route types for plugins Related: event.go — event parsing and family operations Related: format.go — route command formatting Related: nlri.go — NLRI value parsing

Package bgp provides common BGP domain types used by multiple BGP plugins (bgp-rib, bgp-adj-rib-in, bgp-watchdog, and future plugins).

RFC 7911: ADD-PATH path-id is included in route keys when present. Multiple paths to the same prefix with different path-ids are stored separately.

Index

Constants

This section is empty.

Variables

View Source
var KnownFields = map[string]bool{
	"type": true, "msg-id": true, "message": true,
	"peer": true, "state": true, "origin": true, "as-path": true,
	"med": true, "local-preference": true, "communities": true,
	"large-communities": true, "extended-communities": true, "aigp": true,
	"serial": true, "command": true, "args": true, "afi": true, "safi": true,
	"raw": true,

	"raw-attributes": true, "raw-nlri": true, "raw-withdrawn": true,

	"bgp": true, "rib": true,

	"attributes": true, "nlri": true, "action": true, "attr": true,

	"update": true, "notification": true, "open": true, "keepalive": true,
	"refresh": true, "borr": true, "eorr": true, "negotiated": true,
}

KnownFields are the standard Event fields that are not family operations. Note: "direction" is inside message wrapper, not at root level.

Functions

func FormatAnnounceCommand

func FormatAnnounceCommand(route *Route) string

FormatAnnounceCommand builds an announce command with full attributes. When route.RawAttrs is set (from format=full sent events), uses "update hex" format to preserve ALL transitive attributes (OTC, unknown attrs) through replay. Otherwise uses "update text" with per-field attributes. The peer selector is passed separately to updateRoute.

func FormatWithdrawCommand

func FormatWithdrawCommand(route *Route) string

FormatWithdrawCommand builds an "update text" withdrawal command. Withdrawals only need family, prefix, and NLRI modifiers (no attributes).

func ParseCommunityStrings

func ParseCommunityStrings(ss []string) []attribute.Community

ParseCommunityStrings converts string-form communities ("ASN:Value") to typed values. Invalid entries are silently dropped (source is trusted JSON from ze-bgp).

func ParseExtCommunityStrings

func ParseExtCommunityStrings(ss []string) []attribute.ExtendedCommunity

ParseExtCommunityStrings converts hex-encoded extended community strings to typed values.

func ParseFamilyOps

func ParseFamilyOps(event *Event, data []byte)

ParseFamilyOps extracts family operations from JSON data into the event. Dynamic keys with the shape "afi/safi" are resolved via family.LookupFamily; unregistered families are dropped and aggregated into a single debug log.

func ParseLargeCommunityStrings

func ParseLargeCommunityStrings(ss []string) []attribute.LargeCommunity

ParseLargeCommunityStrings converts string-form large communities ("GA:LD1:LD2") to typed values.

func ParseNLRIValue

func ParseNLRIValue(v any) (prefix string, pathID uint32)

ParseNLRIValue extracts prefix and path-id from an NLRI value. Handles both new format {"prefix":"...", "path-id":N} and legacy string format.

func RouteKey

func RouteKey(family, prefix string, pathID uint32) string

RouteKey creates a unique key for a route. RFC 7911: When ADD-PATH is negotiated, path-id is part of the key.

Types

type Event

type Event struct {
	// Sent events use top-level type (string: may carry non-BGP event types like "cache", "request").
	Type     string        `json:"type"`
	TypeKind rpc.EventKind `json:"-"`
	MsgID    uint64        `json:"msg-id"`

	// Received events use message wrapper (includes type, id, direction).
	Message *MessageInfo `json:"message,omitempty"`

	// Peer info - uses RawMessage to handle both flat and nested formats.
	Peer json.RawMessage `json:"peer"`

	// State event field.
	State string `json:"state,omitempty"`

	// UPDATE fields - new command-style format.
	// Family operations are parsed from raw JSON (dynamic keys like "ipv4/unicast").
	// Format: {"ipv4/unicast": [{"next-hop": "...", "action": "add", "nlri": [...]}]}.
	// Keys are typed family.Family -- the JSON "afi/safi" string is resolved via
	// family.LookupFamily at parse time and unregistered families are dropped.
	FamilyOps map[family.Family][]FamilyOperation `json:"-"` // Populated by ParseEvent

	// Path attributes at top level.
	Origin              string   `json:"origin,omitempty"`
	ASPath              []uint32 `json:"as-path,omitempty"`
	MED                 *uint32  `json:"med,omitempty"`
	LocalPreference     *uint32  `json:"local-preference,omitempty"`
	Communities         []string `json:"communities,omitempty"`
	LargeCommunities    []string `json:"large-communities,omitempty"`
	ExtendedCommunities []string `json:"extended-communities,omitempty"`
	AIGP                *uint64  `json:"aigp,omitempty"`

	// Request fields.
	Serial  string   `json:"serial,omitempty"`
	Command string   `json:"command,omitempty"`
	Args    []string `json:"args,omitempty"`

	// Route refresh fields (RFC 7313). JSON text form uses the registered
	// AFI/SAFI names (e.g. "ipv4"/"unicast") via family.AFI/SAFI TextMarshaler.
	AFI  family.AFI  `json:"afi,omitempty"`
	SAFI family.SAFI `json:"safi,omitempty"`

	// Pool storage raw fields (format=full only).
	// Hex-encoded wire bytes for pool-based storage. The per-family maps use
	// typed family.Family keys; ParseEvent resolves JSON "afi/safi" strings via
	// family.LookupFamily and drops entries whose family is not registered.
	RawAttributes string                   `json:"raw-attributes,omitempty"` // Path attributes (without MP_REACH/UNREACH)
	RawNLRI       map[family.Family]string `json:"-"`                        // family -> hex bytes; populated by ParseEvent
	RawWithdrawn  map[family.Family]string `json:"-"`                        // family -> hex bytes; populated by ParseEvent

	// Decoded byte caches: set directly by structured producers to skip the
	// hex encode/decode round-trip. Accessors return these when present,
	// falling back to hex decoding the string fields for JSON-sourced events.
	RawAttributeBytes []byte                   `json:"-"`
	RawNLRIBytes      map[family.Family][]byte `json:"-"`
	RawWithdrawnBytes map[family.Family][]byte `json:"-"`

	// RFC 7911: ADD-PATH per-family flags from negotiated capabilities (format=full only).
	// When true for a family, NLRI wire bytes include 4-byte path-ID prefix.
	AddPath map[family.Family]bool `json:"-"` // Populated by parseRawFields from raw.add-path

	// RouteMeta carries route-level metadata through events (e.g., "src-role" for OTC filtering).
	// Set from ReceivedUpdate.Meta on sent events; stored on Route.Meta in ribOut.
	RouteMeta map[string]any `json:"route-meta,omitempty"`
}

Event represents a JSON event from ze. Handles both sent events (flat format) and received events (nested format). Event is single-owner: each instance is consumed by one goroutine. Lazy accessors (GetRawAttributesHex, GetRawNLRIHex) cache derived values by mutating string fields. Do not share an Event across goroutines.

func ParseEvent

func ParseEvent(data []byte) (*Event, error)

ParseEvent parses a JSON event from ze. Handles ze-bgp JSON format where events are nested under their event type:

{"type":"bgp","bgp":{"type":"update","update":{...}}}
{"type":"bgp","bgp":{"type":"state","state":{...}}}

Extracts family operations (ipv4/unicast, ipv6/unicast, etc.) from dynamic keys.

func (*Event) GetDirection

func (e *Event) GetDirection() string

GetDirection returns the direction from message wrapper.

func (*Event) GetEventType

func (e *Event) GetEventType() rpc.EventKind

GetEventType returns unified event type. For received events, uses message.type. For sent events, uses cached TypeKind (populated by ParseEvent), falling back to parsing Type on first call.

func (*Event) GetMsgID

func (e *Event) GetMsgID() uint64

GetMsgID returns message ID from either format.

func (*Event) GetPeerASN

func (e *Event) GetPeerASN() uint32

GetPeerASN extracts the remote peer ASN (YANG: remote.as).

func (*Event) GetPeerAddress

func (e *Event) GetPeerAddress() string

GetPeerAddress extracts the peer address from remote.address.

func (*Event) GetPeerName

func (e *Event) GetPeerName() string

GetPeerName extracts the peer name (YANG: name leaf).

func (*Event) GetPeerSelector

func (e *Event) GetPeerSelector() string

GetPeerSelector extracts peer selector string for request events. For request events, ze sends peer as a JSON string (the selector). Returns empty string if not a request event or no selector specified.

func (*Event) GetPeerState

func (e *Event) GetPeerState() string

GetPeerState extracts peer state from the peer object or top-level State field.

func (*Event) GetRawAttributesBytes

func (e *Event) GetRawAttributesBytes() []byte

GetRawAttributesBytes returns raw attribute bytes. Returns the cached []byte when set by a structured producer, otherwise decodes the hex string field.

func (*Event) GetRawAttributesHex

func (e *Event) GetRawAttributesHex() string

GetRawAttributesHex returns the hex-encoded raw attributes string. If only the byte field is set (structured producer), encodes lazily.

func (*Event) GetRawNLRIBytes

func (e *Event) GetRawNLRIBytes(fam family.Family) []byte

GetRawNLRIBytes returns decoded NLRI bytes for a specific family. Returns the cached []byte when set by a structured producer, otherwise decodes the hex string field.

func (*Event) GetRawNLRIHex

func (e *Event) GetRawNLRIHex(fam family.Family) string

GetRawNLRIHex returns the hex-encoded NLRI string for a specific family. If only the byte field is set (structured producer), encodes lazily.

func (*Event) GetRawWithdrawnBytes

func (e *Event) GetRawWithdrawnBytes(fam family.Family) []byte

GetRawWithdrawnBytes returns decoded withdrawn bytes for a specific family. Returns the cached []byte when set by a structured producer, otherwise decodes the hex string field.

func (*Event) RawNLRIFamilies

func (e *Event) RawNLRIFamilies() []family.Family

RawNLRIFamilies returns the set of families with raw NLRI data, merged from both byte and string maps.

func (*Event) RawWithdrawnFamilies

func (e *Event) RawWithdrawnFamilies() []family.Family

RawWithdrawnFamilies returns the set of families with raw withdrawn data, merged from both byte and string maps.

type FamilyOperation

type FamilyOperation struct {
	NextHop string             `json:"next-hop,omitempty"` // Only for "add" operations
	Action  routeaction.Action `json:"action"`
	NLRIs   []any              `json:"nlri"` // Strings or {"prefix":"...", "path-id":N}
}

FamilyOperation represents a single add or del operation for a family. RFC 7911: nlri items may have path-id when ADD-PATH is negotiated.

type MessageInfo

type MessageInfo struct {
	Type      rpc.EventKind        `json:"type"`
	ID        uint64               `json:"id,omitempty"`
	Direction rpc.MessageDirection `json:"direction,omitempty"`
}

MessageInfo contains message wrapper for received events.

type PeerInfoJSON

type PeerInfoJSON struct {
	Name   string         `json:"name,omitempty"`
	Group  string         `json:"group,omitempty"`
	Remote PeerRemoteInfo `json:"remote"`
	Local  *PeerLocalInfo `json:"local,omitempty"`
	State  string         `json:"state,omitempty"`
}

PeerInfoJSON is the YANG-aligned peer format for all events. Both local and remote are always present with address + as.

type PeerLocalInfo

type PeerLocalInfo struct {
	Address string `json:"address,omitempty"`
	AS      uint32 `json:"as,omitempty"`
}

PeerLocalInfo holds local peer identity (YANG: container local).

type PeerRemoteInfo

type PeerRemoteInfo struct {
	Address string `json:"address,omitempty"`
	AS      uint32 `json:"as"`
}

PeerRemoteInfo holds the remote peer identity (YANG: container remote).

type Route

type Route struct {
	MsgID     uint64        `json:"msg-id,omitempty"`
	Family    family.Family `json:"family"`
	Prefix    string        `json:"prefix"`
	PathID    uint32        `json:"path-id,omitempty"` // RFC 7911: ADD-PATH path identifier
	NextHop   string        `json:"next-hop"`
	Timestamp time.Time     `json:"timestamp,omitzero"`

	// Path attributes for full route resend.
	Origin              *attribute.Origin             `json:"origin,omitempty"`
	ASPath              []uint32                      `json:"as-path,omitempty"`
	MED                 *uint32                       `json:"med,omitempty"`
	LocalPreference     *uint32                       `json:"local-preference,omitempty"`
	Communities         []attribute.Community         `json:"communities,omitempty"`
	LargeCommunities    []attribute.LargeCommunity    `json:"large-communities,omitempty"`
	ExtendedCommunities []attribute.ExtendedCommunity `json:"extended-communities,omitempty"`

	// RawAttrs is the hex-encoded path attributes from format=full sent events.
	// When non-empty, FormatAnnounceCommand uses "update hex attr set <hex>" format
	// instead of per-field text format. This preserves ALL transitive attributes
	// (including OTC, unknown attributes) through RIB replay.
	RawAttrs string `json:"raw-attrs,omitempty"`

	// Meta carries route-level metadata through the RIB for egress filtering on replay.
	// Set by handleSent from ReceivedUpdate.Meta (e.g., "src-role" for OTC suppression).
	// When the RIB replays routes through ForwardUpdate, egress filters read this.
	Meta map[string]any `json:"meta,omitempty"`

	// SourcePeer is the address of the peer that originally sent this route.
	// Set in ribOut entries to scope GR/LLGR stale propagation to the restarting peer.
	SourcePeer string `json:"source-peer,omitempty"`

	// StaleLevel tracks LLGR stale status for ribOut routes.
	// 0 = fresh, 1 = GR stale, 2 = LLGR stale (depreference threshold).
	// Set by markStaleCommand when propagating stale to ribOut.
	// Used by sendRoutes to carry meta["stale"] through ForwardUpdate to egress filters.
	StaleLevel uint8 `json:"stale-level,omitempty"`

	// VPN fields — used by watchdog and future VPN route replay.
	RD     string   `json:"rd,omitempty"`     // Route Distinguisher ("ASN:NN" or "IP:NN")
	Labels []uint32 `json:"labels,omitempty"` // MPLS label stack
}

Route represents a stored route with full path attributes. RFC 7911: PathID is included when ADD-PATH is negotiated.

Directories

Path Synopsis
Package attrpool provides refcounted, deduplicating attribute pools for BGP path attributes.
Package attrpool provides refcounted, deduplicating attribute pools for BGP path attributes.
cli
Design: docs/architecture/core-design.md — BGP CLI commands Detail: cmd_plugin.go — plugin CLI simulator subcommand
Design: docs/architecture/core-design.md — BGP CLI commands Detail: cmd_plugin.go — plugin CLI simulator subcommand
yang
Package yang embeds and registers the BGP tools CLI command YANG module.
Package yang embeds and registers the BGP tools CLI command YANG module.
Package bgpconfig converts BGP configuration trees into peer definitions and route attributes.
Package bgpconfig converts BGP configuration trees into peer definitions and route attributes.
Package configjson provides shared helpers for traversing BGP config JSON delivered to plugins at Stage 2 (configure callback).
Package configjson provides shared helpers for traversing BGP config JSON delivered to plugins at Stage 2 (configure callback).
Package filter implements BGP route filtering based on attribute matching rules.
Package filter implements BGP route filtering based on attribute matching rules.
Package format provides JSON and text formatting of BGP messages directly from wire bytes.
Package format provides JSON and text formatting of BGP messages directly from wire bytes.
Package fsm implements the BGP Finite State Machine per RFC 4271 Section 8, managing peer state transitions, timers, and session lifecycle events.
Package fsm implements the BGP Finite State Machine per RFC 4271 Section 8, managing peer state transitions, timers, and session lifecycle events.
Design: docs/architecture/core-design.md -- GR restart marker for Restarting Speaker detection
Design: docs/architecture/core-design.md -- GR restart marker for Restarting Speaker detection
Design: docs/architecture/wire/messages.md — BGP message types Related: update_build.go — UPDATE builder infrastructure
Design: docs/architecture/wire/messages.md — BGP message types Related: update_build.go — UPDATE builder infrastructure
plugins
adj_rib_in
Design: docs/architecture/plugin/rib-storage-design.md — Adj-RIB-In raw hex storage RFC: rfc/short/rfc4271.md -- Adj-RIBs-In stores unprocessed routing information Detail: rib_commands.go — command handlers (status, show, replay, validation) Detail: rib_validation.go — RPKI validation gate (pending routes, timeout, state constants)
Design: docs/architecture/plugin/rib-storage-design.md — Adj-RIB-In raw hex storage RFC: rfc/short/rfc4271.md -- Adj-RIBs-In stores unprocessed routing information Detail: rib_commands.go — command handlers (status, show, replay, validation) Detail: rib_validation.go — RPKI validation gate (pending routes, timeout, state constants)
adj_rib_in/yang
Package yang embeds and registers the adj-rib-in API YANG module.
Package yang embeds and registers the adj-rib-in API YANG module.
aigp
Design: (none -- predates documentation) RFC: rfc/short/rfc7311.md
Design: (none -- predates documentation) RFC: rfc/short/rfc7311.md
bmp
Design: docs/architecture/core-design.md -- BGP plugin model
Design: docs/architecture/core-design.md -- BGP plugin model
bmp/yang
Package yang embeds and registers the BMP command and configuration YANG modules.
Package yang embeds and registers the BMP command and configuration YANG modules.
cmd/announce
Package announce implements the on-demand BGP route origination command handlers.
Package announce implements the on-demand BGP route origination command handlers.
cmd/announce/yang
Package yang embeds and registers the BGP announce command and API YANG modules.
Package yang embeds and registers the BGP announce command and API YANG modules.
cmd/cache
Package cache implements the BGP cache operation command handlers.
Package cache implements the BGP cache operation command handlers.
cmd/cache/yang
Package yang embeds and registers the YANG schema modules for the cache command.
Package yang embeds and registers the YANG schema modules for the cache command.
cmd/commit
Package commit implements the BGP commit command that manages named route commit transactions.
Package commit implements the BGP commit command that manages named route commit transactions.
cmd/commit/yang
Package yang embeds and registers the YANG schema modules for the commit command.
Package yang embeds and registers the YANG schema modules for the commit command.
cmd/monitor
Design: docs/architecture/api/commands.md — BGP monitor command handlers
Design: docs/architecture/api/commands.md — BGP monitor command handlers
cmd/monitor/yang
Package yang embeds and registers the YANG schema modules for the monitor command.
Package yang embeds and registers the YANG schema modules for the monitor command.
cmd/peer
Package peer provides BGP peer lifecycle and introspection command handlers for the plugin server.
Package peer provides BGP peer lifecycle and introspection command handlers for the plugin server.
cmd/peer/yang
Package yang embeds and registers the YANG schema modules for the peer command.
Package yang embeds and registers the YANG schema modules for the peer command.
cmd/policy
Package policy implements the show policy commands that inspect policy chains and dry-run policy evaluation.
Package policy implements the show policy commands that inspect policy chains and dry-run policy evaluation.
cmd/policy/yang
Package yang embeds and registers the YANG schema module for the policy command.
Package yang embeds and registers the YANG schema module for the policy command.
cmd/raw
Design: docs/architecture/api/commands.md — BGP raw message command handler
Design: docs/architecture/api/commands.md — BGP raw message command handler
cmd/raw/yang
Package yang embeds and registers the YANG schema modules for the raw command.
Package yang embeds and registers the YANG schema modules for the raw command.
cmd/rib
Design: docs/architecture/api/commands.md — RIB CLI proxy handlers
Design: docs/architecture/api/commands.md — RIB CLI proxy handlers
cmd/rib/yang
Package yang embeds and registers the YANG schema modules for the rib command.
Package yang embeds and registers the YANG schema modules for the rib command.
cmd/update
Design: plan/learned/824-rib-feed-replay-batch.md — stateful cursor for replay batching Overview: update_text.go — handleUpdate dispatch, parsedAttrs, snapshot, parseCommonAttributeText Related: update_text_nlri.go — parseNLRISection (reused unchanged)
Design: plan/learned/824-rib-feed-replay-batch.md — stateful cursor for replay batching Overview: update_text.go — handleUpdate dispatch, parsedAttrs, snapshot, parseCommonAttributeText Related: update_text_nlri.go — parseNLRISection (reused unchanged)
cmd/update/yang
Package yang embeds and registers the YANG schema modules for the update command.
Package yang embeds and registers the YANG schema modules for the update command.
filter_aspath
Design: docs/architecture/core-design.md -- AS-path filter config parsing Related: match.go -- AS-path regex matching algorithm Related: filter_aspath.go -- SDK entry point and handleFilterUpdate
Design: docs/architecture/core-design.md -- AS-path filter config parsing Related: match.go -- AS-path regex matching algorithm Related: filter_aspath.go -- SDK entry point and handleFilterUpdate
filter_aspath/yang
Package yang embeds and registers the YANG schema module for the aspath filter.
Package yang embeds and registers the YANG schema module for the aspath filter.
filter_aspath_length/yang
Package yang embeds and registers the YANG schema module for the aspath-length filter.
Package yang embeds and registers the YANG schema module for the aspath-length filter.
filter_community
Package filter_community implements the bgp-filter-community plugin.
Package filter_community implements the bgp-filter-community plugin.
filter_community/yang
Package yang embeds and registers the community-filter plugin's YANG configuration schema module.
Package yang embeds and registers the community-filter plugin's YANG configuration schema module.
filter_community_match
Design: docs/architecture/core-design.md -- community match filter config parsing Related: match.go -- community matching algorithm Related: filter_community_match.go -- SDK entry point and handleFilterUpdate
Design: docs/architecture/core-design.md -- community match filter config parsing Related: match.go -- community matching algorithm Related: filter_community_match.go -- SDK entry point and handleFilterUpdate
filter_community_match/yang
Package yang embeds and registers the YANG schema module for the community-match filter.
Package yang embeds and registers the YANG schema module for the community-match filter.
filter_family
Design: docs/architecture/core-design.md -- address-family policy filter Related: config.go -- bgp/policy/family-filter config parsing + tear-down-in-export guard Related: match.go -- family extraction from the raw UPDATE body Related: handler.go -- per-update remove / tear-down decision RFC: rfc/short/rfc4760.md -- multiprotocol families (Section 6) RFC: rfc/short/rfc4271.md -- NOTIFICATION + session close (Section 6)
Design: docs/architecture/core-design.md -- address-family policy filter Related: config.go -- bgp/policy/family-filter config parsing + tear-down-in-export guard Related: match.go -- family extraction from the raw UPDATE body Related: handler.go -- per-update remove / tear-down decision RFC: rfc/short/rfc4760.md -- multiprotocol families (Section 6) RFC: rfc/short/rfc4271.md -- NOTIFICATION + session close (Section 6)
filter_family/yang
Package yang embeds and registers the family-filter plugin's YANG configuration schema module.
Package yang embeds and registers the family-filter plugin's YANG configuration schema module.
filter_irr/yang
Package yang embeds and registers the IRR-filter plugin's YANG configuration schema modules.
Package yang embeds and registers the IRR-filter plugin's YANG configuration schema modules.
filter_modify
Design: docs/architecture/core-design.md -- route modify filter config parsing Related: modify.go -- delta building and attribute encoding Related: filter_modify.go -- SDK entry point and handleFilterUpdate
Design: docs/architecture/core-design.md -- route modify filter config parsing Related: modify.go -- delta building and attribute encoding Related: filter_modify.go -- SDK entry point and handleFilterUpdate
filter_modify/yang
Package yang embeds and registers the modify-filter plugin's YANG configuration schema module.
Package yang embeds and registers the modify-filter plugin's YANG configuration schema module.
filter_prefix
Design: docs/architecture/core-design.md -- prefix-list filter plugin Detail: match.go -- prefix matching algorithm and update evaluator Detail: config.go -- bgp/policy/prefix-list config parsing
Design: docs/architecture/core-design.md -- prefix-list filter plugin Detail: match.go -- prefix matching algorithm and update evaluator Detail: config.go -- bgp/policy/prefix-list config parsing
filter_prefix/yang
Package yang embeds and registers the prefix-filter plugin's YANG configuration schema module.
Package yang embeds and registers the prefix-filter plugin's YANG configuration schema module.
filter_remove_private_as/yang
Package yang embeds and registers the remove-private-AS filter plugin's YANG configuration schema module.
Package yang embeds and registers the remove-private-AS filter plugin's YANG configuration schema module.
gr
Design: docs/architecture/core-design.md — graceful restart plugin RFC: rfc/short/rfc4724.md RFC: rfc/short/rfc9494.md Detail: gr_state.go — GR state machine (per-peer timers, stale family tracking) Detail: gr_llgr.go — LLGR capability decode, config extraction, CLI decode (RFC 9494)
Design: docs/architecture/core-design.md — graceful restart plugin RFC: rfc/short/rfc4724.md RFC: rfc/short/rfc9494.md Detail: gr_state.go — GR state machine (per-peer timers, stale family tracking) Detail: gr_llgr.go — LLGR capability decode, config extraction, CLI decode (RFC 9494)
gr/yang
Package yang embeds and registers the graceful-restart plugin's YANG configuration schema module.
Package yang embeds and registers the graceful-restart plugin's YANG configuration schema module.
healthcheck
Design: plan/learned/516-healthcheck-0-umbrella.md -- healthcheck config parsing Overview: healthcheck.go -- plugin lifecycle and probe management
Design: plan/learned/516-healthcheck-0-umbrella.md -- healthcheck config parsing Overview: healthcheck.go -- plugin lifecycle and probe management
healthcheck/yang
Package yang embeds and registers the healthcheck plugin's YANG configuration schema module.
Package yang embeds and registers the healthcheck plugin's YANG configuration schema module.
hostname
Design: docs/architecture/core-design.md — hostname capability plugin
Design: docs/architecture/core-design.md — hostname capability plugin
hostname/yang
Package yang embeds and registers the hostname plugin's YANG configuration schema module.
Package yang embeds and registers the hostname plugin's YANG configuration schema module.
llnh
Design: docs/architecture/core-design.md — link-local next-hop plugin RFC: rfc/short/rfc5549.md
Design: docs/architecture/core-design.md — link-local next-hop plugin RFC: rfc/short/rfc5549.md
llnh/yang
Package yang embeds and registers the link-local-nexthop plugin's YANG configuration schema module.
Package yang embeds and registers the link-local-nexthop plugin's YANG configuration schema module.
nlri/evpn
Design: docs/architecture/wire/nlri-evpn.md — EVPN NLRI plugin RFC: rfc/short/rfc7432.md
Design: docs/architecture/wire/nlri-evpn.md — EVPN NLRI plugin RFC: rfc/short/rfc7432.md
nlri/flowspec
Design: docs/architecture/wire/nlri-flowspec.md — FlowSpec NLRI plugin RFC: rfc/short/rfc5575.md Detail: plugin_decode.go — wire-to-JSON decoding and formatting Detail: plugin_encode_text.go — text-to-wire encoding Detail: plugin_protocol.go — stdin/stdout protocol dispatch
Design: docs/architecture/wire/nlri-flowspec.md — FlowSpec NLRI plugin RFC: rfc/short/rfc5575.md Detail: plugin_decode.go — wire-to-JSON decoding and formatting Detail: plugin_encode_text.go — text-to-wire encoding Detail: plugin_protocol.go — stdin/stdout protocol dispatch
nlri/labeled
Design: docs/architecture/wire/nlri.md — labeled unicast NLRI plugin RFC: rfc/short/rfc8277.md
Design: docs/architecture/wire/nlri.md — labeled unicast NLRI plugin RFC: rfc/short/rfc8277.md
nlri/ls
Design: docs/architecture/wire/nlri-bgpls.md — BGP-LS attribute TLV framework RFC: rfc/short/rfc7752.md — BGP-LS attribute type 29 TLV format Overview: types.go — core types, TLV constants, and helper functions Detail: attr_node.go — node attribute TLV types Detail: attr_link.go — link attribute TLV types Detail: attr_prefix.go — prefix attribute TLV types Detail: attr_srv6.go — SRv6 attribute TLV types Detail: register_attr.go — attribute TLV registration
Design: docs/architecture/wire/nlri-bgpls.md — BGP-LS attribute TLV framework RFC: rfc/short/rfc7752.md — BGP-LS attribute type 29 TLV format Overview: types.go — core types, TLV constants, and helper functions Detail: attr_node.go — node attribute TLV types Detail: attr_link.go — link attribute TLV types Detail: attr_prefix.go — prefix attribute TLV types Detail: attr_srv6.go — SRv6 attribute TLV types Detail: register_attr.go — attribute TLV registration
nlri/mup
Design: docs/architecture/wire/nlri.md — MUP NLRI prefix encoding helpers RFC: rfc/short/draft-ietf-bess-mup-safi.md — MUP SAFI encoding
Design: docs/architecture/wire/nlri.md — MUP NLRI prefix encoding helpers RFC: rfc/short/draft-ietf-bess-mup-safi.md — MUP SAFI encoding
nlri/mvpn
Design: docs/architecture/wire/nlri.md — MVPN NLRI plugin
Design: docs/architecture/wire/nlri.md — MVPN NLRI plugin
nlri/rtc
Design: docs/architecture/wire/nlri.md — route target constraint plugin RFC: rfc/short/rfc4684.md
Design: docs/architecture/wire/nlri.md — route target constraint plugin RFC: rfc/short/rfc4684.md
nlri/srpolicy
Design: docs/architecture/wire/nlri.md -- SR-Policy NLRI plugin RFC: rfc/short/rfc9830.md -- SR-Policy NLRI wire format (SAFI 73)
Design: docs/architecture/wire/nlri.md -- SR-Policy NLRI plugin RFC: rfc/short/rfc9830.md -- SR-Policy NLRI wire format (SAFI 73)
nlri/vpls
Design: docs/architecture/wire/nlri.md — VPLS NLRI plugin RFC: rfc/short/rfc4761.md
Design: docs/architecture/wire/nlri.md — VPLS NLRI plugin RFC: rfc/short/rfc4761.md
nlri/vpn
Design: docs/architecture/wire/nlri.md — VPN NLRI plugin RFC: rfc/short/rfc4364.md
Design: docs/architecture/wire/nlri.md — VPN NLRI plugin RFC: rfc/short/rfc4364.md
rib
Design: docs/architecture/plugin/rib-storage-design.md — best-path selection Overview: rib.go — RIB plugin core types and event handlers Related: rib_attr_format.go — attribute formatting (asPathLength, firstASInPath shared concern) Related: rib_commands.go — extractCandidate, gatherCandidates Related: rib_pipeline_best.go — best-path pipeline for show bgp rib best commands Related: rib_bestchange.go — best-path change tracking and Bus publishing
Design: docs/architecture/plugin/rib-storage-design.md — best-path selection Overview: rib.go — RIB plugin core types and event handlers Related: rib_attr_format.go — attribute formatting (asPathLength, firstASInPath shared concern) Related: rib_commands.go — extractCandidate, gatherCandidates Related: rib_pipeline_best.go — best-path pipeline for show bgp rib best commands Related: rib_bestchange.go — best-path change tracking and Bus publishing
rib/pool
Package pool holds the per-attribute-type BGP path-attribute pools used for fine-grained RIB deduplication.
Package pool holds the per-attribute-type BGP path-attribute pools used for fine-grained RIB deduplication.
rib/storage
Package storage implements the per-peer, per-family RIB storage with per-attribute-type deduplication.
Package storage implements the per-peer, per-family RIB storage with per-attribute-type deduplication.
rib/yang
Package yang embeds and registers the BGP RIB YANG schema modules.
Package yang embeds and registers the BGP RIB YANG schema modules.
role
Design: docs/architecture/core-design.md — BGP role plugin RFC: rfc/short/rfc9234.md Detail: otc.go — OTC attribute processing (ingress/egress) Detail: config.go — per-peer role config parsing (import/export)
Design: docs/architecture/core-design.md — BGP role plugin RFC: rfc/short/rfc9234.md Detail: otc.go — OTC attribute processing (ingress/egress) Detail: config.go — per-peer role config parsing (import/export)
role/yang
Package yang embeds and registers the BGP role YANG schema module.
Package yang embeds and registers the BGP role YANG schema module.
route_refresh
Design: docs/architecture/core-design.md — route refresh capability plugin RFC: rfc/short/rfc2918.md — route refresh capability RFC: rfc/short/rfc7313.md — enhanced route refresh
Design: docs/architecture/core-design.md — route refresh capability plugin RFC: rfc/short/rfc2918.md — route refresh capability RFC: rfc/short/rfc7313.md — enhanced route refresh
route_refresh/handler
Design: docs/architecture/api/commands.md — BGP route refresh command handlers Overview: ../register.go — bgp-route-refresh SDK plugin registration
Design: docs/architecture/api/commands.md — BGP route refresh command handlers Overview: ../register.go — bgp-route-refresh SDK plugin registration
route_refresh/yang
Package yang embeds and registers the BGP route-refresh YANG schema modules.
Package yang embeds and registers the BGP route-refresh YANG schema modules.
rpki
Design: docs/architecture/plugin/rib-storage-design.md -- ASPA record cache Overview: rpki.go -- plugin using this cache for ASPA path verification Related: roa_cache.go -- ROA cache following the same pattern
Design: docs/architecture/plugin/rib-storage-design.md -- ASPA record cache Overview: rpki.go -- plugin using this cache for ASPA path verification Related: roa_cache.go -- ROA cache following the same pattern
rpki/yang
Package yang embeds and registers the RPKI YANG schema module.
Package yang embeds and registers the RPKI YANG schema module.
rpki_decorator
Package rpki_decorator provides the bgp-rpki-decorator plugin.
Package rpki_decorator provides the bgp-rpki-decorator plugin.
rpki_decorator/yang
Package yang embeds and registers the RPKI decorator YANG schema module.
Package yang embeds and registers the RPKI decorator YANG schema module.
rr
rr/yang
Package yang embeds and registers the BGP route-reflector command YANG schema module.
Package yang embeds and registers the BGP route-reflector command YANG schema module.
rs
rs/yang
Package yang embeds and registers the BGP route-server configuration YANG schema module.
Package yang embeds and registers the BGP route-server configuration YANG schema module.
softver
Design: docs/architecture/core-design.md — software-version capability plugin
Design: docs/architecture/core-design.md — software-version capability plugin
softver/yang
Package yang embeds and registers the BGP software-version capability YANG schema module.
Package yang embeds and registers the BGP software-version capability YANG schema module.
watchdog
Design: docs/architecture/rib-transition.md — watchdog plugin extraction Detail: server.go — command dispatch and state management Detail: config.go — config tree parser Detail: pool.go — route pool management
Design: docs/architecture/rib-transition.md — watchdog plugin extraction Detail: server.go — command dispatch and state management Detail: config.go — config tree parser Detail: pool.go — route pool management
Package reactor implements the BGP reactor event loop, managing peer sessions, processing wire events, and dispatching messages to plugins.
Package reactor implements the BGP reactor event loop, managing peer sessions, processing wire events, and dispatching messages to plugins.
filter
Design: docs/architecture/core-design.md — route loop detection ingress filter RFC: rfc/short/rfc4271.md RFC: rfc/short/rfc4456.md
Design: docs/architecture/core-design.md — route loop detection ingress filter RFC: rfc/short/rfc4271.md RFC: rfc/short/rfc4456.md
filter/yang
Package yang embeds and registers the BGP loop-detection filter YANG schema module.
Package yang embeds and registers the BGP loop-detection filter YANG schema module.
Package redistribute bridges BGP RIB best-path changes into the generic redistribution subsystem and injects redistributed routes back as BGP updates.
Package redistribute bridges BGP RIB best-path changes into the generic redistribution subsystem and injects redistributed routes back as BGP updates.
Package rib implements the BGP Routing Information Base with per-attribute-type deduplication.
Package rib implements the BGP Routing Information Base with per-attribute-type deduplication.
Package route parses text-format BGP route definitions into wire-ready attributes and NLRI.
Package route parses text-format BGP route definitions into wire-ready attributes and NLRI.
Package server provides BGP-specific event delivery and dispatch for the plugin server.
Package server provides BGP-specific event delivery and dispatch for the plugin server.
Design: docs/architecture/pool-architecture.md — attribute and NLRI storage
Design: docs/architecture/pool-architecture.md — attribute and NLRI storage
Package textparse provides a zero-allocation tokenizer and keyword resolution for BGP text commands.
Package textparse provides a zero-allocation tokenizer and keyword resolution for BGP text commands.
Package transaction manages named BGP commits that queue route announcements and withdrawals until they are ended or rolled back.
Package transaction manages named BGP commits that queue route announcements and withdrawals until they are ended or rolled back.
Package types defines shared BGP-specific types for routes, next-hops, and reactor interfaces.
Package types defines shared BGP-specific types for routes, next-hops, and reactor interfaces.
Package wireu ("wire UPDATE") implements lazy-parsed BGP UPDATE messages with zero-copy iterators over wire bytes.
Package wireu ("wire UPDATE") implements lazy-parsed BGP UPDATE messages with zero-copy iterators over wire bytes.
Package schema embeds the YANG schemas for BGP configuration and API.
Package schema embeds the YANG schemas for BGP configuration and API.

Jump to

Keyboard shortcuts

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