output_modules.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * ZMap Copyright 2013 Regents of the University of Michigan
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy
  6. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  7. */
  8. #ifndef OUTPUT_MODULES_H
  9. #define OUTPUT_MODULES_H
  10. #include "../state.h"
  11. #include "../fieldset.h"
  12. // called at scanner initialization
  13. typedef int (*output_init_cb)(struct state_conf *, char **fields, int fieldslen);
  14. // called on packet receipt
  15. typedef int (*output_packet_cb)(fieldset_t *fs);
  16. // called periodically during the scan
  17. typedef int (*output_update_cb)(struct state_conf*,
  18. struct state_send*, struct state_recv*);
  19. typedef struct output_module {
  20. const char *name;
  21. int filter_duplicates;
  22. int filter_unsuccessful;
  23. unsigned update_interval;
  24. output_init_cb init;
  25. output_update_cb start;
  26. output_update_cb update;
  27. output_update_cb close;
  28. output_packet_cb process_ip;
  29. const char *helptext;
  30. } output_module_t;
  31. output_module_t* get_output_module_by_name(const char*);
  32. void print_output_modules(void);
  33. #endif // HEADER_OUTPUT_MODULES_H