Add basic structure for fuzzing targets

General changes:

* Add -D/--deterministic command line option as
  convenience/alternative to -G/--load-seeds (i.e. no file needed, it just
  uses zero-initialized random seeds).  It also changes Broker data
  stores over to using deterministic timing rather than real time.

* Add option to make Reporter abort on runtime scripting errors
This commit is contained in:
Jon Siwek 2020-04-21 20:16:00 -07:00
parent f849571910
commit 8f1b34b915
20 changed files with 1290 additions and 928 deletions

31
src/zeek-setup.h Normal file
View file

@ -0,0 +1,31 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "Options.h"
namespace zeek {
struct SetupResult {
int code = 0;
zeek::Options options;
};
/**
* Initializes Zeek's global state.
* @param argc the argument count (same semantics as main function)
* @param argv the argument strings (same semantics as main function)
* @param options if provided, those options are used instead of
* deriving them by parsing the "argv" list. The "argv" list still
* needs to be provided regardless since some functionality requires
* it, particularly, several things use the value of argv[0].
*/
SetupResult setup(int argc, char** argv, zeek::Options* options = nullptr);
/**
* Cleans up Zeek's global state.
* @param did_net_run whether the net_run() was called.
*/
int cleanup(bool did_net_run);
}