|
|
There should be one node per StaticRoutes instance.
typedef multimap<IPvXNet, StaticRoute> Table | Table |
StaticRoutesNode (EventLoop& eventloop)
| StaticRoutesNode |
Constructor for a given event loop.
Parameters:
eventloop | the event loop to use. |
~StaticRoutesNode ()
| ~StaticRoutesNode |
[virtual]
EventLoop& eventloop ()
| eventloop |
Get the event loop this node is added to.
Returns: the event loop this node is added to.
const string& protocol_name ()
| protocol_name |
[const]
Get the protocol name.
Returns: a string with the protocol name.
bool startup ()
| startup |
Startup the node operation.
Returns: true on success, false on failure.
Reimplemented from ServiceBase.
bool shutdown ()
| shutdown |
Shutdown the node operation.
Returns: true on success, false on failure.
Reimplemented from ServiceBase.
ProcessStatus node_status (string& reason_msg)
| node_status |
Get the node status (see ProcessStatus).
Parameters:
reason_msg | return-by-reference string that contains human-readable information about the status. |
Returns: the node status (see ProcessStatus).
bool is_done ()
| is_done |
[const]
Test if the node processing is done.
Returns: true if the node processing is done, otherwise false.
bool is_enabled ()
| is_enabled |
[const]
Test whether the node operation is enabled.
Returns: true if the node operation is enabled, otherwise false.
void set_enabled (bool enable)
| set_enabled |
Enable/disable node operation.
Note that for the time being it affects only whether the routes are installed into RIB. In the future it may affect the interaction with other modules as well.
Parameters:
enable | if true then enable node operation, otherwise disable it. |
int add_route4 (bool unicast, bool multicast,
const IPv4Net& network, const IPv4& nexthop,
const string& ifname, const string& vifname,
uint32_t metric, bool is_backup_route, string& error_msg)
| add_route4 |
Add a static IPv4 route.
Parameters:
unicast | if true, then the route would be used for unicast routing. |
multicast | if true, then the route would be used in the MRIB (Multicast Routing Information Base) for multicast purpose (e.g., computing the Reverse-Path Forwarding information). |
network | the network address prefix this route applies to. |
nexthop | the address of the next-hop router for this route. |
ifname | of the name of the physical interface toward the destination. |
vifname | of the name of the virtual interface toward the destination. |
metric | the metric distance for this route. |
is_backup_route | if true, then this is a backup route operation. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_route6 (bool unicast, bool multicast,
const IPv6Net& network, const IPv6& nexthop,
const string& ifname, const string& vifname,
uint32_t metric, bool is_backup_route, string& error_msg)
| add_route6 |
Add a static IPv6 route.
Parameters:
unicast | if true, then the route would be used for unicast routing. |
multicast | if true, then the route would be used in the MRIB (Multicast Routing Information Base) for multicast purpose (e.g., computing the Reverse-Path Forwarding information). |
network | the network address prefix this route applies to. |
nexthop | the address of the next-hop router for this route. |
ifname | of the name of the physical interface toward the destination. |
vifname | of the name of the virtual interface toward the destination. |
metric | the metric distance for this route. |
is_backup_route | if true, then this is a backup route operation. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int replace_route4 (bool unicast, bool multicast,
const IPv4Net& network, const IPv4& nexthop,
const string& ifname, const string& vifname,
uint32_t metric, bool is_backup_route,
string& error_msg)
| replace_route4 |
Replace a static IPv4 route.
Parameters:
unicast | if true, then the route would be used for unicast routing. |
multicast | if true, then the route would be used in the MRIB (Multicast Routing Information Base) for multicast purpose (e.g., computing the Reverse-Path Forwarding information). |
network | the network address prefix this route applies to. |
nexthop | the address of the next-hop router for this route. |
ifname | of the name of the physical interface toward the destination. |
vifname | of the name of the virtual interface toward the destination. |
metric | the metric distance for this route. |
is_backup_route | if true, then this is a backup route operation. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int replace_route6 (bool unicast, bool multicast,
const IPv6Net& network, const IPv6& nexthop,
const string& ifname, const string& vifname,
uint32_t metric, bool is_backup_route,
string& error_msg)
| replace_route6 |
Replace a static IPv6 route.
Parameters:
unicast | if true, then the route would be used for unicast routing. |
multicast | if true, then the route would be used in the MRIB (Multicast Routing Information Base) for multicast purpose (e.g., computing the Reverse-Path Forwarding information). |
network | the network address prefix this route applies to. |
nexthop | the address of the next-hop router for this route. |
ifname | of the name of the physical interface toward the destination. |
vifname | of the name of the virtual interface toward the destination. |
metric | the metric distance for this route. |
is_backup_route | if true, then this is a backup route operation. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_route4 (bool unicast, bool multicast, const IPv4Net& network,
const IPv4& nexthop, const string& ifname,
const string& vifname, bool is_backup_route,
string& error_msg)
| delete_route4 |
Delete a static IPv4 route.
Parameters:
unicast | if true, then the route would be used for unicast routing. |
multicast | if true, then the route would be used in the MRIB (Multicast Routing Information Base) for multicast purpose (e.g., computing the Reverse-Path Forwarding information). |
network | the network address prefix this route applies to. |
nexthop | the address of the next-hop router for this route. |
ifname | of the name of the physical interface toward the destination. |
vifname | of the name of the virtual interface toward the destination. |
is_backup_route | if true, then this is a backup route operation. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_route6 (bool unicast, bool multicast, const IPv6Net& network,
const IPv6& nexthop, const string& ifname,
const string& vifname, bool is_backup_route,
string& error_msg)
| delete_route6 |
Delete a static IPv6 route.
Parameters:
unicast | if true, then the route would be used for unicast routing. |
multicast | if true, then the route would be used in the MRIB (Multicast Routing Information Base) for multicast purpose (e.g., computing the Reverse-Path Forwarding information). |
network | the network address prefix this route applies to. |
nexthop | the address of the next-hop router for this route. |
ifname | of the name of the physical interface toward the destination. |
vifname | of the name of the virtual interface toward the destination. |
is_backup_route | if true, then this is a backup route operation. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
StaticRoutesNode::Table::iterator find_route (
StaticRoutesNode::Table& table,
const StaticRoute& key_route)
| find_route |
Find a route from the routing table.
Parameters:
table | the routing table to seach. |
key_route | the route information to search for. |
Returns: a table iterator to the route. If the route is not found, the iterator will point to the end of the table.
StaticRoutesNode::Table::iterator find_best_accepted_route (
StaticRoutesNode::Table& table,
const StaticRoute& key_route)
| find_best_accepted_route |
Find the best accepted route from the routing table.
Parameters:
table | the routing table to seach. |
key_route | the route information to search for. |
Returns: a table iterator to the route. If the route is not found, the iterator will point to the end of the table.
bool is_log_trace ()
| is_log_trace |
[const]
Test if trace log is enabled.
This method is used to test whether to output trace log debug messges.
Returns: true if trace log is enabled, otherwise false.
void set_log_trace (bool is_enabled)
| set_log_trace |
Enable/disable trace log.
This method is used to enable/disable trace log debug messages output.
Parameters:
is_enabled | if true, trace log is enabled, otherwise is disabled. |
void configure_filter (const uint32_t& filter, const string& conf)
| configure_filter |
Configure a policy filter.
Will throw an exception on error.
Export filter is not supported by static routes.
Parameters:
filter | identifier of filter to configure. |
conf | configuration of the filter. |
void reset_filter (const uint32_t& filter)
| reset_filter |
Reset a policy filter.
Parameters:
filter | identifier of filter to reset. |
void push_routes ()
| push_routes |
Push all the routes through the policy filters for re-filtering.
void push_pull_rib_routes (bool is_push)
| push_pull_rib_routes |
Push or pull all the routes to/from the RIB.
Parameters:
is_push | if true, then push the routes, otherwise pull them |
void tree_complete ()
| tree_complete |
[protected]
Reimplemented from IfMgrHintObserver.
void updates_made ()
| updates_made |
[protected]
Reimplemented from IfMgrHintObserver.
void incr_startup_requests_n ()
| incr_startup_requests_n |
[protected]
void decr_startup_requests_n ()
| decr_startup_requests_n |
[protected]
void incr_shutdown_requests_n ()
| incr_shutdown_requests_n |
[protected]
void decr_shutdown_requests_n ()
| decr_shutdown_requests_n |
[protected]
void update_status ()
| update_status |
[protected]