libtorrent Namespace Reference


Classes

class  alert
class  alert_manager
struct  unhandled_alert
struct  handle_alert
struct  torrent_alert
struct  tracker_alert
struct  tracker_warning_alert
struct  tracker_reply_alert
struct  tracker_announce_alert
struct  hash_failed_alert
struct  peer_ban_alert
struct  peer_error_alert
struct  invalid_request_alert
struct  torrent_finished_alert
struct  url_seed_alert
struct  file_error_alert
struct  metadata_failed_alert
struct  metadata_received_alert
struct  listen_failed_alert
struct  fastresume_rejected_alert
struct  history_entry
struct  bw_queue_entry
struct  bandwidth_limit
struct  bandwidth_manager
struct  invalid_encoding
class  bt_peer_connection
class  buffer
struct  logger
struct  type_error
class  entry
struct  torrent_plugin
struct  peer_plugin
struct  file_error
class  file
struct  file_pool
struct  fingerprint
class  adler32_crc
class  hasher
class  http_parser
class  http_tracker_connection
class  invariant_access
struct  invariant_checker
struct  invariant_checker_impl
struct  ip_range
class  ip_filter
struct  peer_entry
struct  protocol_error
class  peer_connection
class  big_number
struct  peer_info
struct  peer_request
struct  piece_block_progress
struct  piece_block
class  piece_picker
class  policy
struct  resource_request
class  session_proxy
class  session
struct  session_settings
struct  dht_settings
struct  session_status
class  stat
struct  file_allocation_failed
class  storage
class  piece_manager
class  torrent
struct  duplicate_torrent
struct  invalid_handle
struct  torrent_status
struct  partial_piece_info
struct  torrent_handle
struct  file_entry
struct  file_slice
struct  announce_entry
struct  invalid_torrent_file
class  torrent_info
struct  tracker_request
struct  request_callback
struct  timeout_handler
struct  tracker_connection
class  tracker_manager
class  udp_tracker_connection
class  web_peer_connection
struct  disconnect_torrent
struct  check_postcondition
struct  set_to_zero
struct  thread_safe_storage
struct  slot_lock

Namespaces

namespace  aux
namespace  detail
namespace  dht

Typedefs

typedef big_number peer_id
typedef big_number sha1_hash
typedef boost::int64_t size_type
typedef asio::ip::tcp::socket stream_socket
typedef asio::ip::address address
typedef asio::ip::address_v4 address_v4
typedef asio::ip::address_v6 address_v6
typedef asio::ip::udp::socket datagram_socket
typedef asio::ip::tcp::acceptor socket_acceptor
typedef asio::io_service io_service
typedef std::pair< int, char
const * > 
country_entry

Enumerations

enum  { min_request_queue = 2, free_upload_amount = 4 * 16 * 1024 }

Functions

int saturated_add (int a, int b)
void allocate_resources (int resources, std::map< sha1_hash, boost::shared_ptr< torrent > > &torrents, resource_request torrent::*res)
void allocate_resources (int resources, std::map< tcp::endpoint, peer_connection * > &connections, resource_request peer_connection::*res)
void allocate_resources (int resources, std::vector< session * > &_sessions, resource_request session::*res)
template<class OutIt>
void bencode (OutIt out, const entry &e)
template<class InIt>
entry bdecode (InIt start, InIt end)
std::ostream & operator<< (std::ostream &os, const entry &e)
std::string TORRENT_EXPORT unescape_string (std::string const &s)
std::string TORRENT_EXPORT escape_string (const char *str, int len)
std::string TORRENT_EXPORT escape_path (const char *str, int len)
boost::shared_ptr< torrent_plugincreate_logger_plugin (torrent *)
boost::shared_ptr< torrent_plugincreate_metadata_plugin (torrent *)
boost::shared_ptr< torrent_plugincreate_ut_pex_plugin (torrent *)
TORRENT_EXPORT std::string identify_client (const peer_id &p)
TORRENT_EXPORT boost::optional
< fingerprint
client_fingerprint (peer_id const &p)
template<class T>
void check_invariant (T const &x)
template<class T>
invariant_checker_impl< T > make_invariant_checker (T const &x)
bool operator<= (address const &lhs, address const &rhs)
TORRENT_EXPORT void intrusive_ptr_add_ref (peer_connection const *)
TORRENT_EXPORT void intrusive_ptr_release (peer_connection const *)
std::ostream & operator<< (std::ostream &os, big_number const &peer)
std::istream & operator>> (std::istream &is, big_number &peer)
void request_a_block (torrent &t, peer_connection &c, std::vector< peer_connection * > ignore=std::vector< peer_connection * >())
template<class InIter, class OutIter, class Distance>
void random_sample_n (InIter start, InIter end, OutIter out, Distance n)
TORRENT_EXPORT std::vector
< std::pair< size_type,
std::time_t > > 
get_filesizes (torrent_info const &t, boost::filesystem::path p)
TORRENT_EXPORT bool match_filesizes (torrent_info const &t, boost::filesystem::path p, std::vector< std::pair< size_type, std::time_t > > const &sizes, std::string *error=0)
TORRENT_EXPORT std::string base64encode (const std::string &s)
TORRENT_EXPORT int gzip_header (const char *buf, int size)
TORRENT_EXPORT boost::tuple
< std::string, std::string,
int, std::string > 
parse_url_components (std::string url)
TORRENT_EXPORT bool inflate_gzip (std::vector< char > &buffer, tracker_request const &req, request_callback *requester, int maximum_tracker_response_length)
TORRENT_EXPORT void intrusive_ptr_add_ref (timeout_handler const *)
TORRENT_EXPORT void intrusive_ptr_release (timeout_handler const *)
void utf8_wchar (const std::string &utf8, std::wstring &wide)
std::wstring utf8_wchar (const std::string &str)
void wchar_utf8 (const std::wstring &wide, std::string &utf8)
std::string wchar_utf8 (const std::wstring &str)
int div_round_up (int numerator, int denominator)
std::pair< int, int > req_to_offset (std::pair< int, int > req, int total_size)
std::pair< int, int > offset_to_req (std::pair< int, int > offset, int total_size)
void close_socket_ignore_error (boost::shared_ptr< stream_socket > s)
 catch (std::exception &e)
 catch (...)
bool exclusively_requested_from (piece_picker::downloading_piece const &p, int num_blocks_in_piece, tcp::endpoint peer)
std::vector< std::pair
< size_type, std::time_t > > 
get_filesizes (torrent_info const &t, path p)
bool match_filesizes (torrent_info const &t, path p, std::vector< std::pair< size_type, std::time_t > > const &sizes, std::string *error)
bool compare_first (country_entry const &lhs, country_entry const &rhs)
void throw_invalid_handle ()
template<class Ret, class F>
Ret call_member (session_impl *ses, aux::checker_impl *chk, sha1_hash const &hash, F f)
bool range_contains (peer_request const &range, peer_request const &req)

Variables

const int max_bandwidth_block_size = 33000
const int min_bandwidth_block_size = 4000
const pt::time_duration window_size = pt::seconds(1)
const char extension_name [] = "ut_pex"


Typedef Documentation

Definition at line 86 of file socket.hpp.

Definition at line 87 of file socket.hpp.

Definition at line 88 of file socket.hpp.

typedef std::pair<int, char const*> libtorrent::country_entry [static]

Definition at line 1394 of file torrent.cpp.

Definition at line 89 of file socket.hpp.

Definition at line 91 of file socket.hpp.

Definition at line 141 of file peer_id.hpp.

Definition at line 142 of file peer_id.hpp.

Definition at line 48 of file size_type.hpp.

Definition at line 90 of file socket.hpp.

Definition at line 85 of file socket.hpp.


Enumeration Type Documentation

anonymous enum

Enumerator:
min_request_queue 
free_upload_amount 

Definition at line 62 of file policy.hpp.


Function Documentation

void libtorrent::allocate_resources ( int  resources,
std::vector< session * > &  _sessions,
resource_request session::*  res 
)

void libtorrent::allocate_resources ( int  resources,
std::map< tcp::endpoint, peer_connection * > &  connections,
resource_request peer_connection::*  res 
)

void libtorrent::allocate_resources ( int  resources,
std::map< sha1_hash, boost::shared_ptr< torrent > > &  torrents,
resource_request torrent::*  res 
)

std::string libtorrent::base64encode ( const std::string &  s  ) 

template<class InIt>
entry libtorrent::bdecode ( InIt  start,
InIt  end 
) [inline]

template<class OutIt>
void libtorrent::bencode ( OutIt  out,
const entry &  e 
) [inline]

template<class Ret, class F>
Ret libtorrent::@291::call_member ( session_impl ses,
aux::checker_impl *  chk,
sha1_hash const &  hash,
f 
) [inline, static]

libtorrent::catch (   ...  ) 

libtorrent::catch ( std::exception &  e  ) 

template<class T>
void libtorrent::check_invariant ( T const &  x  )  [inline]

boost::optional< fingerprint > libtorrent::client_fingerprint ( peer_id const &  p  ) 

void libtorrent::close_socket_ignore_error ( boost::shared_ptr< stream_socket >  s  ) 

Definition at line 1365 of file peer_connection.cpp.

References simple_client::e.

Referenced by libtorrent::peer_connection::disconnect().

bool libtorrent::@290::compare_first ( country_entry const &  lhs,
country_entry const &  rhs 
) [static]

Definition at line 1396 of file torrent.cpp.

boost::shared_ptr< torrent_plugin > libtorrent::create_logger_plugin ( torrent *   ) 

Definition at line 199 of file logger.cpp.

boost::shared_ptr< torrent_plugin > libtorrent::create_metadata_plugin ( torrent *  t  ) 

Definition at line 516 of file metadata_transfer.cpp.

Referenced by main(), and test_transfer().

boost::shared_ptr< torrent_plugin > libtorrent::create_ut_pex_plugin ( torrent *  t  ) 

int libtorrent::@281::div_round_up ( int  numerator,
int  denominator 
) [static]

Definition at line 38 of file metadata_transfer.cpp.

Referenced by req_to_offset().

std::string libtorrent::escape_path ( const char *  str,
int  len 
)

std::string libtorrent::escape_string ( const char *  str,
int  len 
)

Definition at line 59 of file escape_string.cpp.

References count.

Referenced by libtorrent::http_tracker_connection::http_tracker_connection().

bool libtorrent::@283::exclusively_requested_from ( piece_picker::downloading_piece const &  p,
int  num_blocks_in_piece,
tcp::endpoint  peer 
) [static]

std::vector<std::pair<size_type, std::time_t> > libtorrent::get_filesizes ( torrent_info const &  t,
path  p 
)

TORRENT_EXPORT std::vector<std::pair<size_type, std::time_t> > libtorrent::get_filesizes ( torrent_info const &  t,
boost::filesystem::path  p 
)

int libtorrent::gzip_header ( const char *  buf,
int  size 
)

Definition at line 62 of file tracker_manager.cpp.

References FCOMMENT, FEXTRA, FHCRC, FNAME, FRESERVED, GZIP_MAGIC0, GZIP_MAGIC1, and Z_DEFLATED.

Referenced by inflate_gzip().

std::string libtorrent::identify_client ( const peer_id p  ) 

bool libtorrent::inflate_gzip ( std::vector< char > &  buffer,
tracker_request const &  req,
request_callback requester,
int  maximum_tracker_response_length 
)

void libtorrent::intrusive_ptr_add_ref ( timeout_handler const *  c  ) 

void libtorrent::intrusive_ptr_add_ref ( peer_connection const *  c  ) 

Definition at line 34 of file peer_connection.cpp.

References libtorrent::peer_connection::m_refs.

void libtorrent::intrusive_ptr_release ( timeout_handler const *  c  ) 

void libtorrent::intrusive_ptr_release ( peer_connection const *  c  ) 

Definition at line 41 of file peer_connection.cpp.

References libtorrent::peer_connection::m_refs.

template<class T>
invariant_checker_impl<T> libtorrent::make_invariant_checker ( T const &  x  )  [inline]

Definition at line 63 of file invariant_check.hpp.

bool libtorrent::match_filesizes ( torrent_info const &  t,
path  p,
std::vector< std::pair< size_type, std::time_t > > const &  sizes,
std::string *  error 
)

TORRENT_EXPORT bool libtorrent::match_filesizes ( torrent_info const &  t,
boost::filesystem::path  p,
std::vector< std::pair< size_type, std::time_t > > const &  sizes,
std::string *  error = 0 
)

std::pair<int, int> libtorrent::@281::offset_to_req ( std::pair< int, int >  offset,
int  total_size 
) [static]

Definition at line 55 of file metadata_transfer.cpp.

References req_to_offset().

std::ostream& libtorrent::operator<< ( std::ostream &  os,
big_number const &  peer 
) [inline]

Definition at line 144 of file peer_id.hpp.

References libtorrent::big_number::begin(), and libtorrent::big_number::end().

std::ostream& libtorrent::operator<< ( std::ostream &  os,
const entry &  e 
) [inline]

Definition at line 203 of file entry.hpp.

References libtorrent::entry::print().

bool libtorrent::operator<= ( address const &  lhs,
address const &  rhs 
) [inline]

Definition at line 57 of file ip_filter.hpp.

std::istream& libtorrent::operator>> ( std::istream &  is,
big_number &  peer 
) [inline]

Definition at line 156 of file peer_id.hpp.

References libtorrent::big_number::begin(), c, and libtorrent::big_number::end().

tuple< std::string, std::string, int, std::string > libtorrent::parse_url_components ( std::string  url  ) 

template<class InIter, class OutIter, class Distance>
void libtorrent::random_sample_n ( InIter  start,
InIter  end,
OutIter  out,
Distance  n 
) [inline]

Definition at line 45 of file random_sample.hpp.

References libtorrent::dht::distance().

Referenced by libtorrent::dht::node_impl::on_find().

bool libtorrent::@296::range_contains ( peer_request const &  range,
peer_request const &  req 
) [static]

std::pair<int, int> libtorrent::@281::req_to_offset ( std::pair< int, int >  req,
int  total_size 
) [static]

Definition at line 43 of file metadata_transfer.cpp.

References div_round_up().

Referenced by offset_to_req().

void libtorrent::request_a_block ( torrent t,
peer_connection c,
std::vector< peer_connection * >  ignore = std::vector<peer_connection*>() 
)

int libtorrent::saturated_add ( int  a,
int  b 
)

void libtorrent::@291::throw_invalid_handle (  )  [static]

std::string libtorrent::unescape_string ( std::string const &  s  ) 

Definition at line 18 of file escape_string.cpp.

std::wstring libtorrent::utf8_wchar ( const std::string &  str  )  [inline]

Definition at line 139 of file utf8.hpp.

References utf8_wchar().

Referenced by utf8_wchar().

void libtorrent::utf8_wchar ( const std::string &  utf8,
std::wstring &  wide 
) [inline]

Definition at line 133 of file utf8.hpp.

References utf8_wchar().

Referenced by utf8_native(), and utf8_wchar().

std::string libtorrent::wchar_utf8 ( const std::wstring &  str  )  [inline]

Definition at line 152 of file utf8.hpp.

References wchar_utf8().

Referenced by wchar_utf8().

void libtorrent::wchar_utf8 ( const std::wstring &  wide,
std::string &  utf8 
) [inline]

Definition at line 146 of file utf8.hpp.

References wchar_utf8().

Referenced by throw_exception(), and wchar_utf8().


Variable Documentation

const char libtorrent::extension_name[] = "ut_pex" [static]

Definition at line 28 of file ut_pex.cpp.

const pt::time_duration libtorrent::window_size = pt::seconds(1) [static]


Generated on Sun May 25 00:21:39 2008 by  doxygen 1.5.6