package org.klomp.snark
I2P version of the Snark BitTorrent client, enhanced for I2P: peers are I2P destinations, torrents can be served anonymously as hidden services, and metadata carries I2P-specific comment fields. The main entry points are SnarkManager and the web interface in org.klomp.snark.web.
See also: BEP 3 • BEP 5 (DHT).
- ClassDescriptionSelf-contained bandwidth sampler for the snark screen log graph.Bandwidth and bandwidth limits.Bandwidth and bandwidth limits.Container of a byte array representing set and unset bits for torrent piece availability.Retrieves bandwidth limits from an I2P router via I2CP.Registry of known BitTorrent client identities.One impersonatable client: peer ID prefix plus the matching tracker User-Agent and extension handshake "v" strings.A full bitfield, immutable, to save memory and time.Callback for Snark events.Accepts incoming I2P connections and routes them to the appropriate PeerAcceptor.Callback interface for monitoring PeerCoordinator state changes.Callback used to fetch data.Tracks the pieces a peer said it no longer has (BEP 54 dont_have), so the piece is not re-requested from that peer even if it re-announces HAVE, until the remembered state expires.REF: BEP 10 Extension Protocol.I2P-specific utilities and context management for I2PSnark.Periodically ramp the tunnel count with connected peers, and reduce it once nothing is running.Standalone launcher that forwards magnet links, torrent URLs, info hashes, or torrent file paths to the I2PSnark browser API (POST /_add).Simple state for the download of the metainfo, shared between Peer and ExtensionHandler.Magnet URI parser and handler for BitTorrent magnet links.Represents a BitTorrent protocol message for peer communication.Holds all information extracted from a torrent file.Test utility for extracting and displaying MP3 metadata tags.Represents a piece of a torrent being downloaded, storing partial data either on the heap or in a temporary file if the piece is large.Represents a peer in the BitTorrent network, managing all public information and communication with that peer.Accepts incoming connections from peers.A unique exception so we can tell the ConnectionAcceptor about non-BT connections.TimerTask that checks for good/bad up/downloader.Handles incoming BitTorrent protocol messages from a peer.
This class runs in a separate thread to continuously read and parse incoming messages, delegating them to the appropriate PeerState handlers.Manages outgoing BitTorrent protocol messages to a peer.
This class maintains a queue of outgoing messages and handles bandwidth limiting, message prioritization, and reliable delivery to the peer.Coordinates peer activities for a single torrent including upload/download management, peer selection, piece distribution, and bandwidth allocation.Thread-safe collection for managing PeerCoordinator instances across multiple torrents.Store the address information about a peer.Listener for Peer events.Manages the state and protocol logic for a BitTorrent peer connection.
This class tracks peer interest/choking status, piece availability, request queues, and handles all BitTorrent protocol message processing.Represents a torrent piece and tracks which peers have it and are requesting it.Holds all information needed for a partial piece request.Callback interface for the end of the shutdown sequence.Main Snark program startup class.A unique exception class to blame the router that can be caught by SnarkManager.Simple command line access to various utilities.Central manager for multiple torrent downloads and the I2PSnark application.Result of a DHT metadata lookup — name plus combined size of data files.Main snark startup class for staticly linking with gcj.Storage manages torrent data files on disk for I2PSnark.Classified storage failures.Callback interface for monitoring Storage state changes and progress.A structure for torrent creation filters.Bundles the transient I2P destination, session, server socket, DHT instance, and UDP tracker client for one torrent or for a pool of torrents, so that all of a torrent's network activity goes out through its own identity.Represents a known BitTorrent tracker with its configuration and capabilities.Handles communication with BitTorrent trackers and DHT to discover new peers.The data structure for the tracker response.One of these for all trackers and info hashes.Represents a response from a UDP tracker.
This class encapsulates the tracker's response including peer lists, interval information, and any error messages.Handles the request to update the router by firing up a magnet.The downloader for router signed updates.URI Holder.BEP 19.