summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/fuzz_messages.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:15:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:15:43 +0000
commitf5f56e1a1c4d9e9496fcb9d81131066a964ccd23 (patch)
tree49e44c6f87febed37efb953ab5485aa49f6481a7 /src/lib/dhcpsrv/fuzz_messages.cc
parentInitial commit. (diff)
downloadisc-kea-f5f56e1a1c4d9e9496fcb9d81131066a964ccd23.tar.xz
isc-kea-f5f56e1a1c4d9e9496fcb9d81131066a964ccd23.zip
Adding upstream version 2.4.1.upstream/2.4.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib/dhcpsrv/fuzz_messages.cc')
-rw-r--r--src/lib/dhcpsrv/fuzz_messages.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/fuzz_messages.cc b/src/lib/dhcpsrv/fuzz_messages.cc
new file mode 100644
index 0000000..651f2e2
--- /dev/null
+++ b/src/lib/dhcpsrv/fuzz_messages.cc
@@ -0,0 +1,39 @@
+// File created from ../../../src/lib/dhcpsrv/fuzz_messages.mes
+
+#include <cstddef>
+#include <log/message_types.h>
+#include <log/message_initializer.h>
+
+namespace isc {
+namespace dhcp {
+
+extern const isc::log::MessageID FUZZ_DATA_READ = "FUZZ_DATA_READ";
+extern const isc::log::MessageID FUZZ_INIT_COMPLETE = "FUZZ_INIT_COMPLETE";
+extern const isc::log::MessageID FUZZ_INIT_FAIL = "FUZZ_INIT_FAIL";
+extern const isc::log::MessageID FUZZ_READ_FAIL = "FUZZ_READ_FAIL";
+extern const isc::log::MessageID FUZZ_SEND = "FUZZ_SEND";
+extern const isc::log::MessageID FUZZ_SEND_ERROR = "FUZZ_SEND_ERROR";
+extern const isc::log::MessageID FUZZ_SHORT_SEND = "FUZZ_SHORT_SEND";
+extern const isc::log::MessageID FUZZ_SOCKET_CREATE_FAIL = "FUZZ_SOCKET_CREATE_FAIL";
+
+} // namespace dhcp
+} // namespace isc
+
+namespace {
+
+const char* values[] = {
+ "FUZZ_DATA_READ", "read %1 byte(s) from AFL via stdin",
+ "FUZZ_INIT_COMPLETE", "fuzz initialization complete: interface %1, address %2, port %3, max loops %4",
+ "FUZZ_INIT_FAIL", "fuzz initialization failure, reason: %1",
+ "FUZZ_READ_FAIL", "error reading input from fuzzer: %1",
+ "FUZZ_SEND", "sent %1 byte(s) to the socket connected to the Kea interface",
+ "FUZZ_SEND_ERROR", "failed to send data to Kea input socket: %1",
+ "FUZZ_SHORT_SEND", "expected to send %d bytes to Kea input socket but only sent %2",
+ "FUZZ_SOCKET_CREATE_FAIL", "failed to crease socket for use by fuzzing thread: %1",
+ NULL
+};
+
+const isc::log::MessageInitializer initializer(values);
+
+} // Anonymous namespace
+