as_path
as_local
as_local
structs. Each such struct contains
pertinent about each local AS that the router is running in.
as_path_data
as_path
block. That is, routines that manipulate as_path
structs that
have path attributes would cast that struct into a as_path_data
struct.
as_path_info
as_path
structure. The
non-transitive attributes are returned (and passed around) in this
structure.
as_path_list
PATH_GET_*
PATH_PUT_*
AS_PATH_LIST
AS_PATH_LIST_END
AS_LOCAL_FINDBIT
as_local_info
array. Given
a local AS, we find the position of that AS in this array and convert that
position into a 16-bit number with the bit corresponding to that position
set.
PATH_FREE_PATH
as_path
structs are allocated in 32 byte and 64 byte
blocks for the common cases when the structure fits entirely into
one of these blocks. Otherwise, it is malloc'd. path_size_list
is an array, the first element of which contains the number of 32 byte
blocks allocated and the second the number of 64 byte blocks allocated.
This macro frees the storage associated with an as_path
.
PATH_FIND_PATH
as_path
struct matching the given as_path
.
PATH_ADD
as_path
struct to the beginning of an overflow
chain on the hash bucket.
PATH_REMOVE
as_path
entry from the overflow
chain. To do this, scan the chain to find the previous element and
then unlink this element.
aslocal_set
as_local_info
stores all the local ASs sorted
by AS number. Insert a new AS into this array. Called at configuration
time.
aslocal_bit
as_local_info
array.
aslocal_cleanup
aslocal_reinit
.
aslocal_reinit
aspath_family_init
aspath_alloc
as_path
struct of the required length.
If it fits into the common-case lengths, allocate a block out of
one of those. Otherwise, malloc some memory of the requested length.
aspath_free
as_path
structure, irrespective
of whether it is in the hash table or not.
aspath_unlink
as_path
structure, assuming it
is in the hash table or not.
aspath_find
as_path
struct matches the one we are given,
return that instead. Otherwise, insert the one we are given and increment
the hop count.
aspath_insert_aspath
aspath_attr
when
parsing an incoming attribute list to store into an as_path
structure.
This moves the already parsed optional attributes to the end of
the as_path
structure creating room for the AS path
itself.
aspath_insert
as_path
structure at which to insert the attribute. Attributes are stored sorted
by code, so we insert the new attribute after moving south any existing
attributes.
aspath_attr
as_path
struct.
Basically, it allocates an as_path
struct of the same
size as the buffer we are handed (we could do a better job).
Then we basically look at each attribute (making sure there are no
duplicates and that there is enough data for the attribute).
Most of the attributes are processed in a straightforward manner:
transitive attributes are stored in the as_path
structure,
and non-transitive attributes are stored in an as_path_info
structure. The only complicated processing is performed for the AS
path.
The AS path attribute, in the incoming message, is a list of
type/length/list of ASs triples. In the as_path
struct,
this is stored as a list of all ASs followed by type/length tuples.
During the processing, successive triples which are AS sequences
are collapsed into a single AS sequences. AS sets are kept the same
but are ordered for ease of later processing.
aspath_format_v4
aspath_attr
function. This is similar
to the above in that the most complicated portion is the formatting
of the AS path attribute. Prior to walking down the list of ASs, we first
find out if we have to prepend our own AS number. If so, we do that
to every route and then appropriately create the type/length/value
triplets that we so carefully undid in the last message.
aspath_do_aggregation
rt_aggregate_flash()
.
Given a list of AS paths, we are required to find an AS path that
represents the aggregate. The idea behind the algorithm may be
found in Appendix A of
RFC 1654.
aspath_aggregate_changed
aspath_aggregate_free
as_path_list
structs (each such struct points to and AS path). This routine frees
the storage associated with the as_path_list
structs.
aspath_prefer