1 // Copyright Daniel Wallin 2006. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #include <libtorrent/session.hpp>
6 #include <boost/python.hpp>
8 using namespace boost::python
;
9 using namespace libtorrent
;
11 void bind_session_settings()
13 class_
<session_settings
>("session_settings")
14 .def_readwrite("user_agent", &session_settings::user_agent
)
15 .def_readwrite("tracker_completion_timeout", &session_settings::tracker_completion_timeout
)
16 .def_readwrite("tracker_receive_timeout", &session_settings::tracker_receive_timeout
)
17 .def_readwrite("tracker_maximum_response_length", &session_settings::tracker_maximum_response_length
)
18 .def_readwrite("piece_timeout", &session_settings::piece_timeout
)
19 .def_readwrite("request_queue_time", &session_settings::request_queue_time
)
20 .def_readwrite("max_allowed_in_request_queue", &session_settings::max_allowed_in_request_queue
)
21 .def_readwrite("max_out_request_queue", &session_settings::max_out_request_queue
)
22 .def_readwrite("whole_pieces_threshold", &session_settings::whole_pieces_threshold
)
23 .def_readwrite("peer_timeout", &session_settings::peer_timeout
)
24 .def_readwrite("urlseed_timeout", &session_settings::urlseed_timeout
)
25 .def_readwrite("urlseed_pipeline_size", &session_settings::urlseed_pipeline_size
)
26 .def_readwrite("file_pool_size", &session_settings::file_pool_size
)
27 .def_readwrite("allow_multiple_connections_per_ip", &session_settings::allow_multiple_connections_per_ip
)
28 .def_readwrite("max_failcount", &session_settings::max_failcount
)
29 .def_readwrite("min_reconnect_time", &session_settings::min_reconnect_time
)
30 .def_readwrite("peer_connect_timeout", &session_settings::peer_connect_timeout
)
31 .def_readwrite("ignore_limits_on_local_network", &session_settings::ignore_limits_on_local_network
)
32 .def_readwrite("connection_speed", &session_settings::connection_speed
)
33 .def_readwrite("send_redundant_have", &session_settings::send_redundant_have
)
34 .def_readwrite("lazy_bitfields", &session_settings::lazy_bitfields
)
35 .def_readwrite("inactivity_timeout", &session_settings::inactivity_timeout
)
36 .def_readwrite("unchoke_interval", &session_settings::unchoke_interval
)
37 .def_readwrite("active_downloads", &session_settings::active_downloads
)
38 .def_readwrite("active_seeds", &session_settings::active_seeds
)
39 .def_readwrite("active_limit", &session_settings::active_limit
)
40 .def_readwrite("dont_count_slow_torrents", &session_settings::dont_count_slow_torrents
)
41 .def_readwrite("auto_manage_interval", &session_settings::auto_manage_interval
)
42 .def_readwrite("share_ratio_limit", &session_settings::share_ratio_limit
)
43 .def_readwrite("seed_time_ratio_limit", &session_settings::seed_time_ratio_limit
)
44 .def_readwrite("seed_time_limit", &session_settings::seed_time_limit
)
45 .def_readwrite("auto_scraped_interval", &session_settings::auto_scrape_interval
)
46 .def_readwrite("peer_tos", &session_settings::peer_tos
)
47 #ifndef TORRENT_DISABLE_DHT
48 .def_readwrite("use_dht_as_fallback", &session_settings::use_dht_as_fallback
)
52 enum_
<proxy_settings::proxy_type
>("proxy_type")
53 .value("none", proxy_settings::none
)
54 .value("socks4", proxy_settings::socks4
)
55 .value("socks5", proxy_settings::socks5
)
56 .value("socks5_pw", proxy_settings::socks5_pw
)
57 .value("http", proxy_settings::http
)
58 .value("http_pw", proxy_settings::http_pw
)
60 class_
<proxy_settings
>("proxy_settings")
61 .def_readwrite("hostname", &proxy_settings::hostname
)
62 .def_readwrite("port", &proxy_settings::port
)
63 .def_readwrite("password", &proxy_settings::password
)
64 .def_readwrite("username", &proxy_settings::username
)
65 .def_readwrite("type", &proxy_settings::type
)
68 #ifndef TORRENT_DISABLE_ENCRYPTION
69 enum_
<pe_settings::enc_policy
>("enc_policy")
70 .value("forced", pe_settings::forced
)
71 .value("enabled", pe_settings::enabled
)
72 .value("disabled", pe_settings::disabled
)
75 enum_
<pe_settings::enc_level
>("enc_level")
76 .value("rc4", pe_settings::rc4
)
77 .value("plaintext", pe_settings::plaintext
)
78 .value("both", pe_settings::both
)
81 class_
<pe_settings
>("pe_settings")
82 .def_readwrite("out_enc_policy", &pe_settings::out_enc_policy
)
83 .def_readwrite("in_enc_policy", &pe_settings::in_enc_policy
)
84 .def_readwrite("allowed_enc_level", &pe_settings::allowed_enc_level
)
85 .def_readwrite("prefer_rc4", &pe_settings::prefer_rc4
)