LCOV - code coverage report
Current view: top level - vnsw/agent/services - icmp_proto.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 5 11 45.5 %
Date: 2026-06-18 01:51:13 Functions: 4 10 40.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : 
       5             : #ifndef vnsw_agent_icmp_proto_h_
       6             : #define vnsw_agent_icmp_proto_h_
       7             : 
       8             : #include "pkt/proto.h"
       9             : #include "services/icmp_handler.h"
      10             : 
      11             : class IcmpProto : public Proto {
      12             : public:
      13             :     struct IcmpStats {
      14           6 :         IcmpStats() { Reset(); }
      15          16 :         void Reset() { icmp_gw_ping = icmp_gw_ping_err = icmp_drop =
      16          16 :                         icmp_intf_not_inst = icmp_no_l3fwd = 0; }
      17             : 
      18             :         uint32_t icmp_gw_ping;
      19             :         uint32_t icmp_gw_ping_err;
      20             :         uint32_t icmp_drop;
      21             :         uint32_t icmp_intf_not_inst;
      22             :         uint32_t icmp_no_l3fwd;
      23             :     };
      24             : 
      25           0 :     void Shutdown() {}
      26             :     IcmpProto(Agent *agent, boost::asio::io_context &io);
      27             :     virtual ~IcmpProto();
      28             :     ProtoHandler *AllocProtoHandler(boost::shared_ptr<PktInfo> info,
      29             :                                     boost::asio::io_context &io);
      30             : 
      31           0 :     void IncrStatsGwPing() { stats_.icmp_gw_ping++; }
      32           0 :     void IncrStatsGwPingErr() { stats_.icmp_gw_ping_err++; }
      33           0 :     void IncrStatsDrop() { stats_.icmp_drop++; }
      34           0 :     void IncrStatsIntfNotInst() { stats_.icmp_intf_not_inst++; }
      35           0 :     void IncrStatsNoL3Fwd() { stats_.icmp_no_l3fwd++; }
      36          20 :     const IcmpStats &GetStats() const { return stats_; }
      37          10 :     void ClearStats() { stats_.Reset(); }
      38             : 
      39             : private:
      40             :     IcmpStats stats_;
      41             :     DISALLOW_COPY_AND_ASSIGN(IcmpProto);
      42             : };
      43             : 
      44             : #endif // vnsw_agent_icmp_proto_h_

Generated by: LCOV version 1.14