xorp

XrlPortManager< A > Class Template Reference

Class for managing RIP Ports and their transport systems. More...

#include <xrl_port_manager.hh>

Inheritance diagram for XrlPortManager< A >:
NONCOPYABLE PortManagerBase< A > IfMgrHintObserver ServiceBase ServiceChangeObserverBase BugCatcher

List of all members.

Public Member Functions

 XrlPortManager (System< A > &system, XrlRouter &xr, IfMgrXrlMirror &ifm)
int startup ()
 Request start up of instance.
int shutdown ()
 Request shutdown of instance.
bool add_rip_address (const string &ifname, const string &vifname, const A &addr)
 Request the addition of an address to run RIP on.
bool remove_rip_address (const string &ifname, const string &vifname, const A &addr)
 Remove an address running RIP.
bool deliver_packet (const string &sockid, const string &ifname, const string &vifname, const A &src_addr, uint16_t src_port, const vector< uint8_t > &pdata)
 Deliver packet to RIP port associated with socket id that received the packet.
Port< A > * find_port (const string &ifname, const string &vifname, const A &addr)
 Find RIP port associated with interface, vif, address tuple.
const Port< A > * find_port (const string &ifname, const string &vifname, const A &addr) const
 Find RIP port associated with interface, vif, address tuple.
bool underlying_rip_address_up (const string &ifname, const string &vifname, const A &addr) const
 Determine if rip address is up.
bool underlying_rip_address_exists (const string &ifname, const string &vifname, const A &addr) const
 Determine if rip address exists.
Tracepacket_trace ()

Protected Member Functions

void tree_complete ()
void updates_made ()
void status_change (ServiceBase *service, ServiceStatus old_status, ServiceStatus new_status)
void try_start_next_io_handler ()

Protected Attributes

XrlRouter_xr
IfMgrXrlMirror_ifm
map< ServiceBase *, Port< A > * > _dead_ports

Private Attributes

Trace _trace

Detailed Description

template<typename A>
class XrlPortManager< A >

Class for managing RIP Ports and their transport systems.

The XrlPortManager class instantiates RIP Port instances and their transport system. The methods add_rip_address and remove_rip_address cause Port objects and XrlPortIO objects to be instantiated and destructed.

The deliver_packet method forwards an arriving packet to the appropriate XrlPortIO object.


Member Function Documentation

template<typename A>
bool XrlPortManager< A >::add_rip_address ( const string &  ifname,
const string &  vifname,
const A &  addr 
)

Request the addition of an address to run RIP on.

If the address is known to exist on the specified interface and vif, a request is sent to the FEA to create an appropriately bound RIP socket.

Parameters:
interfaceto run RIP on.
vifvirtual interface to run RIP on.
addraddress to run RIP on.
Returns:
true on success or if address is already running RIP, false on failure.
template<typename A>
bool XrlPortManager< A >::deliver_packet ( const string &  sockid,
const string &  ifname,
const string &  vifname,
const A &  src_addr,
uint16_t  src_port,
const vector< uint8_t > &  pdata 
)

Deliver packet to RIP port associated with socket id that received the packet.

Parameters:
sockidunique socket identifier.
ifnamethe interface name the packet arrived on, if known. If unknown, then it is an empty string.
vifnamethe vif name the packet arrived on, if known. If unknown, then it is an empty string.
src_addrsource address of packet.
src_portsource port of packet.
pdatapacket data.
Returns:
true if packet delivered, false if the owner of the sockid can not be found.
template<typename A>
Port< A > * XrlPortManager< A >::find_port ( const string &  ifname,
const string &  vifname,
const A &  addr 
)

Find RIP port associated with interface, vif, address tuple.

Returns:
pointer to port on success, 0 if port could not be found.
template<typename A>
const Port< A > * XrlPortManager< A >::find_port ( const string &  ifname,
const string &  vifname,
const A &  addr 
) const

Find RIP port associated with interface, vif, address tuple.

Returns:
pointer to port on success, 0 if port could not be found.
template<typename A>
bool XrlPortManager< A >::remove_rip_address ( const string &  ifname,
const string &  vifname,
const A &  addr 
)

Remove an address running RIP.

Parameters:
interfaceto run RIP on.
vifvirtual interface to run RIP on.
addraddress to run RIP on.
Returns:
true on success or if address is not running RIP, false on otherwise.
template<typename A >
int XrlPortManager< A >::shutdown ( ) [virtual]

Request shutdown of instance.

Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements ServiceBase.

template<typename A >
int XrlPortManager< A >::startup ( ) [virtual]

Request start up of instance.

Returns:
XORP_OK on success, otherwise XORP_ERROR.

Implements ServiceBase.

template<typename A>
bool XrlPortManager< A >::underlying_rip_address_exists ( const string &  ifname,
const string &  vifname,
const A &  addr 
) const

Determine if rip address exists.

The result is based on the current state of information from the FEA.

Returns:
true if the address is up, false if the address is not up or does not exist.
template<typename A>
bool XrlPortManager< A >::underlying_rip_address_up ( const string &  ifname,
const string &  vifname,
const A &  addr 
) const

Determine if rip address is up.

The result is based on the current state of information from the FEA.

Returns:
true if the address is up, false if the address is not up or does not exist.

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