OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pkt_sandesh_flow.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef __PKT_SANDESH_FLOW_H__
6 #define __PKT_SANDESH_FLOW_H__
7 
8 #include "base/task.h"
9 #include "pkt/flow_table.h"
10 #include "pkt/pkt_types.h"
12 
13 class PktSandeshFlow : public Task {
14 public:
15  static const int kMaxFlowResponse = 100;
16  static const char kDelimiter = '-';
17  static const std::string start_key;
18  PktSandeshFlow(Agent *agent, FlowRecordsResp *obj, std::string resp_ctx,
19  std::string key);
20  virtual ~PktSandeshFlow();
21 
22  void SendResponse(SandeshResponse *resp);
23  bool SetFlowKey(std::string key);
24  static std::string GetFlowKey(const FlowKey &key, uint16_t partition_id);
25 
26  virtual bool Run();
27  std::string Description() const { return "PktSandeshFlow"; }
28  void SetSandeshFlowData(std::vector<SandeshFlowData> &list, FlowEntry *fe,
29  const FlowExportInfo *info);
30  void set_delete_op(bool delete_op) {delete_op_ = delete_op;}
31 
32 protected:
33  FlowRecordsResp *resp_obj_;
34  std::string resp_data_;
36  bool key_valid_;
37  bool delete_op_;
39  uint16_t partition_id_;
40 
41 private:
43 };
44 
46 public:
47  PktSandeshFlowStats(Agent *agent, FlowStatsCollectorRecordsResp *obj, std::string resp_ctx,
48  std::string key);
49  virtual ~PktSandeshFlowStats() {}
50  bool SetProtoKey(std::string key);
51  virtual bool Run();
52  bool SetProto(std::string &key);
53 private:
54  uint32_t proto_;
55  uint32_t port_;
56  FlowStatsCollectorRecordsResp *resp_;
58 };
59 #endif
virtual bool Run()
Code to execute. Returns true if task is completed. Return false to reschedule the task...
void SendResponse(SandeshResponse *resp)
FlowRecordsResp * resp_obj_
static std::string GetFlowKey(const FlowKey &key, uint16_t partition_id)
static const char kDelimiter
bool SetFlowKey(std::string key)
DISALLOW_COPY_AND_ASSIGN(PktSandeshFlowStats)
virtual ~PktSandeshFlowStats()
bool SetProtoKey(std::string key)
void set_delete_op(bool delete_op)
static const std::string start_key
DISALLOW_COPY_AND_ASSIGN(PktSandeshFlow)
std::string resp_data_
Definition: agent.h:358
static const int kMaxFlowResponse
PktSandeshFlowStats(Agent *agent, FlowStatsCollectorRecordsResp *obj, std::string resp_ctx, std::string key)
std::string Description() const
uint16_t partition_id_
bool SetProto(std::string &key)
FlowStatsCollectorRecordsResp * resp_
FlowKey flow_iteration_key_
virtual bool Run()
Code to execute. Returns true if task is completed. Return false to reschedule the task...
PktSandeshFlow(Agent *agent, FlowRecordsResp *obj, std::string resp_ctx, std::string key)
void SetSandeshFlowData(std::vector< SandeshFlowData > &list, FlowEntry *fe, const FlowExportInfo *info)
Task is a wrapper over tbb::task to support policies.
Definition: task.h:86
virtual ~PktSandeshFlow()