class Neighborhood

Representation of OLSR node's one-hop and two-hop neighborhood. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods

Protected Types

Protected Methods


Detailed Description

Responsible for originating TC broadcasts when the node is selected as an MPR by other nodes.

 Neighborhood (Olsr& olsr, EventLoop& eventloop, FaceManager& fm)

Neighborhood

 ~Neighborhood ()

~Neighborhood

TopologyManager*  topology_manager ()

topology_manager

void  set_topology_manager (TopologyManager* tm)

set_topology_manager

RouteManager*  route_manager ()

route_manager

void  set_route_manager (RouteManager* rm)

set_route_manager

size_t  populate_hello (HelloMessage* hello)

populate_hello

Given an empty HELLO message, fill it out as appropriate for its interface ID property. If the message is not empty the results are undefined.

TODO: Support ETX measurements.

Parameters:

hellothe HELLO message to be filled out, which MUST contain the FaceID of where it is to be sent.

Returns: the number of link addresses, including neighbors which are not local to this link, filled out in hello.

void  push_topology ()

push_topology

Push the topology to the RouteManager for route computation.

When we do incremental SPT this can partially go away. The SPT can contain only one edge between each node -- the nested methods here deal with this.

bool  set_tc_redundancy (const OlsrTypes::TcRedundancyType type)

set_tc_redundancy

Attempt to set the redundancy of links advertised in TC broadcasts.

Parameters:

typethe new redundancy level to set.

Returns: true if the TC_REDUNDANCY was set to type.

OlsrTypes::TcRedundancyType  get_tc_redundancy ()

get_tc_redundancy

[const]

Returns: the value of the TC_REDUNDANCY protocol variable.

inline uint32_t  mpr_coverage ()

mpr_coverage

[const]

Returns: the value of the MPR_COVERAGE protocol variable.

bool  set_mpr_coverage (const uint32_t coverage)

set_mpr_coverage

Attempt to set the required level of MPR coverage.

If successful, and OLSR is running on any configured interface, the MPR set will be recalculated.

Parameters:

coveragethe new value of the MPR_COVERAGE variable.

Returns: true if the MPR_COVERAGE was set to coverage.

TimeVal  get_refresh_interval ()

get_refresh_interval

[const]

Returns: the value of the REFRESH_INTERVAL protocol variable.

void  set_refresh_interval (const TimeVal& interval)

set_refresh_interval

Set the value of the REFRESH_INTERVAL protocol variable.

Parameters:

intervalthe new value of REFRESH_INTERVAL..
TimeVal  get_tc_interval ()

get_tc_interval

Returns: the value of the TC_INTERVAL protocol variable.

void  set_tc_interval (const TimeVal& interval)

set_tc_interval

Set the interval between TC broadcasts.

The timer will only be restarted if previously scheduled. If the period of the TC broadcasts is changed, a TC broadcast is scheduled to take place immediately.

Parameters:

intervalthe new value of TC_INTERVAL.
void  set_willingness (const OlsrTypes::WillType willingness)

set_willingness

Set the WILLINGNESS protocol variable.

Parameters:

willingnessthe new value of the WILLINGNESS protocol variable.
OlsrTypes::WillType  willingness ()

willingness

[const]

Returns: the current value of the WILLINGNESS protocol variable.

TimeVal  get_neighbor_hold_time ()

get_neighbor_hold_time

Returns: the current value of the NEIGHB_HOLD_TIME protocol variable.

TimeVal  get_topology_hold_time ()

get_topology_hold_time

Returns: the current value of the TOP_HOLD_TIME protocol variable.

void  add_face (const OlsrTypes::FaceID faceid)

add_face

Add an interface to the neighborhood. Called whenever an instance of Face is configured administratively up.

Parameters:

faceidThe ID of the interface which has been configured administratively up.
void  delete_face (const OlsrTypes::FaceID faceid)

delete_face

Delete an interface from the neighborhood. Called whenever an instance of Face is configured administratively down.

Parameters:

faceidThe ID of the interface which has been configured administratively down.
OlsrTypes::LogicalLinkID  update_link ( const OlsrTypes::FaceID faceid, const IPv4& remote_addr, const IPv4& local_addr, const TimeVal& vtime, bool& is_created)
throw(BadLogicalLink)

update_link

Update a LogicalLink.

The link will be created if it does not exist. Links are specified by their remote and local interface addresses.

Parameters:

faceidthe ID of the interface where this link appears.
remote_addrthe protocol address of the remote interface at the far end of the link.
local_addrthe protocol address of the local interface at the near end of the link.
vtimethe validity time of the new link.
is_createdwill be set to true if the link did not previously exist and was created by this method.

Returns: the ID of the link tuple. @throw BadLogicalLink if the link could not be updated.

OlsrTypes::LogicalLinkID  add_link ( const TimeVal& vtime, const IPv4& remote_addr, const IPv4& local_addr)
throw(BadLogicalLink)

add_link

Add a link to the local link database.

Parameters:

vtimethe validity time of the new link.
remote_addrthe protocol address of the remote interface at the far end of the link.
local_addrthe protocol address of the local interface at the near end of the link.

Returns: the ID of the new link. @throw BadLogicalLink if the link could not be created.

bool  delete_link (OlsrTypes::LogicalLinkID linkid)

delete_link

Delete the link tuple specified by the given link id.

Note: The associated Neighbor may be deleted. State change is also propagated to the FaceManager.

Parameters:

linkidthe identifier of the link tuple.

Returns: true if the link was deleted.

void  clear_links ()

clear_links

Clear the neighborhood one-hop links.

The neighbors and two-hop neighbors associated with these links will be removed. Assertions for this are in the destructor.

const LogicalLink*  get_logical_link (const OlsrTypes::LogicalLinkID linkid)
throw(BadLogicalLink)

get_logical_link

Look up a LogicalLink's pointer given its LogicalLinkID.

Parameters:

linkidthe ID of the link to look up.

Returns: a pointer to the logical link. @throw BadLogicalLink if the link could not be found.

void  get_logical_link_list (list<OlsrTypes::LogicalLinkID>& l1_list)

get_logical_link_list

[const]

Fill out a list of all LogicalLinkIDs in the database.

Parameters:

l1_listthe list to fill out.
OlsrTypes::LogicalLinkID  get_linkid (const IPv4& remote_addr, const IPv4& local_addr)
throw(BadLogicalLink)

get_linkid

Look up a LogicalLink's ID given its interface addresses.

Parameters:

remote_addrthe protocol address of the remote interface at the far end of the link.
local_addrthe protocol address of the local interface at the near end of the link.

Returns: the ID of the LogicalLink. @throw BadLogicalLink if the link could not be found.

OlsrTypes::NeighborID  update_neighbor (const IPv4& main_addr, const OlsrTypes::LogicalLinkID linkid, const bool is_new_link, const OlsrTypes::WillType will, const bool is_mpr_selector, const TimeVal& mprs_expiry_time, bool& is_created)
throw(BadNeighbor)

update_neighbor

Update or create a Neighbor in the one-hop neighbor database.

This method has the weak exception guarantee that BadNeighbor will only be thrown before it is associated with LogicalLink.

Parameters:

main_addrThe main protocol address of the neighbor.
linkidThe ID of the initially created link to the neighbor.
is_new_linktrue if the link the neighbor is being created with has just been instantiated.
willThe neighbor's advertised willingness-to-forward.
is_mpr_selectortrue if the neighbor selects us as an MPR.
mprs_expiry_timethe expiry time for the MPR selector tuple.
is_createdset to true if a new neighbor entry was created.

Returns: the ID of the updated or created neighbor tuple. @throw BadNeighbor if the neighbor entry could not be updated.

OlsrTypes::NeighborID  add_neighbor (const IPv4& main_addr, OlsrTypes::LogicalLinkID linkid)
throw(BadNeighbor)

add_neighbor

Add a new Neighbor to the one-hop neighbor database. A Neighbor must be created with at least one LogicalLink.

Parameters:

main_addrThe main address of the new neighbor.
linkidThe ID of the Neighbor's first link.

Returns: the ID of the newly created neighbor. @throw BadNeighbor if the neighbor entry could not be created.

bool  delete_neighbor (const OlsrTypes::NeighborID nid)

delete_neighbor

Delete a neighbor from the neighbor database. Called when the last link to the neighbor has been deleted.

Parameters:

nidThe ID of this neighbor.

Returns: true if the neighbor was removed, false if it cannot be found.

const Neighbor*  get_neighbor (const OlsrTypes::NeighborID nid)
throw(BadNeighbor)

get_neighbor

Find a Neighbor's pointer, given its NeighborID.

Parameters:

nidthe ID of the Neighbor.

Returns: the pointer to the Neighbor instance. @throw BadNeighbor if the Neighbor does not exist.

void  get_neighbor_list (list<OlsrTypes::NeighborID>& n1_list)

get_neighbor_list

[const]

Fill out a list of all NeighborIDs in the database.

Parameters:

n1_listthe list to fill out.
OlsrTypes::NeighborID  get_neighborid_by_main_addr (const IPv4& main_addr)
throw(BadNeighbor)

get_neighborid_by_main_addr

Find a neighbor ID, given its main address.

Parameters:

main_addrthe main protocol address of the OLSR node.

Returns: the neighbor ID. @throw BadNeighbor if the neighbor is not found.

OlsrTypes::NeighborID  get_neighborid_by_remote_addr (const IPv4& remote_addr)
throw(BadNeighbor)

get_neighborid_by_remote_addr

Find a neighbor ID, given the address of one of its interfaces.

Parameters:

remote_addrthe address of one of the interfaces of an OLSR node.

Returns: the neighbor ID. @throw BadNeighbor if the neighbor is not found.

bool  is_sym_neighbor_addr (const IPv4& addr)

is_sym_neighbor_addr

Check if a remote address belongs to a symmetric one-hop neighbor.

Referenced from: Section 5.4 point 1 MID Message Processing. Section 9.5 point 1 TC Message Processing. Section 12.5 point 1 HNA Message Processing.

Parameters:

addrthe interface address of a neighbor.

Returns: true if addr is an interface address of a symmetric one-hop neighbor.

inline bool  is_tc_advertised_neighbor (Neighbor* n)

is_tc_advertised_neighbor

Returns: true if the Neighbor n would be advertised in a TC broadcast, given the current TC_REDUNDANCY.

void  schedule_ans_update (const bool is_deleted)

schedule_ans_update

Schedule an update of the Advertised Neighbor Set.

Parameters:

is_deletedtrue if the update is being scheduled in response to the deletion of a Neighbor.
OlsrTypes::TwoHopLinkID  update_twohop_link (const LinkAddrInfo& node_info, Neighbor& nexthop, const OlsrTypes::FaceID faceid, const TimeVal& vtime)
throw(BadTwoHopLink)

update_twohop_link

Update the link state information for a two-hop neighbor.

This method may create a TwoHopNeighbor and/or a TwoHopLink if they do not already exist.

Parameters:

node_infoThe address information for the two-hop neighbor; contains ETX measurements, if applicable.
nexthopThe main address of the immediate neighbor which advertises this TwoHopLink.
faceidThe interface where the advertisement was heard.
vtimeThe time for which the TwoHopLink remains valid.

Returns: the ID of the two-hop neighbor.

OlsrTypes::TwoHopLinkID  add_twohop_link (Neighbor* nexthop, const IPv4& remote_addr, const TimeVal& vtime)
throw(BadTwoHopLink)

add_twohop_link

Add a TwoHopLink to the Neighborhood.

The constructor signature forces us to associate the near end of the TwoHopLink with a Neighbor. It MUST be associated with a TwoHopNeighbor after construction to be considered valid.

Parameters:

nexthopThe strict one-hop neighbor at the near end of the TwoHopLink being created.
remote_addrThe two-hop neighbor at the far end of the TwoHopLink being created.
vtimeThe time for which the TwoHopLink remains valid.

Returns: the ID of the newly created TwoHopLink. @throw BadTwoHopLink if the TwoHopLink could not be created.

bool  delete_twohop_link (OlsrTypes::TwoHopNodeID tlid)

delete_twohop_link

Delete the TwoHopLink to a two-hop neighbor.

The deletion is propagated to the Neighbor and TwoHopNeighbor instances on the near and far ends of the link respectively.

Parameters:

tlidID of the two-hop link which is to be deleted.

Returns: true if the link thus deleted was the last link to the two-hop node it is used to reach, otherwise false.

bool  delete_twohop_link_by_addrs (const IPv4& nexthop_addr, const IPv4& twohop_addr)

delete_twohop_link_by_addrs

Delete the TwoHopLink to a two-hop neighbor.

The link is identified by the near and far end main addresses.

Parameters:

nexthop_addrThe address of the Neighbor used to reach the two-hop neighbor given by twohop_addr.
twohop_addrThe two-hop neighbor whose link has been lost.

Returns: true if this was the last link to the two-hop neighbor and it was deleted as a result.

TwoHopLink*  get_twohop_link (const OlsrTypes::TwoHopLinkID tlid)
throw(BadTwoHopLink)

get_twohop_link

Given the ID of a TwoHopLink, return its instance pointer.

Parameters:

tlidthe ID of a TwoHopLink.

Returns: the pointer to the TwoHopLink instance. @throw BadTwoHopLink if tlid does not exist.

void  get_twohop_link_list (list<OlsrTypes::TwoHopLinkID>& l2_list)

get_twohop_link_list

[const]

Fill out a list of all TwoHopLinkIDs in the database.

Parameters:

l2_listthe list to fill out.
OlsrTypes::TwoHopNodeID  update_twohop_node ( const IPv4& main_addr, const OlsrTypes::TwoHopLinkID tlid, const bool is_new_l2, bool& is_n2_created)
throw(BadTwoHopNode)

update_twohop_node

Update a two-hop neighbor.

If the TwoHopNeighbor does not exist it will be created. A valid two-hop link must be provided; if the link is also newly created, this method will create the back-reference.

Parameters:

main_addrthe main address of the two-hop neighbor.
tlidthe ID of the two-hop link with which the two-hop neighbor is initially associated.
is_new_l2true if tlid refers to a newly created link.
is_n2_createdset to true if a new TwoHopNeighbor was created.

Returns: the ID of the two-hop neighbor. @throw BadTwoHopNode if the two-hop neighbor could not be updated.

OlsrTypes::TwoHopNodeID  add_twohop_node ( const IPv4& main_addr, const OlsrTypes::TwoHopLinkID tlid)
throw(BadTwoHopNode)

add_twohop_node

Add a two-hop neighbor to the two-hop neighborhood.

Parameters:

main_addrthe main address of the two-hop neighbor to create.
tlidthe ID of the initial link to this two-hop neighbor.

Returns: the ID of the newly created two-hop neighbor. @throw BadTwoHopNode if the two-hop neighbor could not be created.

bool  delete_twohop_node (OlsrTypes::TwoHopNodeID tnid)

delete_twohop_node

Delete an entry in the two-hop neighbor table.

Parameters:

tnidthe ID of a two-hop neighbor.

Returns: true if the neighbor was deleted, otherwise false.

OlsrTypes::TwoHopNodeID  get_twohop_nodeid_by_main_addr ( const IPv4& main_addr)
throw(BadTwoHopNode)

get_twohop_nodeid_by_main_addr

Look up a two-hop neighbor by main address.

Parameters:

main_addrthe main address of a two-hop neighbor.

Returns: the ID of the two-hop neighbor. @throw BadTwoHopNode if the two-hop neighbor could not be found.

const TwoHopNeighbor*  get_twohop_neighbor ( const OlsrTypes::TwoHopNodeID tnid)
throw(BadTwoHopNode)

get_twohop_neighbor

[const]

Given the ID of a TwoHopNeighbor, return its instance pointer.

Parameters:

tnidthe ID of a TwoHopNeighbor.

Returns: the pointer to the TwoHopNeighbor instance. @throw BadTwoHopNode if tnid does not exist.

void  get_twohop_neighbor_list (list<OlsrTypes::TwoHopNodeID>& n2_list)

get_twohop_neighbor_list

[const]

Fill out a list of all TwoHopNodeIDs in the database.

Parameters:

n2_listthe list to fill out.
inline bool  is_mpr ()

is_mpr

[const]

Returns: true if this node has been selected as an MPR by any one-hop neighbor, that is, the MPR selector set is non-empty.

void  update_mpr_selector (const OlsrTypes::NeighborID nid, const TimeVal& vtime)

update_mpr_selector

Update a Neighbor's status in the MPR selector set, possibly adding it.

If our node now has a non-empty MPR selector set, it must now originate TC advertisements.

Parameters:

nidthe ID of the Neighbor to mark as an MPR selector.
vtimethe duration of the MPR selector set membership.
void  delete_mpr_selector (const OlsrTypes::NeighborID nid)

delete_mpr_selector

Remove a neighbor from the MPR selector set by its ID.

If the node no longer has any MPR selectors, it is no longer considered an MPR, and it must continue to originate empty TCs for TOP_HOLD_TIME, after which it shall stop.

Parameters:

nidthe ID of the Neighbor to add as an MPR selector.
bool  is_mpr_selector_addr (const IPv4& remote_addr)

is_mpr_selector_addr

Check if an address belongs to a one-hop neighbor which is also an MPR selector.

Referenced from: Section 3.4.1 Default Forwarding Algorithm.

Parameters:

remote_addrthe IPv4 interface address to look up in the neighbor database.

Returns: true if addr is an interface address of a symmetric one-hop neighbor which selects this node as an MPR.

set<OlsrTypes::NeighborID>  mpr_selector_set ()

mpr_selector_set

[const]

For use by simulation framework.

Returns: the MPR selector set.

inline void  schedule_mpr_recount ()

schedule_mpr_recount

Trigger a recount of the MPR set.

Invoked whenever there is a change of state which would cause the MPR set to change. Calculating the MPR set is an expensive operation, so it is scheduled as a one-off task in the event loop.

void  add_cand_mpr (const OlsrTypes::NeighborID nid)

add_cand_mpr

Add a neighbor to the set of MPR candidates for the interfaces from which it is reachable.

Parameters:

nidthe ID of the neighbor to add.
void  withdraw_cand_mpr (const OlsrTypes::NeighborID nid)

withdraw_cand_mpr

Remove a neighbor from the set of MPR candidates for all interfaces.

Parameters:

nidthe ID of the neighbor to remove.
void  recount_mpr_set ()

recount_mpr_set

Callback method to: recount the MPR set for all configured OLSR interfaces.

void  reset_onehop_mpr_state ()

reset_onehop_mpr_state

Clear all existing MPR state for Neighbors.

size_t  reset_twohop_mpr_state ()

reset_twohop_mpr_state

Clear all existing MPR state for TwoHopNeighbors. Compute number of now uncovered reachable nodes at radius=2.

Returns: The number of reachable, strict two-hop neighbors to be considered by MPR selection.

void  update_onehop_reachability (Neighbor* n)

update_onehop_reachability

Compute one-hop neighbor reachability and update it in the Neighbor to avoid repetitively computing it on every MPR recount.

Coverage must be valid. If this method is called outside of an MPR recount results are undefined.

Reachability is defined as: the number of uncovered N2 nodes which have edges to this N. We do this outside of Neighbor for code brevity.

Parameters:

nPointer to a Neighbor, which is normally an MPR candidate.
void  update_twohop_reachability (TwoHopNeighbor* tn)

update_twohop_reachability

Compute two-hop neighbor reachability.

It will be updated it in the TwoHopNeighbor to avoid computing it more than once during an MPR recount. If an N2 is reachable via an N with WILL_ALWAYS this takes precedence.

TODO: WHEN ETX IS IMPLEMENTED, A LINK WITH NO 'GOOD' LINKS MUST BE CONSIDERED UNREACHABLE.

Two-hop reachability is defined as: the number of MPR candidates with edges linking them to N2. Note: This is NOT THE SAME as a one-hop neighbor's reachability.

We do this outside of TwoHopNeighbor to avoid playing too many tedious C++ accessor games. MPR candidacy of linked neighbors must be valid. If this method is called outside of an MPR recount, its results are undefined.

Parameters:

tnPointer to a TwoHopNeighbor.
size_t  consider_persistent_cand_mprs ()

consider_persistent_cand_mprs

Consider persistent MPR candidates for MPR selection.

8.3.1, 1: Start with an MPR set made of all members of N with willingness equal to WILL_ALWAYS.

This introduces the funky situation that a neighbor may be selected as an MPR even if it has no two-hop links. Such neighbors are always chosen as MPRs before other neighbors.

Returns: The number of two-hop neighbors which have been covered by considering the persistent MPR candidates.

size_t  consider_poorly_covered_twohops ()

consider_poorly_covered_twohops

Consider MPR coverage of poorly covered two-hop neighbors.

8.3.1, 3: Ensure that for all uncovered strict N2 reachable *only via 1 edge*, their neighbor N is selected as an MPR.

TODO: Use ETX measurements.

Returns: The number of two-hop neighbors which have been covered by considering the persistent MPR candidates.

void  consider_remaining_cand_mprs (const size_t n2_count, size_t& covered_n2_count)

consider_remaining_cand_mprs

Consider remaining MPR candidates for MPR selection.

Candidates are considered in descending order of willingness, reachability and degree.

Note: As we only use the result of the insertion sort in this scope, this block is a candidate for a Boost++ filter_iterator. However a filter iterator might keep scanning the N space and blowing the l2/l3 cache.

Parameters:

n2_countThe total number of N2 which must be reachable by the MPR set, used as a recursion upper bound.
covered_n2_countA reference to the cumulative number of N2 which are reachable by the MPR set, and which this method will update.
size_t  mark_all_n1_as_mprs (set<OlsrTypes::NeighborID>& final_mpr_set)

mark_all_n1_as_mprs

Mark all N1 neighbors was MPRs.

Considers all reachable one-hop neighbors with willingness of other than WILL_NEVER as MPRs. This feature is typically used as a workaround in dense OLSR topologies which are not sufficiently partitioned.

Parameters:

final_mpr_setwill have the result set of this method merged with it.

Returns: the number of neighbors which have been selected as MPRs.

size_t  minimize_mpr_set (set<OlsrTypes::NeighborID>& final_mpr_set)
throw(BadTwoHopCoverage)

minimize_mpr_set

Minimize the MPR set, based on the MPR coverage parameter.

Produces the final MPR set in a std::set container, for debugging purposes. Section 8.3.1, 4.

Parameters:

final_mpr_setreference to an empty MPR set that shall contain the resultant MPR set after it has been minimized.

Returns: the number of elements removed from the MPR set, as it appears in the one-hop neighbor database. @throw BadTwoHopCoverage if the MPR minimization algorithm detects that a two-hop node is now uncovered by any MPRs.

bool  is_essential_mpr (const Neighbor* n)

is_essential_mpr

Determine if an MPR is essential to covering the entire two-hop neighborhood.

Parameters:

nthe Neighbor to evaluate.

Returns: true if any of N's links cover a poorly covered strict TwoHopNeighbor.

set<OlsrTypes::NeighborID>  mpr_set ()

mpr_set

[const]

For use by simulation framework.

Returns: the MPR selector set.

void  event_link_sym_timer (OlsrTypes::LogicalLinkID linkid)

event_link_sym_timer

Callback method to: service a LogicalLink's SYM timer.

Whilst the SYM interval timer is pending, the link is considered symmetric. When the timer fires, the link is considered ASYM. If both the ASYM and SYM timers fire in the same event loop quantum, the ASYM timer is considered to have priority.

Parameters:

linkidthe ID of the link whose SYM timer has fired.
void  event_link_asym_timer (OlsrTypes::LogicalLinkID linkid)

event_link_asym_timer

Callback method to: service a LogicalLink's ASYM timer.

Whilst the ASYM interval timer is pending, the link is considered asymmetric. When the timer fires, the link is considered LOST.

Parameters:

linkidthe ID of the link whose ASYM timer has fired.
void  event_link_lost_timer (OlsrTypes::LogicalLinkID linkid)

event_link_lost_timer

Callback method to: service a LogicalLink's LOST timer.

Section 13: Link Layer Notification.

TODO: Not yet implemented, as it relies on link layer support from the host platform which does not yet exist. In practice this should not pose a problem, as 802.11 IBSS disassociation is often unreliable anyway.

Parameters:

linkidthe ID of the link whose LOST timer has fired.
void  event_link_dead_timer (OlsrTypes::LogicalLinkID linkid)

event_link_dead_timer

Callback method to: service a LogicalLink's DEAD timer.

Parameters:

linkidthe ID of the link whose DEAD timer has fired.
void  event_twohop_link_dead_timer (const OlsrTypes::TwoHopLinkID tlid)

event_twohop_link_dead_timer

Callback method to: service a TwoHopLink's DEAD timer.

Parameters:

tlidthe ID of the two-hop link whose DEAD timer has fired.
void  event_mpr_selector_expired (const OlsrTypes::NeighborID nid)

event_mpr_selector_expired

Callback method to: service an MPR selector's EXPIRY timer.

Parameters:

nidthe ID of the Neighbor whose MPR selector tuple has expired.
bool  event_receive_hello (Message* msg, const IPv4& remote_addr, const IPv4& local_addr)

event_receive_hello

Callback method to: process an incoming HELLO message. Section 7.1.1: HELLO Message Processing.

Parameters:

msgPointer to a message which is derived from HelloMessage.
remote_addrThe source address of the packet containing msg.
local_addrThe address of the interface where this packet was received.

Returns: true if this function consumed msg.

bool  event_send_tc ()

event_send_tc

Callback method to: service the TC transmission timer.

Section 9.2: Advertised Neighbor Set.

Flood a TC message to the rest of the OLSR domain which contains our Advertised Neighbor Set (ANS). This method should only be called if the TC timer is running or finishing. The finishing state is entered when a node has stopped being an MPR or when the ANS set becomes empty.

TODO: Account for ETX metrics in selecting advertised neighbors. TODO: Fish-eye TC emission optimization; transmit only.

Returns: true if the callback should be rescheduled, otherwise false.

void  stop_all_timers ()

stop_all_timers

Stop all timers in Neighborhood.

void  start_tc_timer ()

start_tc_timer

Start the TC transmission interval timer.

void  stop_tc_timer ()

stop_tc_timer

Stop the TC transmission interval timer.

void  restart_tc_timer ()

restart_tc_timer

Restart the TC transmission interval timer.

const LogicalLink*  find_best_link (const Neighbor* n)
throw(BadLinkCoverage)

find_best_link

[protected]

Find the best link to a neighbor N.

Parameters:

nPointer to a neighbor N.

Returns: Pointer to a LogicalLink l which is the best link to N. @throw BadLinkCoverage if none of the links are reachable or is of suitable ETX criteria.

bool  push_neighbor (const Neighbor* n)

push_neighbor

[protected]

Push a single Neighbor, and its links, to the RouteManager.

The SPT structure can only hold a single edge between each neighbor at the moment. We also need to select each node by its ETX. In the absence of ETX measurements, we select the most recently heard symmetric link which is up.

Parameters:

nthe neighbor to push.

Returns: true if the neighbor was pushed, false if it was not.

const TwoHopLink*  find_best_twohop_link (const TwoHopNeighbor* n2)
throw(BadTwoHopCoverage)

find_best_twohop_link

[protected]

Find the best link to a two-hop neighbor N2.

Parameters:

n2Pointer to a neighbor N2.

Returns: Pointer to a TwoHopLink l2 which is the best link to N2. @throw BadTwoHopCoverage if none of the links are reachable, or of suitable ETX criteria.

bool  push_twohop_neighbor (TwoHopNeighbor* n2)

push_twohop_neighbor

[protected]

Push a single TwoHopNeigbor, and its links, to the RouteManager. Here, we select the best link to this TwoHopNeighbor.

Parameters:

n2the two-hop neighbor to push.

Returns: true if the two-hop neighbor was pushed, false if it was not.

void  finish_tc_timer ()

finish_tc_timer

[protected]

Transition to the 'finish' state for the TC timer.

void  reschedule_immediate_tc_timer ()

reschedule_immediate_tc_timer

[protected]

Schedule the TC timer as soon as possible.

void  reschedule_tc_timer ()

reschedule_tc_timer

[protected]

Reschedule the TC timer if the TC interval changed.

enum TcTimerState { TC_STOPPED = 0, TC_RUNNING = 1, TC_FINISHING = 2 }

TcTimerState

[protected]


Generated by: pavlin on kobe.xorp.net on Wed Jan 7 19:11:15 2009, using kdoc 2.0a54+XORP.