xorp

FastPathAttributeList< A > Class Template Reference

List of all members.

Public Member Functions

 FastPathAttributeList (PAListRef< A > &palist)
 FastPathAttributeList (FastPathAttributeList< A > &fpalist)
 FastPathAttributeList (const NextHopAttribute< A > &nexthop, const ASPathAttribute &aspath, const OriginAttribute &origin)
void load_raw_data (const uint8_t *data, size_t size, const BGPPeerData *peer, bool have_nlri, BGPMain *mainprocess, bool do_checks)
 Load the raw path attribute data from an update message.
void lock () const
void unlock () const
bool is_locked () const
NextHopAttribute< A > * nexthop_att ()
ASPathAttributeaspath_att ()
AS4PathAttributeas4path_att ()
OriginAttributeorigin_att ()
MEDAttributemed_att ()
LocalPrefAttributelocal_pref_att ()
AtomicAggAttributeatomic_aggregate_att ()
AggregatorAttributeaggregator_att ()
CommunityAttributecommunity_att ()
OriginatorIDAttributeoriginator_id ()
ClusterListAttributecluster_list ()
template<typename A2 >
MPReachNLRIAttribute< A2 > * mpreach (Safi)
template<typename A2 >
MPUNReachNLRIAttribute< A2 > * mpunreach (Safi)
A & nexthop ()
ASPathaspath ()
OriginType origin ()
virtual bool complete () const
void add_path_attribute (const PathAttribute &att)
 Add this path attribute to the list after making a local copy.
void add_path_attribute (PathAttribute *att)
 Add this path attribute to the list don't make a local copy.
PathAttributefind_attribute_by_type (PathAttType type)
 return the relevant path attribute, given the PA type.
int max_att () const
 return the highest attribute type.
void process_unknown_attributes ()
 For unknown attributes: 1) If transitive set the partial bit.
void replace_nexthop (const A &nexthop)
void replace_AS_path (const ASPath &as_path)
void replace_origin (const OriginType &origin)
void remove_attribute_by_type (PathAttType type)
void remove_attribute_by_pointer (PathAttribute *)
bool encode (uint8_t *buf, size_t &wire_size, const BGPPeerData *peerdata) const
 Encode the PA List for transmission to the specified peer.
string str () const
void canonicalize () const
const uint8_t * canonical_data () const
size_t canonical_length () const
bool canonicalized () const
bool operator== (const FastPathAttributeList< A > &him) const
bool is_empty () const
int attribute_count () const

Private Member Functions

void quick_decode (const uint8_t *canonical_data, uint16_t canonical_length)
void replace_attribute (PathAttribute *att)
uint32_t att_order (uint32_t index) const
void count_attributes ()
bool encode_and_decode_attribute (const uint8_t *att_data, const size_t &att_len, uint8_t *buf, size_t &wire_size, const BGPPeerData *peerdata) const
 We need to encode an attribute to send to a peer.

Private Attributes

const PAListRef< A > _slave_pa_list
const uint8_t * _att_bytes [MAX_ATTRIBUTE+1]
size_t _att_lengths [MAX_ATTRIBUTE+1]
vector< PathAttribute * > _att
int _attribute_count
 A count of the number of attributes in this attribute list.
bool _locked
 We pass around ref_ptrs to FastPathAttributeLists for efficiency reasons, and this greatly simplifies memory management.
uint8_t * _canonical_data
uint16_t _canonical_length
bool _canonicalized

template<class A>
class FastPathAttributeList< A >


Member Function Documentation

template<class A >
bool FastPathAttributeList< A >::encode ( uint8_t *  buf,
size_t &  wire_size,
const BGPPeerData peerdata 
) const

Encode the PA List for transmission to the specified peer.

Note that as Some peers speak 4-byte AS numbers and some don't, the encoding is peer-specific.

Returns:
true if the data was successfully encoded; false if there wasn't enough space in the buffer for the data.
Parameters:
bufis the buffer to encode into.
wire_sizeis given the size of the buffer to encode into, and returns the amount of data placed in the buffer.
peeris the peer to encode this for. Some peers want 4-byte AS numbers and some don't.
template<class A >
bool FastPathAttributeList< A >::encode_and_decode_attribute ( const uint8_t *  att_data,
const size_t &  att_len,
uint8_t *  buf,
size_t &  wire_size,
const BGPPeerData peerdata 
) const [private]

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.

template<class A >
void FastPathAttributeList< A >::load_raw_data ( const uint8_t *  data,
size_t  size,
const BGPPeerData peer,
bool  have_nlri,
BGPMain mainprocess,
bool  do_checks 
)

Load the raw path attribute data from an update message.

This data will not yet be in canonical form. Call canonicalize() to put the data in canonical form.

template<class A >
void FastPathAttributeList< A >::process_unknown_attributes ( )

For unknown attributes: 1) If transitive set the partial bit.

2) If not transitive remove.


Member Data Documentation

template<class A>
bool FastPathAttributeList< A >::_locked [mutable, private]

We pass around ref_ptrs to FastPathAttributeLists for efficiency reasons, and this greatly simplifies memory management.

However, it makes it easy to store one temporarily in one place and the while it's stored, modify it via a reference somewhere else. This would be a bug, but it's hard to catch. We add the ability to lock the contents to detect such a condition and aid debugging.


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