blob: 0ef42ba145a3ebc6d103a4cde7976d87dd9b33a8 [file] [log] [blame]
robert.swiecki3bb518c2010-10-14 00:48:24 +00001/*
2
3 honggfuzz - core structures and macros
4 -----------------------------------------
5
6 Author: Robert Swiecki <swiecki@google.com>
7
robert.swiecki@gmail.comba85c3e2015-02-02 14:55:16 +00008 Copyright 2010-2015 by Google Inc. All Rights Reserved.
robert.swiecki3bb518c2010-10-14 00:48:24 +00009
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.comba85c3e2015-02-02 14:55:16 +000027#include <limits.h>
robert.swiecki3bb518c2010-10-14 00:48:24 +000028#include <stdbool.h>
29#include <stdint.h>
robert.swiecki@gmail.comba85c3e2015-02-02 14:55:16 +000030#include <sys/param.h>
31#include <sys/types.h>
robert.swiecki3bb518c2010-10-14 00:48:24 +000032
33#define PROG_NAME "honggfuzz"
robert.swiecki@gmail.come68a71c2015-02-01 16:13:00 +000034#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.swiecki3bb518c2010-10-14 00:48:24 +000036
37#define FILE_PLACEHOLDER "___FILE___"
38
39typedef 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.com8e2f44a2013-03-15 13:54:18 +000050 long mutationsMax;
51 long mutationsCnt;
robert.swiecki3bb518c2010-10-14 00:48:24 +000052 long threadsMax;
53 long threadsCnt;
54 void *ignoreAddr;
55 unsigned long asLimit;
robert.swiecki28cba5c2011-06-22 01:38:55 +000056 int pid;
robert.swiecki3bb518c2010-10-14 00:48:24 +000057
58 char **files;
59 int fileCnt;
robert.swiecki3bb518c2010-10-14 00:48:24 +000060} honggfuzz_t;
61
robert.swiecki@gmail.com882900b2015-02-11 13:56:22 +000062typedef 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.swiecki3bb518c2010-10-14 00:48:24 +000072
73#endif