1
0

dnsbl.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2019 Markus Hennecke <markus-hennecke@markus-hennecke.de>
  3. *
  4. * Permission to use, copy, modify, and distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef __DNSBL_H__
  17. #define __DNSBL_H__
  18. #include <sys/queue.h>
  19. #include <stdbool.h>
  20. struct spamlist {
  21. TAILQ_ENTRY(spamlist) entry;
  22. char *name;
  23. char *dns;
  24. };
  25. struct config {
  26. TAILQ_HEAD(, spamlist) lists;
  27. char *config_file;
  28. char *logfile;
  29. FILE *log;
  30. int autowhitelist;
  31. struct passwd *pw;
  32. };
  33. struct spamlist *spamlist_new(const char *, const char *);
  34. void spamlist_free(struct spamlist *);
  35. struct config *config_new(void);
  36. void config_free(struct config *);
  37. void config_add_spamlist(struct config *, const char *,
  38. const char *);
  39. bool config_parse(struct config *, const char *);
  40. bool config_check(struct config *);
  41. struct config *config_reload(struct config *);
  42. #endif // __DNSBL_H__