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);
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());
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());
bool Add(const std::string &key, const std::string &val)
bool Get(const std::string &key, std::string *val) const
const std::string & name() const
const boost::uuids::uuid & GetUuid() const
std::string StateString() const
KSyncEntry * GetReference(const KSyncEntry *key)
const std::string & phy_intf_display_name() const
VmInterface * vm_interface() const
const std::string & phy_dev_display_name() const
PhysicalPortTable * physical_port_table()
PhysicalSwitchTable * physical_switch_table()
VMInterfaceKSyncObject * vm_interface_table()
LogicalSwitchTable * logical_switch_table()
VlanPortBindingTable * vlan_port_table()
OvsdbClientIdl * client_idl()
OvsdbClientIdl * client_idl()
void DeleteBinding(int16_t vlan, LogicalSwitchEntry *ls)
void AddBinding(int16_t vlan, LogicalSwitchEntry *ls)
const std::string & vn_name() const
void AddMsg(struct ovsdb_idl_txn *)
std::string logical_switch_name_
LogicalSwitchRef logical_switch_
bool IsLess(const KSyncEntry &) const
KSyncEntryPtr physical_port_
const std::string & physical_port_name() const
const std::string & physical_device_name() const
KSyncEntry * UnresolvedReference()
std::string physical_device_name_
std::string physical_port_name_
VlanPortBindingEntry(VlanPortBindingTable *table, const std::string &physical_device, const std::string &physical_port, uint16_t vlan_tag, const std::string &logical_switch)
const std::string & logical_switch_name() const
void ChangeMsg(struct ovsdb_idl_txn *)
std::string old_logical_switch_name_
boost::uuids::uuid vmi_uuid_
void DeleteMsg(struct ovsdb_idl_txn *)
std::string physical_port_
VlanPortBindingSandeshTask(std::string resp_ctx, AgentSandeshArguments &args)
KSyncObject * GetObject(OvsdbClientSession *session)
void UpdateResp(KSyncEntry *kentry, SandeshResponse *resp)
FilterResp Filter(KSyncEntry *entry)
SandeshResponse * Alloc()
void EncodeArgs(AgentSandeshArguments &args)
virtual ~VlanPortBindingSandeshTask()
DBFilterResp OvsdbDBEntryFilter(const DBEntry *entry, const OvsdbDBEntry *ovsdb_entry)
KSyncEntry * DBToKSyncEntry(const DBEntry *)
std::string GetLogicalSwitchName(const DBEntry *entry) const
VlanPortBindingTable(OvsdbClientIdl *idl)
virtual ~VlanPortBindingTable()
KSyncEntry * Alloc(const KSyncEntry *key, uint32_t index)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
void Enqueue(Task *task)
Enqueues a task for running. Starts task if all policy rules are met else puts task in waitq....
static TaskScheduler * GetInstance()
const VnEntry * vn() const
const boost::uuids::uuid & GetUuid() const
#define OVSDB_TRACE(obj,...)
static std::string UuidToString(const boost::uuids::uuid &id)
static const std::string integerToString(const NumberType &num)