|
xorp
|
Class which manages distribution of external routes throughout the OLSR domain. More...
#include <external.hh>
Public Member Functions | |
| ExternalRoutes (Olsr &olsr, EventLoop &eventloop, FaceManager &fm, Neighborhood &nh) | |
| FaceManager & | face_manager () |
| RouteManager * | route_manager () |
| void | set_route_manager (RouteManager *rm) |
| TimeVal | get_hna_interval () const |
| void | set_hna_interval (const TimeVal &hna_interval) |
| Set the HNA send timer. | |
| TimeVal | 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 or create a route entry learned from HNA. | |
| OlsrTypes::ExternalID | add_hna_route_in (const IPv4Net &dest, const IPv4 &lasthop, const uint16_t distance, const TimeVal &expiry_time) throw (BadExternalRoute) |
| Create a route entry learned from HNA. | |
| bool | delete_hna_route_in (OlsrTypes::ExternalID erid) |
| Delete an HNA learned route entry given its ID. | |
| void | clear_hna_routes_in () |
| Clear the learned HNA routes. | |
| const ExternalRoute * | get_hna_route_in (const IPv4Net &dest, const IPv4 &lasthop) throw (BadExternalRoute) |
| Look up an ExternalRoute learned from HNA, given its origin and destination network prefix. | |
| OlsrTypes::ExternalID | get_hna_route_in_id (const IPv4Net &dest, const IPv4 &lasthop) throw (BadExternalRoute) |
| Look up the ID of a learned HNA entry. | |
| const ExternalRoute * | get_hna_route_in_by_id (const OlsrTypes::ExternalID erid) throw (BadExternalRoute) |
| Look up a learned HNA route entry by its ID. | |
| size_t | hna_origin_count () const |
| Calculate the number of unique OLSR nodes with HNA entries in this node's HNA learned route database. | |
| size_t | hna_dest_count () const |
| Calculate the number of unique HNA prefixes which have been learned. | |
| size_t | hna_entry_count () const |
| void | get_hna_route_in_list (list< OlsrTypes::ExternalID > &hnalist) |
| Fill out a list of all the external learned route IDs. | |
| bool | originate_hna_route_out (const IPv4Net &dest) throw (BadExternalRoute) |
| Originate an HNA route. | |
| void | withdraw_hna_route_out (const IPv4Net &dest) throw (BadExternalRoute) |
| Withdraw an HNA route. | |
| void | clear_hna_routes_out () |
| Clear the advertised HNA routes. | |
| OlsrTypes::ExternalID | get_hna_route_out_id (const IPv4Net &dest) throw (BadExternalRoute) |
| Look up the ID of an originated HNA entry. | |
| void | push_external_routes () |
| Push candidate HNA routes to the RouteManager. | |
| void | start_hna_send_timer () |
| void | stop_hna_send_timer () |
| void | restart_hna_send_timer () |
| void | reschedule_hna_send_timer () |
| Reschedule the HNA send timer (if the HNA interval has changed). | |
| void | reschedule_immediate_hna_send_timer () |
| Schedule the HNA send timer to fire as soon as possible. | |
| bool | event_send_hna () |
| Callback method to: service the HNA transmission timer. | |
| bool | event_receive_hna (Message *msg, const IPv4 &remote_addr, const IPv4 &local_addr) |
| Process incoming HNA message. | |
| void | event_hna_route_in_expired (const OlsrTypes::ExternalID erid) |
| Callback method to: delete a learned route entry when it expires. | |
Private Types | |
|
typedef multimap< IPv4Net, OlsrTypes::ExternalID > | ExternalDestInMap |
| Map of learned routes by destination to route ID covering that destination. | |
|
typedef map < OlsrTypes::ExternalID, ExternalRoute * > | ExternalRouteMap |
| HNA entries learned by this node. | |
|
typedef map< IPv4Net, OlsrTypes::ExternalID > | ExternalDestOutMap |
| Map of originated route IDs by destination. | |
Private Attributes | |
| Olsr & | _olsr |
| EventLoop & | _eventloop |
| FaceManager & | _fm |
| Neighborhood & | _nh |
| RouteManager * | _rm |
| ExternalRouteOrderPred | _routes_in_order_pred |
| bool | _is_early_hna_enabled |
| OlsrTypes::ExternalID | _next_erid |
| TimeVal | _hna_interval |
| the interval at which HNA broadcasts are flooded throughout the OLSR domain by this node, if routes are originated. | |
| XorpTimer | _hna_send_timer |
| ExternalDestInMap | _routes_in_by_dest |
| ExternalRouteMap | _routes_in |
| ExternalDestOutMap | _routes_out_by_dest |
| ExternalRouteMap | _routes_out |
| HNA entries originated by this node. | |
Class which manages distribution of external routes throughout the OLSR domain.
| OlsrTypes::ExternalID ExternalRoutes::add_hna_route_in | ( | const IPv4Net & | dest, |
| const IPv4 & | lasthop, | ||
| const uint16_t | distance, | ||
| const TimeVal & | expiry_time | ||
| ) | throw (BadExternalRoute) |
Create a route entry learned from HNA.
| 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. |
| BadExternalRoute | if the route could not be created. |
| bool ExternalRoutes::delete_hna_route_in | ( | OlsrTypes::ExternalID | erid | ) |
| void ExternalRoutes::event_hna_route_in_expired | ( | const OlsrTypes::ExternalID | erid | ) |
Callback method to: delete a learned route entry when it expires.
| erid | The ID of the external route to delete. |
| bool ExternalRoutes::event_receive_hna | ( | Message * | msg, |
| const IPv4 & | remote_addr, | ||
| const IPv4 & | local_addr | ||
| ) |
Process incoming HNA message.
Section 12.5: HNA Message Processing.
| 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. |
| bool ExternalRoutes::event_send_hna | ( | ) |
| const ExternalRoute * ExternalRoutes::get_hna_route_in | ( | const IPv4Net & | dest, |
| const IPv4 & | lasthop | ||
| ) | throw (BadExternalRoute) |
Look up an ExternalRoute learned from HNA, given its origin and destination network prefix.
| BadExternalRoute | if the route could not be found. |
| const ExternalRoute * ExternalRoutes::get_hna_route_in_by_id | ( | const OlsrTypes::ExternalID | erid | ) | throw (BadExternalRoute) |
Look up a learned HNA route entry by its ID.
| erid | the ID of the learned ExternalRoute. |
| BadExternalRoute | if the route could not be found. |
| OlsrTypes::ExternalID ExternalRoutes::get_hna_route_in_id | ( | const IPv4Net & | dest, |
| const IPv4 & | lasthop | ||
| ) | throw (BadExternalRoute) |
| void ExternalRoutes::get_hna_route_in_list | ( | list< OlsrTypes::ExternalID > & | hnalist | ) |
| OlsrTypes::ExternalID ExternalRoutes::get_hna_route_out_id | ( | const IPv4Net & | dest | ) | throw (BadExternalRoute) |
| size_t ExternalRoutes::hna_dest_count | ( | ) | const |
| size_t ExternalRoutes::hna_entry_count | ( | ) | const [inline] |
| size_t ExternalRoutes::hna_origin_count | ( | ) | const |
| bool ExternalRoutes::originate_hna_route_out | ( | const IPv4Net & | dest | ) | throw (BadExternalRoute) |
Originate an HNA route.
| dest | the network for which to originate HNA broadcasts. |
| BadExternalRoute | if the route could not be originated. |
| void ExternalRoutes::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 ExternalRoutes::set_hna_interval | ( | const TimeVal & | hna_interval | ) |
| OlsrTypes::ExternalID ExternalRoutes::update_hna_route_in | ( | const IPv4Net & | dest, |
| const IPv4 & | lasthop, | ||
| const uint16_t | distance, | ||
| const TimeVal & | expiry_time, | ||
| bool & | is_created | ||
| ) | throw (BadExternalRoute) |
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.
| 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. |
| BadExternalRoute | if the route could not be created. |
| void ExternalRoutes::withdraw_hna_route_out | ( | const IPv4Net & | dest | ) | throw (BadExternalRoute) |
Withdraw an HNA route.
| dest | the network to withdraw from HNA broadcasts. |
| BadExternalRoute | if no route to the given destination could be found. |