OpenSDN source code
TagLC Class Reference

Represents a single BGP Large Community tag. More...

#include <tag.h>

Public Types

typedef boost::array< uint8_t, kSizebytes_type
 Raw 12-byte type representing the community on the wire. More...
 

Public Member Functions

 TagLC (const bytes_type &data)
 Construct from a raw 12-byte value. More...
 
 TagLC (as_t asn, uint64_t tag)
 Construct from AS number and tag value. More...
 
std::string ToString () const
 Returns a string representation. More...
 
bool IsGlobal () const
 Returns true if this tag belongs to a global community. More...
 
as_t as_number () const
 Returns the AS number. More...
 
uint64_t tag () const
 Returns the tag id. More...
 
const std::vector< uint32_t > GetLargeCommunityValue () const
 Returns the community value as a vector of 3 32-bit integers. More...
 

Static Public Attributes

static const int kSize = 12
 Fixed size (in bytes) of a BGP Large Community value. More...
 
static const int kMinGlobalId = 8000000
 Minimum tag id to belong to a global community. More...
 

Private Attributes

bytes_type data_
 Raw 12-byte encoded Large Community value. More...
 

Detailed Description

Represents a single BGP Large Community tag.

Definition at line 16 of file bgp/large-community/tag.h.

Member Typedef Documentation

◆ bytes_type

typedef boost::array<uint8_t, kSize> TagLC::bytes_type

Raw 12-byte type representing the community on the wire.

Definition at line 23 of file bgp/large-community/tag.h.

Constructor & Destructor Documentation

◆ TagLC() [1/2]

TagLC::TagLC ( const bytes_type data)
explicit

Construct from a raw 12-byte value.

Definition at line 18 of file bgp/large-community/tag.cc.

◆ TagLC() [2/2]

TagLC::TagLC ( as_t  asn,
uint64_t  tag 
)
explicit

Construct from AS number and tag value.

Definition at line 22 of file bgp/large-community/tag.cc.

Here is the call graph for this function:

Member Function Documentation

◆ as_number()

as_t TagLC::as_number ( ) const

Returns the AS number.

Definition at line 28 of file bgp/large-community/tag.cc.

Here is the call graph for this function:

◆ GetLargeCommunityValue()

const std::vector<uint32_t> TagLC::GetLargeCommunityValue ( ) const
inline

Returns the community value as a vector of 3 32-bit integers.

Definition at line 40 of file bgp/large-community/tag.h.

Here is the call graph for this function:

◆ IsGlobal()

bool TagLC::IsGlobal ( ) const

Returns true if this tag belongs to a global community.

Definition at line 44 of file bgp/large-community/tag.cc.

Here is the call graph for this function:

◆ tag()

uint64_t TagLC::tag ( ) const

Returns the tag id.

Definition at line 36 of file bgp/large-community/tag.cc.

Here is the call graph for this function:

◆ ToString()

string TagLC::ToString ( ) const

Returns a string representation.

Definition at line 48 of file bgp/large-community/tag.cc.

Here is the call graph for this function:

Member Data Documentation

◆ data_

bytes_type TagLC::data_
private

Raw 12-byte encoded Large Community value.

Definition at line 51 of file bgp/large-community/tag.h.

◆ kMinGlobalId

const int TagLC::kMinGlobalId = 8000000
static

Minimum tag id to belong to a global community.

Definition at line 21 of file bgp/large-community/tag.h.

◆ kSize

const int TagLC::kSize = 12
static

Fixed size (in bytes) of a BGP Large Community value.

Definition at line 19 of file bgp/large-community/tag.h.


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