Skip to content

Commit

Permalink
Added libtorrent dht_storage_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 10, 2016
1 parent f85cb7c commit 2e3486d
Show file tree
Hide file tree
Showing 5 changed files with 1,707 additions and 222 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java
Expand Up @@ -157,6 +157,11 @@ public static void set_piece_hashes(create_torrent t, String p, error_code ec) {
libtorrent_jni.set_piece_hashes(create_torrent.getCPtr(t), t, p, error_code.getCPtr(ec), ec);
}

public static dht_storage_interface dht_default_storage_constructor(sha1_hash id, dht_settings settings) {
long cPtr = libtorrent_jni.dht_default_storage_constructor(sha1_hash.getCPtr(id), id, dht_settings.getCPtr(settings), settings);
return (cPtr == 0) ? null : new dht_storage_interface(cPtr, false);
}

public static boolean is_utp_stream_logging() {
return libtorrent_jni.is_utp_stream_logging();
}
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java
Expand Up @@ -2909,6 +2909,26 @@ public class libtorrent_jni {
public final static native int ed25519_signature_size_get();
public final static native int ed25519_scalar_size_get();
public final static native int ed25519_shared_secret_size_get();
public final static native void dht_storage_counters_torrents_set(long jarg1, dht_storage_counters jarg1_, int jarg2);
public final static native int dht_storage_counters_torrents_get(long jarg1, dht_storage_counters jarg1_);
public final static native void dht_storage_counters_peers_set(long jarg1, dht_storage_counters jarg1_, int jarg2);
public final static native int dht_storage_counters_peers_get(long jarg1, dht_storage_counters jarg1_);
public final static native void dht_storage_counters_immutable_data_set(long jarg1, dht_storage_counters jarg1_, int jarg2);
public final static native int dht_storage_counters_immutable_data_get(long jarg1, dht_storage_counters jarg1_);
public final static native void dht_storage_counters_mutable_data_set(long jarg1, dht_storage_counters jarg1_, int jarg2);
public final static native int dht_storage_counters_mutable_data_get(long jarg1, dht_storage_counters jarg1_);
public final static native long new_dht_storage_counters();
public final static native void delete_dht_storage_counters(long jarg1);
public final static native boolean dht_storage_interface_get_peers(long jarg1, dht_storage_interface jarg1_, long jarg2, sha1_hash jarg2_, boolean jarg3, boolean jarg4, long jarg5, entry jarg5_);
public final static native void dht_storage_interface_announce_peer(long jarg1, dht_storage_interface jarg1_, long jarg2, sha1_hash jarg2_, long jarg3, tcp_endpoint jarg3_, String jarg4, boolean jarg5);
public final static native boolean dht_storage_interface_get_immutable_item(long jarg1, dht_storage_interface jarg1_, long jarg2, sha1_hash jarg2_, long jarg3, entry jarg3_);
public final static native void dht_storage_interface_put_immutable_item(long jarg1, dht_storage_interface jarg1_, long jarg2, sha1_hash jarg2_, String jarg3, int jarg4, long jarg5, address jarg5_);
public final static native boolean dht_storage_interface_get_mutable_item(long jarg1, dht_storage_interface jarg1_, long jarg2, sha1_hash jarg2_, long jarg3, boolean jarg4, long jarg5, entry jarg5_);
public final static native void dht_storage_interface_put_mutable_item(long jarg1, dht_storage_interface jarg1_, long jarg2, sha1_hash jarg2_, String jarg3, int jarg4, String jarg5, long jarg6, String jarg7, String jarg8, int jarg9, long jarg10, address jarg10_);
public final static native void dht_storage_interface_tick(long jarg1, dht_storage_interface jarg1_);
public final static native long dht_storage_interface_counters(long jarg1, dht_storage_interface jarg1_);
public final static native void delete_dht_storage_interface(long jarg1);
public final static native long dht_default_storage_constructor(long jarg1, sha1_hash jarg1_, long jarg2, dht_settings jarg2_);
public final static native long new_address__SWIG_0();
public final static native long new_address__SWIG_1(long jarg1, address_v4 jarg1_);
public final static native long new_address__SWIG_2(long jarg1, address_v6 jarg1_);
Expand Down
6 changes: 6 additions & 0 deletions swig/libtorrent.i
Expand Up @@ -75,6 +75,8 @@
#include "libtorrent/torrent_status.hpp"
#include "libtorrent/ed25519.hpp"

#include "libtorrent/kademlia/dht_storage.hpp"

#include "libtorrent/extensions/ut_pex.hpp"
#include "libtorrent/extensions/ut_metadata.hpp"
#include "libtorrent/extensions/lt_trackers.hpp"
Expand Down Expand Up @@ -492,6 +494,8 @@ namespace std {
%ignore libtorrent::bitfield::begin;
%ignore libtorrent::bitfield::end;

%ignore libtorrent::dht::dht_storage_interface::get_mutable_item_seq;

%ignore boost::throws;
%ignore boost::detail::throws;
%ignore boost::asio::ip::address_v4::to_bytes;
Expand Down Expand Up @@ -600,6 +604,8 @@ namespace std {
%include "libtorrent/torrent_status.hpp"
%include "libtorrent/ed25519.hpp"

%include "libtorrent/kademlia/dht_storage.hpp"

namespace boost {

namespace asio {
Expand Down

0 comments on commit 2e3486d

Please sign in to comment.