blob: b85c4332827ddd7f9ef4571624e3f46d87e4b7f5 [file] [log] [blame]
Robert Swieckif827c982017-06-01 16:02:39 +02001#ifdef __cplusplus
2extern "C" {
3#endif
4
Robert Swiecki74c23a82017-06-01 15:58:45 +02005/*
6 * buf: input fuzzing data
7 * len: size of the 'buf' data
8 *
9 * Return value: should return 0
10 */
Robert Swieckicabf6e72017-06-01 16:12:23 +020011 int LLVMFuzzerTestOneInput(const uint8_t * buf, size_t len);
Robert Swiecki74c23a82017-06-01 15:58:45 +020012
13/*
14 * argc: ptr to main's argc
15 * argv: ptr to main's argv
16 *
17 * Return value: ignored
18 */
Robert Swieckif827c982017-06-01 16:02:39 +020019 int LLVMFuzzerInitialize(int *argc, char ***argv);
Robert Swiecki74c23a82017-06-01 15:58:45 +020020
21/*
22 *
23 * An alternative for LLVMFuzzerTestOneInput()
24 *
25 * buf_ptr: will be set to input fuzzing data
26 * len_ptr: will be set to the size of the input fuzzing data
27 */
Robert Swieckicabf6e72017-06-01 16:12:23 +020028 void HF_ITER(const uint8_t ** buf_ptr, size_t * len_ptr);
Robert Swieckif827c982017-06-01 16:02:39 +020029
Robert Swiecki0061b222017-06-01 16:49:35 +020030#if defined(__linux__)
Robert Swiecki649b89d2017-06-01 16:42:49 +020031
32/*
33 * Enter Linux namespaces
34 *
35 * cloneFlags: see 'man unshare'
36 */
37 bool linuxEnterNs(uintptr_t cloneFlags);
38/*
39 * Bring network interface up
40 *
41 * ifacename: name of the interface, typically "lo"
42 */
43 bool linuxIfaceUp(const char *ifacename);
44/*
45 * Mount tmpfs over a mount point
46 *
47 * dst: mount point for tmfs
48 */
49 bool linuxMountTmpfs(const char *dst);
50
Robert Swiecki0061b222017-06-01 16:49:35 +020051#endif /* defined(__linux__) */
Robert Swiecki649b89d2017-06-01 16:42:49 +020052
Robert Swieckif827c982017-06-01 16:02:39 +020053#ifdef __cplusplus
54} /* extern "C" */
55#endif