Package-level declarations

Types

Link copied to clipboard
data class AddTorrentParams(val ti: TorrentInfo? = null, val infoSection: ByteArray? = null, val infoHashV1: Sha1Hash? = null, val infoHashV2: Sha256Hash? = null, val name: String = "", val savePath: String = "", val trackers: List<String> = emptyList(), val trackerTiers: List<Int> = emptyList(), val dhtNodes: List<Pair<String, Int>> = emptyList(), val urlSeeds: List<String> = emptyList(), val httpSeeds: List<String> = emptyList(), val trackerId: String = "", val peers: List<Endpoint> = emptyList(), val bannedPeers: List<Endpoint> = emptyList(), val filePriorities: List<Int> = emptyList(), val piecePriorities: List<Int> = emptyList(), val havePieces: Bitfield = Bitfield(), val verifiedPieces: Bitfield = Bitfield(), val unfinishedPieces: Map<Int, Bitfield> = emptyMap(), val renamedFiles: Map<Int, String> = emptyMap(), val merkleTrees: List<List<Digest32>> = emptyList(), val merkleTreeMask: List<List<Boolean>> = emptyList(), val verifiedLeafHashes: List<List<Boolean>> = emptyList(), val flags: Long = TorrentFlags.DEFAULT_FLAGS, val storageModeAllocate: Boolean = false, val maxUploads: Int = -1, val maxConnections: Int = -1, val uploadLimit: Int = -1, val downloadLimit: Int = -1, val totalUploaded: Long = 0, val totalDownloaded: Long = 0, val activeTime: Int = 0, val finishedTime: Int = 0, val seedingTime: Int = 0, val addedTime: Long = 0, val completedTime: Long = 0, val lastSeenComplete: Long = 0, val lastDownload: Long = 0, val lastUpload: Long = 0, val numComplete: Int = -1, val numIncomplete: Int = -1, val numDownloaded: Int = -1, val completeSent: Boolean = false)

The pure-Kotlin port of libtorrent's add_torrent_params (include/libtorrent/add_torrent_params.hpp): all the information needed to add a torrent to a session, and the in-memory shape that fast-resume data round-trips through.

Link copied to clipboard
data class Endpoint(val address: PeerAddress, val port: Int)

One IP endpoint (an address plus a TCP port). This is the pure-Kotlin stand-in for the tcp::endpoint values libtorrent stores in add_torrent_params::peers and banned_peers. On the wire (and in resume data) an endpoint is the address bytes in network order followed by a 16-bit big-endian port: 6 bytes for IPv4, 18 for IPv6 (see write_endpoint / read_v*_endpoint in socket_io.hpp).

Link copied to clipboard
object ResumeData

Fast-resume (de)serialisation: the pure-Kotlin port of libtorrent's write_resume_data() (src/write_resume_data.cpp) and read_resume_data() (src/read_resume_data.cpp).

Link copied to clipboard

The torrent_flags_t bit constants. This is a pure-Kotlin port of libtorrent's torrent_flags namespace (include/libtorrent/torrent_flags.hpp).