|
OpenSDN source code
|
This class represents an array of BGP Large Community values. A LargeCommunity consists of one or more 12-byte tuples. This class provides manipulation (append, remove, set), comparison, hashing, and conversion to/from human-readable formats. More...
#include <community.h>

Public Types | |
| typedef boost::array< uint8_t, 12 > | LargeCommunityValue |
| A single Large Community value. More... | |
| typedef std::vector< LargeCommunityValue > | LargeCommunityList |
| A list (vector) of LargeCommunityValue items. More... | |
Public Member Functions | |
| LargeCommunity (LargeCommunityDB *largecomm_db) | |
| Constructs an instance of the class and links to the given LargeCommunityDB instance. More... | |
| LargeCommunity (const LargeCommunity &rhs) | |
| Copy constructor. More... | |
| LargeCommunity (LargeCommunityDB *largecomm_db, const LargeCommunitySpec spec) | |
| Constructs an instance of the class using the given LargeCommunitySpec and links to the given LargeCommunityDB instance. More... | |
| virtual | ~LargeCommunity () |
| Destroys an instance. More... | |
| virtual void | Remove () |
| Remove this community. More... | |
| int | CompareTo (const LargeCommunity &rhs) const |
| Compare this LargeCommunity to another. More... | |
| const LargeCommunityList & | communities () const |
| Get the list of Large Community values. More... | |
| std::vector< uint64_t > | GetTagList (as_t asn=0) const |
| Get the list of tags with the specified ASN. More... | |
Static Public Member Functions | |
| static LargeCommunityList | LargeCommunityFromString (const std::string &comm) |
| Parse a string into a list of LargeCommunity values. More... | |
| static LargeCommunityValue | FromHexString (const std::string &comm, boost::system::error_code *errorp) |
| Convert a hexadecimal string to a LargeCommunityValue. More... | |
| static bool | is_tag (const LargeCommunityValue &val) |
| Check if the LargeCommunity value is tag. More... | |
| static std::string | ToString (const LargeCommunityValue &val) |
| Convert a LargeCommunityValue to a human-readable string. More... | |
| static std::string | ToHexString (const LargeCommunityValue &val) |
| Convert a LargeCommunityValue to a hexadecimal string. More... | |
Private Member Functions | |
| void | Append (const LargeCommunityValue &value) |
| Append a single LargeCommunity value. More... | |
| void | Append (const LargeCommunityList &list) |
| Append a list of LargeCommunity values. More... | |
| void | Remove (const LargeCommunityList &list) |
| Remove specific LargeCommunity values. More... | |
| void | RemoveTag () |
| Remove all the tags. More... | |
| void | Set (const LargeCommunityList &list) |
| Replace all existing values with the provided list. More... | |
Private Attributes | |
| tbb::atomic< int > | refcount_ |
| A reference counter, needed for memory management. More... | |
| LargeCommunityDB * | largecomm_db_ |
| A pointer to the managing LargeCommunityDB. More... | |
| LargeCommunityList | communities_ |
| A list of LargeCommunity storing BGP Large Community values. More... | |
Friends | |
| class | LargeCommunityDB |
| Enables the access to private members for LargeCommunityDB. More... | |
| class | BgpAttrTest |
| Enables the access to private members for BgpAttrTest. More... | |
| std::size_t | hash_value (LargeCommunity const &comm) |
| Compute the hash value for a LargeCommunity object. More... | |
| int | intrusive_ptr_add_ref (const LargeCommunity *clargecomm) |
| Increment reference count atomically. More... | |
| int | intrusive_ptr_del_ref (const LargeCommunity *clargecomm) |
| Decrement reference count of an clargecomm. More... | |
| void | intrusive_ptr_release (const LargeCommunity *clargecomm) |
| Release a LargeCommunity instance when the reference count reaches zero. More... | |
This class represents an array of BGP Large Community values. A LargeCommunity consists of one or more 12-byte tuples. This class provides manipulation (append, remove, set), comparison, hashing, and conversion to/from human-readable formats.
Definition at line 548 of file community.h.
| typedef std::vector<LargeCommunityValue> LargeCommunity::LargeCommunityList |
A list (vector) of LargeCommunityValue items.
Definition at line 554 of file community.h.
| typedef boost::array<uint8_t, 12> LargeCommunity::LargeCommunityValue |
A single Large Community value.
Definition at line 551 of file community.h.
|
inlineexplicit |
Constructs an instance of the class and links to the given LargeCommunityDB instance.
Definition at line 558 of file community.h.
|
inlineexplicit |
Copy constructor.
Definition at line 564 of file community.h.
|
explicit |
Constructs an instance of the class using the given LargeCommunitySpec and links to the given LargeCommunityDB instance.
Definition at line 1128 of file community.cc.

|
inlinevirtual |
Destroys an instance.
Definition at line 577 of file community.h.
|
private |
Append a list of LargeCommunity values.
Definition at line 1017 of file community.cc.
|
private |
Append a single LargeCommunity value.
Definition at line 1025 of file community.cc.
|
inline |
Get the list of Large Community values.
Definition at line 586 of file community.h.
| int LargeCommunity::CompareTo | ( | const LargeCommunity & | rhs | ) | const |
Compare this LargeCommunity to another.
Definition at line 982 of file community.cc.
|
static |
Convert a hexadecimal string to a LargeCommunityValue.
Definition at line 1033 of file community.cc.

| vector< uint64_t > LargeCommunity::GetTagList | ( | as_t | asn = 0 | ) | const |
Get the list of tags with the specified ASN.
Definition at line 1109 of file community.cc.

|
inlinestatic |
Check if the LargeCommunity value is tag.
Definition at line 613 of file community.h.
|
static |
Parse a string into a list of LargeCommunity values.
Definition at line 1066 of file community.cc.

|
virtual |
Remove this community.
Definition at line 1005 of file community.cc.

|
private |
Remove specific LargeCommunity values.
Definition at line 998 of file community.cc.
|
private |
Remove all the tags.
Definition at line 1098 of file community.cc.

|
private |
Replace all existing values with the provided list.
Definition at line 1009 of file community.cc.
|
static |
Convert a LargeCommunityValue to a hexadecimal string.
Definition at line 1081 of file community.cc.
|
static |
Convert a LargeCommunityValue to a human-readable string.
Definition at line 1090 of file community.cc.

|
friend |
Enables the access to private members for BgpAttrTest.
Definition at line 634 of file community.h.
|
friend |
Compute the hash value for a LargeCommunity object.
Definition at line 602 of file community.h.
|
friend |
Increment reference count atomically.
Definition at line 656 of file community.h.
|
friend |
Decrement reference count of an clargecomm.
Definition at line 661 of file community.h.
|
friend |
Release a LargeCommunity instance when the reference count reaches zero.
Definition at line 667 of file community.h.
|
friend |
Enables the access to private members for LargeCommunityDB.
Definition at line 632 of file community.h.
|
private |
A list of LargeCommunity storing BGP Large Community values.
Definition at line 652 of file community.h.
|
private |
A pointer to the managing LargeCommunityDB.
Definition at line 650 of file community.h.
|
mutableprivate |
A reference counter, needed for memory management.
Definition at line 648 of file community.h.