22 #include <ovsdb_types.h>
24 using namespace OVSDB;
27 const std::string &physical_device,
const std::string &physical_port,
28 uint16_t vlan_tag,
const std::string &logical_switch) :
29 OvsdbDBEntry(table), logical_switch_name_(logical_switch),
30 physical_port_name_(physical_port), physical_device_name_(physical_device),
31 vlan_(vlan_tag), vmi_uuid_(boost::uuids::nil_uuid()),
32 old_logical_switch_name_(), logical_switch_(NULL, this) {
37 logical_switch_name_(), physical_port_name_(entry->phy_intf_display_name()),
38 physical_device_name_(entry->phy_dev_display_name()), vlan_(entry->vlan()),
39 vmi_uuid_(boost::uuids::nil_uuid()), old_logical_switch_name_(),
40 logical_switch_(NULL, this) {
45 logical_switch_name_(key->logical_switch_name_),
46 physical_port_name_(key->physical_port_name_),
47 physical_device_name_(key->physical_device_name_), vlan_(key->vlan_),
48 vmi_uuid_(boost::uuids::nil_uuid()), old_logical_switch_name_(),
49 logical_switch_(NULL, this) {
128 std::string ls_name =
130 GetLogicalSwitchName(entry);
166 if (!p_switch->IsResolved()) {
209 if (!ls_entry->IsResolved()) {
274 if (l_port == NULL) {
282 if (ovsdb_entry != NULL) {
284 "Port " + l_port->
name());
287 "Port " + l_port->
name());
296 "name unavailablity Logical port = " + l_port->
name());
302 "unavailablity Logical port = " + l_port->
name());
309 (dynamic_cast<const VlanPortBindingEntry*>(ovsdb_entry))->
329 std::string resp_ctx,
const std::string &ip, uint32_t port,
330 const std::string &physical_port) :
360 OvsdbVlanPortBindingEntry oentry;
365 oentry.set_vlan(entry->
vlan());
366 OvsdbVlanPortBindingResp *v_resp =
367 static_cast<OvsdbVlanPortBindingResp *
>(resp);
368 std::vector<OvsdbVlanPortBindingEntry> &bindings =
369 const_cast<std::vector<OvsdbVlanPortBindingEntry>&
>(
370 v_resp->get_bindings());
371 bindings.push_back(oentry);
384 void OvsdbVlanPortBindingReq::HandleRequest()
const {
387 get_session_remote_port(),
388 get_physical_port());
virtual ~VlanPortBindingSandeshTask()
#define OVSDB_TRACE(obj,...)
OvsdbClientIdl * client_idl()
std::string physical_port_
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
std::string physical_device_name_
const std::string & logical_switch_name() const
VlanPortBindingTable(OvsdbClientIdl *idl)
const boost::uuids::uuid & GetUuid() const
virtual ~VlanPortBindingTable()
void AddMsg(struct ovsdb_idl_txn *)
std::string StateString() const
DBFilterResp OvsdbDBEntryFilter(const DBEntry *entry, const OvsdbDBEntry *ovsdb_entry)
std::string old_logical_switch_name_
SandeshResponse * Alloc()
static std::string UuidToString(const boost::uuids::uuid &id)
VMInterfaceKSyncObject * vm_interface_table()
const std::string & vn_name() const
KSyncEntry * Alloc(const KSyncEntry *key, uint32_t index)
std::string GetLogicalSwitchName(const DBEntry *entry) const
VlanPortBindingSandeshTask(std::string resp_ctx, AgentSandeshArguments &args)
KSyncEntry * UnresolvedReference()
const std::string & physical_port_name() const
static const std::string integerToString(const NumberType &num)
bool Get(const std::string &key, std::string *val) const
std::string physical_port_name_
static TaskScheduler * GetInstance()
void Enqueue(Task *task)
Enqueues a task for running. Starts task if all policy rules are met else puts task in waitq...
boost::uuids::uuid vmi_uuid_
std::string logical_switch_name_
LogicalSwitchRef logical_switch_
OvsdbClientIdl * client_idl()
const VnEntry * vn() const
FilterResp Filter(KSyncEntry *entry)
bool Add(const std::string &key, const std::string &val)
void UpdateResp(KSyncEntry *kentry, SandeshResponse *resp)
VlanPortBindingEntry(VlanPortBindingTable *table, const std::string &physical_device, const std::string &physical_port, uint16_t vlan_tag, const std::string &logical_switch)
KSyncEntry * GetReference(const KSyncEntry *key)
LogicalSwitchTable * logical_switch_table()
void AddBinding(int16_t vlan, LogicalSwitchEntry *ls)
const std::string & phy_intf_display_name() const
KSyncEntryPtr physical_port_
void DeleteMsg(struct ovsdb_idl_txn *)
PhysicalPortTable * physical_port_table()
const std::string & phy_dev_display_name() const
void DeleteBinding(int16_t vlan, LogicalSwitchEntry *ls)
VmInterface * vm_interface() const
KSyncObject * GetObject(OvsdbClientSession *session)
void ChangeMsg(struct ovsdb_idl_txn *)
VlanPortBindingTable * vlan_port_table()
KSyncEntry * DBToKSyncEntry(const DBEntry *)
const std::string & name() const
bool IsLess(const KSyncEntry &) const
const boost::uuids::uuid & GetUuid() const
void EncodeArgs(AgentSandeshArguments &args)
const std::string & physical_device_name() const
PhysicalSwitchTable * physical_switch_table()