LCOV - code coverage report
Current view: top level - vnsw/agent/services - icmpv6_error_proto.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 6 8 75.0 %
Date: 2026-08-03 02:19:58 Functions: 3 5 60.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : #ifndef VNSW_AGENT_SERVICES_ICMPV6_ERROR_PROTO_H_
       5             : #define VNSW_AGENT_SERVICES_ICMPV6_ERROR_PROTO_H_
       6             : 
       7             : #include <boost/asio.hpp>
       8             : #include "pkt/proto.h"
       9             : 
      10             : class Icmpv6ErrorProto : public Proto {
      11             :  public:
      12             :     struct Stats {
      13           1 :         Stats() { Reset(); }
      14           1 :         ~Stats() { }
      15           1 :         void Reset() {
      16           1 :             drops = 0;
      17           1 :             interface_errors = 0;
      18           1 :         }
      19             : 
      20             :         uint32_t drops;
      21             :         uint32_t interface_errors;
      22             :     };
      23             : 
      24             :     Icmpv6ErrorProto(Agent *agent, boost::asio::io_context &io);
      25             :     virtual ~Icmpv6ErrorProto();
      26             :     ProtoHandler *AllocProtoHandler(boost::shared_ptr<PktInfo> info,
      27             :                                     boost::asio::io_context &io);
      28             : 
      29           0 :     void increment_drops() { stats_.drops++; }
      30           0 :     void increment_interface_errors() { stats_.interface_errors++; }
      31             :     const Stats &GetStats() const { return stats_; }
      32             :     void ClearStats() { stats_.Reset(); }
      33             : 
      34             :  private:
      35             :     Stats stats_;
      36             :     DISALLOW_COPY_AND_ASSIGN(Icmpv6ErrorProto);
      37             : };
      38             : 
      39             : #endif  // VNSW_AGENT_SERVICES_ICMPV6_ERROR_PROTO_H_

Generated by: LCOV version 1.14