OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
icmp_error_proto.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 #ifndef VNSW_AGENT_SERVICES_ICMP_ERROR_PROTO_H_
5 #define VNSW_AGENT_SERVICES_ICMP_ERROR_PROTO_H_
6 
7 #include <boost/asio.hpp>
8 #include "pkt/proto.h"
9 
10 struct FlowKey;
11 
12 class IcmpErrorProto : public Proto {
13  public:
14  struct Stats {
15  Stats() { Reset(); }
16  ~Stats() { }
17  void Reset() {
18  df_msgs = 0;
19  drops = 0;
20  interface_errors = 0;
22  }
23 
24  uint32_t df_msgs;
25  uint32_t drops;
26  uint32_t interface_errors;
28  };
29  typedef boost::function<bool(uint32_t, FlowKey *, bool *)> FlowIndexToKeyFn;
30 
31  IcmpErrorProto(Agent *agent, boost::asio::io_context &io);
32  virtual ~IcmpErrorProto();
33 
34  void Shutdown() { }
36  bool FlowIndexToKey(uint32_t index, FlowKey *key, bool *is_nat_flow);
37  ProtoHandler *AllocProtoHandler(boost::shared_ptr<PktInfo> info,
38  boost::asio::io_context &io);
39 
44  const Stats &GetStats() const { return stats_; }
45  void ClearStats() { stats_.Reset(); }
46 
47  private:
51 };
52 
53 #endif // VNSW_AGENT_SERVICES_ICMP_ERROR_PROTO_H_
IcmpErrorProto(Agent *agent, boost::asio::io_context &io)
const Stats & GetStats() const
Definition: agent.h:358
virtual ~IcmpErrorProto()
void increment_interface_errors()
DISALLOW_COPY_AND_ASSIGN(IcmpErrorProto)
void Register(FlowIndexToKeyFn fn)
void increment_invalid_flow_index()
ProtoHandler * AllocProtoHandler(boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
FlowIndexToKeyFn flow_index_to_key_fn_
boost::function< bool(uint32_t, FlowKey *, bool *)> FlowIndexToKeyFn
bool FlowIndexToKey(uint32_t index, FlowKey *key, bool *is_nat_flow)
void incrememt_df_msgs()