| Kea 3.0.2-git

dhcpv6_callouts.cc
Go to the documentation of this file.
1// Copyright (C) 2022-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#include <config.h>
8
9#include <dhcpsrv/lease_mgr_factory.h>
10#include <dhcpsrv/srv_config.h>
11#include <hooks/callout_handle.h>
12#include <limits/limit_manager.h>
13#include <util/dhcp_space.h>
14
15 using namespace isc::dhcp;
16 using namespace isc::hooks;
17
18 using isc::hooks::CalloutHandle;
19 using isc::util::DHCPv6;
20
21 namespace isc {
22 namespace limits {
23
24// Functions accessed by the hooks framework use C linkage to avoid the name
25// mangling that accompanies use of the C++ compiler as well as to avoid
26// issues related to namespaces
27 extern "C" {
28
34 int
35 cb6_updated(CalloutHandle& handle) {
36 return (LimitManager::instance().cb_updated<DHCPv6>(handle));
37}
38
44 int
45 dhcp6_srv_configured(CalloutHandle& handle) {
46 return (LimitManager::instance().dhcp_srv_configured<DHCPv6>(handle));
47}
48
54 int
55 pkt6_receive(CalloutHandle& handle) {
56 return (LimitManager::instance().pkt_receive<DHCPv6>(handle));
57}
58
64 int
65 subnet6_select(CalloutHandle& handle) {
66 return (LimitManager::instance().subnet_select<DHCPv6>(handle));
67}
68
74 int
75 lease6_select(CalloutHandle& handle) {
76 return (LimitManager::instance().lease_callout<DHCPv6>(handle));
77}
78
84 int
85 lease6_renew(CalloutHandle& handle) {
86 return (LimitManager::instance().lease_callout<DHCPv6>(handle, /* lease_update = */ true));
87}
88
94 int
95 lease6_rebind(CalloutHandle& handle) {
96 return (LimitManager::instance().lease_callout<DHCPv6>(handle, /* lease_update = */ true));
97}
98
99} // extern "C"
100
101} // namespace limits
102} // namespace isc
callout_handle.h
isc::hooks::CalloutHandle
Per-packet callout handle.
Definition callout_handle.h:78
dhcp_space.h
lease_mgr_factory.h
limit_manager.h
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::hooks
Definition callout_handle.cc:21
isc::limits
Definition configuration.cc:18
isc::limits::pkt6_receive
int pkt6_receive(CalloutHandle &handle)
Callout at the pkt6_receive hook point.
Definition dhcpv6_callouts.cc:55
isc::limits::dhcp6_srv_configured
int dhcp6_srv_configured(CalloutHandle &handle)
dhcp6_srv_configured callout implementation
Definition dhcpv6_callouts.cc:45
isc::limits::lease6_rebind
int lease6_rebind(CalloutHandle &handle)
Callout at the lease6_rebind hook point.
Definition dhcpv6_callouts.cc:95
isc::limits::lease6_select
int lease6_select(CalloutHandle &handle)
Callout at the lease6_select hook point.
Definition dhcpv6_callouts.cc:75
isc::limits::cb6_updated
int cb6_updated(CalloutHandle &handle)
Callout at the cb6_updated hook point.
Definition dhcpv6_callouts.cc:35
isc::limits::lease6_renew
int lease6_renew(CalloutHandle &handle)
Callout at the lease6_renew hook point.
Definition dhcpv6_callouts.cc:85
isc::limits::subnet6_select
int subnet6_select(CalloutHandle &handle)
Callout at the subnet6_select hook point.
Definition dhcpv6_callouts.cc:65
isc::util::DHCPv6
@ DHCPv6
Definition dhcp_space.h:19
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
srv_config.h
isc::limits::LimitManager::instance
static LimitManager & instance()
singleton access function
Definition limit_manager.cc:31