diff options
author | Simon Rettberg | 2017-10-30 21:39:56 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-10-30 21:39:56 +0100 |
commit | 46c3e0e276e62b6be76e69b68de56432692efcf3 (patch) | |
tree | 194ab981ea90f1227cfb94509b9d17b25bb29354 /CMakeLists.txt | |
parent | [SERVER] Missed occurence of AF_INET(6) -> HOST_IP[46] (diff) | |
download | dnbd3-46c3e0e276e62b6be76e69b68de56432692efcf3.tar.gz dnbd3-46c3e0e276e62b6be76e69b68de56432692efcf3.tar.xz dnbd3-46c3e0e276e62b6be76e69b68de56432692efcf3.zip |
[SERVER] Add AFL support
AFL is an instrumenting fuzzer.
It expects to pass input to the program to be tested
via command line (file name) or via stdin. This adds
support for reading messages that normally would arrive
via network directly from stdin. In this mode, the server
is pretty useless otherwise.
http://lcamtuf.coredump.cx/afl/
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d738bd1..f2da9e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,8 @@ OPTION(BUILD_FUSE_CLIENT "Build dnbd3 fuse client" ON) OPTION(BUILD_SERVER "Build dnbd3 server" ON) OPTION(BUILD_STRESSTEST "Build dnbd3 stress testing tool" OFF) +OPTION(SERVER_FOR_AFL "Build dnbd3-server for usage with afl-fuzz" OFF) + # Is there a non-retarded way to check if build type is debug or release? # When specifying, it is case insensitive, so DeBuG would also enable debug builds, # but in cmake, we can only do case sensitive matches... :/ @@ -140,6 +142,10 @@ ENDIF() ################################################################################ if(BUILD_SERVER) + IF(SERVER_FOR_AFL) + message(" ######################## Building server for AFL mode - will be useless otherwise!") + ADD_DEFINITIONS(-DAFL_MODE) + ENDIF() INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${JANSSON_INCLUDE_DIR}) FILE(GLOB SERVER_SRCS src/server/*.c src/shared/*.c src/server/picohttpparser/*.c) ADD_EXECUTABLE(dnbd3-server ${SERVER_SRCS}) |