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.

38 lignes
943 B

  1. #ifndef BTPD_NET_H
  2. #define BTPD_NET_H
  3. #define MSG_CHOKE 0
  4. #define MSG_UNCHOKE 1
  5. #define MSG_INTEREST 2
  6. #define MSG_UNINTEREST 3
  7. #define MSG_HAVE 4
  8. #define MSG_BITFIELD 5
  9. #define MSG_REQUEST 6
  10. #define MSG_PIECE 7
  11. #define MSG_CANCEL 8
  12. #define WRITE_TIMEOUT (& (struct timeval) { 60, 0 })
  13. extern struct peer_tq net_unattached;
  14. extern struct peer_tq net_bw_readq;
  15. extern struct peer_tq net_bw_writeq;
  16. extern unsigned net_npeers;
  17. void net_init(void);
  18. void net_add_torrent(struct torrent *tp);
  19. void net_del_torrent(struct torrent *tp);
  20. int net_torrent_has_peer(struct net *n, const uint8_t *id);
  21. void net_read_cb(int sd, short type, void *arg);
  22. void net_write_cb(int sd, short type, void *arg);
  23. int net_connect2(struct sockaddr *sa, socklen_t salen, int *sd);
  24. int net_connect(const char *ip, int port, int *sd);
  25. void net_write32(void *buf, uint32_t num);
  26. uint32_t net_read32(const void *buf);
  27. #endif