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§
- attributes
- BGP attribute structs
- bgp4mp
- MRT BGP4MP structs
- capabilities
- community
- elem
- error
- BGP error code module that maintains explicit error codes assigned by IANA.
- role
- table_
dump - MRT table dump version 1 and 2 structs
- table_
dump_ v2 - MRT table dump version 2 structs
Structs§
- AsPath
- AsPath
Route Iter - Asn
- ASN – Autonomous System Number
- Attr
Flags - 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).
- AttrRaw
- Attribute
- BGP Attribute struct with attribute value and flag
- Attributes
- Convenience wrapper for a list of attributes
- Bgp4
MpMessage - BGP4MP message.
- Bgp4
MpState Change - BGP4MP state change message.
- BgpElem
- BgpElem represents a per-prefix BGP element.
- BgpNotification
Message - BgpOpen
Message - BGP Open Message
- BgpUpdate
Message - Capability
- BGP Capability.
- Common
Header - MRT common header.
- Four
Octet AsExt Community - Four-Octet AS Specific Extended Community
- Ipv4
Addr ExtCommunity - IPv4 Address Specific Extended Community
- Ipv6
Addr ExtCommunity - Large
Community - Large community structure as defined in RFC8092
- Meta
Communities Iter - MpReachable
Nlri - MpUnreachable
Nlri - MrtRecord
- MrtRecord is a wrapper struct that contains a header and a message.
- Network
Prefix - A representation of a network prefix with an optional path ID.
- Nlri
- Network Layer Reachability Information
- Opaque
ExtCommunity - Opaque Extended Community
- OptParam
- Peer
- Peer struct.
- Peer
Index Table - peer index table.
- Peer
Type - RibAfi
Entries - AFI/SAFI-Specific RIB Subtypes.
- RibEntry
- RIB entry.
- RibGeneric
Entries - RIB generic entries subtype.
- Table
Dump Message - TableDump message version 1
- TwoOctet
AsExt Community - Two-Octet AS Specific Extended Community
Enums§
- Afi
- AFI – Address Family Identifier
- AsPath
Segment - Enum of AS path segment.
- AsnLength
- AS number length: 16 or 32 bits.
- Attr
Type - Attribute types.
- Attribute
Category - Category of an attribute.
- Attribute
Value - The
AttributeValue
enum represents different kinds of Attribute values. - Bgp4
MpEnum - BGP4MP message types.
- Bgp4
MpType - BGP4MP message subtypes.
- BgpError
- BGP Error Subcode enum.
- BgpError
Code - BgpMessage
- BgpMessage
Type - BgpModels
Error - BgpRole
- BGP Role
- BgpState
- BGP states enum.
- Cease
Notification - BGP Cease NOTIFICATION message subcodes
- Community
- Elem
Type - ElemType
- Entry
Type - MRT entry type.
- Extended
Community - Extended Communities.
- Extended
Community Type - Type definitions of extended communities
- Finite
State Machine Error - BGP Finite State Machine Error Subcodes
- Message
Header Error - Message Header Error subcodes
- Meta
Community - MrtMessage
- Next
HopAddress - enum that represents the type of the next hop address.
- Open
Error - OPEN Message Error subcodes
- Origin
- Param
Value - Route
Refresh Error - BGP ROUTE-REFRESH Message Error subcodes
- Safi
- SAFI – Subsequent Address Family Identifier
- Table
Dump V2Message - TableDump message version 2 enum
- Table
Dump V2Type - TableDump version 2 subtypes.
- Update
Error - UPDATE Message Error subcodes
Functions§
- address_
family - get_
deprecated_ attr_ type - option_
to_ string_ communities - validate_
role_ pairs - Validate the local-remote BGP Role pairs.