xorp

CommunityAttribute Class Reference

Inheritance diagram for CommunityAttribute:
PathAttribute NONCOPYABLE

List of all members.

Public Types

typedef set< uint32_t >
::const_iterator 
const_iterator

Public Member Functions

 CommunityAttribute ()
 CommunityAttribute.
 CommunityAttribute (const uint8_t *d) throw (CorruptMessage)
PathAttributeclone () const
 Make a copy of the current attribute.
string str () const
 We need to encode an attribute to send to a peer.
const set< uint32_t > & community_set () const
void add_community (uint32_t community)
bool contains (uint32_t community) const
bool encode (uint8_t *buf, size_t &wire_size, const BGPPeerData *peerdata) const
 encode a path attribute.

Static Public Attributes

static const uint32_t NO_EXPORT = 0xFFFFFF01
static const uint32_t NO_ADVERTISE = 0xFFFFFF02
static const uint32_t NO_EXPORT_SUBCONFED = 0xFFFFFF03

Private Attributes

set< uint32_t > _communities

Member Function Documentation

PathAttribute * CommunityAttribute::clone ( ) const [virtual]

Make a copy of the current attribute.

The derived class should use new to generate a copy of itself. The wire format representation will not be used by the caller.

Implements PathAttribute.

bool CommunityAttribute::encode ( uint8_t *  buf,
size_t &  wire_size,
const BGPPeerData peerdata 
) const [virtual]

encode a path attribute.

In a sane world, we'd use a virtual function for this. But we store so many path attributes that we can't afford the overhead of a virtual function table for them, so we have to do this the hard way

XXX THE ABOVE IS NO LONGER THE CASE. WE SHOULD REWRITE THIS TO USE VIRTUAL FUNCTIONS

Implements PathAttribute.

string CommunityAttribute::str ( ) const [virtual]

We need to encode an attribute to send to a peer.

However we only have the canonically encoded byte stream data for it. Sometimes that is fine, and we should just send that; sometimes we need to decode and re-encode for this specific peer.

Reimplemented from PathAttribute.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations