A clone of btpd with my configuration changes.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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