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.

48 lignes
1.1 KiB

  1. #ifndef BTPD_TORRENT_H
  2. #define BTPD_TORRENT_H
  3. #define PIECE_BLOCKLEN (1 << 14)
  4. #define RELPATH_SIZE 41
  5. enum torrent_state {
  6. T_STARTING,
  7. T_ACTIVE,
  8. T_STOPPING
  9. };
  10. struct torrent {
  11. char relpath[RELPATH_SIZE];
  12. struct metainfo meta;
  13. enum torrent_state state;
  14. struct content *cm;
  15. struct tracker *tr;
  16. struct net *net;
  17. BTPDQ_ENTRY(torrent) entry;
  18. };
  19. BTPDQ_HEAD(torrent_tq, torrent);
  20. unsigned torrent_count(void);
  21. const struct torrent_tq *torrent_get_all(void);
  22. struct torrent *torrent_get(const uint8_t *hash);
  23. int torrent_start(const uint8_t *hash);
  24. void torrent_stop(struct torrent *tp);
  25. int torrent_set_links(const uint8_t *hash, const char *torrent,
  26. const char *content);
  27. off_t torrent_piece_size(struct torrent *tp, uint32_t piece);
  28. uint32_t torrent_piece_blocks(struct torrent *tp, uint32_t piece);
  29. uint32_t torrent_block_size(struct torrent *tp, uint32_t piece,
  30. uint32_t nblocks, uint32_t block);
  31. const char *torrent_name(struct torrent *tp);
  32. void torrent_on_cm_stopped(struct torrent *tp);
  33. void torrent_on_cm_started(struct torrent *tp);
  34. void torrent_on_tr_stopped(struct torrent *tp);
  35. #endif