|
ELinks 0.19.1
|
#include "main/timer.h"#include "network/progress.h"#include "network/socket.h"#include "network/state.h"#include "protocol/protocol.h"#include "protocol/uri.h"#include "util/error.h"#include "util/lists.h"#include "util/md5.h"#include "util/sha1.h"#include "util/time.h"

Data Structures | |
| For showing tracker failure responses to the user. More... | |
| struct | bittorrent_peer_request |
| The peer request matches information sent in the request and cancel messages in the peer-wire protocol. More... | |
| struct | bittorrent_peer_status |
| struct | bittorrent_peer_stats |
| struct | bittorrent_peer_connection |
| Peer connection information. More... | |
| struct | bittorrent_tracker_connection |
| This stores info about tracker requests. More... | |
| struct | bittorrent_peer |
| Information about peers returned by the tracker. More... | |
| struct | bittorrent_file |
| Information about a file in the torrent. More... | |
| struct | bittorrent_meta |
| Static information from the .torrent metafile. More... | |
| struct | bittorrent_connection |
| This stores info about an active BitTorrent connection. More... | |
| struct | bittorrent_const_string |
| Like struct string, except the data is const and not freed via this structure. More... | |
Macros | |
| #define | BITTORRENT_DEFAULT_SHARING_RATE 0.250 |
| The least acceptable default sharing rate. | |
| #define | BITTORRENT_DEFAULT_CHOKE_INTERVAL 10 |
| The number of seconds between updating the connection state and most importantly choke and unchoke peer connections. | |
| #define | BITTORRENT_REQUEST_LENGTH (1 << 14) |
| #define | BITTORRENT_REQUEST_ACCEPT_LENGTH (1 << 23) |
| The length regarded as ``typical'' by the community wiki specification. | |
| #define | BITTORRENT_MESSAGE_MAX_SIZE (1 << 23) |
| The maximum size to allow a peer message to have. | |
| #define | bittorrent_id_is_empty(id) |
| Check if the ID has been set. | |
Typedefs | |
| typedef sha1_digest_bin_T | bittorrent_id_T |
| 20-byte string ID used for both peer IDs and info-hashes. | |
| typedef signed char | bittorrent_message_id_T |
| typedef int | bittorrent_message_id_TT |
| typedef void(* | bittorrent_fetch_callback_T) (void *, struct connection_state, struct bittorrent_const_string *) |
| typedef unsigned char | bittorrent_blacklist_flags_T |
Variables | |
| const bittorrent_id_T | BITTORRENT_NULL_ID |
| Special peer ID used for determining whether an ID has been set. | |
| #define BITTORRENT_DEFAULT_CHOKE_INTERVAL 10 |
The number of seconds between updating the connection state and most importantly choke and unchoke peer connections.
| #define BITTORRENT_DEFAULT_SHARING_RATE 0.250 |
The least acceptable default sharing rate.
| #define bittorrent_id_is_empty | ( | id | ) |
Check if the ID has been set.
| #define BITTORRENT_MESSAGE_MAX_SIZE (1 << 23) |
The maximum size to allow a peer message to have.
| #define BITTORRENT_REQUEST_ACCEPT_LENGTH (1 << 23) |
The length regarded as ``typical'' by the community wiki specification.
Looks like Bram uses 2^14 here. Used for the protocol.bittorrent.request_length option */ #define BITTORRENT_REQUEST_LENGTH
/** The length of requested blocks of pieces should not exceed 2^17 bytes. Used for the protocol.bittorrent.max_request_length option. Bram uses 2^23 here.
| #define BITTORRENT_REQUEST_LENGTH (1 << 14) |
| typedef unsigned char bittorrent_blacklist_flags_T |
| typedef void(* bittorrent_fetch_callback_T) (void *, struct connection_state, struct bittorrent_const_string *) |
| typedef sha1_digest_bin_T bittorrent_id_T |
20-byte string ID used for both peer IDs and info-hashes.
| typedef signed char bittorrent_message_id_T |
| typedef int bittorrent_message_id_TT |
BitTorrent peer-wire state and message IDs.
| enum bittorrent_state |
BitTorrent error states.
| enum meta_type |
| void add_bittorrent_blacklist_flags | ( | bittorrent_id_T | peer_id, |
| bittorrent_blacklist_flags_T | flags ) |
| void add_bittorrent_peer_request | ( | struct bittorrent_peer_status * | status, |
| uint32_t | piece, | ||
| uint32_t | offset, | ||
| uint32_t | length ) |
| enum bittorrent_state add_peer_to_bittorrent_pool | ( | struct bittorrent_connection * | bittorrent, |
| bittorrent_id_T | id, | ||
| int | port, | ||
| const char * | ip, | ||
| int | iplen ) |
| int bittorrent_id_is_known | ( | struct bittorrent_connection * | bittorrent, |
| bittorrent_id_T | id ) |
| int bittorrent_piece_is_valid | ( | struct bittorrent_meta * | meta, |
| uint32_t | piece, | ||
| char * | data, | ||
| uint32_t | datalen ) |
| void del_bittorrent_blacklist_flags | ( | bittorrent_id_T | peer_id, |
| bittorrent_blacklist_flags_T | flags ) |
| void del_bittorrent_peer_request | ( | struct bittorrent_peer_status * | status, |
| uint32_t | piece, | ||
| uint32_t | offset, | ||
| uint32_t | length ) |
| void done_bittorrent_blacklist | ( | void | ) |
| void done_bittorrent_fetch | ( | struct bittorrent_fetcher ** | fetcher_ref | ) |
| void done_bittorrent_message | ( | struct bittorrent_message * | message | ) |
| void done_bittorrent_meta | ( | struct bittorrent_meta * | meta | ) |
| bittorrent_blacklist_flags_T get_bittorrent_blacklist_flags | ( | bittorrent_id_T | peer_id | ) |
| struct bittorrent_peer_request * get_bittorrent_peer_request | ( | struct bittorrent_peer_status * | status, |
| uint32_t | piece, | ||
| uint32_t | offset, | ||
| uint32_t | length ) |
|
inlinestatic |
| char * get_hexed_bittorrent_id | ( | bittorrent_id_T | id | ) |
| struct bittorrent_peer * get_peer_from_bittorrent_pool | ( | struct bittorrent_connection * | bittorrent, |
| bittorrent_id_T | id ) |
| char * get_peer_id | ( | bittorrent_id_T | peer | ) |
| const char * get_peer_message | ( | bittorrent_message_id_T | message_id | ) |
| struct bittorrent_fetcher * init_bittorrent_fetch | ( | struct bittorrent_fetcher ** | fetcher_ref, |
| struct uri * | uri, | ||
| bittorrent_fetch_callback_T | callback, | ||
| void * | data, | ||
| int | delete_ ) |
| void init_bittorrent_peer_id | ( | bittorrent_id_T | peer_id | ) |
|
extern |
Special peer ID used for determining whether an ID has been set.