Line data Source code
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: 13 : FlowExportInfo(); 14 : FlowExportInfo(const FlowEntryPtr &fe, uint64_t setup_time); 15 : FlowExportInfo(const FlowEntryPtr &fe); 16 1819 : ~FlowExportInfo() {} 17 : 18 1033 : FlowEntry* flow() const { return flow_.get(); } 19 : FlowEntry* reverse_flow() const; 20 152 : uint64_t teardown_time() const { return teardown_time_; } 21 128 : void set_teardown_time(uint64_t time) { teardown_time_ = time; } 22 8 : uint64_t last_modified_time() const { return last_modified_time_; } 23 0 : void set_last_modified_time(uint64_t time) { last_modified_time_ = time; } 24 : 25 126 : uint64_t bytes() const { return bytes_; } 26 42 : void set_bytes(uint64_t value) { bytes_ = value; } 27 126 : uint64_t packets() const { return packets_; } 28 42 : void set_packets(uint64_t value) { packets_ = value; } 29 : 30 86 : void set_delete_enqueue_time(uint64_t value) { delete_enqueue_time_ = value; } 31 0 : uint64_t delete_enqueue_time() const { return delete_enqueue_time_; } 32 86 : void set_evict_enqueue_time(uint64_t value) { evict_enqueue_time_ = value; } 33 0 : uint64_t evict_enqueue_time() const { return evict_enqueue_time_; } 34 : 35 152 : uint8_t gen_id() const { return gen_id_; } 36 : void set_gen_id(uint8_t value) { gen_id_ = value; } 37 172 : uint32_t flow_handle() const { return flow_handle_; } 38 : void set_flow_handle(uint32_t value) { flow_handle_ = value; } 39 86 : const boost::uuids::uuid &uuid() const { return uuid_; } 40 : void CopyFlowInfo(FlowEntry *fe); 41 : void ResetStats(); 42 : 43 : private: 44 : FlowEntryPtr flow_; 45 : uint64_t teardown_time_; 46 : uint64_t last_modified_time_; //used for aging 47 : uint64_t bytes_; 48 : uint64_t packets_; 49 : uint64_t delete_enqueue_time_; 50 : uint64_t evict_enqueue_time_; 51 : uint8_t gen_id_; 52 : uint32_t flow_handle_; 53 : boost::uuids::uuid uuid_; 54 : }; 55 : 56 : typedef boost::intrusive::list<FlowExportInfo> FlowExportInfoList; 57 : #endif // __AGENT_FLOW_EXPORT_INFO_H__