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