85 const int last_count)
const {
88 ss << uuid_str <<
":";
94 const std::string &ace_id) {
97 ss << uuid_str <<
":";
103 AclFlowCountResp &data,
104 const std::string& ace_id) {
106 bool key_set =
false;
107 AceIdFlowCntMap::iterator aceid_it =
aceid_cnt_map_.upper_bound(ace_id);
108 std::vector<AceIdFlowCnt> id_cnt_l;
110 AceIdFlowCnt id_cnt_s;
111 id_cnt_s.ace_id = aceid_it->first;
112 id_cnt_s.flow_cnt = aceid_it->second;
113 id_cnt_l.push_back(id_cnt_s);
122 data.set_aceid_cnt_list(id_cnt_l);
124 data.set_flow_count(
Size());
134 const int last_count,
137 bool key_set =
false;
138 FlowList::iterator fe_tree_it =
flow_list_.begin();
139 while (fe_tree_it !=
flow_list_.end() && (count + 1) < last_count) {
143 data.set_flow_count(
Size());
145 std::vector<FlowSandeshData> flow_entries_l;
149 FlowSandeshData fe_sandesh_data;
152 flow_entries_l.push_back(fe_sandesh_data);
162 data.set_flow_entries(flow_entries_l);
169 AclEntryIDList::const_iterator id_it;
170 for (id_it = id_list->begin(); id_it != id_list->end(); ++id_it) {
181 if (id_list->size()) {
182 AclEntryIDList::const_iterator id_it;
183 for (id_it = id_list->begin(); id_it != id_list->end(); ++id_it) {
194 if (id_list->size()) {
223 for (FlowList::iterator it =
flow_list_.begin();
241 bool local_flow,
bool old_ingress) {
259 if (new_ingress != old_ingress) {
301 FlowList::iterator it = flow_list_.begin();
302 while (it != flow_list_.end()) {
340 vrf_(vrf), vrf_id_(vrf->vrf_id()),
341 inet4_(this, vrf, vrf->GetRouteTable(
Agent::INET4_UNICAST)),
342 inet6_(this, vrf, vrf->GetRouteTable(
Agent::INET6_UNICAST)),
343 bridge_(this, vrf, vrf->GetRouteTable(
Agent::BRIDGE)),
344 vrf_tree_(vrf_tree) {
361 deleted_(false), table_ref_(this, NULL),
362 vrf_mgmt_entry_(vrf_mgmt_entry), vrf_(vrf) {
371 table_ref_.Reset(NULL);
376 vrf_mgmt_entry_->vrf_tree()->mgr()->RetryVrfDeleteEvent(
vrf_);
uint32_t egress_flow_count_
virtual bool OperEntryChange(FlowMgmtManager *mgr, const FlowMgmtRequest *req, FlowMgmtKey *key)
Data(VrfFlowMgmtEntry *vrf_mgmt_entry, const VrfEntry *vrf, AgentRouteTable *table)
virtual bool OperEntryDelete(FlowMgmtManager *mgr, const FlowMgmtRequest *req, FlowMgmtKey *key)
bool HandleNhChange(FlowMgmtManager *mgr, const FlowMgmtRequest *req, FlowMgmtKey *key)
virtual bool HealthCheckUpdate(Agent *agent, FlowMgmtManager *mgr, BgpAsAServiceFlowMgmtKey &key, BgpAsAServiceFlowMgmtRequest *req)
virtual bool OperEntryAdd(FlowMgmtManager *mgr, const FlowMgmtRequest *req, FlowMgmtKey *key)
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.
bool Delete(const AclEntryIDList *ace_id_list, FlowEntry *flow, FlowMgmtKeyNode *node)
BgpAsAServiceFlowMgmtKey * FindBgpAsAServiceInfo(FlowEntry *flow, BgpAsAServiceFlowMgmtKey &key)
std::vector< AclEntryID > AclEntryIDList
void NonOperEntryEvent(FlowEvent::Event event, FlowEntry *flow)
void UpdateCounterOnDel(FlowEntry *flow, bool local_flow, bool old_ingress)
static std::string UuidToString(const boost::uuids::uuid &id)
const boost::uuids::uuid & GetUuid() const
static const int MaxResponses
LifetimeActor * deleter()
bool Delete(FlowEntry *flow, FlowMgmtKeyNode *node)
virtual bool Delete(FlowEntry *flow, FlowMgmtKeyNode *node)
FlowEvent::Event GetResponseEvent() const
bool NeedsReCompute(const FlowEntry *flow)
virtual bool CanDelete() const
void StopHealthCheck(FlowEntry *flow)
bool is_flags_set(const FlowEntryFlags &flags) const
static const std::string & NullString()
bool HasVrfFlows(uint32_t vrf)
VrfFlowMgmtEntry(VrfFlowMgmtTree *vrf_tree, const VrfEntry *vrf)
void DBEntryEvent(FlowEvent::Event event, FlowMgmtKey *key, FlowEntry *flow)
std::string GetAceSandeshDataKey(const AclDBEntry *acl, const std::string &ace_id)
std::string GetAclFlowSandeshDataKey(const AclDBEntry *acl, const int last_count) const
virtual bool NonOperEntryDelete(FlowMgmtManager *mgr, const FlowMgmtRequest *req, FlowMgmtKey *key)
void UpdateCounterOnAdd(FlowEntry *flow, bool add_flow, bool local_flow, bool old_ingress)
LifetimeRef< Data > table_ref_
uint32_t ingress_flow_count_
void SetAclFlowSandeshData(const AclDBEntry *acl, FlowSandeshData &fe_sandesh_data, Agent *agent) const
void FillAceFlowSandeshInfo(const AclDBEntry *acl, AclFlowCountResp &data, const std::string &ace_id)
bool RecomputeCoveringRouteEntry(FlowMgmtManager *mgr, InetRouteFlowMgmtKey *covering_route, InetRouteFlowMgmtKey *key)
void FillAclFlowSandeshInfo(const AclDBEntry *acl, AclFlowResp &data, const int last_count, Agent *agent)
const boost::uuids::uuid & health_check_uuid() const
void DecrementAceIdCountMap(const AclEntryIDList *id_list)
virtual bool Add(FlowEntry *flow, FlowMgmtKeyNode *node)
VrfFlowMgmtTree * vrf_tree_
void StartHealthCheck(Agent *agent, FlowEntry *flow, const boost::uuids::uuid &hc_uuid)
FlowEntry * flow_entry() const
BgpAsAServiceFlowMgmtRequest::Type type() const
AceIdFlowCntMap aceid_cnt_map_
FlowMgmtManager * mgr() const
bool Add(FlowEntry *flow, FlowMgmtKeyNode *node)
bool Add(const AclEntryIDList *ace_id_list, FlowEntry *flow, const AclEntryIDList *old_id_list, FlowMgmtKeyNode *node)