xorp

PortIOBase< A > Class Template Reference

Base class for RIP Port I/O classes. More...

#include <port_io.hh>

Inheritance diagram for PortIOBase< A >:
BlockedPortIO< A > SpoofPortIO< A > XrlPortIO< A >

List of all members.

Public Types

typedef A Addr
typedef PortIOUserBase< A > PortIOUser

Public Member Functions

 PortIOBase (PortIOUser &user, const string &ifname, const string &vifname, const Addr &address, bool enabled=true)
 Constructor associating a Port I/O User object with I/O object.
virtual bool send (const Addr &dst_addr, uint16_t dst_port, const vector< uint8_t > &rip_packet)=0
 Send RIP packet to Port.
virtual bool pending () const =0
 Check if send request is pending.
const string & ifname () const
 Get Interface name associated with I/O.
const string & vifname () const
 Get Virtual Interface name associated with I/O.
const Addr & address () const
 Get associated address.
size_t max_route_entries_per_packet () const
 Get the maximum number of route entries in a packet.
bool set_max_route_entries_per_packet (size_t max_entries)
 Set the maximum number of route entries in a packet.
bool enabled () const
 Get enabled status of I/O system.
void set_enabled (bool en)
 Set enabled status of I/O system.
template<>
bool set_max_route_entries_per_packet (size_t max_entries)

Protected Attributes

PortIOUser_user
string _ifname
string _vifname
Addr _addr
size_t _max_rte_pp
bool _en

Detailed Description

template<typename A>
class PortIOBase< A >

Base class for RIP Port I/O classes.

RIP Port I/O classes provide support for reading and writing to RIP Ports.


Member Function Documentation

template<typename A>
virtual bool PortIOBase< A >::pending ( ) const [pure virtual]

Check if send request is pending.

Returns:
true if a send request is pending, false otherwise.

Implemented in BlockedPortIO< A >, SpoofPortIO< A >, XrlPortIO< A >, and SpoofPortIO< IPv4 >.

template<typename A>
virtual bool PortIOBase< A >::send ( const Addr &  dst_addr,
uint16_t  dst_port,
const vector< uint8_t > &  rip_packet 
) [pure virtual]

Send RIP packet to Port.

The invoker of this method is expected to be the associated Port I/O User instance. The invoker is responsible for the packet data in the send request and should not decommission the data until it receives the PortIOUserBase<A>::send_completion callback. If the request to send fails immediately the send_completion callback is not called for the associated data.

Parameters:
dst_addraddress to send packet.
dst_portport to send packet to.
rip_packetvector containing rip packet to be sent.
Returns:
false on immediately detectable failure, true otherwise.

Implemented in BlockedPortIO< A >, SpoofPortIO< A >, XrlPortIO< A >, and SpoofPortIO< IPv4 >.

template<typename A >
void PortIOBase< A >::set_enabled ( bool  en) [inline]

Set enabled status of I/O system.

The user object associated with the I/O system will be notified through PortIOBase<A>::port_io_enabled_change() if the enabled state changes.

Parameters:
ennew enable state.
template<typename A>
bool PortIOBase< A >::set_max_route_entries_per_packet ( size_t  max_entries)

Set the maximum number of route entries in a packet.

Returns:
true on success, false if route entries per packet is fixed.

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