|
|
This class is used to store a routing entry.
StaticRoute (bool unicast, bool multicast,
const IPv4Net& network, const IPv4& nexthop,
const string& ifname, const string& vifname,
uint32_t metric)
| StaticRoute |
Constructor for a given IPv4 static 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. |
StaticRoute (bool unicast, bool multicast,
const IPv6Net& network, const IPv6& nexthop,
const string& ifname, const string& vifname,
uint32_t metric)
| StaticRoute |
Constructor for a given IPv6 static 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. |
bool operator== (const StaticRoute& other)
| operator== |
Equality Operator
Parameters:
other | the right-hand operand to compare against. |
Returns: true if the left-hand operand is numerically same as the right-hand operand.
bool is_ipv4 ()
| is_ipv4 |
[const]
Test if this is an IPv4 route.
Returns: true if this is an IPv4 route, otherwise false.
bool is_ipv6 ()
| is_ipv6 |
[const]
Test if this is an IPv6 route.
Returns: true if this is an IPv6 route, otherwise false.
bool unicast ()
| unicast |
[const]
Test if this route would be used for unicast routing.
Returns: true if this route would be used for unicast routing, otherwise false.
bool multicast ()
| multicast |
[const]
Test if this route would be used for multicast routing.
Returns: true if this route would be used for multicast routing, otherwise false.
const IPvXNet& network ()
| network |
[const]
Get the network address prefix this route applies to.
Returns: the network address prefix this route appies to.
const IPvX& nexthop ()
| nexthop |
[const]
Get the address of the next-hop router for this route.
Returns: the address of the next-hop router for this route.
const string& ifname ()
| ifname |
[const]
Get the name of the physical interface toward the destination.
Returns: the name of the physical interface toward the destination.
const string& vifname ()
| vifname |
[const]
Get the name of the virtual interface toward the destination.
Returns: the name of the virtual interface toward the destination.
uint32_t metric ()
| metric |
[const]
Get the metric distance for this route.
Returns: the metric distance for this route.
bool is_add_route ()
| is_add_route |
[const]
Test if this is a route to add.
Returns: true if this is a route to add, otherwise false.
bool is_replace_route ()
| is_replace_route |
[const]
Test if this is a replacement route.
Returns: true if this is a replacement route, otherwise false.
bool is_delete_route ()
| is_delete_route |
[const]
Test if this is a route to delete.
Returns: true if this is a route to delete, otherwise false.
void set_add_route ()
| set_add_route |
Set the type of this route to "a route to add".
void set_replace_route ()
| set_replace_route |
Set the type of this route to "a replacement route".
void set_delete_route ()
| set_delete_route |
Set the type of this route to "a route to delete".
bool is_interface_route ()
| is_interface_route |
[const]
Test if the route is interface-specific (e.g., if the interface is explicitly specified).
Returns: true if the route is interface-specific, otherwise false.
bool is_valid_entry (string& error_msg)
| is_valid_entry |
[const]
Check whether the route entry is valid.
Parameters:
error_msg | the error message (if error). |
Returns: true if the route entry is valid, otherwise false.
bool is_ignored ()
| is_ignored |
[const]
Test if the route is to be ignored.
This method is used only for internal purpose when passing the route around.
Returns: true if the route is to be ignored, otherwise false.
void set_ignored (bool v)
| set_ignored |
Set whether the route is to be ignored.
This method is used only for internal purpose when passing the route around.
Parameters:
v | true if the route is to be ignored, otherwise false. |