xorp

Vertex Class Reference

A vertex in the shortest path tree. More...

#include <vertex.hh>

List of all members.

Public Member Functions

 Vertex ()
 Default constructor for Vertex.
 Vertex (const Neighbor &n)
 Explicit constructor to: Create a Vertex from a Neighbor.
 Vertex (const TwoHopNeighbor &n2)
 Explicit constructor to: Create a Vertex from a TwoHopNeighbor.
 Vertex (const IPv4 &main_addr)
 Explicit constructor to: Create a Vertex from a protocol address.
 Vertex (const TopologyEntry &tc)
 Explicit constructor to: Create a Vertex from a topology control tuple.
bool operator< (const Vertex &other) const
 Compare two Vertex instances for less-than ordering.
bool operator== (const Vertex &other) const
 Compare two Vertex instances for equality.
void set_main_addr (const IPv4 &main_addr)
IPv4 main_addr () const
void set_nodeid (uint32_t nid)
uint32_t nodeid () const
void set_is_origin (bool v)
bool is_origin () const
void set_producer (const IPv4 &producer)
IPv4 producer () const
void set_faceid (const OlsrTypes::FaceID fid)
OlsrTypes::FaceID faceid () const
const LogicalLinklink () const
void set_link (const LogicalLink *l)
const TwoHopLinktwohop_link () const
void set_twohop_link (const TwoHopLink *l2)
void set_type (const OlsrTypes::VertexType t)
OlsrTypes::VertexType type () const
string str () const
bool operator< (const Vertex &other) const
bool operator== (const Vertex &other) const
void set_version (OspfTypes::Version v)
OspfTypes::Version get_version () const
void set_type (OspfTypes::VertexType t)
OspfTypes::VertexType get_type () const
void set_nodeid (uint32_t nodeid)
uint32_t get_nodeid () const
void set_lsa (Lsa::LsaRef lsar)
 OSPFv2 only.
Lsa::LsaRef get_lsa () const
 OSPFv2 only.
list< Lsa::LsaRef > & get_lsas ()
 OSPFv3 only.
void set_interface_id (uint32_t interface_id)
uint32_t get_interface_id () const
void set_origin (bool origin)
bool get_origin () const
void set_address (IPv4 address)
IPv4 get_address_ipv4 () const
void set_address (IPv6 address)
IPv6 get_address_ipv6 () const
void set_nexthop_id (uint32_t nexthop_id)
uint32_t get_nexthop_id () const
string str () const

Private Attributes

bool _is_origin
 true if this Vertex represents this OLSR router.
OlsrTypes::VertexType _t
 The type of node in the OLSR link state databases from which this Vertex is derived.
uint32_t _nodeid
 ID of the Neighbor, TwoHopNeighbor or TopologyEntry responsible for the creation of this vertex.
IPv4 _main_addr
 The main protocol address of the OLSR node is used as the unique node identifier in the shortest-path tree.
IPv4 _producer
 The main protocol address of the OLSR node from where this vertex was learned.
OlsrTypes::FaceID _faceid
 If the OLSR node which this vertex represents is directly connected to the origin, this is the FaceID which should be used to reach the next hop.
const LogicalLink_link
 If this is a one-hop neighbor vertex, this is the link which was chosen to reach the neighbor.
const TwoHopLink_twohop_link
 If this is a two-hop neighbor vertex, this is the link which was chosen to reach it.
OspfTypes::Version _version
OspfTypes::VertexType _t
uint32_t _interface_id
bool _origin
IPv4 _address_ipv4
IPv6 _address_ipv6
uint32_t _nexthop_id
list< Lsa::LsaRef_lsars

Detailed Description

A vertex in the shortest path tree.

Vertex required for computing the shortest path tree.


Constructor & Destructor Documentation

Vertex::Vertex ( const Neighbor n) [inline, explicit]

Explicit constructor to: Create a Vertex from a Neighbor.

A neighbor vertex is learned from the neighbor itself, so mark it as the producer.

Parameters:
nthe Neighbor represented by this Vertex.
Vertex::Vertex ( const TwoHopNeighbor n2) [inline, explicit]

Explicit constructor to: Create a Vertex from a TwoHopNeighbor.

The producer of a two-hop vertex is the one-hop neighbor which advertised the link we choose to reach it, which we set after creation using set_producer().

The face ID is not known until the SPT calculation has run and paths have been chosen; it will be that of the path selected at radius = 1.

Parameters:
n2the TwoHopNeighbor represented by this Vertex.
Vertex::Vertex ( const IPv4 main_addr) [inline, explicit]

Explicit constructor to: Create a Vertex from a protocol address.

Typically used for sanity checking when populating the SPT from OLSR's TC database.

Vertex::Vertex ( const TopologyEntry tc) [inline, explicit]

Explicit constructor to: Create a Vertex from a topology control tuple.

The producer of a TC vertex is the OLSR node which advertised the TC entry from which the vertex has been created.


Member Function Documentation

Lsa::LsaRef Vertex::get_lsa ( ) const [inline]

OSPFv2 only.

Get the LSA that is responsible for this vertex.

list<Lsa::LsaRef>& Vertex::get_lsas ( ) [inline]

OSPFv3 only.

Return the list of LSAs that may be responsible for this vertex.

bool Vertex::is_origin ( ) const [inline]
Returns:
true if this node represents this router.
const LogicalLink* Vertex::link ( ) const [inline]
Returns:
the LogicalLink associated with a one-hop neighbor.
bool Vertex::operator< ( const Vertex other) const [inline]

Compare two Vertex instances for less-than ordering.

Collation order for sort: 1. Main address; always unique.

XXX The following two can't be relied upon... because differentiating them at all means we can't look up nodes purely by their address! 2. Is origin vertex: true, false. 3. Vertex type: origin, onehop, twohop, tc.

Parameters:
othernode to compare with.
Returns:
true if this node comes before the other node.
bool Vertex::operator== ( const Vertex other) const [inline]

Compare two Vertex instances for equality.

Comparison is performed solely on the main address of the node, which is always unique.

Parameters:
othernode to compare with.
Returns:
true if this node and the other node are equal.
void Vertex::set_lsa ( Lsa::LsaRef  lsar) [inline]

OSPFv2 only.

Set the LSA that is responsible for this vertex.

const TwoHopLink* Vertex::twohop_link ( ) const [inline]
Returns:
the TwoHopLink associated with a two-hop neighbor.

Member Data Documentation

The main protocol address of the OLSR node from where this vertex was learned.

In the routing CLI this is referred to as the origin; it is NOT the origin of the SPT graph.


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