Module 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
§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

§Other Informational

  • RFC 4384: BGP Communities for Data Collection BCP 114
  • RFC 8195: Use of BGP Large Communities (informational)
  • RFC 8642: Policy Behavior for Well-Known BGP Communities

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
AsPathRouteIter
Asn
ASN – Autonomous System Number
AttrFlags
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
Bgp4MpMessage
BGP4MP message.
Bgp4MpStateChange
BGP4MP state change message.
BgpElem
BgpElem represents a per-prefix BGP element.
BgpNotificationMessage
BgpOpenMessage
BGP Open Message
BgpUpdateMessage
Capability
BGP Capability.
CommonHeader
MRT common header.
FourOctetAsExtCommunity
Four-Octet AS Specific Extended Community
Ipv4AddrExtCommunity
IPv4 Address Specific Extended Community
Ipv6AddrExtCommunity
LargeCommunity
Large community structure as defined in RFC8092
MetaCommunitiesIter
MpReachableNlri
MpUnreachableNlri
MrtRecord
MrtRecord is a wrapper struct that contains a header and a message.
NetworkPrefix
A representation of a network prefix with an optional path ID.
Nlri
Network Layer Reachability Information
OpaqueExtCommunity
Opaque Extended Community
OptParam
Peer
Peer struct.
PeerIndexTable
peer index table.
PeerType
RibAfiEntries
AFI/SAFI-Specific RIB Subtypes.
RibEntry
RIB entry.
RibGenericEntries
RIB generic entries subtype.
TableDumpMessage
TableDump message version 1
TwoOctetAsExtCommunity
Two-Octet AS Specific Extended Community

Enums§

Afi
AFI – Address Family Identifier
AsPathSegment
Enum of AS path segment.
AsnLength
AS number length: 16 or 32 bits.
AttrType
Attribute types.
AttributeCategory
Category of an attribute.
AttributeValue
The AttributeValue enum represents different kinds of Attribute values.
Bgp4MpEnum
BGP4MP message types.
Bgp4MpType
BGP4MP message subtypes.
BgpError
BGP Error Subcode enum.
BgpErrorCode
BgpMessage
BgpMessageType
BgpModelsError
BgpRole
BGP Role
BgpState
BGP states enum.
CeaseNotification
BGP Cease NOTIFICATION message subcodes
Community
ElemType
ElemType
EntryType
MRT entry type.
ExtendedCommunity
Extended Communities.
ExtendedCommunityType
Type definitions of extended communities
FiniteStateMachineError
BGP Finite State Machine Error Subcodes
MessageHeaderError
Message Header Error subcodes
MetaCommunity
MrtMessage
NextHopAddress
enum that represents the type of the next hop address.
OpenError
OPEN Message Error subcodes
Origin
ParamValue
RouteRefreshError
BGP ROUTE-REFRESH Message Error subcodes
Safi
SAFI – Subsequent Address Family Identifier
TableDumpV2Message
TableDump message version 2 enum
TableDumpV2Type
TableDump version 2 subtypes.
UpdateError
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.

Type Aliases§

BgpIdentifier
SegmentIntoIter
SegmentIter
SegmentIterMut