From 85c3fe47292f4e4e47a1f58f1347cb1f6d03b37e Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Tue, 20 Oct 2020 15:31:52 +0200 Subject: [BUILD] add option to build the dnbd3-server with afl-fuzz support The afl-fuzz support for the dnbd3-server requires an AFL C compiler like afl-gcc and can be enabled with the CMake option DNBD3_SERVER_AFL. --- inc/dnbd3/shared/log.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'inc') diff --git a/inc/dnbd3/shared/log.h b/inc/dnbd3/shared/log.h index 5b1e8f7..9185b18 100644 --- a/inc/dnbd3/shared/log.h +++ b/inc/dnbd3/shared/log.h @@ -23,6 +23,7 @@ #include #include +#include typedef unsigned int logmask_t; #define LOG_ERROR ((logmask_t)1) // Fatal error, server will terminate @@ -32,6 +33,10 @@ typedef unsigned int logmask_t; #define LOG_DEBUG1 ((logmask_t)16) // Debug information, use this for non-spammy stuff #define LOG_DEBUG2 ((logmask_t)32) // Use this for debug messages that will show up a lot +/** + * Initialize the logging (constructor) + */ +void log_init(void); /** * Check if cansoleMask | fileMask has all of mask set. @@ -44,6 +49,16 @@ void log_setConsoleMask(logmask_t mask); void log_setConsoleTimestamps(bool on); +/** + * Set console output stream + * The output stream can be either stdout or stderr + * + * Note: A call of this function is optional and only required if the output + * stream should be changed from stdout to stderr since the log + * implementation defaults to the output stream stdout + */ +int log_setConsoleOutputStream(FILE *outputStream); + /** * Open or reopen the log file. If path is NULL and the * function was called with a path before, the same path -- cgit v1.2.3-55-g7522