24 #include <ovsdb_types.h>
26 using namespace OVSDB;
30 logical_switch_name_(table->logical_switch_name()),
31 self_exported_route_(false), sequence_(0), self_sequence_(0),
32 ecmp_suppressed_(false), logical_switch_(NULL, this) {
37 mac_(entry->prefix_address().
ToString()),
38 logical_switch_name_(table->logical_switch_name()),
39 self_exported_route_(false), sequence_(0), self_sequence_(0),
40 ecmp_suppressed_(false), logical_switch_(NULL, this) {
45 mac_(entry->mac_), logical_switch_name_(entry->logical_switch_name_),
46 dest_ip_(entry->dest_ip_), self_exported_route_(false), sequence_(0),
47 self_sequence_(0), ecmp_suppressed_(false), logical_switch_(NULL, this) {
51 struct ovsdb_idl_row *entry) :
OvsdbDBEntry(table, entry),
53 logical_switch_name_(table->logical_switch_name()), dest_ip_(),
54 self_exported_route_(false), sequence_(0), self_sequence_(0),
55 ecmp_suppressed_(false), logical_switch_(NULL, this) {
87 boost::system::error_code ec;
145 struct ovsdb_idl_row *pl_row = NULL;
190 tunnel =
static_cast<const TunnelNH *
>(nh);
210 if (evpn_rt != NULL) {
213 if (ovs_path != NULL) {
217 if (tunnel != NULL &&
326 SandeshUnicastMacRemoteInfo info;
329 info.set_op(
"Add Requested");
332 info.set_op(
"Delete Requested");
335 info.set_op(
"Add Received");
338 info.set_op(
"Delete Received");
341 info.set_op(
"unknown");
352 OvsdbDupIdlList::iterator it =
dup_list_.begin();
370 const std::string &logical_switch_name,
VrfOvsdbEntry *vrf) :
371 OvsdbDBObject(idl, true), logical_switch_name_(logical_switch_name),
372 table_delete_ref_(this, NULL), vrf_(vrf) {
455 if (args.
Get(
"mac", &
mac_) ==
false) {
461 std::string resp_ctx,
const std::string &ip, uint32_t port,
462 const std::string &ls,
const std::string &mac) :
481 if (entry->
mac().find(
mac_) != std::string::npos) {
492 OvsdbUnicastMacRemoteEntry oentry;
494 oentry.set_mac(entry->
mac());
496 oentry.set_dest_ip(entry->
dest_ip());
498 oentry.set_sequence(entry->
sequence());
501 OvsdbUnicastMacRemoteResp *u_resp =
502 static_cast<OvsdbUnicastMacRemoteResp *
>(resp);
503 std::vector<OvsdbUnicastMacRemoteEntry> &macs =
504 const_cast<std::vector<OvsdbUnicastMacRemoteEntry>&
>(
506 macs.push_back(oentry);
510 return static_cast<SandeshResponse *
>(
new OvsdbUnicastMacRemoteResp());
520 (vrf_entry != NULL) ? vrf_entry->
route_table() : NULL);
523 void OvsdbUnicastMacRemoteReq::HandleRequest()
const {
526 get_session_remote_port(),
527 get_logical_switch(), get_mac());
boost::asio::ip::address_v4 Ip4Address
bool ecmp_suppressed() const
uint32_t sequence() const
NextHop * nexthop() const
virtual const PrefixType & prefix_address() const
Returns the value of a stored prefix address (IPv4, IPv6 or MAC address)
Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge,...
LifetimeActor * deleter()
const AgentPath * GetActivePath() const
const NextHop * GetActiveNextHop() const
bool is_multicast() const
virtual AgentPath * FindPath(const Peer *peer) const
bool Add(const std::string &key, const std::string &val)
bool Get(const std::string &key, std::string *val) const
virtual uint32_t GetActiveLabel() const
EvpnRouteEntry * FindRoute(const MacAddress &mac, const IpAddress &ip_addr, uint32_t plen, uint32_t ethernet_tag)
std::string StateString() const
static void Unregister(KSyncObject *)
KSyncEntry * Find(const KSyncEntry *key)
void Change(KSyncEntry *entry)
void SafeNotifyEvent(KSyncEntry *entry, KSyncEntry::KSyncEvent event)
KSyncEntry * CreateStale(const KSyncEntry *key)
KSyncEntry * GetReference(const KSyncEntry *key)
Ip4Address & physical_switch_tunnel_ip()
VrfOvsdbObject * vrf_ovsdb()
LogicalSwitchTable * logical_switch_table()
PhysicalLocatorTable * physical_locator_table()
OvsdbClientIdl * client_idl()
struct ovsdb_idl_row * ovs_entry_
virtual void Ack(bool success)
struct ovsdb_idl_row * ovs_entry()
virtual void NotifyAdd(struct ovsdb_idl_row *)
virtual void NotifyDelete(struct ovsdb_idl_row *)
OvsdbClientIdl * client_idl()
virtual void OvsdbRegisterDBTable(DBTable *tbl)
virtual void EmptyTable(void)
struct ovsdb_idl_row * ovs_entry()
bool AcquireCreateRequest(KSyncEntry *creator)
void ReleaseCreateRequest(KSyncEntry *creator)
const std::string & logical_switch_name() const
void AddMsg(struct ovsdb_idl_txn *)
UnicastMacRemoteEntry(UnicastMacRemoteTable *table, const std::string mac)
void ReleaseLocatorCreateReference()
void SendTrace(Trace event) const
bool self_exported_route_
OvsdbDupIdlList dup_list_
void DeleteDupEntries(struct ovsdb_idl_txn *)
void ChangeMsg(struct ovsdb_idl_txn *)
bool IsLess(const KSyncEntry &) const
bool ecmp_suppressed() const
virtual void NotifyAdd(struct ovsdb_idl_row *)
virtual void NotifyDelete(struct ovsdb_idl_row *)
std::string logical_switch_name_
uint32_t sequence() const
const std::string & mac() const
LogicalSwitchRef logical_switch_
KSyncEntry * UnresolvedReference()
void DeleteMsg(struct ovsdb_idl_txn *)
bool self_exported_route() const
virtual ~UnicastMacRemoteEntry()
uint32_t self_sequence() const
const std::string & dest_ip() const
KSyncEntryPtr pl_create_ref_
UnicastMacRemoteSandeshTask(std::string resp_ctx, AgentSandeshArguments &args)
void UpdateResp(KSyncEntry *kentry, SandeshResponse *resp)
SandeshResponse * Alloc()
FilterResp Filter(KSyncEntry *entry)
virtual ~UnicastMacRemoteSandeshTask()
void EncodeArgs(AgentSandeshArguments &args)
KSyncObject * GetObject(OvsdbClientSession *session)
UnicastMacRemoteTable(OvsdbClientIdl *idl, const std::string &logical_switch_name, VrfOvsdbEntry *vrf)
OvsdbDBEntry * AllocOvsEntry(struct ovsdb_idl_row *row)
const std::string & logical_switch_name() const
virtual void EmptyTable()
LifetimeRef< UnicastMacRemoteTable > table_delete_ref_
KSyncEntry * DBToKSyncEntry(const DBEntry *)
virtual void OvsdbRegisterDBTable(DBTable *tbl)
KSyncEntry * Alloc(const KSyncEntry *key, uint32_t index)
std::string logical_switch_name_
virtual ~UnicastMacRemoteTable()
DBFilterResp OvsdbDBEntryFilter(const DBEntry *entry, const OvsdbDBEntry *ovsdb_entry)
UnicastMacRemoteTable * route_table()
void TriggerAck(UnicastMacRemoteTable *table)
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 Ip4Address * GetDip() const
AgentRouteTable * GetEvpnRouteTable() const
#define OVSDB_TRACE(obj,...)
void ovsdb_wrapper_add_ucast_mac_remote(struct ovsdb_idl_txn *txn, struct ovsdb_idl_row *row, const char *mac, struct ovsdb_idl_row *ls, struct ovsdb_idl_row *pl, const char *dest_ip)
char * ovsdb_wrapper_ucast_mac_remote_dst_ip(struct ovsdb_idl_row *row)
void ovsdb_wrapper_delete_ucast_mac_remote(struct ovsdb_idl_row *row)
char * ovsdb_wrapper_ucast_mac_remote_mac(struct ovsdb_idl_row *row)
static string ToString(PhysicalDevice::ManagementProtocol proto)