OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dhcpv6_proto.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #include "cmn/agent_cmn.h"
6 #include "init/agent_init.h"
8 #include "services/services_types.h"
10 #include "pkt/pkt_init.h"
11 
12 using namespace boost::asio;
13 using boost::asio::ip::udp;
14 
15 Dhcpv6Proto::Dhcpv6Proto(Agent *agent, boost::asio::io_context &io,
16  bool run_with_vrouter) :
17  Proto(agent, "Agent::Services", PktHandler::DHCPV6, io),
18  run_with_vrouter_(run_with_vrouter) {
19  // limit the number of entries in the workqueue
21  work_queue_.SetBounded(true);
22 
23  // server duid based on vrrp mac
26  agent->vrrp_mac().ToArray(server_duid_.mac, sizeof(server_duid_.mac));
27 }
28 
30 }
31 
32 ProtoHandler *Dhcpv6Proto::AllocProtoHandler(boost::shared_ptr<PktInfo> info,
33  boost::asio::io_context &io) {
34  return new Dhcpv6Handler(agent(), info, io);
35 }
36 
38 }
void SetBounded(bool bounded)
Definition: queue_task.h:200
uint8_t mac[ETHER_ADDR_LEN]
Definition: dhcpv6_proto.h:29
bool ToArray(u_int8_t *p, size_t s) const
Definition: mac_address.cc:93
static const MacAddress & vrrp_mac()
Definition: agent.h:439
#define DHCPV6_DUID_TYPE_LL
Definition: dhcpv6_proto.h:21
void SetSize(size_t size)
Definition: queue_task.h:196
Definition: agent.h:358
AgentParam * params() const
Definition: agent.h:1218
void Shutdown()
Definition: dhcpv6_proto.cc:37
uint32_t services_queue_limit()
Definition: agent_param.h:417
Duid server_duid_
Definition: dhcpv6_proto.h:81
Dhcpv6Proto(Agent *agent, boost::asio::io_context &io, bool run_with_vrouter)
Definition: dhcpv6_proto.cc:15
ProtoHandler * AllocProtoHandler(boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
Definition: dhcpv6_proto.cc:32
virtual ~Dhcpv6Proto()
Definition: dhcpv6_proto.cc:29