From 72e0a35986e311ca65217967854799805dc3d2d7 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 17 Feb 2008 05:33:41 +0000 Subject: [PATCH] Add ip_filter to libtorrent bindings. --- libtorrent/bindings/python/src/docstrings.cpp | 3 ++- libtorrent/bindings/python/src/module.cpp | 2 ++ libtorrent/bindings/python/src/session.cpp | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libtorrent/bindings/python/src/docstrings.cpp b/libtorrent/bindings/python/src/docstrings.cpp index d6e473836..647e375cd 100755 --- a/libtorrent/bindings/python/src/docstrings.cpp +++ b/libtorrent/bindings/python/src/docstrings.cpp @@ -179,7 +179,8 @@ char const* session_start_natpmp_doc = ""; char const* session_stop_natpmp_doc = ""; - +char const* session_set_ip_filter_doc = + ""; // -- alert ----------------------------------------------------------------- char const* alert_doc = diff --git a/libtorrent/bindings/python/src/module.cpp b/libtorrent/bindings/python/src/module.cpp index 5c8d891d2..ea718388e 100755 --- a/libtorrent/bindings/python/src/module.cpp +++ b/libtorrent/bindings/python/src/module.cpp @@ -21,6 +21,7 @@ void bind_extensions(); void bind_peer_plugin(); void bind_torrent(); void bind_peer_info(); +void bind_ip_filter(); BOOST_PYTHON_MODULE(libtorrent) { @@ -44,5 +45,6 @@ BOOST_PYTHON_MODULE(libtorrent) bind_peer_plugin(); bind_torrent(); bind_peer_info(); + bind_ip_filter(); } diff --git a/libtorrent/bindings/python/src/session.cpp b/libtorrent/bindings/python/src/session.cpp index 91befd094..dbaee26b6 100755 --- a/libtorrent/bindings/python/src/session.cpp +++ b/libtorrent/bindings/python/src/session.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "gil.hpp" @@ -57,6 +58,7 @@ extern char const* session_stop_lsd_doc; extern char const* session_stop_upnp_doc; extern char const* session_start_natpmp_doc; extern char const* session_stop_natpmp_doc; +extern char const* session_set_ip_filter_doc; namespace { @@ -260,6 +262,7 @@ void bind_session() .def("stop_lsd", allow_threads(&session::stop_lsd), session_stop_lsd_doc) .def("start_natpmp", allow_threads(&session::start_natpmp), session_start_natpmp_doc) .def("stop_natpmp", allow_threads(&session::stop_natpmp), session_stop_natpmp_doc) + .def("set_ip_filter", allow_threads(&session::set_ip_filter), session_set_ip_filter_doc) ; register_ptr_to_python >();