OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Interface Class Referenceabstract

#include <interface.h>

Inheritance diagram for Interface:
Collaboration diagram for Interface:

Public Types

enum  Type {
  INVALID, PHYSICAL, REMOTE_PHYSICAL, LOGICAL,
  VM_INTERFACE, INET, PACKET
}
 
enum  Trace {
  ADD, DEL, ACTIVATED, DEACTIVATED,
  FLOATING_IP_CHANGE, SERVICE_CHANGE
}
 
enum  MirrorDirection { MIRROR_RX_TX, MIRROR_RX, MIRROR_TX, UNKNOWN }
 
enum  Transport {
  TRANSPORT_INVALID, TRANSPORT_VIRTUAL, TRANSPORT_ETHERNET, TRANSPORT_SOCKET,
  TRANSPORT_PMD
}
 
- Public Types inherited from AgentDBEntry
typedef boost::intrusive_ptr
< AgentDBEntry
AgentDBEntyRef
 
- Public Types inherited from DBEntryBase
typedef DBTableBase::ListenerId ListenerId
 
typedef std::unique_ptr
< DBRequestKey
KeyPtr
 

Public Member Functions

 Interface (Type type, const boost::uuids::uuid &uuid, const std::string &name, VrfEntry *vrf, bool os_oper_state, const boost::uuids::uuid &logical_router_uuid)
 
virtual ~Interface ()
 
virtual KeyPtr GetDBRequestKey () const =0
 
virtual void SetKey (const DBRequestKey *key)
 
virtual bool CmpInterface (const DBEntry &rhs) const =0
 
virtual bool Delete (const DBRequest *req)
 
virtual void Add ()
 
virtual void SendTrace (const AgentDBTable *table, Trace event) const
 
virtual void GetOsParams (Agent *agent)
 
void SetPciIndex (Agent *agent, size_t index)
 
bool IsLess (const DBEntry &rhs) const
 
uint32_t vrf_id () const
 
uint32_t GetRefCount () const
 
bool DBEntrySandesh (Sandesh *sresp, std::string &name) const
 
bool IsTunnelEnabled () const
 
Type type () const
 
const boost::uuids::uuidGetUuid () const
 
const std::string & name () const
 
VrfEntryvrf () const
 
bool ipv4_active () const
 
bool ipv6_active () const
 
bool is_hc_active () const
 
bool metadata_ip_active () const
 
bool metadata_l2_active () const
 
bool ip_active (Address::Family family) const
 
bool l2_active () const
 
const uint32_t id () const
 
bool dhcp_enabled () const
 
bool dhcp_enabled_v6 () const
 
bool dns_enabled () const
 
uint32_t label () const
 
uint32_t l2_label () const
 
bool IsL2LabelValid (uint32_t label) const
 
uint32_t os_index () const
 
const MacAddressmac () const
 
bool os_oper_state () const
 
bool admin_state () const
 
void set_test_oper_state (bool val)
 
void set_flow_key_nh (const NextHop *nh)
 
const NextHopflow_key_nh () const
 
Interface::Transport transport () const
 
bool IsUveActive () const
 
const AgentQosConfigqos_config () const
 
void UpdateOperStateOfSubIntf (const InterfaceTable *table)
 
bool NeedDefaultOsOperStateDisabled (Agent *agent) const
 
boost::optional
< InterfaceOsParams::IfGuid
os_guid () const
 
const boost::uuids::uuidlogical_router_uuid () const
 
void set_logical_router_uuid (const boost::uuids::uuid &logical_router_uuid)
 
InterfaceOsParams get_os_params ()
 
- Public Member Functions inherited from AgentOperDBEntry
 AgentOperDBEntry ()
 
virtual ~AgentOperDBEntry ()
 
IFMapNodeifmap_node () const
 
void SetIFMapNodeState (IFMapDependencyManager::IFMapNodePtr sref)
 
- Public Member Functions inherited from AgentDBEntry
 AgentDBEntry ()
 
virtual ~AgentDBEntry ()
 
void SetRefState () const
 
void ClearRefState () const
 
bool IsActive () const
 
DBStateGetAgentDBEntryState (int listener_id)
 
const DBStateGetAgentDBEntryState (int listener_id) const
 
virtual void AllocateResources (ResourceManager *resource_manager)
 
virtual void FreeResources (ResourceManager *resource_manager)
 
virtual void PostAdd ()
 
- Public Member Functions inherited from DBEntry
 DBEntry ()
 
virtual ~DBEntry ()
 
bool operator< (const DBEntry &rhs) const
 
- Public Member Functions inherited from DBEntryBase
 DBEntryBase ()
 
virtual ~DBEntryBase ()
 
virtual std::string ToString () const =0
 
virtual bool IsMoreSpecific (const std::string &match) const
 
virtual bool IsLessSpecific (const std::string &match) const
 
void SetState (DBTableBase *tbl_base, ListenerId listener, DBState *state)
 
void ClearState (DBTableBase *tbl_base, ListenerId listener)
 
DBStateGetState (DBTableBase *tbl_base, ListenerId listener) const
 
const DBStateGetState (const DBTableBase *tbl_base, ListenerId listener) const
 
bool is_state_empty (DBTablePartBase *tpart)
 
bool is_state_empty_unlocked (DBTablePartBase *tpart)
 
void Delete ()
 
void MarkDelete ()
 
void ClearDelete ()
 
bool IsDeleted () const
 
void set_onlist ()
 
void clear_onlist ()
 
bool is_onlist ()
 
void SetOnRemoveQ ()
 
bool IsOnRemoveQ ()
 
void ClearOnRemoveQ ()
 
void set_last_change_at (uint64_t time)
 
void set_last_change_at_to_now ()
 
const uint64_t last_change_at () const
 
const std::string last_change_at_str () const
 
void set_last_update_at (uint64_t time)
 
void set_last_update_at_to_now ()
 
const uint64_t last_update_at () const
 
DBTablePartBaseget_table_partition () const
 
void set_table_partition (DBTablePartBase *tpart)
 
DBTableBaseget_table () const
 
void Notify ()
 

Static Public Attributes

static const uint32_t kInvalidIndex = 0xFFFFFFFF
 

Protected Member Functions

void SetItfSandeshData (ItfSandeshData &data) const
 
virtual void ObtainOsSpecificParams (const std::string &name, Agent *agent)
 

Protected Attributes

Type type_
 
boost::uuids::uuid uuid_
 
VrfEntryRef vrf_
 
uint32_t label_
 
uint32_t l2_label_
 
bool ipv4_active_
 
bool ipv6_active_
 
bool is_hc_active_
 
bool metadata_ip_active_
 
bool metadata_l2_active_
 
bool l2_active_
 
size_t id_
 
bool dhcp_enabled_
 
bool dhcp_enabled_v6_
 
bool dns_enabled_
 
bool admin_state_
 
bool test_oper_state_
 
NextHopConstRef flow_key_nh_
 
Transport transport_
 
AgentQosConfigConstRef qos_config_
 
struct InterfaceOsParams os_params_
 
boost::uuids::uuid logical_router_uuid_
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (Interface)
 
- Private Member Functions inherited from AgentRefCount< Interface >
uint32_t GetRefCount () const
 
 AgentRefCount ()
 
 AgentRefCount (const AgentRefCount &)
 
AgentRefCountoperator= (const AgentRefCount &)
 
virtual ~AgentRefCount ()
 
void swap (AgentRefCount &)
 

Private Attributes

InterfaceTabletable_
 
- Private Attributes inherited from AgentRefCount< Interface >
tbb::mutex back_ref_mutex_
 
std::set< IntrusiveReferrerback_ref_set_
 

Friends

class InterfaceTable
 

Additional Inherited Members

- Public Attributes inherited from DBEntryBase
boost::intrusive::list_member_hook chg_list_
 

Detailed Description

Definition at line 23 of file interface.h.

Member Enumeration Documentation

Enumerator
MIRROR_RX_TX 
MIRROR_RX 
MIRROR_TX 
UNKNOWN 

Definition at line 55 of file interface.h.

Enumerator
ADD 
DEL 
ACTIVATED 
DEACTIVATED 
FLOATING_IP_CHANGE 
SERVICE_CHANGE 

Definition at line 46 of file interface.h.

Enumerator
TRANSPORT_INVALID 
TRANSPORT_VIRTUAL 
TRANSPORT_ETHERNET 
TRANSPORT_SOCKET 
TRANSPORT_PMD 

Definition at line 62 of file interface.h.

Enumerator
INVALID 
PHYSICAL 
REMOTE_PHYSICAL 
LOGICAL 
VM_INTERFACE 
INET 
PACKET 

Definition at line 26 of file interface.h.

Constructor & Destructor Documentation

Interface::Interface ( Type  type,
const boost::uuids::uuid uuid,
const std::string &  name,
VrfEntry vrf,
bool  os_oper_state,
const boost::uuids::uuid logical_router_uuid 
)

Definition at line 480 of file interface.cc.

Interface::~Interface ( )
virtual

Definition at line 495 of file interface.cc.

Here is the call graph for this function:

Member Function Documentation

virtual void Interface::Add ( )
inlinevirtual

Reimplemented in VmInterface.

Definition at line 86 of file interface.h.

bool Interface::admin_state ( ) const
inline

Definition at line 133 of file interface.h.

virtual bool Interface::CmpInterface ( const DBEntry rhs) const
pure virtual
bool Interface::DBEntrySandesh ( Sandesh sresp,
std::string &  name 
) const
virtual

Implements AgentDBEntry.

Definition at line 1417 of file interface.cc.

Here is the call graph for this function:

virtual bool Interface::Delete ( const DBRequest req)
inlinevirtual

Reimplemented in VmInterface, PhysicalInterface, InetInterface, PacketInterface, and LogicalInterface.

Definition at line 85 of file interface.h.

bool Interface::dhcp_enabled ( ) const
inline

Definition at line 124 of file interface.h.

bool Interface::dhcp_enabled_v6 ( ) const
inline

Definition at line 125 of file interface.h.

Interface::DISALLOW_COPY_AND_ASSIGN ( Interface  )
private
bool Interface::dns_enabled ( ) const
inline

Definition at line 126 of file interface.h.

const NextHop* Interface::flow_key_nh ( ) const
inline

Definition at line 137 of file interface.h.

InterfaceOsParams Interface::get_os_params ( )
inline

Definition at line 153 of file interface.h.

virtual KeyPtr Interface::GetDBRequestKey ( ) const
pure virtual
void Interface::GetOsParams ( Agent agent)
virtual

Reimplemented in VmInterface, LogicalInterface, and RemotePhysicalInterface.

Definition at line 536 of file interface.cc.

Here is the call graph for this function:

uint32_t Interface::GetRefCount ( ) const
inlinevirtual

Implements AgentDBEntry.

Definition at line 102 of file interface.h.

Here is the call graph for this function:

const boost::uuids::uuid& Interface::GetUuid ( ) const
inline

Definition at line 113 of file interface.h.

const uint32_t Interface::id ( ) const
inline

Definition at line 123 of file interface.h.

bool Interface::ip_active ( Address::Family  family) const

Definition at line 1476 of file interface.cc.

bool Interface::ipv4_active ( ) const
inline

Definition at line 116 of file interface.h.

bool Interface::ipv6_active ( ) const
inline

Definition at line 117 of file interface.h.

bool Interface::is_hc_active ( ) const
inline

Definition at line 118 of file interface.h.

bool Interface::IsL2LabelValid ( uint32_t  label) const
inline

Definition at line 129 of file interface.h.

bool Interface::IsLess ( const DBEntry rhs) const
inlinevirtual

Implements DBEntry.

Definition at line 92 of file interface.h.

Here is the call graph for this function:

bool Interface::IsTunnelEnabled ( ) const
inline

Definition at line 109 of file interface.h.

bool Interface::IsUveActive ( ) const

Definition at line 1486 of file interface.cc.

Here is the call graph for this function:

bool Interface::l2_active ( ) const
inline

Definition at line 122 of file interface.h.

uint32_t Interface::l2_label ( ) const
inline

Definition at line 128 of file interface.h.

uint32_t Interface::label ( ) const
inline

Definition at line 127 of file interface.h.

const boost::uuids::uuid& Interface::logical_router_uuid ( ) const
inline

Definition at line 146 of file interface.h.

const MacAddress& Interface::mac ( ) const
inline

Definition at line 131 of file interface.h.

bool Interface::metadata_ip_active ( ) const
inline

Definition at line 119 of file interface.h.

bool Interface::metadata_l2_active ( ) const
inline

Definition at line 120 of file interface.h.

const std::string& Interface::name ( ) const
inline

Definition at line 114 of file interface.h.

bool Interface::NeedDefaultOsOperStateDisabled ( Agent agent) const

Definition at line 1509 of file interface.cc.

Here is the call graph for this function:

void Interface::ObtainOsSpecificParams ( const std::string &  name,
Agent agent 
)
protectedvirtual

Reimplemented in VmInterface, PhysicalInterface, and PacketInterface.

Definition at line 10 of file interface_params.cc.

Here is the call graph for this function:

boost::optional<InterfaceOsParams::IfGuid> Interface::os_guid ( ) const
inline

Definition at line 145 of file interface.h.

uint32_t Interface::os_index ( ) const
inline

Definition at line 130 of file interface.h.

bool Interface::os_oper_state ( ) const
inline

Definition at line 132 of file interface.h.

const AgentQosConfig* Interface::qos_config ( ) const
inline

Definition at line 140 of file interface.h.

void Interface::SendTrace ( const AgentDBTable table,
Trace  event 
) const
virtual

Reimplemented in VmInterface.

Definition at line 1455 of file interface.cc.

Here is the call graph for this function:

void Interface::set_flow_key_nh ( const NextHop nh)
inline

Definition at line 136 of file interface.h.

void Interface::set_logical_router_uuid ( const boost::uuids::uuid logical_router_uuid)
inline

Definition at line 149 of file interface.h.

Here is the call graph for this function:

void Interface::set_test_oper_state ( bool  val)
inline

Definition at line 135 of file interface.h.

void Interface::SetItfSandeshData ( ItfSandeshData &  data) const
protected

Definition at line 822 of file interface.cc.

void Interface::SetKey ( const DBRequestKey key)
virtual

Implements DBEntry.

Definition at line 614 of file interface.cc.

void Interface::SetPciIndex ( Agent agent,
size_t  index 
)

Definition at line 508 of file interface.cc.

Here is the call graph for this function:

Interface::Transport Interface::transport ( ) const
inline

Definition at line 138 of file interface.h.

Type Interface::type ( ) const
inline

Definition at line 112 of file interface.h.

void Interface::UpdateOperStateOfSubIntf ( const InterfaceTable table)

Definition at line 1493 of file interface.cc.

Here is the call graph for this function:

VrfEntry* Interface::vrf ( ) const
inline

Definition at line 115 of file interface.h.

uint32_t Interface::vrf_id ( ) const

Definition at line 621 of file interface.cc.

Friends And Related Function Documentation

friend class InterfaceTable
friend

Definition at line 192 of file interface.h.

Member Data Documentation

bool Interface::admin_state_
protected

Definition at line 178 of file interface.h.

bool Interface::dhcp_enabled_
protected

Definition at line 175 of file interface.h.

bool Interface::dhcp_enabled_v6_
protected

Definition at line 176 of file interface.h.

bool Interface::dns_enabled_
protected

Definition at line 177 of file interface.h.

NextHopConstRef Interface::flow_key_nh_
protected

Definition at line 185 of file interface.h.

size_t Interface::id_
protected

Definition at line 174 of file interface.h.

bool Interface::ipv4_active_
protected

Definition at line 166 of file interface.h.

bool Interface::ipv6_active_
protected

Definition at line 167 of file interface.h.

bool Interface::is_hc_active_
protected

Definition at line 169 of file interface.h.

const uint32_t Interface::kInvalidIndex = 0xFFFFFFFF
static

Definition at line 70 of file interface.h.

bool Interface::l2_active_
protected

Definition at line 173 of file interface.h.

uint32_t Interface::l2_label_
protected

Definition at line 165 of file interface.h.

uint32_t Interface::label_
protected

Definition at line 164 of file interface.h.

boost::uuids::uuid Interface::logical_router_uuid_
protected

Definition at line 189 of file interface.h.

bool Interface::metadata_ip_active_
protected

Definition at line 171 of file interface.h.

bool Interface::metadata_l2_active_
protected

Definition at line 172 of file interface.h.

struct InterfaceOsParams Interface::os_params_
protected

Definition at line 188 of file interface.h.

AgentQosConfigConstRef Interface::qos_config_
protected

Definition at line 187 of file interface.h.

InterfaceTable* Interface::table_
private

Definition at line 193 of file interface.h.

bool Interface::test_oper_state_
protected

Definition at line 180 of file interface.h.

Transport Interface::transport_
protected

Definition at line 186 of file interface.h.

Type Interface::type_
protected

Definition at line 161 of file interface.h.

boost::uuids::uuid Interface::uuid_
protected

Definition at line 162 of file interface.h.

VrfEntryRef Interface::vrf_
protected

Definition at line 163 of file interface.h.


The documentation for this class was generated from the following files: