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