Packages that use Hash
Package
Description
Address book application for fetching and maintaining I2P host databases from subscription sources.
Interfaces and factories for the base I2P SDK used to develop applications that communicate through I2P.
Provides a standard way for reading and writing messages transferred over I2P so that the recipient has an authenticated mechanism to reply to the sender.
Internal implementation of the I2P client SDK - the client side of the Invisible Internet Client Protocol (I2CP), separating implementation from the interfaces in
net.i2p.client. Naming service for resolving human-readable names (such as ident.i2p) into I2P destinations, providing a standard interface without JNDI complexity.
Implementation of a TCP-like (reliable, authenticated, in order) set of sockets for communicating over the IP-like (unreliable, unauthenticated, unordered) I2P messages.
Core cryptographic primitives used throughout I2P: symmetric ciphers (AES, ChaCha20), hashes (SHA-1, SHA-256, SHA-384, SHA-512), HMAC and HKDF key derivation, the ElGamal and DSA/EdDSA/RedDSA engines, key and certificate utilities, and the entropy harvester.
Common data structures used by the I2P protocols: Destination, LeaseSet, PublicKey, Signature, Certificate and their friends.
The Invisible Internet Client Protocol (I2CP) allows applications simplified access to I2P network without requiring them to deal with the issues involved with the Invisible Internet Network Protocol (I2NP).
Low-level messages sent between routers - the Invisible Internet Network Protocol (I2NP).
Router-specific data structures: RouterInfo and RouterIdentity with their transport addresses and capabilities, router key generation, and the optionally password-protected router private key file.
Implementation of preconfigured tunnels for clients and servers, including special-purpose tunnels for IRC, SOCKS, HTTP and streaming.
Definition-based incoming connection filter for server tunnels, with fine-grained access control by destination.
The I2P router application handles I2P network communication.
Router-side implementation of the Invisible Internet Client Protocol (I2CP): client sessions over plain or TLS sockets, message delivery, and lease and tunnel management on behalf of clients.
Router-specific cryptography: ElGamal+AES garlic encryption (ElGamalAESEngine), session key and tag caching for repeated peer communication (TransientSessionKeyManager), router-family shared keys (FamilyKeyCrypto), and the ratchet and pqc subpackages.
Simplified fake implementations of router interfaces (comm system and friends) for testing and embedded builds.
Garlic message creation, parsing and handling, and the outbound message jobs: one-shot sends, source routing and delivery status handling.
The router's default naming service, BlockfileNamingService, backed by the Metanotion BlockFile database (
net.metanotion) in hostsdb.dat. Network database message handling shared by all facades: database lookup jobs and local RouterInfo publication.
The Kademlia distributed hash table (DHT) network database: lookup, store and explore jobs, the data store, the floodfill variants, and lookup throttling.
Reseeding: fetching router info lists from reseed servers, web indexes or local files, validating them (signed SU3 update files and unsigned ZIP archives) and processing them to bootstrap into the network.
Peer profiles and capacity calculation, peer test jobs, peer selection for tunnel building, and the database and tunnel history used for peer selection.
Offline analysis tools for detecting Sybil attacks and malicious peer coordination by correlating peer relationships.
Transport framework: the transport lifecycle and pool management, connection handling and bandwidth throttling for the transports (NTCP2 over TCP, SSU over UDP) that carry I2P messages between routers, plus NAT traversal via UPnP and GeoIP country lookups.
NTCP2, the TCP transport: framed, ratchet-encrypted and mutually authenticated connections between routers.
SSU2, the UDP transport: datagram sessions with Holepunch peer discovery, plus the older SSU compatibility code.
Tunnel messages and the tunnel layer: the
TunnelManagerFacade, tunnel build request and reply processing, and the inbound and outbound tunnel structures. Tunnel pool management: pool lifecycle, peer selection, build scheduling and failure handling for client and exploratory tunnels.
Router utility classes: CoDel active queue management, time-decaying collections, a diagnostics ring buffer, CIDR matching, and password management.
Helpers and handlers for the router console user interface, packaged in routerconsole.war and accessible only from JSP files.
General utility classes shared across the core libraries and the router.
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.
BitTorrent distributed hash table (DHT) implementation following the Mainline protocol, for trackerless peer discovery.
Uses of Hash in net.i2p.addressbook
Methods in net.i2p.addressbook with parameters of type HashModifier and TypeMethodDescriptionprivate HostChecker.PingResultHostChecker.lookupLeaseSetRemotely(String hostname, Hash destHash, long startTime, long existingResponseTime) Perform remote LeaseSet lookup via floodfill network and record the result.private voidHostChecker.removeFromClientTracking(Hash destHash) Remove LeaseSet from client refresh tracking after HostChecker is done with it.Uses of Hash in net.i2p.client
Methods in net.i2p.client with parameters of type HashModifier and TypeMethodDescriptionI2PSession.lookupDest(Hash h) Lookup a Destination by Hash.I2PSession.lookupDest(Hash h, long maxWait) Lookup a Destination by Hash.I2PSession.lookupDest(Hash h, long maxWait, LookupCallback callback) Lookup a Destination by hash.Uses of Hash in net.i2p.client.datagram
Fields in net.i2p.client.datagram declared as HashMethods in net.i2p.client.datagram that return HashModifier and TypeMethodDescriptionI2PDatagramDissector.extractHash()Extract the hash of the payload of an I2P repliable datagram (previously loaded with the loadI2PDatagram() method), without verifying the datagram signature.I2PDatagramDissector.getHash()Extract the hash of the payload of an I2P repliable datagram (previously loaded with the loadI2PDatagram() method), verifying the datagram signature.Datagram3.getSender()The sender of an I2P repliable datagram (previously loaded with the load() method).Methods in net.i2p.client.datagram with parameters of type HashModifier and TypeMethodDescriptionstatic byte[]Datagram2.make(I2PAppContext ctx, I2PSession session, byte[] payload, Hash tohash) Make a repliable I2P datagram2 containing the specified payload.static byte[]Datagram2.make(I2PAppContext ctx, I2PSession session, byte[] payload, Hash tohash, Properties options) Make a repliable I2P datagram2 containing the specified payload.Constructors in net.i2p.client.datagram with parameters of type HashModifierConstructorDescriptionprivateDatagram3(Hash dest, byte[] data, Properties options) As returned fromDatagram3.load(I2PAppContext, I2PSession, byte[]).Uses of Hash in net.i2p.client.impl
Fields in net.i2p.client.impl declared as HashMethods in net.i2p.client.impl with parameters of type HashModifier and TypeMethodDescription(package private) voidI2PSessionImpl.destLookupFailed(Hash h) Called by the message handler on reception of DestReplyMessage.(package private) voidSubSession.destLookupFailed(Hash h) Called by the message handler on reception of DestReplyMessageI2PSessionImpl.lookupDest(Hash h) Blocking.I2PSessionImpl.lookupDest(Hash h, long maxWait) Blocking.I2PSessionImpl.lookupDest(Hash h, long maxWait, LookupCallback callback) Lookup a Destination by hostname.SubSession.lookupDest(Hash h) Blocking.SubSession.lookupDest(Hash h, long maxWait) Looks up a Destination, blocking up to the given wait for the answer.Constructors in net.i2p.client.impl with parameters of type HashModifierConstructorDescriptionLookupWaiter(Hash h) Waits for one destination lookup.LookupWaiter(Hash h, long nonce) Waits for a destination lookup by hash.LookupWaiter(Hash h, long nonce, LookupCallback callback) Waits for a destination lookup by hash, with a callback.Uses of Hash in net.i2p.client.naming
Methods in net.i2p.client.naming with parameters of type HashModifier and TypeMethodDescriptionSame asNamingService.lookupBase32(String, int)but with the SHA256 Hash precalculated This implementation returns null.NamingService.reverseLookup(Hash h) Reverse lookup a hash.NamingService.reverseLookupAll(Hash h) Reverse lookup a hash.Uses of Hash in net.i2p.client.streaming.impl
Fields in net.i2p.client.streaming.impl with type parameters of type HashModifier and TypeFieldDescriptionConnectionOptions._accessListAccess list.ConnectionOptions._blackListBlack list.private final ConcurrentHashMap<Hash, Long> ConnectionManager._cooldownWarnedWhen we last logged the "Delaying connect" cooldown WARN per destination.private final ConcurrentHashMap<Hash, Long> ConnectionManager._destFailuresPer-destination cooldown to avoid hammering unreachable peers.I2PSocketManagerFull._ecUnsupportedDoes not support EC.I2PSocketManagerFull._edUnsupportedDoes not support Ed.ConnectionManager._globalBlacklistDestinations blacklisted across all managers.private final ConcurrentHashMap<Hash, long[]> ConnectionManager._recentSynsPer-destination burst state for the sub-second SYN gate: value is a two-element array {burstStartMs, count}, updated at most once per validated SYN via compare-and-swap (replace).private final ObjectCounter<Hash> ConnectionManager._refusalCounterRolling refusals per destination, incremented each time the MAXIMUM streams gate refuses a SYN from that dest.private final ConcurrentHashMap<Hash, ConcurrentLinkedDeque<ConnectionManager.PooledConnection>> ConnectionManager._streamPoolsStream connection pool — reuses established streams to the same destination.private final ConcurrentHashMap<Long, Hash> ConnectionManager._streamReservationsReservation tokens: receive stream ID → the dest whose budget the stream was admitted under.private final ConcurrentHashMap<Hash, AtomicInteger> ConnectionManager._streamsByDestLive concurrent-stream count keyed by remote destination.private final ConcurrentHashMap<Hash, Integer> ConnectionManager._streamShrinkCandidatesReconciliation memory: whatConnectionManager.BanExpirylast observed for a dest whose ledger count exceeded the live connection table.private final ConcurrentHashMap<Hash, ConnectionManager.SynStrike> ConnectionManager._synBurstStrikesEach dest's most recent SYN-burst strikes: the start of the burst window that crossed the threshold, the time that strike was recorded, and how many distinct windows have tripped inside the current strike window.private final ConcurrentHashMap<Hash, String> ConnectionManager._tempBanReasonTrigger reason for an active temp-ban, kept alongside _tempBanUntil so the enforcement path can tell a client *why* it was banned (e.g.private final ConcurrentHashMap<Hash, Long> ConnectionManager._tempBanUntilTemporary bans keyed by destination hash -> bannedUntil epoch ms.I2PSocketManagerFull._userDsaOnlyDestinations pinned to DSA by configuration.private final ObjectCounter<Hash> ConnThrottler.counterOpen connections counted per peer.Methods in net.i2p.client.streaming.impl that return HashModifier and TypeMethodDescription(package private) static HashConnectionManager.consumeReservation(ConcurrentHashMap<Long, Hash> tokens, ConcurrentHashMap<Hash, AtomicInteger> ledger, long receiveStreamId) Consume the reservation token bound to a receive stream ID, releasing the dest budget slot it owns.private HashConnectionManager.releaseConnectionReservation(Connection con) Release whatever this connection still holds against a dest budget: first its reservation token, and only if no token was bound, its remote peer (a connection built outside the reservation protocol, so the slot must still be drained or the budget leaks forever).private HashConnectionManager.releaseReservation(long receiveStreamId) Consume the reservation bound to a receive stream ID, releasing its slot.Methods in net.i2p.client.streaming.impl that return types with arguments of type HashModifier and TypeMethodDescriptionConnectionOptions.getAccessList()Access list.ConnectionOptions.getBlacklist()Destinations refused outright, consulted when blacklisting is enabled.ConnectionManager.observedStreamCounts()Live connection count per dest, preferring the reservation token (the dest that was actually charged at admission) and falling back to the connection's remote peer for anything bound outside the protocol.ConnectionManager.tokenStreamCounts()Bound reservation tokens per dest: the ABA floor forConnectionManager.reconcileStreamCount(int, int, Integer, int).Methods in net.i2p.client.streaming.impl with parameters of type HashModifier and TypeMethodDescription(package private) static ConnectionManager.SynBurstActionConnectionManager.applySynBurstStrike(ConcurrentHashMap<Hash, ConnectionManager.SynStrike> strikes, Hash h, long windowStart, long now, long strikeWindowMs, int requiredStrikes) Atomically evaluate and apply a burst-gate trip againsth's recorded strike.private voidConnectionManager.assignReceiveStreamId(Connection con, Hash destHash) Pick a new random stream ID for the con and assign it, taking care to avoid duplicates, and put it in the connection table.(package private) booleanBan a dest for the configured duration.(package private) booleanConnectionManager.checkInboundSynFlood(Hash h, long now) Package-visible flood gate for the retransmit-SYN path inConnectionHandler.receiveNewSyn(Packet).private longConnectionManager.checkSynBurst(Hash h, long now, boolean autoban) Whether a SYN from a dest tripped the sub-second burst gate.(package private) booleanChecks if individual count is over the limit by this much.(package private) booleanConnectionManager.isTempBanned(Hash h, long now) Whether the dest is currently temp-banned.(package private) booleanConnThrottler.isThrottled(Hash h) Check if throttled without incrementing.private booleanConnectionManager.noteSynBurstStrike(Hash h, long windowStart, long now) Record a SYN-burst strike forhand decide whether this trip autobans (seeConnectionManager.synBurstStrikeAction(ConnectionManager.SynStrike, long, long, long, int)).private voidConnectionManager.releaseStream(Hash h) Return a stream slot taken outside the token protocol (a SYN rejected after admission, or a connection built before a token was bound).(package private) static voidConnectionManager.releaseStreamSlot(ConcurrentHashMap<Hash, AtomicInteger> ledger, Hash h) Return one stream slot to a dest's budget.(package private) static booleanConnectionManager.reserveStreamSlot(ConcurrentHashMap<Hash, AtomicInteger> ledger, Hash h, int max) Atomically take one stream slot from a dest's budget: the ceiling check and the increment happen inside a single per-keycompute(), so two SYNs racing the gate can no longer both observe "room left" and admit past the ceiling (the check-then-add this replaced).private voidConnectionManager.sendRejectResponse(Packet synPacket, Destination from, Hash fromHash, int retryAfter) Send the configured response for a rejected SYN (RESET, HTTP-style Retry-After payload, or custom payload), subject to the peer's throttler status.(package private) booleanConnThrottler.shouldThrottle(Hash h) Checks both individual and total.(package private) static intConnectionManager.streamSlotCount(ConcurrentHashMap<Hash, AtomicInteger> ledger, Hash h) Read the stream count a dest is actually holding in the ledger, or 0 if it holds none.(package private) static booleanConnectionManager.synNacksMatch(long[] nacks, Hash localHash) Whether a SYN's 8 NACK words match the local destination hash.private StringConnectionManager.tempBanReason(Hash h) The stored trigger description for an active temp-ban, if any.private booleanConnectionManager.tryReserveStream(Hash h, int max) Take a stream slot from this dest's budget.Method parameters in net.i2p.client.streaming.impl with type arguments of type HashModifier and TypeMethodDescription(package private) static ConnectionManager.SynBurstActionConnectionManager.applySynBurstStrike(ConcurrentHashMap<Hash, ConnectionManager.SynStrike> strikes, Hash h, long windowStart, long now, long strikeWindowMs, int requiredStrikes) Atomically evaluate and apply a burst-gate trip againsth's recorded strike.(package private) static HashConnectionManager.consumeReservation(ConcurrentHashMap<Long, Hash> tokens, ConcurrentHashMap<Hash, AtomicInteger> ledger, long receiveStreamId) Consume the reservation token bound to a receive stream ID, releasing the dest budget slot it owns.(package private) static intConnectionManager.pruneEmptyPoolBuckets(Map<Hash, ? extends Collection<?>> pools) Remove destination buckets whose connection deque has gone empty, so a destination that is no longer contacted does not keep a (now-empty) pool entry alive forever.(package private) static voidConnectionManager.reconcileStreamSlots(ConcurrentHashMap<Hash, AtomicInteger> ledger, Map<Hash, Integer> observed, ConcurrentHashMap<Hash, Integer> candidates, Map<Hash, Integer> boundTokens) Reconcile the per-dest stream ledger against the live connection table.(package private) static voidConnectionManager.reconcileStreamSlots(ConcurrentHashMap<Hash, AtomicInteger> ledger, Map<Hash, Integer> observed, ConcurrentHashMap<Hash, Integer> candidates, Map<Hash, Integer> boundTokens) Reconcile the per-dest stream ledger against the live connection table.(package private) static voidConnectionManager.releaseStreamSlot(ConcurrentHashMap<Hash, AtomicInteger> ledger, Hash h) Return one stream slot to a dest's budget.(package private) static booleanConnectionManager.reserveStreamSlot(ConcurrentHashMap<Hash, AtomicInteger> ledger, Hash h, int max) Atomically take one stream slot from a dest's budget: the ceiling check and the increment happen inside a single per-keycompute(), so two SYNs racing the gate can no longer both observe "room left" and admit past the ceiling (the check-then-add this replaced).(package private) static intConnectionManager.streamSlotCount(ConcurrentHashMap<Hash, AtomicInteger> ledger, Hash h) Read the stream count a dest is actually holding in the ledger, or 0 if it holds none.Uses of Hash in net.i2p.crypto
Methods in net.i2p.crypto that return HashModifier and TypeMethodDescriptionfinal HashSHA256Generator.calculateHash(byte[] source) Calculate the SHA-256 hash of the source and cache the result.final HashSHA256Generator.calculateHash(byte[] source, int start, int len) Calculate the hash and cache the result.Methods in net.i2p.crypto with parameters of type HashModifier and TypeMethodDescriptionDSAEngine.sign(Hash hash, SigningPrivateKey signingKey) Nonstandard.booleanDSAEngine.verifySignature(Signature signature, Hash hash, SigningPublicKey verifyingKey) Nonstandard.Uses of Hash in net.i2p.data
Fields in net.i2p.data declared as HashModifier and TypeFieldDescriptionprivate HashEncryptedLeaseSet.__calculatedHashCached calculated hash value.private HashKeysAndCert.__calculatedHashCached calculated hash value.private HashLeaseSet2._blindedHashIf this leaseset was formerly blinded, the blinded hash, so we can find it again.private HashBlindData._blindHashThe hash of the blinded destination.private HashDatabaseEntry._currentRoutingKeyCurrent routing key, cached.protected HashLease._gatewayGateway router hash.private HashDatabaseEntry._receivedByHash of the client receiving the routerinfo, or null if it was sent directly.static final HashHash.FAKE_HASHPlaceholder all-zero hash, used as a stand-in when no real router hash is known.Fields in net.i2p.data with type parameters of type HashMethods in net.i2p.data that return HashModifier and TypeMethodDescriptionDataStructure.calculateHash()Calculate the SHA256 value of this object (useful for a few scenarios).DataStructureImpl.calculateHash()KeysAndCert.calculateHash()Throws IllegalStateException if keys and cert are not initialized, as of 0.9.12.SimpleDataStructure.calculateHash()SHA256 hash of the byte array, or null if data is null.static HashHash.create(byte[] data) Pull from cache or return newstatic HashHash.create(byte[] data, int off) Pull from cache or return new.static HashHash.create(InputStream in) Pull from cache or return new.BlindData.getBlindedHash()Gets the hash of the blinded key for the current day.LeaseSet2.getBlindedHash()The original blinded hash, where this came from.BlindData.getDestHash()Gets the destination hash if known.Lease.getGateway()Retrieve the router at which the destination can be contacted.DatabaseEntry.getHash()A common interface to the Hash of the two subclasses.EncryptedLeaseSet.getHash()This must be used instead of getDestination().EncryptedLeaseSet.getHash().KeysAndCert.getHash()Throws IllegalStateException if keys and cert are not initialized, as of 0.9.12.DatabaseEntry.getReceivedBy()The Hash of the local client that received this LS, null if the router or unknown.DatabaseEntry.getRoutingKey()Routing key for the structure using the current modifier in the RoutingKeyGenerator.abstract HashRoutingKeyGenerator.getRoutingKey(Hash origKey) Routing key for a key.Methods in net.i2p.data with parameters of type HashModifier and TypeMethodDescriptionabstract HashRoutingKeyGenerator.getRoutingKey(Hash origKey) Routing key for a key.voidLeaseSet2.setBlindedHash(Hash bh) Blinded hash, if known at creation.voidLease.setGateway(Hash ident) Configure the router at which the destination can be contacted.voidDatabaseEntry.setReceivedBy(Hash receivedBy) Local client that received this entry.voidLeaseSet.setReceivedBy(Hash localClient) Record the local client that received this leaseset.Uses of Hash in net.i2p.data.i2cp
Fields in net.i2p.data.i2cp declared as HashModifier and TypeFieldDescriptionprivate HashBlindingInfoMessage._hashThe hash of the blinded destination.private HashDestLookupMessage._hashThe destination being looked up.private HashDestReplyMessage._hashHash of the destination being reported.private HashHostLookupMessage._hashThe hash to look up, for hash lookups.private final HashRequestLeaseSetMessage.TunnelEndpoint._routerThe gateway router's hash.Methods in net.i2p.data.i2cp that return HashModifier and TypeMethodDescriptionBlindingInfoMessage.getHash()Gets the hash for hash-type endpoints.DestLookupMessage.getHash()Returns the destination hash the router is asked to resolve.DestReplyMessage.getHash()Gets the hash of the destination.HostLookupMessage.getHash()Gets the hash for hash-type lookups.RequestLeaseSetMessage.getRouter(int endpoint) Returns the router identity of one of the requested tunnels.RequestLeaseSetMessage.TunnelEndpoint.getRouter()Returns the router identity of this tunnel.Methods in net.i2p.data.i2cp with parameters of type HashModifier and TypeMethodDescriptionvoidRequestLeaseSetMessage.addEndpoint(Hash router, TunnelId tunnel) Add a router and tunnel endpoint.Constructors in net.i2p.data.i2cp with parameters of type HashModifierConstructorDescriptionCreates a message asking the router to resolve a destination hash.Non-null with non-null data.HostLookupMessage(SessionId id, Hash h, long reqID, long timeout) Session id.TunnelEndpoint(Hash router, TunnelId id) One requested tunnel, pairing a router with one of its tunnel ids.Uses of Hash in net.i2p.data.i2np
Fields in net.i2p.data.i2np declared as HashModifier and TypeFieldDescriptionprivate HashDeliveryInstructions._destinationHashHash of the destination for DESTINATION mode.private HashDatabaseSearchReplyMessage._fromThe router sending the reply.private HashDatabaseLookupMessage._fromHashThe hash of the requester.private HashDatabaseLookupMessage._keyThe hash being looked up.private HashDatabaseSearchReplyMessage._keyThe hash that was looked up.private HashDatabaseStoreMessage._keyThe key being stored.private HashDatabaseStoreMessage._replyGatewayGateway the reply should go back to.private HashDeliveryInstructions._routerHashHash of the router for ROUTER or TUNNEL mode.Fields in net.i2p.data.i2np with type parameters of type HashModifier and TypeFieldDescriptionDatabaseLookupMessage._dontIncludePeersThis must be kept as a list to preserve the order and not break the checksum.DatabaseSearchReplyMessage._peerHashesThe peers found, closest first.Methods in net.i2p.data.i2np that return HashModifier and TypeMethodDescriptionDeliveryInstructions.getDestination()Default null.DatabaseLookupMessage.getFrom()Contains the router who requested this lookup.DatabaseSearchReplyMessage.getFromHash()The router that sent this reply.DatabaseStoreMessage.getKey()Defines the key in the network database being stored.DatabaseSearchReplyMessage.getReply(int index) The peer hash at the given index.DatabaseStoreMessage.getReplyGateway()The gateway to send the reply to, or null if no reply is requested.DeliveryInstructions.getRouter()Default null.DatabaseLookupMessage.getSearchKey()Defines the key being searched for.DatabaseSearchReplyMessage.getSearchKey()Defines the key being searched for.BuildRequestRecord.readNextIdentity()Reads the next hop's identity hash.Methods in net.i2p.data.i2np that return types with arguments of type HashModifier and TypeMethodDescriptionDatabaseLookupMessage.getDontIncludePeers()Collection of peers that a lookup reply should NOT include.Methods in net.i2p.data.i2np with parameters of type HashModifier and TypeMethodDescriptionvoidDatabaseLookupMessage.addDontIncludePeer(Hash peer) Add to the set.voidAdds a peer hash to the reply.BuildRequestRecord.encryptECIESRecord(RouterContext ctx, PublicKey toKey, Hash toPeer) Encrypts the record using ECIES.BuildRequestRecord.encryptRecord(I2PAppContext ctx, PublicKey toKey, Hash toPeer) Encrypts the record using ElGamal.voidDeliveryInstructions.LocalInstructions.setDestination(Hash dest) Throws, as local delivery instructions are immutable.voidDeliveryInstructions.setDestination(Hash dest) Required for DESTINATION.voidAssigns the router who requested this lookup.voidDatabaseSearchReplyMessage.setFromHash(Hash from) Assigns the router that sent this reply.voidDatabaseStoreMessage.setReplyGateway(Hash peer) Assigns the gateway to send the reply to.voidThrows, as local delivery instructions are immutable.voidRequired for ROUTER or TUNNEL.voidDatabaseLookupMessage.setSearchKey(Hash key) Assigns the key being searched for.voidDatabaseSearchReplyMessage.setSearchKey(Hash key) Assigns the key being searched for.(package private) static StringDatabaseLookupMessage.shortKey(DatabaseLookupMessage.Type type, Hash key) The search key as the house truncation - 8 base32 characters for a lease set, 6 base64 for anything else - bracketed so the console links it.Method parameters in net.i2p.data.i2np with type arguments of type HashModifier and TypeMethodDescriptionvoidDatabaseLookupMessage.addDontIncludePeers(Collection<Hash> peers) Add to the set.voidDatabaseLookupMessage.setDontIncludePeers(Collection<Hash> peers) Replace the dontInclude set with this set.Constructors in net.i2p.data.i2np with parameters of type HashModifierConstructorDescriptionBuildRequestRecord(I2PAppContext ctx, long receiveTunnelId, long nextTunnelId, Hash nextHop, long nextMsgId, boolean isInGateway, boolean isOutEndpoint, Properties options) Creates a new ECIES short build request record.BuildRequestRecord(I2PAppContext ctx, long receiveTunnelId, long nextTunnelId, Hash nextHop, long nextMsgId, SessionKey layerKey, SessionKey ivKey, SessionKey replyKey, byte[] iv, boolean isInGateway, boolean isOutEndpoint, Properties options) Creates a new ECIES long build request record.BuildRequestRecord(I2PAppContext ctx, long receiveTunnelId, Hash peer, long nextTunnelId, Hash nextHop, long nextMsgId, SessionKey layerKey, SessionKey ivKey, SessionKey replyKey, byte[] iv, boolean isInGateway, boolean isOutEndpoint) Creates a new ElGamal build request record.Uses of Hash in net.i2p.data.router
Fields in net.i2p.data.router with type parameters of type HashMethods in net.i2p.data.router that return HashModifier and TypeMethodDescriptionprivate static HashGenerate a modified (yet consistent) hash from the origKey by generating the SHA256 of the targetKey with the specified modData appended to it.RouterKeyGenerator.getNextRoutingKey(Hash origKey) Routing key using tomorrow's modData, not today's.RouterKeyGenerator.getRoutingKey(Hash origKey) Generate a modified (yet consistent) hash from the origKey by generating the SHA256 of the targetKey with the current modData appended to itRouterKeyGenerator.getRoutingKey(Hash origKey, long time) Routing key for the specified date, not today's.Methods in net.i2p.data.router that return types with arguments of type HashModifier and TypeMethodDescriptionRouterInfo.getPeers()Retrieve a set of SHA-256 hashes of RouterIdentities from routers this router can be reached through.Methods in net.i2p.data.router with parameters of type HashModifier and TypeMethodDescriptionprivate static HashGenerate a modified (yet consistent) hash from the origKey by generating the SHA256 of the targetKey with the specified modData appended to it.RouterKeyGenerator.getNextRoutingKey(Hash origKey) Routing key using tomorrow's modData, not today's.RouterKeyGenerator.getRoutingKey(Hash origKey) Generate a modified (yet consistent) hash from the origKey by generating the SHA256 of the targetKey with the current modData appended to itRouterKeyGenerator.getRoutingKey(Hash origKey, long time) Routing key for the specified date, not today's.Method parameters in net.i2p.data.router with type arguments of type HashUses of Hash in net.i2p.i2ptunnel
Fields in net.i2p.i2ptunnel declared as HashModifier and TypeFieldDescriptionprivate HashI2PTunnelHTTPClient.WarmSlot._destThe destination being connected to.private HashI2PTunnelHTTPClient.WarmSlot._permitThe destination holding our connection permit.Fields in net.i2p.i2ptunnel with type parameters of type HashModifier and TypeFieldDescriptionprivate static final ConcurrentHashMap<Hash, AtomicInteger> I2PTunnelHTTPClient._activeConnsActive outbound I2P socket count per destination hash.private final Map<Hash, ConnThrottler.Record> ConnThrottler._peersConnection records, by peer hash.private static final ConcurrentHashMap<Hash, long[]> I2PTunnelHTTPClient._raceBudgetPer-remote-dest race token bucket for empty-response dual-race opens.private final java.util.function.Consumer<Hash> I2PTunnelHTTPClient.WarmSlot._releaserCallback releasing the destination's connection permit.Methods in net.i2p.i2ptunnel with parameters of type HashModifier and TypeMethodDescriptionprivate SocketI2PTunnelServer.createUniqueLocalSocket(Hash from, InetAddress remoteHost, int remotePort, int timeout) Create a socket with a unique local address derived from the peer hash.protected SocketCreates a TCP socket connection to the configured destination.protected SocketI2PTunnelServer.getSocket(Hash from, InetAddress remoteHost, int remotePort) Creates a TCP socket connection to the specified destination.private SocketI2PTunnelServer.getSocket(Hash from, InetAddress remoteHost, int remotePort, boolean forceNonSSL) Get a regular or SSL socket depending on config.(package private) booleanI2PTunnelHTTPServer.isPostThrottled(StringBuilder command, Hash peerHash, I2PSocket socket, String peerB32) Check POST/PUT throttling for this peer.(package private) longBegin a warm-connect attempt, taking a lease onpermit.private static voidI2PTunnelHTTPClient.releaseConnPermit(Hash dest) Release a concurrent-connection permit fordest.booleanConnThrottler.shouldThrottle(Hash h) Checks if a peer or the total connection rate exceeds configured limits.(package private) I2PSocketTake an installed socket for the request.private static booleanI2PTunnelHTTPClient.tryAcquireConnPermit(Hash dest) Try to acquire a concurrent-connection permit fordest.Constructor parameters in net.i2p.i2ptunnel with type arguments of type HashUses of Hash in net.i2p.i2ptunnel.access
Fields in net.i2p.i2ptunnel.access declared as HashModifier and TypeFieldDescriptionprivate final HashDestTracker.hashThe destination this rule tracks.private final HashExplicitFilterDefinitionElement.hashThe destination this rule matches, decoded from its address.Fields in net.i2p.i2ptunnel.access with type parameters of type HashModifier and TypeFieldDescriptionprivate final Map<Hash, DestTracker> AccessFilter.knownDestsTrackers for known destinations defined in access lists.private final Map<Hash, DestTracker> FileFilterDefinitionElement.lastLoadedWhen each destination was last seen in the file.private final Map<Hash, DestTracker> AccessFilter.unknownDestsTrackers for unknown destinations not defined in access lists.Methods in net.i2p.i2ptunnel.access that return HashModifier and TypeMethodDescriptionprotected static HashFilterDefinitionElement.fromBase32(String b32) Utility method to create a Hash object from a .b32 string.(package private) HashDestTracker.getHash()The destination this tracker counts attempts for.Method parameters in net.i2p.i2ptunnel.access with type arguments of type HashModifier and TypeMethodDescriptionvoidExplicitFilterDefinitionElement.update(Map<Hash, DestTracker> map) voidFileFilterDefinitionElement.update(Map<Hash, DestTracker> map) (package private) abstract voidFilterDefinitionElement.update(Map<Hash, DestTracker> map) Updates the provided map with the hash(es) of remote destinations mentioned in this element.Constructors in net.i2p.i2ptunnel.access with parameters of type HashModifierConstructorDescription(package private)DestTracker(Hash hash, Threshold threshold) Create a tracker for one remote destination with an empty access history.Uses of Hash in net.i2p.router
Fields in net.i2p.router declared as HashModifier and TypeFieldDescriptionprivate HashTunnelPoolSettings._aliasOfDestination this pool is an alias of, null if none.private final HashTunnelPoolSettings._destinationThe tunnel's destination hash.private final HashClientMessage._destinationHashHash of the destination.private final HashBlocklist.BanlistJob._peerThe router to ban.private HashRouter._routerHashHash of our router identity.(package private) final HashInNetMessagePool.QueuedMessage.fromThe peer the message came from.static final HashBanlist.HASH_ZERORIHash of 387 zeros.(package private) final HashBlocklist.Entry.peerThe router hash, if this is a hash entry.Fields in net.i2p.router with type parameters of type HashModifier and TypeFieldDescriptionTunnelPoolSettings._aliasesDestination hashes aliasing this pool.private final Map<Hash, Banlist.Entry> Banlist._entriesActive bans by router hash.TunnelPoolSettings._firstPeerExclusionsPeers excluded as the first hop of a new tunnel, for diversity.Blocklist._inProcessRouters whose banlisting is already queued.TunnelPoolSettings._lastPeerExclusionsPeers excluded as the last hop of a new tunnel, for diversity.private final Map<Hash, LeaseSetKeys> KeyManager._leaseSetKeysThe lease set keys, by destination hash.Blocklist._peerBlocklistTemporarily banned routers by hash, with reasons.Methods in net.i2p.router that return HashModifier and TypeMethodDescriptionTunnelPoolSettings.getAliasOf()Other destination that this is an alias of (or null).TunnelInfo.getDestination()If this is a client tunnel, what destination is it for?TunnelPoolSettings.getDestination()What destination is this a client tunnel for (or null if exploratory)?ClientMessage.getDestinationHash()Retrieve the destination to which this message is directed.TunnelInfo.getEndpoint()For convenience.TunnelInfo.getFarEnd()For convenience.TunnelInfo.getGateway()For convenience.TunnelInfo.getPeer(int hop) The peer at the given hop.Router.getRouterHash()Our current router hash.RouterContext.routerHash()Convenience method for getting the router hash.Methods in net.i2p.router that return types with arguments of type HashModifier and TypeMethodDescriptionNetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) Return the RouterInfo structures for the routers closest to the given key.TunnelPoolSettings.getAliases()Other destinations that use the same tunnel (or null if exploratory).NetworkDatabaseFacade.getAllRouters()All known router hashes.Banlist.getEntries()Get the banlist entries.CommSystemFacade.getEstablished()Get all the peers we are connected to.TunnelPoolSettings.getFirstPeerExclusions()First peer exclusions for diversity.TunnelManagerFacade.getInboundClientPools()For TunnelRenderer in router console.TunnelPoolSettings.getLastPeerExclusions()Last peer exclusions for diversity.TunnelManagerFacade.getOutboundClientPools()For TunnelRenderer in router console.PeerManagerFacade.getPeersByCapability(char capability) All peers with the given capability.ClientManagerFacade.getPrimaryHashes()A set of all primary hashes.TunnelManagerFacade.selectPeersInTooManyTunnels()Peers that should not be allowed to be in another tunnel.Methods in net.i2p.router with parameters of type HashModifier and TypeMethodDescriptionabstract voidNetworkDatabaseFacade.accessLeaseSet(Hash key) Record access to a LeaseSet for refresh tracking.intInNetMessagePool.add(I2NPMessage messageBody, RouterIdentity fromRouter, Hash fromRouterHash) Adds a new inbound message to be processed.intInNetMessagePool.add(I2NPMessage messageBody, RouterIdentity fromRouter, Hash fromRouterHash, long msgIDBloomXor) Adds a new inbound message with optional bloom filter XOR id.voidRecord a bad packet from a peer identified by its Router hash.private voidWe don't keep the comment field in-memory, so we have to go back out to the file to find it.private voidBlocklist.banlist(Hash peer, byte[] ip, RouterInfo ri) Queues a ban for a peer matching a blocklist entry.voidWe banlisted the peer.booleanBanlist.banlistRouter(String reasonCode, Hash peer, String reason) Ban a router with default duration.booleanBanlist.banlistRouter(Hash peer) Ban a router with default duration.booleanBanlist.banlistRouter(Hash peer, String reason) Ban a router with default duration.booleanBanlist.banlistRouter(Hash peer, String reason, String transport) Ban a router on a specific transport.booleanBanlist.banlistRouter(Hash peer, String reason, String transport, boolean forever) Ban a router with configurable duration and transport.private booleanBanlist.banlistRouter(Hash peer, String reason, String reasonCode, String transport, boolean forever) Ban a router with automatic duration calculation.booleanBanlist.banlistRouter(Hash peer, String reason, String reasonCode, String transport, long expireOn) Ban a router with a specified expiration time.private voidBlocklist.banlistRouter(Hash peer, String reason, String comment) Queues a ban for a router by hash.private voidBlocklist.banlistRouter(Hash peer, String reason, String reasonCode, long duration) Look up the original record so we can record the reason in the banlist.private voidBlocklist.banlistRouter(Hash peer, String reason, String comment, RouterInfo ri) Queues a ban for a router given its info.private voidBlocklist.banlistRouter(Hash peer, List<byte[]> ips, long duration) Bans a router and its addresses for a duration.booleanBanlist.banlistRouterForever(Hash peer, String reason) Permanently ban a router.booleanBanlist.banlistRouterForever(Hash peer, String reason, String reasonCode) Permanently ban a router.private voidBlocklist.banlistRouterWithRI(Hash peer, String reason, String comment, RouterInfo ri, String ip) Queues a ban for a router with its info and address.RouterContext.clientNetDb(Hash id) The client netDb for the given id.voidProfileManager.commErrorOccurred(Hash peer) Note that there was some sort of communication error talking with the peer.voidBanlist.corruptConnection(Hash hash, String version) Record a corrupt connection from a peer identified by its Router hash.HandlerJobBuilder.createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash fromHash) Create a new job to handle the received message.voidProfileManager.dbLookupFailed(Hash peer) Note that the peer was unable to reply to a db lookup - either with data or with a lookupReply redirecting the user elsewhere.voidProfileManager.dbLookupReceived(Hash peer) Note that the local router received a db lookup from the given peer.voidProfileManager.dbLookupReply(Hash peer, int newPeers, int oldPeers, int invalid, int duplicate, long responseTimeMs) The peer replied to a db lookup with a redirect to other routers.voidProfileManager.dbLookupSuccessful(Hash peer, long responseTimeMs) Note that the peer was able to return the valid data for a db lookup.voidProfileManager.dbStoreFailed(Hash peer) Note that we were unable to confirm a successful send of db data to the peer, at least not within our timeout period.voidProfileManager.dbStoreReceived(Hash peer, boolean wasNewKey) Note that the local router received an unprompted db store from the given peer.voidProfileManager.dbStoreSent(Hash peer, long responseTimeMs) Note that we've confirmed a successful send of db data to the peer (though we haven't necessarily requested it again from them, so they /might/ be lying).voidProfileManager.dbStoreSuccessful(Hash peer) Note that we confirmed a successful send of db data to the peer.private voidInNetMessagePool.doShortCircuitTunnelData(I2NPMessage messageBody, Hash from) Actual direct dispatch of a tunnel data message.voidMessageHistory.droppedInboundMessage(long messageId, Hash from, String info) Note that an inbound message was dropped.voidMessageHistory.droppedOtherMessage(I2NPMessage message, Hash from) We received another message we weren't waiting for and don't know how to handle.voidMessageHistory.droppedTunnelMessage(TunnelId id, long msgId, Date expiration, Hash from) We don't know about the given tunnel, so we are dropping a message sent to us by the given router.intTunnelManagerFacade.ensurePoolsFor(Hash client) Run both of a client's pools' ensure logic on demand instead of waiting for the next build-timer interval.voidCommSystemFacade.exemptIncoming(Hash peer) Exempt this router hash from any incoming throttles or rejections.abstract voidMark a database entry as failed.voidFail every tunnel that depends on a peer we can no longer reach: outbound tunnels with it as first hop, inbound tunnels with it as last hop.private voidBanLogger.fetchRouterInfo(Hash hash, String reason, long durationMs) Schedule an async network lookup for a RouterInfo that was not locally cached when the ban was logged.NetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) Return the RouterInfo structures for the routers closest to the given key.voidCommSystemFacade.forceDisconnect(Hash peer) Tell the comm system to disconnect from this peer.voidCommSystemFacade.forceDisconnect(Hash peer, String reason) Tell the comm system to disconnect from this peer with a reason.private List<byte[]> Blocklist.getAddresses(Hash peer) Will not contain duplicates.longHow long the banlist has been holding a peer, in milliseconds.Banlist.getBanCause(Hash peer) Reason recorded when the peer was banlisted.private StringCapabilities string from RouterInfo for the given hash.abstract FloodfillNetworkDatabaseFacadeClientManagerFacade.getClientFloodfillNetworkDatabaseFacade(Hash destHash) The FloodfillNetworkDatabaseFacade associated with a particular client destination.abstract SessionKeyManagerClientManagerFacade.getClientSessionKeyManager(Hash dest) The session key manager for a given client.CommSystemFacade.getCountry(Hash peer) Get the two-letter country code for the given peer's IP address.intTunnelManagerFacade.getInboundClientTunnelCount(Hash destination) How many inbound client tunnels in this pool?TunnelManagerFacade.getInboundPool(Hash client) Inbound tunnel pool for the given client, or null if none.TunnelManagerFacade.getInboundSettings(Hash client) The inbound settings for the given client.byte[]Get the IP address associated with the given destination.private StringBanLogger.getIPFromContext(Hash hash, RouterContext context) IP address from banlist for the given hash.Client session lease set keys.private static final StringPrettify the hash by doing a base64 and returning the first 6 characters.intTunnelManagerFacade.getOutboundClientTunnelCount(Hash destination) How many outbound client tunnels in this pool?TunnelManagerFacade.getOutboundPool(Hash client) Outbound tunnel pool for the given client, or null if none.TunnelManagerFacade.getOutboundSettings(Hash client) The outbound settings for the given client.private StringBanLogger.getVersion(Hash hash) Version string from RouterInfo for the given hash.private voidInNetMessagePool.handleDroppedUnmatchedMessage(I2NPMessage messageBody, RouterIdentity fromRouter, Hash fromRouterHash, boolean doHistory) Handles dropping messages that are not matched or handled.private voidInNetMessagePool.handleInvalidMessage(I2NPMessage messageBody, String invalidReason, RouterIdentity fromRouter, Hash fromRouterHash, boolean doHistory, long msgIDBloomXor) Handles invalid or duplicate messages by logging, statistics updates, and history recording.voidProfileManager.heardAbout(Hash peer) Note that the local router received a reference to the given peer, either through an explicit dbStore or in a dbLookupReply.voidProfileManager.heardAbout(Hash peer, long when) Note that the local router received a reference to the given peer at a specific time.booleanCommSystemFacade.isBacklogged(Hash peer) Check whether the given peer has excessive pending outbound messages.booleanBanlist.isBanlisted(Hash peer) Check if a router is banlisted.booleanBanlist.isBanlisted(Hash peer, String transport) Check if a router is banlisted on a specific transport.booleanBanlist.isBanlistedForever(Hash peer) Check if a router is permanently banlisted.booleanBanlist.isBanlistedHostile(Hash peer) Check if a router is banlisted with a hostile duration (at least 1 hour).booleanBlocklist.isBlocklisted(Hash peer) Check if a peer is blocklisted by IP address.booleanCommSystemFacade.isConnecting(Hash peer) Check if any transport has a connection attempt in progress for the given peer (handshake started but not yet complete).abstract booleanCommSystemFacade.isEstablished(Hash peer) Check whether a transport connection exists with the given peer.booleanCommSystemFacade.isInStrictCountry(Hash peer) Whether the given peer's country is blocked.abstract booleanDetermine if the destination hash specified is managed locally.booleanNetworkDatabaseFacade.isNegativeCachedForever(Hash key) Is it permanently negative cached?booleanTunnelManagerFacade.isValidTunnel(Hash client, TunnelInfo tunnel) Is a tunnel a valid member of the pool?voidLog a ban by hash with IP address.voidBanLogger.logBan(Hash hash, String ip, String reason, long durationMs, RouterInfo ri) Log a ban withRouterInfofor direct caps extraction.voidBanLogger.logBan(Hash hash, RouterContext context, String reason, long durationMs) Log a ban by hash withRouterContext(IP will be looked up from banlist).voidBanLogger.logBanForever(Hash hash, String ip, String reason) Log a permanent ban (forever).voidBanLogger.logBanForever(Hash hash, String ip, String reason, RouterInfo ri) Log a permanent ban with RouterInfo for direct caps extraction.voidBanLogger.logBanForever(Hash hash, RouterContext context, String reason) Log a permanent ban with RouterContext.abstract voidNetworkDatabaseFacade.lookupDestination(Hash key, Job onFinishedJob, long timeoutMs, Hash fromLocalDest) Lookup using the client's tunnels Succeeds even if LS validation fails due to unsupported sig type.abstract DestinationNetworkDatabaseFacade.lookupDestinationLocally(Hash key) Lookup locally in netDB and in badDest cache Succeeds even if LS validation failed due to unsupported sig type.abstract voidNetworkDatabaseFacade.lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs) Lookup a LeaseSet in the network database.abstract voidNetworkDatabaseFacade.lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest) Lookup using the client's tunnels.abstract LeaseSetNetworkDatabaseFacade.lookupLeaseSetLocally(Hash key) Look up a LeaseSet in the local network database.abstract voidNetworkDatabaseFacade.lookupLeaseSetRemotely(Hash key, Hash fromLocalDest) Unconditionally lookup using the client's tunnels.abstract voidNetworkDatabaseFacade.lookupLeaseSetRemotely(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest) Unconditionally lookup using the client's tunnels.abstract DatabaseEntryNetworkDatabaseFacade.lookupLocally(Hash key) Lookup a database entry locally.abstract DatabaseEntryNetworkDatabaseFacade.lookupLocallyWithoutValidation(Hash key) Not for use without validation.abstract voidNetworkDatabaseFacade.lookupRouterInfo(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs) Look up a RouterInfo in the network database.abstract RouterInfoNetworkDatabaseFacade.lookupRouterInfoLocally(Hash key) Look up a RouterInfo in the local network database.voidCommSystemFacade.mayDisconnect(Hash peer) Tell the comm system that we may disconnect from this peer.voidProfileManager.messageFailed(Hash peer) Note that the router failed to send a message to the peer over any transport.voidProfileManager.messageFailed(Hash peer, String transport) Note that the router failed to send a message to the peer over the transport specified.voidProfileManager.messageReceived(Hash peer, String style, long msToReceive, int bytesRead) Note that the router received a message from the given peer on the specified transport.voidProfileManager.messageSent(Hash peer, String transport, long msToSend, long bytesSent) Note that it took msToSend to send a message of size bytesSent to the peer over the transport.voidProfileManager.peerLossEvent(Hash peer, float ratio) Record the packet-loss (retransmit) ratio measured by the transport for a peer.voidBanlist.portHopping(Hash hash) Record a port hopping attempt from a peer identified by its Router hash.private booleanInNetMessagePool.processDatabaseStoreMessage(I2NPMessage messageBody, RouterIdentity fromRouter, Hash fromRouterHash, boolean doHistory) Processes DatabaseStoreMessage types by running or queueing corresponding jobs.StatisticsManager.publishStatistics(Hash h) Retrieve a snapshot of the statistics that should be published.PersistentKeyRing.put(Hash h, SessionKey sk) Store a session key, persisting it to the router config.voidMessageHistory.receiveMessage(String messageType, long messageId, long expiration, Hash from, boolean isValid) Note that we just received a message from the peer.voidPeerManagerFacade.removeCapabilities(Hash peer) Remove all capabilities from a peer.abstract voidNetworkDatabaseFacade.removeLeaseSetFromTracking(Hash key) Remove a LeaseSet from refresh tracking.CommSystemFacade.renderPeerCaps(Hash peer, boolean inline) Render the peer's capabilities as HTML, optionally inline.CommSystemFacade.renderPeerFlag(Hash peer) Render the country flag for the given peer as HTML.CommSystemFacade.renderPeerHTML(Hash peer, boolean extended) Render an HTML snippet identifying the given peer, optionally with extended details.abstract voidClientManagerFacade.requestLeaseSet(Hash dest, LeaseSet set) Request that the client authorize the Leases contained in the LeaseSet, identified by destination hash.TunnelManagerFacade.selectInboundExploratoryTunnel(Hash closestTo) Pick the inbound exploratory tunnel with the gateway closest to the given hash.TunnelManagerFacade.selectInboundTunnel(Hash destination) Pick a random inbound tunnel from the given destination's pool.TunnelManagerFacade.selectInboundTunnel(Hash destination, Hash closestTo) Pick the inbound tunnel with the gateway closest to the given hash from the given destination's pool.TunnelManagerFacade.selectOutboundExploratoryTunnel(Hash closestTo) Pick the outbound exploratory tunnel with the endpoint closest to the given hash.TunnelManagerFacade.selectOutboundTunnel(Hash destination) Pick a random outbound tunnel from the given destination's pool.TunnelManagerFacade.selectOutboundTunnel(Hash destination, Hash closestTo) Pick the outbound tunnel with the endpoint closest to the given hash from the given destination's pool.voidMessageHistory.sendMessage(String messageType, long messageId, long expiration, Hash peer, boolean sentOk, String info) We just sent a message to the peer.voidTunnelPoolSettings.setAliasOf(Hash h) Other destination that this is an alias of (or null).voidPeerManagerFacade.setCapabilities(Hash peer, String caps) The capabilities for a peer.voidTunnelManagerFacade.setInboundSettings(Hash client, TunnelPoolSettings settings) The inbound settings for the given client.voidTunnelManagerFacade.setOutboundSettings(Hash client, TunnelPoolSettings settings) The outbound settings for the given client.private voidInNetMessagePool.shortCircuitTunnelData(I2NPMessage messageBody, Hash from) Shortcut dispatch tunnel data message either directly or queued.booleanClientManagerFacade.shouldPublishLeaseSet(Hash destinationHash) Does the client specified want their leaseSet published?NetworkDatabaseFacade.store(Hash key, DatabaseEntry entry) Store a DatabaseEntry in the network database.abstract LeaseSetStore a LeaseSet in the network database.abstract RouterInfoNetworkDatabaseFacade.store(Hash key, RouterInfo routerInfo) Store a RouterInfo in the network database.voidProfileManager.tunnelDataPushed(Hash peer, long rtt, long size) Note that we were able to push some data through a tunnel that the peer is participating in (detected after rtt).voidProfileManager.tunnelDataPushed1m(Hash peer, long size) Note that the peer is participating in a tunnel that pushed the given amount of data over the last minute.voidMessageHistory.tunnelDispatched(long messageId, long tunnelId, long toTunnel, Hash toPeer, String type) Note that a message was dispatched to a tunnel.voidProfileManager.tunnelFailed(Hash peer, int pct) Note that the peer participated in a tunnel that failed.voidProfileManager.tunnelJoined(Hash peer, long responseTimeMs) Note that the router agreed to participate in a tunnel.voidProfileManager.tunnelLifetimePushed(Hash peer, long lifetime, long size) Note that we were able to push the given amount of data through a tunnel that the peer is participating in.voidMessageHistory.tunnelParticipantRejected(Hash peer, String msg) Note that a router rejected our request to participate in a tunnel.voidMessageHistory.tunnelRejected(Hash peer, TunnelId tunnel, Hash replyThrough, String reason) The peer did not accept the tunnel join for the given reason.voidProfileManager.tunnelRejected(Hash peer, long responseTimeMs, int severity) Note that a router explicitly rejected joining a tunnel.voidMessageHistory.tunnelRequestTimedOut(Hash peer, TunnelId tunnel) The peer did not accept the tunnel join for the given reason (this may be because of a timeout or an explicit refusal).voidProfileManager.tunnelTestSucceeded(Hash peer, long responseTimeMs) Note that a tunnel that the router is participating in was successfully tested with the given round trip latency.voidProfileManager.tunnelTimedOut(Hash peer) Note that a router timed out joining a tunnel.voidWe unbanlisted the peer.voidBanlist.unbanlistRouter(Hash peer) Remove a router from the banlist.private voidBanlist.unbanlistRouter(Hash peer, boolean realUnbanlist) Remove a peer from the banlist, optionally updating message history.private voidBanlist.unbanlistRouter(Hash peer, boolean realUnbanlist, String transport) Remove a router from the banlist.voidBanlist.unbanlistRouter(Hash peer, String transport) Remove a router from the banlist for a specific transport.abstract booleanCommSystemFacade.wasFailsafeClosed(Hash peer, long withinMs) Whether any transport closed a session to the given peer for idleness within the given window.booleanCommSystemFacade.wasUnreachable(Hash peer) Check whether the given peer was recently unreachable.Method parameters in net.i2p.router with type arguments of type HashModifier and TypeMethodDescriptionNetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) Return the RouterInfo structures for the routers closest to the given key.voidTunnelPoolSettings.setFirstPeerExclusions(Set<Hash> exclusions) First peer exclusions for diversity.voidTunnelPoolSettings.setLastPeerExclusions(Set<Hash> exclusions) Last peer exclusions for diversity.Constructors in net.i2p.router with parameters of type HashModifierConstructorDescriptionBanlistJob(Hash p, List<byte[]> ips) Prepares to ban one router.ClientMessage(Hash toDestHash, Payload payload) For inbound (from remote dest).ClientTunnelSettings(Hash dest) Create tunnel settings for the given destination.Creates an entry from its fields.(package private)QueuedMessage(I2NPMessage m, Hash f) Records one queued message.TunnelPoolSettings(Hash dest, boolean isInbound) A pool with the defaults, exploratory if dest is null and a client pool otherwise.Uses of Hash in net.i2p.router.client
Fields in net.i2p.router.client declared as HashModifier and TypeFieldDescriptionprivate HashClientConnectionRunner._encryptedLSHashHash of the client's encrypted lease set.private final HashLookupDestJob._fromLocalDestThe local destination to search from, null if none.private final HashLookupDestJob._hashThe hash being looked up.Fields in net.i2p.router.client with type parameters of type HashModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<Hash, Long> ClientManagerFacadeImpl._lastExpiredLogTimeWhen each client's expiration was last logged.ClientManager._metaHashesDestination hashes of the metadata sessions.private final Map<Hash, ClientConnectionRunner> ClientManager._runnersByHashThe runners, by destination hash.private final ConcurrentHashMap<Hash, ClientConnectionRunner.SessionParams> ClientConnectionRunner._sessionsThe client's sessions, by destination hash.Methods in net.i2p.router.client that return HashModifier and TypeMethodDescriptionClientConnectionRunner.getDestHash()Equivalent toClientConnectionRunner.getConfig(Hash).getDestination().calculateHash(); will be null before session is established Not subsession aware.ClientConnectionRunner.getDestHash(SessionId id) Return the hash for the given ID.Methods in net.i2p.router.client that return types with arguments of type HashModifier and TypeMethodDescriptionClientManager.getPrimaryHashes()All the primary hashes for all the clients as a set.ClientManagerFacadeImpl.getPrimaryHashes()All the primary hashes for all the clients as a set.Methods in net.i2p.router.client with parameters of type HashModifier and TypeMethodDescriptionClientManager.getClientFloodfillNetworkDatabaseFacade(Hash destHash) The FloodfillNetworkDatabaseFacade associated with a particular client destination.ClientManagerFacadeImpl.getClientFloodfillNetworkDatabaseFacade(Hash destHash) The FloodfillNetworkDatabaseFacade associated with a particular client destination.ClientManager.getClientSessionKeyManager(Hash dest) Return the client's SessionKeyManager Use this instead of theI2PAppContext.sessionKeyManager()to prevent correlation attacks across destinations.ClientManagerFacadeImpl.getClientSessionKeyManager(Hash dest) Return the client's current manager or null if not connected.Current client's config, will be null if session not found IS subsession aware.(package private) LeaseRequestStateClientConnectionRunner.getLeaseRequest(Hash h) Data for the current leaseRequest, or null if there is no active leaseSet request.ClientConnectionRunner.getLeaseSet(Hash h) Currently allocated leaseSet.private ClientConnectionRunnerLooks up a client's runner by hash without holding the lock.(package private) SessionIdClientConnectionRunner.getSessionId(Hash h) Subsession aware.booleanUnsynchronized.booleanDetermine if the destination specified is managed locally.(package private) booleanClientConnectionRunner.receiveMessage(Hash toHash, Destination fromDest, Payload payload) Synchronously deliver the message to the current runnerbooleanClientManager.registerEncryptedDestination(ClientConnectionRunner runner, Hash hash) Call afterClientManager.destinationEstablished(ClientConnectionRunner, Destination), when an encrypted leaseset is created, so we know it's local.booleanClientConnectionRunner.registerEncryptedLS(Hash hash) Call after destinationEstablished(), when an encrypted leaseset is created, so we know it's local.(package private) voidClientConnectionRunner.requestLeaseSet(Hash h, LeaseSet set, long expirationTime, Job onCreateJob, Job onFailedJob) Request that a particular client authorize the Leases contained in the LeaseSet, after which the onCreateJob is queued up.voidClientManager.requestLeaseSet(Hash dest, LeaseSet ls) Request that a particular client authorize the Leases contained in the LeaseSet.voidClientManagerFacadeImpl.requestLeaseSet(Hash dest, LeaseSet set) Request that a particular client authorize the Leases contained in the LeaseSet.(package private) voidClientConnectionRunner.setSessionId(Hash hash, SessionId id) To be called only byClientManager.booleanClientManager.shouldPublishLeaseSet(Hash destHash) Determine if we should publish a leaseSet for this hash.booleanClientManagerFacadeImpl.shouldPublishLeaseSet(Hash destinationHash) Whether the lease set for the destination should be published.voidClientManager.unregisterEncryptedDestination(ClientConnectionRunner runner, Hash hash) Remove the hash for the encrypted LS.Method parameters in net.i2p.router.client with type arguments of type HashModifier and TypeMethodDescription(package private) static intClientManagerFacadeImpl.pruneStaleExpiredLogEntries(ConcurrentHashMap<Hash, Long> map, Set<Hash> active) Remove lease-expiration log-throttle entries whose destination no longer has a live runner.(package private) static intClientManagerFacadeImpl.pruneStaleExpiredLogEntries(ConcurrentHashMap<Hash, Long> map, Set<Hash> active) Remove lease-expiration log-throttle entries whose destination no longer has a live runner.Constructors in net.i2p.router.client with parameters of type HashModifierConstructorDescriptionLookupDestJob(RouterContext context, ClientConnectionRunner runner, long reqID, long timeout, SessionId sessID, Hash h, String name, Hash fromLocalDest) One of h or name non-null.LookupDestJob(RouterContext context, ClientConnectionRunner runner, Hash h, Hash fromLocalDest) Create a lookup job with the default timeout.Uses of Hash in net.i2p.router.crypto
Fields in net.i2p.router.crypto with type parameters of type HashModifier and TypeFieldDescriptionprivate final Map<Hash, FamilyKeyCrypto.Result> FamilyKeyCrypto._negativeCacheThe failed verifications, by hash.FamilyKeyCrypto._ourFamilyThe hashes of our own family members.private final Map<Hash, FamilyKeyCrypto.Verified> FamilyKeyCrypto._verifiedThe verified family members, by hash.Methods in net.i2p.router.crypto that return types with arguments of type HashMethods in net.i2p.router.crypto with parameters of type HashUses of Hash in net.i2p.router.dummy
Fields in net.i2p.router.dummy declared as HashFields in net.i2p.router.dummy with type parameters of type HashModifier and TypeFieldDescriptionprivate static Map<Hash, VMCommSystem> VMCommSystem._commSystemFacadesMapping from Hash to VMCommSystem for all routers hooked together.private final Map<Hash, RouterInfo> DummyNetworkDatabaseFacade._routersRouters this dummy database knows.Methods in net.i2p.router.dummy that return types with arguments of type HashModifier and TypeMethodDescriptionDummyNetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) DummyNetworkDatabaseFacade.getAllRouters()VMCommSystem.getEstablished()Return the established.DummyTunnelManagerFacade.getInboundClientPools()DummyTunnelManagerFacade.getOutboundClientPools()DummyPeerManagerFacade.getPeersByCapability(char capability) DummyClientManagerFacade.getPrimaryHashes()Return the set of primary hashes.DummyTunnelManagerFacade.selectPeersInTooManyTunnels()Methods in net.i2p.router.dummy with parameters of type HashModifier and TypeMethodDescriptionvoidDummyNetworkDatabaseFacade.accessLeaseSet(Hash key) DummyNetworkDatabaseSegmentor.clientNetDB(Hash id) intDummyTunnelManagerFacade.ensurePoolsFor(Hash client) voidRecord a lookup failure.voidDummyNetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) DummyClientManagerFacade.getClientFloodfillNetworkDatabaseFacade(Hash dbid) Return the floodfill network database facade.DummyClientManagerFacade.getClientSessionKeyManager(Hash _dest) intDummyTunnelManagerFacade.getInboundClientTunnelCount(Hash destination) DummyTunnelManagerFacade.getInboundPool(Hash client) DummyTunnelManagerFacade.getInboundSettings(Hash client) intDummyTunnelManagerFacade.getOutboundClientTunnelCount(Hash destination) DummyTunnelManagerFacade.getOutboundPool(Hash client) DummyTunnelManagerFacade.getOutboundSettings(Hash client) booleanVMCommSystem.isEstablished(Hash peer) Return whether established.booleanbooleanDummyTunnelManagerFacade.isValidTunnel(Hash client, TunnelInfo tunnel) voidDummyNetworkDatabaseFacade.lookupDestination(Hash key, Job onFinishedJob, long timeoutMs, Hash fromLocalDest) Look up a destination using the client's tunnels.DummyNetworkDatabaseFacade.lookupDestinationLocally(Hash key) Look up a destination in the in-memory store.voidDummyNetworkDatabaseFacade.lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs) Look up a lease set in the network database.voidDummyNetworkDatabaseFacade.lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest) DummyNetworkDatabaseFacade.lookupLeaseSetLocally(Hash key) voidDummyNetworkDatabaseFacade.lookupLeaseSetRemotely(Hash key, Hash fromLocalDest) voidDummyNetworkDatabaseFacade.lookupLeaseSetRemotely(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest) DummyNetworkDatabaseFacade.lookupLocally(Hash key) DummyNetworkDatabaseFacade.lookupLocallyWithoutValidation(Hash key) voidDummyNetworkDatabaseFacade.lookupRouterInfo(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs) Look up a router info in the network database.DummyNetworkDatabaseFacade.lookupRouterInfoLocally(Hash key) Look up a router info in the in-memory store.voidWe send messages between comms as bytes so that we strip any router-local info.voidDummyPeerManagerFacade.removeCapabilities(Hash peer) voidDummyNetworkDatabaseFacade.removeLeaseSetFromTracking(Hash key) Remove a lease set from tracking.voidDummyClientManagerFacade.requestLeaseSet(Hash dest, LeaseSet set) DummyTunnelManagerFacade.selectInboundExploratoryTunnel(Hash closestTo) DummyTunnelManagerFacade.selectInboundTunnel(Hash destination) DummyTunnelManagerFacade.selectInboundTunnel(Hash destination, Hash closestTo) DummyTunnelManagerFacade.selectOutboundExploratoryTunnel(Hash closestTo) DummyTunnelManagerFacade.selectOutboundTunnel(Hash destination) DummyTunnelManagerFacade.selectOutboundTunnel(Hash destination, Hash closestTo) voidDummyPeerManagerFacade.setCapabilities(Hash peer, String caps) voidDummyTunnelManagerFacade.setInboundSettings(Hash client, TunnelPoolSettings settings) voidDummyTunnelManagerFacade.setOutboundSettings(Hash client, TunnelPoolSettings settings) Store a key locally.DummyNetworkDatabaseFacade.store(Hash key, RouterInfo routerInfo) Store a key locally.booleanVMCommSystem.wasFailsafeClosed(Hash peer, long withinMs) Always false, the VM transport never disconnects.Method parameters in net.i2p.router.dummy with type arguments of type HashModifier and TypeMethodDescriptionDummyNetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) Constructors in net.i2p.router.dummy with parameters of type HashModifierConstructorDescriptionReceiveJob(Hash from, byte[] msg, RouterContext us) Holds a message to deliver to a job.Uses of Hash in net.i2p.router.message
Fields in net.i2p.router.message declared as HashModifier and TypeFieldDescriptionprivate final HashGarlicMessageReceiver._clientDestinationThe client the message is for.private final HashSendMessageDirectJob._targetHashThe hash of the target router.private final HashOutboundCache.HashPair.dhThe session's local hash.private final HashOutboundCache.HashPair.shThe session's remote hash.Fields in net.i2p.router.message with type parameters of type HashModifier and TypeFieldDescription(package private) final ConcurrentHashMap<Hash, Long> OutboundCache.lsFailCooldownPer-destination cooldown timestamps (epoch ms) after a failed LeaseSet lookup.(package private) final ConcurrentHashMap<Hash, Long> OutboundCache.lsLastLookupTimestamp (epoch ms) when the most recent real LeaseSet lookup for the destination started.(package private) final ConcurrentHashMap<Hash, Long> OutboundCache.lsLastValidTimestamp (epoch ms) when a valid LeaseSet for the destination was last observed locally (set on local find and on successful send).final ConcurrentHashMap<Hash, LeaseSet> OutboundCache.multihomedCacheCache for LeaseSets associated with multihomed routers or hosted destinations.Methods in net.i2p.router.message that return HashModifier and TypeMethodDescription(package private) static HashOutboundClientMessageOneShotJob.starvationNudgeKey(Hash sourceHash, Hash destHash) Which hash a pool-starvation nudge must be addressed to.Methods in net.i2p.router.message with parameters of type HashModifier and TypeMethodDescriptionprivate static PayloadGarlicConfigOutboundClientMessageJobHelper.buildAckClove(RouterContext ctx, Hash from, TunnelInfo replyToTunnel, long replyToken, long expiration, SessionKeyManager skm) Build a clove that sends a DeliveryStatusMessage to us.(package private) static GarlicMessageGarlicMessageBuilder.buildECIESMessage(RouterContext ctx, GarlicConfig config, Hash from, Destination to, SessionKeyManager skm, ReplyCallback callback) ECIES_X25519 and PQ only.private static GarlicConfigOutboundClientMessageJobHelper.createGarlicConfig(RouterContext ctx, long replyToken, long expiration, PublicKey recipientPK, PayloadGarlicConfig dataClove, Hash from, Destination dest, TunnelInfo replyTunnel, boolean requireAck, LeaseSet bundledReplyLeaseSet, SessionKeyManager skm) Make the top-level config, with a data clove, an optional ack clove, and an optional leaseset clove.(package private) static GarlicMessageOutboundClientMessageJobHelper.createGarlicMessage(RouterContext ctx, long replyToken, long expiration, PublicKey recipientPK, PayloadGarlicConfig dataClove, Hash from, Destination dest, TunnelInfo replyTunnel, int tagsToSendOverride, int lowTagsOverride, SessionKey wrappedKey, Set<SessionTag> wrappedTags, boolean requireAck, LeaseSet bundledReplyLeaseSet, ReplyCallback callback) Build a garlic message that will be delivered to the router on which the target is located.GarlicMessageHandler.createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash fromHash) Create and return a job to handle this message.private StringOutboundClientMessageOneShotJob.getDestNickname(Hash dest) Resolve a human-readable nickname for a destination, if available.(package private) static booleanGarlicMessageBuilder.needsTags(RouterContext ctx, PublicKey key, Hash local, int minTagOverride) ELGAMAL_2048 only; returns false for others.(package private) static HashOutboundClientMessageOneShotJob.starvationNudgeKey(Hash sourceHash, Hash destHash) Which hash a pool-starvation nudge must be addressed to.Method parameters in net.i2p.router.message with type arguments of type HashModifier and TypeMethodDescriptionprivate static voidOutboundCache.cleanLsFailCooldown(RouterContext ctx, Map<Hash, Long> cc) Removes expired LS fail cooldown entries.private static voidOutboundCache.cleanLsLastLookup(RouterContext ctx, Map<Hash, Long> mc) Prunes last-lookup timestamps older than two probe intervals.private static voidOutboundCache.cleanLsLastValid(RouterContext ctx, Map<Hash, Long> mc) Prunes last-valid timestamps older than the transient-gap grace window plus one cleanup interval (so a two-minute slack is kept).private static voidOutboundCache.cleanMultihomedCache(RouterContext ctx, Map<Hash, LeaseSet> mc) Removes expired LeaseSets from the multihomed cache.Constructors in net.i2p.router.message with parameters of type HashModifierConstructorDescriptionGarlicMessageReceiver(RouterContext context, GarlicMessageReceiver.CloveReceiver receiver, Hash clientDestination) Garlic message receiver targeting a specific client destination.HandleGarlicMessageJob(RouterContext context, GarlicMessage msg, RouterIdentity from, Hash fromHash, long msgIDBloomXorLocal, long msgIDBloomXorRouter, long msgIDBloomXorTunnel) Job to handle an inbound garlic message received outside of a tunnel.(package private)Hash pair.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority) Send a message directly to a peer.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with an XOR mask.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, Job onSend, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with full options.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) Send a message directly to a peer with reply handling.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with reply handling and XOR mask.Uses of Hash in net.i2p.router.naming
Methods in net.i2p.router.naming with parameters of type HashModifier and TypeMethodDescriptionBlockfileNamingService.getReverseEntries(Hash hash) Caller must synchronize.private static IntegerBlockfileNamingService.getReverseKey(Hash hash) Reverse lookup key for the hash.BlockfileNamingService.reverseLookup(Hash h) Look up a hostname from a hash.BlockfileNamingService.reverseLookupAll(Hash h) Return all hostnames registered for this hash.Uses of Hash in net.i2p.router.networkdb
Fields in net.i2p.router.networkdb declared as HashModifier and TypeFieldDescriptionprivate final HashHandleDatabaseLookupMessageJob._usOur own router hash.Methods in net.i2p.router.networkdb that return types with arguments of type HashModifier and TypeMethodDescriptionHandleDatabaseLookupMessageJob.getNearestRouters(DatabaseLookupMessage.Type lookupType) Closest to the message's search key, honoring the message's dontInclude set.Methods in net.i2p.router.networkdb with parameters of type HashModifier and TypeMethodDescriptionprotected voidHandleDatabaseLookupMessageJob.sendClosest(Hash key, Set<Hash> routerHashes, Hash toPeer, TunnelId replyTunnel) Send the closest routers to the requesting peer.private voidHandleDatabaseLookupMessageJob.sendData(Hash key, DatabaseEntry data, Hash toPeer, TunnelId replyTunnel) Sends the data that was found.protected voidHandleDatabaseLookupMessageJob.sendMessage(I2NPMessage message, Hash toPeer, TunnelId replyTunnel) Send an I2NP message to the specified peer.private voidHandleDatabaseLookupMessageJob.sendThroughTunnel(I2NPMessage message, Hash toPeer, TunnelId replyTunnel) Sends the message through the reply tunnel.Method parameters in net.i2p.router.networkdb with type arguments of type HashModifier and TypeMethodDescriptionprotected voidHandleDatabaseLookupMessageJob.sendClosest(Hash key, Set<Hash> routerHashes, Hash toPeer, TunnelId replyTunnel) Send the closest routers to the requesting peer.Constructors in net.i2p.router.networkdb with parameters of type HashModifierConstructorDescriptionHandleDatabaseLookupMessageJob(RouterContext ctx, DatabaseLookupMessage receivedMessage, RouterIdentity _from, Hash _fromHash, long msgIDBloomXor) Creates a new HandleDatabaseLookupMessageJob.Uses of Hash in net.i2p.router.networkdb.kademlia
Subclasses of Hash in net.i2p.router.networkdb.kademliaModifier and TypeClassDescription(package private) classPull the caching used only by KBucketImpl out of Hash and put it here.Classes in net.i2p.router.networkdb.kademlia that implement interfaces with type arguments of type HashModifier and TypeClassDescriptionprivate classCollector picking the closest floodfills.(package private) classEvicts the least-recently-attested peer from a full routing bucket so the netdb routing table rotates toward live peers instead of filling with dead-but-unexpired routers.Fields in net.i2p.router.networkdb.kademlia declared as HashModifier and TypeFieldDescriptionprivate static HashIterativeSearchJob._alwaysQueryHashHash to always query first, set from a router property for testing.private final HashFloodfillVerifyStoreJob._clientThe client that published the data.private final HashKademliaNetworkDatabaseFacade._dbidDB ID.private final HashRepublishLeaseSetJob._destDestination hash.private HashHandleFloodfillDatabaseStoreMessageJob._fromHashThe sender's hash, computed when needed.private final HashIterativeSearchJob._fromLocalDestThe local destination to search from, null if none.private final HashFloodfillPeerSelector.FloodfillSelectionCollector._keyThe hash being searched for.private final HashFloodfillVerifyStoreJob._keyThe key being verified.protected final HashFloodSearchJob._keyTarget database entry hash being searched.private final HashPersistentDataStore.ReadRouterJob._keyHash key of the router.private final HashStoreState._keyThe key being stored.private HashExploreJob._lastReplyFromThe peer that answered the last explore.private final HashFloodfillNetworkDatabaseFacade.DropLookupFailedJob._peerThe peer being searched for.private final HashFloodfillNetworkDatabaseFacade.DropLookupFoundJob._peerThe peer the reply goes to.private final HashFloodfillNetworkDatabaseFacade.FloodFailedJob._peerThe peer whose reply is awaited.private final HashFloodfillNetworkDatabaseFacade.FloodSuccessJob._peerThe peer being processed.private final HashIterativeTimeoutJob._peerThe peer that did not answer.private HashSearchJob.FailedJob._peerPeer hash.private final HashSearchMessageSelector._peerThe peer being searched for.private final HashSearchReplyJob._peerThe peer that sent the reply.private final HashSearchUpdateReplyFoundJob._peerThe hash of the searched peer.private final HashStoreMessageSelector._peerThe peer whose reply we are waiting for.private final HashIterativeSearchJob._rkeyThe routing key.private final HashSearchState._searchKeyThe hash being searched for.private final HashFloodfillVerifyStoreJob._sentToThe floodfill the query was sent to.private HashFloodfillVerifyStoreJob._targetThe floodfill currently holding the data.private final HashSingleSearchJob._toThe hash being looked up.final HashLookupBanHammer.ReplyTunnel.hThe hash of the peer that replied.private final HashPersistentDataStore.Disconnector.hRouter hash to disconnect.private final HashRefreshRoutersJob.Disconnector.hThe router to disconnect.static final HashFloodfillNetworkDatabaseSegmentor.MAIN_DBIDDatabase id of the special main netDb, deliberately null so it is never confused with a client's hash-keyed id.(package private) final HashFloodfillNetworkDatabaseFacade.TimeoutEntry.peerThe peer being searched for.Fields in net.i2p.router.networkdb.kademlia with type parameters of type HashModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<Hash, AtomicInteger> KademliaNetworkDatabaseFacade._activeFloodfillQueriesCount of active outbound iterative-search queries per floodfill peer; incremented when a query is dispatched, decremented when it completes or fails.private final ConcurrentHashMap<Hash, FloodSearchJob> FloodfillNetworkDatabaseFacade._activeFloodQueriesActive flood queries keyed by search hash.SearchState._attemptedPeersPeers asked at any point in the search.StoreState._attemptedPeersThe peers contacted so far.IntroducerLookupJob._attemptsIntroducer hash -> {last attempt time, consecutive failures}.KademliaNetworkDatabaseFacade._batchRepublishPendingPending set for batch deduplication — a hash is in this set iff it is in the batch queue or being processed.private final ConcurrentLinkedQueue<Hash> KademliaNetworkDatabaseFacade._batchRepublishQueueQueue for batching LeaseSet republishes within a 15-second window.private final ConcurrentHashMap<Hash, Long> KademliaNetworkDatabaseFacade._clientLeaseSetAccessTimeMap of remote destination Hash to last access time for LeaseSets we're using as a client.private final ConcurrentHashMap<Hash, DatabaseEntry> TransientDataStore._dataEntries held only for this router's uptime.KademliaNetworkDatabaseFacade._exploreKeysHash objects that we should search on (to fill up a bucket, not to get data).IterativeSearchJob._failedPeersQuery sent, failed, timed out, or got DSRM.SearchState._failedPeersPeers that failed to reply.private static final ConcurrentHashMap<Hash, Long> RepublishLeaseSetJob._firstDeferredAtWhen the first publish was deferred, per destination, cleared on success or on the first publish timeout.FloodfillPeerSelector.FloodfillSelectionCollector._floodfillMatchesFloodfill hashes matching the search.private static final ConcurrentHashMap<Hash, AtomicInteger> RepublishLeaseSetJob._globalFailCountPersistent per-destination store failure count, never reset, surviving job instances, used to decide when to do the expensive floodfill verification.private final ConcurrentHashMap<Hash, BlindData> BlindCache._hashCacheThe blind data, by destination hash.FloodfillVerifyStoreJob._ignoreFloodfills not to query again.private final Map<Hash, RouterInfo> FloodfillPeerSelector.FloodfillSelectionCollector._infoCacheRouter infos cached during the search.KademliaNetworkDatabaseFacade.PurgeMatchingRoutersJob._iterIterator over peer hashes during search.private KBucketSet<Hash> KademliaNetworkDatabaseFacade._kbKbucket set.private final Map<Hash, DatabaseEntry> PersistentDataStore.Writer._keysQueue of entries pending disk write.PersistentDataStore.Writer._keysToRemoveKeys to remove from disk on next write cycle.private static final ConcurrentHashMap<Hash, Long> RepublishLeaseSetJob._lastIneffectiveRemintWhen this destination last ran a re-mint that could not improve anything.private static final ConcurrentHashMap<Hash, Long> RepublishLeaseSetJob._lastMissingLogTimeLast log timestamp per destination to throttle missing-LeaseSet log messages.private static final ConcurrentHashMap<Hash, Long> RepublishLeaseSetJob._lastNotRequeueLogTimeLast log timestamp per destination to throttle no-requeue log messages.ProbeStalePeerJob._lastProbedWhen each peer was last probed.private static final ConcurrentHashMap<Hash, Long> RepublishLeaseSetJob._lastPublishLogTimeLast publish attempt per destination.ContactDrivenRefreshJob._lastRefreshCooldown tracker: peer hash -> last refresh time (ms).private static final ConcurrentHashMap<Hash, Long> RepublishLeaseSetJob._lastShortExpiryLogLast short-expiry warning per destination, for rate limiting.private static final ConcurrentHashMap<Hash, Long> RepublishLeaseSetJob._lastVerifyLogTimeLast log timestamp per destination to throttle verification log messages.SearchState._leaseSetResponsesLease sets found, by hash.private final ConcurrentLinkedQueue<Hash> ContactDrivenRefreshJob._pendingPeers we've heard from recently that may need a RI refresh.private final Map<Hash, MessageWrapper.WrappedMessage> StoreState._pendingMessagesThe sent messages awaiting a reply.SearchState._pendingPeersPeers asked, waiting for a reply.StoreState._pendingPeersThe peers not yet replied.SearchState._pendingPeerTimesWhen each pending peer was asked.StoreState._pendingPeerTimesWhen each pending peer was contacted.RepublishLeaseSetJob._publishedOnceDestinations that have published successfully at least once — never defer these again.private final ConcurrentMap<Hash, Set<RepublishLeaseSetJob>> KademliaNetworkDatabaseFacade._publishingLeaseSetsMap of Hash to RepublishLeaseSetJob for leases we're already managing.IterativeSearchJob._queriedFloodfillsFloodfill peers we've sent queries to in this search — for active-query tracking.private static final ConcurrentHashMap<Hash, Long> IterativeSearchJob._recentlyCompletedStatic cache of recently completed searches: peer hash -> expiration timestamp.private final ConcurrentHashMap<Hash, Long> KademliaNetworkDatabaseFacade._recentlyQueriedFloodfillsTracks recently-queried floodfill peers across all concurrent searches to avoid hammering the same floodfill.private static final ConcurrentHashMap<Hash, AtomicInteger> RepublishLeaseSetJob._remintDefersConsecutive re-mint deferral count per destination, to bound fresh-build waiting.SearchState._repliedPeersPeers that replied at all.private static final ConcurrentHashMap<Hash, Boolean> RepublishLeaseSetJob._retryInProgressTracks destinations currently being retried to prevent duplicate retries.RefreshRoutersJob._routersThe routers still to visit this cycle, highest-value first.ProbeStalePeerJob._scoresProbe scores for the current cycle's candidates, keyed by hash.IterativeSearchJob._sentTimeThe time the query was sent to a peer, which we need to update profiles correctly.IterativeSearchJob._skippedPeersThe peers left out of the search.FloodfillPeerSelector.FloodfillSelectionCollector._sortedCandidate hashes, sorted by distance.SearchState._successfulPeersPeers that replied with results.StoreState._successfulPeersThe peers that stored the entry.private static final ConcurrentHashMap<Hash, Integer> RepublishLeaseSetJob._supplyDeferralsConsecutive supply-check deferrals per destination, bounded so a pool that never reaches the freshness threshold cannot defer its LeaseSet forever.KademliaNetworkDatabaseFacade.PurgeMatchingRoutersJob._toCheckTo check set.FloodfillPeerSelector.FloodfillSelectionCollector._toIgnoreHashes to skip in the search.IterativeSearchJob._toTryPeers not sent to yet, sorted closest-to-the-routing-key.FloodOnlySearchJob._unheardFromPeers that did not answer this search.IterativeSearchJob._unheardFromQuery sent, no reply yet.KademliaNetworkDatabaseFacade._unverifiedPeersPeers stored in the netdb but not yet in the routing buckets, awaiting direct-contact evidence before insertion (verify-before-add).FloodfillNetworkDatabaseFacade._verifiesInProgressHashes whose verification is in progress.LocalHash._xorCacheDistances already computed, by peer hash.private final Map<Hash, Destination> NegativeLookupCache.badDestsThe destinations known to be bad.LookupThrottler.burstTimestampsMap of peer hashes to sets of reply tunnel IDs for throttling.NegativeLookupCache.cachedUntilEpoch ms until which a tripped key remains negatively cached.private final ObjectCounter<Hash> FloodThrottler.counterLookup floods counted per peer.private final ConcurrentHashMap<Hash, ConcurrentHashMap<TunnelId, AtomicInteger>> LookupThrottler.counterConcurrent hash map.private final ObjectCounter<Hash> NegativeLookupCache.counterFailed lookups per hash.NegativeLookupCache.lastFailAtLast time a fail was recorded for the key (streak / age tracking).private final ObjectCounter<Hash> NegativeLookupCache.timeoutCounterTimed out lookups per hash.NegativeLookupCache.tripCountHow many times the key has tripped the threshold (TTL backoff).Methods in net.i2p.router.networkdb.kademlia that return HashModifier and TypeMethodDescriptionBlindCache.getBlindedHash(Destination dest) The hash to lookup for a dest.BlindCache.getBlindedHash(SigningPublicKey spk) The hash to lookup for a SPK known to be blinded.private HashFloodfillStoreJob.getClientHash(DatabaseEntry data, Hash key) The client hash from the data, or the key if not available.(package private) HashRepublishLeaseSetJob.getDestHash()The destination hash this job publishes for.IterativeSearchJob.getFromHash()Hash of the dest this query is from.BlindCache.getHash(Destination dest) The hash to lookup for a dest.The hash to lookup for a dest hash.private static HashExtract hash from a prefixed+suffixed filename.FloodSearchJob.getKey()The database entry hash being searched.(package private) static HashPersistentDataStore.getRouterInfoHash(String filename) Package private for installer BundleRouterInfos.StoreState.getSuccessful()Return a successful peer (a random one if more than one was successful) or null.SearchState.getTarget()The search target.StoreState.getTarget()The DatabaseEntry hash target.(package private) static HashIntroducerLookupJob.parseIntroducerHash(String b64) Decode an "ih{i}" option value into a Hash: Base64 of exactly 32 bytes, else null.private HashFloodfillVerifyStoreJob.pickTarget()Pick a responsive floodfill close to the key, but not the one we sent to.Methods in net.i2p.router.networkdb.kademlia that return types with arguments of type HashModifier and TypeMethodDescriptionFloodfillPeerSelector.buildFloodfillCandidates(Set<Hash> toIgnore) Build the floodfill candidate list with only the cheap per-peer checks: the exclusion set, the two banlist tiers, and the unreachable capability flag.private List<Map.Entry<Hash, DatabaseEntry>> PersistentDataStore.Writer.drainPending()Drain up to WRITE_LIMIT pending entries from the write queue.KademliaNetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) The routers closest to that key in response to a remote lookup.FloodfillPeerSelector.FloodfillSelectionCollector.get(int howMany) The first howMany matching entries, floodfills with the 'f' mark in their NetDb except for banlisted ones; non-floodfills only if there aren't enough floodfills.KademliaNetworkDatabaseFacade.getAllRouters()Hashes for all known routers.SearchState.getAttempted()Copy of the attempted peers.StoreState.getAttempted()The peers attempted OR skipped.SearchState.getClosestAttempted(int max) Up to max attempted peers closest to the target.StoreJob.getClosestFloodfillRouters(Hash key, int numClosest, Set<Hash> alreadyChecked) Find the closest floodfill routers to a given key.SearchJob.getClosestRouters(Hash key, int numClosest, Set<Hash> alreadyChecked) Hash structures for routers we want to check next.KademliaNetworkDatabaseFacade.getExploreKeys()Keys to explore.SearchState.getFailed()Copy of the failed peers.FloodfillNetworkDatabaseFacade.getFloodfillPeers()List of the hashes of currently known floodfill peers.IntroducerLookupJob.getIntroducerHashes(Collection<RouterAddress> addresses) Extract SSU2 introducer router hashes ("ih0".."ih4") from the given addresses.(package private) KBucketSet<Hash> KademliaNetworkDatabaseFacade.getKBuckets()KBucketSet for the main DB.DataStore.getKeys()All keys stored in the data store.TransientDataStore.getKeys()Keys of all stored entries.DataStore.getMapEntries()All map entries in the data store.TransientDataStore.getMapEntries()All stored entries as key-value pairs.SearchState.getPending()Copy of the pending peers.SearchState.getRepliedPeers()Copy of the peers that replied.SearchState.getSuccessful()Copy of the successful peers.KademliaNetworkDatabaseFacade.getUnverifiedPeersSnapshot()Snapshot of the pending-verification queue, for the probe cycle to target.SearchState.locked_getClosest(Set<Hash> peers, int max, Hash target) Picks the peers closest to the target.FloodfillNetworkDatabaseFacade.selectFloodfillParticipants(Set<Hash> toIgnore, int concurrent) Selects a set of floodfill participant peers to which data should be sent: random selection among the filtered floodfill participants, preferring peers not queried in the last 60s to spread load, with a fallback top-up so store operations never starve.FloodfillPeerSelector.selectFloodfillParticipants(Set<Hash> toIgnore, KBucketSet<Hash> _kbuckets) List MAY INCLUDE our own hash.FloodfillPeerSelector.selectFloodfillParticipants(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets) See above for description List will not include our own hash Returns new list, may be modified.FloodfillPeerSelector.selectFloodfillParticipants(Hash key, int maxNumRouters, KBucketSet<Hash> kbuckets) Sort the floodfills.FloodfillPeerSelector.selectFloodfillParticipants(KBucketSet<Hash> kbuckets) List will not include our own hash.FloodfillPeerSelector.selectFloodfillParticipantsIncludingUs(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets) See above for description List MAY CONTAIN our own hash unless included in toIgnore Returns new list, may be modified.ExpireLeasesJob.selectKeysToExpire()Run through the entire data store, finding all expired leaseSets (ones that don't have any leases that haven't yet passed, even with the CLOCK_FUDGE_FACTOR).StartExplorersJob.selectKeysToExplore(int num) Selects a set of keys from the exploration pool, supplementing with bucket-targeted keys (classic Kademlia bucket refresh) and then random keys if needed.FloodfillPeerSelector.selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Floodfill peers only.PeerSelector.selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Peers nearest to the key in routing space.FloodfillPeerSelector.selectNearestExplicit(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Pick out peers with the floodfill capacity set, returning them first, but then after they're complete, sort via kademlia.PeerSelector.selectNearestExplicit(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Peers nearest to the key, floodfills first, then sorted by Kademlia distance.FloodfillNetworkDatabaseFacade.selectStoreParticipants(List<Hash> shuffled, int concurrent, Set<Hash> recentlyQueried) Select up toconcurrentstore participants, preferring peers not queried in the last 60s to spread load, with a fallback top-up so store operations never starve.Methods in net.i2p.router.networkdb.kademlia with parameters of type HashModifier and TypeMethodDescriptionvoidKademliaNetworkDatabaseFacade.accessLeaseSet(Hash key) Record access to a LeaseSet for refresh tracking.(package private) booleanThis is called fromSearchReplyJob.voidAdd an entry to the selection, skipping ignored, banlisted, or non-floodfill entries once enough matches have been collected.(package private) booleanAdds a peer to the search.(package private) static voidIterativeSearchJob.addClosest(Collection<Hash> candidates, Collection<Hash> allRouters, Hash rkey, Hash us, Hash key, int cap) Add the closest cap peers of allRouters, by XOR distance from rkey, excluding us and key.(package private) booleanKademliaNetworkDatabaseFacade.addContact(Hash key) Policy entry point for peers learned from search replies, where no RouterInfo is in hand yet: direct-contact gate only.private voidKademliaNetworkDatabaseFacade.addContact(Hash key, RouterInfo routerInfo) Insert a newly-stored peer into the routing buckets, gated on two local-only checks (no wire-format change): verify-before-add — a peer merely named in someone else's DatabaseSearchReply has never answered us, so it waits inKademliaNetworkDatabaseFacade._unverifiedPeersuntil direct-contact evidence arrives (a reply, a successful send, or an established session).voidSearchState.addInitialLeaseSetResponse(Hash peer, LeaseSet ls) Record the peer's LeaseSet response from the initial phase.voidSearchState.addLeaseSetResponse(Hash peer, LeaseSet ls) Record the peer's LeaseSet response.voidSearchState.addPending(Hash peer) Add the peer to the pending and attempted sets.voidStoreState.addPending(Hash peer) Increments attempted count.voidStoreState.addPending(Hash peer, MessageWrapper.WrappedMessage msg) Adds a pending message for tracking.(package private) static booleanFloodfillPeerSelector.addSameIPFingerprint(Set<Long> maskedIPs, Set<Integer> ports, Set<String> families, RouterContext ctx, Hash peer, RouterInfo pinfo, int mask) Fingerprint a candidate peer into the exclusion accumulators, adding compact masked-IP keys, ports, and the claimed family option.voidStoreState.addSkipped(Hash peer) We aren't even going to try to contact this peer.private booleanKademliaNetworkDatabaseFacade.allowPolicyBan(Hash key) Whether policy bans (country/XG/LU/capability) may be applied to this router during resolution.private voidFloodfillPeerSelector.banAndDisconnect(Hash entry, RouterInfo info, String banReason, String logReason, String disconnectReason, long banDuration, long logDuration, long now) Ban, log, and disconnect from a floodfill peer, with separate texts for the banlist, the ban log, and the disconnect reason.protected I2NPMessageExploreJob.buildMessage(TunnelId replyTunnelId, Hash replyGateway, long expiration, RouterInfo peer) Builds the database lookup message to send to a peer.protected I2NPMessageSearchJob.buildMessage(TunnelId replyTunnelId, Hash replyGateway, long expiration, RouterInfo peer) Build the database search message.voidNegative cache the hash for one entry-TTL generation.private RouterInfoFloodfillPeerSelector.FloodfillSelectionCollector.cachedInfo(Hash entry) Look up the RouterInfo for an entry, caching the result.byte[]Calculate the xor with the current object and the specified hash, caching values where possible.private booleanKademliaNetworkDatabaseFacade.cancelActiveRepublishJob(Hash hash) Cancel any queued RepublishLeaseSetJob for the given hash.private booleanKademliaNetworkDatabaseFacade.checkCountryBlocking(RouterInfo routerInfo, String caps, String routerId, Hash h) Checks if the given router should be blocked due to country restrictions.private StringKademliaNetworkDatabaseFacade.checkExpiredLeaseSet(Hash key, LeaseSet leaseSet, long earliest, long latest, long now, String idShort) Reject a LeaseSet whose timestamps are outdated (stale).private StringKademliaNetworkDatabaseFacade.checkFutureRouterInfo(RouterInfo routerInfo, long now, String caps, String routerId, Hash h, boolean isUs) Checks if the given router info was published in the future and bans it if so.private voidKademliaNetworkDatabaseFacade.checkLeaseSetSigType(Hash h, LeaseSet ls) Reject LeaseSets with unsupported signature types; negative-cache the destination permanently.private booleanKademliaNetworkDatabaseFacade.checkLU(RouterInfo routerInfo, String caps, String routerId, Hash h) Ban LU (low bandwidth) routers unconditionally for 1 hour.private voidKademliaNetworkDatabaseFacade.checkRouterInfoSigType(Hash h, RouterInfo ri) Reject RouterInfos with unsupported signature types; ban until restart.private StringKademliaNetworkDatabaseFacade.checkRouterVersion(RouterInfo routerInfo, String caps, String routerId, Hash h) Checks if the given router is running a version older than the minimum allowed.private booleanPersistentDataStore.checkSpoofAndBan(Hash key, RouterInfo ri, PersistentDataStore.RiFlags f) Detect IP spoofing and apply ban decisions for non-storeable peers.private booleanKademliaNetworkDatabaseFacade.checkXG(RouterInfo routerInfo, String caps, String routerId, Hash h) Whether the router should be XG-banned: an X-tier (unlimited bandwidth) router advertising the G (no tunnels) capability.private FloodfillPeerSelector.PeerClassFloodfillPeerSelector.classifyFloodfillPeer(Hash entry, RouterInfo info, boolean sameIP, long now, boolean enforceHeard, double maxFailRate) Classify a single floodfill peer as GOOD, OK, or BAD for selection.FloodfillPeerSelector.classifyFloodfillPeerForDisplay(Hash entry, RouterInfo info, long now) Classify a floodfill peer for display purposes.voidClears the transient failure count for the given hash only, including its trip generation (next trip starts at base TTL).voidKademliaNetworkDatabaseFacade.clearNegativeCache(Hash key) Clear any transient (non-permanent) negative-cache entry for the given key so the nextKademliaNetworkDatabaseFacade.lookupLeaseSet(Hash, Job, Job, long)performs a real search instead of aborting instantly.static voidIterativeSearchJob.clearRecentlyQueried(Hash peer) Clear peer from grace period cache (received their response).FloodfillNetworkDatabaseSegmentor.clientNetDB(Hash id) The client netDb for the given id.abstract NetworkDatabaseFacadeSegmentedNetworkDatabaseFacade.clientNetDB(Hash dbid) A client netDb for a given client Hash identifier.private voidIterativeSearchJob.collectFingerprint(RouterContext ctx, Hash peer, int mask) Collect one candidate's fingerprint keys into the reusable scratch buffers, without claiming them.(package private) voidMust be called by the search job queued by search() on success or failure.longMark the peer as confirmed and return the response time.voidFloodfillNetworkDatabaseFacade.contactHeardFrom(Hash peer) Notify that we heard from or about a peer (e.g.FloodfillDatabaseLookupMessageHandler.createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash fromHash) Creates a job to handle an incoming DatabaseLookupMessage, or returns null if the lookup should be dropped.FloodfillDatabaseStoreMessageHandler.createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash fromHash) longHow long it took to get the reply, or -1 if we don't know.(package private) voidKademliaNetworkDatabaseFacade.decrementActiveFloodfillQuery(Hash floodfill) Decrement the active outbound query count for a floodfill peer.(package private) intFloodOnlySearchJob.decrementRemaining(Hash peer) Note that we heard from the peer.(package private) booleanKademliaNetworkDatabaseFacade.dropAfterLookupFailed(Hash peer) Final remove for a router info.private voidIf the key already has a per-entry TTL, drop counts when due (lazy expire).private PersistentDataStore.RiFlagsPersistentDataStore.extractRiFlags(Hash key, RouterInfo ri) Extract classification flags from raw RouterInfo data.voidFinal remove for a leaseset.(package private) voidNote that the peer did not respond with a DSM (either a DSRM, timeout, or failure).KademliaNetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) The routers closest to that key in response to a remote lookup.booleanDataStore.forcePut(Hash key, DatabaseEntry data) Unconditionally store, bypass all newer/older checks.booleanPersistentDataStore.forcePut(Hash key, DatabaseEntry data) Unconditionally store, bypassing all newer/older checks.booleanTransientDataStore.forcePut(Hash key, DatabaseEntry data) Unconditionally store, bypass all newer/older checks.MessageWrapper.generateSession(RouterContext ctx, Hash localDest, long expiration, boolean forceElG) Create a single key and tag, for receiving a single encrypted message, and register it with the client's session key manager, to expire in the time specified.Retrieve the database entry for the given key.Retrieve the database entry for the given key with optional persistence control.The entry stored for the key, or null if not found.Prepare for having only a partial set in memory and the rest on disk.The entry for the key, or null if not found.For PersistentDataStore only - don't use here.NegativeLookupCache.getBadDest(Hash h) Cached bad destination for the given hash.private HashFloodfillStoreJob.getClientHash(DatabaseEntry data, Hash key) The client hash from the data, or the key if not available.StoreJob.getClosestFloodfillRouters(Hash key, int numClosest, Set<Hash> alreadyChecked) Find the closest floodfill routers to a given key.SearchJob.getClosestRouters(Hash key, int numClosest, Set<Hash> alreadyChecked) Hash structures for routers we want to check next.The hash to lookup for a dest hash.private StringFloodfillDatabaseLookupMessageHandler.getIPFromHash(Hash h) Extract IP:port fromRouterInfofor a peer hash.private LeaseSetKademliaNetworkDatabaseFacade.getLocalLeaseSet(Hash key) Read a current LeaseSet from this facade's store only.intKademliaNetworkDatabaseFacade.getPeerTimeout(Hash peer) How long to wait for one peer's reply, scaled from its profile.StoreState.getPendingMessage(Hash peer) Returns the pending message for the specified peer.protected intSearchJob.getPerPeerTimeoutMs(Hash peer) Per-peer timeout adjusted for floodfill and remaining time.static FilePersistentDataStore.getRouterInfoFile(RouterContext ctx, Hash hash) The persistent RI file for a hash.private StringPersistentDataStore.getRouterInfoName(Hash hash) Builds the router info file name for a hash.private NetworkDatabaseFacadeFloodfillNetworkDatabaseSegmentor.getSubNetDB(Hash id) Retrieves the FloodfillNetworkDatabaseFacade object for the specified ID.private voidKademliaNetworkDatabaseFacade.handleBanlistAndRemove(RouterInfo ri, Hash key, Job onFailedLookupJob) Banlist a router for one hour as an unreachable low-bandwidth peer older thanKademliaNetworkDatabaseFacade.MIN_VERSION, then drop it from the data store, the routing buckets and the unverified queue.private voidKademliaNetworkDatabaseFacade.handleCustomCapabilityBan(RouterInfo ri, Hash key, Job onFailedLookupJob) Handle banning a router that matches custom capability ban patterns, for four hours.private voidKademliaNetworkDatabaseFacade.handleHostileBlocklist(RouterInfo _ri, Hash key, Job onFailedLookupJob) Drop the RouterInfo of a router tagged hostile on the Banlist, without extending or adding a ban.private voidKademliaNetworkDatabaseFacade.handleIntroducerBan(RouterInfo ri, Hash key, Job onFailedLookupJob) Handle banning a router that advertises more introducers on one address than the SSU2 spec allows.private voidKademliaNetworkDatabaseFacade.handleInvalidRouterInfoBan(RouterInfo ri, Hash key, String reason, Job onFailedLookupJob) Handle banning a RouterInfo that breaks one of the RouterInfo validation rules - fabricated version, impossible publication date, or contradictory reachability flags.private voidKademliaNetworkDatabaseFacade.handleNonPublishedLeaseSet(Hash hash) A local client whose LS is not published to the network (i2cp.dontPublishLeaseSet, e.g.private voidKademliaNetworkDatabaseFacade.handlePermanentBlocklist(RouterInfo _ri, Hash key, Job onFailedLookupJob) Drop the RouterInfo of a router already on the permanent blocklist; no new ban entry is written, the existing one stands.(package private) booleanKademliaNetworkDatabaseFacade.hasActiveRepublishJob(Hash hash) Check if an active republish job exists for the given destination.(package private) booleanKademliaNetworkDatabaseFacade.hasDirectContact(Hash peer) Have we ever heard from this peer directly, as opposed to merely being told about it? An established session or a profile with a received message or successful send counts.(package private) voidCalled when we hear from or about a peer.(package private) intKademliaNetworkDatabaseFacade.incrementActiveFloodfillQuery(Hash floodfill) Increment the active outbound query count for a floodfill peer.(package private) booleanKademliaNetworkDatabaseFacade.ipDiversityAllows(Hash key, RouterInfo routerInfo) Would adding this peer to its bucket exceed the per-bucket or global IP-group caps? Peers with no literal-IP address are unconstrained.booleanCheck if the hash is in the negative cache.(package private) booleanKademliaNetworkDatabaseFacade.isFloodfillOverloaded(Hash floodfill) Check if a floodfill peer already has too many active outbound queries from this router.private booleanKademliaNetworkDatabaseFacade.isHostileBlocklisted(Hash key) Whether the router is on the hostile blocklist.booleanCheck if the given key exists in the data store.booleanWhether the data store contains the key.private booleanKademliaNetworkDatabaseFacade.isLocalDestination(Hash key) Whether the key is one of our own destinations.(package private) booleanKademliaNetworkDatabaseFacade.isNegativeCached(Hash key) Is the key in the negative lookup cache?booleanKademliaNetworkDatabaseFacade.isNegativeCachedForever(Hash key) Is it permanently negative cached?private booleanKademliaNetworkDatabaseFacade.isPermanentlyBlocklisted(Hash key) Whether the router is on the permanent blocklist.(package private) booleanKademliaNetworkDatabaseFacade.isRecentlyQueried(Hash peer) Check if a floodfill peer was queried recently (within cooldown period).private booleanWhether the cache is full enough to stop storing.(package private) booleanFloodfillNetworkDatabaseFacade.isVerifyInProgress(Hash h) Checks if verification is in progress for the specified hash.(package private) static longStaleContactTrimmer.lastSeen(RouterContext context, Hash peer) The newest contact evidence for a peer, 0 when there is none.SearchState.locked_getClosest(Set<Hash> peers, int max, Hash target) Picks the peers closest to the target.private static StringKademliaNetworkDatabaseFacade.logName(NamingService ns, Hash key) Best-effort display name for a tracked LeaseSet in logs: the registered hostname when available, otherwise a truncated base32.protected voidFloodfillNetworkDatabaseFacade.lookupBeforeDropping(Hash peer, RouterInfo info) Search for a newer router info, drop it from the db if the search fails, unless just started up or have bigger problems.protected voidKademliaNetworkDatabaseFacade.lookupBeforeDropping(Hash peer, RouterInfo info) Don't use directly - see F.N.D.F.voidKademliaNetworkDatabaseFacade.lookupDestination(Hash key, Job onFinishedJob, long timeoutMs, Hash fromLocalDest) Lookup using the client's tunnels Succeeds even if LS validation and store fails due to unsupported sig type, expired, etc.KademliaNetworkDatabaseFacade.lookupDestinationLocally(Hash key) Destination stored locally, or null.(package private) voidKademliaNetworkDatabaseFacade.lookupFailed(Hash key) Increment in the negative lookup cache.voidNegativeLookupCache.lookupFailed(Hash h) Record a failed lookup for the given hash.voidKademliaNetworkDatabaseFacade.lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs) Look up a LeaseSet, locally first.voidKademliaNetworkDatabaseFacade.lookupLeaseSet(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest) Lookup using the client's tunnels UseKademliaNetworkDatabaseFacade.lookupDestination(Hash, Job, long, Hash)if you don't need the LS or don't need it validated.KademliaNetworkDatabaseFacade.lookupLeaseSetLocally(Hash key) LeaseSet stored locally.voidKademliaNetworkDatabaseFacade.lookupLeaseSetRemotely(Hash key, Hash fromLocalDest) Unconditionally lookup using the client's tunnels, with no jobs.voidKademliaNetworkDatabaseFacade.lookupLeaseSetRemotely(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, Hash fromLocalDest) Unconditionally lookup using the client's tunnels.KademliaNetworkDatabaseFacade.lookupLocally(Hash key) Validated entry stored locally.KademliaNetworkDatabaseFacade.lookupLocallyWithoutValidation(Hash key) Not for use without validation.private static RouterInfoIterativeSearchJob.lookupRIUnvalidated(RouterContext ctx, Hash peer) Look up a peer's RouterInfo in the router's main NetDb, skipping the full validation performed byNetworkDatabaseFacade.lookupRouterInfoLocally(Hash).(package private) RouterInfoKademliaNetworkDatabaseFacade.lookupRIUnvalidated(Hash key) Look up a peer's RouterInfo without running the fullKademliaNetworkDatabaseFacade.validate(RouterInfo)ban cascade.voidKademliaNetworkDatabaseFacade.lookupRouterInfo(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs) Look up a RouterInfo, resolving over the network when not cached locally.KademliaNetworkDatabaseFacade.lookupRouterInfoLocally(Hash key) This will return immediately with the result or null.voidKademliaNetworkDatabaseFacade.lookupRouterInfoRemote(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs) Look up a RouterInfo by hash, performing a network search if not locally cached.(package private) voidKademliaNetworkDatabaseFacade.lookupTimeout(Hash key) Pure-timeout search failure (no peer replied).voidNegativeLookupCache.lookupTimeout(Hash h) Record a pure-timeout search failure (no peer ever replied).(package private) voidKademliaNetworkDatabaseFacade.markQueried(Hash peer) Mark a floodfill peer as recently queried.private voidOn the transition into the cached state, set a per-entry TTL with backoff from how many times this key has tripped before.(package private) voidIterativeSearchJob.newPeerToTry(Hash peer) A new (floodfill) peer was discovered that may have the answer.booleanKademliaNetworkDatabaseFacade.peekNegativeCached(Hash key) Negative-cache check without recording an abort stat.private voidRefreshRoutersJob.performRouterRefresh(Hash routerHash, RouterInfo ri) Performs the router refresh operation by calling the facade search with proper timeout.private LeaseStoreJob.pickReplyTunnel(LeaseSet ls, int attempts, Hash to) Pick a reply tunnel from a LeaseSet for the store response.private DatabaseLookupMessageFloodfillDatabaseLookupMessageHandler.preProcessDatabaseLookup(DatabaseLookupMessage dlm, Hash fromHash) Handle special cases: - Fix loopback DLM bug (pre-0.9.67) where from was set to self - Reject direct floodfill-to-floodfill lookups of type EXPL or ANY.private booleanKademliaNetworkDatabaseFacade.proactivelyRefreshIfExpiring(Hash key, long now, NamingService ns) Refresh a tracked LeaseSet early when it is about to expire.(package private) voidFloodfillNetworkDatabaseFacade.probeStalePeer(Hash peer, RouterInfo ri) Fire a DirectLookupJob for a stale peer, deduplicated via _activeFloodQueries.private voidKademliaNetworkDatabaseFacade.processStoreFailure(Hash h, DatabaseEntry entry) If the validate fails, call this to determine if it was because of unsupported crypto.booleanDataStore.put(Hash key, DatabaseEntry data) Store a database entry with the given key.booleanDataStore.put(Hash key, DatabaseEntry data, boolean persist) Store a database entry with the given key and persistence control.booleanPersistentDataStore.put(Hash key, DatabaseEntry data) Store the entry and persist it to disk.booleanPersistentDataStore.put(Hash key, DatabaseEntry data, boolean persist) Store the entry and optionally persist it to disk.booleanTransientDataStore.put(Hash key, DatabaseEntry data) Store an entry, replacing any previous one for the key.booleanTransientDataStore.put(Hash key, DatabaseEntry data, boolean persist) For PersistentDataStore only - don't use here.voidPersistentDataStore.Writer.queue(Hash key, DatabaseEntry data) Add entry to the disk write queue.private voidKademliaNetworkDatabaseFacade.queueUnverified(Hash key) Queue a peer for later bucket promotion once it proves itself, sweeping expired entries when the queue is full.(package private) static booleanRepublishLeaseSetJob.recordPublishAttempt(ConcurrentHashMap<Hash, Long> times, Hash dest, Long previous, long now) Record that we tried to publish for this destination, and report whether the event is worth logging.private voidKademliaNetworkDatabaseFacade.refreshLocalLeaseSetIfExpiring(Hash key, long now) Nudge the inbound pool to re-publish our own LeaseSet when a client is actively using it and the earliest lease is inside the proactive window.private voidNegativeLookupCache.refreshStreak(Hash h, long now) Discard a below-threshold fail streak that has outlivedcleanTimeso "N fails within the window" still holds without a global wipe.voidFloodfillNetworkDatabaseFacade.registerSearchTimeout(Hash peer, IterativeSearchJob search, long timeoutMs) Register a search timeout to be processed in batches.Remove the entry for the given key.Remove the entry for the given key with optional persistence control.Remove from memory and queue the file for disk deletion.Remove from memory and optionally queue disk deletion.voidMark a key for removal from disk on next cycle.Remove and return the entry for the key.For PersistentDataStore only - don't use here.private voidPersistentDataStore.removeFile(Hash key, File dir) Delete the RouterInfo file for a hash, if it is present.private voidKademliaNetworkDatabaseFacade.removeFromNetDb(Hash key) Remove a router from the NetDb without banning it.voidKademliaNetworkDatabaseFacade.removeLeaseSetFromTracking(Hash key) Remove a LeaseSet from refresh tracking.voidSearchState.removePending(Hash peer) We didn't actually want to add this peer as part of the pending list...(package private) voidKademliaNetworkDatabaseFacade.removePublishingJob(Hash hash, RepublishLeaseSetJob job) Remove a specific job from the tracking set.voidKademliaNetworkDatabaseFacade.removeRouterInfo(Hash key) Remove a RouterInfo from the local netdb.(package private) voidExploreJob.replyFound(DatabaseSearchReplyMessage message, Hash peer) Process a reply listing routers that hold the key.(package private) voidSearchJob.replyFound(DatabaseSearchReplyMessage message, Hash peer) Found a reply.longSearchState.replyFound(Hash peer) How long it took to get the reply, or -1 if we don't know.voidSearchState.replyTimeout(Hash peer) Move the peer from pending to failed on timeout.voidStoreState.replyTimeout(Hash peer) Remove the peer from pending on timeout.private voidIntroducerLookupJob.requestLookup(RouterContext ctx, Hash h, long now, int timeoutMs) Record the attempt and issue one non-blocking remote RI lookup with the given deadline (never past this cycle's query budget, never above the standard adaptive RouterInfo lookup cap).private voidKademliaNetworkDatabaseFacade.scheduleRepublish(Hash hash) Queues the LeaseSet for future republishing.private intScore a peer for refresh priority.(package private) SearchJobFloodfillNetworkDatabaseFacade.search(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease) Lookup using exploratory tunnels.(package private) SearchJobFloodfillNetworkDatabaseFacade.search(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease, Hash fromLocalDest) Lookup using the client's tunnels.(package private) abstract SearchJobKademliaNetworkDatabaseFacade.search(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease) Begin a kademlia-style iterative search for the key, which can take up to timeoutMs and will fire the appropriate jobs on success or timeout (or if the search completes without any match).(package private) abstract SearchJobKademliaNetworkDatabaseFacade.search(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease, Hash fromLocalDest) Search using the client's tunnels; seeKademliaNetworkDatabaseFacade.search(Hash, Job, Job, long, boolean).(package private) voidKademliaNetworkDatabaseFacade.searchComplete(Hash key) The search for the given key is no longer active.FloodfillPeerSelector.selectFloodfillParticipants(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets) See above for description List will not include our own hash Returns new list, may be modified.FloodfillPeerSelector.selectFloodfillParticipants(Hash key, int maxNumRouters, KBucketSet<Hash> kbuckets) Sort the floodfills.FloodfillPeerSelector.selectFloodfillParticipantsIncludingUs(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets) See above for description List MAY CONTAIN our own hash unless included in toIgnore Returns new list, may be modified.FloodfillPeerSelector.selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Floodfill peers only.PeerSelector.selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Peers nearest to the key in routing space.FloodfillPeerSelector.selectNearestExplicit(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Pick out peers with the floodfill capacity set, returning them first, but then after they're complete, sort via kademlia.PeerSelector.selectNearestExplicit(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Peers nearest to the key, floodfills first, then sorted by Kademlia distance.private voidSends the store reply to the sender.protected voidHandleFloodfillDatabaseLookupMessageJob.sendClosest(Hash key, Set<Hash> routerInfoSet, Hash toPeer, TunnelId replyTunnel) We extend this here to send our routerInfo back as well, if we are not floodfill.private voidSend a DLM to the peer.(package private) voidFloodfillNetworkDatabaseFacade.sendStore(Hash key, DatabaseEntry ds, Job onSuccess, Job onFailure, long sendTimeout, Set<Hash> toIgnore) Send out a store.(package private) abstract voidKademliaNetworkDatabaseFacade.sendStore(Hash key, DatabaseEntry ds, Job onSuccess, Job onFailure, long sendTimeout, Set<Hash> toIgnore) See implementation in FNDF.private booleanKademliaNetworkDatabaseFacade.sharesIPGroup(Set<Long> groups, Hash peer) Does this bucket entry share an IP group with any of the given groups?(package private) booleanRecord a lookup and check if the requester should be banned.private booleanKademliaNetworkDatabaseFacade.shouldBanlistBasedOnCountry(RouterInfo _ri, Hash key) Should we banlist this router based on country restrictions? Checks if: - we are in strict country mode and router is in same country - blockMyCountry is enabled - router is in our country (strict country mode).(package private) booleanFloodfillNetworkDatabaseFacade.shouldBanLookup(Hash from, TunnelId id) Check if lookup from a peer should be banned.private booleanFloodfillNetworkDatabaseFacade.shouldFloodTo(Hash key, int type, SigType lsSigType, Hash peer, RouterInfo target) Determines if we should flood the database store to a peer.private booleanRefreshRoutersJob.shouldRefreshRouter(RouterInfo ri, Hash _routerHash) Determines whether to refresh the given router info.private booleanFloodfillStoreJob.shouldSkipVerify(Hash key, String keyB64, boolean shouldLog) Check if verify should be skipped due to existing verify or shutdown.(package private) booleanFloodThrottler.shouldThrottle(Hash h) Increments the counter and checks if the hash should be throttled.(package private) booleanLookupThrottler.shouldThrottle(Hash key, TunnelId id) Increment and check throttling for the given peer and tunnel.(package private) booleanFloodfillNetworkDatabaseFacade.shouldThrottleFlood(Hash key) Increments and tests.(package private) booleanFloodfillNetworkDatabaseFacade.shouldThrottleLookup(Hash from, TunnelId id) Increments and tests.(package private) voidKademliaNetworkDatabaseFacade.stopPublishing(Hash target) Stops publishing the given LeaseSet.Store the LeaseSet without persisting it to disk.Store the leaseSet.KademliaNetworkDatabaseFacade.store(Hash key, RouterInfo routerInfo) Store the routerInfo.(package private) RouterInfoKademliaNetworkDatabaseFacade.store(Hash key, RouterInfo routerInfo, boolean persist) Store the routerInfo.(package private) longWhen did we send the query to the peer?booleanValidates whether the given LeaseSet is acceptable as valid and current based on current known parameters.private StringKademliaNetworkDatabaseFacade.validate(Hash key, RouterInfo routerInfo) Determine whether this routerInfo will be accepted as valid and current given what we know now.private StringKademliaNetworkDatabaseFacade.validateKeyMatch(Hash key, LeaseSet leaseSet) Check that the key matches the LeaseSet hash.private StringKademliaNetworkDatabaseFacade.validateSignature(Hash key, LeaseSet leaseSet, String leaseBase32) Verify the LeaseSet's cryptographic signature validity.(package private) voidFloodfillNetworkDatabaseFacade.verifyFinished(Hash h) Marks verification as finished for the specified hash.(package private) voidFloodfillNetworkDatabaseFacade.verifyStarted(Hash h) Marks verification as started for the specified hash.(package private) booleanSearchJob.wasAttempted(Hash peer) Whether the peer was already queried.booleanSearchState.wasAttempted(Hash peer) Whether the peer was attempted.booleanIterativeSearchJob.wasQueried(Hash peer) Did we send a request to this peer?static booleanIterativeSearchJob.wasRecentlyQueried(Hash peer) Was this peer recently queried (within grace period)? Used to avoid false positive bans for late but legitimate replies.(package private) static MessageWrapper.WrappedMessageMessageWrapper.wrap(RouterContext ctx, I2NPMessage m, Hash from, RouterInfo to) Garlic wrap a message from a client or this router, destined for a router, to hide the contents from the OBEP.private voidPersistentDataStore.write(Hash key, DatabaseEntry data) Persist a single RouterInfo to disk, applying spoof/ban checks.private booleanPersistentDataStore.writeRiFile(Hash key, DatabaseEntry data, File dbFile) Write a single RouterInfo to disk.Method parameters in net.i2p.router.networkdb.kademlia with type arguments of type HashModifier and TypeMethodDescription(package private) static voidIterativeSearchJob.addClosest(Collection<Hash> candidates, Collection<Hash> allRouters, Hash rkey, Hash us, Hash key, int cap) Add the closest cap peers of allRouters, by XOR distance from rkey, excluding us and key.voidSearchState.addPending(Collection<Hash> pending) Add the peers to the pending and attempted sets.FloodfillPeerSelector.buildFloodfillCandidates(Set<Hash> toIgnore) Build the floodfill candidate list with only the cheap per-peer checks: the exclusion set, the two banlist tiers, and the unreachable capability flag.private static voidRepublishLeaseSetJob.cleanupMap(ConcurrentHashMap<Hash, Long> map, long now) Cleanup map: drop the entries whose timestamp is older than the cleanup threshold.KademliaNetworkDatabaseFacade.findNearestRouters(Hash key, int maxNumRouters, Set<Hash> peersToIgnore) The routers closest to that key in response to a remote lookup.StoreJob.getClosestFloodfillRouters(Hash key, int numClosest, Set<Hash> alreadyChecked) Find the closest floodfill routers to a given key.SearchJob.getClosestRouters(Hash key, int numClosest, Set<Hash> alreadyChecked) Hash structures for routers we want to check next.SearchState.locked_getClosest(Set<Hash> peers, int max, Hash target) Picks the peers closest to the target.private voidLog the classification results at debug level.voidKademliaNetworkDatabaseFacade.queueForExploration(Collection<Hash> keys) Queue keys for exploration.(package private) static booleanRepublishLeaseSetJob.recordPublishAttempt(ConcurrentHashMap<Hash, Long> times, Hash dest, Long previous, long now) Record that we tried to publish for this destination, and report whether the event is worth logging.voidKademliaNetworkDatabaseFacade.removeFromExploreKeys(Collection<Hash> toRemove) Remove keys from the exploration set.FloodfillNetworkDatabaseFacade.selectFloodfillParticipants(Set<Hash> toIgnore, int concurrent) Selects a set of floodfill participant peers to which data should be sent: random selection among the filtered floodfill participants, preferring peers not queried in the last 60s to spread load, with a fallback top-up so store operations never starve.FloodfillPeerSelector.selectFloodfillParticipants(Set<Hash> toIgnore, KBucketSet<Hash> _kbuckets) List MAY INCLUDE our own hash.FloodfillPeerSelector.selectFloodfillParticipants(Set<Hash> toIgnore, KBucketSet<Hash> _kbuckets) List MAY INCLUDE our own hash.FloodfillPeerSelector.selectFloodfillParticipants(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets) See above for description List will not include our own hash Returns new list, may be modified.FloodfillPeerSelector.selectFloodfillParticipants(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets) See above for description List will not include our own hash Returns new list, may be modified.FloodfillPeerSelector.selectFloodfillParticipants(Hash key, int maxNumRouters, KBucketSet<Hash> kbuckets) Sort the floodfills.FloodfillPeerSelector.selectFloodfillParticipants(KBucketSet<Hash> kbuckets) List will not include our own hash.FloodfillPeerSelector.selectFloodfillParticipantsIncludingUs(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets) See above for description List MAY CONTAIN our own hash unless included in toIgnore Returns new list, may be modified.FloodfillPeerSelector.selectFloodfillParticipantsIncludingUs(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet<Hash> kbuckets) See above for description List MAY CONTAIN our own hash unless included in toIgnore Returns new list, may be modified.FloodfillPeerSelector.selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Floodfill peers only.FloodfillPeerSelector.selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Floodfill peers only.PeerSelector.selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Peers nearest to the key in routing space.PeerSelector.selectNearest(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Peers nearest to the key in routing space.FloodfillPeerSelector.selectNearestExplicit(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Pick out peers with the floodfill capacity set, returning them first, but then after they're complete, sort via kademlia.FloodfillPeerSelector.selectNearestExplicit(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Pick out peers with the floodfill capacity set, returning them first, but then after they're complete, sort via kademlia.PeerSelector.selectNearestExplicit(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Peers nearest to the key, floodfills first, then sorted by Kademlia distance.PeerSelector.selectNearestExplicit(Hash key, int maxNumRouters, Set<Hash> peersToIgnore, KBucketSet<Hash> kbuckets) Peers nearest to the key, floodfills first, then sorted by Kademlia distance.FloodfillNetworkDatabaseFacade.selectStoreParticipants(List<Hash> shuffled, int concurrent, Set<Hash> recentlyQueried) Select up toconcurrentstore participants, preferring peers not queried in the last 60s to spread load, with a fallback top-up so store operations never starve.FloodfillNetworkDatabaseFacade.selectStoreParticipants(List<Hash> shuffled, int concurrent, Set<Hash> recentlyQueried) Select up toconcurrentstore participants, preferring peers not queried in the last 60s to spread load, with a fallback top-up so store operations never starve.protected voidHandleFloodfillDatabaseLookupMessageJob.sendClosest(Hash key, Set<Hash> routerInfoSet, Hash toPeer, TunnelId replyTunnel) We extend this here to send our routerInfo back as well, if we are not floodfill.(package private) voidFloodfillNetworkDatabaseFacade.sendStore(Hash key, DatabaseEntry ds, Job onSuccess, Job onFailure, long sendTimeout, Set<Hash> toIgnore) Send out a store.(package private) abstract voidKademliaNetworkDatabaseFacade.sendStore(Hash key, DatabaseEntry ds, Job onSuccess, Job onFailure, long sendTimeout, Set<Hash> toIgnore) See implementation in FNDF.booleanprivate voidPersistentDataStore.Writer.writeBatch(List<Map.Entry<Hash, DatabaseEntry>> entries) Write a batch of RouterInfo entries to disk under the _dbDir lock.Constructors in net.i2p.router.networkdb.kademlia with parameters of type HashModifierConstructorDescriptionDirectLookupJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash peer, RouterInfo oldRI, Job onFind, Job onFail) Request is sent to; if null the job fails without sending anything.Disconnector(Hash h, String reason) Job disconnecting a peer after a delay.Disconnector(Hash h) Force a disconnect for the peer on refresh timeout.DropLookupFailedJob(RouterContext ctx, Hash peer, RouterInfo _info) Job to drop the peer after a lookup timeout.DropLookupFoundJob(RouterContext ctx, Hash peer, RouterInfo info) Job to verify a failing peer after a successful lookup.ExploreJob(RouterContext context, KademliaNetworkDatabaseFacade facade, Hash key, boolean isRealExplore, long msgIDBloomXor) New exploratory search with the given parameters and calculated concurrency level.FloodFailedJob(RouterContext ctx, Hash peer) Record a failed store for the given peer.FloodfillNetworkDatabaseFacade(RouterContext context, Hash dbid) Sub DBs.FloodfillSelectionCollector(Hash key, Set<Hash> toIgnore, int wanted) Warning - may return our router hash - add to toIgnore if necessary.FloodfillStoreJob(RouterContext context, FloodfillNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs) Create a new FloodfillStoreJob to send data to floodfills.FloodfillStoreJob(RouterContext context, FloodfillNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs, Set<Hash> toSkip) Create a new FloodfillStoreJob to send data to floodfills.FloodfillVerifyStoreJob(RouterContext ctx, Hash key, Hash client, long published, int type, Hash sentTo, Set<Hash> toSkip, FloodfillNetworkDatabaseFacade facade) Delay, then confirm the store peer still holds the entry; after a longer delay, confirm a different floodfill got the flood.protectedFloodOnlySearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs) For DirectLookupJob extension, RI only, different match job.FloodOnlySearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease) Flood-only search for the given key against the floodfill network database.FloodSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease) Prepares a flood search for one key: records the target, the callbacks and the lease-set flag, then derives the deadline from the requested timeout, applied in full.FloodSuccessJob(RouterContext ctx, Hash peer) Record a successful store for the given peer.HandleFloodfillDatabaseLookupMessageJob(RouterContext ctx, DatabaseLookupMessage receivedMessage, RouterIdentity from, Hash fromHash, long msgIDBloomXor) Creates a new job to handle a floodfill database lookup message.HandleFloodfillDatabaseStoreMessageJob(RouterContext ctx, DatabaseStoreMessage receivedMessage, RouterIdentity from, Hash fromHash, FloodfillNetworkDatabaseFacade facade, long msgIDBloomXor) Handle an incoming floodfill DatabaseStoreMessage.IterativeFollowupJob(RouterContext ctx, Hash key, Hash to, IterativeSearchJob search) Queries one peer for a single key on behalf of an iterative search.IterativeSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease) Lookup using exploratory tunnels.IterativeSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease, Hash fromLocalDest) Lookup using the client's tunnels.IterativeTimeoutJob(RouterContext ctx, Hash peer, IterativeSearchJob job) Create a timeout job for an iterative search.KademliaNetworkDatabaseFacade(RouterContext context, Hash dbid) Initializes the Kademlia-based network database facade.LeaseComparator(Hash target) Create a comparator for a target hash.Builds a local hash from the data of an existing hash.ReadRouterJob(File routerFile, Hash key) Creates a job to read a RouterInfo from disk.(package private)ReplyTunnel(Hash h, TunnelId id) Identifies one reply tunnel.RepublishLeaseSetJob(RouterContext ctx, KademliaNetworkDatabaseFacade facade, Hash destHash) Creates a new job to republish a LeaseSet for the given destination.SearchJob(RouterContext context, KademliaNetworkDatabaseFacade facade, Hash key, Job onSuccess, Job onFailure, long timeoutMs, boolean keepStats, boolean isLease, long msgIDBloomXor) Create a new search for the routingKey specified.SearchReplyJob(RouterContext enclosingContext, SearchJob job, DatabaseSearchReplyMessage message, Hash peer, long duration) Opens a log and clamps a non-positive duration to zero.SearchState(RouterContext context, Hash key) Opens the search's log, records the start time and initializes the peer-tracking sets.SingleSearchJob(RouterContext ctx, Hash key, Hash to) Send one DatabaseLookupMessage straight to a chosen peer over exploratory tunnels, instead of flooding the networkDb with it.StoreJob(RouterContext context, KademliaNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs) Send a data structure to the floodfills.StoreJob(RouterContext context, KademliaNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs, Set<Hash> toSkip) Send a data structure to the floodfills, skipping certain peers.StoreState(RouterContext ctx, Hash key, DatabaseEntry data) Starts a store tracking no skipped peers.StoreState(RouterContext ctx, Hash key, DatabaseEntry data, Set<Hash> toSkip) New store state tracking pending, attempted, and successful peers.(package private)TimeoutEntry(Hash peer, IterativeSearchJob search) Entry for a peer that failed to respond.Constructor parameters in net.i2p.router.networkdb.kademlia with type arguments of type HashModifierConstructorDescriptionFloodfillSelectionCollector(Hash key, Set<Hash> toIgnore, int wanted) Warning - may return our router hash - add to toIgnore if necessary.FloodfillStoreJob(RouterContext context, FloodfillNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs, Set<Hash> toSkip) Create a new FloodfillStoreJob to send data to floodfills.FloodfillVerifyStoreJob(RouterContext ctx, Hash key, Hash client, long published, int type, Hash sentTo, Set<Hash> toSkip, FloodfillNetworkDatabaseFacade facade) Delay, then confirm the store peer still holds the entry; after a longer delay, confirm a different floodfill got the flood.StoreJob(RouterContext context, KademliaNetworkDatabaseFacade facade, Hash key, DatabaseEntry data, Job onSuccess, Job onFailure, long timeoutMs, Set<Hash> toSkip) Send a data structure to the floodfills, skipping certain peers.StoreState(RouterContext ctx, Hash key, DatabaseEntry data, Set<Hash> toSkip) New store state tracking pending, attempted, and successful peers.Uses of Hash in net.i2p.router.networkdb.reseed
Methods in net.i2p.router.networkdb.reseed with parameters of type HashModifier and TypeMethodDescriptionprivate static StringReseedBundler.getRouterInfoName(Hash hash) Copied/modded from PersistentDataStore.Uses of Hash in net.i2p.router.peermanager
Fields in net.i2p.router.peermanager declared as HashModifier and TypeFieldDescriptionprivate final HashPeerProfile._peerThe peer this profile describes.private final HashPeerTestJob.ReplySelector._peerThe peer being tested.private HashProfileOrganizer._usHash of this router.private HashProfilePersistenceHelper._usOur router hash.Fields in net.i2p.router.peermanager with type parameters of type HashModifier and TypeFieldDescriptionprivate final ArrayDeque<Hash> RouterInfoRefresher._addressRefreshQueuePeers whose promotion was held for want of a usable address, awaiting a lookup.private final List<Map<Hash, PeerProfile>> ProfileOrganizer._allTiersEvery tier this object retains, in a fixed order, so a pass that must read the whole retained population walks one collection instead of repeating itself per map.PeerManager._capabilitiesByPeerValue strings are lower case.private final ConcurrentHashMap<Hash, Long> ProfileOrganizer._demotedPeersPeers demoted via demoteIfUnreachable — excluded from promotion for TUNNEL_DEMOTION_COOLDOWN_MS.private final ConcurrentHashMap<Hash, Integer> ProfileOrganizer._demoteStrikesStrike count per peer for demoteIfUnreachable — only demote after DEMOTE_STRIKE_THRESHOLD strikes within the decay window.private final ConcurrentHashMap<Hash, Long> ProfileOrganizer._demoteStrikeTimesLast strike time per peer, so strikes expire after DEMOTE_STRIKE_DECAY_MS.private final Map<Hash, PeerProfile> ProfileOrganizer._fastPeersProfiles of peers fast enough for tunnels.private final Map<Hash, PeerProfile> ProfileOrganizer._highCapacityPeersProfiles of peers with high capacity.ProfilePersistenceHelper._missingRouterInfoPeers whose profile was loaded while the netdb held no RouterInfo, collected duringProfilePersistenceHelper.readProfiles().RouterInfoRefresher._missingRouterInfoPeers whose stored profile was loaded while the netdb held no RouterInfo for them.private final Map<Hash, PeerProfile> ProfileOrganizer._notFailingPeersProfiles of peers not currently failing.ProfileOrganizer._notFailingPeersListCached keys of the not-failing peers map.PeerManager._peersByCapabilityPeer hashes, by capability flag.PeerTestJob._priorityPeersPeers tested before the random ones.private final Map<Hash, PeerProfile> ProfileOrganizer._wellIntegratedPeersProfiles of peers well integrated into the netdb.Methods in net.i2p.router.peermanager that return HashModifier and TypeMethodDescriptionprivate HashExtracts the router hash from a profile file name.PeerProfile.getPeer()What peer is being profiled.ProfileOrganizer.getUs()Self-exclusion hash for this router instance.Methods in net.i2p.router.peermanager that return types with arguments of type HashModifier and TypeMethodDescriptionPeerManager.getPeersByCapability(char capability) Every tracked peer advertising a capability.PeerManagerFacadeImpl.getPeersByCapability(char capability) Peers advertising the given capability.PeerManager.locked_getPeers(char c) Locking no longer required.ProfileOrganizer.selectAllPeers()Gather the union of all peers from fast, high-capacity, and not-failing tiers.ProfileOrganizer.selectFastPeers()Return the current fast tier membership directly.ProfileOrganizer.selectHighCapacityPeers()Return the current high-capacity tier membership directly.PeerManager.selectPeers()All tracked peers from the organizer.PeerManager.selectPeers(PeerSelectionCriteria criteria) Find some peers that meet the criteria and we have the netDb info for locally.PeerManager.selectTestPeersNonBlocking(int needed) Non-blocking test peer selection.ProfileOrganizer.selectWellIntegratedPeers()Return the current well-integrated tier membership directly.RouterInfoRefresher.takeAddressRefreshBatch(long now) Hand over the queued peers, oldest first, clearing the queue.ProfileOrganizer.takeMissingRouterInfoBatch(long now) Hand over the next batch of peers whose RouterInfo should be requested.RouterInfoRefresher.takeMissingRouterInfoBatch(long now) Hand over up to one batch of peers to look up, removing them from the set.Methods in net.i2p.router.peermanager with parameters of type HashModifier and TypeMethodDescriptionprivate DatabaseStoreMessagePeerTestJob.buildMessage(RouterInfo peer, TunnelId replyTunnel, Hash replyGateway, long nonce, long expiration) Build a message to test the peer with.voidProfileManagerImpl.dbLookupFailed(Hash peer) Note that the peer was unable to reply to a db lookup - either with data or with a lookupReply redirecting the user elsewherevoidProfileManagerImpl.dbLookupReceived(Hash peer) Note that the local router received a db lookup from the given peervoidProfileManagerImpl.dbLookupReply(Hash peer, int newPeers, int oldPeers, int invalid, int duplicate, long responseTimeMs) The peer replied to a db lookup with a redirect to other routers.voidProfileManagerImpl.dbLookupSuccessful(Hash peer, long responseTimeMs) Note that the peer was able to return the valid data for a db lookupvoidProfileManagerImpl.dbStoreFailed(Hash peer) Note that we were unable to confirm a successful send of db data to the peer, at least not within our timeout periodvoidProfileManagerImpl.dbStoreReceived(Hash peer, boolean wasNewKey) Note that the local router received an unprompted db store from the given peervoidProfileManagerImpl.dbStoreSent(Hash peer, long responseTimeMs) Note that we've confirmed a successful send of db data to the peer (though we haven't necessarily requested it again from them, so they /might/ be lying)voidProfileManagerImpl.dbStoreSuccessful(Hash peer) Note that we've verified a successful send of db data to the floodfill peer by querying another floodfill.voidProfileOrganizer.demoteIfBanned(Hash peer) Immediately demote a peer from fast/high-cap tiers.voidProfileOrganizer.demoteIfCongested(Hash peer) Immediately demote a peer from fast/high-cap tiers.voidProfileOrganizer.demoteIfHighLatency(Hash peer) Immediately demote a peer from fast/high-cap tiers.(package private) voidProfileOrganizer.demoteIfHighRTT(Hash peer, long responseTimeMs) Demote a peer from fast/high-cap tiers when its direct-link latency is poor.voidProfileOrganizer.demoteIfLossy(Hash peer) Instantly remove a peer from the fast/high-capacity tiers when its decayed loss score exceeds the threshold, and mark it for loss probation.voidProfileOrganizer.demoteIfNotLowLatency(Hash peer) Immediately demote a peer from the fast tier when a peer test shows it is no longer low-latency.voidProfileOrganizer.demoteIfNoTunnel(Hash peer) Immediately demote a peer from fast/high-cap tiers.(package private) voidProfileOrganizer.demoteIfSlowFirstHop(Hash peer, int firstHopRttMs) Remove a peer from the fast/high-cap tiers if its measured direct-link RTT reaches the low-latency threshold.voidProfileOrganizer.demoteIfStale(Hash peer) Immediately demote a peer from fast/high-cap tiers if its RouterInfo is stale and it has no recent proof of life (fails isSelectable).voidProfileOrganizer.demoteIfUnreachable(Hash peer) Immediately demote a peer from fast/high-cap tiers when our transport connection to it failed as a tunnel first hop (unreachable).voidProfileOrganizer.demoteIfUnreachableNow(Hash peer) Immediately demote a peer from fast/high-cap tiers on a single unreachable first hop, skipping theProfileOrganizer.DEMOTE_STRIKE_THRESHOLDstrikes and the cooldown thatProfileOrganizer.demoteIfUnreachable(Hash)requires.booleanProfileOrganizer.exportProfile(Hash profile, OutputStream out) Write a peer profile to the given output stream for persistence.ProfileOrganizer.fingerprints(RouterContext ctx, Hash peer, int mask) One peer's fingerprints: the masked IP the comm system recorded, the masked IP and port of every published address, and the family option.(package private) longProfileOrganizer.getCalibratedLatencyFloorMs(Hash peer) The calibrated latency floor for a peer, choosing the style of the transport that measured it.(package private) longProfileOrganizer.getCalibratedLatencyThresholdMs(Hash peer) The qualifying latency threshold for a peer, from the calibrated baseline of the transport that measured it.(package private) static doubleProfileOrganizer.getExcessiveFailurePenalty(Hash peer, PeerProfile prof) Selection penalty multiplier for peers between the soft and hard failure thresholds.ProfileOrganizer.getOrCreateProfileNonblocking(Hash peer) Retrieve an existing profile or create a new one, without blocking on contention.private PeerProfileProfileManagerImpl.getProfile(Hash peer) Blocking.ProfileOrganizer.getProfile(Hash peer) Retrieve the profile for a peer, or null if unknown.private PeerProfileProfileManagerImpl.getProfileNonblocking(Hash peer) Non-blocking.ProfileOrganizer.getProfileNonblocking(Hash peer) Retrieve the profile for a peer without blocking.private intProfileOrganizer.getSubTier(Hash peer, long k0, long k1) Sub-tier slice index for a peer, keyed off the session key so the same key always yields the same slice.private booleanProfileOrganizer.hasNoUsableTransport(Hash peer) Does this peer's RouterInfo carry no address we could still send to?private booleanProfileOrganizer.hasValidRouterInfo(Hash peer, RouterInfo info, double buildSuccess, PeerProfile prof) Checks the RouterInfo for hidden flag, stale proof of life, usable transport address, bandwidth tier, and tunnel exclusion.voidProfileManagerImpl.heardAbout(Hash peer) Note that the local router received a reference to the given peer, either through an explicit dbStore or in a dbLookupReply Non-blocking.voidProfileManagerImpl.heardAbout(Hash peer, long when) Note that the local router received a reference to the given peer at a certain time.private booleanProfileOrganizer.holdPromotionForRefresh(Hash peer, boolean staleRouterInfo, int tierSize, int safeFloor) Apply the hold to one tier insert: leave the peer out of the tier, or let it in.private booleanProfileOrganizer.isCongestedPeer(Hash peer) Check if a peer has a congestion capability cap (D or E).(package private) booleanProfileOrganizer.isExcludedFromProfiling(Hash peer) Check if a peer should be excluded from profiling.booleanCheck whether a peer is classified in the fast tier.private booleanProfileOrganizer.isFastTierCapable(Hash peer) Whether the peer qualifies for the fast tier based on advertised bandwidth tier and capabilities.private booleanProfileOrganizer.isHighBandwidthCapable(Hash peer) Whether the peer qualifies for the high-capacity tier based on advertised bandwidth tier and capabilities.booleanProfileOrganizer.isHighCapacity(Hash peer) Check whether a peer is classified in the high-capacity tier.private booleanPeerManager.isLowBandwidthPeer(Hash peer) Is this peer in a bandwidth tier too low to be worth remembering across a restart?private booleanProfileOrganizer.isLowLatency(Hash peer) Check whether the peer's profile has low-latency status.private booleanProfileOrganizer.isRestorableTierPeer(Hash peer, PeerProfile profile, Map<Hash, PeerProfile> tier, double buildSuccess, long now, boolean highCap) Whether a preserved pre-reorganize tier entry may be re-added: not already present in the tier, selectable, no recent tunnel failures, not in loss probation (fast tier) or below the loss demotion threshold (high-cap tier), and acceptable tunnel acceptance.booleanProfileOrganizer.isSelectable(Hash peer) Whether the given peer is eligible for selection.private booleanProfileOrganizer.isSelectable(Hash peer, double buildSuccess) Whether the given peer is eligible for selection.booleanProfileOrganizer.isWellIntegrated(Hash peer) Check whether a peer is classified in the well-integrated tier.private booleanProfileOrganizer.isX(Map<Hash, PeerProfile> m, Hash peer) Checks whether a peer is in one pool map.private PeerProfileProfileOrganizer.lockedGetProfile(Hash peer) Returns a peer's profile with the read lock held.private RouterInfoProfileOrganizer.lookupRouterInfoUnvalidated(Hash peer) Fetch a peer's local RouterInfo without re-running the network database'svalidate().(package private) static RouterInfoProfileOrganizer.lookupRouterInfoUnvalidated(RouterContext ctx, Hash peer) ProfileOrganizer.lookupRouterInfoUnvalidated(Hash)with the context passed in, so the fingerprint builder below is reachable from tests.voidProfileManagerImpl.messageFailed(Hash peer) Note that the router failed to send a message to the peer over any transport.voidProfileManagerImpl.messageFailed(Hash peer, String transport) Note that the router failed to send a message to the peer over the transport specified.voidProfileManagerImpl.messageReceived(Hash peer, String style, long msToReceive, int bytesRead) Note that the router received a message from the given peer on the specified transport.voidProfileManagerImpl.messageSent(Hash peer, String transport, long msToSend, long bytesSent) Note that it took msToSend to send a message of size bytesSent to the peer over the transport.voidProfileOrganizer.noteFirstHopRtt(Hash peer, int rtt, long when) Record a measured direct-link RTT against a peer, by hash.(package private) booleanProfileOrganizer.noteMissingRouterInfo(Hash peer) Record that a stored profile was loaded for a peer the netdb cannot resolve.(package private) booleanRouterInfoRefresher.noteMissingRouterInfo(Hash peer) Note that a stored profile was loaded for a peer the netdb cannot resolve.private booleanProfileOrganizer.notRestricted(Hash peer, MaskedIPSet ipSet, int mask) Subnet-diversity gate for the running router.(package private) static booleanProfileOrganizer.notRestricted(RouterContext ctx, Hash peer, MaskedIPSet ipSet, int mask) Subnet-diversity gate: does this peer pass the masked-subnet, port and family check, and if it does, claim its fingerprints so that no later peer sharing any one of them passes as well.private booleanProfileOrganizer.passesBasicGates(Hash peer) Returns false when the peer is us, banlisted, or recently failed as first hop.voidProfileManagerImpl.peerLossEvent(Hash peer, float ratio) Record the packet-loss (retransmit) ratio measured by the transport for a peer.booleanProfileOrganizer.peerSendsBadReplies(Hash peer) Check whether a peer sends an excessive rate of invalid or failed netDb lookup replies (potential misbehavior indicator).(package private) StringProfileOrganizer.promotionSkipReason(PeerProfile profile, Hash peer, double buildSuccess, long now) WhyProfileOrganizer.skipsPromotion(PeerProfile, Hash, double)would skip this profile, or null when it would not.private voidProfileOrganizer.putFastPeer(Hash peer, PeerProfile profile) Add a peer to the fast tier, maintaining the quality counter.voidPeerManager.removeCapabilities(Hash peer) Remove all capabilities for the peer from the index.voidPeerManagerFacadeImpl.removeCapabilities(Hash peer) Remove all capabilities for the peer from the index.private PeerProfileProfileOrganizer.removeFastPeer(Hash peer) Remove a peer from the fast tier, maintaining the quality counter.(package private) booleanRouterInfoRefresher.requestAddressRefresh(Hash peer) Ask for a RouterInfo lookup for a peer held out of the tiers for want of a usable address.voidPeerManager.setCapabilities(Hash peer, String caps) Records the capability string a peer advertised and reindexes it in the per-capability lookup, dropping any capability it no longer holds.voidPeerManagerFacadeImpl.setCapabilities(Hash peer, String caps) Record a peer's capability flags.voidStore the local router hash for self-exclusion from peer selection.voidStore the local router identity hash for filtering out the router's own profile.(package private) booleanProfileOrganizer.skipsPromotion(PeerProfile profile, Hash peer, double buildSuccess) Whether the peer should be skipped for tier promotion: not selectable, in a strict country, low tunnel acceptance, high-latency penalty, congested, or in loss probation.private booleanPeerManager.storeProfile(Hash peer, long cutoff) Save a peer's profile to disk if it is still usable.private static intPeerTestJob.tierRank(ProfileOrganizer organizer, Hash peer) Selection priority for a test candidate: tier first (fast 0, high-cap 1, other 2), then staleness of the persisted tunnel-test EWMA so never-tested peers go first.voidProfileManagerImpl.tunnelDataPushed(Hash peer, long rtt, long size) Non-blocking.voidProfileManagerImpl.tunnelDataPushed1m(Hash peer, long size) Non-blocking.voidProfileManagerImpl.tunnelFailed(Hash peer, int pct) Note that the peer participated in a tunnel that failed.voidProfileManagerImpl.tunnelJoined(Hash peer, long responseTimeMs) Note that the router agreed to participate in a tunnel.voidProfileManagerImpl.tunnelLifetimePushed(Hash peer, long lifetime, long size) Non-blocking.voidProfileManagerImpl.tunnelRejected(Hash peer, long responseTimeMs, int severity) Note that a router explicitly rejected joining a tunnel.voidProfileManagerImpl.tunnelTestSucceeded(Hash peer, long responseTimeMs) Note that a tunnel that the router is participating in was successfully tested with the given round trip latencyvoidProfileManagerImpl.tunnelTimedOut(Hash peer) Note that a router did not respond to a tunnel join.Method parameters in net.i2p.router.peermanager with type arguments of type HashModifier and TypeMethodDescriptionprivate intProfileOrganizer.count(Map<Hash, PeerProfile> m) Counts the profiles in one pool map.voidProfileOrganizer.demoteBatch(Set<Hash> peers) Batch-demote peers from fast/high-cap tiers under a single write lock.voidProfileOrganizer.demoteFastOnlyBatch(Set<Hash> peers) Batch-remove peers from fast tier only, keeping them in high-cap.(package private) static booleanProfileOrganizer.isEvictable(PeerProfile profile, Map<Hash, PeerProfile> fastPeers, Map<Hash, PeerProfile> highCapPeers, long activeThreshold, int fastPeerLimit, int highCapacityLimit) Whether a profile is eligible for eviction under the profile cap: not protected by a fast/high-cap tier slot that still has room below its limit, and no send or heard-from activity within the active window.private static booleanProfileOrganizer.isQualityFastPeer(PeerProfile profile, Map<Hash, PeerProfile> highCap) True when a peer in the fast tier has proven throughput or is in the high-cap tier.private booleanProfileOrganizer.isRestorableTierPeer(Hash peer, PeerProfile profile, Map<Hash, PeerProfile> tier, double buildSuccess, long now, boolean highCap) Whether a preserved pre-reorganize tier entry may be re-added: not already present in the tier, selectable, no recent tunnel failures, not in loss probation (fast tier) or below the loss demotion threshold (high-cap tier), and acceptable tunnel acceptance.private booleanProfileOrganizer.isX(Map<Hash, PeerProfile> m, Hash peer) Checks whether a peer is in one pool map.private voidProfileOrganizer.lockedPickLowestPriority(List<Map.Entry<Hash, PeerProfile>> candidates, int howMany, Set<Hash> matches) Selects the lowest-priority candidates, penalizing moderately-lossy peers.private voidProfileOrganizer.lockedPickLowestPriority(List<Map.Entry<Hash, PeerProfile>> candidates, int howMany, Set<Hash> matches) Selects the lowest-priority candidates, penalizing moderately-lossy peers.private voidProfileOrganizer.lockedSelectActive(List<Hash> connected, int howMany, Set<Hash> toExclude, Set<Hash> matches, int mask, MaskedIPSet ipSet, double buildSuccess) Scan up toProfileOrganizer.maxCandidateSample(int, int)established peers for the active tier, inRandomIteratororder so the peers examined differ from call to call.private voidProfileOrganizer.lockedSelectActive(List<Hash> connected, int howMany, Set<Hash> toExclude, Set<Hash> matches, int mask, MaskedIPSet ipSet, double buildSuccess) Scan up toProfileOrganizer.maxCandidateSample(int, int)established peers for the active tier, inRandomIteratororder so the peers examined differ from call to call.private voidProfileOrganizer.lockedSelectPeers(Map<Hash, PeerProfile> peers, int howMany, Set<Hash> toExclude, Set<Hash> matches, int mask, MaskedIPSet ipSet, double buildSuccess, long rttCeiling) Selects peers while holding the lock.private voidProfileOrganizer.lockedSelectPeers(Map<Hash, PeerProfile> peers, int howMany, Set<Hash> toExclude, Set<Hash> matches, int mask, MaskedIPSet ipSet, double buildSuccess, long rttCeiling) Selects peers while holding the lock.private voidProfileOrganizer.lockedSelectPeers(Map<Hash, PeerProfile> peers, int howMany, Set<Hash> toExclude, Set<Hash> matches, SessionKey randomKey, ProfileOrganizer.Slice subTierMode, int mask, MaskedIPSet ipSet, double buildSuccess, long rttCeiling) Collects up toProfileOrganizer.maxCandidateSample(int, int)candidates from a tier and hands them toProfileOrganizer.lockedPickLowestPriority(List, int, Set).private voidProfileOrganizer.lockedSelectPeers(Map<Hash, PeerProfile> peers, int howMany, Set<Hash> toExclude, Set<Hash> matches, SessionKey randomKey, ProfileOrganizer.Slice subTierMode, int mask, MaskedIPSet ipSet, double buildSuccess, long rttCeiling) Collects up toProfileOrganizer.maxCandidateSample(int, int)candidates from a tier and hands them toProfileOrganizer.lockedPickLowestPriority(List, int, Set).static intProfileOrganizer.pickLowestPriority(List<Hash> candidates, float[] priority, int howMany, Set<Hash> matches) Choose up tohowManycandidates in ascending priority order.static intProfileOrganizer.pickLowestPriority(List<Hash> candidates, float[] priority, int howMany, Set<Hash> matches) Choose up tohowManycandidates in ascending priority order.voidProfilePersistenceHelper.purgeExcessProfiles(Set<Hash> keepPeers, int retentionFloor) Delete profile files that are no longer worth keeping.private voidProfileOrganizer.purgeUnusableFromMap(Map<Hash, PeerProfile> tier, String tierName, long now, double buildSuccess, boolean allowSoftEviction, Map<ProfileOrganizer.PurgeReason, Integer> reasons) Evicts every peer in one tier map thatProfileOrganizer.purgeReasonFor(boolean, boolean, boolean, boolean, boolean, boolean, boolean)rejects.(package private) static intProfileOrganizer.remainingToSelect(int howMany, Set<Hash> matches) How many slots are still free in a cascade's destination set.private voidProfileOrganizer.restorePreservedPeers(long now, Set<Hash> oldFastPeers, Set<Hash> oldHighCapPeers, double buildSuccess) Re-adds preserved pre-reorganize tier entries when the rebuild shrank the tiers too much.voidPeerTestJob.schedulePriorityTests(List<Hash> peers) Schedule peers for priority testing (e.g., from slow tunnels).voidProfileOrganizer.selectActiveNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches) Select from currently connected (established) not-failing peers.voidProfileOrganizer.selectActiveNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, int mask, MaskedIPSet ipSet) Select from currently connected peers with IP-subnet diversity.voidProfileOrganizer.selectAllNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, boolean onlyNotFailing) Select from all not-failing peers randomly, falling through to general peers if the not-failing set is insufficient.voidProfileOrganizer.selectAllNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, boolean onlyNotFailing, int mask, MaskedIPSet ipSet) Select from all not-failing peers randomly, honouring a /n subnet diversity restriction.private voidProfileOrganizer.selectAllNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, boolean onlyNotFailing, int mask, MaskedIPSet ipSet, double buildSuccess, boolean preferUnproven) Random iterator over not-failing list with optional tier exclusion.voidProfileOrganizer.selectFastPeers(int howMany, Set<Hash> exclude, Set<Hash> matches) Select up to howMany fast-tier peers, filling shortfalls from high-capacity.voidProfileOrganizer.selectFastPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, int mask, MaskedIPSet ipSet) Select fast-tier peers with IP-subnet diversity constraints.voidProfileOrganizer.selectFastPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, SessionKey randomKey, ProfileOrganizer.Slice subTierMode, int mask, MaskedIPSet ipSet) Select fast-tier peers deterministically sliced by a random key.voidProfileOrganizer.selectHighBandwidthPeers(int howMany, Set<Hash> exclude, Set<Hash> matches) Select up to howMany peers from O/P/X bandwidth tiers (high shared bandwidth) that are not failing.voidProfileOrganizer.selectHighBandwidthPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, boolean onlyNotFailing, int mask, MaskedIPSet ipSet) Select high-bandwidth peers with tier-exclusion and IP-subnet diversity.private voidProfileOrganizer.selectHighBandwidthPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, boolean onlyNotFailing, int mask, MaskedIPSet ipSet, double buildSuccess) Iterates not-failing peers randomly, filtering for O/P/X bandwidth tiers with reliability checks (acceptance ratio, recent activity, peer tests).voidProfileOrganizer.selectHighCapacityPeers(int howMany, Set<Hash> exclude, Set<Hash> matches) Select high-capacity peers, filling shortfalls from not-failing peers.voidProfileOrganizer.selectHighCapacityPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, int mask, MaskedIPSet ipSet) Select high-capacity peers with IP-subnet diversity.voidProfileOrganizer.selectNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches) Select from not-failing peers, excluding high-capacity tier if requested.voidProfileOrganizer.selectNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, boolean onlyNotFailing) Select from not-failing peers, optionally excluding the high-capacity tier.voidProfileOrganizer.selectNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, boolean onlyNotFailing, int mask, MaskedIPSet ipSet) Full-parameter select from not-failing peers.voidProfileOrganizer.selectNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, boolean onlyNotFailing, int mask, MaskedIPSet ipSet, boolean preferUnproven) Full-parameter select from not-failing peers.voidProfileOrganizer.selectNotFailingPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, int mask, MaskedIPSet ipSet) Select from not-failing peers with IP-subnet diversity.private voidProfileOrganizer.selectRemainderFromAllPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, double buildSuccess) Fallback selection: fill the remaining slots from the union of all peers (fast + high-capacity + not-failing).booleanProfileOrganizer.selectTestPeersNonBlocking(int howMany, Set<Hash> exclude, Set<Hash> matches) Non-blocking test peer selection: tries the full fast → high-cap → active chain under a singleProfileOrganizer.tryReadLock().(package private) voidProfilePersistenceHelper.setMissingRouterInfoSink(Set<Hash> missingRouterInfo) Supply the set to collect peers-without-RouterInfo into.(package private) static booleanProfileOrganizer.stillSelecting(int howMany, Set<Hash> matches) Whether a cascade still has slots left to fill.private voidProfileOrganizer.warnTierStarved(Map<Hash, PeerProfile> peers, int examined, int skipExcluded, int skipGated, int skipSliced, int skipIp, int skipRtt) Rate-limited warning naming the gate that emptied a tier scan.Constructors in net.i2p.router.peermanager with parameters of type HashModifierConstructorDescription(package private)PeerData(RouterContext ctx, Hash peerHash) Creates a new PeerData instance by looking up all necessary information.PeerProfile(RouterContext context, Hash peer) Caller should callPeerProfile.setLastHeardAbout(long)andPeerProfile.setFirstHeardAbout(long).privatePeerProfile(RouterContext context, Hash peer, boolean expand) Caller should callPeerProfile.setLastHeardAbout(long)andPeerProfile.setFirstHeardAbout(long).ReplySelector(Hash peer, long nonce, long expiration) Records the peer, nonce and expiry this outstanding test expects.Uses of Hash in net.i2p.router.sybil
Fields in net.i2p.router.sybil declared as HashModifier and TypeFieldDescriptionprivate final HashAnalysis.RouterInfoRoutingKeyComparator._usOur hash, the distance reference.Methods in net.i2p.router.sybil that return types with arguments of type HashModifier and TypeMethodDescriptionAnalysis.backgroundAnalysis(boolean includeAll) Analyze threats.PersistSybil.load(long date) Load the analysis for a certain date.Methods in net.i2p.router.sybil with parameters of type HashModifier and TypeMethodDescriptionprivate voidAdds scored points for one router.voidAnalysis.calculateRouterInfo(Hash us, String usName, List<RouterInfo> ris, Map<Hash, Points> points) Build the version comparison report.private static doubleAnalysis.closestDistance(Hash h, List<RouterInfo> ris) Finds the keyspace distance to the nearest listed router.Analysis.getAllRouters(Hash us) Returns all routers in the network DB, excluding our own router.Analysis.getFloodfills(Hash us) Returns all floodfill routers, excluding our own router.Load all the analysis for a certain hash.Method parameters in net.i2p.router.sybil with type arguments of type HashModifier and TypeMethodDescriptionprivate voidAdds scored points for one router.voidAnalysis.addProfilePoints(List<RouterInfo> ris, Map<Hash, Points> points) Analyzes router profiles and adds Sybil points for banlisted, newly observed, or poorly performing routers.voidAnalysis.addVersionPoints(List<RouterInfo> ris, Map<Hash, Points> points) Analyzes router versions and adds Sybil points for old, unreachable, or non-floodfill routers.Map<Integer, List<RouterInfo>> Analysis.calculateIPGroups16(List<RouterInfo> ris, Map<Hash, Points> points) Categorize routers by their /16 subnet to identify routers in the same /16 network.Map<Integer, List<RouterInfo>> Analysis.calculateIPGroups24(List<RouterInfo> ris, Map<Hash, Points> points) Categorize routers by their /24 subnet to identify routers in the same /24 network.Map<Integer, List<RouterInfo>> Analysis.calculateIPGroups32(List<RouterInfo> ris, Map<Hash, Points> points) Categorize routers by their IP address to identify routers sharing the same IP.Map<Long, List<RouterInfo>> Analysis.calculateIPGroups48(List<RouterInfo> ris, Map<Hash, Points> points) Categorize routers by their IPv6 /48 subnet to identify routers in the same /48 network.Map<Long, List<RouterInfo>> Analysis.calculateIPGroups64(List<RouterInfo> ris, Map<Hash, Points> points) Categorize routers by their IPv6 /64 subnet to identify routers in the same /64 network.Map<String, List<RouterInfo>> Analysis.calculateIPGroupsFamily(List<RouterInfo> ris, Map<Hash, Points> points) Categorize routers by their router family to identify routers in the same family.voidAnalysis.calculateIPGroupsUs(List<RouterInfo> ris, Map<Hash, Points> points, List<RouterInfo> ri32, List<RouterInfo> ri24, List<RouterInfo> ri16, List<RouterInfo> ri64, List<RouterInfo> ri48) Categorize routers by their proximity to our IP address, grouping them by /32, /24, /16 for IPv4 and /64, /48 for IPv6.doubleAnalysis.calculatePairDistance(List<RouterInfo> ris, Map<Hash, Points> points, List<Pair> pairs) Calculate average pairwise distance between floodfills and identifies routers that are unusually close to each other.voidAnalysis.calculateRouterInfo(Hash us, String usName, List<RouterInfo> ris, Map<Hash, Points> points) Build the version comparison report.private voidAnalysis.doBlocking(Map<Hash, Points> points) Blocklist and Banlist if configured.voidStore each entry.Constructors in net.i2p.router.sybil with parameters of type HashModifierConstructorDescriptionComparator using the routing key.Uses of Hash in net.i2p.router.transport
Fields in net.i2p.router.transport declared as HashModifier and TypeFieldDescriptionprivate HashTransportImpl._lastReachablePeerThe last peer checked for reachability, a one-entry cache.Fields in net.i2p.router.transport with type parameters of type HashModifier and TypeFieldDescriptionTransportImpl._IPMapGlobal router ident -> IP map.TransportImpl._unreachableEntriesMap from routerIdentHash to timestamp (Long) when the peer was last unreachable.TransportImpl._wasUnreachableEntriesPeers recently marked unreachable, by hash.PeerHTMLRenderer.capacityCacheThe cached capacity strings, by peer.private final ConcurrentHashMap<Hash, String> CountryLookup.countryCacheThe cached countries, by router hash.private final ConcurrentHashMap<Hash, Long> CountryLookup.countryCacheTimestampsWhen each cached country was stored.TransportManager.EstablishedSnapshot.peersPeers in the summary.private final Map<Hash, RouterInfo> PeerHTMLRenderer.routerInfoCacheThe cached router infos, by peer, to speed repeated lookups.Methods in net.i2p.router.transport that return types with arguments of type HashModifier and TypeMethodDescriptionCommSystemFacadeImpl.getEstablished()Established peers.Transport.getEstablished()The list of peers this transport has established connections with.TransportManager.getEstablished()The list of peer hashes with established connections, may be empty.Methods in net.i2p.router.transport with parameters of type HashModifier and TypeMethodDescriptionprivate voidTransportManager.establishTo(Hash peer) Trigger transport connection establishment to a peer.voidCommSystemFacadeImpl.exemptIncoming(Hash peer) Exempt this router hash from any incoming throttles or rejections.voidCommSystemFacadeImpl.forceDisconnect(Hash peer) Tell the comm system to disconnect from this peer.voidCommSystemFacadeImpl.forceDisconnect(Hash peer, String reason) Force an immediate disconnect from the given peer with the given reason.voidTransport.forceDisconnect(Hash peer) Force immediate disconnection from specified peer.voidTransport.forceDisconnect(Hash peer, String reason) Forcefully disconnect from a peer with a reason for logging.(package private) voidTransportManager.forceDisconnect(Hash peer) Tell the transports to disconnect from this peer.(package private) voidTransportManager.forceDisconnect(Hash peer, String reason) Tell the transports to disconnect from this peer with a reason for logging.private StringPeerHTMLRenderer.getCapacityCached(Hash peer) Gets the capacity text from the cache.CommSystemFacadeImpl.getCountry(Hash peer) Uses the transport IP first because that lookup is fast, then the IP from the netDb.CountryLookup.getCountry(Hash peer) Uses the transport IP first because that lookup is fast, then the IP from the netDb.default intTransport.getEstimatedRTT(Hash peer) The transport's own measured round trip time to a peer.default longTransport.getEstimatedRTTTime(Hash peer) WhenTransport.getEstimatedRTT(Hash)last measured this peer, on the router clock.byte[]The known IP address of the given peer.static byte[]IP of the peer from the last connection (in or out, any transport).(package private) byte[]IP of the peer from the last connection (in or out, any transport).private RouterInfoPeerHTMLRenderer.getRouterInfoCached(Hash peer) Gets the router info from the cache.booleanCommSystemFacadeImpl.isBacklogged(Hash peer) Whether the given peer is backlogged.booleanTransport.isBacklogged(Hash peer) Whether the given peer is backlogged.booleanTransportImpl.isBacklogged(Hash peer) Whether the given peer is backlogged.(package private) booleanTransportManager.isBacklogged(Hash peer) Whether any transport is backlogged to the given peer.booleanCommSystemFacadeImpl.isConnecting(Hash peer) Whether we are currently connecting to the given peer.booleanTransport.isConnecting(Hash peer) Check if a connection attempt is in progress for the given peer.booleanTransportImpl.isConnecting(Hash peer) Check if a connection attempt is in progress for the given peer.(package private) booleanTransportManager.isConnecting(Hash peer) Check if any transport has a connection attempt in progress for the peer.booleanCommSystemFacadeImpl.isEstablished(Hash peer) Whether the given peer is established.booleanTransport.isEstablished(Hash peer) Whether the given peer is established.booleanTransportImpl.isEstablished(Hash peer) Whether the given peer is established.(package private) booleanTransportManager.isEstablished(Hash peer) Whether any transport has an established connection to the given peer.booleanCommSystemFacadeImpl.isInStrictCountry(Hash peer) Are they in a strict country.booleanCountryLookup.isInStrictCountry(Hash peer) Are they in a strict country.booleanTransport.isUnreachable(Hash peer) Whether the given peer is unreachable.booleanTransportImpl.isUnreachable(Hash peer) Whether the given peer is unreachable.voidTransportImpl.markReachable(Hash peer, boolean isInbound) Called when we establish a peer connection (outbound or inbound).voidTransportImpl.markUnreachable(Hash peer) Called when we can't reach a peer.private voidTransportImpl.markWasUnreachable(Hash peer, boolean yes) Maintain the WasUnreachable list.voidCommSystemFacadeImpl.mayDisconnect(Hash peer) Tell the comm system that we may disconnect from this peer.voidTransport.mayDisconnect(Hash peer) Suggest that transport may disconnect from specified peer.voidTransportImpl.mayDisconnect(Hash peer) Tell the transport that we may disconnect from this peer.(package private) voidTransportManager.mayDisconnect(Hash peer) Tell the transports that we may disconnect from this peer.voidTransportEventListener.messageReceived(I2NPMessage message, RouterIdentity fromRouter, Hash fromRouterHash) Message received.voidTransportImpl.messageReceived(I2NPMessage inMsg, RouterIdentity remoteIdent, Hash remoteIdentHash, long msToReceive, int bytesReceived) Message received from the I2NPMessageReader - send it to the listener.voidTransportManager.messageReceived(I2NPMessage message, RouterIdentity fromRouter, Hash fromRouterHash) Handle incoming I2NP message from a peer.CommSystemFacadeImpl.renderPeerCaps(Hash peer, boolean inline) Renders the peer's capability HTML block.PeerHTMLRenderer.renderPeerCaps(Hash peer, boolean inline) Renders the peer's capability HTML block.CommSystemFacadeImpl.renderPeerFlag(Hash peer) Render the HTML flag image for the given peer.PeerHTMLRenderer.renderPeerFlag(Hash peer) Render the HTML flag image for the given peer.CommSystemFacadeImpl.renderPeerHTML(Hash peer, boolean extended) Renders HTML for a peer with optional extended info.PeerHTMLRenderer.renderPeerHTML(Hash peer, boolean extended) Renders HTML for a peer with optional extended info.voidIP of the peer from the last connection (in or out, any transport).booleanCommSystemFacadeImpl.wasFailsafeClosed(Hash peer, long withinMs) Whether the peer's most recent connection was closed by the failsafe.booleanTransport.wasFailsafeClosed(Hash peer, long withinMs) Whether this transport closed a session to the given peer for idleness within the given window.booleanTransportImpl.wasFailsafeClosed(Hash peer, long withinMs) Whether this transport closed a session to the peer for idleness recently.(package private) booleanTransportManager.wasFailsafeClosed(Hash peer, long withinMs) Whether any transport closed a session to this peer for idleness recently.booleanCommSystemFacadeImpl.wasUnreachable(Hash peer) Whether the given peer was recently unreachable.booleanTransport.wasUnreachable(Hash peer) Check if peer was unreachable on last outbound attempt.booleanTransportImpl.wasUnreachable(Hash peer) Was the peer unreachable (outbound only) the last time we tried it? This is NOT reset if the peer contacts us.(package private) booleanTransportManager.wasUnreachable(Hash peer) Was the peer unreachable (outbound only) on every transport, based on the last time we tried it for each transport? This is NOT reset if the peer contacts us.Method parameters in net.i2p.router.transport with type arguments of type HashModifier and TypeMethodDescription(package private) static intCountryLookup.evictExpired(Map<Hash, String> cache, Map<Hash, Long> timestamps, long now, long expiryMs) Remove stale and unresolved ("xx") entries from the country cache.(package private) static voidCountryLookup.trimToCapacity(Map<Hash, String> cache, Map<Hash, Long> timestamps, long now, long expiryMs, int maxSize) Bring an over-capacity country cache back under its size bound.Constructor parameters in net.i2p.router.transport with type arguments of type HashModifierConstructorDescription(package private)EstablishedSnapshot(List<Hash> peers, long expiresAt) Creates a snapshot of established peers valid until the given time.Uses of Hash in net.i2p.router.transport.ntcp
Fields in net.i2p.router.transport.ntcp with type parameters of type HashModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<Hash, NTCPConnection> NTCPTransport._conByIdentOpen connections, by peer hash.EventPumper._failedOutboundAttemptsWhen an outbound connection to a peer was last attempted.EventPumper._failedOutboundCountFailed outbound attempts per peer, for backoff.NTCPTransport._failsafeClosesAtPeers this transport closed an idle session to, and when.Methods in net.i2p.router.transport.ntcp that return types with arguments of type HashMethods in net.i2p.router.transport.ntcp with parameters of type HashModifier and TypeMethodDescriptionvoidNTCPTransport.forceDisconnect(Hash peer) Tell the transport to disconnect from this peer.voidNTCPTransport.forceDisconnect(Hash peer, String reason) Tell the transport to disconnect from this peer with a reason for logging.private NTCPConnectionNTCPTransport.getConnectionOrCreateNew(Hash ih, RouterInfo target) Retrieves an existing NTCPConnection for the given peer hash or creates a new one.intNTCPTransport.getEstimatedRTT(Hash peer) Round trip time measured for this peer during the NTCP2 handshake.longNTCPTransport.getEstimatedRTTTime(Hash peer) WhenNTCPTransport.getEstimatedRTT(Hash)was measured for this peer.booleanNTCPTransport.isBacklogged(Hash dest) Whether the connection to the given peer is backlogged.booleanNTCPTransport.isConnecting(Hash dest) Whether a connection attempt is in progress to the given peer.booleanNTCPTransport.isEstablished(Hash dest) (package private) static booleanNTCPConnection.isOwnRouterInfo(Hash h, Hash ourHash) Whether a received RouterInfo's hash identifies us.(package private) static booleanNTCPTransport.isOwnRouterInfoStore(I2NPMessage m, Hash ourHash) Whether a DatabaseStoreMessage stored our own RouterInfo under our own key.(package private) static booleanNTCPConnection.isSamePeer(Hash h, Hash peerHash) Whether a received RouterInfo's hash identifies the peer we are talking to.voidNTCPTransport.mayDisconnect(Hash peer) Tell the transport that we may disconnect from this peer.(package private) voidNTCPTransport.noteFailsafeClose(Hash peer, long now) Record that an idle session to this peer was just closed.voidEventPumper.trackFailedInboundHandshake(byte[] ip, Hash hash) Track failed inbound handshake for diagnostic stats.voidEventPumper.trackInvalidEncryption(byte[] ip, Hash hash) Track failed inbound handshake with invalid encryption and ban if too many failures.private booleanInboundEstablishState.verifyInbound(Hash aliceHash) Validates an inbound peer's identity and eligibility for connection.booleanNTCPTransport.wasFailsafeClosed(Hash peer, long withinMs) Whether the peer's most recent connection was closed by the failsafe.Uses of Hash in net.i2p.router.transport.udp
Fields in net.i2p.router.transport.udp declared as HashModifier and TypeFieldDescriptionprivate HashPeerTestState._aliceHashAlice's router hash, for SSU2 tests.private HashPeerTestState._charlieHashCharlie's router hash, for SSU2 tests.private final HashInboundMessageState._fromThe peer the message came from.private final Hash[]UDPAddress._introHashesThe introducer hashes.private HashUDPTransport._lastFromv4Last report from a peer of our IP.private HashUDPTransport._lastFromv6Hash of the last peer reached over IPv6.private final HashRemoteHostId._peerHashThe peer's hash, if known.protected final HashPeerState._remotePeerThe peer are we talking to.private final HashIntroductionManager.DelayIntro.aliceAlice's router hash.private final HashSSU2Payload.PeerTestBlock.hThe hash echoed in the test.private final HashPeerTestManager.DelayTest.hashThe target peer's hash.private final HashPeerTestManager.RIMiss.hashThe router whose router info went missing.Fields in net.i2p.router.transport.udp with type parameters of type HashModifier and TypeFieldDescriptionprivate final Map<Hash, OutboundEstablishState2.IntroState> OutboundEstablishState2._introducersIntroduction states, by introducer hash.private final ConcurrentHashMap<Hash, OutboundEstablishState> EstablishmentManager._outboundByHashMap of router hash to OutboundEstablishState.UDPTransport._peersByIdentMap of known peers, keyed by their identity hash.PeerTestState._previousCharliesPrevious Charlies to avoid reusing, for SSU2 Bob.Methods in net.i2p.router.transport.udp that return HashModifier and TypeMethodDescriptionPeerTestState.getCharlieHash()Return Charlie's Hash (SSU2 only).InboundMessageState.getFrom()The Hash of the sender.(package private) HashUDPAddress.getIntroducerHash(int i) Introducer hash for the given introducer.RemoteHostId.getPeerHash()The peer hash, or null if direct.PeerState.getRemotePeer()Remote peer hash.Methods in net.i2p.router.transport.udp that return types with arguments of type HashModifier and TypeMethodDescriptionUDPTransport.getEstablished()Identities of all currently established peers.PeerTestState.getPreviousCharlies()Return previous Charlie hashes (SSU2 only, Bob only).Methods in net.i2p.router.transport.udp with parameters of type HashModifier and TypeMethodDescriptionprivate voidEstablishmentManager.banAndFail(OutNetMessage msg, Hash toHash, String failReason, String banReason, String noHashWarn, String ipAddress, int port, String truncHash, long banDuration, long now, boolean isBanned) Mark the peer unreachable and fail the message.PacketBuilder2.buildPeerTestToAlice(int code, Hash charlieHash, byte[] signedData, PeerState2 alice) Build a packet as Bob to Alice, with the response from Charlie, or a rejection by Bob.PacketBuilder2.buildPeerTestToAlice(int code, Hash charlieHash, byte[] signedData, SSU2Payload.Block riBlock, PeerState2 alice) Build a packet as Bob to Alice, with the response from Charlie, or a rejection by Bob.PacketBuilder2.buildPeerTestToCharlie(Hash aliceHash, byte[] signedData, SSU2Payload.Block riBlock, PeerState2 charlie) Build a packet as Bob to Charlie to help test Alice.private OutboundEstablishStateEstablishmentManager.createOutboundState(OutNetMessage msg, RemoteHostId to, RemoteHostId maybeTo, RouterIdentity toIdentity, boolean isIndirect, UDPAddress addr, RouterAddress ra, Hash toHash, String truncHash, String ipAddress, int maybePort, long now, boolean isBanned) Create a new outbound establish state for the peer, after verifying that its introducers, MTU, and introduction key are usable.static byte[]SSU2Util.createPeerTestData(I2PAppContext ctx, Hash h, Hash h2, PeerTestState.Role role, long nonce, byte[] ip, int port, SigningPrivateKey spk) Make the data for the peer test block.static byte[]SSU2Util.createRelayRequestData(I2PAppContext ctx, Hash h, Hash h2, long nonce, long tag, byte[] ip, int port, SigningPrivateKey spk) Make the data for the relay request block.static byte[]SSU2Util.createRelayResponseData(I2PAppContext ctx, Hash h, int code, long nonce, byte[] ip, int port, SigningPrivateKey spk, long token) Make the data for the relay response block.(package private) voidThis does not send a session destroy, caller must do that if desired.private voidPacketBuilder2.encryptSessionRequest(UDPPacket packet, HandshakeState state, boolean isIPv6, int mtu, byte[] hdrKey1, byte[] hdrKey2, boolean needIntro, int version, Hash bob) Encrypt and write out message 1 of the handshake, the SessionRequest.(package private) voidUDPTransport.externalAddressReceived(Hash from, byte[] hisIP, byte[] ourIP, int ourPort) Someone we tried to contact gave us what they think our IP address is.voidUDPTransport.forceDisconnect(Hash peer) Force disconnect a peer.voidUDPTransport.forceDisconnect(Hash peer, String reason) Force disconnect with reason.intUDPTransport.getEstimatedRTT(Hash peer) Measured round trip time to a peer over SSU.longUDPTransport.getEstimatedRTTTime(Hash peer) WhenUDPTransport.getEstimatedRTT(Hash)was measured, on the router clock.OutboundEstablishState2.getIntroState(Hash h) The current state for the SSU2 introducer specified.(package private) PeerStateUDPTransport.getPeerState(Hash remotePeer) The peer state for the peer with the given ident, or null if no state exists.voidEstablishmentManager.HPCallback.gotPeerTest(int msg, int status, Hash h, byte[] data) Got a PeerTest block.voidInboundEstablishState2.gotPeerTest(int msg, int status, Hash h, byte[] data) Got a PeerTest block.voidOutboundEstablishState2.gotPeerTest(int msg, int status, Hash h, byte[] data) voidPeerState2.gotPeerTest(int msg, int status, Hash h, byte[] data) Process a received PeerTest block.voidPeerStateDestroyed.gotPeerTest(int msg, int status, Hash h, byte[] data) Process a received PeerTest block.voidPeerTestManager.PTCallback.gotPeerTest(int msg, int status, Hash h, byte[] data) voidSSU2Payload.PayloadCallback.gotPeerTest(int msg, int status, Hash h, byte[] data) Receive a peer test block.voidEstablishmentManager.HPCallback.gotRelayIntro(Hash aliceHash, byte[] data) Got a RelayIntro block.voidInboundEstablishState2.gotRelayIntro(Hash aliceHash, byte[] data) Got a RelayIntro block.voidOutboundEstablishState2.gotRelayIntro(Hash aliceHash, byte[] data) voidPeerState2.gotRelayIntro(Hash aliceHash, byte[] data) Process a received RelayIntro block.voidPeerStateDestroyed.gotRelayIntro(Hash aliceHash, byte[] data) Process a received RelayIntro block.voidPeerTestManager.PTCallback.gotRelayIntro(Hash aliceHash, byte[] data) voidSSU2Payload.PayloadCallback.gotRelayIntro(Hash aliceHash, byte[] data) Receive a relay introduction.voidA relay request was sent to the SSU2 introducer specified.booleanUDPTransport.isBacklogged(Hash dest) Whether the peer for the given destination is backlogged.(package private) static booleanEstablishmentManager.isBanlisted(Banlist banlist, Hash h) Is the router with the given hash banlisted under any active ban? Null-safe.booleanEstablishmentManager.isConnecting(Hash dest) Check if an outbound SSU handshake is in progress for the given peer.booleanUDPTransport.isConnecting(Hash dest) booleanUDPTransport.isEstablished(Hash dest) private OutboundEstablishStateEstablishmentManager.lookupOutboundState(RemoteHostId to, Hash toHash) Look up an existing outbound establish state for the peer, first by address, then by hash (for indirect connections).private RouterInfoPeerTestManager.lookupRIForTest(Hash h) Look up the RouterInfo a Peer Test message refers to, with a short negative cache.voidUDPTransport.mayDisconnect(Hash peer) Tell the transport that we may disconnect from this peer.voidUDPTransport.messageReceived(I2NPMessage inMsg, RouterIdentity remoteIdent, Hash remoteIdentHash, long msToReceive, int bytesReceived) Handle incoming message from transport layer.(package private) voidIntroductionManager.receiveRelayIntro(PeerState2 bob, Hash alice, byte[] data) Processes a relay introduction message received from another peer.private booleanIntroductionManager.receiveRelayIntro(PeerState2 bob, Hash alice, byte[] data, int retryCount) We are Charlie and we got this from Bob.private booleanIntroductionManager.receiveRelayIntro(PeerState2 bob, Hash alice, byte[] data, RouterInfo aliceRI) We are Charlie and we got this from Bob.voidPeerTestManager.receiveTest(RemoteHostId from, PeerState2 fromPeer, int msg, int status, Hash h, byte[] data) Entry point for all in-session incoming packets.private voidPeerTestManager.receiveTest(RemoteHostId from, PeerState2 fromPeer, int msg, int status, Hash h, byte[] data, byte[] addrBlockIP, int addrBlockPort) Called from above for in-session 1-4 or the PTCallback via processPayload() for out-of-session 5-7private booleanPeerTestManager.receiveTest(RemoteHostId from, PeerState2 fromPeer, int msg, Hash h, byte[] data, int retryCount) Status 0 only, Msg 2 and 4 only, SSU 2 only.private booleanUDPTransport.rejectFloodfill(Hash to, RouterInfo toAddress) Reject a floodfill router that we have no history with, or that has rejected tunnel creation far more often than it has agreed.private voidPeerTestManager.sendRIandPT(RouterInfo ri, int status, Hash hash, byte[] data, PeerState2 to, long now) Send RI and Peer Test.voidPeerTestState.setAlice(InetAddress ip, int port, Hash hash) Alice's IP, port, and hash.voidPeerTestState.setCharlie(InetAddress ip, int port, Hash hash) Charlie's IP, port, and hash.voidOutboundEstablishState2.setIntroState(Hash h, OutboundEstablishState2.IntroState state) The current state for the SSU2 introducer specified.static SignatureSSU2Util.sign(I2PAppContext ctx, byte[] prologue, Hash h, Hash h2, byte[] data, int datalen, SigningPrivateKey spk) Sign the relay or peer test data, using the prologue and hash as the initial data, and then the provided data.static booleanSSU2Util.validateSig(I2PAppContext ctx, byte[] prologue, Hash h, Hash h2, byte[] data, SigningPublicKey spk) Validate the signed relay or peer test data, using the prologue and hash as the initial data, and then the provided data which ends with a signature of the specified type.Constructors in net.i2p.router.transport.udp with parameters of type HashModifierConstructorDescriptionDelayIntro(PeerState2 b, Hash a, byte[] d) Schedules a delayed introduction relay.DelayTest(RemoteHostId f, PeerState2 fp, int m, Hash h, byte[] d) Schedules itself.InboundMessageState(RouterContext ctx, long messageId, Hash from) Creates a new InboundMessageState with no fragments.InboundMessageState(RouterContext ctx, long messageId, Hash from, byte[] data, int off, int len, int fragmentNum, boolean isLast) Creates an InboundMessageState and stores the first received fragment.Introducer(Hash h, long tag, String exp) SSU 2.protectedPeerState(RouterContext ctx, UDPTransport transport, InetSocketAddress addr, Hash remotePeer, boolean isInbound, int rtt) For SSU2.PeerState2(RouterContext ctx, UDPTransport transport, InetSocketAddress remoteAddress, Hash remotePeer, boolean isInbound, int rtt, CipherState sendCha, CipherState rcvCha, long sendID, long rcvID, byte[] sendHdrKey1, byte[] sendHdrKey2, byte[] rcvHdrKey2) A session with a remote peer over SSU2: the connection ids, the four cipher states and the header encryption keys are all fixed here, so the transport can build one without a separate handshake step.PeerTestBlock(int msgNum, int code, Hash hash, byte[] data) Wrap a peer test as a block.privateRemoteHostId(byte[] ip, int port, Hash peerHash) Combines an address, port and hash into one key.RemoteHostId(Hash peerHash) Indirect (hash only).(package private)Records a missing router info.Uses of Hash in net.i2p.router.tunnel
Fields in net.i2p.router.tunnel declared as HashModifier and TypeFieldDescriptionprivate HashTunnelCreatorConfig._blankHashBlank hash used for the reply keys.private final HashInboundMessageDistributor._clientThe client at the end of the tunnel.private final HashTunnelCreatorConfig._destinationOnly necessary for client tunnels.private final HashPumpedTunnelGateway._nextHopThe hash of the next hop.private final Hash[]TunnelCreatorConfig._peersGateway first.private HashHopConfig._receiveFromThe router we receive from.private HashHopConfig._sendToThe router we send to.private final HashOutboundMessageDistributor.DistributeJob._targetThe hash the message searches for.private HashFragmentedMessage._toRouterThe router the message goes to.protected final HashPendingGatewayMessage._toRouterThe destination router.Fields in net.i2p.router.tunnel with type parameters of type HashModifier and TypeFieldDescriptionOutboundMessageDistributor._toRoutersThe routers the message was already sent to.Methods in net.i2p.router.tunnel that return HashModifier and TypeMethodDescriptionTunnelCreatorConfig.getBlankHash()Checksum for blank record.InboundEndpointProcessor.getDestination()The destination this inbound tunnel was created for.TunnelCreatorConfig.getDestination()If this is a client tunnel, what destination is it for?TunnelCreatorConfig.getEndpoint()For convenience.TunnelCreatorConfig.getFarEnd()For convenience.TunnelCreatorConfig.getGateway()For convenience.TunnelCreatorConfig.getPeer(int hop) Retrieve the peer at the given hop (the gateway is hop 0).HopConfig.getReceiveFrom()What is the previous peer in the tunnel (null if gateway)?HopConfig.getSendTo()What is the next peer in the tunnel (null if endpoint)?InboundGatewayReceiver.getSendTo()The next hop.OutboundReceiver.getSendTo()The next hop.TunnelGateway.Receiver.getSendTo()Tunnel the message should be sent through.TunnelGatewayPumper.PoisonPTG.NoOpReceiver.getSendTo()FragmentedMessage.getTargetRouter()The router this message is being sent to.PendingGatewayMessage.getToRouter()The destination router.Methods in net.i2p.router.tunnel with parameters of type HashModifier and TypeMethodDescriptionbooleanPumpedTunnelGateway.add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) Adds a message to be sent down the tunnel.booleanThrottledPumpedTunnelGateway.add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) Adds a message to the inbound gateway after a bandwidth-based drop check.booleanTunnelGateway.add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) Add a message to be sent down the tunnel, either sending it now (perhaps coalesced with other pending messages) or after a brief pause (_flushFrequency).booleanTunnelGatewayZeroHop.add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) Add a message to be sent down the tunnel (immediately forwarding it to theInboundMessageDistributororOutboundMessageDistributor, as necessary).voidOutboundTunnelEndpoint.dispatch(TunnelDataMessage msg, Hash recvFrom) Decrypt and honor the instructions of an incoming tunnel data message.voidTunnelDispatcher.dispatch(TunnelDataMessage msg, Hash recvFrom) Dispatch a TunnelDataMessage to the appropriate participant or endpoint.voidTunnelParticipant.dispatch(TunnelDataMessage msg, Hash recvFrom) Process an incoming tunnel data message.booleanTunnelDispatcher.dispatchOutbound(I2NPMessage msg, TunnelId outboundTunnel, Hash targetPeer) Dispatch an outbound message through a tunnel.booleanTunnelDispatcher.dispatchOutbound(I2NPMessage msg, TunnelId outboundTunnel, TunnelId targetTunnel, Hash targetPeer) Dispatch an outbound message through a tunnel.voidInboundMessageDistributor.distribute(I2NPMessage msg, Hash target) Distribute the message to the target, with no tunnel ID.voidInboundMessageDistributor.distribute(I2NPMessage msg, Hash target, TunnelId tunnel) Distribute the message to the target, giving the tunnel ID for remote delivery.voidOutboundMessageDistributor.distribute(I2NPMessage msg, Hash target) Warning - as of 0.9.63, msg will be an UnknownI2NPMessage, and must be converted before handling locally.voidOutboundMessageDistributor.distribute(I2NPMessage msg, Hash target, TunnelId tunnel) Warning - as of 0.9.63, msg will be an UnknownI2NPMessage, and must be converted before handling locally.booleanProcess the data for the current hop, overwriting the original data with what should be sent to the next peer.booleanFragmentedMessage.receive(byte[] payload, int offset, int length, boolean isLast, Hash toRouter, TunnelId toTunnel) Receive the first fragment (#0) and related metadata.voidFragmentHandler.DefragmentedReceiver.receiveComplete(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) Receive a fully formed I2NPMessage out of the tunnel.private voidFragmentHandler.receiveComplete(byte[] data, int offset, int len, Hash router, TunnelId tunnelId) Zero-copy reception of an unfragmented message.voidOutboundTunnelEndpoint.DefragmentedHandler.receiveComplete(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) Warning - as of 0.9.63, msg will be an UnknownI2NPMessage, and must be converted before handling locally.voidTunnelParticipant.DefragmentedHandler.receiveComplete(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) Distribute the complete message to its target.booleanInboundEndpointProcessor.retrievePreprocessedData(byte[] orig, int offset, int length, Hash prev) Undo all of the encryption done by the peers in the tunnel, recovering the preprocessed data sent by the gateway.voidTunnelCreatorConfig.setBlankHash(Hash h) Checksum for blank record.voidThe peer at the given hop.voidHopConfig.setReceiveFrom(Hash from) Do not set for gateway.voidDo not set for endpoint.private booleanOutboundMessageDistributor.shouldDrop(Hash target) Throttle msgs to unconnected routers after we hit the limit of new routers in a given time period.Constructors in net.i2p.router.tunnel with parameters of type HashModifierConstructorDescriptionDistributeJob(RouterContext ctx, I2NPMessage msg, Hash target, TunnelId id) Builds the distribution job.InboundMessageDistributor(RouterContext ctx, Hash client) Create a new inbound message distributor.OutboundGatewayMessage(I2NPMessage message, Hash toRouter, TunnelId toTunnel) Caches the message priority, which the fragmenter queue orders by.PendingGatewayMessage(I2NPMessage message, Hash toRouter, TunnelId toTunnel) Stores the message data, destination, and expiration for a pending send.TunnelCreatorConfig(RouterContext ctx, int length, boolean isInbound, Hash destination) Allocates the hop configs and peer arrays for the given length.Uses of Hash in net.i2p.router.tunnel.pool
Classes in net.i2p.router.tunnel.pool that implement interfaces with type arguments of type HashModifier and TypeClassDescription(package private) classA Set of Hashes that automatically adds to the Set in theExcluderBase.contains(Object)check.private static classImplement a deterministic comparison that cannot be predicted by others.Fields in net.i2p.router.tunnel.pool declared as HashModifier and TypeFieldDescriptionprivate final HashTunnelPoolManager.ConditionalOutboundStartup._destThe client's destination.private final HashTunnelPoolManager.DelayedPoolCleanup._destinationThe client whose pools are being cleaned up.private final HashBuildHandler.HandleReq._nextPeerThe next hop the lookup found.private final HashBuildHandler.TimeoutReq._nextPeerThe next hop that never answered.private final HashTunnelPeerSelector.PreConnectFailJob._peerThe peer to retry a session with.(package private) HashClientPeerSelector.SelectionExclusions.firstHopThe vetted first hop already in rv, or null when the slot is empty.(package private) final HashBuildHandler.BuildMessageState.fromHashThe sender's hash.private final HashParticipatingThrottler.Disconnector.hThe router's hash.private final HashRequestThrottler.Disconnector.hThe router to disconnect.(package private) final HashBuildHandler.PendingLookup.nextPeerThe next hop found for it.Fields in net.i2p.router.tunnel.pool with type parameters of type HashModifier and TypeFieldDescriptionClientPeerSelector.IBGWExcluder._allowedLocal cache of peers that passed the IBGW check.ClientPeerSelector.OBEPExcluder._allowedLocal cache of peers that passed the OBEP check — same lifecycle and rationale asClientPeerSelector.IBGWExcluder._allowed.private final Map<Hash, RequestThrottler.BurstOffenseRecord> RequestThrottler._burstOffensesBurst offenses recorded per peer.private final Map<Hash, TunnelPool> TunnelPoolManager._clientInboundPoolsHash (destination) to TunnelPool.private final Map<Hash, TunnelPool> TunnelPoolManager._clientOutboundPoolsHash (destination) to TunnelPool.ExploratoryPeerSelector._exploratoryCooldownsCooldown entries for exploratory selections, recorded when checkTunnel fails.TunnelPeerSelector._firstHopFailsTracks when a peer last failed as first hop.private final ConcurrentHashMap<Hash, long[]> BuildExecutor._firstHopFailureHistoryFirst-hop failure history: tracks recent first-hop failures to avoid repeatedly selecting peers that have recently failed as first hops.private final ConcurrentHashMap<Hash, GhostPeerManager.GhostMark> GhostPeerManager._ghostMarksThe marked peers, by hash.private static final ConcurrentHashMap<Hash, TunnelPeerSelector.EndpointCacheEntry> TunnelPeerSelector._ibgwCacheThe cached inbound gateway endpoints.TestJob._inboundReplyPartnerTallyReply partner router hash to the time it was last blamed for a failed round, per direction.private final ThreadLocal<Set<Hash>> ExploratoryPeerSelector._lastAllGhostSelectionPeers from the last selection that were all ghosts, handed to the redraw inExploratoryPeerSelector.selectPeers(TunnelPoolSettings).private final ConcurrentHashMap<Hash, Long> BuildExecutor._lastDispatchTimeLast dispatch time per first-hop peer, for staggering builds.private static final ConcurrentHashMap<Hash, Long> TunnelPeerSelector._lastKeepAliveTracks last keepalive send time per peer.private static final ConcurrentHashMap<Hash, Long> ClientPeerSelector._lastPreConnectTracks the last time preConnectTo was successfully called per peer.private final ConcurrentHashMap<Hash, AtomicInteger> BuildHandler._lookupKeysDistinct next-hop keys currently being resolved, each carrying the refcount of build requests waiting on it.ParticipatingThrottler._noVersionOffensesNo-version offense state per hash: {count, lastOffenseMs}.private static final ConcurrentHashMap<Hash, TunnelPeerSelector.EndpointCacheEntry> TunnelPeerSelector._obepCacheThe cached outbound endpoint entries.TestJob._outboundReplyPartnerTallyOutbound test results tallied per reply partner peer.TunnelPeerSelector._peerCooldownsShared cooldown map across all peer selectors.private final Map<Hash, TunnelPoolManager.DelayedPoolCleanup> TunnelPoolManager._pendingCleanupsPending delayed cleanups for pool removal.private final Map<Hash, TunnelPoolManager.ConditionalOutboundStartup> TunnelPoolManager._pendingOutboundStartupsPending delayed outbound pool startups, keyed by destination hash.TunnelPeerSelector._provenRespondersPeers whose most recent tunnel participation succeeded, mapped to the time of that success.ExcluderBase._reasonsMaps peer hash to the reason it was excluded, for diagnostic logging.ParticipatingThrottler._recentLookupsRouter hashes looked up recently, with the time.private static final Comparator<Map.Entry<Hash, GhostPeerManager.GhostMark>> GhostPeerManager.BY_EXPIRYEviction order by expiry ascending: expired marks sort first (oldest expiry first, so they go in the order they lapsed), followed by active marks nearest to lapsing.private final ObjectCounter<Hash> ParticipatingThrottler.counterHow many tunnels each router participates in.private final ObjectCounter<Hash> RequestThrottler.counterBuild requests counted per peer.ClientPeerSelector.SelectionExclusions.excludePeers explicitly excluded from the selection.ClientPeerSelector.SelectionExclusions.firstHopCooldownsFresh shared-cooldown peers, first-hop-only filter (null when cooldowns are in the base exclude set).ClientPeerSelector.SelectionExclusions.firstPeerExclusionsPeers to skip at the first hop.private static final Comparator<Hash> TunnelPeerSelector.HASH_BASE64_COMPARATOROrders peers by base64 hash for stable selection.private final Map<Hash, AtomicIntegerArray> RequestThrottler.BurstWindowCounter.peerBucketsPer-peer request counts by bucket.ExcluderBase.sThe underlying set of excluded hashes.Methods in net.i2p.router.tunnel.pool that return HashModifier and TypeMethodDescriptionstatic HashBuildRequestor.getBuildRequestPeer(PooledTunnelCreatorConfig cfg) The peer that will receive the tunnel build request (TBM): the gateway (peer 0) for inbound tunnels, or the next hop (peer 1) for outbound tunnels.private HashIdleTunnelMonitor.getPeerHash(HopConfig tunnel) The peer hash for a tunnel - this is the "entry point" peer who first introduced this tunnel to us (IBGW or closest hop to IBGW).private HashTunnelPool.localHop(TunnelInfo t) The peer whose transport session this tunnel sends through, or null when there is none.Methods in net.i2p.router.tunnel.pool that return types with arguments of type HashModifier and TypeMethodDescriptionClientPeerSelector.applyShortfallFallbacks(TunnelPoolSettings settings, List<Hash> rv, int length, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex) Progressive fallbacks when the selected peers are short of the requested length.ClientPeerSelector.buildLastHopExclude(ClientPeerSelector.SelectionParams params, Set<Hash> exclude) Build the last-hop exclusion set: closest-hop wrapped for inbound, OBEP wrapped for outbound.ClientPeerSelector.buildSoftFallbackExclude(Set<Hash> exclude, ClientPeerSelector.SelectionExclusions ex) Builds the soft-fallback exclusion set: a copy of the first-hop exclusion set without no-signal-excluded peers that have proven track records (tunnel acceptance > 50% and at least one successful test), giving them a chance when all standard tiers fail.BuildExecutor.collectPairTargets(List<TunnelPool> pools) Collect per-direction build quantity targets for paired destinations, used by the proportional per-direction cap in calculatePairedBuilds().TunnelPool.collectPeerForPriorityTest(List<Hash> peersToTest, Hash peer, int peersInTunnel, long startupTime) Collect a peer for priority testing, capped at 3 distinct peers.TunnelPool.collectPublishedGateways(LeaseSet publishedLS) Gateway hashes already used by the published lease set.ClientPeerSelector.filterBannedPeers(List<Hash> peers) Drop banlisted peers from a selection so builds do not dispatch requests that BuildHandler will reject with "Next peer is banned".ClientPeerSelector.filterByReliability(Set<Hash> candidates, Set<Hash> exclude) Filter candidates through the reliability gate: a peer must have an adequate acceptance ratio and at least one recent activity or connection signal to remain.ClientPeerSelector.filterGhostPeers(List<Hash> peers) Filter out ghost peers from the selected peer list.ClientPeerSelector.finalizeSelection(TunnelPoolSettings settings, List<Hash> rv, boolean isInbound) Insert self, ghost-filter, strategy post-processing, duplicate re-check, and cooldowns.TunnelPool.findReusableTunnel(int len, long now, long cooldownCutoff) Try to reuse an existing tunnel of the right length that is expiring soon, so its peers carry into the new build.ClientPeerSelector.findUnreliable(List<Hash> hops, long now) The selected hops that fail the reliability gate.TunnelPeerSelector.getClosestHopExclude(boolean isInbound, Set<Hash> toAdd) Pick peers that we want to avoid for the first OB hop or last IB hop.TunnelPeerSelector.getExclude(boolean isInbound, boolean isExploratory) Create the exclusion set for this pool, for passing to ProfileOrganizer.TunnelPoolManager.getInboundClientPools()For TunnelRenderer in router console.TunnelPoolManager.getOutboundClientPools()For TunnelRenderer in router console.TunnelPeerSelector.getPeersInAllPools(RouterContext ctx) All non-self peers in active tunnels across ALL pools (client IB/OB + exploratory IB/OB).TunnelPeerSelector.getPeersInPool(RouterContext ctx, TunnelPool pool) All non-self peers in active tunnels of the given pool.ExcluderBase.iterator()An iterator over the underlying set.TunnelPool.peersEndpointFirst(TunnelInfo ti) The tunnel's peers, endpoint first, the order selectPeers() returns them in.ClientPeerSelector.positionalConflicts(List<Hash> nonSelf, boolean isInbound, Hash dest, long now) Selected hops whose placement would give a single peer concurrent entry and exit visibility across this destination's pools — the pairing that enables traffic correlation.ClientPeerSelector.provenCandidates(Set<Hash> excludePeers) Fresh proven responders, freshest first, filtered for basic eligibility: not us, not banlisted, not on selection cooldown, with a locally cached RouterInfo so a build can reach them, and not already active in the destination's pools (a swap must never introduce a per-pool duplicate).TunnelPeerSelector.regeneratePeers(TunnelPoolSettings settings, List<Hash> peers, int attempt) Regenerate tunnel peers to avoid duplicate sequence.TestJob.replyPartnerMemory(boolean inbound) The per-context tally of reply partners, holding for each one the number of rounds it carried and the time it was last blamed.TunnelPeerSelector.selectExplicit(TunnelPoolSettings settings, int length) For debugging, also possibly for restricted routes.ClientPeerSelector.selectHops(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex) Single-hop or multi-hop selection for one tunnel length.ClientPeerSelector.selectHopsWithRetry(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex) Draws every hop, drops unsuitable peers (ghost and banlisted), and redraws once from a fresh exclusion set when filtering emptied the selection.ClientPeerSelector.selectMultiHop(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches) Select all hops of a multi-hop tunnel: last hop, middle hops, then first hop.ClientPeerSelector.selectPeers(TunnelPoolSettings settings) Returns ENDPOINT FIRST, GATEWAY LAST!!!! In: us ..ClientPeerSelector.selectPeers(TunnelPoolSettings settings, Set<Hash> excludeFirstHops) Select peers for a new tunnel, excluding given peers from first-hop selection.ExploratoryPeerSelector.selectPeers(TunnelPoolSettings settings) Returns ENDPOINT FIRST, GATEWAY LAST!!!! In: us ..TunnelPeerSelector.selectPeers(TunnelPoolSettings settings) Which peers should go into the next tunnel for the given settings?TunnelPeerSelector.selectPeers(TunnelPoolSettings settings, Set<Hash> excludeFirstHops) Select peers for a new tunnel, with an optional set of first-hop peers to exclude from selection.ClientPeerSelector.selectPeersBase(TunnelPoolSettings settings) Select peers for a new tunnel.ExploratoryPeerSelector.selectPeersInternal(TunnelPoolSettings settings, int length, boolean includeCooldowns) The actual peer selection, shared between the normal path and the cooldown-bypass retry inExploratoryPeerSelector.selectPeers(TunnelPoolSettings).ExploratoryPeerSelector.selectPeersInternal(TunnelPoolSettings settings, int length, boolean includeCooldowns, Set<Hash> alsoExclude) Select peers, additionally excluding a set the caller has decided on.TunnelPoolManager.selectPeersInTooManyTunnels()For reliability reasons, don't allow a peer in more than x% of client and exploratory tunnels.ClientPeerSelector.selectSingleHop(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches) Select the single hop of a 1-hop tunnel (with hidden-inbound special case).Methods in net.i2p.router.tunnel.pool with parameters of type HashModifier and TypeMethodDescriptionprivate voidParticipatingThrottler._logHighRequestCount(Hash h, String caps, int count, int limit) Logs warnings for high count tunnel request rejections.booleanAdd the hash to the underlying set.protected booleanTunnelPeerSelector.allowAsIBGW(Hash h) Should we allow as IBGW? This just checks for the "R" capability and IPv4 support.protected booleanTunnelPeerSelector.allowAsOBEP(Hash h) Should we allow as OBEP? This just checks for IPv4 support.(package private) static voidTunnelPeerSelector.applyProbeFailure(RouterContext ctx, Hash peer) Act on a pre-connect probe that could not be delivered.(package private) static booleanBuildHandler.attachLookupKey(ConcurrentHashMap<Hash, AtomicInteger> inFlight, Hash key, int limit) Attach a build request's next hop to the in-flight lookup set.private voidTunnelPool.blameSinglePeer(TunnelInfo cfg, Hash blamePeer) Apply the whole failure penalty to one peer: profile failure, the selection cooldown, tier demotion, and a priority retest so a persistently failing hop is not re-selected on the next generation.private voidTunnelPoolManager.cancelPendingOutboundStartup(Hash destination) Cancel any pending outbound startup event for the destination.booleanConnectChecker.canConnect(Hash from, Hash to) Can "from" connect to "to" based on published addresses?private booleanParticipatingThrottler.checkLowShareAndVersion(String version, boolean isLU, boolean shouldBlockOldRouters, Hash h, boolean shouldDisconnect, boolean isBanned, String caps, int bantime, RouterInfo ri) Checks if a low-share, old-version router should be banned and disconnected.private booleanParticipatingThrottler.checkUnreachableAndOld(String version, boolean isUnreachable, boolean isFast, boolean shouldBlockOldRouters, Hash h, boolean shouldDisconnect, boolean isBanned, String caps) Checks if an unreachable and old router should be banned or ignored.private booleanParticipatingThrottler.checkVersionAndCompressibility(String version, boolean isCompressible, boolean shouldDisconnect, Hash h, boolean isBanned, String caps, RouterInfo ri) Checks router version and compressibility of RouterInfo to decide on banning.voidGhostPeerManager.clearGhost(Hash peer) Clear ghost status for a peer (manual intervention).TunnelPool.collectPeerForPriorityTest(List<Hash> peersToTest, Hash peer, int peersInTunnel, long startupTime) Collect a peer for priority testing, capped at 3 distinct peers.intCompare the two hashes by SipHash distance.(package private) static intClientPeerSelector.compareExcluded(Hash p1, Hash p2, Set<Hash> exclude) Excluded peers sort last; two excluded peers compare equal.(package private) static intClientPeerSelector.compareQuality(Hash p1, Hash p2, Set<Hash> exclude, PeerProfile prof1, PeerProfile prof2, Map<Hash, Long> proven, long now, long thirtyMinutes) Full quality comparison cascade.private voidTunnelPool.countSessionLossCause(Hash hop) Attribute one zombie exclusion to this router or to the peer, and count it.BuildHandler.TunnelBuildMessageHandlerJobBuilder.createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash fromHash) Either from or fromHash may be null, but both should be null only if we're to be a IBGW and it came from us as a OBEP.BuildHandler.TunnelBuildReplyMessageHandlerJobBuilder.createJob(I2NPMessage receivedMessage, RouterIdentity from, Hash fromHash) static voidBuildMessageGenerator.createRecord(int recordNum, int hop, TunnelBuildMessage msg, TunnelCreatorConfig cfg, Hash replyRouter, long replyTunnel, RouterContext ctx, PublicKey peerKey, Properties props) Place the asymmetrically encrypted record in the specified record slot, containing the hop's configuration (as well as the reply info, if it is an outbound endpoint).private static BuildRequestRecordBuildMessageGenerator.createUnencryptedRecord(I2PAppContext ctx, TunnelCreatorConfig cfg, int hop, Hash replyRouter, long replyTunnel, boolean isEC, boolean isShort, Properties props) Create an unencrypted build request record for a tunnel hop.BuildMessageProcessor.decrypt(TunnelBuildMessage msg, Hash ourHash, PrivateKey privKey) Decrypt the record targeting us, encrypting all of the other records with the included reply key and IV.private voidBuildExecutor.didNotReply(long tunnel, Hash peer) Log that a peer did not reply to a tunnel build request.private voidTunnelPoolManager.doRemoveTunnels(Hash destination) Actually perform pool removal.intTunnelPoolManager.ensurePoolsFor(Hash client) Nudge both of a local client's pools to run their ensure logic.private ParticipatingThrottler.ResultParticipatingThrottler.evaluateThrottleConditions(int count, int limit, boolean shouldThrottle, boolean isFast, boolean isLowShare, boolean isUnreachable, Hash h, String caps, boolean isBanned, int bantime, RouterInfo ri, boolean countRequest) Evaluates whether to accept, reject, or drop tunnel requests based on probabilistic rejection curve modulated by system load.voidFail all outbound tunnels with this peer as first hop, and all inbound tunnels with this peer as the last hop, because we can't contact it any more.private voidTunnelPoolManager.failTunnelsWithFirstHop(TunnelPool pool, Hash peer) Fail all (outbound) tunnels with this peer as first hop (not counting us).private voidTunnelPoolManager.failTunnelsWithLastHop(TunnelPool pool, Hash peer) Fail all (inbound) tunnels with this peer as last hop (not counting us).private TunnelInfoTunnelPool.findClosestTunnel(Hash closestTo, boolean avoidZeroHop, long now) Find the non-failed tunnel XOR-closest to the target, so OBEP-IBGW connections keep some locality network-wide.private static intClientPeerSelector.firstHopIndex(List<Hash> rv, Hash firstHop) Index at which a missing middle hop must be inserted: just before the vetted first hop, or at the end when there is none yet.voidTunnelPoolManager.forceRemoveTunnels(Hash destination) Force immediate removal of a pool - used for router shutdown.(package private) intWindow total for the peer without recording a request.(package private) intRequestThrottler.BurstWindowCounter.getCurrentBucketCount(Hash h) Count in the current bucket only, not the whole window.private StringTunnelPeerSelector.getExclusionReason(Hash peerHash, boolean isInbound, boolean isExploratory, double buildSuccess, long activityWindow) Check if a peer should be excluded from closest hop selection.private intBuildExecutor.getFirstHopFailureCount(Hash hash) Get the recent first-hop failure count for a peer (for logging).private StringTunnelPeerSelector.getHardExclusionReason(Hash peerHash, boolean isInbound, boolean isExploratory, double buildSuccess) Hard exclusion reasons only — skips the no-signal (pre-qualification) check.intTunnelPoolManager.getInboundClientTunnelCount(Hash destination) Use to verify a tunnel pool is alive.TunnelPoolManager.getInboundPool(Hash client) The client's inbound pool, creating it if needed.TunnelPoolManager.getInboundSettings(Hash client) Get settings for a client's inbound tunnel pool.private StringBuildHandler.getIPPortFromHash(Hash h) Extract IP:port fromRouterInfofor a peer hash.intTunnelPoolManager.getOutboundClientTunnelCount(Hash destination) Use to verify a tunnel pool is alive.TunnelPoolManager.getOutboundPool(Hash client) The client's outbound pool, creating it if needed.TunnelPoolManager.getOutboundSettings(Hash client) Get settings for a client's outbound tunnel pool.intTunnelPoolManager.getUsableInboundClientTunnelCount(Hash destination) Get USABLE inbound client tunnel count for a specific destination.intTunnelPoolManager.getUsableOutboundClientTunnelCount(Hash destination) Get USABLE outbound client tunnel count for a specific destination.private voidParticipatingThrottler.handleExcessiveRequests(Hash h, String caps, int count, int limit, int bantime, RouterInfo ri) Handles excessive tunnel request counts by banning and scheduling disconnect.private voidParticipatingThrottler.handleNoVersion(boolean shouldDisconnect, Hash h, boolean isBanned, String caps, RouterInfo ri, String version) Handles joins from routers whose held RouterInfo carries no version.private voidBuildHandler.handleReq(RouterInfo nextPeerInfo, BuildHandler.BuildMessageState state, BuildRequestRecord req, Hash nextPeer) Actually process the request and send the reply.private booleanBuildExecutor.hasRecentlyFailedAsFirstHop(Hash hash) Check whether a peer has recently failed as a first hop more thanBuildExecutor._firstHopFailureThresholdtimes within the cooldown window.protected static booleanTunnelPeerSelector.hasRecoveredFromFailure(RouterContext ctx, Hash peer) Check if a peer has recovered from failure and can be reconsidered.protected static booleanTunnelPeerSelector.hasValidTransportAddress(RouterContext ctx, Hash peer) Check if a peer's RouterInfo has at least one reachable SSU or NTCP address.(package private) intRecord one request from the peer and return the fresh window total.private static intBuildExecutor.indexOfPeer(PooledTunnelCreatorConfig cfg, Hash peer) Zero-based position ofpeerin the build path, or -1 when absent.(package private) booleanRequestThrottler.BurstWindowCounter.isBursting(Hash h, int normalLimit) Whether the peer's window total exceeds a burst limit derived from its normal limit (clamped between the min and max).static booleanTunnelPeerSelector.isFirstHopFailing(RouterContext ctx, Hash peer) Check if a peer recently failed as first hop and should be excluded.booleanCheck if a peer should be excluded from tunnel selection.protected static booleanTunnelPeerSelector.isLowAcceptanceRatio(RouterContext ctx, Hash peer) Check if a peer has a history of rejecting tunnel build requests.(package private) static booleanTunnelPoolManager.FastTierProbeJob.isRecentlyActive(RouterContext ctx, Hash peer, long now) Whether this peer has traffic recent enough that probing adds nothing.(package private) static booleanTunnelPeerSelector.isStalePeer(RouterContext ctx, Hash peer) Check whether a peer is stale — no contact (heard from or heard about) within the dynamic activity window.(package private) static booleanTunnelPeerSelector.isStalePeer(RouterContext ctx, Hash peer, double buildSuccess) Check whether a peer is stale — no contact (heard from or heard about) within the dynamic activity window.booleanTunnelPoolManager.isValidTunnel(Hash client, TunnelInfo tunnel) Check if a tunnel is valid and belongs to the client's pool.private voidClientPeerSelector.logAcceptedFirstHopTier(RouterContext ctx, Hash firstHop, int tier, int attempt, int attempts, int remaining, double buildSuccess) Log the quality tier that actually produced this build's first hop.private voidGhostPeerManager.logGhostMarkLocked(Hash peer, boolean underAttack, long cooldownMs, int offenses, long now) Debug detail plus the once-per-minute warn summary.private voidTunnelPool.logPeerBlame(Hash peer, int pct, long uptime, long startupTime, int consecutiveFailures) Log the blame assignment for a peer, gated on startup being complete, warn logging being enabled and an active failure streak.private static RouterInfoTunnelPeerSelector.lookupRouterInfoUnvalidated(RouterContext ctx, Hash peer) Fetch a peer RouterInfo for a message we address to it, preferring the unvalidated store lookup.(package private) static StringTunnelPoolManager.noPoolLine(boolean inbound, Hash destination) The entry for a destination with no client pool of the given direction, so a null return from the selector carries a reason in the log.(package private) static voidTunnelPeerSelector.noteFirstHopRtt(RouterContext ctx, Hash peer, Transport transport) Extract the transport's measured direct-link RTT and record it on the peer.ClientPeerSelector.positionalConflicts(List<Hash> nonSelf, boolean isInbound, Hash dest, long now) Selected hops whose placement would give a single peer concurrent entry and exit visibility across this destination's pools — the pairing that enables traffic correlation.(package private) static booleanBuildRequestor.preConnectFallback(RouterContext ctx, Hash peer, PooledTunnelCreatorConfig cfg, BuildExecutor exec) Approach 2: Fire-and-forget fallback — attempt to establish the transport session and retry the build once.protected static TunnelPeerSelector.PreConnectOutcomeTunnelPeerSelector.preConnectTo(RouterContext ctx, Hash peer) Send aDatabaseLookupMessageto a peer so it answers with our RouterInfo, which forces a full session handshake rather than the emptyDataMessagethat would leave the peer with nothing to reply to.protected voidExcluderBase.recordExclusion(Hash h, String reason) Record why a peer was excluded, for diagnostic logging.protected static voidTunnelPeerSelector.recordFirstHopFail(RouterContext ctx, Hash peer) Record that a peer failed as first hop (first hop unreachable).private voidBuildExecutor.recordFirstHopFailure(Hash hash) Record a first-hop failure for a given peer hash.(package private) static voidClientPeerSelector.recordPreConnect(Hash peer, long time) Records that preConnectTo was called for the peer at the given time.voidGhostPeerManager.recordSuccess(Hash peer) Record successful tunnel participation by a peer.voidGhostPeerManager.recordTimeout(Hash peer) Record that a peer timed out during tunnel build.(package private) static voidBuildHandler.releaseLookupKey(ConcurrentHashMap<Hash, AtomicInteger> inFlight, Hash key) Release one build request's attachment to an in-flight lookup key, dropping the key entry once its last waiting request completes so released slots become visible to new arrivals.voidTunnelPoolManager.removeTunnels(Hash destination) This will be called twice, once by the inbound and once by the outbound pool.private voidBuildHandler.scheduleLookupDeadline(BuildHandler.BuildMessageState state, Hash nextPeer, AtomicBoolean decremented, int attempts) Schedule an independent deadline that releases this request's lookup attachment if neither callback has done so by then.private voidParticipatingThrottler.scheduleRouterLookup(Hash h) Rate-limited background resolution for transit peers missing from our local netDb, so throttler decisions graduate from count-only to full classification without blocking or hammering the netdb.TunnelPoolManager.selectInboundExploratoryTunnel(Hash closestTo) Pick the inbound exploratory tunnel with the gateway closest to the given hash.TunnelPoolManager.selectInboundTunnel(Hash destination) Pick a random inbound tunnel from the given destination's pool.TunnelPoolManager.selectInboundTunnel(Hash destination, Hash closestTo) Pick the inbound tunnel with the gateway closest to the given hash from the given destination's pool.TunnelPoolManager.selectInboundTunnelForTest(Hash destination) Pick a tunnel from a destination's inbound pool to carry a test round's reply, preferring partners that have demonstrated they work.TunnelPoolManager.selectOutboundExploratoryTunnel(Hash closestTo) Pick the outbound exploratory tunnel with the endpoint closest to the given hash.TunnelPoolManager.selectOutboundTunnel(Hash destination) Pick a random outbound tunnel from the given destination's pool.TunnelPoolManager.selectOutboundTunnel(Hash destination, Hash closestTo) Pick the outbound tunnel with the endpoint closest to the given hash from the given destination's pool.TunnelPoolManager.selectOutboundTunnelForTest(Hash destination) Pick a tunnel from a destination's outbound pool to carry a test round's outbound leg, preferring partners that have demonstrated they work.(package private) TunnelInfoAliasedTunnelPool.selectTunnel(Hash closestTo) (package private) TunnelInfoTunnelPool.selectTunnel(Hash closestTo) Return the tunnel from the pool that is XOR-closest to the target.voidTunnelPoolManager.setInboundSettings(Hash client, TunnelPoolSettings settings) Set settings for a client's inbound tunnel pool.voidTunnelPoolManager.setOutboundSettings(Hash client, TunnelPoolSettings settings) Set settings for a client's outbound tunnel pool.private static voidTunnelPoolManager.setSettings(Map<Hash, TunnelPool> pools, Hash client, TunnelPoolSettings settings) Applies settings to one client's pools.(package private) booleanBuildExecutor.shouldChargeGhostMark(PooledTunnelCreatorConfig cfg, Hash contacted) Whether an expired build's contacted hop should be charged a ghost mark.(package private) static booleanClientPeerSelector.shouldPreConnect(RouterContext ctx, Hash peer) Determines whether preConnectTo() should be called for a first-hop candidate.(package private) ParticipatingThrottler.ResultParticipatingThrottler.shouldThrottle(Hash h) Determines whether to throttle tunnel participation for the given router, counting the request against the peer's limit.(package private) ParticipatingThrottler.ResultParticipatingThrottler.shouldThrottle(Hash h, boolean countRequest) Determines whether to throttle tunnel participation for the given router.(package private) booleanRequestThrottler.shouldThrottle(Hash h) Checks if the given router's tunnel requests should be throttled.protected static booleanTunnelPeerSelector.supportsNTCP2(RouterContext ctx, Hash peer) Check if a peer supports NTCP2 transport.(package private) static voidClientPeerSelector.trimToAcceptedFirstHop(ArraySet<Hash> matches, Hash accepted) Reduce a first-hop candidate batch to the single peer the quality loop accepted.(package private) voidAliasedTunnelPool.tunnelFailed(TunnelInfo cfg, Hash blamePeer) (package private) voidTunnelPool.tunnelFailed(TunnelInfo cfg, Hash blamePeer) Remove the tunnel and blame only one peer.private static booleanClientPeerSelector.wasRecentlyConnected(RouterContext ctx, Hash peer) Check whether the peer was connected within the cooldown window.Method parameters in net.i2p.router.tunnel.pool with type arguments of type HashModifier and TypeMethodDescriptionbooleanExcluderBase.addAll(Collection<? extends Hash> c) Add all of the hashes to the underlying set.protected static intTunnelPeerSelector.addFreshCooldownExclusions(Map<Hash, Long> cooldowns, long cutoff, Set<Hash> exclude) Add cooldown entries still inside their window (value > cutoff) to the exclusion set without mutating the map.protected static intTunnelPeerSelector.addFreshCooldownExclusions(Map<Hash, Long> cooldowns, long cutoff, Set<Hash> exclude) Add cooldown entries still inside their window (value > cutoff) to the exclusion set without mutating the map.ClientPeerSelector.applyShortfallFallbacks(TunnelPoolSettings settings, List<Hash> rv, int length, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex) Progressive fallbacks when the selected peers are short of the requested length.(package private) static booleanBuildHandler.attachLookupKey(ConcurrentHashMap<Hash, AtomicInteger> inFlight, Hash key, int limit) Attach a build request's next hop to the in-flight lookup set.ClientPeerSelector.buildLastHopExclude(ClientPeerSelector.SelectionParams params, Set<Hash> exclude) Build the last-hop exclusion set: closest-hop wrapped for inbound, OBEP wrapped for outbound.ClientPeerSelector.buildSoftFallbackExclude(Set<Hash> exclude, ClientPeerSelector.SelectionExclusions ex) Builds the soft-fallback exclusion set: a copy of the first-hop exclusion set without no-signal-excluded peers that have proven track records (tunnel acceptance > 50% and at least one successful test), giving them a chance when all standard tiers fail.protected booleanTunnelPeerSelector.checkTunnel(boolean isInbound, boolean isExploratory, List<Hash> tunnel) Connectivity check.private booleanTunnelPeerSelector.checkTunnel(List<Hash> tunnel) Connectivity check.private intClientPeerSelector.collectActive(List<Hash> rv, int min, ClientPeerSelector.SelectionExclusions ex) Pulls connected peers, which are not reachable through the profile tier cascade at all: a peer with an established transport session but no usable profile still builds fast.private intClientPeerSelector.collectFromTier(List<Hash> rv, int min, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex) One cascading tier selection.private List<TunnelInfo> TunnelPool.collectNonPublishedTunnels(Set<Hash> publishedGateways, int latencyThreshold, long now) Scan for GOOD tunnels not included in the published LeaseSet.TunnelPool.collectPeerForPriorityTest(List<Hash> peersToTest, Hash peer, int peersInTunnel, long startupTime) Collect a peer for priority testing, capped at 3 distinct peers.(package private) static intClientPeerSelector.compareExcluded(Hash p1, Hash p2, Set<Hash> exclude) Excluded peers sort last; two excluded peers compare equal.(package private) static intClientPeerSelector.compareQuality(Hash p1, Hash p2, Set<Hash> exclude, PeerProfile prof1, PeerProfile prof2, Map<Hash, Long> proven, long now, long thirtyMinutes) Full quality comparison cascade.(package private) static intClientPeerSelector.compareQuality(Hash p1, Hash p2, Set<Hash> exclude, PeerProfile prof1, PeerProfile prof2, Map<Hash, Long> proven, long now, long thirtyMinutes) Full quality comparison cascade.(package private) PooledTunnelCreatorConfigTunnelPool.configureNewTunnel(boolean forceZeroHop, Set<Hash> excludeFirstHops) Configure a new tunnel, optionally excluding peers from first-hop selection.private intTunnelPoolManager.countTunnelsPerPeer(ObjectCounterUnsafe<Hash> lc, boolean exploratory) Count tunnels and peers separately for exploratory or client pools.private PooledTunnelCreatorConfigTunnelPool.createConfig(TunnelPoolSettings settings, List<Hash> peers, long now, long expiration) Build the config with the given peers, endpoint first.(package private) static booleanTunnelPeerSelector.dropUnreliable(List<Hash> hops, Set<Hash> unreliable, int minKeep) Remove unreliable hops while at leastminKeepremain.(package private) static booleanTunnelPeerSelector.dropUnreliable(List<Hash> hops, Set<Hash> unreliable, int minKeep) Remove unreliable hops while at leastminKeepremain.private intClientPeerSelector.fillRemainingHops(List<Hash> rv, int min, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex) Topsrvup tominhops from the tier ladder, inserting new middle hops before the vetted first hop so rv keeps its [endpoint ..ClientPeerSelector.filterBannedPeers(List<Hash> peers) Drop banlisted peers from a selection so builds do not dispatch requests that BuildHandler will reject with "Next peer is banned".ClientPeerSelector.filterByReliability(Set<Hash> candidates, Set<Hash> exclude) Filter candidates through the reliability gate: a peer must have an adequate acceptance ratio and at least one recent activity or connection signal to remain.ClientPeerSelector.filterGhostPeers(List<Hash> peers) Filter out ghost peers from the selected peer list.ClientPeerSelector.finalizeSelection(TunnelPoolSettings settings, List<Hash> rv, boolean isInbound) Insert self, ghost-filter, strategy post-processing, duplicate re-check, and cooldowns.ClientPeerSelector.findUnreliable(List<Hash> hops, long now) The selected hops that fail the reliability gate.private static intClientPeerSelector.firstHopIndex(List<Hash> rv, Hash firstHop) Index at which a missing middle hop must be inserted: just before the vetted first hop, or at the end when there is none yet.protected static StringTunnelPeerSelector.formatExcludedPeers(Set<Hash> peers) Format a set of excluded peers for logging, with exclusion reasons when the set is anTunnelPeerSelector.ExcluderorExcluderBase.private static StringClientPeerSelector.formatPeerList(List<Hash> peers) Formats a peer list for the log.TunnelPeerSelector.getClosestHopExclude(boolean isInbound, Set<Hash> toAdd) Pick peers that we want to avoid for the first OB hop or last IB hop.private booleanTunnelPool.hasAllPeerRIs(List<Hash> peers) Whether every non-self peer in the list still has a RouterInfo cached locally.private booleanTunnelPool.hasPeerOnCooldown(List<Hash> peers, long cooldownCutoff) Whether any non-self peer in the list is on cooldown.(package private) static intClientPeerSelector.insertNewPeers(List<Hash> rv, int index, Collection<Hash> picked, int need) Adds up toneedpeers frompickedthat are not already inrv, inserting them atindexso the surrounding order is untouched.(package private) static intClientPeerSelector.insertNewPeers(List<Hash> rv, int index, Collection<Hash> picked, int need) Adds up toneedpeers frompickedthat are not already inrv, inserting them atindexso the surrounding order is untouched.protected booleanTunnelPeerSelector.isDuplicateSequence(TunnelPoolSettings settings, List<Hash> newPeers) Check if the selected peer sequence matches an existing tunnel in the pool.private booleanTunnelPool.isPruneCandidate(TunnelInfo t, Set<Hash> publishedGateways, long now, int latencyThreshold) Whether the tunnel should be pruned: near expiry or slower than the latency threshold, not fresh, not UNTESTED, and not published in the current LeaseSet.private voidTunnelPool.logConfigDebug(PooledTunnelCreatorConfig cfg, List<Hash> peers) Logs a new tunnel's config and peers at debug level.(package private) static booleanTunnelPeerSelector.matchesExistingTunnel(TunnelInfo existing, List<Hash> newPeers, boolean isInbound) Compare a newly selected peer sequence (excluding self) against one existing tunnel.(package private) static voidTestJob.noteReplyPartnerRound(Map<Hash, long[]> tally, TunnelInfo replyPartner, boolean failed) Record one round against its reply partner: the use always, the failure only when the round failed.protected voidTunnelPeerSelector.orderPeers(List<Hash> rv, SessionKey key) Order peers using the given key.ClientPeerSelector.positionalConflicts(List<Hash> nonSelf, boolean isInbound, Hash dest, long now) Selected hops whose placement would give a single peer concurrent entry and exit visibility across this destination's pools — the pairing that enables traffic correlation.(package private) static intTunnelPeerSelector.preferProven(List<Hash> hops, int from, int to, Map<Hash, Long> proof, long now, long window, Iterator<Hash> replacements) Replace hops lacking fresh proof with proven replacements, in order.(package private) static intTunnelPeerSelector.preferProven(List<Hash> hops, int from, int to, Map<Hash, Long> proof, long now, long window, Iterator<Hash> replacements) Replace hops lacking fresh proof with proven replacements, in order.(package private) static intTunnelPeerSelector.preferProven(List<Hash> hops, int from, int to, Map<Hash, Long> proof, long now, long window, Iterator<Hash> replacements) Replace hops lacking fresh proof with proven replacements, in order.ClientPeerSelector.provenCandidates(Set<Hash> excludePeers) Fresh proven responders, freshest first, filtered for basic eligibility: not us, not banlisted, not on selection cooldown, with a locally cached RouterInfo so a build can reach them, and not already active in the destination's pools (a swap must never introduce a per-pool duplicate).private static voidTunnelPeerSelector.pruneEndpointCache(ConcurrentHashMap<Hash, TunnelPeerSelector.EndpointCacheEntry> cache, long now) Prune expired entries when the cache grows too large.(package private) static intBuildExecutor.pruneFirstHopFailures(Map<Hash, long[]> history, long now, long cooldown, int cap) Prune the first-hop failure history once it has outgrown its cap.(package private) static voidTestJob.pruneReplyPartnerTally(Map<Hash, long[]> tally) Keep the tally bounded.(package private) static intClientPeerSelector.pruneStalePreConnect(ConcurrentHashMap<Hash, Long> map, long now) Drop pre-connect records older than the cooldown window.private voidTunnelPool.recordPeerCooldowns(List<Hash> peers, long now) Record a diversity cooldown for every reused peer so selectPeers respects them on the next selection.private voidClientPeerSelector.refillFirstHop(ClientPeerSelector.SelectionParams params, SessionKey randomKey, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches, boolean inStartup) Refill the first-hop candidate batch after a quality-loop ejection.TunnelPeerSelector.regeneratePeers(TunnelPoolSettings settings, List<Hash> peers, int attempt) Regenerate tunnel peers to avoid duplicate sequence.(package private) static voidBuildHandler.releaseLookupKey(ConcurrentHashMap<Hash, AtomicInteger> inFlight, Hash key) Release one build request's attachment to an in-flight lookup key, dropping the key entry once its last waiting request completes so released slots become visible to new arrivals.(package private) static doubleTestJob.replyPartnerFailureRate(Map<Hash, long[]> tally, TunnelInfo replyPartner) Failure rate of a reply partner: failures divided by rounds it carried.private voidTunnelPoolManager.schedulePeerTests(List<Hash> peers) Schedule peers for priority testing.private voidTunnelPool.schedulePriorityPeerTests(List<Hash> peersToTest) Schedule the collected peers for priority testing if the peer test job is available.private voidClientPeerSelector.selectFirstHop(int length, ClientPeerSelector.SelectionParams params, SessionKey randomKey, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches) Select the first hop, IBGW for inbound and the closest outbound peer otherwise, with a quality loop and pre-connect.private booleanClientPeerSelector.selectLastHop(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, SessionKey randomKey, Set<Hash> lastHopExclude, Set<Hash> rawExclude, ArraySet<Hash> matches) Select the last hop (hidden-inbound closest hop, hidden-outbound OBEP, or normal OBEP).private booleanClientPeerSelector.selectLastHop(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, SessionKey randomKey, Set<Hash> lastHopExclude, Set<Hash> rawExclude, ArraySet<Hash> matches) Select the last hop (hidden-inbound closest hop, hidden-outbound OBEP, or normal OBEP).private voidClientPeerSelector.selectMiddleHops(int length, ClientPeerSelector.SelectionParams params, SessionKey randomKey, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches, List<Hash> rv) Select the middle hop(s) of a tunnel longer than 2 hops, subtiers 2-3, quality-ordered.private voidClientPeerSelector.selectMiddleHops(int length, ClientPeerSelector.SelectionParams params, SessionKey randomKey, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches, List<Hash> rv) Select the middle hop(s) of a tunnel longer than 2 hops, subtiers 2-3, quality-ordered.ClientPeerSelector.selectMultiHop(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches) Select all hops of a multi-hop tunnel: last hop, middle hops, then first hop.ClientPeerSelector.selectPeers(TunnelPoolSettings settings, Set<Hash> excludeFirstHops) Select peers for a new tunnel, excluding given peers from first-hop selection.TunnelPeerSelector.selectPeers(TunnelPoolSettings settings, Set<Hash> excludeFirstHops) Select peers for a new tunnel, with an optional set of first-hop peers to exclude from selection.ExploratoryPeerSelector.selectPeersInternal(TunnelPoolSettings settings, int length, boolean includeCooldowns, Set<Hash> alsoExclude) Select peers, additionally excluding a set the caller has decided on.ClientPeerSelector.selectSingleHop(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches) Select the single hop of a 1-hop tunnel (with hidden-inbound special case).private static voidTunnelPoolManager.setSettings(Map<Hash, TunnelPool> pools, Hash client, TunnelPoolSettings settings) Applies settings to one client's pools.private voidClientPeerSelector.sortByPeerQuality(List<Hash> peers, Set<Hash> exclude) Sort peers by quality for tunnel building preference.private voidClientPeerSelector.sortByPeerQuality(List<Hash> peers, Set<Hash> exclude) Sort peers by quality for tunnel building preference.private voidClientPeerSelector.topUpFromFastTier(ClientPeerSelector.SelectionParams params, Set<Hash> exclude, ArraySet<Hash> matches) Add Fast-tier candidates until the batch is full, used when the first hop is widening past the HighCapacity tier it started from.private voidClientPeerSelector.topUpFromFastTier(ClientPeerSelector.SelectionParams params, Set<Hash> exclude, ArraySet<Hash> matches) Add Fast-tier candidates until the batch is full, used when the first hop is widening past the HighCapacity tier it started from.private voidClientPeerSelector.topUpFromHighCapacityTier(ClientPeerSelector.SelectionParams params, Set<Hash> exclude, ArraySet<Hash> matches) Add HighCapacity-tier candidates until the batch is full.private voidClientPeerSelector.topUpFromHighCapacityTier(ClientPeerSelector.SelectionParams params, Set<Hash> exclude, ArraySet<Hash> matches) Add HighCapacity-tier candidates until the batch is full.(package private) static voidClientPeerSelector.trimToAcceptedFirstHop(ArraySet<Hash> matches, Hash accepted) Reduce a first-hop candidate batch to the single peer the quality loop accepted.Constructors in net.i2p.router.tunnel.pool with parameters of type HashModifierConstructorDescriptionBuildMessageState(RouterContext ctx, I2NPMessage m, RouterIdentity f, Hash h) Either f or h may be null, but both should be null only if we're to be a IBGW and it came from us as a OBEP.ConditionalOutboundStartup(TunnelPool out, TunnelPool in, TunnelPoolManager mgr, RouterContext context, Hash dest) Schedule a startup that is abandoned unless the pools are ready in time.DelayedPoolCleanup(Hash dest) Remove an unused client pool after the re-registration window expires.Disconnector(Hash h, String version) Force disconnect the peer on timer expiry.Disconnector(Hash h, String version) Prepares to disconnect one router.(package private)HandleReq(RouterContext ctx, BuildHandler.BuildMessageState state, BuildRequestRecord req, Hash nextPeer, AtomicBoolean decremented) Prepares to forward one build request.(package private)PendingLookup(BuildHandler.BuildMessageState state, BuildRequestRecord req, Hash nextPeer) Records a request waiting on a next-hop lookup.PooledTunnelCreatorConfig(RouterContext ctx, int length, boolean isInbound, Hash destination, TunnelPool pool) Creates a new instance of PooledTunnelCreatorConfig.(package private)PreConnectFailJob(RouterContext ctx, Hash peer) Prepares to retry a failed pre-connect session.(package private)TimeoutReq(RouterContext ctx, BuildHandler.BuildMessageState state, BuildRequestRecord req, Hash nextPeer, AtomicBoolean decremented, int retriesLeft) Prepares to time out one build request.TunnelInfoComparator(Hash target, boolean avoidZeroHop) The sort key and zero-hop handling for this comparator.Constructor parameters in net.i2p.router.tunnel.pool with type arguments of type HashModifierConstructorDescriptionClosestHopExcluder(boolean isInbound, Set<Hash> set) Automatically check if peer can connect to us (for inbound) or we can connect to it (for outbound) and add the Hash to the set if not.Does not add selectPeersInTooManyTunnels().Does not add selectPeersInTooManyTunnels().protectedExcluderBase(Set<Hash> set) Automatically check if peer is connected and add the Hash to the set if not.IBGWExcluder(Set<Hash> set) Automatically check if peer is connected and add the Hash to the set if not.OBEPExcluder(Set<Hash> set) Automatically check if peer is connected and add the Hash to the set if not.(package private)SelectionExclusions(TunnelPeerSelector.Excluder excluder, Set<Hash> exclude, int peerCooldownExcluded, int firstHopFailCount, Set<Hash> firstPeerExclusions, Set<Hash> firstHopCooldowns) Records what must not be selected in one pass.Uses of Hash in net.i2p.router.util
Methods in net.i2p.router.util with parameters of type HashModifier and TypeMethodDescriptionstatic intCompare two XOR distances without allocating BigInteger.static BigIntegerHashDistance.getDistance(Hash targetKey, Hash routerInQuestion) Compute XOR distance between two hashes.private static RouterInfoMaskedIPSet.lookupRILocally(RouterContext ctx, Hash peer) This gets the peer from the netdb without validation, for efficiency and to avoid deadlocks.Constructors in net.i2p.router.util with parameters of type HashModifierConstructorDescriptionMaskedIPSet(RouterContext ctx, Hash peer, int mask) The Set of IPs for this peer, with a given mask.MaskedIPSet(RouterContext ctx, Hash peer, RouterInfo pinfo, int mask) The Set of IPs for this peer, with a given mask.Uses of Hash in net.i2p.router.web.helpers
Classes in net.i2p.router.web.helpers that implement interfaces with type arguments of type HashModifier and TypeClassDescription(package private) classSorts in true binary order, not Base64 string order.private static classOrders router hashes by sybil points.private static classSorts peers by country then name.Fields in net.i2p.router.web.helpers declared as HashModifier and TypeFieldDescriptionprivate final HashNetDbComparators.LeaseSetRoutingKeyComparator._usThe destination whose routing key entries are being ordered.Fields in net.i2p.router.web.helpers with type parameters of type HashModifier and TypeFieldDescriptionProfileOrganizerRenderer.ProfileComparator._fastSetThe hashes of the fast peers.ProfileOrganizerRenderer.ProfileComparator._highCapSetThe hashes of the high capacity peers.SybilRenderer.PointsComparator._pointsThe points, by router hash.NetDbRenderer._renderedLeaseSetKeysLeaseSet keys already rendered for this request, so a LeaseSet stored in more than one facade is shown only once.ProfileOrganizerRenderer.ProfileSelection.fastSetSnapshot of fast-tier hashes, taken once under organizer read lock.ProfileOrganizerRenderer.ProfileSelection.highCapSetSnapshot of high-capacity-tier hashes, taken once under organizer read lock.ProfileOrganizerRenderer.ProfileSelection.integratedSetSnapshot of well-integrated hashes, taken once under organizer read lock.(package private) final ObjectCounter<Hash> TunnelRenderer.PeerRows.localCountTimes each peer appears in our local tunnels.private final TunnelRenderer.BoundedCache<Hash, String> TunnelRenderer.peerToIPCached peer to IP mappings for the tunnel graph.private final TunnelRenderer.BoundedCache<Hash, TunnelRenderer.ReverseLookupResult> TunnelRenderer.reverseLookupResultsCached reverse lookups for the tunnel graph.private final TunnelRenderer.BoundedCache<Hash, RouterInfo> TunnelRenderer.routerInfoCacheCached router infos for the tunnel graph.(package private) final ObjectCounter<Hash> TunnelRenderer.PeerRows.transitCountTimes each peer appears in our transit tunnels.TunnelRenderer.PeerRows.validPeerListPeers included in the graph.Methods in net.i2p.router.web.helpers that return HashModifier and TypeMethodDescriptionprivate HashConfigPeerHandler.getHash()Parses the peer's hash from the form.Methods in net.i2p.router.web.helpers with parameters of type HashModifier and TypeMethodDescriptionprivate voidTunnelRenderer.appendPeerIdentity(StringBuilder sb, Hash h, String hB64, String truncHash, String version, RouterInfo info, String ip, TunnelRenderer.ReverseLookupResult rl, String versionTip, String banlistedTip, String unknownLabel, boolean isBanned) Append the identity cells shared by the peer tables: country flag, router hash link, version with netdb link, tier caps, IP address, and reverse-lookup domain.private voidTunnelRenderer.appendPeerRow(StringBuilder chunkSb, Hash h, RouterInfo info, int tunnelCount, int partCount, int localTunnelCount, int transitTunnelCount, String versionTip, String unknownLabel, String configurePeerTip, String editLabel) Append one tunnel peer count row: identity cells plus local and transit tunnel bars and the edit link.private static StringClientSKMDebugHelper.clientTitle(RouterContext ctx, Destination dest, Hash h) The client's nickname when its inbound tunnel has one, otherwise the base32 destination.static intOrders two hashes by their raw data bytes, statically.intOrders two hashes by their raw data bytes.intOrders two hashes by their points, highest score first.intCompare the two countries as plain strings, substituting "zzzz" for an unknown one so it sorts after every real code.private StringStatHelper.dumpProfile(Hash peer) Dump the profile.private StringNetDbRenderer.getLocalClientNickname(Hash key) Local client nickname for a destination hash.NetDbRenderer.getPeerProfileTier(Hash peer, boolean fullname) Peer profile tier name or CSS class.TunnelRenderer.getReverseLookupInfo(Hash h, RouterInfo info, long uptime) Performs a cached reverse lookup for the given router hash and its RouterInfo, returning canonical hostname, domain, and cleaned WHOIS data if available.private StringBanlistRenderer.getRouterCaps(Hash hash) Get router capabilities string from NetDB.private StringBanlistRenderer.getRouterVersion(Hash hash, String reason) Router version for a banned hash, from NetDB or parsed out of the ban reason.booleanDetermine whether the given peer hash is banned.private static booleanProfileOrganizerRenderer.isValid(PeerProfile prof, Hash peer, Hash us, boolean requireTunnelHistory) Exclude ourself and profiles never heard from.private RouterInfoNetDbRenderer.lookupRouterInfoWithWait(NetworkDatabaseFacade networkDatabase, Hash hash, long timeout) Looks up a RouterInfo by its hash with a timeout.private StringBuilds the netdb link for one peer.private StringBuilds the country flag image for one peer.private voidSybilRenderer.renderCloseTmrwSummary(Writer out, StringBuilder buf, Analysis analysis, Hash us, double avgMinDist, List<RouterInfo> ris, Map<Hash, Points> points) Render the closest floodfills to tomorrow's routing key.private voidSybilRenderer.renderDHTSummary(Writer out, StringBuilder buf, Analysis analysis, Hash us, double avgMinDist, List<RouterInfo> ris, Map<Hash, Points> points) Render the closest floodfills to our router hash.voidNetDbRenderer.renderLeaseSetHTML(Writer out, boolean debug, Hash client) Renders all leasesets.private voidTunnelRenderer.renderPoolSummary(Writer out, TunnelPool in, TunnelPool outPool, Hash client) Render a summary table for a tunnel pool.private doubleSybilRenderer.renderRouterInfo(StringBuilder buf, RouterInfo info, Hash us, boolean isUs, boolean full) Be careful to use stripHTML for any displayed routerInfo data to prevent vulnerabilities.private voidSybilRenderer.renderRouterInfoHTML(Writer out, StringBuilder buf, Hash us, double avgMinDist, List<RouterInfo> ris) Render routers closer than MIN_CLOSE up to MAX routers.Method parameters in net.i2p.router.web.helpers with type arguments of type HashModifier and TypeMethodDescriptionprivate intTunnelRenderer.countParticipatingPerPeer(ObjectCounter<Hash> pc) Tally the transit tunnels this router participates in, counting the receive-from and send-to peer of each into pc.private intTunnelRenderer.countTunnelsPerPeer(ObjectCounter<Hash> lc) Tally the exploratory and client tunnels longer than one hop, counting each of their peers into lc.private voidSybilRenderer.renderCloseSummary(Writer out, StringBuilder buf, Analysis analysis, double avgMinDist, List<RouterInfo> ris, Map<Hash, Points> points) Render the closest floodfills to our routing key.private voidSybilRenderer.renderCloseTmrwSummary(Writer out, StringBuilder buf, Analysis analysis, Hash us, double avgMinDist, List<RouterInfo> ris, Map<Hash, Points> points) Render the closest floodfills to tomorrow's routing key.private voidSybilRenderer.renderDestSummary(Writer out, StringBuilder buf, Analysis analysis, double avgMinDist, List<RouterInfo> ris, Map<Hash, Points> points) Render the closest floodfills to our published destinations.private voidSybilRenderer.renderDHTSummary(Writer out, StringBuilder buf, Analysis analysis, Hash us, double avgMinDist, List<RouterInfo> ris, Map<Hash, Points> points) Render the closest floodfills to our router hash.private voidSybilRenderer.renderFamilySummary(Writer out, StringBuilder buf, Analysis analysis, List<RouterInfo> ris, Map<Hash, Points> points) Render the family group summary section.private voidSybilRenderer.renderIP16Summary(Writer out, StringBuilder buf, Analysis analysis, List<RouterInfo> ris, Map<Hash, Points> points) Render the /16 IP group summary.private voidSybilRenderer.renderIP24Summary(Writer out, StringBuilder buf, Analysis analysis, List<RouterInfo> ris, Map<Hash, Points> points) Render the /24 IP group summary.private voidSybilRenderer.renderIP32Summary(Writer out, StringBuilder buf, Analysis analysis, List<RouterInfo> ris, Map<Hash, Points> points) Render the /32 IP group summary.private voidSybilRenderer.renderIP48Summary(Writer out, StringBuilder buf, Analysis analysis, List<RouterInfo> ris, Map<Hash, Points> points) Render the /48 IPv6 group summary.private voidSybilRenderer.renderIP64Summary(Writer out, StringBuilder buf, Analysis analysis, List<RouterInfo> ris, Map<Hash, Points> points) Render the /64 IPv6 group summary.private voidSybilRenderer.renderIPUsSummary(Writer out, StringBuilder buf, Analysis analysis, List<RouterInfo> ris, Map<Hash, Points> points) Render the IP group summary for our own IP address.private voidSybilRenderer.renderPairSummary(Writer out, StringBuilder buf, Analysis analysis, List<RouterInfo> ris, Map<Hash, Points> points) Render the pairwise distance summary.static voidSybilRenderer.renderSybilHTML(Writer out, RouterContext ctx, List<Hash> sybils, String victim) Called from NetDbRenderer.private voidSybilRenderer.renderThreatsHTML(Writer out, StringBuilder buf, long date, Map<Hash, Points> points) Render the threats analysis HTML section.Constructors in net.i2p.router.web.helpers with parameters of type HashModifierConstructorDescriptionCreate a comparator ordering leases by their routing key entry.Constructor parameters in net.i2p.router.web.helpers with type arguments of type HashModifierConstructorDescriptionPointsComparator(Map<Hash, Points> points) Orders hashes by sybil score, most points first.(package private)ProfileComparator(Set<Hash> fastSet, Set<Hash> highCapSet) Orders the profiles for the page.Uses of Hash in net.i2p.util
Subclasses with type arguments of type Hash in net.i2p.utilModifier and TypeClassDescriptionclassThread-safe mapping from router hashes to session keys.Fields in net.i2p.util with type parameters of type HashMethods in net.i2p.util that return HashMethods in net.i2p.util with parameters of type HashModifier and TypeMethodDescriptionstatic voidStallRegistry.markStalled(Hash remote, long now) Note that a stream to this destination stopped making progress.static booleanStallRegistry.recentlyStalled(Hash remote, long now, long cooldownMs) Whether this destination was marked within the cooldown, meaning a caller may prefer a different outbound tunnel.static longHow long ago this destination was marked, clamped to the cooldown.Uses of Hash in org.klomp.snark
Fields in org.klomp.snark declared as HashModifier and TypeFieldDescriptionprivate HashI2PSnarkUtil.Unbanlist._destThe peer to unban.private final HashUDPTrackerClient._myHashHash of this client's destination.Fields in org.klomp.snark with type parameters of type HashModifier and TypeFieldDescriptionprivate final ObjectCounter<Hash> ConnectionAcceptor._badCounterBad handshakes counted per peer hash.ConnectionAcceptor._badReasonsBad handshake reasons, by peer hash.I2PSnarkUtil._banlistPeers banned for bad data.UDPTrackerClient.TrackerResponse.peersPeers returned by the reply.PeerCoordinator.swarmSeenDistinct swarm peers, keyed by destination hash, value is the last-seen wall time.Methods in org.klomp.snark that return HashModifier and TypeMethodDescriptionprivate HashTrackerClient.getHostHash(String ann) This also validates the URL.Methods in org.klomp.snark that return types with arguments of type HashMethods in org.klomp.snark with parameters of type HashModifier and TypeMethodDescriptionvoidBan the given hash.voidBan the given hash.voidBan the given hash.voidBan the given hash.voidBan the given hash.voidBan the given destination hash for the given period.booleanIs the given hash banned?booleanIs the given hash banned?booleanIs the given destination hash banned?booleanIs the given hash banned?booleanIs the given hash banned?booleanIs the given hash banned?Method parameters in org.klomp.snark with type arguments of type HashModifier and TypeMethodDescription(package private) static intTrackerInfo.getPeerCount(Set<Hash> peers, int complete, int incomplete) Compute peer count from tracker response data.TrackerInfo.getPeers(Set<Hash> hashes, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) From Hash to Peer.private booleanTrackerClient.isNewValidTracker(Set<Hash> existing, String ann) Whether the announce URL already exists in the list.Constructors in org.klomp.snark with parameters of type HashConstructor parameters in org.klomp.snark with type arguments of type HashModifierConstructorDescriptionTrackerInfo(Set<Hash> hashes, int interval, int complete, int incomplete, int downloaders, String error, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) To convert returned UDPTracker data to the standard structure.TrackerResponse(int interval, int seeds, int leeches, Set<Hash> peers) Builds a successful response from the tracker's swarm statistics.Uses of Hash in org.klomp.snark.dht
Subclasses of Hash in org.klomp.snark.dhtModifier and TypeClassDescription(package private) classRepresents a single peer participating in a specific torrent within the DHT tracker.Subclasses with type arguments of type Hash in org.klomp.snark.dhtModifier and TypeClassDescription(package private) classThread-safe collection of all peers participating in a single torrent.Fields in org.klomp.snark.dht declared as HashMethods in org.klomp.snark.dht that return HashModifier and TypeMethodDescriptionNodeInfo.calculateHash()Calculate the hash.NodeInfo.getHash()The hash.Methods in org.klomp.snark.dht that return types with arguments of type HashModifier and TypeMethodDescriptionFetch peers for a torrent.DHT.getPeersAndAnnounce(byte[] ih, int max, long maxWait, int annMax, long annMaxWait, boolean isSeed, boolean noSeeds) Fetch peers for a torrent, and announce to the closest annMax nodes we find.KRPC.getPeersAndAnnounce(byte[] ih, int max, long maxWait, int annMax, long annMaxWait, boolean isSeed, boolean noSeeds) Find peers for a torrent, announcing to the closest annMax nodes found.KRPC.receivePeers(NodeInfo nInfo, List<BEValue> peers) Receive 32-byte hashes as peer list.Methods in org.klomp.snark.dht with parameters of type HashModifier and TypeMethodDescription(package private) voidAnnounce a peer for a torrent.static NIDNodeInfo.generateNID(Hash h, int p, RandomSource random) Generate a secure NID that matches the Hash and port.(package private) voidDHTTracker.unannounce(InfoHash ih, Hash hash) Remove a peer from a torrent's peer list.Constructors in org.klomp.snark.dht with parameters of type Hash