OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
icmp_error_proto.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #include <cmn/agent_cmn.h>
6 #include <init/agent_init.h>
9 
10 IcmpErrorProto::IcmpErrorProto(Agent *agent, boost::asio::io_context &io) :
11  Proto(agent, "Agent::Services", PktHandler::ICMP_ERROR, io) {
12  // limit the number of entries in the workqueue
14  work_queue_.SetBounded(true);
15 }
16 
18 }
19 
20 ProtoHandler *IcmpErrorProto::AllocProtoHandler(boost::shared_ptr<PktInfo> info,
21  boost::asio::io_context &io) {
22  return new IcmpErrorHandler(agent(), this, info, &io);
23 }
24 
25 bool IcmpErrorProto::FlowIndexToKey(uint32_t index, FlowKey *key, bool *is_nat_flow) {
26  if (flow_index_to_key_fn_.empty())
27  return false;
28  return flow_index_to_key_fn_(index, key, is_nat_flow);
29 }
void SetBounded(bool bounded)
Definition: queue_task.h:200
IcmpErrorProto(Agent *agent, boost::asio::io_context &io)
void SetSize(size_t size)
Definition: queue_task.h:196
Definition: agent.h:358
AgentParam * params() const
Definition: agent.h:1218
virtual ~IcmpErrorProto()
uint32_t services_queue_limit()
Definition: agent_param.h:417
ProtoHandler * AllocProtoHandler(boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
FlowIndexToKeyFn flow_index_to_key_fn_
bool FlowIndexToKey(uint32_t index, FlowKey *key, bool *is_nat_flow)