Kea 3.1.9
sflq_cmds.h
Go to the documentation of this file.
1// Copyright (C) 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 SFLQ_CMDS_H
8#define SFLQ_CMDS_H
9
10#include <config.h>
11#include <config/cmds_impl.h>
12#include <cc/data.h>
13#include <asiolink/io_address.h>
15#include <dhcpsrv/lease_mgr.h>
16#include <dhcpsrv/subnet_id.h>
17
18#include <string>
19#include <sstream>
20
21namespace isc {
22namespace lease_cmds {
23
27public:
30
32 virtual ~SflqCmdsImpl() {};
33
53
71
90
110
130
150
168
187
207
227
228private:
246 int sflqPoolGetAll(hooks::CalloutHandle& handle, uint16_t family);
247
266 int sflqPoolGetBySubnet(hooks::CalloutHandle& handle, uint16_t family);
267
287 int sflqPoolGetByRange(hooks::CalloutHandle& handle, uint16_t family);
288
309 int sflqPoolDel(hooks::CalloutHandle& handle, uint16_t family);
310
311public:
319
336 static void extractRange(data::ConstElementPtr& params, uint8_t family,
337 asiolink::IOAddress& start_address,
338 asiolink::IOAddress& end_address);
339
353 static bool extractBool(data::ConstElementPtr& params, const std::string& name,
354 bool default_value = false);
355
368 uint16_t family);
369};
370
375class SflqCmds {
376public:
380 SflqCmds();
381
404
422
441
461
481
501
519
538
558
578
579private:
581 boost::shared_ptr<SflqCmdsImpl> sflq_impl_;
582};
583
584};
585};
586#endif
Base class that command handler implementers may use for common tasks.
Definition cmds_impl.h:21
Per-packet callout handle.
int sflqPool6DelHandler(hooks::CalloutHandle &handle)
Delete the SFLQ V6 pool that matches a start and end address.
Definition sflq_cmds.cc:219
static bool extractBool(data::ConstElementPtr &params, const std::string &name, bool default_value=false)
Extracts a boolean from given parameters map.
Definition sflq_cmds.cc:453
virtual ~SflqCmdsImpl()
Destructor.
Definition sflq_cmds.h:32
static dhcp::Lease::Type extractLeaseType(data::ConstElementPtr &params, uint16_t family)
Extracts 'lease-type' from given parameters map.
Definition sflq_cmds.cc:468
static data::ConstElementPtr buildGetResponse(dhcp::SflqPoolInfoCollectionPtr pools)
Creates a success response from a list of SqlPoolInfos.
Definition sflq_cmds.cc:420
int sflqPool6RebuildHandler(hooks::CalloutHandle &handle)
The 'sflq-pool6-rebuild' command handler.
Definition sflq_cmds.cc:131
int sflqPool6GetBySubnetHandler(hooks::CalloutHandle &handle)
The 'sflq-pool6-by-subnet' command handler.
Definition sflq_cmds.cc:209
static void extractRange(data::ConstElementPtr &params, uint8_t family, asiolink::IOAddress &start_address, asiolink::IOAddress &end_address)
Extracts an ip address range from given parameters map.
Definition sflq_cmds.cc:441
int sflqPool4GetByRangeHandler(hooks::CalloutHandle &handle)
Handles a 'sflq-pool4-by-range' command.
Definition sflq_cmds.cc:121
int sflqPool4GetAllHandler(hooks::CalloutHandle &handle)
The 'sflq-pool4-get-all' command handler.
Definition sflq_cmds.cc:111
int sflqPool4RebuildHandler(hooks::CalloutHandle &handle)
The 'sflq-pool4-rebuild' command handler.
Definition sflq_cmds.cc:39
int sflqPool4GetBySubnetHandler(hooks::CalloutHandle &handle)
The 'sflq-pool4-by-subnet' command handler.
Definition sflq_cmds.cc:116
int sflqPool6GetByRangeHandler(hooks::CalloutHandle &handle)
Handles a 'sflq-pool6-by-range' command.
Definition sflq_cmds.cc:214
int sflqPool6GetAllHandler(hooks::CalloutHandle &handle)
The 'sflq-pool6-get-all' command handler.
Definition sflq_cmds.cc:204
int sflqPool4DelHandler(hooks::CalloutHandle &handle)
Delete the SFLQ V4 pool that matches a start and end address.
Definition sflq_cmds.cc:126
int sflqPool4DelHandler(hooks::CalloutHandle &handle)
Delete the SFLQ V4 pool that matches a start and end address.
Definition sflq_cmds.cc:513
int sflqPool4GetBySubnetHandler(hooks::CalloutHandle &handle)
The 'sflq-pool4-get-by-subnet' command handler.
Definition sflq_cmds.cc:503
int sflqPool6RebuildHandler(hooks::CalloutHandle &handle)
The 'sflq-pool6-rebuild' command handler.
Definition sflq_cmds.cc:518
int sflqPool6GetAllHandler(hooks::CalloutHandle &handle)
The 'sflq-pool6-get-all' command handler.
Definition sflq_cmds.cc:523
int sflqPool4GetByRangeHandler(hooks::CalloutHandle &handle)
Handles a 'sflq-pool4-by-range' command.
Definition sflq_cmds.cc:508
int sflqPool4GetAllHandler(hooks::CalloutHandle &handle)
The 'sflq-pool4-get-all' command handler.
Definition sflq_cmds.cc:498
int sflqPool6GetByRangeHandler(hooks::CalloutHandle &handle)
Handles a 'sflq-pool6-by-range' command.
Definition sflq_cmds.cc:533
int sflqPool6DelHandler(hooks::CalloutHandle &handle)
Delete the SFLQ V6 pool that matches a start and end address.
Definition sflq_cmds.cc:538
int sflqPool6GetBySubnetHandler(hooks::CalloutHandle &handle)
The 'sflq-pool6-get-by-subnet' command handler.
Definition sflq_cmds.cc:528
int sflqPool4RebuildHandler(hooks::CalloutHandle &handle)
sflq-pool4-rebuild handler.
Definition sflq_cmds.cc:493
An abstract API for lease database.
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
boost::shared_ptr< SflqPoolInfoCollection > SflqPoolInfoCollectionPtr
Definition lease_mgr.h:262
Defines the logger used by the top-level component of kea-lfc.
Type
Type of lease or pool.
Definition lease.h:46