|
|
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 OSPF code.
IO ()
| IO |
~IO ()
| ~IO |
[virtual]
uint16_t get_ip_protocol_number ()
| get_ip_protocol_number |
[const]
bool send (const string& interface, const string& vif,
A dst, A src,
uint8_t* data, uint32_t len)
| send |
[pure virtual]
bool set_ip_router_alert (bool alert)
| set_ip_router_alert |
Send router alerts in IP packets?
bool get_ip_router_alert ()
| get_ip_router_alert |
[const]
typedef XorpCallback6<void, const string&, const string&, A, A, uint8_t*, uint32_t>::RefPtr ReceiveCallback | ReceiveCallback |
void register_receive (ReceiveCallback cb)
| register_receive |
Register for receiving raw frames.
bool enable_interface_vif (const string& interface,
const string& vif)
| enable_interface_vif |
[pure virtual]
Enable the interface/vif to receive frames.
bool disable_interface_vif (const string& interface,
const string& vif)
| disable_interface_vif |
[pure virtual]
Disable this interface/vif from receiving frames.
bool is_interface_enabled (const string& interface)
| is_interface_enabled |
[const pure virtual]
Test whether this interface is enabled.
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.
Returns: true if it exists and is enabled, otherwise false.
bool is_address_enabled (const string& interface, const string& vif,
const A& address)
| is_address_enabled |
[const pure virtual]
Test whether this interface/vif/address is enabled.
Returns: true if it exists and is enabled, otherwise false.
typedef XorpCallback2<void, const string&, bool>::RefPtr InterfaceStatusCb | InterfaceStatusCb |
typedef XorpCallback3<void, const string&, const string&, bool>::RefPtr VifStatusCb | VifStatusCb |
typedef XorpCallback4<void, const string&, const string&, A, bool>::RefPtr AddressStatusCb | AddressStatusCb |
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:
cb | the callback to register. |
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:
cb | the callback to register. |
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:
cb | the callback to register. |
bool get_addresses (const string& interface,
const string& vif,
list<A>& addresses)
| get_addresses |
[const pure virtual]
Get all addresses associated with this interface/vif.
Parameters:
interface | the name of the interface |
vif | the name of the vif |
addresses | (out argument) list of associated addresses |
Returns: true if there are no errors.
bool get_link_local_address (const string& interface,
const string& vif,
A& address)
| get_link_local_address |
[pure virtual]
Get a link local address for this interface/vif if available.
Parameters:
interface | the name of the interface |
vif | the name of the vif |
address | (out argument) set if address is found. |
Returns: true if a link local address is available.
bool get_interface_id (const string& interface,
uint32_t& interface_id)
| get_interface_id |
[pure virtual]
Returns: the interface id for this interface.
uint32_t get_prefix_length (const string& interface,
const string& vif,
A address)
| get_prefix_length |
[pure virtual]
Returns: prefix length for this address.
uint32_t get_mtu (const string& interface)
| get_mtu |
[pure virtual]
Returns: the mtu for this interface.
bool join_multicast_group (const string& interface,
const string& vif, A mcast)
| join_multicast_group |
[pure virtual]
On the interface/vif join this multicast group.
bool leave_multicast_group (const string& interface,
const string& vif, A mcast)
| leave_multicast_group |
[pure virtual]
On the interface/vif leave this multicast group.
bool add_route (IPNet<A> net,
A nexthop,
uint32_t nexthop_id,
uint32_t metric,
bool equal,
bool discard, const PolicyTags& policytags)
| add_route |
[pure virtual]
Add route
Parameters:
net | network |
nexthop_id | interface ID towards the nexthop |
metric | to network |
equal | true if this in another route to the same destination. |
discard | true if this is a discard route. |
policytags | policy info to the RIB. |
bool replace_route (IPNet<A> net,
A nexthop,
uint32_t nexthop_id,
uint32_t metric,
bool equal,
bool discard, const PolicyTags& policytags)
| replace_route |
[pure virtual]
Replace route
Parameters:
net | network |
nexthop_id | interface ID towards the nexthop |
metric | to network |
equal | true if this in another route to the same destination. |
discard | true if this is a discard route. |
policytags | policy info to the RIB. |
bool delete_route (IPNet<A> net)
| delete_route |
[pure virtual]
void set_interface_mapping (uint32_t interface_id, const string& interface,
const string& vif)
| set_interface_mapping |
Store a mapping of the OSPF internal interface ID to interface/vif. This will be required by when installing a route.
bool get_interface_vif_by_interface_id (uint32_t interface_id,
string& interface, string& vif)
| get_interface_vif_by_interface_id |
Given an OSPF internal interface ID return the interface/vif.
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]
bool _ip_router_alert | _ip_router_alert |
[protected]
interface_vif (struct) | interface_vif |
[protected]
map<uint32_t, interface_vif> _interface_vif | _interface_vif |
[protected]