23 #include <ovsdb_types.h>
25 using namespace OVSDB;
28 const std::string &physical_device,
const std::string &physical_port,
29 uint16_t vlan_tag,
const std::string &logical_switch) :
30 OvsdbDBEntry(table), logical_switch_name_(logical_switch),
31 physical_port_name_(physical_port), physical_device_name_(physical_device),
32 vlan_(vlan_tag), vmi_uuid_(
boost::uuids::nil_uuid()),
33 old_logical_switch_name_(), logical_switch_(NULL, this) {
38 logical_switch_name_(), physical_port_name_(entry->phy_intf_display_name()),
39 physical_device_name_(entry->phy_dev_display_name()), vlan_(entry->vlan()),
40 vmi_uuid_(
boost::uuids::nil_uuid()), old_logical_switch_name_(),
41 logical_switch_(NULL, this) {
46 logical_switch_name_(key->logical_switch_name_),
47 physical_port_name_(key->physical_port_name_),
48 physical_device_name_(key->physical_device_name_), vlan_(key->vlan_),
49 vmi_uuid_(
boost::uuids::nil_uuid()), old_logical_switch_name_(),
50 logical_switch_(NULL, this) {
129 std::string ls_name =
131 GetLogicalSwitchName(entry);
275 if (l_port == NULL) {
283 if (ovsdb_entry != NULL) {
285 "Port " + l_port->
name());
288 "Port " + l_port->
name());
297 "name unavailablity Logical port = " + l_port->
name());
303 "unavailablity Logical port = " + l_port->
name());
330 std::string resp_ctx,
const std::string &ip, uint32_t port,
331 const std::string &physical_port) :
361 OvsdbVlanPortBindingEntry oentry;
366 oentry.set_vlan(entry->
vlan());
367 OvsdbVlanPortBindingResp *v_resp =
368 static_cast<OvsdbVlanPortBindingResp *
>(resp);
369 std::vector<OvsdbVlanPortBindingEntry> &bindings =
370 const_cast<std::vector<OvsdbVlanPortBindingEntry>&
>(
371 v_resp->get_bindings());
372 bindings.push_back(oentry);
385 void OvsdbVlanPortBindingReq::HandleRequest()
const {
388 get_session_remote_port(),
389 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)