21 #include <ovsdb_types.h>
27 using namespace OVSDB;
32 logical_switch_name_(key->logical_switch_name_), vrf_(NULL, this),
33 vxlan_id_(key->vxlan_id_), row_list_(key->row_list_) {
37 const std::string &logical_switch_name)
38 :
OvsdbEntry(table), logical_switch_name_(logical_switch_name),
39 vrf_(NULL, this), vxlan_id_(0), row_list_() {
43 const std::string &logical_switch_name,
struct ovsdb_idl_row *row)
44 :
OvsdbEntry(table), logical_switch_name_(logical_switch_name),
45 vrf_(NULL, this), vxlan_id_(0), row_list_() {
61 if ((vn_entry == NULL) || (vn_entry->
vrf() == NULL)) {
89 OvsdbIdlRowList::iterator it =
row_list_.begin();
106 TorIpList::iterator it_ip = old_tor_ip_list.begin();
107 for (; it_ip != old_tor_ip_list.end(); it_ip++) {
112 old_tor_ip_list.clear();
119 struct ovsdb_idl_row *l_set =
123 for (std::size_t i = 0; i != count; i++) {
124 struct ovsdb_idl_row *locator =
126 std::string tor_ip_str =
128 boost::system::error_code ec;
129 Ip4Address tor_ip = Ip4Address::from_string(tor_ip_str, ec);
130 if (tor_ip.to_ulong() == 0) {
137 old_tor_ip_list.erase(tor_ip);
147 TorIpList::iterator it_ip = old_tor_ip_list.begin();
148 for (; it_ip != old_tor_ip_list.end(); it_ip++) {
226 VrfDepList::iterator it =
229 if (it->first != vrf_ref.get()) {
240 struct ovsdb_idl_row *row) {
247 if (ls_name == NULL) {
251 std::string ls_name_str(ls_name);
255 struct ovsdb_idl_row *l_set =
289 struct ovsdb_idl_row *row) {
319 std::string resp_ctx,
const std::string &ip, uint32_t port,
320 const std::string &ls) :
350 OvsdbMulticastMacLocalEntry oentry;
352 oentry.set_mac(
"ff:ff:ff:ff:ff:ff");
354 oentry.set_vxlan_id(entry->
vxlan_id());
355 std::vector<std::string> &tor_ip =
356 const_cast<std::vector<std::string>&
>(oentry.get_tor_ip());
357 MulticastMacLocalEntry::TorIpList::const_iterator it =
360 tor_ip.push_back((*it).to_string());
362 OvsdbMulticastMacLocalResp *m_resp =
363 static_cast<OvsdbMulticastMacLocalResp *
>(resp);
364 std::vector<OvsdbMulticastMacLocalEntry> &macs =
365 const_cast<std::vector<OvsdbMulticastMacLocalEntry>&
>(
367 macs.push_back(oentry);
371 return static_cast<SandeshResponse *
>(
new OvsdbMulticastMacLocalResp());
380 void OvsdbMulticastMacLocalReq::HandleRequest()
const {
383 get_session_remote_port(),
384 get_logical_switch());
#define OVSDB_TRACE(obj,...)
void Change(KSyncEntry *entry)
char * ovsdb_wrapper_mcast_mac_local_logical_switch(struct ovsdb_idl_row *row)
std::string logical_switch_name_
static boost::uuids::uuid StringToUuid(const std::string &str)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
const TorIpList & tor_ip_list() const
KSyncEntry * UnresolvedReference()
MulticastMacLocalEntry(MulticastMacLocalOvsdb *table, const MulticastMacLocalEntry *key)
MulticastMacLocalSandeshTask(std::string resp_ctx, AgentSandeshArguments &args)
char * ovsdb_wrapper_physical_locator_dst_ip(struct ovsdb_idl_row *row)
void EncodeArgs(AgentSandeshArguments &args)
void UpdateResp(KSyncEntry *kentry, SandeshResponse *resp)
SandeshResponse * Alloc()
std::string StateString() const
const std::string & logical_switch_name() const
struct ovsdb_idl_row * ovsdb_wrapper_mcast_mac_local_physical_locator_set(struct ovsdb_idl_row *row)
bool VrfReEval(VrfEntryRef vrf)
void Delete(KSyncEntry *entry)
std::set< Ip4Address > TorIpList
bool IsLess(const KSyncEntry &) const
void Notify(OvsdbClientIdl::Op op, struct ovsdb_idl_row *row)
void Register(EntryType type, NotifyCB cb)
MulticastMacLocalOvsdb * multicast_mac_local_ovsdb()
WorkQueue< VrfEntryRef > * vrf_reeval_queue_
OVSDB::VnOvsdbEntry * GetVnEntry() const
int GetTaskId(const std::string &name)
KSyncEntry * FindActiveEntry(KSyncEntry *key)
void VrfReEvalEnqueue(VrfEntry *vrf)
VnOvsdbObject * vn_ovsdb()
const uint32_t vxlan_id() const
TaskScheduler * task_scheduler() const
bool Get(const std::string &key, std::string *val) const
void SafeNotifyEvent(KSyncEntry *entry, KSyncEntry::KSyncEvent event)
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...
OvsdbIdlDepList locator_dep_list_
struct ovsdb_idl_row ** ovsdb_wrapper_physical_locator_set_locators(struct ovsdb_idl_row *row)
OvsdbClientIdl * client_idl()
void EvaluateVrfDependency(VrfEntry *vrf)
bool Add(const std::string &key, const std::string &val)
KSyncEntry * GetReference(const KSyncEntry *key)
void OvsdbMcastLocalMacNotify(OvsdbClientIdl::Op, struct ovsdb_idl_row *)
boost::asio::ip::address_v4 Ip4Address
OvsdbIdlRowList row_list_
std::pair< VrfEntry *, MulticastMacLocalEntry * > VrfDepEntry
KSyncEntry * Create(const KSyncEntry *key)
KSyncObject * GetObject(OvsdbClientSession *session)
void AddOvsPeerMulticastRoute(const VrfEntry *vrf, uint32_t vxlan_id, const std::string &vn_name_, const Ip4Address &tsn_ip, const Ip4Address &tor_ip)
~MulticastMacLocalOvsdb()
FilterResp Filter(KSyncEntry *entry)
KSyncEntry * Alloc(const KSyncEntry *key, uint32_t index)
OvsdbClientIdlPtr client_idl_
const std::string & name()
friend class MulticastMacLocalEntry
virtual ~MulticastMacLocalSandeshTask()
void DeleteOvsPeerMulticastRoute(const VrfEntry *vrf, uint32_t vxlan_id, const Ip4Address &tor_ip)
size_t ovsdb_wrapper_physical_locator_set_locator_count(struct ovsdb_idl_row *row)
MulticastMacLocalOvsdb(OvsdbClientIdl *idl, OvsPeer *peer)
void LocatorSetNotify(OvsdbClientIdl::Op op, struct ovsdb_idl_row *row)
OvsdbClientIdl * client_idl()