class IO

Abstract interface to low level IO operations. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods

Protected Members


Detailed Description

An abstract class that defines packet reception and transmission. The details of how packets are received or transmitted are therefore hidden from the internals of the OLSR code.

 IO ()

IO

 ~IO ()

~IO

[virtual]

bool  enable_address (const string& interface, const string& vif, const IPv4& address, const uint16_t& port, const IPv4& all_nodes_address)

enable_address

[pure virtual]

Enable an IPv4 address and port for OLSR datagram reception and transmission.

Parameters:

interfacethe interface to enable.
vifthe vif to enable.
addressthe address to enable.
portthe port to enable.
all_nodes_addressthe all-nodes address to enable.

Returns: true if the address was enabled, otherwise false.

bool  disable_address (const string& interface, const string& vif, const IPv4& address, const uint16_t& port)

disable_address

[pure virtual]

Disable an IPv4 address and port for OLSR datagram reception.

Parameters:

interfacethe interface to disable.
vifthe vif to disable.
addressthe address to disable.
portthe port to disable.

Returns: true if the address was disabled, otherwise false.

bool  is_interface_enabled (const string& interface)

is_interface_enabled

[const pure virtual]

Test whether this interface is enabled.

Parameters:

interfacethe interface to test.

Returns: true if it exists and is enabled, otherwise false.

bool  is_vif_enabled (const string& interface, const string& vif)

is_vif_enabled

[const pure virtual]

Test whether this interface/vif is enabled.

Parameters:

interfacethe interface to test.
vifthe vif to test.

Returns: true if it exists and is enabled, otherwise false.

bool  is_vif_broadcast_capable (const string& interface, const string& vif)

is_vif_broadcast_capable

[pure virtual]

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  is_vif_multicast_capable (const string& interface, const string& vif)

is_vif_multicast_capable

[pure virtual]

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  is_vif_loopback (const string& interface, const string& vif)

is_vif_loopback

[pure virtual]

Test whether this interface/vif is a loopback interface.

Parameters:

interfacethe interface to test.
vifthe vif to test.

Returns: true if it is a loopback interface, otherwise false.

bool  is_address_enabled (const string& interface, const string& vif, const IPv4& address)

is_address_enabled

[const pure virtual]

Test whether this interface/vif/address is enabled.

Parameters:

interfacethe interface to test.
vifthe vif to test.
addressthe address to test.

Returns: true if it exists and is enabled, otherwise false.

typedef XorpCallback2<void, const string&, bool>::RefPtr InterfaceStatusCb

InterfaceStatusCb

Callback for interface status from the FEA.

typedef XorpCallback3<void, const string&, const string&, bool>::RefPtr VifStatusCb

VifStatusCb

Callback for vif status from the FEA.

typedef XorpCallback4<void, const string&, const string&, IPv4, bool>::RefPtr AddressStatusCb

AddressStatusCb

Callback for address status from the FEA.

typedef XorpCallback8<void, const string&, const string&, IPv4, uint16_t, IPv4, uint16_t, uint8_t*, uint32_t>::RefPtr ReceiveCallback

ReceiveCallback

Callback for packet reception from the FEA.

bool  get_addresses (const string& interface, const string& vif, list<IPv4>& addresses)

get_addresses

[const pure virtual]

Get all addresses associated with this interface/vif.

Parameters:

interfacethe name of the interface
vifthe name of the vif
addresses(out argument) list of associated addresses

Returns: true if there are no errors.

bool  get_broadcast_address (const string& interface, const string& vif, const IPv4& address, IPv4& bcast_address)

get_broadcast_address

[const pure virtual]

Get the broadcast address associated with this interface/vif/address.

Parameters:

interfacethe name of the interface
vifthe name of the vif
addressIPv4 binding address
bcast_address(out argument) primary broadcast address

Returns: true if there are no errors.

bool  get_interface_id (const string& interface, uint32_t& interface_id)

get_interface_id

[pure virtual]

Get the ID of the interface, as seen by libfeaclient.

Parameters:

interfacethe name of the interface.
interface_id(out argument) interface ID.

Returns: the interface id for this interface.

uint32_t  get_mtu (const string& interface)

get_mtu

[pure virtual]

Get the MTU for an interface.

Parameters:

interfacethe name of the interface.

Returns: the mtu for this interface.

inline void  register_interface_status (InterfaceStatusCb cb)

register_interface_status

Add a callback for tracking the interface status.

The callback will be invoked whenever the status of the interface is changed from disabled to enabled or vice-versa.

Parameters:

cbthe callback to register.
inline void  register_vif_status (VifStatusCb cb)

register_vif_status

Add a callback for tracking the interface/vif status.

The callback will be invoked whenever the status of the interface/vif is changed from disabled to enabled or vice-versa.

Parameters:

cbthe callback to register.
inline void  register_address_status (AddressStatusCb cb)

register_address_status

Add a callback for tracking the interface/vif/address status.

The callback will be invoked whenever the status of the tuple (interface, vif, address) is changed from disabled to enabled or vice-versa.

Parameters:

cbthe callback to register.
inline void  register_receive (ReceiveCallback cb)

register_receive

Register for receiving datagrams.

Parameters:

cbthe callback to register.
ReceiveCallback _receive_cb

_receive_cb

[protected]

InterfaceStatusCb _interface_status_cb

_interface_status_cb

[protected]

VifStatusCb _vif_status_cb

_vif_status_cb

[protected]

AddressStatusCb _address_status_cb

_address_status_cb

[protected]

interface_vif (struct)

interface_vif

bool  send (const string& interface, const string& vif, const IPv4& src, const uint16_t& sport, const IPv4& dst, const uint16_t& dport, uint8_t* data, const uint32_t& len)

send

[pure virtual]

Send a UDP datagram from src:sport to dst:dport, on the given interface, if possible.

Parameters:

interfacethe interface to transmit from.
vifthe vif to transmit from.
srcthe IPv4 source address to transmit from.
sportthe UDP source port to transmit from.
dstthe IPv4 destination address to send to.
dportthe UDP destination port to send to.
datathe datagram to transmit.
lenthe length of the datagram to transmit.

Returns: true if the datagram was sent OK, otherwise false.

bool  add_route (IPv4Net net, IPv4 nexthop, uint32_t faceid, uint32_t metric, const PolicyTags& policytags)

add_route

[pure virtual]

Add route.

Parameters:

netnetwork
faceidinterface ID towards the nexthop
metricto network
policytagspolicy info to the RIB.

Returns: true if the route was added OK, otherwise false.

bool  replace_route (IPv4Net net, IPv4 nexthop, uint32_t faceid, uint32_t metric, const PolicyTags& policytags)

replace_route

[pure virtual]

Replace route.

Parameters:

netnetwork
faceidinterface ID towards the nexthop
metricto network
policytagspolicy info to the RIB.

Returns: true if the route was replaced OK, otherwise false.

bool  delete_route (IPv4Net net)

delete_route

[pure virtual]

Delete route.

Parameters:

netnetwork

Returns: true if the route was deleted OK, otherwise false.

inline void  set_interface_mapping (uint32_t interface_id, const string& interface, const string& vif)

set_interface_mapping

Store a mapping of the OLSR internal interface ID to interface/vif. This will be required by when installing a route.

Parameters:

interface_idthe ID of the interface, as seen by libfeaclient.
interfacethe name of the interface mapped to interface_id.
vifthe name of vif mapped to interface_id.
inline bool  get_interface_vif_by_interface_id (uint32_t interface_id, string& interface, string& vif)

get_interface_vif_by_interface_id

Given an OLSR interface ID, return the interface/vif.

Parameters:

interface_idthe ID of the interface, as seen by libfeaclient.
interfacethe name of the interface mapped to interface_id.
vifthe name of vif mapped to interface_id.

Returns: true if interface_id was found, otherwise false.

map<uint32_t, interface_vif> _interface_vif

_interface_vif

[protected]


Generated by: pavlin on kobe.xorp.net on Wed Jan 7 19:11:15 2009, using kdoc 2.0a54+XORP.