libbgp  0.6
A C++ BGP Library.
Public Member Functions | Public Attributes | List of all members
libbgp::BgpAsPathSegment Class Reference

An AS_PATH or AS4_PATH segment. More...

#include <bgp-path-attrib.h>

Public Member Functions

 BgpAsPathSegment (bool is_4b, uint8_t type)
 Construct a new Bgp As Path Segment:: Bgp As Path Segment object. More...
 
size_t getCount () const
 Get number of ASNs in the segment. More...
 
bool prepend (uint32_t asn)
 Prepend ASN to AS segment. More...
 

Public Attributes

bool is_4b
 Is ASNs in this segment four octets?
 
uint8_t type
 Segment type.
 
std::vector< uint32_t > value
 The segment value.
 

Detailed Description

An AS_PATH or AS4_PATH segment.

Definition at line 200 of file bgp-path-attrib.h.

Constructor & Destructor Documentation

◆ BgpAsPathSegment()

libbgp::BgpAsPathSegment::BgpAsPathSegment ( bool  is_4b,
uint8_t  type 
)

Construct a new Bgp As Path Segment:: Bgp As Path Segment object.

Parameters
is_4bEnable four octets ASN support.
typeType of AS path segment.

Definition at line 379 of file bgp-path-attrib.cc.

References libbgp::BgpPathAttribAsPath::is_4b.

Member Function Documentation

◆ getCount()

size_t libbgp::BgpAsPathSegment::getCount ( ) const

Get number of ASNs in the segment.

Returns
size_t Number of ASNs.

Definition at line 389 of file bgp-path-attrib.cc.

◆ prepend()

bool libbgp::BgpAsPathSegment::prepend ( uint32_t  asn)

Prepend ASN to AS segment.

Parameters
asnASN to prepend.
Returns
true ASN prepended.
false Failed to prepend ASN.

Definition at line 400 of file bgp-path-attrib.cc.

References libbgp::BgpPathAttribAsPath::is_4b.


The documentation for this class was generated from the following files: