2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 01:49:48 +00:00
kea/fuzz/input/regenerate-cpp-sources.sh
Andrei Pavel a96168e762
[#3605] Integrate a new fuzzing solution in Kea
The solution is based on clusterfuzzlite, libfuzzer, and oss-fuzz
technologies.

- Add the .clusterfuzzlite directory.
- Add the fuzz CI stage and fuzzing CI jobs.
- Add the fuzzing targets in the fuzz directory.
- Document fuzzing in doxygen.
2024-10-23 16:40:31 +03:00

27 lines
480 B
Bash
Executable File

#!/bin/sh
set -eu
script_path=$(cd "$(dirname "${0}")" && pwd)
cd "${script_path}"
generate() {
source="${1}"
target="${2}"
source_content=$(cat "${source}")
variable_name=$(echo "${source}" | tr '[:lower:]' '[:upper:]' | sed 's/\./_/' | sed 's/-/_/')
cat > "${target}" <<HERE_DOCUMENT
#include <string>
extern std::string ${variable_name} = R"(
${source_content}
)";
HERE_DOCUMENT
}
generate kea-dhcp4.conf ../kea-dhcp4.h
generate kea-dhcp6.conf ../kea-dhcp6.h