OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
session_stats_collector.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef vnsw_agent_session_stats_collector_h
6 #define vnsw_agent_session_stats_collector_h
7 
9 // Forward declaration
10 class FlowStatsManager;
11 class SessionStatsReq;
12 class FlowToSessionMap;
13 struct SessionSloRuleEntry;
14 class SessionSloState;
15 
17 
18 #define SESSION_STATS_TRACE(obj, ...)\
19 do {\
20  SessionStats##obj::TraceMsg(SessionStatsTraceBuf, __FILE__, __LINE__, __VA_ARGS__);\
21 } while (false)
22 
24 public:
25  std::string vmi_cfg_name;
26  std::string local_vn;
27  std::string remote_vn;
30  std::string remote_prefix;
31  std::string match_policy;
33  bool is_si;
35 
36  void Reset();
37  bool IsLess(const SessionEndpointKey &rhs) const;
38  bool IsEqual(const SessionEndpointKey &rhs) const;
39 };
40 
41 struct SessionAggKey {
42 public:
44  uint16_t server_port;
45  uint16_t proto;
47  void Reset();
48  bool IsLess(const SessionAggKey &rhs) const;
49  bool IsEqual(const SessionAggKey &rhs) const;
50 };
51 
52 struct SessionKey {
53 public:
55  uint16_t client_port;
57  SessionKey() { Reset(); }
58 
59  void Reset();
60  bool IsLess(const SessionKey &rhs) const;
61  bool IsEqual(const SessionKey &rhs) const;
62 };
63 
64 struct SessionKeyCmp {
65  bool operator()(const SessionKey &lhs, const SessionKey &rhs) const {
66  return lhs.IsLess(rhs);
67  }
68 };
69 
71 public:
73  uint8_t gen_id;
74  uint32_t flow_handle;
76  uint64_t total_bytes;
77  uint64_t total_packets;
78 };
79 
81  std::string sg_rule_uuid;
82  std::string nw_ace_uuid;
83  std::string aps_rule_uuid;
84  std::string action;
85  std::string drop_reason;
87  aps_rule_uuid(""), action(""), drop_reason("") {
88  }
89 };
90 
92  bool valid;
93  std::string vm_cfg_name;
94  std::string other_vrouter;
95  uint16_t underlay_proto;
101  underlay_proto(0) {}
102 };
103 
105  uint64_t diff_bytes;
106  uint64_t diff_packets;
108  uint16_t tcp_flags;
109  bool valid;
111  underlay_src_port(0), tcp_flags(0), valid(false) {
112  }
113 };
114 
116  bool sampled;
120 };
121 
123 public:
124  uint64_t setup_time;
125  uint64_t teardown_time;
127  bool deleted;
129  bool evicted;
135  exported_atleast_once(false), deleted(false), del_stats(),
136  evicted(false), evict_stats(), export_info(), fwd_flow(), rev_flow() {}
137 };
138 
140 public:
141  typedef std::map<const SessionKey, SessionStatsInfo,
144 };
145 
147  bool operator()(const SessionAggKey &lhs, const SessionAggKey &rhs) const {
148  return lhs.IsLess(rhs);
149  }
150 };
151 
153 public:
154  typedef std::map<const SessionAggKey, SessionPreAggInfo,
157 };
158 
161  const SessionEndpointKey &rhs) const {
162  return lhs.IsLess(rhs);
163  }
164 };
165 
167 public:
168  typedef std::map<const SessionEndpointKey, SessionEndpointInfo,
171  typedef std::map<FlowEntryPtr, FlowToSessionMap> FlowSessionMap;
172  typedef std::map<std::string, SessionSloRuleEntry> SessionSloRuleMap;
173 
174  static const uint32_t kSessionStatsTimerInterval = 1000;
175  static const uint32_t kSessionsPerTask = 256;
176 
177  uint32_t RunSessionEndpointStats(uint32_t max_count);
178 
179  class SessionTask : public Task {
180  public:
182  virtual ~SessionTask();
183  std::string Description() const;
184  bool Run();
185  private:
187  };
188 
189 
190  SessionStatsCollector(boost::asio::io_context &io, AgentUveBase *uve,
191  uint32_t instance_id, FlowStatsManager *fsm,
193  virtual ~SessionStatsCollector();
194  bool Run();
195 
196  int task_id() const { return task_id_; }
197  uint32_t instance_id() const { return instance_id_; }
198  const Queue *queue() const { return &request_queue_; }
199  size_t Size() const { return session_endpoint_map_.size(); }
200  friend class FlowStatsManager;
202 protected:
203  virtual void DispatchSessionMsg(const std::vector<SessionEndpoint> &lst);
204 private:
205  #define CheckFlowLogging(logged) { \
206  if (logged) { \
207  return true; \
208  } \
209  }
210  int ComputeSloRate(int rate, SecurityLoggingObject *slo) const;
212  SessionFlowStatsParams *params) const;
213  uint64_t threshold() const;
214  bool IsSamplingEnabled() const;
215  bool SampleSession(SessionPreAggInfo::SessionMap::iterator session_map_iter,
216  SessionStatsParams *params) const;
218  (SessionPreAggInfo::SessionMap::iterator session_map_iter,
219  SessionStatsParams *params) const;
221  (SessionPreAggInfo::SessionMap::iterator session_map_iter,
222  SessionStatsParams *params) const;
223  bool ProcessSessionEndpoint(const SessionEndpointMap::iterator &it);
224  uint64_t GetUpdatedSessionFlowBytes(uint64_t info_bytes,
225  uint64_t k_flow_bytes) const;
226  uint64_t GetUpdatedSessionFlowPackets(uint64_t info_packets,
227  uint64_t k_flow_pkts) const;
229  (SessionPreAggInfo::SessionMap::iterator session_map_iter,
230  SessionInfo *session_info, bool is_sampling, bool is_logging) const;
232  SessionFlowInfo *flow_info,
233  bool is_sampling,
234  bool is_logging) const;
235  void FillSessionFlowInfo(const SessionFlowStatsInfo &session_flow,
236  const SessionStatsInfo &sinfo,
237  const SessionFlowExportInfo &einfo,
238  SessionFlowInfo *flow_info) const;
240  const boost::uuids::uuid &u,
241  FlowEntry *fe) const;
242  void CopyFlowInfo(SessionStatsInfo &session,
243  const RevFlowDepParams *params);
244  void UpdateAggregateStats(const SessionInfo &sinfo,
245  SessionAggInfo *agg_info,
246  bool is_sampling, bool is_logging) const;
248  (SessionPreAggInfo::SessionMap::iterator session_map_iter,
249  const SessionStatsParams &stats, SessionInfo *session_info,
250  SessionIpPort *session_key, bool is_sampling, bool is_logging) const;
252  (SessionPreAggInfo::SessionMap::iterator session_map_iter,
253  const SessionStatsParams &stats, SessionInfo *session_info,
254  SessionIpPort *session_key,
255  const RevFlowDepParams *params,
256  bool read_flow, bool is_sampling, bool is_logging) const;
257  void FillSessionAggInfo(SessionEndpointInfo::SessionAggMap::iterator it,
258  SessionIpPortProtocol *session_agg_key) const;
259  void FillSessionEndpoint(SessionEndpointMap::iterator it,
260  SessionEndpoint *session_ep) const;
261  void FillSessionTags(const TagList &list, SessionEndpoint *ep) const;
262  void FillSessionRemoteTags(const TagList &list, SessionEndpoint *ep) const;
263  static uint64_t GetCurrentTime();
265  SessionFlowStatsInfo *session_flow) const;
266  void UpdateSessionStatsInfo(FlowEntry* fe, uint64_t setup_time,
267  SessionStatsInfo *session) const;
268  void AddSession(FlowEntry* fe, uint64_t setup_time);
269  void DeleteSession(FlowEntry* fe, const boost::uuids::uuid &del_uuid,
270  uint64_t teardown_time,
271  const RevFlowDepParams *params);
272  void EvictedSessionStatsUpdate(const FlowEntryPtr &flow,
273  uint32_t bytes,
274  uint32_t packets,
275  uint32_t oflow_bytes,
276  const boost::uuids::uuid &u);
277  bool GetSessionKey(FlowEntry* fe, SessionAggKey &session_agg_key,
278  SessionKey &session_key,
279  SessionEndpointKey &session_endpoint_key);
281  SessionKey session_key,
282  SessionAggKey session_agg_key,
283  SessionEndpointKey session_endpoint_key);
285  void Shutdown();
286  void RegisterDBClients();
287  void AddEvent(const FlowEntryPtr &flow);
288  void DeleteEvent(const FlowEntryPtr &flow, const RevFlowDepParams &params);
289  void UpdateSessionStatsEvent(const FlowEntryPtr &flow,
290  uint32_t bytes,
291  uint32_t packets,
292  uint32_t oflow_bytes,
293  const boost::uuids::uuid &u);
294  bool RequestHandlerEntry();
295  void RequestHandlerExit(bool done);
296  bool RequestHandler(boost::shared_ptr<SessionStatsReq> req);
297  void EnqueueSessionMsg();
299  uint8_t GetSessionMsgIdx();
300 
301  bool UpdateSloMatchRuleEntry(const boost::uuids::uuid &slo_uuid,
302  const std::string &match_uuid,
303  bool *match);
304  bool CheckPolicyMatch(const SessionSloRuleMap &map,
305  const std::string &policy_uuid,
306  const bool &deleted_flag,
307  bool *match,
308  const bool &exported_once);
309  bool FindSloMatchRule(const SessionSloRuleMap &map,
310  const std::string &fw_policy_uuid,
311  const std::string &nw_policy_uuid,
312  const std::string &sg_policy_uuid,
313  const bool &deleted_flag,
314  bool *match,
315  const bool &exported_once);
316 
317  void GetPolicyIdFromFlow(const FlowEntry *fe,
318  std::string &fw_policy_uuid,
319  std::string &nw_policy_uuid,
320  std::string &sg_policy_uuid);
321 
323  std::string& fw_policy_uuid,
324  std::string& nw_policy_uuid,
325  std::string& sg_policy_uuid);
326 
327  bool MatchSloForFlow(const SessionStatsInfo &stats_info,
328  const FlowEntry *fe,
329  const std::string& fw_policy_uuid,
330  const std::string& nw_policy_uuid,
331  const std::string& sg_policy_uuid,
332  const bool &deleted_flag,
333  bool *logged,
334  const bool &exported_once);
335 
336  void BuildSloList(const SessionStatsInfo &stats_info,
337  const FlowEntry *fe,
338  SessionSloRuleMap *global_session_slo_rule_map,
339  SessionSloRuleMap *vmi_session_slo_rule_map,
340  SessionSloRuleMap *vn_session_slo_rule_map);
341  void MakeSloList(const FlowEntry *fe,
342  SessionSloRuleMap *vmi_session_slo_rule_map,
343  SessionSloRuleMap *vn_session_slo_rule_map);
344 
345  bool FlowLogging(const SessionStatsInfo &stats_info,
346  const FlowEntry *fe,
347  bool *logged,
348  const bool &exported_once);
349 
350  bool DeletedFlowLogging(const SessionStatsInfo &stats_info,
351  const SessionFlowExportInfo &flow_info,
352  bool *logged,
353  const bool &exported_once);
354 
355  bool HandleDeletedFlowLogging(const SessionStatsInfo &stats_info);
356  bool HandleFlowLogging(const SessionStatsInfo &stats_info);
357  bool CheckSessionLogging(const SessionStatsInfo &stats_info);
358  void AddSloList(const UuidList &slo_list, SessionSloRuleMap *slo_rule_map);
359  void AddSloEntry(const boost::uuids::uuid &uuid,
360  SessionSloRuleMap *slo_rule_map);
362  SessionSloRuleMap *slo_rule_map);
364  SessionSloRuleMap *r_map);
366  SessionSloRuleMap *rule_map);
367  void AddSloRules(
368  const std::vector<autogen::SecurityLoggingObjectRuleEntryType> &list,
370  SessionSloRuleMap *slo_rule_map);
371  void AddSessionSloRuleEntry(const std::string &uuid, int rate,
373  SessionSloRuleMap *slo_rule_map);
374  void SloNotify(DBTablePartBase *partition, DBEntryBase *e);
376  SessionSloState *state);
378  SessionPreAggInfo::SessionMap::iterator session_map_iter);
379 
381  int task_id_;
388  std::vector<SessionEndpoint> session_msg_list_;
390  uint32_t instance_id_;
394  // Cached UTC Time stamp
395  // The timestamp is taken once on SessionStatsCollector::RequestHandlerEntry()
396  // and used for all requests in current run
397  uint64_t current_time_;
402 };
403 
405 public:
406  static const int kMaxSessionCollectors = 1;
407  typedef boost::shared_ptr<SessionStatsCollector> SessionStatsCollectorPtr;
409  SessionStatsCollector* GetCollector(uint8_t idx) const;
410  void SetExpiryTime(int time);
411  int GetExpiryTime() const;
413  void Shutdown();
414  size_t Size() const;
415  void RegisterDBClients();
416 private:
419 };
420 
422 public:
423  enum Event {
428  };
429 
430  SessionStatsReq(Event ev, const FlowEntryPtr &flow, uint64_t time):
431  event_(ev), flow_(flow), time_(time) {
432  }
434  const RevFlowDepParams &p) :
435  event_(ev), flow_(flow), time_(time), params_(p) {
436  }
438  uint32_t packets, uint32_t oflow_bytes,
439  const boost::uuids::uuid &u) :
440  event_(event), flow_(flow), bytes_(bytes), packets_(packets),
441  oflow_bytes_(oflow_bytes), uuid_(u) {
442  }
443 
445 
446  Event event() const { return event_; }
447  FlowEntry* flow() const { return flow_.get(); }
448  FlowEntry* reverse_flow() const;
449  uint64_t time() const { return time_; }
450  const RevFlowDepParams& params() const { return params_; }
451  uint32_t bytes() const { return bytes_;}
452  uint32_t packets() const { return packets_;}
453  uint32_t oflow_bytes() const { return oflow_bytes_;}
454  boost::uuids::uuid uuid() const { return uuid_; }
455 
456 private:
459  uint64_t time_;
461  uint32_t bytes_;
462  uint32_t packets_;
463  uint32_t oflow_bytes_;
466 };
467 
469 public:
473  session_key_(session_key),
474  session_agg_key_(session_agg_key),
475  session_endpoint_key_(session_endpoint_key) {
476  }
477  bool IsEqual(FlowToSessionMap &rhs);
481 private:
485 };
486 
488 public:
490  rate(rate), slo_uuid(uuid) {}
491 
492  int rate;
494 };
495 
497 public:
498  int rate;
500 };
501 
502 class SessionSloState : public DBState {
503 public:
504  typedef std::map<std::string, SessionSloRuleState> SessionSloRuleStateMap;
505  void DeleteSessionSloStateRuleEntry(std::string uuid);
506  void UpdateSessionSloStateRuleEntry(std::string uuid, int rate);
507  bool UpdateSessionSloStateRuleRefCount(const std::string &uuid, bool *matc);
510  session_rule_state_map_.clear();
511  }
512 private:
514 };
515 
516 #endif //vnsw_agent_session_stats_collector_h
bool FlowLogging(const SessionStatsInfo &stats_info, const FlowEntry *fe, bool *logged, const bool &exported_once)
FlowEntry * reverse_flow() const
uint64_t GetUpdatedSessionFlowBytes(uint64_t info_bytes, uint64_t k_flow_bytes) const
SessionAggKey session_agg_key_
void UpdateSessionSloStateRuleEntry(std::string uuid, int rate)
SessionEndpointKey session_endpoint_key()
std::map< const SessionAggKey, SessionPreAggInfo, SessionAggKeyCmp > SessionAggMap
bool GetSessionKey(FlowEntry *fe, SessionAggKey &session_agg_key, SessionKey &session_key, SessionEndpointKey &session_endpoint_key)
bool IsEqual(const SessionEndpointKey &rhs) const
void GetPolicyIdFromDeletedFlow(const SessionFlowExportInfo &flow_info, std::string &fw_policy_uuid, std::string &nw_policy_uuid, std::string &sg_policy_uuid)
uint64_t time() const
bool SampleSession(SessionPreAggInfo::SessionMap::iterator session_map_iter, SessionStatsParams *params) const
std::vector< SessionEndpoint > session_msg_list_
bool HandleDeletedFlowLogging(const SessionStatsInfo &stats_info)
boost::shared_ptr< SessionStatsCollector > SessionStatsCollectorPtr
int ComputeSloRate(int rate, SecurityLoggingObject *slo) const
SessionFlowStatsParams rev_flow
void GetPolicyIdFromFlow(const FlowEntry *fe, std::string &fw_policy_uuid, std::string &nw_policy_uuid, std::string &sg_policy_uuid)
bool IsEqual(FlowToSessionMap &rhs)
void UpdateSessionStatsEvent(const FlowEntryPtr &flow, uint32_t bytes, uint32_t packets, uint32_t oflow_bytes, const boost::uuids::uuid &u)
void BuildSloList(const SessionStatsInfo &stats_info, const FlowEntry *fe, SessionSloRuleMap *global_session_slo_rule_map, SessionSloRuleMap *vmi_session_slo_rule_map, SessionSloRuleMap *vn_session_slo_rule_map)
FlowToSessionMap(SessionKey &session_key, SessionAggKey &session_agg_key, SessionEndpointKey &session_endpoint_key)
std::map< std::string, SessionSloRuleEntry > SessionSloRuleMap
DBTable::ListenerId slo_listener_id_
bool SessionStatsChangedLocked(SessionPreAggInfo::SessionMap::iterator session_map_iter, SessionStatsParams *params) const
boost::asio::ip::address IpAddress
Definition: address.h:13
DISALLOW_COPY_AND_ASSIGN(SessionStatsCollector)
SessionStatsReq(Event ev, const FlowEntryPtr &flow, uint64_t time, const RevFlowDepParams &p)
static const uint32_t kSessionsPerTask
int ListenerId
Definition: db_table.h:62
void AddSloRules(const std::vector< autogen::SecurityLoggingObjectRuleEntryType > &list, SecurityLoggingObject *slo, SessionSloRuleMap *slo_rule_map)
virtual void DispatchSessionMsg(const std::vector< SessionEndpoint > &lst)
static const uint32_t kSessionStatsTimerInterval
void DeleteSession(FlowEntry *fe, const boost::uuids::uuid &del_uuid, uint64_t teardown_time, const RevFlowDepParams *params)
SessionStatsCollectorObject * parent_
SessionStatsCollector(boost::asio::io_context &io, AgentUveBase *uve, uint32_t instance_id, FlowStatsManager *fsm, SessionStatsCollectorObject *obj)
void FillSessionEvictStats(SessionPreAggInfo::SessionMap::iterator session_map_iter, SessionInfo *session_info, bool is_sampling, bool is_logging) const
void FillSessionInfoUnlocked(SessionPreAggInfo::SessionMap::iterator session_map_iter, const SessionStatsParams &stats, SessionInfo *session_info, SessionIpPort *session_key, const RevFlowDepParams *params, bool read_flow, bool is_sampling, bool is_logging) const
void UpdateAggregateStats(const SessionInfo &sinfo, SessionAggInfo *agg_info, bool is_sampling, bool is_logging) const
boost::uuids::uuid uuid
bool Run()
Code to execute. Returns true if task is completed. Return false to reschedule the task...
bool CheckPolicyMatch(const SessionSloRuleMap &map, const std::string &policy_uuid, const bool &deleted_flag, bool *match, const bool &exported_once)
SessionEndpointKey session_ep_iteration_key_
WorkQueue< boost::shared_ptr< SessionStatsReq > > Queue
SessionStatsReq(Event ev, const FlowEntryPtr &flow, uint64_t time)
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
Definition: sandesh_trace.h:18
SessionEndpointMap session_endpoint_map_
std::map< const SessionEndpointKey, SessionEndpointInfo, SessionEndpointKeyCmp > SessionEndpointMap
const RevFlowDepParams & params() const
DISALLOW_COPY_AND_ASSIGN(SessionStatsReq)
const Queue * queue() const
void AddSloFirewallRules(SecurityLoggingObject *slo, SessionSloRuleMap *rule_map)
bool IsEqual(const SessionKey &rhs) const
void SloNotify(DBTablePartBase *partition, DBEntryBase *e)
bool UpdateSessionSloStateRuleRefCount(const std::string &uuid, bool *matc)
bool operator()(const SessionKey &lhs, const SessionKey &rhs) const
FlowEntry * flow() const
bool HandleFlowLogging(const SessionStatsInfo &stats_info)
boost::uuids::uuid slo_uuid
bool MatchSloForFlow(const SessionStatsInfo &stats_info, const FlowEntry *fe, const std::string &fw_policy_uuid, const std::string &nw_policy_uuid, const std::string &sg_policy_uuid, const bool &deleted_flag, bool *logged, const bool &exported_once)
void AddSloEntry(const boost::uuids::uuid &uuid, SessionSloRuleMap *slo_rule_map)
boost::uuids::uuid uuid_
SessionStatsCollector * FlowToCollector(const FlowEntry *flow)
Definition: agent.h:358
void DeleteEvent(const FlowEntryPtr &flow, const RevFlowDepParams &params)
uint32_t oflow_bytes() const
SessionSloRuleEntry(int rate, const boost::uuids::uuid &uuid)
std::map< std::string, SessionSloRuleState > SessionSloRuleStateMap
bool CheckAndDeleteSessionStatsFlow(SessionPreAggInfo::SessionMap::iterator session_map_iter)
bool IsLess(const SessionAggKey &rhs) const
bool RequestHandler(boost::shared_ptr< SessionStatsReq > req)
void AddSessionSloRuleEntry(const std::string &uuid, int rate, SecurityLoggingObject *slo, SessionSloRuleMap *slo_rule_map)
void CopyFlowInfo(SessionStatsInfo &session, const RevFlowDepParams *params)
SessionStatsCollectorPtr collectors[kMaxSessionCollectors]
bool FetchFlowStats(SessionFlowStatsInfo *info, SessionFlowStatsParams *params) const
SessionFlowStatsInfo rev_flow
void AddSloList(const UuidList &slo_list, SessionSloRuleMap *slo_rule_map)
void DeleteFlowToSessionMap(FlowEntry *fe)
void FillSessionFlowInfo(const SessionFlowStatsInfo &session_flow, const SessionStatsInfo &sinfo, const SessionFlowExportInfo &einfo, SessionFlowInfo *flow_info) const
SessionStatsCollector * GetCollector(uint8_t idx) const
bool operator()(const SessionEndpointKey &lhs, const SessionEndpointKey &rhs) const
void FillSessionTags(const TagList &list, SessionEndpoint *ep) const
static uint64_t GetCurrentTime()
SandeshTraceBufferPtr SessionStatsTraceBuf
FlowStatsManager * flow_stats_manager_
void AddSloEntryRules(SecurityLoggingObject *slo, SessionSloRuleMap *slo_rule_map)
void FillSessionFlowStats(const SessionFlowStatsParams &stats, SessionFlowInfo *flow_info, bool is_sampling, bool is_logging) const
uint32_t bytes() const
std::vector< boost::uuids::uuid > UuidList
Definition: agent.h:203
bool DeletedFlowLogging(const SessionStatsInfo &stats_info, const SessionFlowExportInfo &flow_info, bool *logged, const bool &exported_once)
void AddEvent(const FlowEntryPtr &flow)
void UpdateSessionFlowStatsInfo(FlowEntry *fe, SessionFlowStatsInfo *session_flow) const
boost::uuids::uuid uuid
void AddFlowToSessionMap(FlowEntry *fe, SessionKey session_key, SessionAggKey session_agg_key, SessionEndpointKey session_endpoint_key)
void AddSloFirewallPolicies(SecurityLoggingObject *slo, SessionSloRuleMap *r_map)
void FillSessionInfoLocked(SessionPreAggInfo::SessionMap::iterator session_map_iter, const SessionStatsParams &stats, SessionInfo *session_info, SessionIpPort *session_key, bool is_sampling, bool is_logging) const
SessionSloRuleStateMap session_rule_state_map_
SessionFlowStatsInfo fwd_flow
SessionFlowExportInfo fwd_flow
uint32_t packets() const
bool operator()(const SessionAggKey &lhs, const SessionAggKey &rhs) const
void MakeSloList(const FlowEntry *fe, SessionSloRuleMap *vmi_session_slo_rule_map, SessionSloRuleMap *vn_session_slo_rule_map)
bool IsLess(const SessionKey &rhs) const
DISALLOW_COPY_AND_ASSIGN(SessionStatsCollectorObject)
SessionStatsParams del_stats
bool IsEqual(const SessionAggKey &rhs) const
void CopyFlowInfoInternal(SessionFlowExportInfo *info, const boost::uuids::uuid &u, FlowEntry *fe) const
void UpdateSessionStatsInfo(FlowEntry *fe, uint64_t setup_time, SessionStatsInfo *session) const
SessionFlowStatsParams fwd_flow
SessionFlowExportInfo rev_flow
uint32_t RunSessionEndpointStats(uint32_t max_count)
bool UpdateSloMatchRuleEntry(const boost::uuids::uuid &slo_uuid, const std::string &match_uuid, bool *match)
SessionAggKey session_agg_iteration_key_
std::map< const SessionKey, SessionStatsInfo, SessionKeyCmp > SessionMap
RevFlowDepParams params_
uint64_t GetUpdatedSessionFlowPackets(uint64_t info_packets, uint64_t k_flow_pkts) const
SessionStatsParams evict_stats
SessionStatsReq(Event event, const FlowEntryPtr &flow, uint32_t bytes, uint32_t packets, uint32_t oflow_bytes, const boost::uuids::uuid &u)
bool SessionStatsChangedUnlocked(SessionPreAggInfo::SessionMap::iterator session_map_iter, SessionStatsParams *params) const
void AddSession(FlowEntry *fe, uint64_t setup_time)
void FillSessionAggInfo(SessionEndpointInfo::SessionAggMap::iterator it, SessionIpPortProtocol *session_agg_key) const
void UpdateSloStateRules(SecurityLoggingObject *slo, SessionSloState *state)
SessionStatsCollectorObject(Agent *agent, FlowStatsManager *mgr)
void FillSessionEndpoint(SessionEndpointMap::iterator it, SessionEndpoint *session_ep) const
bool ProcessSessionEndpoint(const SessionEndpointMap::iterator &it)
Task is a wrapper over tbb::task to support policies.
Definition: task.h:86
void FillSessionRemoteTags(const TagList &list, SessionEndpoint *ep) const
void DeleteSessionSloStateRuleEntry(std::string uuid)
void EvictedSessionStatsUpdate(const FlowEntryPtr &flow, uint32_t bytes, uint32_t packets, uint32_t oflow_bytes, const boost::uuids::uuid &u)
SessionEndpointKey session_endpoint_key_
std::map< FlowEntryPtr, FlowToSessionMap > FlowSessionMap
bool CheckSessionLogging(const SessionStatsInfo &stats_info)
bool IsLess(const SessionEndpointKey &rhs) const
SessionAggKey session_agg_key()
SessionExportInfo export_info
boost::uuids::uuid uuid() const
boost::intrusive_ptr< FlowEntry > FlowEntryPtr
Definition: flow_entry.h:125
std::vector< int > TagList
Definition: agent.h:202
bool FindSloMatchRule(const SessionSloRuleMap &map, const std::string &fw_policy_uuid, const std::string &nw_policy_uuid, const std::string &sg_policy_uuid, const bool &deleted_flag, bool *match, const bool &exported_once)