class PathAttribute


Definition#include <path_attribute.hh>
Inherited byASPathAttribute, AggregatorAttribute, AtomicAggAttribute, CommunityAttribute, LocalPrefAttribute, MEDAttribute, NextHopAttribute, OriginAttribute, UnknownAttribute
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods

Protected Methods

Protected Static Methods

Protected Members


Detailed Description

enum Flags { Optional = 0x80, Transitive = 0x40, Partial = 0x20, Extended = 0x10, ValidFlags = 0xf0, NoFlags = 0 }

Flags

PathAttributecreate (const uint8_t* d, uint16_t max_len, size_t& actual_length)
throw(CorruptMessage)

create

[static]

main routine to create a PathAttribute from incoming data. Takes a chunk of memory of size l, returns an object of the appropriate type and actual_length is the number of bytes used from the packet. Throws an exception on error.

 ~PathAttribute ()

~PathAttribute

[virtual]

const uint8_t * data ()

data

[const]

size_t  wire_size ()

wire_size

[const]

Returns: the size of the wire representation.

size_t  header_size ()

header_size

[const]

Returns: the size of the header.

PathAttType  type ()

type

[const]

Returns: the type of the attribute

Flags  flags ()

flags

[const]

Returns: the flags for the attribute

bool  operator< (const PathAttribute& him)

operator<

[const]

comparison operators are used to sort attributes. Right now the sort order is based on the type, size() and payload representation.

bool  operator== (const PathAttribute& him)

operator==

[const]

void  add_hash (MD5_CTX *context)

add_hash

[const]

compute the hash for this object.

string  str ()

str

[const virtual]

void  pretty_print ()

pretty_print

bool  optional ()

optional

[const]

bool  transitive ()

transitive

[const]

bool  partial ()

partial

[const]

bool  extended ()

extended

[const]

bool  well_known ()

well_known

[const]

const int  sorttype ()

sorttype

[protected const]

sorttype() is only used in sorting a path attribute list. It is different from PathAttType because we want to sort the path attribute list on NextHop for less expensive processing when the IGP information for a nexthop changes. So we give priority to NEXT_HOP and keep other values unchanged.

 PathAttribute (Flags f, PathAttType t)

PathAttribute

[protected]

helper constructor used when creating an object from a derived class. NOTE: it does not provide a usable object as _data is invalid.

 PathAttribute (const uint8_t *d)

PathAttribute

[protected]

basic constructor from data, assumes that the block has at least the required size. NOTE: it does not provide a usable object as _data is invalid.

uint8_t * set_header (size_t payload_size)

set_header

[protected]

helper function to fill the header. Needs _flags and _type properly initialized, overwrites _size and _data by allocating a new block of appropriate size (payload_size + 3 or 4 header bytes).

size_t  length (const uint8_t* d)

length

[protected static]

fetch the length from the header. Assume the header is there.

const uint8_t * payload (const uint8_t *d)

payload

[protected]

size_t _size

_size

[protected]

uint8_t * _data

_data

[protected]

uint8_t _flags

_flags

[protected]

uint8_t _type

_type

[protected]


Generated by: pavlin on possum.icir.org on Mon Mar 10 19:34:59 2003, using kdoc 2.0a54+XORP.