|
xorp
|
The DebugIO class realizes the interface IO. More...
#include <debug_io.hh>
Classes | |
| struct | DebugRouteEntry |
Public Member Functions | |
| DebugIO (TestInfo &info, EventLoop &eventloop) | |
| void | pp (const string &which, int level, const string &interface, const string &vif, IPv4 dst, uint16_t dport, IPv4 src, uint16_t sport, uint8_t *data, uint32_t len) |
| Pretty print frames. | |
| int | startup () |
| Start service. | |
| int | shutdown () |
| Shutdown service. | |
| bool | enable_address (const string &interface, const string &vif, const IPv4 &address, const uint16_t &port, const IPv4 &all_nodes_address) |
| Enable an IPv4 address and port for OLSR datagram reception. | |
| bool | disable_address (const string &interface, const string &vif, const IPv4 &address, const uint16_t &port) |
| Disable an IPv4 address and port for OLSR datagram reception. | |
| bool | is_interface_enabled (const string &interface) const |
| Test whether this interface is enabled. | |
| bool | is_vif_enabled (const string &interface, const string &vif) const |
| Test whether this interface/vif is enabled. | |
| bool | is_vif_broadcast_capable (const string &interface, const string &vif) |
| Return true if the given vif is broadcast capable. | |
| bool | is_vif_multicast_capable (const string &interface, const string &vif) |
| Return true if the given vif is multicast capable. | |
| bool | is_vif_loopback (const string &interface, const string &vif) |
| Return true if the given vif is a loopback vif. | |
| bool | is_address_enabled (const string &interface, const string &vif, const IPv4 &address) const |
| Test whether this interface/vif/address is enabled. | |
| bool | get_addresses (const string &interface, const string &vif, list< IPv4 > &addresses) const |
| Get all addresses associated with this interface/vif. | |
| bool | get_broadcast_address (const string &interface, const string &vif, const IPv4 &address, IPv4 &bcast_address) const |
| Get the broadcast address associated with this IPv4 address. | |
| bool | get_interface_id (const string &interface, uint32_t &interface_id) |
| uint32_t | get_mtu (const string &interface) |
| int | packets () const |
| 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 a UDP datagram from src:sport to dst:dport, preferably on the given link. | |
| void | receive (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) |
| Receive frames. | |
| bool | register_forward (const string &interface, const string &vif, IO::ReceiveCallback cb) |
| Register where datagrams should be forwarded. | |
| void | unregister_forward (const string &interface, const string &vif) |
| Unregister an existing callback registered with register_forward(). | |
| 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 | routing_table_empty () |
| uint32_t | routing_table_size () |
| bool | routing_table_verify (IPv4Net net, IPv4 nexthop, uint32_t metric) |
| Verify that this route is in the routing table. | |
| void | routing_table_dump (ostream &o) |
| Dump the routing table contents to the given ostream (not necessarily what's in the TestInfo). | |
| DebugIO (TestInfo &info, OspfTypes::Version version, EventLoop &eventloop) | |
| void | pp (const string &which, int level, const string &interface, const string &vif, A dst, A src, uint8_t *data, uint32_t len) |
| Pretty print frames. | |
| int | startup () |
| Start service. | |
| int | shutdown () |
| Shutdown service. | |
| bool | send (const string &interface, const string &vif, A dst, A src, int ttl, uint8_t *data, uint32_t len) |
| Send Raw frames. | |
| bool | register_forward (typename IO< A >::ReceiveCallback cb) |
| Register where frames should be forwarded. | |
| void | receive (const string &interface, const string &vif, A dst, A src, uint8_t *data, uint32_t len) |
| Receive frames. | |
| bool | enable_interface_vif (const string &interface, const string &vif) |
| Enable the interface/vif to receive frames. | |
| bool | disable_interface_vif (const string &interface, const string &vif) |
| Disable this interface/vif from receiving frames. | |
| bool | is_interface_enabled (const string &interface) const |
| Test whether this interface is enabled. | |
| bool | is_vif_enabled (const string &interface, const string &vif) const |
| Test whether this interface/vif is enabled. | |
| bool | is_address_enabled (const string &interface, const string &vif, const A &address) const |
| Test whether this interface/vif/address is enabled. | |
| bool | get_addresses (const string &interface, const string &vif, list< A > &) const |
| Get all addresses associated with this interface/vif. | |
| bool | get_link_local_address (const string &interface, const string &vif, IPv4 &address) |
| bool | get_link_local_address (const string &interface, const string &vif, IPv6 &address) |
| bool | get_interface_id (const string &interface, uint32_t &interface_id) |
| Get the ID of the interface, as seen by libfeaclient. | |
| uint32_t | get_prefix_length (const string &interface, const string &vif, A address) |
| uint32_t | get_mtu (const string &interface) |
| Get the MTU for an interface. | |
| bool | join_multicast_group (const string &interface, const string &vif, A mcast) |
| On the interface/vif join this multicast group. | |
| bool | leave_multicast_group (const string &interface, const string &vif, A mcast) |
| 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 to 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 in RIB. | |
| bool | delete_route (IPNet< A > net) |
| Delete route from RIB. | |
| void | routing_table_empty () |
| A debugging entry point. | |
| uint32_t | routing_table_size () |
| bool | routing_table_verify (IPNet< A > net, A nexthop, uint32_t metric, bool equal, bool discard) |
| Verify that this route is in the routing table. | |
| int | packets () |
| Return the number of packets that have seen so far. | |
Private Attributes | |
| TestInfo & | _info |
| EventLoop & | _eventloop |
| int | _packets |
| uint32_t | _next_interface_id |
| map< string, uint32_t > | _interface_ids |
| MessageDecoder | _md |
|
map< pair< string, string > , IO::ReceiveCallback > | _forward_cbs |
| Forwarding callback, one per emulated interface, so that interfaces may be bound to separate EmulateSubnet instances. | |
| map< IPv4Net, DebugRouteEntry > | _routing_table |
| PacketDecoder | _dec |
| LsaDecoder | _lsa_decoder |
| IO< A >::ReceiveCallback | _forward_cb |
| map< IPNet< A >, DebugRouteEntry > | _routing_table |
The DebugIO class realizes the interface IO.
Debugging implementation of IO for use by test programs.
It is used for OLSR regression tests.
| bool DebugIO< A >::add_route | ( | IPv4Net | net, |
| IPv4 | nexthop, | ||
| uint32_t | faceid, | ||
| uint32_t | metric, | ||
| const PolicyTags & | policytags | ||
| ) | [virtual] |
| bool DebugIO< A >::get_addresses | ( | const string & | interface, |
| const string & | vif, | ||
| list< A > & | addresses | ||
| ) | const [inline, virtual] |
| bool DebugIO< A >::get_interface_id | ( | const string & | interface, |
| uint32_t & | interface_id | ||
| ) | [inline, virtual] |
| bool DebugIO< A >::get_interface_id | ( | const string & | interface, |
| uint32_t & | interface_id | ||
| ) | [virtual] |
| uint32_t DebugIO< A >::get_mtu | ( | const string & | interface | ) | [inline, virtual] |
| uint32_t DebugIO< A >::get_mtu | ( | const string & | interface | ) | [virtual] |
| uint32_t DebugIO< A >::get_prefix_length | ( | const string & | interface, |
| const string & | vif, | ||
| A | address | ||
| ) | [inline, virtual] |
Implements IO< A >.
| bool DebugIO< A >::is_address_enabled | ( | const string & | interface, |
| const string & | vif, | ||
| const A & | address | ||
| ) | const [inline, virtual] |
Test whether this interface/vif/address is enabled.
Implements IO< A >.
| bool DebugIO< A >::is_address_enabled | ( | const string & | interface, |
| const string & | vif, | ||
| const IPv4 & | address | ||
| ) | const [virtual] |
Test whether this interface/vif/address is enabled.
Implements IO< A >.
| bool DebugIO< A >::is_interface_enabled | ( | const string & | interface | ) | const [inline, virtual] |
Test whether this interface is enabled.
Implements IO< A >.
| bool DebugIO< A >::is_interface_enabled | ( | const string & | interface | ) | const [virtual] |
Test whether this interface is enabled.
Implements IO< A >.
| bool DebugIO< A >::is_vif_enabled | ( | const string & | interface, |
| const string & | vif | ||
| ) | const [inline, virtual] |
Test whether this interface/vif is enabled.
Implements IO< A >.
| bool DebugIO< A >::is_vif_enabled | ( | const string & | interface, |
| const string & | vif | ||
| ) | const [virtual] |
Test whether this interface/vif is enabled.
Implements IO< A >.
| int DebugIO< A >::packets | ( | ) | const [inline] |
| void DebugIO< A >::pp | ( | const string & | which, |
| int | level, | ||
| const string & | interface, | ||
| const string & | vif, | ||
| IPv4 | dst, | ||
| uint16_t | dport, | ||
| IPv4 | src, | ||
| uint16_t | sport, | ||
| uint8_t * | data, | ||
| uint32_t | len | ||
| ) |
Pretty print frames.
Specific to DebugIo.
| void DebugIO< A >::pp | ( | const string & | which, |
| int | level, | ||
| const string & | interface, | ||
| const string & | vif, | ||
| A | dst, | ||
| A | src, | ||
| uint8_t * | data, | ||
| uint32_t | len | ||
| ) | [inline] |
Pretty print frames.
Specific to DebugIO.
| void DebugIO< A >::receive | ( | const string & | interface, |
| const string & | vif, | ||
| A | dst, | ||
| A | src, | ||
| uint8_t * | data, | ||
| uint32_t | len | ||
| ) | [inline] |
Receive frames.
Specific to DebugIO.
| void DebugIO< A >::receive | ( | 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 | ||
| ) |
Receive frames.
Specific to DebugIo.
| bool DebugIO< A >::register_forward | ( | const string & | interface, |
| const string & | vif, | ||
| IO::ReceiveCallback | cb | ||
| ) |
Register where datagrams should be forwarded.
Specific to DebugIo.
| bool DebugIO< A >::register_forward | ( | typename IO< A >::ReceiveCallback | cb | ) | [inline] |
Register where frames should be forwarded.
Specific to DebugIO.
| bool DebugIO< A >::replace_route | ( | IPv4Net | net, |
| IPv4 | nexthop, | ||
| uint32_t | faceid, | ||
| uint32_t | metric, | ||
| const PolicyTags & | policytags | ||
| ) | [virtual] |
| void DebugIO< A >::routing_table_empty | ( | ) | [inline] |
A debugging entry point.
Empty the routing table.
| int DebugIO< A >::shutdown | ( | ) | [inline, virtual] |
Shutdown service.
Service should transition from SERVICE_RUNNING to SERVICE_SHUTTING_DOWN immediately and onto SERVICE_SHUTDOWN or SERVICE_FAILED in the near future.
Implements ServiceBase.
| int DebugIO< A >::shutdown | ( | ) | [virtual] |
Shutdown service.
Service should transition from SERVICE_RUNNING to SERVICE_SHUTTING_DOWN immediately and onto SERVICE_SHUTDOWN or SERVICE_FAILED in the near future.
Implements ServiceBase.
| int DebugIO< A >::startup | ( | ) | [inline, virtual] |
Start service.
Service should transition from SERVICE_READY to SERVICE_STARTING immediately and onto SERVICE_RUNNING or SERVICE_FAILED in the near future.
Implements ServiceBase.
| int DebugIO< A >::startup | ( | ) | [virtual] |
Start service.
Service should transition from SERVICE_READY to SERVICE_STARTING immediately and onto SERVICE_RUNNING or SERVICE_FAILED in the near future.
Implements ServiceBase.
| void DebugIO< A >::unregister_forward | ( | const string & | interface, |
| const string & | vif | ||
| ) |
Unregister an existing callback registered with register_forward().
Specific to DebugIo.