OpenSDN source code
flow_export_info.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 #ifndef __AGENT_FLOW_EXPORT_INFO_H__
6 #define __AGENT_FLOW_EXPORT_INFO_H__
7 
8 #include <pkt/flow_entry.h>
9 #include <filter/acl.h>
10 
11 class FlowExportInfo : public boost::intrusive::list_base_hook<> {
12 public:
14  FlowExportInfo(const FlowEntryPtr &fe, uint64_t setup_time);
15  FlowExportInfo(const FlowEntryPtr &fe);
17 
18  FlowEntry* flow() const { return flow_.get(); }
19  FlowEntry* reverse_flow() const;
20  uint64_t teardown_time() const { return teardown_time_; }
21  void set_teardown_time(uint64_t time) { teardown_time_ = time; }
22  uint64_t last_modified_time() const { return last_modified_time_; }
23  void set_last_modified_time(uint64_t time) { last_modified_time_ = time; }
24 
25  uint64_t bytes() const { return bytes_; }
26  void set_bytes(uint64_t value) { bytes_ = value; }
27  uint64_t packets() const { return packets_; }
28  void set_packets(uint64_t value) { packets_ = value; }
29 
30  void set_delete_enqueue_time(uint64_t value) { delete_enqueue_time_ = value; }
31  uint64_t delete_enqueue_time() const { return delete_enqueue_time_; }
32  void set_evict_enqueue_time(uint64_t value) { evict_enqueue_time_ = value; }
33  uint64_t evict_enqueue_time() const { return evict_enqueue_time_; }
34 
35  uint8_t gen_id() const { return gen_id_; }
36  void set_gen_id(uint8_t value) { gen_id_ = value; }
37  uint32_t flow_handle() const { return flow_handle_; }
38  void set_flow_handle(uint32_t value) { flow_handle_ = value; }
39  const boost::uuids::uuid &uuid() const { return uuid_; }
40  void CopyFlowInfo(FlowEntry *fe);
41  void ResetStats();
42 
43 private:
45  uint64_t teardown_time_;
46  uint64_t last_modified_time_; //used for aging
47  uint64_t bytes_;
48  uint64_t packets_;
51  uint8_t gen_id_;
52  uint32_t flow_handle_;
54 };
55 
56 typedef boost::intrusive::list<FlowExportInfo> FlowExportInfoList;
57 #endif // __AGENT_FLOW_EXPORT_INFO_H__
boost::uuids::uuid uuid_
void set_teardown_time(uint64_t time)
uint64_t evict_enqueue_time_
uint64_t delete_enqueue_time_
const boost::uuids::uuid & uuid() const
void set_last_modified_time(uint64_t time)
uint64_t delete_enqueue_time() const
FlowEntryPtr flow_
void set_gen_id(uint8_t value)
FlowEntry * reverse_flow() const
FlowEntry * flow() const
void set_delete_enqueue_time(uint64_t value)
uint64_t last_modified_time_
uint8_t gen_id() const
uint32_t flow_handle() const
void CopyFlowInfo(FlowEntry *fe)
uint64_t last_modified_time() const
uint64_t evict_enqueue_time() const
uint64_t packets() const
uint64_t teardown_time() const
void set_packets(uint64_t value)
void set_evict_enqueue_time(uint64_t value)
void set_flow_handle(uint32_t value)
uint64_t teardown_time_
uint64_t bytes() const
uint32_t flow_handle_
void set_bytes(uint64_t value)
boost::intrusive_ptr< FlowEntry > FlowEntryPtr
Definition: flow_entry.h:126
boost::intrusive::list< FlowExportInfo > FlowExportInfoList
boost::uuids::uuid uuid