xorp

Fib2mribRoute Class Reference

A Fib2mrib helper class. More...

#include <fib2mrib_node.hh>

List of all members.

Public Member Functions

 Fib2mribRoute (const IPv4Net &network, const IPv4 &nexthop, const string &ifname, const string &vifname, uint32_t metric, uint32_t admin_distance, const string &protocol_origin, bool xorp_route)
 Constructor for a given IPv4 route.
 Fib2mribRoute (const IPv6Net &network, const IPv6 &nexthop, const string &ifname, const string &vifname, uint32_t metric, uint32_t admin_distance, const string &protocol_origin, bool xorp_route)
 Constructor for a given IPv6 route.
bool operator== (const Fib2mribRoute &other) const
 Equality Operator.
bool is_ipv4 () const
 Test if this is an IPv4 route.
bool is_ipv6 () const
 Test if this is an IPv6 route.
const IPvXNetnetwork () const
 Get the network address prefix this route applies to.
const IPvXnexthop () const
 Get the address of the next-hop router for this route.
void set_nexthop (const IPvX &v)
 Set the address of the next-hop router for this route.
const string & ifname () const
 Get the name of the physical interface toward the destination.
void set_ifname (const string &v)
 Set the name of the physical interface toward the destination.
const string & vifname () const
 Get the name of the virtual interface toward the destination.
void set_vifname (const string &v)
 Set the name of the virtual interface toward the destination.
uint32_t admin_distance () const
 Get the the administratively defined distance for this route.
uint32_t metric () const
 Get the metric distance for this route.
const string & protocol_origin () const
 Get the name of the protocol that originated this route.
bool xorp_route () const
 Test if this route was installed by XORP.
bool is_add_route () const
 Test if this is a route to add.
bool is_replace_route () const
 Test if this is a replacement route.
bool is_delete_route () const
 Test if this is a route to delete.
void set_add_route ()
 Set the type of this route to "a route to add".
void set_replace_route ()
 Set the type of this route to "a replacement route".
void set_delete_route ()
 Set the type of this route to "a route to delete".
bool is_interface_route () const
 Test if the route is interface-specific (e.g., if the interface is explicitly specified).
bool is_valid_entry (string &error_msg) const
 Check whether the route entry is valid.
bool is_ignored () const
 Test if the route is to be ignored.
void set_ignored (bool v)
 Set whether the route is to be ignored.
PolicyTagspolicytags ()
bool is_filtered () const
void set_filtered (bool v)
 Set a flag that indicates whether the route is to be considered filtered [rejected by the policy filter].
bool is_accepted_by_nexthop () const
 Test whether the route is accepted based on its next-hop information.
void set_accepted_by_nexthop (bool v)
 Set a flag that indicates whether the route is accepted based on its next-hop information.
bool is_accepted_by_rib () const
 Test whether the route is accepted for transmission to the RIB.

Private Types

enum  RouteType { IDLE_ROUTE, ADD_ROUTE, REPLACE_ROUTE, DELETE_ROUTE }

Private Attributes

IPvXNet _network
IPvX _nexthop
string _ifname
string _vifname
uint32_t _metric
uint32_t _admin_distance
string _protocol_origin
bool _xorp_route
RouteType _route_type
bool _is_ignored
bool _is_filtered
bool _is_accepted_by_nexthop
PolicyTags _policytags

Detailed Description

A Fib2mrib helper class.

This class is used to store a routing entry.


Constructor & Destructor Documentation

Fib2mribRoute::Fib2mribRoute ( const IPv4Net network,
const IPv4 nexthop,
const string &  ifname,
const string &  vifname,
uint32_t  metric,
uint32_t  admin_distance,
const string &  protocol_origin,
bool  xorp_route 
) [inline]

Constructor for a given IPv4 route.

Parameters:
networkthe network address prefix this route applies to.
nexthopthe address of the next-hop router for this route.
ifnamethe name of the physical interface toward the destination.
vifnamethe name of the virtual interface toward the destination.
metricthe routing metric for this route.
admin_distancethe administratively defined distance for this route.
protocol_originthe name of the protocol that originated this route.
xorp_routetrue if this route was installed by XORP.
Fib2mribRoute::Fib2mribRoute ( const IPv6Net network,
const IPv6 nexthop,
const string &  ifname,
const string &  vifname,
uint32_t  metric,
uint32_t  admin_distance,
const string &  protocol_origin,
bool  xorp_route 
) [inline]

Constructor for a given IPv6 route.

Parameters:
networkthe network address prefix this route applies to.
nexthopthe address of the next-hop router for this route.
ifnamethe name of the physical interface toward the destination.
vifnamethe name of the virtual interface toward the destination.
metricthe routing metric for this route.
admin_distancethe administratively defined distance for this route.
protocol_originthe name of the protocol that originated this route.
xorp_routetrue if this route was installed by XORP.

Member Function Documentation

uint32_t Fib2mribRoute::admin_distance ( ) const [inline]

Get the the administratively defined distance for this route.

Returns:
the administratively defined distance for this route.
const string& Fib2mribRoute::ifname ( ) const [inline]

Get the name of the physical interface toward the destination.

Returns:
the name of the physical interface toward the destination.
bool Fib2mribRoute::is_accepted_by_nexthop ( ) const [inline]

Test whether the route is accepted based on its next-hop information.

Returns:
true if the route is accepted based on its next-hop information, otherwise false.
bool Fib2mribRoute::is_accepted_by_rib ( ) const

Test whether the route is accepted for transmission to the RIB.

Returns:
true if route is accepted for transmission to the RIB, otherwise false.
bool Fib2mribRoute::is_add_route ( ) const [inline]

Test if this is a route to add.

Returns:
true if this is a route to add, otherwise false.
bool Fib2mribRoute::is_delete_route ( ) const [inline]

Test if this is a route to delete.

Returns:
true if this is a route to delete, otherwise false.
bool Fib2mribRoute::is_filtered ( ) const [inline]
Returns:
whether route has been rejected by policy filter.
true if route has been rejected by a policy filter, otherwise false.
bool Fib2mribRoute::is_ignored ( ) const [inline]

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.
bool Fib2mribRoute::is_interface_route ( ) const [inline]

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 Fib2mribRoute::is_ipv4 ( ) const [inline]

Test if this is an IPv4 route.

Returns:
true if this is an IPv4 route, otherwise false.
bool Fib2mribRoute::is_ipv6 ( ) const [inline]

Test if this is an IPv6 route.

Returns:
true if this is an IPv6 route, otherwise false.
bool Fib2mribRoute::is_replace_route ( ) const [inline]

Test if this is a replacement route.

Returns:
true if this is a replacement route, otherwise false.
bool Fib2mribRoute::is_valid_entry ( string &  error_msg) const

Check whether the route entry is valid.

Parameters:
error_msgthe error message (if error).
Returns:
true if the route entry is valid, otherwise false.
uint32_t Fib2mribRoute::metric ( ) const [inline]

Get the metric distance for this route.

Returns:
the metric distance for this route.
const IPvXNet& Fib2mribRoute::network ( ) const [inline]

Get the network address prefix this route applies to.

Returns:
the network address prefix this route appies to.
const IPvX& Fib2mribRoute::nexthop ( ) const [inline]

Get the address of the next-hop router for this route.

Returns:
the address of the next-hop router for this route.
bool Fib2mribRoute::operator== ( const Fib2mribRoute other) const [inline]

Equality Operator.

Parameters:
otherthe right-hand operand to compare against.
Returns:
true if the left-hand operand is numerically same as the right-hand operand.
PolicyTags& Fib2mribRoute::policytags ( ) [inline]
Returns:
policy-tags for this route.
const string& Fib2mribRoute::protocol_origin ( ) const [inline]

Get the name of the protocol that originated this route.

Returns:
the name of the protocol that originated this route.
void Fib2mribRoute::set_accepted_by_nexthop ( bool  v) [inline]

Set a flag that indicates whether the route is accepted based on its next-hop information.

Parameters:
vtrue if the route is accepted based on its next-hop information, otherwise false.
void Fib2mribRoute::set_filtered ( bool  v) [inline]

Set a flag that indicates whether the route is to be considered filtered [rejected by the policy filter].

Parameters:
vtrue if the route should be considered filtered, otherwise false.
void Fib2mribRoute::set_ifname ( const string &  v) [inline]

Set the name of the physical interface toward the destination.

Parameters:
vthe name of the physical interface toward the destination.
void Fib2mribRoute::set_ignored ( bool  v) [inline]

Set whether the route is to be ignored.

This method is used only for internal purpose when passing the route around.

Parameters:
vtrue if the route is to be ignored, otherwise false.
void Fib2mribRoute::set_nexthop ( const IPvX v) [inline]

Set the address of the next-hop router for this route.

Parameters:
vthe address of the next-hop router for this route.
void Fib2mribRoute::set_vifname ( const string &  v) [inline]

Set the name of the virtual interface toward the destination.

Parameters:
vthe name of the virtual interface toward the destination.
const string& Fib2mribRoute::vifname ( ) const [inline]

Get the name of the virtual interface toward the destination.

Returns:
the name of the virtual interface toward the destination.
bool Fib2mribRoute::xorp_route ( ) const [inline]

Test if this route was installed by XORP.

Returns:
true if this route was installed by XORP.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations