| Kea 3.0.2-git

dhcp6_srv.h
Go to the documentation of this file.
1// Copyright (C) 2011-2025 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef DHCPV6_SRV_H
8#define DHCPV6_SRV_H
9
10#include <asiolink/io_service.h>
11#include <dhcp/dhcp6.h>
12#include <dhcp/duid.h>
13#include <dhcp/option.h>
14#include <dhcp/option_string.h>
15#include <dhcp/option6_client_fqdn.h>
16#include <dhcp/option6_ia.h>
17#include <dhcp/option_custom.h>
18#include <dhcp/option_definition.h>
19#include <dhcp_ddns/ncr_msg.h>
20#include <dhcp/pkt6.h>
21#include <dhcpsrv/alloc_engine.h>
22#include <dhcpsrv/callout_handle_store.h>
23#include <dhcpsrv/cb_ctl_dhcp6.h>
24#include <dhcpsrv/cfg_option.h>
25#include <dhcpsrv/d2_client_mgr.h>
26#include <dhcpsrv/network_state.h>
27#include <dhcpsrv/subnet.h>
28#include <hooks/callout_handle.h>
29#include <process/daemon.h>
30
31#include <functional>
32#include <iostream>
33#include <queue>
34
35// Undefine the macro OPTIONAL which is defined in some operating
36// systems but conflicts with a member of the RequirementLevel enum in
37// the server class.
38
39#ifdef OPTIONAL
40#undef OPTIONAL
41#endif
42
43 namespace isc {
44 namespace dhcp {
45
48 class DHCPv6DiscardMessageError : public Exception {
49 public:
50 DHCPv6DiscardMessageError(const char* file, size_t line, const char* what) :
51 isc::Exception(file, line, what) { }
52};
53
66 class Dhcpv6Srv : public process::Daemon {
67 private:
68
70 asiolink::IOServicePtr io_service_;
71
72 public:
74 typedef enum {
75 FORBIDDEN,
76 MANDATORY,
77 OPTIONAL
78 } RequirementLevel;
79
81 static const size_t MIN_MAC_LEN = 6;
82
95 Dhcpv6Srv(uint16_t server_port = DHCP6_SERVER_PORT,
96 uint16_t client_port = 0);
97
99 virtual ~Dhcpv6Srv();
100
105 bool inTestMode() const {
106 return (server_port_ == 0);
107 }
108
110 asiolink::IOServicePtr& getIOService() {
111 return (io_service_);
112 }
113
115 NetworkStatePtr& getNetworkState() {
116 return (network_state_);
117 }
118
124 CBControlDHCPv6Ptr getCBControl() const {
125 return (cb_control_);
126 }
127
130 static std::string getVersion(bool extended);
131
135 OptionPtr getServerID() { return serverid_; }
136
143 int run();
144
150 void runOne();
151
158 void processPacketAndSendResponse(Pkt6Ptr query);
159
166 void processPacketAndSendResponseNoThrow(Pkt6Ptr query);
167
174 void sendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
175 Pkt6Ptr query, Pkt6Ptr& rsp,
176 ConstSubnet6Ptr& subnet);
177
185 Pkt6Ptr processPacket(Pkt6Ptr query);
186
194 Pkt6Ptr processDhcp6Query(Pkt6Ptr query);
195
202 void processDhcp6QueryAndSendResponse(Pkt6Ptr query);
203
210 Pkt6Ptr processLocalizedQuery6(AllocEngine::ClientContext6& ctx);
211
219 void processLocalizedQuery6AndSendResponse(Pkt6Ptr query,
220 AllocEngine::ClientContext6& ctx);
221
228 void processLocalizedQuery6AndSendResponse(Pkt6Ptr query);
229
231 void shutdown() override;
232
236
237
244 uint16_t getServerPort() const;
246
252 void startD2();
253
259 void stopD2();
260
275 virtual void d2ClientErrorHandler(const dhcp_ddns::
276 NameChangeSender::Result result,
277 dhcp_ddns::NameChangeRequestPtr& ncr);
278
282 void discardPackets();
283
288 void initContext0(const Pkt6Ptr& query,
289 AllocEngine::ClientContext6& ctx);
290
298 bool earlyGHRLookup(const Pkt6Ptr& query,
299 AllocEngine::ClientContext6& ctx);
300
309 static void setHostIdentifiers(AllocEngine::ClientContext6& ctx);
310
311 protected:
312
319 void setPacketStatisticsDefaults();
320
329 bool testServerID(const Pkt6Ptr& pkt);
330
341 bool testUnicast(const Pkt6Ptr& pkt) const;
342
351 bool sanityCheck(const Pkt6Ptr& pkt);
352
362 void sanityCheck(const Pkt6Ptr& pkt, RequirementLevel clientid,
363 RequirementLevel serverid);
364
370 void sanityCheckDUID(const OptionPtr& opt, const std::string& opt_name);
371
386 Pkt6Ptr processSolicit(AllocEngine::ClientContext6& ctx);
387
399 Pkt6Ptr processRequest(AllocEngine::ClientContext6& ctx);
400
406 Pkt6Ptr processRenew(AllocEngine::ClientContext6& ctx);
407
419 Pkt6Ptr processRebind(AllocEngine::ClientContext6& ctx);
420
444 Pkt6Ptr processConfirm(AllocEngine::ClientContext6& ctx);
445
451 Pkt6Ptr processRelease(AllocEngine::ClientContext6& ctx);
452
463 Pkt6Ptr processDecline(AllocEngine::ClientContext6& ctx);
464
470 Pkt6Ptr processInfRequest(AllocEngine::ClientContext6& ctx);
471
481 void processDhcp4Query(const Pkt6Ptr& dhcp4_query);
482
488 Pkt6Ptr processAddrRegInform(AllocEngine::ClientContext6& ctx);
489
495 isc::dhcp::ConstSubnet6Ptr selectSubnet(const Pkt6Ptr& question, bool& drop);
496
511 OptionPtr assignIA_NA(const isc::dhcp::Pkt6Ptr& query,
512 AllocEngine::ClientContext6& ctx,
513 Option6IAPtr ia);
514
527 OptionPtr assignIA_PD(const Pkt6Ptr& query,
528 AllocEngine::ClientContext6& ctx,
529 boost::shared_ptr<Option6IA> ia);
530
544 OptionPtr extendIA_NA(const Pkt6Ptr& query,
545 AllocEngine::ClientContext6& ctx,
546 Option6IAPtr ia);
547
601 OptionPtr extendIA_PD(const Pkt6Ptr& query,
602 AllocEngine::ClientContext6& ctx,
603 Option6IAPtr ia);
604
623 OptionPtr releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
624 int& general_status,
625 boost::shared_ptr<Option6IA> ia,
626 Lease6Ptr& old_lease);
627
641 OptionPtr releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
642 int& general_status,
643 boost::shared_ptr<Option6IA> ia,
644 Lease6Ptr& old_lease);
645
655 void copyClientOptions(const Pkt6Ptr& question, Pkt6Ptr& answer);
656
665 void buildCfgOptionList(const Pkt6Ptr& question,
666 AllocEngine::ClientContext6& ctx,
667 CfgOptionList& co_list);
668
678 void appendDefaultOptions(const Pkt6Ptr& question, Pkt6Ptr& answer,
679 const CfgOptionList& co_list);
680
689 void appendRequestedOptions(const Pkt6Ptr& question, Pkt6Ptr& answer,
690 const CfgOptionList& co_list);
691
701 void appendRequestedVendorOptions(const Pkt6Ptr& question, Pkt6Ptr& answer,
702 AllocEngine::ClientContext6& ctx,
703 const CfgOptionList& co_list);
704
715 void assignLeases(const Pkt6Ptr& question, Pkt6Ptr& answer,
716 AllocEngine::ClientContext6& ctx);
717
762 void processClientFqdn(const Pkt6Ptr& question, const Pkt6Ptr& answer,
763 AllocEngine::ClientContext6& ctx);
764
784 void createNameChangeRequests(const Pkt6Ptr& answer,
785 AllocEngine::ClientContext6& ctx);
786
798 void extendLeases(const Pkt6Ptr& query, Pkt6Ptr& reply,
799 AllocEngine::ClientContext6& ctx);
800
826 void setTeeTimes(uint32_t preferred_lft,
827 const ConstSubnet6Ptr& subnet,
828 Option6IAPtr& resp);
829
840 void releaseLeases(const Pkt6Ptr& release, Pkt6Ptr& reply,
841 AllocEngine::ClientContext6& ctx);
842
849 static std::string duidToString(const OptionPtr& opt);
850
855 virtual Pkt6Ptr receivePacket(int timeout);
856
861 virtual void sendPacket(const Pkt6Ptr& pkt);
862
873 void classifyPacket(const Pkt6Ptr& pkt);
874
885 void evaluateClasses(const Pkt6Ptr& pkt, bool depend_on_known);
886
893 static void removeDependentEvaluatedClasses(const Pkt6Ptr& pkt);
894
899 void setReservedClientClasses(const Pkt6Ptr& pkt,
900 const AllocEngine::ClientContext6& ctx);
901
912 void conditionallySetReservedClientClasses(const Pkt6Ptr& pkt,
913 const AllocEngine::ClientContext6& ctx);
914
932 void evaluateAdditionalClasses(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx);
933
941 static HWAddrPtr getMAC(const Pkt6Ptr& pkt);
942
951 void processRSOO(const Pkt6Ptr& query, const Pkt6Ptr& rsp);
952
971 void initContext(AllocEngine::ClientContext6& ctx, bool& drop);
972
979 static const std::string VENDOR_CLASS_PREFIX;
980
991 bool declineLeases(const Pkt6Ptr& decline, Pkt6Ptr& reply,
992 AllocEngine::ClientContext6& ctx);
993
1007 OptionPtr
1008 declineIA(const Pkt6Ptr& decline, const DuidPtr& duid, int& general_status,
1009 boost::shared_ptr<Option6IA> ia, Lease6Collection& new_leases);
1010
1027 bool declineLease(const Pkt6Ptr& decline, const Lease6Ptr lease,
1028 boost::shared_ptr<Option6IA> ia_rsp);
1029
1035 void setStatusCode(boost::shared_ptr<Option6IA>& container,
1036 const OptionPtr& status);
1037
1072 //
1073 void checkPostAssignmentChanges(const Pkt6Ptr& question, Pkt6Ptr& answer,
1074 AllocEngine::ClientContext6& ctx,
1075 const ConstSubnet6Ptr orig_subnet);
1076
1082 OptionPtr getPDExclude(const AllocEngine::ClientContext6& ctx,
1083 const Lease6Ptr& lease);
1084
1085 public:
1086
1088
1093 static uint16_t checkRelaySourcePort(const Pkt6Ptr& query);
1094
1095 private:
1096
1102 void classifyByVendor(const Pkt6Ptr& pkt);
1103
1120 void updateReservedFqdn(AllocEngine::ClientContext6& ctx,
1121 const Pkt6Ptr& answer);
1122
1165 void generateFqdn(const Pkt6Ptr& answer,
1166 AllocEngine::ClientContext6& ctx);
1167
1170 static void processStatsReceived(const Pkt6Ptr& query);
1171
1179 bool requestedInORO(const Pkt6Ptr& query, const uint16_t code) const;
1180
1187 static std::tuple<bool, uint32_t> parkingLimitExceeded(std::string const& hook_label);
1188
1189 protected:
1191 uint16_t server_port_;
1192
1194 uint16_t client_port_;
1195
1196 public:
1197
1199
1202 static void processStatsSent(const Pkt6Ptr& response);
1203
1206 static int getHookIndexBuffer6Send();
1207
1212 void processPacketBufferSend(hooks::CalloutHandlePtr& callout_handle,
1213 Pkt6Ptr& rsp);
1214
1220 std::list<std::list<std::string>> jsonPathsToRedact() const final override;
1221
1222protected:
1223
1225 OptionPtr serverid_;
1226
1229 volatile bool shutdown_;
1230
1237 void processPacketPktSend(hooks::CalloutHandlePtr& callout_handle,
1238 Pkt6Ptr& query, Pkt6Ptr& rsp,
1239 ConstSubnet6Ptr& subnet);
1240
1245 boost::shared_ptr<AllocEngine> alloc_engine_;
1246
1249 std::queue<isc::dhcp_ddns::NameChangeRequest> name_change_reqs_;
1250
1253 NetworkStatePtr network_state_;
1254
1256 CBControlDHCPv6Ptr cb_control_;
1257};
1258
1259} // namespace dhcp
1260} // namespace isc
1261
1262#endif // DHCP6_SRV_H
alloc_engine.h
callout_handle.h
callout_handle_store.h
cb_ctl_dhcp6.h
cfg_option.h
isc::Exception::Exception
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
Definition exceptions/exceptions.cc:17
isc::Exception::what
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Definition exceptions/exceptions.cc:32
isc::dhcp::AllocEngine
DHCPv4 and DHCPv6 allocation engine.
Definition alloc_engine.h:47
isc::dhcp::DHCPv6DiscardMessageError::DHCPv6DiscardMessageError
DHCPv6DiscardMessageError(const char *file, size_t line, const char *what)
Definition dhcp6_srv.h:50
isc::dhcp::Dhcpv6Srv::name_change_reqs_
std::queue< isc::dhcp_ddns::NameChangeRequest > name_change_reqs_
Holds a list of isc::dhcp_ddns::NameChangeRequest objects, which are waiting for sending to kea-dhcp-...
Definition dhcp6_srv.h:1249
isc::dhcp::Dhcpv6Srv::shutdown
void shutdown() override
Instructs the server to shut down.
Definition dhcp6_srv.cc:361
isc::dhcp::Dhcpv6Srv::RequirementLevel
RequirementLevel
defines if certain option may, must or must not appear
Definition dhcp6_srv.h:74
isc::dhcp::Dhcpv6Srv::OPTIONAL
@ OPTIONAL
Definition dhcp6_srv.h:77
isc::dhcp::Dhcpv6Srv::MANDATORY
@ MANDATORY
Definition dhcp6_srv.h:76
isc::dhcp::Dhcpv6Srv::FORBIDDEN
@ FORBIDDEN
Definition dhcp6_srv.h:75
isc::dhcp::Dhcpv6Srv::getServerID
OptionPtr getServerID()
Returns server-identifier option.
Definition dhcp6_srv.h:135
isc::dhcp::Dhcpv6Srv::processPacket
Pkt6Ptr processPacket(Pkt6Ptr query)
Process a single incoming DHCPv6 packet.
Definition dhcp6_srv.cc:809
isc::dhcp::Dhcpv6Srv::processLocalizedQuery6
Pkt6Ptr processLocalizedQuery6(AllocEngine::ClientContext6 &ctx)
Process a localized incoming DHCPv6 query.
Definition dhcp6_srv.cc:1115
isc::dhcp::Dhcpv6Srv::processPacketAndSendResponseNoThrow
void processPacketAndSendResponseNoThrow(Pkt6Ptr query)
Process a single incoming DHCPv6 packet and sends the response.
Definition dhcp6_srv.cc:784
isc::dhcp::Dhcpv6Srv::extendIA_PD
OptionPtr extendIA_PD(const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
Extends lifetime of the prefix.
Definition dhcp6_srv.cc:3062
isc::dhcp::Dhcpv6Srv::setReservedClientClasses
void setReservedClientClasses(const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
Assigns classes retrieved from host reservation database.
Definition dhcp6_srv.cc:4806
isc::dhcp::Dhcpv6Srv::processDecline
Pkt6Ptr processDecline(AllocEngine::ClientContext6 &ctx)
Process incoming Decline message.
Definition dhcp6_srv.cc:4107
isc::dhcp::Dhcpv6Srv::evaluateClasses
void evaluateClasses(const Pkt6Ptr &pkt, bool depend_on_known)
Evaluate classes.
Definition dhcp6_srv.cc:4766
isc::dhcp::Dhcpv6Srv::processRenew
Pkt6Ptr processRenew(AllocEngine::ClientContext6 &ctx)
Processes incoming Renew message.
Definition dhcp6_srv.cc:3901
isc::dhcp::Dhcpv6Srv::processStatsSent
static void processStatsSent(const Pkt6Ptr &response)
Updates statistics for transmitted packets.
Definition dhcp6_srv.cc:5220
isc::dhcp::Dhcpv6Srv::evaluateAdditionalClasses
void evaluateAdditionalClasses(const Pkt6Ptr &pkt, AllocEngine::ClientContext6 &ctx)
Evaluates classes in the additional classes lists.
Definition dhcp6_srv.cc:4832
isc::dhcp::Dhcpv6Srv::processLocalizedQuery6AndSendResponse
void processLocalizedQuery6AndSendResponse(Pkt6Ptr query, AllocEngine::ClientContext6 &ctx)
Process a localized incoming DHCPv6 query.
Definition dhcp6_srv.cc:1077
isc::dhcp::Dhcpv6Srv::run
int run()
Main server processing loop.
Definition dhcp6_srv.cc:649
isc::dhcp::Dhcpv6Srv::setPacketStatisticsDefaults
void setPacketStatisticsDefaults()
This function sets statistics related to DHCPv6 packets processing to their initial values.
Definition dhcp6_srv.cc:307
isc::dhcp::Dhcpv6Srv::sanityCheck
bool sanityCheck(const Pkt6Ptr &pkt)
Verifies if specified packet meets RFC requirements.
Definition dhcp6_srv.cc:1986
isc::dhcp::Dhcpv6Srv::checkRelaySourcePort
static uint16_t checkRelaySourcePort(const Pkt6Ptr &query)
Used for DHCPv4-over-DHCPv6 too.
Definition dhcp6_srv.cc:5142
isc::dhcp::Dhcpv6Srv::assignLeases
void assignLeases(const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Assigns leases.
Definition dhcp6_srv.cc:2227
isc::dhcp::Dhcpv6Srv::stopD2
void stopD2()
Stops DHCP_DDNS client IO if DDNS updates are enabled.
Definition dhcp6_srv.cc:5050
isc::dhcp::Dhcpv6Srv::copyClientOptions
void copyClientOptions(const Pkt6Ptr &question, Pkt6Ptr &answer)
Copies required options from client message to server answer.
Definition dhcp6_srv.cc:1566
isc::dhcp::Dhcpv6Srv::alloc_engine_
boost::shared_ptr< AllocEngine > alloc_engine_
Allocation Engine.
Definition dhcp6_srv.h:1245
isc::dhcp::Dhcpv6Srv::sendPacket
virtual void sendPacket(const Pkt6Ptr &pkt)
dummy wrapper around IfaceMgr::send()
Definition dhcp6_srv.cc:370
isc::dhcp::Dhcpv6Srv::testServerID
bool testServerID(const Pkt6Ptr &pkt)
Compare received server id with our server id.
Definition dhcp6_srv.cc:375
isc::dhcp::Dhcpv6Srv::d2ClientErrorHandler
virtual void d2ClientErrorHandler(const dhcp_ddns::NameChangeSender::Result result, dhcp_ddns::NameChangeRequestPtr &ncr)
Implements the error handler for DHCP_DDNS IO errors.
Definition dhcp6_srv.cc:5060
isc::dhcp::Dhcpv6Srv::declineIA
OptionPtr declineIA(const Pkt6Ptr &decline, const DuidPtr &duid, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Collection &new_leases)
Declines leases in a single IA_NA option.
Definition dhcp6_srv.cc:4185
isc::dhcp::Dhcpv6Srv::getServerPort
uint16_t getServerPort() const
Get UDP port on which server should listen.
Definition dhcp6_srv.cc:5291
isc::dhcp::Dhcpv6Srv::runOne
void runOne()
Main server processing step.
Definition dhcp6_srv.cc:706
isc::dhcp::Dhcpv6Srv::receivePacket
virtual Pkt6Ptr receivePacket(int timeout)
dummy wrapper around IfaceMgr::receive6
Definition dhcp6_srv.cc:366
isc::dhcp::Dhcpv6Srv::processPacketBufferSend
void processPacketBufferSend(hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &rsp)
Executes buffer6_send callout and sends the response.
Definition dhcp6_srv.cc:1475
isc::dhcp::Dhcpv6Srv::releaseIA_NA
OptionPtr releaseIA_NA(const DuidPtr &duid, const Pkt6Ptr &query, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Ptr &old_lease)
Releases specific IA_NA option.
Definition dhcp6_srv.cc:3363
isc::dhcp::Dhcpv6Srv::buildCfgOptionList
void buildCfgOptionList(const Pkt6Ptr &question, AllocEngine::ClientContext6 &ctx, CfgOptionList &co_list)
Build the configured option list.
Definition dhcp6_srv.cc:1589
isc::dhcp::Dhcpv6Srv::appendDefaultOptions
void appendDefaultOptions(const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
Appends default options to server's answer.
Definition dhcp6_srv.cc:1582
isc::dhcp::Dhcpv6Srv::assignIA_NA
OptionPtr assignIA_NA(const isc::dhcp::Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
Processes IA_NA option (and assigns addresses if necessary).
Definition dhcp6_srv.cc:2607
isc::dhcp::Dhcpv6Srv::VENDOR_CLASS_PREFIX
static const std::string VENDOR_CLASS_PREFIX
this is a prefix added to the content of vendor-class option
Definition dhcp6_srv.h:979
isc::dhcp::Dhcpv6Srv::serverid_
OptionPtr serverid_
Server DUID (to be sent in server-identifier option).
Definition dhcp6_srv.h:1225
isc::dhcp::Dhcpv6Srv::setTeeTimes
void setTeeTimes(uint32_t preferred_lft, const ConstSubnet6Ptr &subnet, Option6IAPtr &resp)
Sets the T1 and T2 timers in the outbound IA.
Definition dhcp6_srv.cc:5328
isc::dhcp::Dhcpv6Srv::conditionallySetReservedClientClasses
void conditionallySetReservedClientClasses(const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
Assigns classes retrieved from host reservation database if they haven't been yet set.
Definition dhcp6_srv.cc:4817
isc::dhcp::Dhcpv6Srv::processPacketAndSendResponse
void processPacketAndSendResponse(Pkt6Ptr query)
Process a single incoming DHCPv6 packet and sends the response.
Definition dhcp6_srv.cc:798
isc::dhcp::Dhcpv6Srv::releaseIA_PD
OptionPtr releaseIA_PD(const DuidPtr &duid, const Pkt6Ptr &query, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Ptr &old_lease)
Releases specific IA_PD option.
Definition dhcp6_srv.cc:3580
isc::dhcp::Dhcpv6Srv::processDhcp4Query
void processDhcp4Query(const Pkt6Ptr &dhcp4_query)
Processes incoming DHCPv4-query message.
Definition dhcp6_srv.cc:4465
isc::dhcp::Dhcpv6Srv::processRebind
Pkt6Ptr processRebind(AllocEngine::ClientContext6 &ctx)
Processes incoming Rebind message.
Definition dhcp6_srv.cc:3941
isc::dhcp::Dhcpv6Srv::earlyGHRLookup
bool earlyGHRLookup(const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx)
Initialize client context and perform early global reservations lookup.
Definition dhcp6_srv.cc:493
isc::dhcp::Dhcpv6Srv::initContext0
void initContext0(const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx)
Initialize client context (first part).
Definition dhcp6_srv.cc:480
isc::dhcp::Dhcpv6Srv::MIN_MAC_LEN
static const size_t MIN_MAC_LEN
Minimum length of a MAC address to be used in DUID generation.
Definition dhcp6_srv.h:81
isc::dhcp::Dhcpv6Srv::getNetworkState
NetworkStatePtr & getNetworkState()
Returns pointer to the network state used by the server.
Definition dhcp6_srv.h:115
isc::dhcp::Dhcpv6Srv::~Dhcpv6Srv
virtual ~Dhcpv6Srv()
Destructor. Used during DHCPv6 service shutdown.
Definition dhcp6_srv.cc:317
isc::dhcp::Dhcpv6Srv::initContext
void initContext(AllocEngine::ClientContext6 &ctx, bool &drop)
Initializes client context for specified packet.
Definition dhcp6_srv.cc:557
isc::dhcp::Dhcpv6Srv::processRequest
Pkt6Ptr processRequest(AllocEngine::ClientContext6 &ctx)
Processes incoming Request and returns Reply response.
Definition dhcp6_srv.cc:3861
isc::dhcp::Dhcpv6Srv::sendResponseNoThrow
void sendResponseNoThrow(hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr query, Pkt6Ptr &rsp, ConstSubnet6Ptr &subnet)
Process an unparked DHCPv6 packet and sends the response.
Definition dhcp6_srv.cc:1385
isc::dhcp::Dhcpv6Srv::network_state_
NetworkStatePtr network_state_
Holds information about disabled DHCP service and/or disabled subnet/network scopes.
Definition dhcp6_srv.h:1253
isc::dhcp::Dhcpv6Srv::jsonPathsToRedact
std::list< std::list< std::string > > jsonPathsToRedact() const final override
Return a list of all paths that contain passwords or secrets for kea-dhcp6.
Definition dhcp6_srv.cc:5435
isc::dhcp::Dhcpv6Srv::getCBControl
CBControlDHCPv6Ptr getCBControl() const
Returns an object which controls access to the configuration backends.
Definition dhcp6_srv.h:124
isc::dhcp::Dhcpv6Srv::assignIA_PD
OptionPtr assignIA_PD(const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, boost::shared_ptr< Option6IA > ia)
Processes IA_PD option (and assigns prefixes if necessary).
Definition dhcp6_srv.cc:2749
isc::dhcp::Dhcpv6Srv::testUnicast
bool testUnicast(const Pkt6Ptr &pkt) const
Check if the message can be sent to unicast.
Definition dhcp6_srv.cc:397
isc::dhcp::Dhcpv6Srv::processRelease
Pkt6Ptr processRelease(AllocEngine::ClientContext6 &ctx)
Process incoming Release message.
Definition dhcp6_srv.cc:4075
isc::dhcp::Dhcpv6Srv::processClientFqdn
void processClientFqdn(const Pkt6Ptr &question, const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Processes Client FQDN Option.
Definition dhcp6_srv.cc:2277
isc::dhcp::Dhcpv6Srv::setStatusCode
void setStatusCode(boost::shared_ptr< Option6IA > &container, const OptionPtr &status)
A simple utility method that sets the status code.
Definition dhcp6_srv.cc:4309
isc::dhcp::Dhcpv6Srv::getHookIndexBuffer6Send
static int getHookIndexBuffer6Send()
Returns the index of the buffer6_send hook.
Definition dhcp6_srv.cc:5247
isc::dhcp::Dhcpv6Srv::classifyPacket
void classifyPacket(const Pkt6Ptr &pkt)
Assigns incoming packet to zero or more classes.
Definition dhcp6_srv.cc:4755
isc::dhcp::Dhcpv6Srv::getMAC
static HWAddrPtr getMAC(const Pkt6Ptr &pkt)
Attempts to get a MAC/hardware address using configured sources.
Definition dhcp6_srv.cc:2567
isc::dhcp::Dhcpv6Srv::Dhcpv6Srv
Dhcpv6Srv(uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
Default constructor.
Definition dhcp6_srv.cc:262
isc::dhcp::Dhcpv6Srv::declineLeases
bool declineLeases(const Pkt6Ptr &decline, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
Attempts to decline all leases in specified Decline message.
Definition dhcp6_srv.cc:4143
isc::dhcp::Dhcpv6Srv::releaseLeases
void releaseLeases(const Pkt6Ptr &release, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
Attempts to release received addresses.
Definition dhcp6_srv.cc:3305
isc::dhcp::Dhcpv6Srv::extendLeases
void extendLeases(const Pkt6Ptr &query, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
Attempts to extend the lifetime of IAs.
Definition dhcp6_srv.cc:3257
isc::dhcp::Dhcpv6Srv::processRSOO
void processRSOO(const Pkt6Ptr &query, const Pkt6Ptr &rsp)
Processes Relay-supplied options, if present.
Definition dhcp6_srv.cc:5109
isc::dhcp::Dhcpv6Srv::getVersion
static std::string getVersion(bool extended)
returns Kea version on stdout and exit.
Definition dhcp6_srv.cc:5072
isc::dhcp::Dhcpv6Srv::processAddrRegInform
Pkt6Ptr processAddrRegInform(AllocEngine::ClientContext6 &ctx)
Processes incoming Addr-reg-inform message.
Definition dhcp6_srv.cc:4488
isc::dhcp::Dhcpv6Srv::extendIA_NA
OptionPtr extendIA_NA(const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
Extends lifetime of the specific IA_NA option.
Definition dhcp6_srv.cc:2898
isc::dhcp::Dhcpv6Srv::processConfirm
Pkt6Ptr processConfirm(AllocEngine::ClientContext6 &ctx)
Processes incoming Confirm message and returns Reply.
Definition dhcp6_srv.cc:3981
isc::dhcp::Dhcpv6Srv::sanityCheckDUID
void sanityCheckDUID(const OptionPtr &opt, const std::string &opt_name)
verifies if received DUID option (client-id or server-id) is sane
Definition dhcp6_srv.cc:2087
isc::dhcp::Dhcpv6Srv::setHostIdentifiers
static void setHostIdentifiers(AllocEngine::ClientContext6 &ctx)
Set host identifiers within a context.
Definition dhcp6_srv.cc:418
isc::dhcp::Dhcpv6Srv::processPacketPktSend
void processPacketPktSend(hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &query, Pkt6Ptr &rsp, ConstSubnet6Ptr &subnet)
Executes pkt6_send callout.
Definition dhcp6_srv.cc:1402
isc::dhcp::Dhcpv6Srv::processDhcp6Query
Pkt6Ptr processDhcp6Query(Pkt6Ptr query)
Process a single incoming DHCPv6 query.
Definition dhcp6_srv.cc:1030
isc::dhcp::Dhcpv6Srv::processDhcp6QueryAndSendResponse
void processDhcp6QueryAndSendResponse(Pkt6Ptr query)
Process a single incoming DHCPv6 query.
Definition dhcp6_srv.cc:1010
isc::dhcp::Dhcpv6Srv::getIOService
asiolink::IOServicePtr & getIOService()
Returns pointer to the IO service used by the server.
Definition dhcp6_srv.h:110
isc::dhcp::Dhcpv6Srv::appendRequestedOptions
void appendRequestedOptions(const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
Appends requested options to server's answer.
Definition dhcp6_srv.cc:1656
isc::dhcp::Dhcpv6Srv::client_port_
uint16_t client_port_
UDP port number to which server sends all responses.
Definition dhcp6_srv.h:1194
isc::dhcp::Dhcpv6Srv::cb_control_
CBControlDHCPv6Ptr cb_control_
Controls access to the configuration backends.
Definition dhcp6_srv.h:1256
isc::dhcp::Dhcpv6Srv::selectSubnet
isc::dhcp::ConstSubnet6Ptr selectSubnet(const Pkt6Ptr &question, bool &drop)
Selects a subnet for a given client's packet.
Definition dhcp6_srv.cc:2103
isc::dhcp::Dhcpv6Srv::shutdown_
volatile bool shutdown_
Indicates if shutdown is in progress.
Definition dhcp6_srv.h:1229
isc::dhcp::Dhcpv6Srv::checkPostAssignmentChanges
void checkPostAssignmentChanges(const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, const ConstSubnet6Ptr orig_subnet)
Iterates over new leases, update stale DNS entries.
Definition dhcp6_srv.cc:5366
isc::dhcp::Dhcpv6Srv::processSolicit
Pkt6Ptr processSolicit(AllocEngine::ClientContext6 &ctx)
Processes incoming Solicit and returns response.
Definition dhcp6_srv.cc:3789
isc::dhcp::Dhcpv6Srv::inTestMode
bool inTestMode() const
Checks if the server is running in unit test mode.
Definition dhcp6_srv.h:105
isc::dhcp::Dhcpv6Srv::startD2
void startD2()
Starts DHCP_DDNS client IO if DDNS updates are enabled.
Definition dhcp6_srv.cc:5038
isc::dhcp::Dhcpv6Srv::duidToString
static std::string duidToString(const OptionPtr &opt)
converts DUID to text Converts content of DUID option to a text representation, e....
Definition dhcp6_srv.cc:1546
isc::dhcp::Dhcpv6Srv::getPDExclude
OptionPtr getPDExclude(const AllocEngine::ClientContext6 &ctx, const Lease6Ptr &lease)
Return the PD exclude option to include.
Definition dhcp6_srv.cc:2581
isc::dhcp::Dhcpv6Srv::removeDependentEvaluatedClasses
static void removeDependentEvaluatedClasses(const Pkt6Ptr &pkt)
Removed evaluated client classes.
Definition dhcp6_srv.cc:4791
isc::dhcp::Dhcpv6Srv::createNameChangeRequests
void createNameChangeRequests(const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Creates a number of isc::dhcp_ddns::NameChangeRequest objects based on the DHCPv6 Client FQDN Option.
Definition dhcp6_srv.cc:2417
isc::dhcp::Dhcpv6Srv::processInfRequest
Pkt6Ptr processInfRequest(AllocEngine::ClientContext6 &ctx)
Processes incoming Information-request message.
Definition dhcp6_srv.cc:4428
isc::dhcp::Dhcpv6Srv::server_port_
uint16_t server_port_
UDP port number on which server listens.
Definition dhcp6_srv.h:1191
isc::dhcp::Dhcpv6Srv::appendRequestedVendorOptions
void appendRequestedVendorOptions(const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, const CfgOptionList &co_list)
Appends requested vendor options to server's answer.
Definition dhcp6_srv.cc:1817
isc::dhcp::Dhcpv6Srv::declineLease
bool declineLease(const Pkt6Ptr &decline, const Lease6Ptr lease, boost::shared_ptr< Option6IA > ia_rsp)
Declines specific IPv6 lease.
Definition dhcp6_srv.cc:4318
isc::dhcp::Dhcpv6Srv::discardPackets
void discardPackets()
Discards parked packets Clears the packet parking lots of all packets.
Definition dhcp6_srv.cc:5286
isc::process::Daemon
Base class for all services.
Definition daemon.h:48
d2_client_mgr.h
Defines the D2ClientMgr class.
daemon.h
dhcp6.h
duid.h
io_service.h
isc::asiolink::IOServicePtr
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
Definition io_service.h:28
isc::dhcp_ddns
Definition dhcp_ddns_log.cc:14
isc::dhcp_ddns::NameChangeRequestPtr
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
Definition ncr_msg.h:241
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::ConstSubnet6Ptr
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
Definition subnet.h:623
isc::dhcp::DuidPtr
boost::shared_ptr< DUID > DuidPtr
Definition duid.h:136
isc::dhcp::Lease6Ptr
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition lease.h:528
isc::dhcp::Lease6Collection
std::vector< Lease6Ptr > Lease6Collection
A collection of IPv6 leases.
Definition lease.h:693
isc::dhcp::Option6IAPtr
boost::shared_ptr< Option6IA > Option6IAPtr
A pointer to the Option6IA object.
Definition option6_ia.h:20
isc::dhcp::HWAddrPtr
boost::shared_ptr< HWAddr > HWAddrPtr
Shared pointer to a hardware address structure.
Definition hwaddr.h:154
isc::dhcp::NetworkStatePtr
boost::shared_ptr< NetworkState > NetworkStatePtr
Pointer to the NetworkState object.
Definition network_state.h:220
isc::dhcp::CBControlDHCPv6Ptr
boost::shared_ptr< CBControlDHCPv6 > CBControlDHCPv6Ptr
Definition cb_ctl_dhcp6.h:45
isc::dhcp::Pkt6Ptr
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
Definition pkt6.h:31
isc::dhcp::OptionPtr
boost::shared_ptr< Option > OptionPtr
Definition option.h:37
isc::dhcp::CfgOptionList
std::list< ConstCfgOptionPtr > CfgOptionList
Const pointer list.
Definition cfg_option.h:898
isc::hooks
Definition callout_handle.cc:21
isc::hooks::CalloutHandlePtr
boost::shared_ptr< CalloutHandle > CalloutHandlePtr
A shared pointer to a CalloutHandle object.
Definition callout_handle.h:470
isc::util::file
Definition filesystem.cc:28
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
ncr_msg.h
This file provides the classes needed to embody, compose, and decompose DNS update requests that are ...
network_state.h
option6_client_fqdn.h
option6_ia.h
option.h
option_custom.h
option_definition.h
option_string.h
pkt6.h
isc::dhcp::AllocEngine::ClientContext6
Context information for the DHCPv6 leases allocation.
Definition alloc_engine.h:218
subnet.h