xorp

IfMgrIfTree Class Reference

Interface configuration tree container. More...

#include <ifmgr_atoms.hh>

List of all members.

Public Types

typedef map< string, IfMgrIfAtomIfMap

Public Member Functions

const IfMap & interfaces () const
 Interface collection accessor.
IfMap & interfaces ()
 Interface collection accessor.
void clear ()
 Clear all interface state.
const IfMgrIfAtomfind_interface (const string &ifname) const
 Find interface.
IfMgrIfAtomfind_interface (const string &ifname)
 Find interface.
const IfMgrVifAtomfind_vif (const string &ifname, const string &vifname) const
 Find virtual interface.
IfMgrVifAtomfind_vif (const string &ifname, const string &vifname)
 Find virtual interface.
const IfMgrIPv4Atomfind_addr (const string &ifname, const string &vifname, const IPv4 &addr) const
 Find IPv4 address structure.
IfMgrIPv4Atomfind_addr (const string &ifname, const string &vifname, const IPv4 &addr)
 Find IPv4 address structure.
const IfMgrIPv6Atomfind_addr (const string &ifname, const string &vifname, const IPv6 &addr) const
 Find IPv6 address structure.
IfMgrIPv6Atomfind_addr (const string &ifname, const string &vifname, const IPv6 &addr)
 Find IPv6 address structure.
bool operator== (const IfMgrIfTree &o) const
 Equality operator.
bool is_my_addr (const IPv4 &addr, string &ifname, string &vifname) const
 Test if an IPv4 address belongs to an interface.
bool is_my_addr (const IPv6 &addr, string &ifname, string &vifname) const
 Test if an IPv6 address belongs to an interface.
bool is_my_addr (const IPvX &addr, string &ifname, string &vifname) const
 Test if an IPvX address belongs to an interface.
bool is_directly_connected (const IPv4 &addr, string &ifname, string &vifname) const
 Test if an IPv4 address is directly connected to an interface.
bool is_directly_connected (const IPv6 &addr, string &ifname, string &vifname) const
 Test if an IPv6 address is directly connected to an interface.
bool is_directly_connected (const IPvX &addr, string &ifname, string &vifname) const
 Test if an IPvX address is directly connected to an interface.
string toString () const

Protected Attributes

IfMap _interfaces

Detailed Description

Interface configuration tree container.

The IfMgrIfTree is the top-level container of interface configuration state. The tree contains a collection of IfMgrIfAtom objects, each of which represents the configuration state of a physical interface.


Member Function Documentation

const IfMgrIPv4Atom * IfMgrIfTree::find_addr ( const string &  ifname,
const string &  vifname,
const IPv4 addr 
) const

Find IPv4 address structure.

Parameters:
ifnamename of interface responsible for address.
vifnamename of virtual interface responsible for address.
addrIPv4 address.
Returns:
pointer to virtual interface structure on success, 0 otherwise.
IfMgrIPv4Atom * IfMgrIfTree::find_addr ( const string &  ifname,
const string &  vifname,
const IPv4 addr 
)

Find IPv4 address structure.

Parameters:
ifnamename of interface responsible for address.
vifnamename of virtual interface responsible for address.
addrIPv4 address.
Returns:
pointer to virtual interface structure on success, 0 otherwise.
const IfMgrIPv6Atom * IfMgrIfTree::find_addr ( const string &  ifname,
const string &  vifname,
const IPv6 addr 
) const

Find IPv6 address structure.

Parameters:
ifnamename of interface responsible for address.
vifnamename of virtual interface responsible for address.
addrIPv6 address.
Returns:
pointer to virtual interface structure on success, 0 otherwise.
IfMgrIPv6Atom * IfMgrIfTree::find_addr ( const string &  ifname,
const string &  vifname,
const IPv6 addr 
)

Find IPv6 address structure.

Parameters:
ifnamename of interface responsible for address.
vifnamename of virtual interface responsible for address.
addrIPv6 address.
Returns:
pointer to virtual interface structure on success, 0 otherwise.
const IfMgrIfAtom * IfMgrIfTree::find_interface ( const string &  ifname) const

Find interface.

Parameters:
ifnamename of interface to find.
Returns:
pointer to interface structure on success, 0 otherwise.
IfMgrIfAtom * IfMgrIfTree::find_interface ( const string &  ifname)

Find interface.

Parameters:
ifnamename of interface to find.
Returns:
pointer to interface structure on success, 0 otherwise.
const IfMgrVifAtom * IfMgrIfTree::find_vif ( const string &  ifname,
const string &  vifname 
) const

Find virtual interface.

Parameters:
ifnamename of interface responsible for virtual interface.
vifnamename of virtual interface.
Returns:
pointer to virtual interface structure on success, 0 otherwise.
IfMgrVifAtom * IfMgrIfTree::find_vif ( const string &  ifname,
const string &  vifname 
)

Find virtual interface.

Parameters:
ifnamename of interface responsible for virtual interface.
vifnamename of virtual interface.
Returns:
pointer to virtual interface structure on success, 0 otherwise.
bool IfMgrIfTree::is_directly_connected ( const IPv4 addr,
string &  ifname,
string &  vifname 
) const

Test if an IPv4 address is directly connected to an interface.

If an interface toward an address is down, then the address is not considered as directly connected.

Parameters:
addrthe address to test.
ifnamethe return-by-reference name of the interface toward the address if the address is directly connected otherwise an empty string.
vifnamethe return-by-reference name of the vif toward the address if the address is directly connected otherwise an empty string.
Returns:
true if the address is directly connected, otherwise false.
bool IfMgrIfTree::is_directly_connected ( const IPvX addr,
string &  ifname,
string &  vifname 
) const

Test if an IPvX address is directly connected to an interface.

If an interface toward an address is down, then the address is not considered as directly connected.

Parameters:
addrthe address to test.
ifnamethe return-by-reference name of the interface toward the address if the address is directly connected otherwise an empty string.
vifnamethe return-by-reference name of the vif toward the address if the address is directly connected otherwise an empty string.
Returns:
true if the address is directly connected, otherwise false.
bool IfMgrIfTree::is_directly_connected ( const IPv6 addr,
string &  ifname,
string &  vifname 
) const

Test if an IPv6 address is directly connected to an interface.

If an interface toward an address is down, then the address is not considered as directly connected.

Parameters:
addrthe address to test.
ifnamethe return-by-reference name of the interface toward the address if the address is directly connected otherwise an empty string.
vifnamethe return-by-reference name of the vif toward the address if the address is directly connected otherwise an empty string.
Returns:
true if the address is directly connected, otherwise false.
bool IfMgrIfTree::is_my_addr ( const IPv4 addr,
string &  ifname,
string &  vifname 
) const

Test if an IPv4 address belongs to an interface.

If an interface with the address is down, then the address is not considered to belong to that interface.

Parameters:
addrthe address to test.
ifnamethe return-by-reference name of the interface the address belongs to, or an empty string.
vifnamethe return-by-reference name of the vif the address belongs to, or an empty string.
Returns:
true if the address belongs to an interface, otherwise false.
bool IfMgrIfTree::is_my_addr ( const IPv6 addr,
string &  ifname,
string &  vifname 
) const

Test if an IPv6 address belongs to an interface.

If an interface with the address is down, then the address is not considered to belong to that interface.

Parameters:
addrthe address to test.
ifnamethe return-by-reference name of the interface the address belongs to, or an empty string.
vifnamethe return-by-reference name of the vif the address belongs to, or an empty string.
Returns:
true if the address belongs to an interface, otherwise false.
bool IfMgrIfTree::is_my_addr ( const IPvX addr,
string &  ifname,
string &  vifname 
) const

Test if an IPvX address belongs to an interface.

If an interface with the address is down, then the address is not considered to belong to that interface.

Parameters:
addrthe address to test.
ifnamethe return-by-reference name of the interface the address belongs to, or an empty string.
vifnamethe return-by-reference name of the vif the address belongs to, or an empty string.
Returns:
true if the address belongs to an interface, otherwise false.
bool IfMgrIfTree::operator== ( const IfMgrIfTree o) const

Equality operator.

Parameters:
otree to compare against.
Returns:
true if this instance and o are the same, false otherwise.

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