xorp

TwoHopLink Class Reference

A link between a Neighbor and a TwoHopNeighbor. More...

#include <twohop.hh>

List of all members.

Public Member Functions

 TwoHopLink (EventLoop &ev, Neighborhood *parent, OlsrTypes::TwoHopLinkID tlid, Neighbor *nexthop, const TimeVal &vtime)
OlsrTypes::TwoHopLinkID id () const
Neighbornexthop () const
TwoHopNeighbordestination () const
void set_destination (TwoHopNeighbor *destination)
 Set the cached destination pointer.
OlsrTypes::FaceID face_id () const
double near_etx () const
double far_etx () const
void set_face_id (const OlsrTypes::FaceID faceid)
 Set the ID of the interface where this link was last heard.
void set_near_etx (const double &near_etx)
 Set the ETX measurement at near end of link.
void set_far_etx (const double &far_etx)
 Set the ETX measurement at far end of link.
TimeVal time_remaining () const
void update_timer (const TimeVal &vtime)
 Update this link's expiry timer.
void event_dead ()
 Callback method to: tell the parent that this two-hop link has now expired.

Private Attributes

EventLoop_ev
Neighborhood_parent
OlsrTypes::TwoHopLinkID _id
 A unique identifier for this object.
Neighbor_nexthop
 The strict one-hop neighbor used to reach the two-hop neighbor referenced by _far_id.
TwoHopNeighbor_destination
 The two-hop neighbor at the end of this link.
OlsrTypes::FaceID _face_id
 The ID of the interface where the advertisement of this link was last heard.
XorpTimer _expiry_timer
 The time at which this two-hop link expires.
double _near_etx
 The ETX as measured at the near end of this link.
double _far_etx
 The ETX as measured at the far end of this link.

Detailed Description

A link between a Neighbor and a TwoHopNeighbor.

Association class between TwoHopNeighbor and Neighbor. TwoHopNeighbor cannot exist without TwoHopLink. Like Link and Neighbor, there is a co-dependent relationship. Both TwoHopNeighbor and TwoHopLink cannot exist without Neighbor.

TwoHopLinks are uniquely identified by the ID of the two-hop neighbor at the far end, and the Neighbor at the near end. When the last TwoHopLink associated with a TwoHopNeighbor is deleted, the TwoHopNeighbor MUST be deleted, to conform to the relations in the RFC.


Member Function Documentation

TwoHopNeighbor* TwoHopLink::destination ( ) const [inline]
Returns:
A pointer to the strict two-hop neighbor at the far end of this link.
OlsrTypes::FaceID TwoHopLink::face_id ( ) const [inline]
Returns:
The ID of the interface where the advertisement of this TwoHopLink was last heard by a Neighbor.
double TwoHopLink::far_etx ( ) const [inline]
Returns:
ETX measurement at far end of link.
OlsrTypes::TwoHopLinkID TwoHopLink::id ( ) const [inline]
Returns:
A unique identifier for this link in the two-hop neighborhood.
double TwoHopLink::near_etx ( ) const [inline]
Returns:
ETX measurement at near end of link.
Neighbor* TwoHopLink::nexthop ( ) const [inline]
Returns:
A pointer to the strict one-hop neighbor at the near end of this link.
void TwoHopLink::set_destination ( TwoHopNeighbor destination) [inline]

Set the cached destination pointer.

Parameters:
destinationthe TwoHopNeighbor at the end of this link.
void TwoHopLink::set_face_id ( const OlsrTypes::FaceID  faceid) [inline]

Set the ID of the interface where this link was last heard.

Parameters:
faceidthe ID of the interface.
void TwoHopLink::set_far_etx ( const double &  far_etx) [inline]

Set the ETX measurement at far end of link.

Parameters:
far_etxfar end ETX measurement.
void TwoHopLink::set_near_etx ( const double &  near_etx) [inline]

Set the ETX measurement at near end of link.

Parameters:
near_etxnear end ETX measurement.
TimeVal TwoHopLink::time_remaining ( ) const [inline]
Returns:
the amount of time remaining until this two-hop link expires.
void TwoHopLink::update_timer ( const TimeVal vtime)

Update this link's expiry timer.

Parameters:
vtimethe amount of time from now til when the link expires.

Member Data Documentation

double TwoHopLink::_far_etx [private]

The ETX as measured at the far end of this link.

Optional.

double TwoHopLink::_near_etx [private]

The ETX as measured at the near end of this link.

Optional.


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