When the last link expires, the entire instance expires.
TwoHopNeighbor (EventLoop& ev,
Neighborhood* parent,
const OlsrTypes::TwoHopNodeID id,
const IPv4& main_addr,
const OlsrTypes::TwoHopLinkID tlid)
| TwoHopNeighbor |
inline OlsrTypes::TwoHopNodeID id ()
| id |
[const]
inline IPv4 main_addr ()
| main_addr |
[const]
void add_twohop_link (const OlsrTypes::TwoHopLinkID tlid)
| add_twohop_link |
Associate this N2 with an N1, using an instance of the association class TwoHopLink.
Parameters:
tlid | the ID of a two-hop link. |
bool delete_twohop_link (const OlsrTypes::TwoHopLinkID tlid)
| delete_twohop_link |
Delete the given N1 from the set of Neighbors which may be used to reach this N2.
Parameters:
tlid | the ID of a two-hop link. |
Returns: true if the last link to the TwoHopNeighbor was removed.
size_t delete_all_twohop_links ()
| delete_all_twohop_links |
inline const set<OlsrTypes::TwoHopLinkID>& twohop_links ()
| twohop_links |
[const]
void add_covering_mpr (const OlsrTypes::NeighborID nid)
| add_covering_mpr |
Add the given neighbor as an MPR which covers this node.
Parameters:
nid | the N to count as one of this N2's covering nodes. |
void withdraw_covering_mpr (const OlsrTypes::NeighborID nid)
| withdraw_covering_mpr |
Withdraw the given neighbor as an MPR which covers this node.
Parameters:
nid | the N to count as one of this N2's covering nodes. |
void reset_covering_mprs ()
| reset_covering_mprs |
Reset the MPR coverage state for this N2 node.
inline uint32_t coverage ()
| coverage |
[const]
Returns: The number of MPRs which cover this node.
inline bool is_covered ()
| is_covered |
[const]
Returns: true if this N2 is covered by at least N1.
inline uint32_t reachability ()
| reachability |
[const]
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.
inline void set_reachability (uint32_t value)
| set_reachability |
inline bool is_reachable ()
| is_reachable |
[const]
Returns: true if this N2 is reachable.
bool is_strict ()
| is_strict |
[const]
An N2 is strict if it appears only in the two-hop neighborhood, and not in the one-hop neighborhood.
Returns: true if this N2 is strict.
void set_is_strict (bool is_strict)
| set_is_strict |
Set if this N2 is a strict two-hop neighbor.
Parameters:
is_strict | true if this N2 does NOT also appear as an N1. |
const set<OlsrTypes::TwoHopLinkID>& twohop_links ()
| twohop_links |
Returns: the set of two-hop links pointing to this N2 node.