|
| ||||||||||||||||
| ExternalRoutes (Olsr& olsr, EventLoop& eventloop,
FaceManager& fm, Neighborhood& nh)
| ExternalRoutes |
| ~ExternalRoutes ()
| ~ExternalRoutes |
| FaceManager& face_manager ()
| face_manager |
| inline RouteManager* route_manager ()
| route_manager |
| inline void set_route_manager (RouteManager* rm)
| set_route_manager |
| inline TimeVal get_hna_interval ()
| get_hna_interval |
[const]
| void set_hna_interval (const TimeVal& hna_interval)
| set_hna_interval |
Set the HNA send timer.
The timer will only be restarted if previously scheduled. If the period of the HNA broadcasts is changed, a HNA broadcast MAY be scheduled to take place immediately.
Parameters:
| hna_interval | the interval between HNA advertisements. |
| inline TimeVal get_hna_hold_time ()
| get_hna_hold_time |
[const]
| OlsrTypes::ExternalID update_hna_route_in (const IPv4Net& dest,
const IPv4& lasthop,
const uint16_t distance,
const TimeVal& expiry_time,
bool& is_created)
throw(BadExternalRoute) | update_hna_route_in |
Update or create a route entry learned from HNA.
If the origin of the HNA route is not reachable in the OLSR SPT, the route will be rejected; see NOTES. TODO: In future distance may also be treated as an advertised metric.
Parameters:
| dest | The destination being updated. |
| lasthop | The last-hop to reach the destination. |
| distance | the number of hops to reach lasthop. |
| expiry_time | The time at which the entry will expire. |
| is_created | reference to a boolean which is set to true iff a new entry was created by this method. |
Returns: The ID of the created or updated route entry. @throw BadExternalRoute if the route could not be created.
| OlsrTypes::ExternalID add_hna_route_in (const IPv4Net& dest,
const IPv4& lasthop,
const uint16_t distance,
const TimeVal& expiry_time)
throw(BadExternalRoute) | add_hna_route_in |
Create a route entry learned from HNA.
Parameters:
| dest | The destination being updated. |
| lasthop | The last-hop to reach the destination; usually this is the origin of the route. |
| distance | the number of hops to reach lasthop. |
| expiry_time | The time at which the entry will expire. |
Returns: The ID of the created route entry. @throw BadExternalRoute if the route could not be created.
| bool delete_hna_route_in (OlsrTypes::ExternalID erid)
| delete_hna_route_in |
Delete an HNA learned route entry given its ID.
Parameters:
| erid | The ID of the external route to delete. |
Returns: true if the entry was found and deleted.
| void clear_hna_routes_in ()
| clear_hna_routes_in |
| const ExternalRoute* get_hna_route_in (const IPv4Net& dest,
const IPv4& lasthop)
throw(BadExternalRoute) | get_hna_route_in |
Look up an ExternalRoute learned from HNA, given its origin and destination network prefix.
Parameters:
| dest | the destination network prefix. |
| lasthop | the origin. |
Returns: pointer to the ExternalRoute. @throw BadExternalRoute if the route could not be found.
| OlsrTypes::ExternalID get_hna_route_in_id (const IPv4Net& dest,
const IPv4& lasthop)
throw(BadExternalRoute) | get_hna_route_in_id |
Look up the ID of a learned HNA entry. Both the destination and the OLSR last-hop must be specified to match.
Parameters:
| dest | The destination address. |
| lasthop | The last-hop advertised for the destination. |
Returns: the ID of the learned external route. @throw BadExternalRoute if the route could not be found.
| const ExternalRoute* get_hna_route_in_by_id (
const OlsrTypes::ExternalID erid)
throw(BadExternalRoute) | get_hna_route_in_by_id |
Look up a learned HNA route entry by its ID.
Parameters:
| erid | the ID of the learned ExternalRoute. |
Returns: the pointer to the learned ExternalRoute. @throw BadExternalRoute if the route could not be found.
| size_t hna_origin_count ()
| hna_origin_count |
[const]
Calculate the number of unique OLSR nodes with HNA entries in this node's HNA learned route database.
Used only by the protocol simulator.
As we don't currently maintain a list of origins for HNA, this is a more computationally expensive invariant than for TC or MID.
Returns: the number of unique origins in the HNA route-in map.
| size_t hna_dest_count ()
| hna_dest_count |
[const]
Calculate the number of unique HNA prefixes which have been learned.
Used only by the protocol simulator.
Returns: the number of unique destinations in the HNA route-in map.
| inline size_t hna_entry_count ()
| hna_entry_count |
[const]
Returns: the number of entries in the learned HNA route database.
| void get_hna_route_in_list (list<OlsrTypes::ExternalID>& hnalist)
| get_hna_route_in_list |
Fill out a list of all the external learned route IDs.
Parameters:
| hnalist | the list to fill out. |
| bool originate_hna_route_out (const IPv4Net& dest)
throw(BadExternalRoute) | originate_hna_route_out |
Originate an HNA route.
Parameters:
| dest | the network for which to originate HNA broadcasts. |
Returns: true if the route was originated successfully. @throw BadExternalRoute if the route could not be originated.
| void withdraw_hna_route_out (const IPv4Net& dest)
throw(BadExternalRoute) | withdraw_hna_route_out |
Withdraw an HNA route.
Parameters:
| dest | the network to withdraw from HNA broadcasts. @throw BadExternalRoute if no route to the given destination could be found. |
| void clear_hna_routes_out ()
| clear_hna_routes_out |
Clear the advertised HNA routes.
| OlsrTypes::ExternalID get_hna_route_out_id (const IPv4Net& dest)
throw(BadExternalRoute) | get_hna_route_out_id |
Look up the ID of an originated HNA entry. Both the destination and the OLSR last-hop must be specified to match.
Parameters:
| dest | The destination address. |
Returns: the ID of the originated external route. @throw BadExternalRoute if the route could not be found.
| void push_external_routes ()
| push_external_routes |
Push candidate HNA routes to the RouteManager.
12.6: The distance to the last-hop, as measured from the HNA message, is used as the current discriminator; this is what's specified in the RFC.
TODO: Deal with the metric here rather than in the RouteManager. For now, RouteManager will invent a metric before plumbing to the RIB.
| void start_hna_send_timer ()
| start_hna_send_timer |
| void stop_hna_send_timer ()
| stop_hna_send_timer |
| void restart_hna_send_timer ()
| restart_hna_send_timer |
| void reschedule_hna_send_timer ()
| reschedule_hna_send_timer |
Reschedule the HNA send timer (if the HNA interval has changed).
| void reschedule_immediate_hna_send_timer ()
| reschedule_immediate_hna_send_timer |
Schedule the HNA send timer to fire as soon as possible.
| bool event_send_hna ()
| event_send_hna |
Callback method to: service the HNA transmission timer. Section 12: Non-OLSR Interfaces.
Flood a HNA message to the rest of the OLSR domain which contains this node's Host and Network Associations.
Returns: true if the callback should be rescheduled, otherwise false.
| bool event_receive_hna (Message* msg,
const IPv4& remote_addr,
const IPv4& local_addr)
| event_receive_hna |
Process incoming HNA message. Section 12.5: HNA Message Processing.
Parameters:
| msg | the message to process. |
| remote_addr | the source address of the Packet containing msg. |
| local_addr | the address of the OLSR interface where the Packet containing msg was received. |
Returns: true if msg was consumed by this method, otherwise false.
| void event_hna_route_in_expired (const OlsrTypes::ExternalID erid)
| event_hna_route_in_expired |
Callback method to: delete a learned route entry when it expires.
Parameters:
| erid | The ID of the external route to delete. |