fuzz-wrapfd.h 787 B

123456789101112131415161718192021222324252627
  1. #ifndef FUZZ_WRAPFD_H
  2. #define FUZZ_WRAPFD_H
  3. #include "includes.h"
  4. #include "buffer.h"
  5. enum wrapfd_mode {
  6. UNUSED = 0,
  7. COMMONBUF, // using the common buffer
  8. DUMMY, // reads return fixed output, of random length
  9. };
  10. // buf is a common buffer read by all wrapped FDs. doesn't take ownership of buf
  11. void wrapfd_setup(buffer *buf);
  12. void wrapfd_setseed(uint32_t seed);
  13. int wrapfd_new_fuzzinput(void);
  14. int wrapfd_new_dummy(void);
  15. // called via #defines for read/write/select
  16. int wrapfd_read(int fd, void *out, size_t count);
  17. int wrapfd_write(int fd, const void* in, size_t count);
  18. int wrapfd_select(int nfds, fd_set *readfds, fd_set *writefds,
  19. fd_set *exceptfds, struct timeval *timeout);
  20. int wrapfd_close(int fd);
  21. int fuzz_kill(pid_t pid, int sig);
  22. #endif // FUZZ_WRAPFD_H