-
Notifications
You must be signed in to change notification settings - Fork 390
/
pkt_sandesh_flow.h
59 lines (51 loc) · 1.74 KB
/
pkt_sandesh_flow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#ifndef __PKT_SANDESH_FLOW_H__
#define __PKT_SANDESH_FLOW_H__
#include "base/task.h"
#include "pkt/flow_table.h"
#include "pkt/pkt_types.h"
#include "vrouter/flow_stats/flow_stats_collector.h"
class PktSandeshFlow : public Task {
public:
static const int kMaxFlowResponse = 100;
static const char kDelimiter = '-';
static const std::string start_key;
PktSandeshFlow(Agent *agent, FlowRecordsResp *obj, std::string resp_ctx,
std::string key);
virtual ~PktSandeshFlow();
void SendResponse(SandeshResponse *resp);
bool SetFlowKey(std::string key);
static std::string GetFlowKey(const FlowKey &key, uint16_t partition_id);
virtual bool Run();
std::string Description() const { return "PktSandeshFlow"; }
void SetSandeshFlowData(std::vector<SandeshFlowData> &list, FlowEntry *fe,
const FlowExportInfo *info);
void set_delete_op(bool delete_op) {delete_op_ = delete_op;}
protected:
FlowRecordsResp *resp_obj_;
std::string resp_data_;
FlowKey flow_iteration_key_;
bool key_valid_;
bool delete_op_;
Agent *agent_;
uint16_t partition_id_;
private:
DISALLOW_COPY_AND_ASSIGN(PktSandeshFlow);
};
class PktSandeshFlowStats : public PktSandeshFlow {
public:
PktSandeshFlowStats(Agent *agent, FlowStatsCollectorRecordsResp *obj, std::string resp_ctx,
std::string key);
virtual ~PktSandeshFlowStats() {}
bool SetProtoKey(std::string key);
virtual bool Run();
bool SetProto(std::string &key);
private:
uint32_t proto_;
uint32_t port_;
FlowStatsCollectorRecordsResp *resp_;
DISALLOW_COPY_AND_ASSIGN(PktSandeshFlowStats);
};
#endif