2017-05-18 16:48:46 +00:00
|
|
|
#ifndef FUZZ_WRAPFD_H
|
|
|
|
#define FUZZ_WRAPFD_H
|
|
|
|
|
|
|
|
#include "buffer.h"
|
|
|
|
|
|
|
|
enum wrapfd_mode {
|
|
|
|
UNUSED = 0,
|
2020-10-15 14:46:24 +00:00
|
|
|
COMMONBUF, // using the common buffer
|
2020-11-13 15:18:05 +00:00
|
|
|
DUMMY, // reads return fixed output, of random length
|
2017-05-18 16:48:46 +00:00
|
|
|
};
|
|
|
|
|
2020-10-15 14:46:24 +00:00
|
|
|
// buf is a common buffer read by all wrapped FDs. doesn't take ownership of buf
|
|
|
|
void wrapfd_setup(buffer *buf);
|
2017-05-25 14:21:49 +00:00
|
|
|
void wrapfd_setseed(uint32_t seed);
|
2020-12-03 14:18:51 +00:00
|
|
|
int wrapfd_new_fuzzinput(void);
|
|
|
|
int wrapfd_new_dummy(void);
|
2017-05-18 16:48:46 +00:00
|
|
|
|
2017-05-20 05:23:16 +00:00
|
|
|
// called via #defines for read/write/select
|
|
|
|
int wrapfd_read(int fd, void *out, size_t count);
|
|
|
|
int wrapfd_write(int fd, const void* in, size_t count);
|
|
|
|
int wrapfd_select(int nfds, fd_set *readfds, fd_set *writefds,
|
|
|
|
fd_set *exceptfds, struct timeval *timeout);
|
2017-05-21 02:48:18 +00:00
|
|
|
int wrapfd_close(int fd);
|
2017-05-20 05:23:16 +00:00
|
|
|
|
2017-05-18 16:48:46 +00:00
|
|
|
#endif // FUZZ_WRAPFD_H
|