xorp

TwoHopNeighbor Class Reference

A two-hop neighbor. More...

#include <twohop.hh>

List of all members.

Public Member Functions

 TwoHopNeighbor (EventLoop &ev, Neighborhood *parent, const OlsrTypes::TwoHopNodeID id, const IPv4 &main_addr, const OlsrTypes::TwoHopLinkID tlid)
OlsrTypes::TwoHopNodeID id () const
IPv4 main_addr () const
string toStringBrief ()
void add_twohop_link (const OlsrTypes::TwoHopLinkID tlid)
 Associate this N2 with an N1, using an instance of the association class TwoHopLink.
bool delete_twohop_link (const OlsrTypes::TwoHopLinkID tlid)
 Delete the given N1 from the set of Neighbors which may be used to reach this N2.
size_t delete_all_twohop_links ()
const set
< OlsrTypes::TwoHopLinkID > & 
twohop_links () const
void add_covering_mpr (const OlsrTypes::NeighborID nid)
 Add the given neighbor as an MPR which covers this node.
void withdraw_covering_mpr (const OlsrTypes::NeighborID nid)
 Withdraw the given neighbor as an MPR which covers this node.
void reset_covering_mprs ()
 Reset the MPR coverage state for this N2 node.
uint32_t coverage () const
bool is_covered () const
uint32_t reachability () const
void set_reachability (uint32_t value)
 Set this N2's reachability.
bool is_reachable () const
bool is_strict () const
void set_is_strict (bool is_strict)
 Set if this N2 is a strict two-hop neighbor.
const set
< OlsrTypes::TwoHopLinkID > & 
twohop_links ()

Private Attributes

EventLoop_ev
Neighborhood_parent
OlsrTypes::TwoHopNodeID _id
 Unique ID of this N2 node.
IPv4 _main_addr
 N_2hop_addr protocol variable.
bool _is_strict
 true if this N2 is NOT also an N1 node.
uint32_t _coverage
 The number of strict N1 which can reach this strict N2, and which have been selected as MPRs by the Neighborhood.
uint32_t _reachability
 The number of strict N1 which can reach this strict N2.
set< OlsrTypes::TwoHopLinkID_twohop_links
 Links by which this two-hop neighbor is reachable.

Detailed Description

A two-hop neighbor.

When the last link expires, the entire instance expires.


Member Function Documentation

void TwoHopNeighbor::add_covering_mpr ( const OlsrTypes::NeighborID  nid)

Add the given neighbor as an MPR which covers this node.

Parameters:
nidthe N to count as one of this N2's covering nodes.
void TwoHopNeighbor::add_twohop_link ( const OlsrTypes::TwoHopLinkID  tlid)

Associate this N2 with an N1, using an instance of the association class TwoHopLink.

Parameters:
tlidthe ID of a two-hop link.
uint32_t TwoHopNeighbor::coverage ( ) const [inline]
Returns:
The number of MPRs which cover this node.
bool TwoHopNeighbor::delete_twohop_link ( const OlsrTypes::TwoHopLinkID  tlid)

Delete the given N1 from the set of Neighbors which may be used to reach this N2.

Parameters:
tlidthe ID of a two-hop link.
Returns:
true if the last link to the TwoHopNeighbor was removed.
bool TwoHopNeighbor::is_covered ( ) const [inline]
Returns:
true if this N2 is covered by at least N1.
bool TwoHopNeighbor::is_reachable ( ) const [inline]
Returns:
true if this N2 is reachable.
bool TwoHopNeighbor::is_strict ( ) const [inline]
Returns:
true if this N2 is strict.

An N2 is strict if it appears only in the two-hop neighborhood, and not in the one-hop neighborhood.

uint32_t TwoHopNeighbor::reachability ( ) const [inline]
Returns:
The number of MPR candidates which cover this node. This is not computed here but by Neighborhood, the parent. Note: This is NOT the same as a neighbor's reachability.
void TwoHopNeighbor::set_is_strict ( bool  is_strict) [inline]

Set if this N2 is a strict two-hop neighbor.

Parameters:
is_stricttrue if this N2 does NOT also appear as an N1.
const set<OlsrTypes::TwoHopLinkID>& TwoHopNeighbor::twohop_links ( ) [inline]
Returns:
the set of two-hop links pointing to this N2 node.
void TwoHopNeighbor::withdraw_covering_mpr ( const OlsrTypes::NeighborID  nid)

Withdraw the given neighbor as an MPR which covers this node.

Parameters:
nidthe N to count as one of this N2's covering nodes.

Member Data Documentation

N_2hop_addr protocol variable.

Main protocol address of this N2 node.


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