Kea: dhcp6_srv.h Source File

| Kea 3.2.0-git

dhcp6_srv.h
Go to the documentation of this file.
1// Copyright (C) 2011-2026 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
43namespace isc {
44namespace dhcp {
45
48 class DHCPv6DiscardMessageError : public Exception {
49public:
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 {
67private:
68
70 asiolink::IOServicePtr io_service_;
71
72public:
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
311protected:
312
319 void setPacketStatisticsDefaults();
320
329 bool testServerID(const Pkt6Ptr& pkt);
330
337 bool testUnicast(const Pkt6Ptr& pkt) const;
338
347 bool sanityCheck(const Pkt6Ptr& pkt);
348
358 void sanityCheck(const Pkt6Ptr& pkt, RequirementLevel clientid,
359 RequirementLevel serverid);
360
366 void sanityCheckDUID(const OptionPtr& opt, const std::string& opt_name);
367
382 Pkt6Ptr processSolicit(AllocEngine::ClientContext6& ctx);
383
395 Pkt6Ptr processRequest(AllocEngine::ClientContext6& ctx);
396
402 Pkt6Ptr processRenew(AllocEngine::ClientContext6& ctx);
403
415 Pkt6Ptr processRebind(AllocEngine::ClientContext6& ctx);
416
440 Pkt6Ptr processConfirm(AllocEngine::ClientContext6& ctx);
441
447 Pkt6Ptr processRelease(AllocEngine::ClientContext6& ctx);
448
459 Pkt6Ptr processDecline(AllocEngine::ClientContext6& ctx);
460
466 Pkt6Ptr processInfRequest(AllocEngine::ClientContext6& ctx);
467
477 void processDhcp4Query(const Pkt6Ptr& dhcp4_query);
478
484 Pkt6Ptr processAddrRegInform(AllocEngine::ClientContext6& ctx);
485
491 isc::dhcp::ConstSubnet6Ptr selectSubnet(const Pkt6Ptr& question, bool& drop);
492
507 OptionPtr assignIA_NA(const isc::dhcp::Pkt6Ptr& query,
508 AllocEngine::ClientContext6& ctx,
509 Option6IAPtr ia);
510
523 OptionPtr assignIA_PD(const Pkt6Ptr& query,
524 AllocEngine::ClientContext6& ctx,
525 boost::shared_ptr<Option6IA> ia);
526
540 OptionPtr extendIA_NA(const Pkt6Ptr& query,
541 AllocEngine::ClientContext6& ctx,
542 Option6IAPtr ia);
543
597 OptionPtr extendIA_PD(const Pkt6Ptr& query,
598 AllocEngine::ClientContext6& ctx,
599 Option6IAPtr ia);
600
619 OptionPtr releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
620 int& general_status,
621 boost::shared_ptr<Option6IA> ia,
622 Lease6Ptr& old_lease);
623
637 OptionPtr releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
638 int& general_status,
639 boost::shared_ptr<Option6IA> ia,
640 Lease6Ptr& old_lease);
641
649 void reject(const Pkt6Ptr& query, Pkt6Ptr& answer);
650
656 OptionPtr rejectIA_NA(const isc::dhcp::Pkt6Ptr& query, Option6IAPtr ia);
657
663 OptionPtr rejectIA_PD(const isc::dhcp::Pkt6Ptr& query, Option6IAPtr ia);
664
674 void copyClientOptions(const Pkt6Ptr& question, Pkt6Ptr& answer);
675
684 void buildCfgOptionList(const Pkt6Ptr& question,
685 AllocEngine::ClientContext6& ctx,
686 CfgOptionList& co_list);
687
697 void appendDefaultOptions(const Pkt6Ptr& question, Pkt6Ptr& answer,
698 const CfgOptionList& co_list);
699
708 void appendRequestedOptions(const Pkt6Ptr& question, Pkt6Ptr& answer,
709 const CfgOptionList& co_list);
710
720 void appendRequestedVendorOptions(const Pkt6Ptr& question, Pkt6Ptr& answer,
721 AllocEngine::ClientContext6& ctx,
722 const CfgOptionList& co_list);
723
734 void assignLeases(const Pkt6Ptr& question, Pkt6Ptr& answer,
735 AllocEngine::ClientContext6& ctx);
736
781 void processClientFqdn(const Pkt6Ptr& question, const Pkt6Ptr& answer,
782 AllocEngine::ClientContext6& ctx);
783
803 void createNameChangeRequests(const Pkt6Ptr& answer,
804 AllocEngine::ClientContext6& ctx);
805
817 void extendLeases(const Pkt6Ptr& query, Pkt6Ptr& reply,
818 AllocEngine::ClientContext6& ctx);
819
845 void setTeeTimes(uint32_t preferred_lft,
846 const ConstSubnet6Ptr& subnet,
847 Option6IAPtr& resp);
848
859 void releaseLeases(const Pkt6Ptr& release, Pkt6Ptr& reply,
860 AllocEngine::ClientContext6& ctx);
861
868 static std::string duidToString(const OptionPtr& opt);
869
874 virtual Pkt6Ptr receivePacket(int timeout);
875
880 virtual void sendPacket(const Pkt6Ptr& pkt);
881
892 void classifyPacket(const Pkt6Ptr& pkt);
893
904 void evaluateClasses(const Pkt6Ptr& pkt, bool depend_on_known);
905
912 static void removeDependentEvaluatedClasses(const Pkt6Ptr& pkt);
913
918 void setReservedClientClasses(const Pkt6Ptr& pkt,
919 const AllocEngine::ClientContext6& ctx);
920
931 void conditionallySetReservedClientClasses(const Pkt6Ptr& pkt,
932 const AllocEngine::ClientContext6& ctx);
933
951 void evaluateAdditionalClasses(const Pkt6Ptr& pkt, AllocEngine::ClientContext6& ctx);
952
960 static HWAddrPtr getMAC(const Pkt6Ptr& pkt);
961
970 void processRSOO(const Pkt6Ptr& query, const Pkt6Ptr& rsp);
971
990 void initContext(AllocEngine::ClientContext6& ctx, bool& drop);
991
998 static const std::string VENDOR_CLASS_PREFIX;
999
1010 bool declineLeases(const Pkt6Ptr& decline, Pkt6Ptr& reply,
1011 AllocEngine::ClientContext6& ctx);
1012
1026 OptionPtr
1027 declineIA(const Pkt6Ptr& decline, const DuidPtr& duid, int& general_status,
1028 boost::shared_ptr<Option6IA> ia, Lease6Collection& new_leases);
1029
1046 bool declineLease(const Pkt6Ptr& decline, const Lease6Ptr lease,
1047 boost::shared_ptr<Option6IA> ia_rsp);
1048
1054 void setStatusCode(boost::shared_ptr<Option6IA>& container,
1055 const OptionPtr& status);
1056
1091 //
1092 void checkPostAssignmentChanges(const Pkt6Ptr& question, Pkt6Ptr& answer,
1093 AllocEngine::ClientContext6& ctx,
1094 const ConstSubnet6Ptr orig_subnet);
1095
1101 OptionPtr getPDExclude(const AllocEngine::ClientContext6& ctx,
1102 const Lease6Ptr& lease);
1103
1104public:
1105
1107
1112 static uint16_t checkRelaySourcePort(const Pkt6Ptr& query);
1113
1114private:
1115
1121 void classifyByVendor(const Pkt6Ptr& pkt);
1122
1139 void updateReservedFqdn(AllocEngine::ClientContext6& ctx,
1140 const Pkt6Ptr& answer);
1141
1184 void generateFqdn(const Pkt6Ptr& answer,
1185 AllocEngine::ClientContext6& ctx);
1186
1189 static void processStatsReceived(const Pkt6Ptr& query);
1190
1198 bool requestedInORO(const Pkt6Ptr& query, const uint16_t code) const;
1199
1206 static std::tuple<bool, uint32_t> parkingLimitExceeded(std::string const& hook_label);
1207
1208protected:
1210 uint16_t server_port_;
1211
1213 uint16_t client_port_;
1214
1215public:
1216
1218
1221 static void processStatsSent(const Pkt6Ptr& response);
1222
1225 static int getHookIndexBuffer6Send();
1226
1231 void processPacketBufferSend(hooks::CalloutHandlePtr& callout_handle,
1232 Pkt6Ptr& rsp);
1233
1239 std::list<std::list<std::string>> jsonPathsToRedact() const final override;
1240
1241protected:
1242
1244 OptionPtr serverid_;
1245
1248 volatile bool shutdown_;
1249
1256 void processPacketPktSend(hooks::CalloutHandlePtr& callout_handle,
1257 Pkt6Ptr& query, Pkt6Ptr& rsp,
1258 ConstSubnet6Ptr& subnet);
1259
1264 boost::shared_ptr<AllocEngine> alloc_engine_;
1265
1268 std::queue<isc::dhcp_ddns::NameChangeRequest> name_change_reqs_;
1269
1272 NetworkStatePtr network_state_;
1273
1275 CBControlDHCPv6Ptr cb_control_;
1276};
1277
1278} // namespace dhcp
1279} // namespace isc
1280
1281#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:1268
isc::dhcp::Dhcpv6Srv::shutdown
void shutdown() override
Instructs the server to shut down.
Definition dhcp6_srv.cc:371
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::rejectIA_PD
OptionPtr rejectIA_PD(const isc::dhcp::Pkt6Ptr &query, Option6IAPtr ia)
Reject IA_PD.
Definition dhcp6_srv.cc:3890
isc::dhcp::Dhcpv6Srv::processPacket
Pkt6Ptr processPacket(Pkt6Ptr query)
Process a single incoming DHCPv6 packet.
Definition dhcp6_srv.cc:834
isc::dhcp::Dhcpv6Srv::processLocalizedQuery6
Pkt6Ptr processLocalizedQuery6(AllocEngine::ClientContext6 &ctx)
Process a localized incoming DHCPv6 query.
Definition dhcp6_srv.cc:1154
isc::dhcp::Dhcpv6Srv::processPacketAndSendResponseNoThrow
void processPacketAndSendResponseNoThrow(Pkt6Ptr query)
Process a single incoming DHCPv6 packet and sends the response.
Definition dhcp6_srv.cc:801
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:3120
isc::dhcp::Dhcpv6Srv::setReservedClientClasses
void setReservedClientClasses(const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
Assigns classes retrieved from host reservation database.
Definition dhcp6_srv.cc:4969
isc::dhcp::Dhcpv6Srv::processDecline
Pkt6Ptr processDecline(AllocEngine::ClientContext6 &ctx)
Process incoming Decline message.
Definition dhcp6_srv.cc:4223
isc::dhcp::Dhcpv6Srv::evaluateClasses
void evaluateClasses(const Pkt6Ptr &pkt, bool depend_on_known)
Evaluate classes.
Definition dhcp6_srv.cc:4929
isc::dhcp::Dhcpv6Srv::processRenew
Pkt6Ptr processRenew(AllocEngine::ClientContext6 &ctx)
Processes incoming Renew message.
Definition dhcp6_srv.cc:4013
isc::dhcp::Dhcpv6Srv::processStatsSent
static void processStatsSent(const Pkt6Ptr &response)
Updates statistics for transmitted packets.
Definition dhcp6_srv.cc:5383
isc::dhcp::Dhcpv6Srv::reject
void reject(const Pkt6Ptr &query, Pkt6Ptr &answer)
Reject query.
Definition dhcp6_srv.cc:3849
isc::dhcp::Dhcpv6Srv::evaluateAdditionalClasses
void evaluateAdditionalClasses(const Pkt6Ptr &pkt, AllocEngine::ClientContext6 &ctx)
Evaluates classes in the additional classes lists.
Definition dhcp6_srv.cc:4995
isc::dhcp::Dhcpv6Srv::processLocalizedQuery6AndSendResponse
void processLocalizedQuery6AndSendResponse(Pkt6Ptr query, AllocEngine::ClientContext6 &ctx)
Process a localized incoming DHCPv6 query.
Definition dhcp6_srv.cc:1108
isc::dhcp::Dhcpv6Srv::run
int run()
Main server processing loop.
Definition dhcp6_srv.cc:657
isc::dhcp::Dhcpv6Srv::setPacketStatisticsDefaults
void setPacketStatisticsDefaults()
This function sets statistics related to DHCPv6 packets processing to their initial values.
Definition dhcp6_srv.cc:317
isc::dhcp::Dhcpv6Srv::sanityCheck
bool sanityCheck(const Pkt6Ptr &pkt)
Verifies if specified packet meets RFC requirements.
Definition dhcp6_srv.cc:2044
isc::dhcp::Dhcpv6Srv::checkRelaySourcePort
static uint16_t checkRelaySourcePort(const Pkt6Ptr &query)
Used for DHCPv4-over-DHCPv6 too.
Definition dhcp6_srv.cc:5305
isc::dhcp::Dhcpv6Srv::assignLeases
void assignLeases(const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Assigns leases.
Definition dhcp6_srv.cc:2291
isc::dhcp::Dhcpv6Srv::stopD2
void stopD2()
Stops DHCP_DDNS client IO if DDNS updates are enabled.
Definition dhcp6_srv.cc:5213
isc::dhcp::Dhcpv6Srv::copyClientOptions
void copyClientOptions(const Pkt6Ptr &question, Pkt6Ptr &answer)
Copies required options from client message to server answer.
Definition dhcp6_srv.cc:1620
isc::dhcp::Dhcpv6Srv::alloc_engine_
boost::shared_ptr< AllocEngine > alloc_engine_
Allocation Engine.
Definition dhcp6_srv.h:1264
isc::dhcp::Dhcpv6Srv::sendPacket
virtual void sendPacket(const Pkt6Ptr &pkt)
dummy wrapper around IfaceMgr::send()
Definition dhcp6_srv.cc:380
isc::dhcp::Dhcpv6Srv::testServerID
bool testServerID(const Pkt6Ptr &pkt)
Compare received server id with our server id.
Definition dhcp6_srv.cc:385
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:5223
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:4301
isc::dhcp::Dhcpv6Srv::rejectIA_NA
OptionPtr rejectIA_NA(const isc::dhcp::Pkt6Ptr &query, Option6IAPtr ia)
Reject IA_NA.
Definition dhcp6_srv.cc:3881
isc::dhcp::Dhcpv6Srv::getServerPort
uint16_t getServerPort() const
Get UDP port on which server should listen.
Definition dhcp6_srv.cc:5454
isc::dhcp::Dhcpv6Srv::runOne
void runOne()
Main server processing step.
Definition dhcp6_srv.cc:714
isc::dhcp::Dhcpv6Srv::receivePacket
virtual Pkt6Ptr receivePacket(int timeout)
dummy wrapper around IfaceMgr::receive6
Definition dhcp6_srv.cc:376
isc::dhcp::Dhcpv6Srv::processPacketBufferSend
void processPacketBufferSend(hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &rsp)
Executes buffer6_send callout and sends the response.
Definition dhcp6_srv.cc:1529
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:3419
isc::dhcp::Dhcpv6Srv::buildCfgOptionList
void buildCfgOptionList(const Pkt6Ptr &question, AllocEngine::ClientContext6 &ctx, CfgOptionList &co_list)
Build the configured option list.
Definition dhcp6_srv.cc:1643
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:1636
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:2665
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:998
isc::dhcp::Dhcpv6Srv::serverid_
OptionPtr serverid_
Server DUID (to be sent in server-identifier option).
Definition dhcp6_srv.h:1244
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:5491
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:4980
isc::dhcp::Dhcpv6Srv::processPacketAndSendResponse
void processPacketAndSendResponse(Pkt6Ptr query)
Process a single incoming DHCPv6 packet and sends the response.
Definition dhcp6_srv.cc:823
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:3638
isc::dhcp::Dhcpv6Srv::processDhcp4Query
void processDhcp4Query(const Pkt6Ptr &dhcp4_query)
Processes incoming DHCPv4-query message.
Definition dhcp6_srv.cc:4581
isc::dhcp::Dhcpv6Srv::processRebind
Pkt6Ptr processRebind(AllocEngine::ClientContext6 &ctx)
Processes incoming Rebind message.
Definition dhcp6_srv.cc:4055
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:497
isc::dhcp::Dhcpv6Srv::initContext0
void initContext0(const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx)
Initialize client context (first part).
Definition dhcp6_srv.cc:484
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:327
isc::dhcp::Dhcpv6Srv::initContext
void initContext(AllocEngine::ClientContext6 &ctx, bool &drop)
Initializes client context for specified packet.
Definition dhcp6_srv.cc:563
isc::dhcp::Dhcpv6Srv::processRequest
Pkt6Ptr processRequest(AllocEngine::ClientContext6 &ctx)
Processes incoming Request and returns Reply response.
Definition dhcp6_srv.cc:3972
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:1439
isc::dhcp::Dhcpv6Srv::network_state_
NetworkStatePtr network_state_
Holds information about disabled DHCP service and/or disabled subnet/network scopes.
Definition dhcp6_srv.h:1272
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:5598
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:2807
isc::dhcp::Dhcpv6Srv::testUnicast
bool testUnicast(const Pkt6Ptr &pkt) const
Check if the message can be sent to unicast.
Definition dhcp6_srv.cc:409
isc::dhcp::Dhcpv6Srv::processRelease
Pkt6Ptr processRelease(AllocEngine::ClientContext6 &ctx)
Process incoming Release message.
Definition dhcp6_srv.cc:4191
isc::dhcp::Dhcpv6Srv::processClientFqdn
void processClientFqdn(const Pkt6Ptr &question, const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
Processes Client FQDN Option.
Definition dhcp6_srv.cc:2338
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:4425
isc::dhcp::Dhcpv6Srv::getHookIndexBuffer6Send
static int getHookIndexBuffer6Send()
Returns the index of the buffer6_send hook.
Definition dhcp6_srv.cc:5410
isc::dhcp::Dhcpv6Srv::classifyPacket
void classifyPacket(const Pkt6Ptr &pkt)
Assigns incoming packet to zero or more classes.
Definition dhcp6_srv.cc:4918
isc::dhcp::Dhcpv6Srv::getMAC
static HWAddrPtr getMAC(const Pkt6Ptr &pkt)
Attempts to get a MAC/hardware address using configured sources.
Definition dhcp6_srv.cc:2625
isc::dhcp::Dhcpv6Srv::Dhcpv6Srv
Dhcpv6Srv(uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
Default constructor.
Definition dhcp6_srv.cc:272
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:4259
isc::dhcp::Dhcpv6Srv::releaseLeases
void releaseLeases(const Pkt6Ptr &release, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
Attempts to release received addresses.
Definition dhcp6_srv.cc:3362
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:3315
isc::dhcp::Dhcpv6Srv::processRSOO
void processRSOO(const Pkt6Ptr &query, const Pkt6Ptr &rsp)
Processes Relay-supplied options, if present.
Definition dhcp6_srv.cc:5272
isc::dhcp::Dhcpv6Srv::getVersion
static std::string getVersion(bool extended)
returns Kea version on stdout and exit.
Definition dhcp6_srv.cc:5235
isc::dhcp::Dhcpv6Srv::processAddrRegInform
Pkt6Ptr processAddrRegInform(AllocEngine::ClientContext6 &ctx)
Processes incoming Addr-reg-inform message.
Definition dhcp6_srv.cc:4604
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:2956
isc::dhcp::Dhcpv6Srv::processConfirm
Pkt6Ptr processConfirm(AllocEngine::ClientContext6 &ctx)
Processes incoming Confirm message and returns Reply.
Definition dhcp6_srv.cc:4097
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:2147
isc::dhcp::Dhcpv6Srv::setHostIdentifiers
static void setHostIdentifiers(AllocEngine::ClientContext6 &ctx)
Set host identifiers within a context.
Definition dhcp6_srv.cc:422
isc::dhcp::Dhcpv6Srv::processPacketPktSend
void processPacketPktSend(hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &query, Pkt6Ptr &rsp, ConstSubnet6Ptr &subnet)
Executes pkt6_send callout.
Definition dhcp6_srv.cc:1456
isc::dhcp::Dhcpv6Srv::processDhcp6Query
Pkt6Ptr processDhcp6Query(Pkt6Ptr query)
Process a single incoming DHCPv6 query.
Definition dhcp6_srv.cc:1062
isc::dhcp::Dhcpv6Srv::processDhcp6QueryAndSendResponse
void processDhcp6QueryAndSendResponse(Pkt6Ptr query)
Process a single incoming DHCPv6 query.
Definition dhcp6_srv.cc:1034
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:1710
isc::dhcp::Dhcpv6Srv::client_port_
uint16_t client_port_
UDP port number to which server sends all responses.
Definition dhcp6_srv.h:1213
isc::dhcp::Dhcpv6Srv::cb_control_
CBControlDHCPv6Ptr cb_control_
Controls access to the configuration backends.
Definition dhcp6_srv.h:1275
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:2163
isc::dhcp::Dhcpv6Srv::shutdown_
volatile bool shutdown_
Indicates if shutdown is in progress.
Definition dhcp6_srv.h:1248
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:5529
isc::dhcp::Dhcpv6Srv::processSolicit
Pkt6Ptr processSolicit(AllocEngine::ClientContext6 &ctx)
Processes incoming Solicit and returns response.
Definition dhcp6_srv.cc:3899
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:5201
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:1600
isc::dhcp::Dhcpv6Srv::getPDExclude
OptionPtr getPDExclude(const AllocEngine::ClientContext6 &ctx, const Lease6Ptr &lease)
Return the PD exclude option to include.
Definition dhcp6_srv.cc:2639
isc::dhcp::Dhcpv6Srv::removeDependentEvaluatedClasses
static void removeDependentEvaluatedClasses(const Pkt6Ptr &pkt)
Removed evaluated client classes.
Definition dhcp6_srv.cc:4954
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:2478
isc::dhcp::Dhcpv6Srv::processInfRequest
Pkt6Ptr processInfRequest(AllocEngine::ClientContext6 &ctx)
Processes incoming Information-request message.
Definition dhcp6_srv.cc:4544
isc::dhcp::Dhcpv6Srv::server_port_
uint16_t server_port_
UDP port number on which server listens.
Definition dhcp6_srv.h:1210
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:1875
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:4434
isc::dhcp::Dhcpv6Srv::discardPackets
void discardPackets()
Discards parked packets Clears the packet parking lots of all packets.
Definition dhcp6_srv.cc:5449
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:35
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:620
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:979
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:29
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
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