xorp

IfTreeInterface Class Reference

FEA class for holding physical interface state. More...

#include <iftree.hh>

Inheritance diagram for IfTreeInterface:
IfTreeItem NONCOPYABLE

List of all members.

Public Types

typedef map< string, IfTreeVif * > VifMap
typedef set< MacMacSet

Public Member Functions

 IfTreeInterface (IfTree &iftree, const string &ifname)
IfTreeiftree ()
const string & ifname () const
uint32_t pif_index () const
void set_pif_index (uint32_t v)
virtual int mark (State st)
bool cr_by_xorp () const
void set_cr_by_xorp (bool b)
bool probed_vlan () const
void set_probed_vlan (bool b)
bool enabled () const
void set_enabled (bool en)
uint32_t mtu () const
void set_mtu (uint32_t mtu)
const Macmac () const
void set_mac (const Mac &mac)
MacSet & macs ()
const MacSet & macs () const
bool no_carrier () const
void set_no_carrier (bool v)
uint64_t baudrate () const
void set_baudrate (uint64_t v)
const string & parent_ifname () const
void set_parent_ifname (string &v)
bool is_vlan () const
const string & iface_type () const
void set_iface_type (string &v)
const string & vid () const
void set_vid (string &v)
bool discard () const
void set_discard (bool discard)
bool unreachable () const
void set_unreachable (bool v)
bool management () const
void set_management (bool v)
bool default_system_config () const
void set_default_system_config (bool v)
uint32_t interface_flags () const
 Get the system-specific interface flags.
void set_interface_flags (uint32_t v)
 Store the system-specific interface flags.
const VifMap & vifs () const
VifMap & vifs ()
void add_recursive_vif (const IfTreeVif &other_vif, bool mark_state)
 Add recursively a new vif.
int add_vif (const string &vifname)
 Create a new vif.
int remove_vif (const string &vifname)
 Label vif as ready for deletion.
IfTreeViffind_vif (const string &vifname)
 Find a vif.
const IfTreeViffind_vif (const string &vifname) const
 Find a const vif.
IfTreeViffind_vif (uint32_t pif_index)
 Find a vif for a given physical index.
const IfTreeViffind_vif (uint32_t pif_index) const
 Find a const vif for a given physical index.
IfTreeAddr4find_addr (const string &vifname, const IPv4 &addr)
 Find an IPv4 address.
const IfTreeAddr4find_addr (const string &vifname, const IPv4 &addr) const
 Find a const IPv4 address.
IfTreeAddr6find_addr (const string &vifname, const IPv6 &addr)
 Find an IPv6 address.
const IfTreeAddr6find_addr (const string &vifname, const IPv6 &addr) const
 Find a const IPv6 address.
void copy_state (const IfTreeInterface &o, bool copy_user_config)
 Copy state of internal variables from another IfTreeInterface.
bool is_same_state (const IfTreeInterface &o)
 Test if the interface-specific internal state is same.
void finalize_state ()
 Virtual method to be implemented to flush out state associated objects, ie if an object is marked CREATED or CHANGED it should be marked NO_CHANGE, if an object is marked DELETED, it should be removed from the relevant container and destructed.
string str () const

Private Attributes

IfTree_iftree
const string _ifname
string _parent_ifname
string _iface_type
string _vid
uint32_t _pif_index
bool _created_by_xorp
bool _probed_vlan
bool _enabled
bool _discard
bool _unreachable
bool _management
bool _default_system_config
uint32_t _mtu
Mac _mac
bool _no_carrier
uint64_t _baudrate
uint32_t _interface_flags
VifMap _vifs
MacSet _macs

Detailed Description

FEA class for holding physical interface state.


Member Function Documentation

void IfTreeInterface::add_recursive_vif ( const IfTreeVif other_vif,
bool  mark_state 
)

Add recursively a new vif.

Parameters:
other_vifthe vif to add recursively.
mark_stateif true, then mark the state same as the state from the other vif, otherwise the state will be CREATED.
int IfTreeInterface::add_vif ( const string &  vifname)

Create a new vif.

Parameters:
vifnamethe vif name.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
void IfTreeInterface::copy_state ( const IfTreeInterface o,
bool  copy_user_config 
)

Copy state of internal variables from another IfTreeInterface.

Parameters:
othe interface to copy from.
copy_user_configif true then copy the flags from the user's configuration.
const IfTreeAddr6 * IfTreeInterface::find_addr ( const string &  vifname,
const IPv6 addr 
) const

Find a const IPv6 address.

Parameters:
vifnamethe vif name to search for.
addrthe address to search for.
Returns:
a pointer to the vif (IfTreeAddr6) or NULL if not found.
const IfTreeAddr4 * IfTreeInterface::find_addr ( const string &  vifname,
const IPv4 addr 
) const

Find a const IPv4 address.

Parameters:
vifnamethe vif name to search for.
addrthe address to search for.
Returns:
a const pointer to the vif (IfTreeAddr4) or NULL if not found.
IfTreeAddr6 * IfTreeInterface::find_addr ( const string &  vifname,
const IPv6 addr 
)

Find an IPv6 address.

Parameters:
vifnamethe vif name to search for.
addrthe address to search for.
Returns:
a pointer to the vif (IfTreeAddr6) or NULL if not found.
IfTreeAddr4 * IfTreeInterface::find_addr ( const string &  vifname,
const IPv4 addr 
)

Find an IPv4 address.

Parameters:
vifnamethe vif name to search for.
addrthe address to search for.
Returns:
a pointer to the vif (IfTreeAddr4) or NULL if not found.
const IfTreeVif * IfTreeInterface::find_vif ( uint32_t  pif_index) const

Find a const vif for a given physical index.

Parameters:
pif_indexthe physical interface index to search for.
Returns:
a const pointer to the interface (IfTreeVif) or NULL if not found.
IfTreeVif * IfTreeInterface::find_vif ( const string &  vifname)

Find a vif.

Parameters:
vifnamethe vif name to search for.
Returns:
a pointer to the vif (IfTreeVif) or NULL if not found.
const IfTreeVif * IfTreeInterface::find_vif ( const string &  vifname) const

Find a const vif.

Parameters:
vifnamethe vif name to search for.
Returns:
a const pointer to the vif (IfTreeVif) or NULL if not found.
IfTreeVif * IfTreeInterface::find_vif ( uint32_t  pif_index)

Find a vif for a given physical index.

Parameters:
pif_indexthe physical interface index to search for.
Returns:
a pointer to the interface (IfTreeVif) or NULL if not found.
uint32_t IfTreeInterface::interface_flags ( ) const [inline]

Get the system-specific interface flags.

Typically, this value is read from the underlying system, and is used only for internal purpose.

Returns:
the system-specific interface flags.
bool IfTreeInterface::is_same_state ( const IfTreeInterface o)

Test if the interface-specific internal state is same.

Parameters:
othe IfTreeInterface to compare against.
Returns:
true if the interface-specific internal state is same.
int IfTreeInterface::remove_vif ( const string &  vifname)

Label vif as ready for deletion.

Deletion does not occur until finalize_state() is called.

Parameters:
vifnamethe name of the vif to be labelled.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
void IfTreeInterface::set_interface_flags ( uint32_t  v) [inline]

Store the system-specific interface flags.

Typically, this value is read from the underlying system, and is used only for internal purpose.

Parameters:
vthe value of the system-specific interface flags to store.

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