robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | |
| 3 | honggfuzz - core structures and macros |
| 4 | ----------------------------------------- |
| 5 | |
| 6 | Author: Robert Swiecki <swiecki@google.com> |
| 7 | |
robert.swiecki@gmail.com | ba85c3e | 2015-02-02 14:55:16 +0000 | [diff] [blame] | 8 | Copyright 2010-2015 by Google Inc. All Rights Reserved. |
robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 9 | |
| 10 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 11 | you may not use this file except in compliance with the License. |
| 12 | You may obtain a copy of the License at |
| 13 | |
| 14 | http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | |
| 16 | Unless required by applicable law or agreed to in writing, software |
| 17 | distributed under the License is distributed on an "AS IS" BASIS, |
| 18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | See the License for the specific language governing permissions and |
| 20 | limitations under the License. |
| 21 | |
| 22 | */ |
| 23 | |
| 24 | #ifndef _COMMON_H_ |
| 25 | #define _COMMON_H_ |
| 26 | |
robert.swiecki@gmail.com | ba85c3e | 2015-02-02 14:55:16 +0000 | [diff] [blame] | 27 | #include <limits.h> |
robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 28 | #include <stdbool.h> |
| 29 | #include <stdint.h> |
robert.swiecki@gmail.com | ba85c3e | 2015-02-02 14:55:16 +0000 | [diff] [blame] | 30 | #include <sys/param.h> |
| 31 | #include <sys/types.h> |
robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 32 | |
| 33 | #define PROG_NAME "honggfuzz" |
robert.swiecki@gmail.com | e68a71c | 2015-02-01 16:13:00 +0000 | [diff] [blame] | 34 | #define PROG_VERSION "0.4" |
| 35 | #define PROG_AUTHORS "Robert Swiecki <swiecki@google.com> and others, Copyright 2010-2015 by Google Inc. All Rights Reserved." |
robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 36 | |
| 37 | #define FILE_PLACEHOLDER "___FILE___" |
| 38 | |
| 39 | typedef struct { |
| 40 | char **cmdline; |
| 41 | char *inputFile; |
| 42 | bool nullifyStdio; |
| 43 | bool fuzzStdin; |
| 44 | bool saveUnique; |
| 45 | char *fileExtn; |
| 46 | double flipRate; |
| 47 | char flipMode; |
| 48 | char *externalCommand; |
| 49 | long tmOut; |
groebert@google.com | 8e2f44a | 2013-03-15 13:54:18 +0000 | [diff] [blame] | 50 | long mutationsMax; |
| 51 | long mutationsCnt; |
robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 52 | long threadsMax; |
| 53 | long threadsCnt; |
| 54 | void *ignoreAddr; |
| 55 | unsigned long asLimit; |
robert.swiecki | 28cba5c | 2011-06-22 01:38:55 +0000 | [diff] [blame] | 56 | int pid; |
robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 57 | |
| 58 | char **files; |
| 59 | int fileCnt; |
robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 60 | } honggfuzz_t; |
| 61 | |
robert.swiecki@gmail.com | 882900b | 2015-02-11 13:56:22 +0000 | [diff] [blame^] | 62 | typedef struct fuzzer_t { |
| 63 | pid_t pid; |
| 64 | time_t timeStarted; |
| 65 | char origFileName[PATH_MAX]; |
| 66 | char fileName[PATH_MAX]; |
| 67 | uint64_t pc; |
| 68 | uint64_t backtrace; |
| 69 | uint64_t access; |
| 70 | int exception; |
| 71 | } fuzzer_t; |
robert.swiecki | 3bb518c | 2010-10-14 00:48:24 +0000 | [diff] [blame] | 72 | |
| 73 | #endif |