Kea 3.3.3
dhcp_space.h
Go to the documentation of this file.
1// Copyright (C) 2022-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 ISC_UTIL_DHCP_SPACE_H
8#define ISC_UTIL_DHCP_SPACE_H 1
9
10#include <cstdint>
11#include <string>
12
13#include <boost/algorithm/string/replace.hpp>
14
15namespace isc {
16namespace util {
17
18enum DhcpSpace : uint16_t {
21};
22
28template <DhcpSpace D>
29char const* cStringDhcpSpace();
30
36template <DhcpSpace D>
37std::string formatDhcpSpace(char const* const format_string) {
38 std::string result(format_string);
39 boost::replace_all(result, "{}", cStringDhcpSpace<D>());
40 return result;
41}
42
43} // namespace util
44} // namespace isc
45
46#endif // ISC_UTIL_DHCP_SPACE_H
std::string formatDhcpSpace(char const *const format_string)
Replaces all occurrences of {} with 4 or 6 based on the templated DHCP space.
Definition dhcp_space.h:37
char const * cStringDhcpSpace()
Provides the C string representation of the DHCP space.
Defines the logger used by the top-level component of kea-lfc.