LCOV - code coverage report
Current view: top level - vnsw/agent/uve - flow_uve_stats_request.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 24 25 96.0 %
Date: 2026-08-03 02:19:58 Functions: 13 14 92.9 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : #ifndef __AGENT_FLOW_UVE_STATS_REQUEST_H__
       5             : #define __AGENT_FLOW_UVE_STATS_REQUEST_H__
       6             : 
       7             : #include "pkt/flow_table.h"
       8             : #include "pkt/flow_event.h"
       9             : 
      10             : struct FlowUveFwPolicyInfo {
      11             :     TagList local_tagset_;
      12             :     std::string fw_policy_;
      13             :     TagList remote_tagset_;
      14             :     std::string remote_prefix_;
      15             :     std::string remote_vn_;
      16             :     std::string local_vn_;
      17             :     bool initiator_;
      18             :     bool added_;
      19             :     std::string action_;
      20             :     bool short_flow_;
      21             :     bool is_valid_;
      22         144 :     FlowUveFwPolicyInfo() : is_valid_(false) {}
      23             : };
      24             : 
      25             : struct FlowUveVnAcePolicyInfo {
      26             :     std::string vn_;
      27             :     std::string nw_ace_uuid_;
      28             :     bool is_valid_;
      29         144 :     FlowUveVnAcePolicyInfo() : is_valid_(false) {}
      30             : };
      31             : 
      32             : ////////////////////////////////////////////////////////////////////////////
      33             : // Request to the Uve module for Flow based statistics update
      34             : ////////////////////////////////////////////////////////////////////////////
      35             : class FlowUveStatsRequest {
      36             : public:
      37             :     enum Event {
      38             :         INVALID,
      39             :         ADD_FLOW,
      40             :         DELETE_FLOW
      41             :     };
      42             : 
      43         100 :     FlowUveStatsRequest(Event event, const boost::uuids::uuid &u,
      44             :                         const std::string &intf, const std::string &sg_rule,
      45             :                         const FlowUveVnAcePolicyInfo &vn_ace_info,
      46         100 :                         const FlowUveFwPolicyInfo &fw_policy_info) :
      47         100 :         event_(event), uuid_(u), interface_(intf), sg_rule_uuid_(sg_rule),
      48         100 :         sg_info_valid_(false), vn_ace_info_(vn_ace_info),
      49         100 :         fw_policy_info_(fw_policy_info) {
      50         100 :         if (!intf.empty() && !sg_rule.empty()) {
      51          58 :             sg_info_valid_ = true;
      52             :         }
      53         100 :     }
      54             : 
      55          44 :     FlowUveStatsRequest(Event event, const boost::uuids::uuid &u,
      56             :                         const std::string &intf,
      57          44 :                         const FlowUveFwPolicyInfo &fw_policy_info) :
      58          44 :         event_(event), uuid_(u), interface_(intf), sg_info_valid_(false),
      59          44 :         fw_policy_info_(fw_policy_info) {
      60          44 :     }
      61             : 
      62         144 :     ~FlowUveStatsRequest() { }
      63             : 
      64         144 :     Event event() const { return event_; }
      65         188 :     const boost::uuids::uuid &uuid() const { return uuid_; }
      66         246 :     const std::string &interface() const { return interface_; }
      67         182 :     const std::string &sg_rule_uuid() const { return sg_rule_uuid_; }
      68         168 :     bool sg_info_valid() const { return sg_info_valid_; }
      69         164 :     const FlowUveVnAcePolicyInfo &vn_ace_info() const { return vn_ace_info_; }
      70          42 :     bool vn_ace_valid() const { return vn_ace_info_.is_valid_; }
      71         144 :     const FlowUveFwPolicyInfo &fw_policy_info() const { return fw_policy_info_;}
      72           0 :     bool fw_policy_valid() const { return fw_policy_info_.is_valid_; }
      73             : 
      74             : private:
      75             :     Event event_;
      76             :     boost::uuids::uuid uuid_;
      77             :     std::string interface_;
      78             :     std::string sg_rule_uuid_;
      79             :     bool sg_info_valid_;
      80             :     FlowUveVnAcePolicyInfo vn_ace_info_;
      81             :     FlowUveFwPolicyInfo fw_policy_info_;
      82             : 
      83             :     DISALLOW_COPY_AND_ASSIGN(FlowUveStatsRequest);
      84             : };
      85             : #endif //  __AGENT_FLOW_UVE_STATS_REQUEST_H__

Generated by: LCOV version 1.14