You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef RSPAMD_FILTER_H
  2. #define RSPAMD_FILTER_H
  3. #include <sys/types.h>
  4. #ifndef HAVE_OWN_QUEUE_H
  5. #include <sys/queue.h>
  6. #else
  7. #include "queue.h"
  8. #endif
  9. #include <glib.h>
  10. struct worker_task;
  11. typedef double (*metric_cons_func)(struct worker_task *task, const char *metric_name);
  12. typedef void (*filter_func)(struct worker_task *task);
  13. enum filter_type { C_FILTER, PERL_FILTER };
  14. struct filter {
  15. char *func_name;
  16. enum filter_type type;
  17. LIST_ENTRY (filter) next;
  18. };
  19. struct metric {
  20. char *name;
  21. char *func_name;
  22. metric_cons_func func;
  23. double required_score;
  24. };
  25. struct metric_result {
  26. struct metric *metric;
  27. double score;
  28. GHashTable *symbols;
  29. };
  30. int process_filters (struct worker_task *task);
  31. void insert_result (struct worker_task *task, const char *metric_name, const char *symbol, u_char flag);
  32. void make_composites (struct worker_task *task);
  33. double factor_consolidation_func (struct worker_task *task, const char *metric_name);
  34. #endif