xorp

Olsr Class Reference

An OLSR routing process. More...

#include <olsr.hh>

List of all members.

Public Member Functions

 Olsr (EventLoop &eventloop, IO *io)
bool running ()
ProcessStatus status (string &reason)
 Determine routing process status.
void shutdown ()
 Shut down this routing process.
void receive (const string &interface, const string &vif, IPv4 dst, uint16_t dport, IPv4 src, uint16_t sport, uint8_t *data, uint32_t len)
 Callback method to: receive a datagram.
bool transmit (const string &interface, const string &vif, const IPv4 &dst, const uint16_t &dport, const IPv4 &src, const uint16_t &sport, uint8_t *data, const uint32_t &len)
 Transmit a datagram.
void register_vif_status (IO::VifStatusCb cb)
 Register vif status callback with the FEA.
void register_address_status (IO::AddressStatusCb cb)
 Register address status callback with the FEA.
EventLoopget_eventloop ()
FaceManagerface_manager ()
Neighborhoodneighborhood ()
TopologyManagertopology_manager ()
ExternalRoutesexternal_routes ()
RouteManagerroute_manager ()
bool set_main_addr (const IPv4 &addr)
 Set the main address for the node.
IPv4 get_main_addr ()
bool set_mpr_coverage (const uint32_t mpr_coverage)
 Set the MPR_COVERAGE for the node.
uint32_t get_mpr_coverage ()
bool set_tc_redundancy (const uint32_t tc_redundancy)
 Set the TC_REDUNDANCY for the node.
uint32_t get_tc_redundancy ()
bool set_hello_interval (const TimeVal &interval)
 Set the HELLO_INTERVAL.
TimeVal get_hello_interval ()
bool set_mid_interval (const TimeVal &interval)
 Set the MID_INTERVAL.
TimeVal get_mid_interval ()
bool set_refresh_interval (const TimeVal &interval)
 Set the REFRESH_INTERVAL.
TimeVal get_refresh_interval ()
bool set_tc_interval (TimeVal interval)
 Set the TC interval for the node.
TimeVal get_tc_interval ()
bool set_willingness (const OlsrTypes::WillType willingness)
 Set the WILLINGNESS.
OlsrTypes::WillType get_willingness ()
bool set_hna_interval (const TimeVal &interval)
 Set the HNA interval.
TimeVal get_hna_interval ()
bool set_dup_hold_time (const TimeVal &interval)
 Set the DUP_HOLD_TIME.
TimeVal get_dup_hold_time ()
bool bind_address (const string &interface, const string &vif, const IPv4 &local_addr, const uint32_t &local_port, const IPv4 &all_nodes_addr, const uint32_t &all_nodes_port)
 Bind OLSR to an interface.
bool unbind_address (const string &interface, const string &vif)
 Unbind OLSR from an interface.
bool enable_address (const string &interface, const string &vif, const IPv4 &address, const uint16_t &port, const IPv4 &all_nodes_address)
 Enable I/O for OLSR on a given address.
bool disable_address (const string &interface, const string &vif, const IPv4 &address, const uint16_t &port)
 Disable I/O for OLSR on a given address.
bool set_interface_enabled (const string &interface, const string &vif, const bool enabled)
 Enable or disable an interface for OLSR.
bool get_interface_enabled (const string &interface, const string &vif, bool &enabled)
 Determine if an interface is enabled for OLSR.
bool get_interface_stats (const string &interface, const string &vif, FaceCounters &stats)
 Get an interface's statistics.
bool set_interface_cost (const string &interface, const string &vif, int cost)
 Set the cost on an interface.
uint32_t get_mtu (const string &interface)
 Get the MTU of an interface.
bool get_broadcast_address (const string &interface, const string &vif, const IPv4 &address, IPv4 &bcast_address)
 Get the primary IPv4 broadcast address configured for this interface/vif/address.
bool is_vif_broadcast_capable (const string &interface, const string &vif)
 Test whether this interface/vif is broadcast capable.
bool is_vif_multicast_capable (const string &interface, const string &vif)
 Test whether this interface/vif is multicast capable.
bool add_route (IPv4Net net, IPv4 nexthop, uint32_t nexthop_id, uint32_t metric, const PolicyTags &policytags)
 Add route.
bool replace_route (IPv4Net net, IPv4 nexthop, uint32_t nexthop_id, uint32_t metric, const PolicyTags &policytags)
 Replace route.
bool delete_route (IPv4Net net)
 Delete route.
void configure_filter (const uint32_t &filter, const string &conf)
 Configure a policy filter.
void reset_filter (const uint32_t &filter)
 Reset a policy filter.
void push_routes ()
 Push routes through policy filters for re-filtering.
bool originate_external_route (const IPv4Net &net, const IPv4 &nexthop, const uint32_t &metric, const PolicyTags &policytags)
 Originate an external route in HNA.
bool withdraw_external_route (const IPv4Net &net)
 Withdraw an external route from HNA.
PolicyFiltersget_policy_filters ()
Tracetrace ()
bool clear_database ()
 Clear protocol databases.

Private Attributes

EventLoop_eventloop
IO_io
FaceManager _fm
Neighborhood _nh
TopologyManager _tm
ExternalRoutes _er
RouteManager _rm
string _reason
ProcessStatus _process_status
PolicyFilters _policy_filters
Trace _trace
 Trace variables.

Detailed Description

An OLSR routing process.

IO is performed by the associated class IO.


Member Function Documentation

bool Olsr::add_route ( IPv4Net  net,
IPv4  nexthop,
uint32_t  nexthop_id,
uint32_t  metric,
const PolicyTags policytags 
)

Add route.

Parameters:
netnetwork
nexthop
nexthop_idinterface ID towards the nexthop
metricto network
policytagspolicy info to the RIB.
bool Olsr::bind_address ( const string &  interface,
const string &  vif,
const IPv4 local_addr,
const uint32_t &  local_port,
const IPv4 all_nodes_addr,
const uint32_t &  all_nodes_port 
)

Bind OLSR to an interface.

Parameters:
interfacethe name of the interface to listen on.
vifthe name of the vif to listen on.
local_addrthe address to listen on.
local_portthe address on the interface to listen on.
all_nodes_addrthe address to transmit to.
all_nodes_portthe port to transmit to.
Returns:
true if the address was bound successfully.
bool Olsr::clear_database ( )

Clear protocol databases.

Returns:
a reference to the profiler

A full routing recomputation should be triggered by this operation. This specifically clears links, MID, TC, learned HNA entries, and the duplicate message set only.

void Olsr::configure_filter ( const uint32_t &  filter,
const string &  conf 
)

Configure a policy filter.

Parameters:
filterId of filter to configure.
confConfiguration of filter.
bool Olsr::delete_route ( IPv4Net  net)

Delete route.

Parameters:
netnetwork
bool Olsr::disable_address ( const string &  interface,
const string &  vif,
const IPv4 address,
const uint16_t &  port 
)

Disable I/O for OLSR on a given address.

Proxy for class IO.

Parameters:
interfacethe name of the interface to listen on.
vifthe name of the vif to listen on.
addressthe name of the address to listen on.
portthe name of the port to listen on.
Returns:
true if the address was enabled successfully.
bool Olsr::enable_address ( const string &  interface,
const string &  vif,
const IPv4 address,
const uint16_t &  port,
const IPv4 all_nodes_address 
)

Enable I/O for OLSR on a given address.

Proxy for class IO.

Parameters:
interfacethe name of the interface to listen on.
vifthe name of the vif to listen on.
addressthe name of the address to listen on.
portthe name of the port to listen on.
all_nodes_addressthe name of the address to transmit to.
Returns:
true if the address was enabled successfully.
bool Olsr::get_broadcast_address ( const string &  interface,
const string &  vif,
const IPv4 address,
IPv4 bcast_address 
)

Get the primary IPv4 broadcast address configured for this interface/vif/address.

Parameters:
interfacethe interface to get broadcast address for.
vifthe vif to get broadcast address for.
addressthe IPv4 interface address.
bcast_address(out argument) the IPv4 broadcast address.
Returns:
true if the broadcast address was obtained successfully.
TimeVal Olsr::get_dup_hold_time ( ) [inline]
Returns:
the value of the DUP_HOLD_TIME protocol variable.
TimeVal Olsr::get_hello_interval ( ) [inline]
Returns:
the value of the HELLO_INTERVAL variable.
TimeVal Olsr::get_hna_interval ( ) [inline]
Returns:
the value of the HNA_INTERVAL protocol variable.
bool Olsr::get_interface_enabled ( const string &  interface,
const string &  vif,
bool &  enabled 
)

Determine if an interface is enabled for OLSR.

Parameters:
interfacethe name of the interface to examine.
vifthe name of the vif to examine.
enabledoutput variable will be set to the enable state of the interface.
Returns:
true if the enable state was retrieved successfully.
bool Olsr::get_interface_stats ( const string &  interface,
const string &  vif,
FaceCounters stats 
)

Get an interface's statistics.

Parameters:
interfacethe name of the interface to examine.
vifthe name of the vif to examine.
statsoutput variable will be set to the interface stats.
Returns:
true if the stats werre retrieved successfully.
IPv4 Olsr::get_main_addr ( ) [inline]
Returns:
the main address.
TimeVal Olsr::get_mid_interval ( ) [inline]
Returns:
the value of the MID_INTERVAL variable.
uint32_t Olsr::get_mpr_coverage ( ) [inline]
Returns:
the value of the MPR_COVERAGE variable.
uint32_t Olsr::get_mtu ( const string &  interface)

Get the MTU of an interface.

Parameters:
interfacethe name of the interface to get MTU for.
Returns:
the MTU of the interface.
PolicyFilters& Olsr::get_policy_filters ( ) [inline]
Returns:
a reference to the policy filters
TimeVal Olsr::get_refresh_interval ( ) [inline]
Returns:
the value of the REFRESH_INTERVAL protocol variable.
TimeVal Olsr::get_tc_interval ( ) [inline]
Returns:
the value of the TC_INTERVAL protocol variable.
uint32_t Olsr::get_tc_redundancy ( ) [inline]
Returns:
the value of the TC_REDUNDANCY variable.
OlsrTypes::WillType Olsr::get_willingness ( ) [inline]
Returns:
the WILLINGNESS protocol variable.
bool Olsr::is_vif_broadcast_capable ( const string &  interface,
const string &  vif 
)

Test whether this interface/vif is broadcast capable.

Parameters:
interfacethe interface to test.
vifthe vif to test.
Returns:
true if it is broadcast capable, otherwise false.
bool Olsr::is_vif_multicast_capable ( const string &  interface,
const string &  vif 
)

Test whether this interface/vif is multicast capable.

Parameters:
interfacethe interface to test.
vifthe vif to test.
Returns:
true if it is multicast capable, otherwise false.
bool Olsr::originate_external_route ( const IPv4Net net,
const IPv4 nexthop,
const uint32_t &  metric,
const PolicyTags policytags 
)

Originate an external route in HNA.

Parameters:
netnetwork prefix to originate.
nexthopthe next hop. Ignored by HNA.
metricexternal metric for this route.
policytagsthe policy tags associated with this route.
Returns:
true if the route was originated successfully.
void Olsr::receive ( const string &  interface,
const string &  vif,
IPv4  dst,
uint16_t  dport,
IPv4  src,
uint16_t  sport,
uint8_t *  data,
uint32_t  len 
)

Callback method to: receive a datagram.

All packets for OLSR are received through this interface. All good packets are sent to the face manager which verifies that the packet is expected, and is wholly responsible for further processing.

void Olsr::register_address_status ( IO::AddressStatusCb  cb) [inline]

Register address status callback with the FEA.

Parameters:
cbthe callback to register.
void Olsr::register_vif_status ( IO::VifStatusCb  cb) [inline]

Register vif status callback with the FEA.

Parameters:
cbthe callback to register.
bool Olsr::replace_route ( IPv4Net  net,
IPv4  nexthop,
uint32_t  nexthop_id,
uint32_t  metric,
const PolicyTags policytags 
)

Replace route.

Parameters:
netnetwork
nexthop
nexthop_idinterface ID towards the nexthop
metricto network
policytagspolicy info to the RIB.
void Olsr::reset_filter ( const uint32_t &  filter)

Reset a policy filter.

Parameters:
filterId of filter to reset.
bool Olsr::running ( ) [inline]
Returns:
true if this routing process is running.
bool Olsr::set_dup_hold_time ( const TimeVal interval) [inline]

Set the DUP_HOLD_TIME.

Parameters:
intervalthe new duplicate message hold time
Returns:
true if the DUP_HOLD_TIME was set successfully.
bool Olsr::set_hello_interval ( const TimeVal interval) [inline]

Set the HELLO_INTERVAL.

Parameters:
intervalthe new value of HELLO_INTERVAL.
Returns:
true if HELLO_INTERVAL was set successfully.
bool Olsr::set_hna_interval ( const TimeVal interval) [inline]

Set the HNA interval.

Parameters:
intervalthe new HNA interval.
Returns:
true if the HNA interval was set successfully.
bool Olsr::set_interface_cost ( const string &  interface,
const string &  vif,
int  cost 
) [inline]

Set the cost on an interface.

Parameters:
interfacethe name of the interface to set cost for.
vifthe name of the vif to set cost for.
costthe new cost of the interface.
Returns:
true if the interface cost was set successfully.
bool Olsr::set_interface_enabled ( const string &  interface,
const string &  vif,
const bool  enabled 
)

Enable or disable an interface for OLSR.

Parameters:
interfacethe name of the interface to enable/disable.
vifthe name of the vif to enable/disable.
enabledthe new enable state of the interface.
Returns:
true if the interface state was set to
Parameters:
enabledsuccessfully.
bool Olsr::set_main_addr ( const IPv4 addr) [inline]

Set the main address for the node.

Parameters:
addrthe main address to set.
Returns:
true if the main address was set successfully.
bool Olsr::set_mid_interval ( const TimeVal interval) [inline]

Set the MID_INTERVAL.

Parameters:
intervalthe new value of MID_INTERVAL.
Returns:
true if MID_INTERVAL was set successfully.
bool Olsr::set_mpr_coverage ( const uint32_t  mpr_coverage) [inline]

Set the MPR_COVERAGE for the node.

Parameters:
mpr_coveragethe new value of MPR_COVERAGE.
Returns:
true if MPR_COVERAGE was set successfully.
bool Olsr::set_refresh_interval ( const TimeVal interval) [inline]

Set the REFRESH_INTERVAL.

Parameters:
intervalthe new refresh interval.
Returns:
true if the refresh interval was set successfully.
bool Olsr::set_tc_interval ( TimeVal  interval) [inline]

Set the TC interval for the node.

Parameters:
intervalthe new TC interval.
Returns:
true if the TC interval was set successfully.
bool Olsr::set_tc_redundancy ( const uint32_t  tc_redundancy) [inline]

Set the TC_REDUNDANCY for the node.

Parameters:
tc_redundancythe new value of TC_REDUNDANCY.
Returns:
true if TC_REDUNDANCY was set successfully.
bool Olsr::set_willingness ( const OlsrTypes::WillType  willingness) [inline]

Set the WILLINGNESS.

Parameters:
willingnessthe new willingness-to-forward.
Returns:
true if the willingness was set successfully.
ProcessStatus Olsr::status ( string &  reason)

Determine routing process status.

Parameters:
reasona text description of the current process status.
Returns:
status of the routing process.
Trace& Olsr::trace ( ) [inline]
Returns:
a reference to the tracing variables
bool Olsr::unbind_address ( const string &  interface,
const string &  vif 
)

Unbind OLSR from an interface.

OLSR may only be bound to a single address on an interface, therefore there is no 'address' argument to this method.

Parameters:
interfacethe name of the interface to unbind.
vifthe name of the vif to unbind.
Returns:
true if the interface was unbound successfully.
bool Olsr::withdraw_external_route ( const IPv4Net net)

Withdraw an external route from HNA.

Parameters:
netnetwork prefix to withdraw.
Returns:
true if the route was withdrawn successfully.

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