A clone of btpd with my configuration changes.
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.

63 lines
1.3 KiB

  1. #ifndef BTPD_H
  2. #define BTPD_H
  3. #include <sys/types.h>
  4. #include <sys/socket.h>
  5. #include <sys/time.h>
  6. #include <assert.h>
  7. #include <errno.h>
  8. #include <event.h>
  9. #include <inttypes.h>
  10. #include <limits.h>
  11. #include <stddef.h>
  12. #include <stdlib.h>
  13. #include "queue.h"
  14. #include "benc.h"
  15. #include "metainfo.h"
  16. #include "iobuf.h"
  17. #include "net_buf.h"
  18. #include "net.h"
  19. #include "peer.h"
  20. #include "torrent.h"
  21. #include "policy.h"
  22. #include "subr.h"
  23. #include "opts.h"
  24. #define BTPD_VERSION (PACKAGE_NAME "/" PACKAGE_VERSION)
  25. extern unsigned long btpd_seconds;
  26. #define BTPD_L_ALL 0xffffffff
  27. #define BTPD_L_ERROR 0x00000001
  28. #define BTPD_L_TRACKER 0x00000002
  29. #define BTPD_L_CONN 0x00000004
  30. #define BTPD_L_MSG 0x00000008
  31. #define BTPD_L_BTPD 0x00000010
  32. #define BTPD_L_POL 0x00000020
  33. void btpd_init(void);
  34. void btpd_log(uint32_t type, const char *fmt, ...);
  35. void btpd_err(const char *fmt, ...);
  36. void *btpd_malloc(size_t size);
  37. void *btpd_calloc(size_t nmemb, size_t size);
  38. void btpd_shutdown(void);
  39. void btpd_add_child(pid_t pid, void (*cb)(pid_t, void *), void *arg);
  40. struct torrent * btpd_get_torrent(const uint8_t *hash);
  41. const struct torrent_tq *btpd_get_torrents(void);
  42. void btpd_add_torrent(struct torrent *tp);
  43. void btpd_del_torrent(struct torrent *tp);
  44. unsigned btpd_get_ntorrents(void);
  45. const uint8_t *btpd_get_peer_id(void);
  46. #endif