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.

71 lines
1.4 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 "subr.h"
  17. #include "iobuf.h"
  18. #include "hashtable.h"
  19. #include "net_buf.h"
  20. #include "net_types.h"
  21. #include "net.h"
  22. #include "peer.h"
  23. #include "tlib.h"
  24. #include "torrent.h"
  25. #include "download.h"
  26. #include "upload.h"
  27. #include "content.h"
  28. #include "opts.h"
  29. #define DAEMON
  30. #include "btpd_if.h"
  31. #undef DAEMON
  32. #define BTPD_VERSION PACKAGE_NAME "/" PACKAGE_VERSION
  33. #define BTPD_L_ALL 0xffffffff
  34. #define BTPD_L_ERROR 0x00000001
  35. #define BTPD_L_TRACKER 0x00000002
  36. #define BTPD_L_CONN 0x00000004
  37. #define BTPD_L_MSG 0x00000008
  38. #define BTPD_L_BTPD 0x00000010
  39. #define BTPD_L_POL 0x00000020
  40. extern long btpd_seconds;
  41. void btpd_init(void);
  42. __attribute__((format (printf, 2, 3)))
  43. void btpd_log(uint32_t type, const char *fmt, ...);
  44. __attribute__((format (printf, 1, 2), noreturn))
  45. void btpd_err(const char *fmt, ...);
  46. __attribute__((malloc))
  47. void *btpd_malloc(size_t size);
  48. __attribute__((malloc))
  49. void *btpd_calloc(size_t nmemb, size_t size);
  50. void btpd_ev_add(struct event *ev, struct timeval *tv);
  51. void btpd_ev_del(struct event *ev);
  52. void btpd_shutdown(int grace_seconds);
  53. int btpd_is_stopping(void);
  54. const uint8_t *btpd_get_peer_id(void);
  55. #endif