xorp

IfTreeVif Class Reference

FEA class for virtual (logical) interface state. More...

#include <iftree.hh>

Inheritance diagram for IfTreeVif:
IfTreeItem NONCOPYABLE

List of all members.

Public Types

typedef map< IPv4, IfTreeAddr4 * > IPv4Map
typedef map< IPv6, IfTreeAddr6 * > IPv6Map

Public Member Functions

 IfTreeVif (IfTreeInterface &iface, const string &vifname)
IfTreeiftree ()
const string & ifname () const
const string & vifname () const
uint32_t pif_index () const
void set_pif_index (uint32_t v)
uint32_t vif_index () const
void set_vif_index (uint32_t v)
bool enabled () const
bool broadcast () const
bool loopback () const
bool point_to_point () const
bool multicast () const
bool pim_register () const
void set_enabled (bool en)
void set_broadcast (bool v)
void set_loopback (bool v)
void set_point_to_point (bool v)
void set_multicast (bool v)
void set_pim_register (bool v)
uint32_t vif_flags () const
 Get the system-specific vif flags.
void set_vif_flags (uint32_t v)
 Store the system-specific vif flags.
const IPv4Map & ipv4addrs () const
IPv4Map & ipv4addrs ()
const IPv6Map & ipv6addrs () const
IPv6Map & ipv6addrs ()
void copy_recursive_vif (const IfTreeVif &other_vif)
 Copy recursively from another vif.
void add_recursive_addr (const IfTreeAddr4 &other_addr, bool mark_state)
 Add recursively a new IPv4 address.
void add_recursive_addr (const IfTreeAddr6 &other_addr, bool mark_state)
 Add recursively a new IPv6 address.
int add_addr (const IPv4 &addr)
 Add IPv4 address.
int remove_addr (const IPv4 &addr)
 Mark IPv4 address as DELETED.
int add_addr (const IPv6 &addr)
 Add IPv6 address.
int remove_addr (const IPv6 &addr)
 Mark IPv6 address as DELETED.
IfTreeAddr4find_addr (const IPv4 &addr)
 Find an IPv4 address.
const IfTreeAddr4find_addr (const IPv4 &addr) const
 Find a const IPv4 address.
IfTreeAddr6find_addr (const IPv6 &addr)
 Find an IPv6 address.
const IfTreeAddr6find_addr (const IPv6 &addr) const
 Find a const IPv6 address.
void propagate_flags_to_addresses ()
 Propagate vif flags to the addresses.
void copy_state (const IfTreeVif &o)
 Copy state of internal variables from another IfTreeVif.
bool is_same_state (const IfTreeVif &o)
 Test if the vif-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

IfTreeInterface_iface
const string _vifname
uint32_t _pif_index
uint32_t _vif_index
bool _enabled
bool _broadcast
bool _loopback
bool _point_to_point
bool _multicast
bool _pim_register
uint32_t _vif_flags
IPv4Map _ipv4addrs
IPv6Map _ipv6addrs

Detailed Description

FEA class for virtual (logical) interface state.


Member Function Documentation

int IfTreeVif::add_addr ( const IPv4 addr)

Add IPv4 address.

Parameters:
addraddress to be added.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int IfTreeVif::add_addr ( const IPv6 addr)

Add IPv6 address.

Parameters:
addraddress to be added.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
void IfTreeVif::add_recursive_addr ( const IfTreeAddr4 other_addr,
bool  mark_state 
)

Add recursively a new IPv4 address.

Parameters:
other_addrthe address to add recursively.
mark_stateif true, then mark the state same as the state from the other address, otherwise the state will be CREATED.
void IfTreeVif::add_recursive_addr ( const IfTreeAddr6 other_addr,
bool  mark_state 
)

Add recursively a new IPv6 address.

Parameters:
other_addrthe address to add recursively.
mark_stateif true, then mark the state same as the state from the other address, otherwise the state will be CREATED.
void IfTreeVif::copy_recursive_vif ( const IfTreeVif other_vif)

Copy recursively from another vif.

Parameters:
other_vifthe vif to copy recursively from.
const IfTreeAddr4 * IfTreeVif::find_addr ( const IPv4 addr) const

Find a const IPv4 address.

Parameters:
addrthe address to search for.
Returns:
a const pointer to the vif (IfTreeAddr4) or NULL if not found.
IfTreeAddr6 * IfTreeVif::find_addr ( const IPv6 addr)

Find an IPv6 address.

Parameters:
addrthe address to search for.
Returns:
a pointer to the vif (IfTreeAddr6) or NULL if not found.
IfTreeAddr4 * IfTreeVif::find_addr ( const IPv4 addr)

Find an IPv4 address.

Parameters:
addrthe address to search for.
Returns:
a pointer to the vif (IfTreeAddr4) or NULL if not found.
const IfTreeAddr6 * IfTreeVif::find_addr ( const IPv6 addr) const

Find a const IPv6 address.

Parameters:
addrthe address to search for.
Returns:
a pointer to the vif (IfTreeAddr6) or NULL if not found.
bool IfTreeVif::is_same_state ( const IfTreeVif o) [inline]

Test if the vif-specific internal state is same.

Parameters:
othe IfTreeVif to compare against.
Returns:
true if the vif-specific internal state is same.
int IfTreeVif::remove_addr ( const IPv6 addr)

Mark IPv6 address as DELETED.

Deletion occurs when finalize_state is called.

Parameters:
addraddress to labelled.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
int IfTreeVif::remove_addr ( const IPv4 addr)

Mark IPv4 address as DELETED.

Deletion occurs when finalize_state is called.

Parameters:
addraddress to labelled.
Returns:
XORP_OK on success, otherwise XORP_ERROR.
void IfTreeVif::set_vif_flags ( uint32_t  v) [inline]

Store the system-specific vif flags.

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

Parameters:
vthe value of the system-specific vif flags to store.
uint32_t IfTreeVif::vif_flags ( ) const [inline]

Get the system-specific vif flags.

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

Returns:
the system-specific vif flags.

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