Module bgpkit_parser::models
source · Expand description
bgp-models
module defines the basic BGP and MRT message data structures.
This library aims to provide building blocks for downstream libraries working with BGP and MRT messages such as MRT bgpkit-parser or BGP table constructor.
§Supported RFCs
Most of the structs defined in this library are named after the formal definitions in a number of RFCs. Here is a list of them:
§BGP
- RFC 2042: Registering New BGP Attribute Types
- RFC 3392: Capabilities Advertisement with BGP-4
- RFC 4271: A Border Gateway Protocol 4 (BGP-4)
- RFC 5065: Autonomous System Confederations for BGP
- RFC 6793: BGP Support for Four-Octet Autonomous System (AS) Number Space
- RFC 7911: Advertisement of Multiple Paths in BGP (ADD-PATH)
- RFC 9072: Extended Optional Parameters Length for BGP OPEN Message Updates
- RFC 9234: Route Leak Prevention and Detection Using Roles in UPDATE and OPEN Messages
§MRT
- RFC 6396: Multi-Threaded Routing Toolkit (MRT) Routing Information Export Format
- RFC 6397: Multi-Threaded Routing Toolkit (MRT) Border Gateway Protocol (BGP) Routing Information Export Format with Geo-Location Extensions
- RFC 8050: Multi-Threaded Routing Toolkit (MRT) Routing Information Export Format with BGP Additional Path Extensions
§Communities
§Communities
- RFC 1977: BGP Communities Attribute
§Extended Communities
- RFC 4360: BGP Extended Communities Attribute
- RFC 5668: 4-Octet AS Specific BGP Extended Community
- RFC 5701: IPv6 Address Specific BGP Extended Community Attribute
- RFC 7153: IANA Registries for BGP Extended Communities Updates 4360, 5701
- RFC 8097: BGP Prefix Origin Validation State Extended Community
§Large Communities
- RFC 8092: BGP Large Communities
§Other Informational
Modules§
- BGP attribute structs
- MRT BGP4MP structs
- BGP error code module that maintains explicit error codes assigned by IANA.
- MRT table dump version 1 and 2 structs
- MRT table dump version 2 structs
Structs§
- ASN – Autonomous System Number
- The high-order bit (bit 0) of the Attribute Flags octet is the Optional bit. It defines whether the attribute is optional (if set to 1) or well-known (if set to 0).
- BGP Attribute struct with attribute value and flag
- Convenience wrapper for a list of attributes
- BGP4MP message.
- BGP4MP state change message.
- BgpElem represents a per-prefix BGP element.
- BGP Open Message
- BGP Capability.
- MRT common header.
- Four-Octet AS Specific Extended Community
- IPv4 Address Specific Extended Community
- Large community structure as defined in RFC8092
- MrtRecord is a wrapper struct that contains a header and a message.
- A representation of a network prefix with an optional path ID.
- Network Layer Reachability Information
- Opaque Extended Community
- Peer struct.
- peer index table.
- AFI/SAFI-Specific RIB Subtypes.
- RIB entry.
- RIB generic entries subtype.
- TableDump message version 1
- Two-Octet AS Specific Extended Community
Enums§
- AFI – Address Family Identifier
- Enum of AS path segment.
- AS number length: 16 or 32 bits.
- Attribute types.
- Category of an attribute.
- The
AttributeValue
enum represents different kinds of Attribute values. - BGP4MP message types.
- BGP4MP message subtypes.
- BGP Error Subcode enum.
- BGP Role
- BGP states enum.
- BGP Cease NOTIFICATION message subcodes
- ElemType
- MRT entry type.
- Extended Communities.
- Type definitions of extended communities
- BGP Finite State Machine Error Subcodes
- Message Header Error subcodes
- enum that represents the type of the next hop address.
- OPEN Message Error subcodes
- BGP ROUTE-REFRESH Message Error subcodes
- SAFI – Subsequent Address Family Identifier
- TableDump message version 2 enum
- TableDump version 2 subtypes.
- UPDATE Message Error subcodes
Functions§
- Validate the local-remote BGP Role pairs.