OpenSDN source code
OVSDB::OvsdbClientIdl Class Reference

#include <ovsdb_client_idl.h>

Collaboration diagram for OVSDB::OvsdbClientIdl:

Classes

struct  OvsdbMsg
 
struct  TxnStats
 

Public Types

enum  OvsdbSessionState { OvsdbSessionActive = 0 , OvsdbSessionRcvWait , OvsdbSessionEchoWait }
 
enum  Op { OVSDB_DEL = 0 , OVSDB_ADD , OVSDB_INVALID_OP }
 
enum  EntryType {
  OVSDB_PHYSICAL_SWITCH = 0 , OVSDB_LOGICAL_SWITCH , OVSDB_PHYSICAL_PORT , OVSDB_PHYSICAL_LOCATOR ,
  OVSDB_UCAST_MAC_LOCAL , OVSDB_UCAST_MAC_REMOTE , OVSDB_PHYSICAL_LOCATOR_SET , OVSDB_MCAST_MAC_LOCAL ,
  OVSDB_MCAST_MAC_REMOTE , OVSDB_TYPE_COUNT
}
 
typedef boost::function< void(OvsdbClientIdl::Op, struct ovsdb_idl_row *)> NotifyCB
 
typedef std::map< struct ovsdb_idl_txn *, OvsdbEntryListPendingTxnMap
 
typedef std::queue< struct jsonrpc_msg * > ThrottledTxnMsgs
 

Public Member Functions

 OvsdbClientIdl (OvsdbClientSession *session, Agent *agent, OvsPeerManager *manager)
 
virtual ~OvsdbClientIdl ()
 
bool ProcessMessage (OvsdbMsg *msg)
 
void OnEstablish ()
 
void TxnScheduleJsonRpc (struct jsonrpc_msg *msg)
 
void MessageProcess (const u_int8_t *buf, std::size_t len)
 
struct ovsdb_idl_txn * CreateTxn (OvsdbEntryBase *entry, KSyncEntry::KSyncEvent ack_event=KSyncEntry::ADD_ACK)
 
struct ovsdb_idl_txn * CreateBulkTxn (OvsdbEntryBase *entry, KSyncEntry::KSyncEvent ack_event=KSyncEntry::ADD_ACK)
 
bool EncodeSendTxn (struct ovsdb_idl_txn *txn, OvsdbEntryBase *skip_entry)
 
void DeleteTxn (struct ovsdb_idl_txn *txn)
 
void Register (EntryType type, NotifyCB cb)
 
void UnRegister (EntryType type)
 
void NotifyDelAdd (struct ovsdb_idl_row *row)
 
Ip4Address tsn_ip ()
 
void MessageProcess (struct jsonrpc_msg *msg)
 
Ip4Address remote_ip () const
 
uint16_t remote_port () const
 
ConnectionStateTableconnection_table ()
 
KSyncObjectManagerksync_obj_manager ()
 
OvsPeerroute_peer ()
 
bool deleted ()
 
Agentagent () const
 
VMInterfaceKSyncObjectvm_interface_table ()
 
PhysicalSwitchTablephysical_switch_table ()
 
LogicalSwitchTablelogical_switch_table ()
 
PhysicalPortTablephysical_port_table ()
 
PhysicalLocatorTablephysical_locator_table ()
 
VlanPortBindingTablevlan_port_table ()
 
UnicastMacLocalOvsdbunicast_mac_local_ovsdb ()
 
MulticastMacLocalOvsdbmulticast_mac_local_ovsdb ()
 
VrfOvsdbObjectvrf_ovsdb ()
 
VnOvsdbObjectvn_ovsdb ()
 
OvsdbResourceVxLanIdTablevxlan_table ()
 
bool IsKeepAliveTimerActive ()
 
bool IsMonitorInProcess ()
 
bool KeepAliveTimerCb ()
 
void TriggerDeletion ()
 
bool IsDeleted () const
 
int refcount () const
 
const TxnStatsstats () const
 
uint64_t pending_txn_count () const
 
uint64_t pending_send_msg_count () const
 
bool ConcurrencyCheck () const
 

Static Public Attributes

static const std::size_t OVSDBMaxInFlightPendingTxn = 25
 
static const std::size_t OVSDBEntriesInBulkTxn = 4
 

Private Member Functions

void ConnectOperDB ()
 
 DISALLOW_COPY_AND_ASSIGN (OvsdbClientIdl)
 

Private Attributes

struct ovsdb_idl * idl_
 
const struct vteprec_global * vtep_global_
 
OvsdbClientSessionsession_
 
Agentagent_
 
NotifyCB callback_ [OVSDB_TYPE_COUNT]
 
PendingTxnMap pending_txn_
 
ThrottledTxnMsgs pending_send_msgs_
 
bool deleted_
 
WorkQueue< OvsdbMsg * > * receive_queue_
 
OvsPeerManagermanager_
 
OvsdbSessionState connection_state_
 
Timerkeepalive_timer_
 
struct json * monitor_request_id_
 
struct ovsdb_idl_txn * bulk_txn_
 
OvsdbEntryList bulk_entries_
 
TxnStats stats_
 
tbb::atomic< int > refcount_
 
std::unique_ptr< OvsPeerroute_peer_
 
std::unique_ptr< VMInterfaceKSyncObjectvm_interface_table_
 
std::unique_ptr< PhysicalSwitchTablephysical_switch_table_
 
std::unique_ptr< LogicalSwitchTablelogical_switch_table_
 
std::unique_ptr< PhysicalPortTablephysical_port_table_
 
std::unique_ptr< PhysicalLocatorTablephysical_locator_table_
 
std::unique_ptr< VlanPortBindingTablevlan_port_table_
 
std::unique_ptr< UnicastMacLocalOvsdbunicast_mac_local_ovsdb_
 
std::unique_ptr< MulticastMacLocalOvsdbmulticast_mac_local_ovsdb_
 
std::unique_ptr< VrfOvsdbObjectvrf_ovsdb_
 
std::unique_ptr< VnOvsdbObjectvn_ovsdb_
 
std::unique_ptr< OvsdbResourceVxLanIdTablevxlan_table_
 

Friends

void ovsdb_wrapper_idl_callback (void *, int, struct ovsdb_idl_row *)
 
void ovsdb_wrapper_idl_txn_ack (void *, struct ovsdb_idl_txn *)
 
void intrusive_ptr_add_ref (OvsdbClientIdl *p)
 
void intrusive_ptr_release (OvsdbClientIdl *p)
 

Detailed Description

Definition at line 58 of file ovsdb_client_idl.h.

Member Typedef Documentation

◆ NotifyCB

typedef boost::function<void(OvsdbClientIdl::Op, struct ovsdb_idl_row *)> OVSDB::OvsdbClientIdl::NotifyCB

Definition at line 109 of file ovsdb_client_idl.h.

◆ PendingTxnMap

typedef std::map<struct ovsdb_idl_txn *, OvsdbEntryList> OVSDB::OvsdbClientIdl::PendingTxnMap

Definition at line 110 of file ovsdb_client_idl.h.

◆ ThrottledTxnMsgs

typedef std::queue<struct jsonrpc_msg *> OVSDB::OvsdbClientIdl::ThrottledTxnMsgs

Definition at line 111 of file ovsdb_client_idl.h.

Member Enumeration Documentation

◆ EntryType

Enumerator
OVSDB_PHYSICAL_SWITCH 
OVSDB_LOGICAL_SWITCH 
OVSDB_PHYSICAL_PORT 
OVSDB_PHYSICAL_LOCATOR 
OVSDB_UCAST_MAC_LOCAL 
OVSDB_UCAST_MAC_REMOTE 
OVSDB_PHYSICAL_LOCATOR_SET 
OVSDB_MCAST_MAC_LOCAL 
OVSDB_MCAST_MAC_REMOTE 
OVSDB_TYPE_COUNT 

Definition at line 83 of file ovsdb_client_idl.h.

◆ Op

Enumerator
OVSDB_DEL 
OVSDB_ADD 
OVSDB_INVALID_OP 

Definition at line 77 of file ovsdb_client_idl.h.

◆ OvsdbSessionState

Enumerator
OvsdbSessionActive 
OvsdbSessionRcvWait 
OvsdbSessionEchoWait 

Definition at line 68 of file ovsdb_client_idl.h.

Constructor & Destructor Documentation

◆ OvsdbClientIdl()

OvsdbClientIdl::OvsdbClientIdl ( OvsdbClientSession session,
Agent agent,
OvsPeerManager manager 
)

Definition at line 143 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ ~OvsdbClientIdl()

OvsdbClientIdl::~OvsdbClientIdl ( )
virtual

Definition at line 180 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

Member Function Documentation

◆ agent()

Agent* OVSDB::OvsdbClientIdl::agent ( ) const
inline

Definition at line 158 of file ovsdb_client_idl.h.

◆ ConcurrencyCheck()

bool OvsdbClientIdl::ConcurrencyCheck ( ) const

Definition at line 587 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ connection_table()

ConnectionStateTable * OvsdbClientIdl::connection_table ( )

Definition at line 427 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ ConnectOperDB()

void OvsdbClientIdl::ConnectOperDB ( )
private

Definition at line 613 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ CreateBulkTxn()

struct ovsdb_idl_txn * OvsdbClientIdl::CreateBulkTxn ( OvsdbEntryBase entry,
KSyncEntry::KSyncEvent  ack_event = KSyncEntry::ADD_ACK 
)

Definition at line 319 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ CreateTxn()

struct ovsdb_idl_txn * OvsdbClientIdl::CreateTxn ( OvsdbEntryBase entry,
KSyncEntry::KSyncEvent  ack_event = KSyncEntry::ADD_ACK 
)

Definition at line 288 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ deleted()

bool OVSDB::OvsdbClientIdl::deleted ( )
inline

Definition at line 157 of file ovsdb_client_idl.h.

◆ DeleteTxn()

void OvsdbClientIdl::DeleteTxn ( struct ovsdb_idl_txn *  txn)

Definition at line 379 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

OVSDB::OvsdbClientIdl::DISALLOW_COPY_AND_ASSIGN ( OvsdbClientIdl  )
private

◆ EncodeSendTxn()

bool OvsdbClientIdl::EncodeSendTxn ( struct ovsdb_idl_txn *  txn,
OvsdbEntryBase skip_entry 
)

Definition at line 350 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ IsDeleted()

bool OVSDB::OvsdbClientIdl::IsDeleted ( ) const
inline

Definition at line 177 of file ovsdb_client_idl.h.

◆ IsKeepAliveTimerActive()

bool OvsdbClientIdl::IsKeepAliveTimerActive ( )

Definition at line 483 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ IsMonitorInProcess()

bool OvsdbClientIdl::IsMonitorInProcess ( )

Definition at line 487 of file ovsdb_client_idl.cc.

◆ KeepAliveTimerCb()

bool OvsdbClientIdl::KeepAliveTimerCb ( )

Definition at line 491 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ ksync_obj_manager()

KSyncObjectManager * OvsdbClientIdl::ksync_obj_manager ( )

Definition at line 431 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ logical_switch_table()

LogicalSwitchTable * OvsdbClientIdl::logical_switch_table ( )

Definition at line 447 of file ovsdb_client_idl.cc.

◆ MessageProcess() [1/2]

void OVSDB::OvsdbClientIdl::MessageProcess ( const u_int8_t *  buf,
std::size_t  len 
)

◆ MessageProcess() [2/2]

void OvsdbClientIdl::MessageProcess ( struct jsonrpc_msg *  msg)

Definition at line 412 of file ovsdb_client_idl.cc.

◆ multicast_mac_local_ovsdb()

MulticastMacLocalOvsdb * OvsdbClientIdl::multicast_mac_local_ovsdb ( )

Definition at line 467 of file ovsdb_client_idl.cc.

◆ NotifyDelAdd()

void OvsdbClientIdl::NotifyDelAdd ( struct ovsdb_idl_row *  row)

Definition at line 398 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ OnEstablish()

void OvsdbClientIdl::OnEstablish ( )

Definition at line 207 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ pending_send_msg_count()

uint64_t OvsdbClientIdl::pending_send_msg_count ( ) const

Definition at line 583 of file ovsdb_client_idl.cc.

◆ pending_txn_count()

uint64_t OvsdbClientIdl::pending_txn_count ( ) const

Definition at line 579 of file ovsdb_client_idl.cc.

◆ physical_locator_table()

PhysicalLocatorTable * OvsdbClientIdl::physical_locator_table ( )

Definition at line 455 of file ovsdb_client_idl.cc.

◆ physical_port_table()

PhysicalPortTable * OvsdbClientIdl::physical_port_table ( )

Definition at line 451 of file ovsdb_client_idl.cc.

◆ physical_switch_table()

PhysicalSwitchTable * OvsdbClientIdl::physical_switch_table ( )

Definition at line 443 of file ovsdb_client_idl.cc.

◆ ProcessMessage()

bool OvsdbClientIdl::ProcessMessage ( OvsdbMsg msg)

Definition at line 249 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ refcount()

int OVSDB::OvsdbClientIdl::refcount ( ) const
inline

Definition at line 178 of file ovsdb_client_idl.h.

◆ Register()

void OVSDB::OvsdbClientIdl::Register ( EntryType  type,
NotifyCB  cb 
)
inline

Definition at line 140 of file ovsdb_client_idl.h.

◆ remote_ip()

Ip4Address OvsdbClientIdl::remote_ip ( ) const

Definition at line 419 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ remote_port()

uint16_t OvsdbClientIdl::remote_port ( ) const

Definition at line 423 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ route_peer()

OvsPeer * OvsdbClientIdl::route_peer ( )

Definition at line 435 of file ovsdb_client_idl.cc.

◆ stats()

const OvsdbClientIdl::TxnStats & OvsdbClientIdl::stats ( ) const

Definition at line 575 of file ovsdb_client_idl.cc.

◆ TriggerDeletion()

void OvsdbClientIdl::TriggerDeletion ( )

Definition at line 518 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ tsn_ip()

Ip4Address OvsdbClientIdl::tsn_ip ( )

Definition at line 408 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ TxnScheduleJsonRpc()

void OvsdbClientIdl::TxnScheduleJsonRpc ( struct jsonrpc_msg *  msg)

Definition at line 235 of file ovsdb_client_idl.cc.

Here is the call graph for this function:

◆ unicast_mac_local_ovsdb()

UnicastMacLocalOvsdb * OvsdbClientIdl::unicast_mac_local_ovsdb ( )

Definition at line 463 of file ovsdb_client_idl.cc.

◆ UnRegister()

void OVSDB::OvsdbClientIdl::UnRegister ( EntryType  type)
inline

Definition at line 141 of file ovsdb_client_idl.h.

◆ vlan_port_table()

VlanPortBindingTable * OvsdbClientIdl::vlan_port_table ( )

Definition at line 459 of file ovsdb_client_idl.cc.

◆ vm_interface_table()

VMInterfaceKSyncObject * OvsdbClientIdl::vm_interface_table ( )

Definition at line 439 of file ovsdb_client_idl.cc.

◆ vn_ovsdb()

VnOvsdbObject * OvsdbClientIdl::vn_ovsdb ( )

Definition at line 475 of file ovsdb_client_idl.cc.

◆ vrf_ovsdb()

VrfOvsdbObject * OvsdbClientIdl::vrf_ovsdb ( )

Definition at line 471 of file ovsdb_client_idl.cc.

◆ vxlan_table()

OvsdbResourceVxLanIdTable * OvsdbClientIdl::vxlan_table ( )

Definition at line 479 of file ovsdb_client_idl.cc.

Friends And Related Function Documentation

◆ intrusive_ptr_add_ref

void intrusive_ptr_add_ref ( OvsdbClientIdl p)
friend

Definition at line 102 of file ovsdb_client_idl.cc.

◆ intrusive_ptr_release

void intrusive_ptr_release ( OvsdbClientIdl p)
friend

Definition at line 107 of file ovsdb_client_idl.cc.

◆ ovsdb_wrapper_idl_callback

void ovsdb_wrapper_idl_callback ( void *  idl_base,
int  op,
struct ovsdb_idl_row *  row 
)
friend

Definition at line 58 of file ovsdb_client_idl.cc.

◆ ovsdb_wrapper_idl_txn_ack

void ovsdb_wrapper_idl_txn_ack ( void *  idl_base,
struct ovsdb_idl_txn *  txn 
)
friend

Definition at line 68 of file ovsdb_client_idl.cc.

Member Data Documentation

◆ agent_

Agent* OVSDB::OvsdbClientIdl::agent_
private

Definition at line 199 of file ovsdb_client_idl.h.

◆ bulk_entries_

OvsdbEntryList OVSDB::OvsdbClientIdl::bulk_entries_
private

Definition at line 220 of file ovsdb_client_idl.h.

◆ bulk_txn_

struct ovsdb_idl_txn* OVSDB::OvsdbClientIdl::bulk_txn_
private

Definition at line 218 of file ovsdb_client_idl.h.

◆ callback_

NotifyCB OVSDB::OvsdbClientIdl::callback_[OVSDB_TYPE_COUNT]
private

Definition at line 200 of file ovsdb_client_idl.h.

◆ connection_state_

OvsdbSessionState OVSDB::OvsdbClientIdl::connection_state_
private

Definition at line 209 of file ovsdb_client_idl.h.

◆ deleted_

bool OVSDB::OvsdbClientIdl::deleted_
private

Definition at line 203 of file ovsdb_client_idl.h.

◆ idl_

struct ovsdb_idl* OVSDB::OvsdbClientIdl::idl_
private

Definition at line 196 of file ovsdb_client_idl.h.

◆ keepalive_timer_

Timer* OVSDB::OvsdbClientIdl::keepalive_timer_
private

Definition at line 210 of file ovsdb_client_idl.h.

◆ logical_switch_table_

std::unique_ptr<LogicalSwitchTable> OVSDB::OvsdbClientIdl::logical_switch_table_
private

Definition at line 229 of file ovsdb_client_idl.h.

◆ manager_

OvsPeerManager* OVSDB::OvsdbClientIdl::manager_
private

Definition at line 208 of file ovsdb_client_idl.h.

◆ monitor_request_id_

struct json* OVSDB::OvsdbClientIdl::monitor_request_id_
private

Definition at line 215 of file ovsdb_client_idl.h.

◆ multicast_mac_local_ovsdb_

std::unique_ptr<MulticastMacLocalOvsdb> OVSDB::OvsdbClientIdl::multicast_mac_local_ovsdb_
private

Definition at line 234 of file ovsdb_client_idl.h.

◆ OVSDBEntriesInBulkTxn

const std::size_t OVSDB::OvsdbClientIdl::OVSDBEntriesInBulkTxn = 4
static

Definition at line 75 of file ovsdb_client_idl.h.

◆ OVSDBMaxInFlightPendingTxn

const std::size_t OVSDB::OvsdbClientIdl::OVSDBMaxInFlightPendingTxn = 25
static

Definition at line 74 of file ovsdb_client_idl.h.

◆ pending_send_msgs_

ThrottledTxnMsgs OVSDB::OvsdbClientIdl::pending_send_msgs_
private

Definition at line 202 of file ovsdb_client_idl.h.

◆ pending_txn_

PendingTxnMap OVSDB::OvsdbClientIdl::pending_txn_
private

Definition at line 201 of file ovsdb_client_idl.h.

◆ physical_locator_table_

std::unique_ptr<PhysicalLocatorTable> OVSDB::OvsdbClientIdl::physical_locator_table_
private

Definition at line 231 of file ovsdb_client_idl.h.

◆ physical_port_table_

std::unique_ptr<PhysicalPortTable> OVSDB::OvsdbClientIdl::physical_port_table_
private

Definition at line 230 of file ovsdb_client_idl.h.

◆ physical_switch_table_

std::unique_ptr<PhysicalSwitchTable> OVSDB::OvsdbClientIdl::physical_switch_table_
private

Definition at line 228 of file ovsdb_client_idl.h.

◆ receive_queue_

WorkQueue<OvsdbMsg *>* OVSDB::OvsdbClientIdl::receive_queue_
private

Definition at line 207 of file ovsdb_client_idl.h.

◆ refcount_

tbb::atomic<int> OVSDB::OvsdbClientIdl::refcount_
private

Definition at line 225 of file ovsdb_client_idl.h.

◆ route_peer_

std::unique_ptr<OvsPeer> OVSDB::OvsdbClientIdl::route_peer_
private

Definition at line 226 of file ovsdb_client_idl.h.

◆ session_

OvsdbClientSession* OVSDB::OvsdbClientIdl::session_
private

Definition at line 198 of file ovsdb_client_idl.h.

◆ stats_

TxnStats OVSDB::OvsdbClientIdl::stats_
private

Definition at line 223 of file ovsdb_client_idl.h.

◆ unicast_mac_local_ovsdb_

std::unique_ptr<UnicastMacLocalOvsdb> OVSDB::OvsdbClientIdl::unicast_mac_local_ovsdb_
private

Definition at line 233 of file ovsdb_client_idl.h.

◆ vlan_port_table_

std::unique_ptr<VlanPortBindingTable> OVSDB::OvsdbClientIdl::vlan_port_table_
private

Definition at line 232 of file ovsdb_client_idl.h.

◆ vm_interface_table_

std::unique_ptr<VMInterfaceKSyncObject> OVSDB::OvsdbClientIdl::vm_interface_table_
private

Definition at line 227 of file ovsdb_client_idl.h.

◆ vn_ovsdb_

std::unique_ptr<VnOvsdbObject> OVSDB::OvsdbClientIdl::vn_ovsdb_
private

Definition at line 236 of file ovsdb_client_idl.h.

◆ vrf_ovsdb_

std::unique_ptr<VrfOvsdbObject> OVSDB::OvsdbClientIdl::vrf_ovsdb_
private

Definition at line 235 of file ovsdb_client_idl.h.

◆ vtep_global_

const struct vteprec_global* OVSDB::OvsdbClientIdl::vtep_global_
private

Definition at line 197 of file ovsdb_client_idl.h.

◆ vxlan_table_

std::unique_ptr<OvsdbResourceVxLanIdTable> OVSDB::OvsdbClientIdl::vxlan_table_
private

Definition at line 237 of file ovsdb_client_idl.h.


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