class AsPath

An AsPath is a list of AsSegments, each of which can be an AS_SET, AS_CONFED_SET, AS_SEQUENCE, or an AS_CONFED_SEQUENCE. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods

Protected Members


Detailed Description

An AsPath is a list of AsSegments, each of which can be an AS_SET, AS_CONFED_SET, AS_SEQUENCE, or an AS_CONFED_SEQUENCE.

typedef list <AsSegment>::const_iterator const_iterator

const_iterator

typedef list <AsSegment>::iterator iterator

iterator

 AsPath ()

AsPath

 AsPath (const char *as_path)
throw(InvalidString)

AsPath

Initialize from a string in the format 1,2,(3,4,5),6,7,8,(9,10,11),12,13

 AsPath (const uint8_t* d, size_t len)
throw(CorruptMessage)

AsPath

construct from received data

 AsPath (const AsPath &asp1, const AsPath &asp2)

AsPath

construct an aggregate from two AsPaths

 AsPath (const AsPath &a)

AsPath

Copy constructor

 ~AsPath ()

~AsPath

void  add_segment (const AsSegment& s)

add_segment

void  prepend_segment (const AsSegment& s)

prepend_segment

size_t  path_length ()

path_length

[const]

bool  contains (const AsNum& as_num)

contains

[const]

const AsNum&  first_asnum ()

first_asnum

[const]

string  str ()

str

[const]

string  short_str ()

short_str

[const]

const AsSegment&  segment (size_t n)

segment

[const]

size_t  num_segments ()

num_segments

[const]

const uint8_t * encode (size_t &len, uint8_t *buf)

encode

[const]

Convert from internal to external representation, with the correct representation for the original AS_PATH attribute. If there are any 4-byte AS numbers, they will be encoded as AS_TRAN.

If we do not pass a buffer (buf = 0), then the routine will allocate a new one; otherwise, len indicates the size of the input buffer, which must be large enough to store the encoding.

Returns: the pointer to the buffer, len is the actual size.

size_t  wire_size ()

wire_size

[const]

Returns: the size of the list on the wire. XXX this should be made more efficient.

void  prepend_as (const AsNum &asn)

prepend_as

Add the As number to the begining of the AS_SEQUENCE that starts the As path, or if the AsPath starts with an AS_SET, then add a new AS_SEQUENCE with the new AsNum to the start of the AsPath

void  prepend_confed_as (const AsNum &asn)

prepend_confed_as

Add the As number to the begining of the AS_CONFED_SEQUENCE that starts the As path, or if the AsPath does not start with an AS_CONFED_SEQUENCE, then add a new AS_CONFED_SEQUENCE with the new AsNum to the start of the AsPath

void  remove_confed_segments ()

remove_confed_segments

remove all confederation segments from aspath

bool  contains_confed_segments ()

contains_confed_segments

[const]

Returns: true if the AS_PATH Contains confederation segments.

bool  operator== (const AsPath& him)

operator==

[const]

bool  operator< (const AsPath& him)

operator<

[const]

void  encode_for_mib (vector<uint8_t>& aspath)

encode_for_mib

[const]

bool  two_byte_compatible ()

two_byte_compatible

[const]

returns true if the AS path does not lose information when represented entirely as two-byte AS numbers

list <AsSegment> _segments

_segments

[protected]

size_t _num_segments

_num_segments

[protected]

size_t _path_len

_path_len

[protected]


Generated by: pavlin on possum.icir.org on Wed Mar 21 11:23:48 2007, using kdoc $.