14 #include <ovsdb_types.h>
59 struct ovsdb_idl_row *row) {
79 assert(!entry_list.empty());
86 OvsdbEntryList::iterator it;
87 for (it = entry_list.begin(); it != entry_list.end(); ++it) {
115 "Triggered Session Cleanup on Close");
145 session_(session), agent_(agent), pending_txn_(), deleted_(false),
146 manager_(manager), connection_state_(OvsdbSessionRcvWait),
148 *(agent->event_manager())->io_service(),
149 "OVSDB Client Keep Alive Timer",
150 agent->task_scheduler()->GetTaskId(
"Agent::KSync"), 0)),
151 monitor_request_id_(NULL), bulk_txn_(NULL), stats_() {
197 if (this->msg != NULL) {
210 "IDL deleted skipping Monitor Request");
214 struct jsonrpc_msg *monitor_request =
225 if (keepalive_intv == 0) {
254 if (msg->
msg != NULL &&
257 bool connect_oper_db =
false;
263 connect_oper_db =
true;
271 if (connect_oper_db) {
303 struct ovsdb_idl_txn *bulk_txn =
bulk_txn_;
311 entry_list.insert(entry);
332 struct ovsdb_idl_txn *bulk_txn =
bulk_txn_;
335 assert(entry != NULL);
363 OvsdbEntryList::iterator it;
364 for (it = entry_list.begin(); it != entry_list.end(); ++it) {
366 if (entry != skip_entry) {
388 struct ovsdb_idl_txn *bulk_txn =
bulk_txn_;
510 "KeepAlive failed, Closing Session");
538 OvsdbEntryList::iterator entry_it;
539 for (entry_it = entry_list.begin(); entry_it != entry_list.end();
589 static int ksync_task_id = -1;
590 static int db_task_id = -1;
592 if (ksync_task_id == -1)
595 if (db_task_id == -1)
598 if (current == NULL) {
602 if (current->
GetTaskId() == ksync_task_id) {
606 if (current->
GetTaskId() == db_task_id) {
615 "Received Monitor Response connecting to OperDb");
std::unique_ptr< VlanPortBindingTable > vlan_port_table_
void NotifyDelAdd(struct ovsdb_idl_row *row)
int ovsdb_wrapper_row_type(struct ovsdb_idl_row *row)
void intrusive_ptr_release(ConnectionStateEntry *p)
virtual Ip4Address tsn_ip()=0
bool IsMonitorInProcess()
#define OVSDB_TRACE(obj,...)
virtual void OnCleanup()=0
std::unique_ptr< PhysicalLocatorTable > physical_locator_table_
bool ConcurrencyCheck() const
virtual void TxnDoneNoMessage()
virtual bool ThrottleInFlightTxnMessages()
std::set< OvsdbEntryBase * > OvsdbEntryList
static Task * Running()
Returns a pointer to the current task the code is executing under.
struct ovsdb_idl_txn * CreateBulkTxn(OvsdbEntryBase *entry, KSyncEntry::KSyncEvent ack_event=KSyncEntry::ADD_ACK)
OvsdbSessionState connection_state_
friend void ovsdb_wrapper_idl_txn_ack(void *, struct ovsdb_idl_txn *)
const char * ovsdb_wrapper_txn_get_error(struct ovsdb_idl_txn *txn)
std::unique_ptr< PhysicalSwitchTable > physical_switch_table_
void intrusive_ptr_add_ref(ConnectionStateEntry *p)
KSyncObjectManager * ksync_obj_manager()
struct jsonrpc_msg * ovsdb_wrapper_jsonrpc_create_echo_request()
OvsdbEntryList bulk_entries_
struct ovsdb_idl_txn * bulk_txn_
std::unique_ptr< VMInterfaceKSyncObject > vm_interface_table_
OvsPeer * Allocate(const IpAddress &peer_ip)
bool ProcessMessage(OvsdbMsg *msg)
ConnectionStateTable * connection_table()
PendingTxnMap pending_txn_
InterfaceTable * interface_table() const
VnTable * vn_table() const
static const std::size_t OVSDBEntriesInBulkTxn
void ovsdb_wrapper_idl_txn_ack(void *idl_base, struct ovsdb_idl_txn *txn)
bool IsKeepAliveTimerActive()
void SendJsonRpc(struct jsonrpc_msg *msg)
PhysicalLocatorTable * physical_locator_table()
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
friend void ovsdb_wrapper_idl_callback(void *, int, struct ovsdb_idl_row *)
VMInterfaceKSyncObject * vm_interface_table()
virtual uint16_t remote_port() const =0
MulticastMacLocalOvsdb * multicast_mac_local_ovsdb()
static void Unregister(KSyncObject *)
Ip4Address remote_ip() const
virtual Ip4Address remote_ip() const =0
uint16_t remote_port() const
struct json * ovsdb_wrapper_jsonrpc_clone_id(struct jsonrpc_msg *msg)
int GetTaskId(const std::string &name)
bool ovsdb_wrapper_msg_echo_req(struct jsonrpc_msg *msg)
std::unique_ptr< UnicastMacLocalOvsdb > unicast_mac_local_ovsdb_
ThrottledTxnMsgs pending_send_msgs_
std::unique_ptr< VrfOvsdbObject > vrf_ovsdb_
virtual void TriggerClose()=0
VnOvsdbObject * vn_ovsdb()
void DeleteTxn(struct ovsdb_idl_txn *txn)
TaskScheduler * task_scheduler() const
void ovsdb_wrapper_idl_msg_process(struct ovsdb_idl *, struct jsonrpc_msg *msg)
OvsdbMsg(struct jsonrpc_msg *m)
void MessageProcess(const u_int8_t *buf, std::size_t len)
struct ovsdb_idl * ovsdb_wrapper_idl_create()
SandeshTraceBufferPtr OvsdbSMTraceBuf
#define OVSDB_SM_TRACE(obj,...)
OvsdbResourceVxLanIdTable * vxlan_table()
uint64_t pending_send_msg_count() const
PhysicalDeviceVnTable * physical_device_vn_table() const
void ovsdb_wrapper_jsonrpc_msg_destroy(struct jsonrpc_msg *msg)
struct jsonrpc_msg * ovsdb_wrapper_idl_encode_monitor_request(struct ovsdb_idl *)
WorkQueue< OvsdbMsg * > * receive_queue_
OvsPeerManager * manager_
OvsdbClientSession * session_
#define OVSDB_SESSION_TRACE(obj, session,...)
void ovsdb_wrapper_idl_txn_destroy(struct ovsdb_idl_txn *txn)
boost::asio::ip::address_v4 Ip4Address
VrfOvsdbObject * vrf_ovsdb()
LogicalSwitchTable * logical_switch_table()
VrfTable * vrf_table() const
std::unique_ptr< OvsdbResourceVxLanIdTable > vxlan_table_
std::unique_ptr< OvsPeer > route_peer_
std::unique_ptr< LogicalSwitchTable > logical_switch_table_
virtual int keepalive_interval()=0
void ovsdb_wrapper_idl_destroy(struct ovsdb_idl *idl)
void ovsdb_wrapper_json_destroy(struct json *)
struct json * monitor_request_id_
PhysicalPortTable * physical_port_table()
bool ovsdb_wrapper_idl_msg_is_monitor_response(struct json *, struct jsonrpc_msg *)
NotifyCB callback_[OVSDB_TYPE_COUNT]
struct jsonrpc_msg * ovsdb_wrapper_idl_txn_encode(struct ovsdb_idl_txn *txn)
uint64_t pending_txn_count() const
virtual void Ack(bool success)=0
bool Start(int time, Handler handler, ErrorHandler error_handler=NULL)
struct vteprec_global * vtep_global_
virtual KSyncObjectManager * ksync_obj_manager()=0
struct ovsdb_idl_txn * ovsdb_wrapper_idl_txn_create(struct ovsdb_idl *idl)
std::unique_ptr< VnOvsdbObject > vn_ovsdb_
void TxnScheduleJsonRpc(struct jsonrpc_msg *msg)
SandeshTraceBufferPtr OvsdbPktTraceBuf
VlanPortBindingTable * vlan_port_table()
UnicastMacLocalOvsdb * unicast_mac_local_ovsdb()
std::unique_ptr< MulticastMacLocalOvsdb > multicast_mac_local_ovsdb_
bool ovsdb_wrapper_msg_echo_reply(struct jsonrpc_msg *msg)
void ovsdb_wrapper_idl_callback(void *idl_base, int op, struct ovsdb_idl_row *row)
static const std::size_t OVSDBMaxInFlightPendingTxn
void ovsdb_wrapper_idl_set_callback(struct ovsdb_idl *idl, void *idl_base, void(*cb)(void *, int, struct ovsdb_idl_row *), void(*ack_cb)(void *, struct ovsdb_idl_txn *))
struct ovsdb_idl_txn * CreateTxn(OvsdbEntryBase *entry, KSyncEntry::KSyncEvent ack_event=KSyncEntry::ADD_ACK)
const TxnStats & stats() const
virtual bool TestConcurrencyAllow()
bool EncodeSendTxn(struct ovsdb_idl_txn *txn, OvsdbEntryBase *skip_entry)
Task is a wrapper over tbb::task to support policies.
struct vteprec_global * ovsdb_wrapper_vteprec_global_first(struct ovsdb_idl *)
virtual ~OvsdbClientIdl()
bool ovsdb_wrapper_is_txn_success(struct ovsdb_idl_txn *txn)
virtual ConnectionStateTable * connection_table()=0
tbb::atomic< int > refcount_
SandeshTraceBufferPtr SandeshTraceBufferCreate(const std::string &buf_name, size_t buf_size, bool trace_enable=true)
static bool DeleteTimer(Timer *Timer)
SandeshTraceBufferPtr OvsdbTraceBuf
PhysicalSwitchTable * physical_switch_table()
KSyncEntry::KSyncEvent ack_event_
std::unique_ptr< PhysicalPortTable > physical_port_table_