22 #include <ovsdb_types.h>
28 using namespace OVSDB;
33 logical_switch_name_(key->logical_switch_name_), vrf_(NULL, this),
34 vxlan_id_(key->vxlan_id_), row_list_(key->row_list_) {
38 const std::string &logical_switch_name)
39 :
OvsdbEntry(table), logical_switch_name_(logical_switch_name),
40 vrf_(NULL, this), vxlan_id_(0), row_list_() {
44 const std::string &logical_switch_name,
struct ovsdb_idl_row *row)
45 :
OvsdbEntry(table), logical_switch_name_(logical_switch_name),
46 vrf_(NULL, this), vxlan_id_(0), row_list_() {
62 if ((vn_entry == NULL) || (vn_entry->
vrf() == NULL)) {
90 OvsdbIdlRowList::iterator it =
row_list_.begin();
107 TorIpList::iterator it_ip = old_tor_ip_list.begin();
108 for (; it_ip != old_tor_ip_list.end(); it_ip++) {
113 old_tor_ip_list.clear();
120 struct ovsdb_idl_row *l_set =
124 for (std::size_t i = 0; i != count; i++) {
125 struct ovsdb_idl_row *locator =
127 std::string tor_ip_str =
129 boost::system::error_code ec;
130 Ip4Address tor_ip = Ip4Address::from_string(tor_ip_str, ec);
131 if (tor_ip.to_ulong() == 0) {
138 old_tor_ip_list.erase(tor_ip);
148 TorIpList::iterator it_ip = old_tor_ip_list.begin();
149 for (; it_ip != old_tor_ip_list.end(); it_ip++) {
227 VrfDepList::iterator it =
230 if (it->first != vrf_ref.get()) {
241 struct ovsdb_idl_row *row) {
248 if (ls_name == NULL) {
252 std::string ls_name_str(ls_name);
256 struct ovsdb_idl_row *l_set =
290 struct ovsdb_idl_row *row) {
320 std::string resp_ctx,
const std::string &ip, uint32_t port,
321 const std::string &ls) :
351 OvsdbMulticastMacLocalEntry oentry;
353 oentry.set_mac(
"ff:ff:ff:ff:ff:ff");
355 oentry.set_vxlan_id(entry->
vxlan_id());
356 std::vector<std::string> &tor_ip =
357 const_cast<std::vector<std::string>&
>(oentry.get_tor_ip());
358 MulticastMacLocalEntry::TorIpList::const_iterator it =
361 tor_ip.push_back((*it).to_string());
363 OvsdbMulticastMacLocalResp *m_resp =
364 static_cast<OvsdbMulticastMacLocalResp *
>(resp);
365 std::vector<OvsdbMulticastMacLocalEntry> &macs =
366 const_cast<std::vector<OvsdbMulticastMacLocalEntry>&
>(
368 macs.push_back(oentry);
372 return static_cast<SandeshResponse *
>(
new OvsdbMulticastMacLocalResp());
381 void OvsdbMulticastMacLocalReq::HandleRequest()
const {
384 get_session_remote_port(),
385 get_logical_switch());
boost::asio::ip::address_v4 Ip4Address
bool Add(const std::string &key, const std::string &val)
bool Get(const std::string &key, std::string *val) const
TaskScheduler * task_scheduler() const
std::string StateString() const
void Change(KSyncEntry *entry)
void SafeNotifyEvent(KSyncEntry *entry, KSyncEntry::KSyncEvent event)
KSyncEntry * GetReference(const KSyncEntry *key)
KSyncEntry * Create(const KSyncEntry *key)
void Delete(KSyncEntry *entry)
void OvsdbMcastLocalMacNotify(OvsdbClientIdl::Op, struct ovsdb_idl_row *)
OvsdbIdlRowList row_list_
KSyncEntry * UnresolvedReference()
std::string logical_switch_name_
OVSDB::VnOvsdbEntry * GetVnEntry() const
std::set< Ip4Address > TorIpList
bool IsLess(const KSyncEntry &) const
void EvaluateVrfDependency(VrfEntry *vrf)
const std::string & logical_switch_name() const
const uint32_t vxlan_id() const
MulticastMacLocalEntry(MulticastMacLocalOvsdb *table, const MulticastMacLocalEntry *key)
const TorIpList & tor_ip_list() const
void LocatorSetNotify(OvsdbClientIdl::Op op, struct ovsdb_idl_row *row)
void VrfReEvalEnqueue(VrfEntry *vrf)
MulticastMacLocalOvsdb(OvsdbClientIdl *idl, OvsPeer *peer)
std::pair< VrfEntry *, MulticastMacLocalEntry * > VrfDepEntry
friend class MulticastMacLocalEntry
bool VrfReEval(VrfEntryRef vrf)
void Notify(OvsdbClientIdl::Op op, struct ovsdb_idl_row *row)
KSyncEntry * Alloc(const KSyncEntry *key, uint32_t index)
OvsdbIdlDepList locator_dep_list_
WorkQueue< VrfEntryRef > * vrf_reeval_queue_
~MulticastMacLocalOvsdb()
void UpdateResp(KSyncEntry *kentry, SandeshResponse *resp)
virtual ~MulticastMacLocalSandeshTask()
void EncodeArgs(AgentSandeshArguments &args)
KSyncObject * GetObject(OvsdbClientSession *session)
MulticastMacLocalSandeshTask(std::string resp_ctx, AgentSandeshArguments &args)
FilterResp Filter(KSyncEntry *entry)
SandeshResponse * Alloc()
@ OVSDB_PHYSICAL_LOCATOR_SET
MulticastMacLocalOvsdb * multicast_mac_local_ovsdb()
VnOvsdbObject * vn_ovsdb()
void Register(EntryType type, NotifyCB cb)
OvsdbClientIdl * client_idl()
OvsdbClientIdlPtr client_idl_
OvsdbClientIdl * client_idl()
KSyncEntry * FindActiveEntry(KSyncEntry *key)
const std::string & name()
void DeleteOvsPeerMulticastRoute(const VrfEntry *vrf, uint32_t vxlan_id, const Ip4Address &tor_ip)
void AddOvsPeerMulticastRoute(const VrfEntry *vrf, uint32_t vxlan_id, const std::string &vn_name_, const Ip4Address &tsn_ip, const Ip4Address &tor_ip)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
int GetTaskId(const std::string &name)
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()
#define OVSDB_TRACE(obj,...)
char * ovsdb_wrapper_mcast_mac_local_logical_switch(struct ovsdb_idl_row *row)
size_t ovsdb_wrapper_physical_locator_set_locator_count(struct ovsdb_idl_row *row)
struct ovsdb_idl_row ** ovsdb_wrapper_physical_locator_set_locators(struct ovsdb_idl_row *row)
struct ovsdb_idl_row * ovsdb_wrapper_mcast_mac_local_physical_locator_set(struct ovsdb_idl_row *row)
char * ovsdb_wrapper_physical_locator_dst_ip(struct ovsdb_idl_row *row)
static boost::uuids::uuid StringToUuid(const std::string &str)