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 7 : IcmpStats() { Reset(); } 15 17 : void Reset() { icmp_gw_ping = icmp_gw_ping_err = icmp_drop = 16 17 : 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 1 : 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_