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;
95 dest_ip == logical_switch->physical_switch_tunnel_ip()) {
145 struct ovsdb_idl_row *pl_row = NULL;
190 tunnel =
static_cast<const TunnelNH *
>(nh);
191 dest_ip = tunnel->
GetDip()->to_string();
210 if (evpn_rt != NULL) {
213 if (ovs_path != NULL) {
217 if (tunnel != NULL &&
218 *(tunnel->
GetDip()) == *(ovs_tunnel->GetDip())) {
219 self_exported_route =
true;
221 self_sequence = ovs_path->
sequence();
264 if (!l_switch->IsResolved()) {
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());
KSyncObject * GetObject(OvsdbClientSession *session)
EvpnRouteEntry * FindRoute(const MacAddress &mac, const IpAddress &ip_addr, uint32_t plen, uint32_t ethernet_tag)
KSyncEntry * UnresolvedReference()
char * ovsdb_wrapper_ucast_mac_remote_mac(struct ovsdb_idl_row *row)
#define OVSDB_TRACE(obj,...)
void Change(KSyncEntry *entry)
const std::string & logical_switch_name() const
OvsdbClientIdl * client_idl()
UnicastMacRemoteEntry(UnicastMacRemoteTable *table, const std::string mac)
virtual void NotifyDelete(struct ovsdb_idl_row *)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
bool ecmp_suppressed() const
AgentRouteTable * GetEvpnRouteTable() const
virtual ~UnicastMacRemoteEntry()
virtual void EmptyTable(void)
Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge, EVPN (Type2/Type5). This base class contains common code for all types of route tables.
void DeleteDupEntries(struct ovsdb_idl_txn *)
void AddMsg(struct ovsdb_idl_txn *)
std::string StateString() const
DBFilterResp OvsdbDBEntryFilter(const DBEntry *entry, const OvsdbDBEntry *ovsdb_entry)
KSyncEntryPtr pl_create_ref_
bool is_multicast() const
char * ovsdb_wrapper_ucast_mac_remote_dst_ip(struct ovsdb_idl_row *row)
KSyncEntry * Alloc(const KSyncEntry *key, uint32_t index)
bool AcquireCreateRequest(KSyncEntry *creator)
OvsdbDBEntry * AllocOvsEntry(struct ovsdb_idl_row *row)
virtual void OvsdbRegisterDBTable(DBTable *tbl)
void ovsdb_wrapper_delete_ucast_mac_remote(struct ovsdb_idl_row *row)
const Ip4Address * GetDip() const
bool self_exported_route_
UnicastMacRemoteTable * route_table()
uint32_t self_sequence() const
LifetimeActor * deleter()
PhysicalLocatorTable * physical_locator_table()
void ChangeMsg(struct ovsdb_idl_txn *)
static void Unregister(KSyncObject *)
FilterResp Filter(KSyncEntry *entry)
struct ovsdb_idl_row * ovs_entry()
static string ToString(PhysicalDevice::ManagementProtocol proto)
const AgentPath * GetActivePath() const
NextHop * nexthop() const
void TriggerAck(UnicastMacRemoteTable *table)
virtual void NotifyAdd(struct ovsdb_idl_row *)
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)
UnicastMacRemoteTable(OvsdbClientIdl *idl, const std::string &logical_switch_name, VrfOvsdbEntry *vrf)
bool Get(const std::string &key, std::string *val) const
const std::string & logical_switch_name() 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...
void UpdateResp(KSyncEntry *kentry, SandeshResponse *resp)
uint32_t sequence() const
const NextHop * GetActiveNextHop() const
void SendTrace(Trace event) const
SandeshResponse * Alloc()
struct ovsdb_idl_row * ovs_entry_
UnicastMacRemoteSandeshTask(std::string resp_ctx, AgentSandeshArguments &args)
virtual ~UnicastMacRemoteSandeshTask()
OvsdbClientIdl * client_idl()
uint32_t sequence() const
const std::string & mac() const
KSyncEntry * Find(const KSyncEntry *key)
struct ovsdb_idl_row * ovs_entry()
bool Add(const std::string &key, const std::string &val)
void ReleaseLocatorCreateReference()
KSyncEntry * GetReference(const KSyncEntry *key)
virtual const PrefixType & prefix_address() const
Returns the value of a stored prefix address (IPv4, IPv6 or MAC address)
boost::asio::ip::address_v4 Ip4Address
virtual void NotifyDelete(struct ovsdb_idl_row *)
VrfOvsdbObject * vrf_ovsdb()
LogicalSwitchTable * logical_switch_table()
virtual void NotifyAdd(struct ovsdb_idl_row *)
void DeleteMsg(struct ovsdb_idl_txn *)
LifetimeRef< UnicastMacRemoteTable > table_delete_ref_
bool self_exported_route() const
void EncodeArgs(AgentSandeshArguments &args)
KSyncEntry * CreateStale(const KSyncEntry *key)
bool IsLess(const KSyncEntry &) const
virtual void EmptyTable()
virtual void Ack(bool success)
LogicalSwitchRef logical_switch_
bool ecmp_suppressed() const
virtual ~UnicastMacRemoteTable()
virtual void OvsdbRegisterDBTable(DBTable *tbl)
const std::string & dest_ip() const
void ReleaseCreateRequest(KSyncEntry *creator)
virtual AgentPath * FindPath(const Peer *peer) const
std::string logical_switch_name_
KSyncEntry * DBToKSyncEntry(const DBEntry *)
std::string logical_switch_name_
OvsdbDupIdlList dup_list_
virtual uint32_t GetActiveLabel() const