Kea: dhcpv4_callouts.cc Source File

| Kea 3.0.2-git

dhcpv4_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
15using namespace isc::dhcp;
16using namespace isc::hooks;
17
18using isc::hooks::CalloutHandle;
19using isc::util::DHCPv4;
20
21namespace isc {
22namespace 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
27extern "C" {
28
34int
35cb4_updated(CalloutHandle& handle) {
36 return (LimitManager::instance().cb_updated<DHCPv4>(handle));
37}
38
44int
45dhcp4_srv_configured(CalloutHandle& handle) {
46 return (LimitManager::instance().dhcp_srv_configured<DHCPv4>(handle));
47}
48
54int
55pkt4_receive(CalloutHandle& handle) {
56 return (LimitManager::instance().pkt_receive<DHCPv4>(handle));
57}
58
64int
65subnet4_select(CalloutHandle& handle) {
66 return (LimitManager::instance().subnet_select<DHCPv4>(handle));
67}
68
74int
75lease4_select(CalloutHandle& handle) {
76 return (LimitManager::instance().lease_callout<DHCPv4>(handle));
77}
78
84int
85lease4_renew(CalloutHandle& handle) {
86 return (LimitManager::instance().lease_callout<DHCPv4>(handle, /* lease_update = */ true));
87}
88
89} // extern "C"
90
91} // namespace limits
92} // 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::cb4_updated
int cb4_updated(CalloutHandle &handle)
Callout at the cb4_updated hook point.
Definition dhcpv4_callouts.cc:35
isc::limits::dhcp4_srv_configured
int dhcp4_srv_configured(CalloutHandle &handle)
dhcp4_srv_configured callout implementation
Definition dhcpv4_callouts.cc:45
isc::limits::pkt4_receive
int pkt4_receive(CalloutHandle &handle)
Callout at the pkt4_receive hook point.
Definition dhcpv4_callouts.cc:55
isc::limits::subnet4_select
int subnet4_select(CalloutHandle &handle)
Callout at the subnet4_select hook point.
Definition dhcpv4_callouts.cc:65
isc::limits::lease4_renew
int lease4_renew(CalloutHandle &handle)
Callout at the leases4_renew hook point.
Definition dhcpv4_callouts.cc:85
isc::limits::lease4_select
int lease4_select(CalloutHandle &handle)
Callout at the leases4_select hook point.
Definition dhcpv4_callouts.cc:75
isc::util::DHCPv4
@ DHCPv4
Definition dhcp_space.h:18
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