Packages that use TunnelInfo
Package
Description
The I2P router application handles I2P network communication.
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 Kademlia distributed hash table (DHT) network database: lookup, store and explore jobs, the data store, the floodfill variants, and lookup throttling.
Peer profiles and capacity calculation, peer test jobs, peer selection for tunnel building, and the database and tunnel history used for peer selection.
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.
Helpers and handlers for the router console user interface, packaged in routerconsole.war and accessible only from JSP files.
Uses of TunnelInfo in net.i2p.router
Methods in net.i2p.router that return TunnelInfoModifier and TypeMethodDescriptionTunnelManagerFacade.selectAnyInboundTunnel()Pick a random inbound tunnel from any pool — client pools first, then exploratory.TunnelManagerFacade.selectAnyOutboundTunnel()Pick a random outbound tunnel from any pool — client pools first, then exploratory.TunnelManagerFacade.selectInboundExploratoryTunnel(Hash closestTo) Pick the inbound exploratory tunnel with the gateway closest to the given hash.TunnelManagerFacade.selectInboundTunnel()Pick a random inbound exploratory tunnel.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()Pick a random outbound exploratory tunnel.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.Methods in net.i2p.router with parameters of type TunnelInfoModifier and TypeMethodDescriptionvoidTunnelManagerFacade.forceTunnelFailure(TunnelInfo tunnel) Force a tunnel to fail immediately and trigger a replacement build.booleanTunnelManagerFacade.isValidTunnel(Hash client, TunnelInfo tunnel) Is a tunnel a valid member of the pool?voidTunnelManagerFacade.reportSendFailure(TunnelInfo tunnel, int status) Report a data-phase send failure for a specific tunnel.voidMessageHistory.tunnelJoined(String state, TunnelInfo tunnel) The local router has joined the given tunnel operating in the given state.voidMessageHistory.tunnelValid(TunnelInfo tunnel, long timeToTest) Note that we have reason to believe that the given tunnel is valid, since we could do something through it in the given amount of time.Uses of TunnelInfo in net.i2p.router.dummy
Methods in net.i2p.router.dummy that return TunnelInfoModifier and TypeMethodDescriptionDummyTunnelManagerFacade.selectAnyInboundTunnel()DummyTunnelManagerFacade.selectAnyOutboundTunnel()DummyTunnelManagerFacade.selectInboundExploratoryTunnel(Hash closestTo) DummyTunnelManagerFacade.selectInboundTunnel(Hash destination) DummyTunnelManagerFacade.selectInboundTunnel(Hash destination, Hash closestTo) DummyTunnelManagerFacade.selectOutboundExploratoryTunnel(Hash closestTo) DummyTunnelManagerFacade.selectOutboundTunnel()DummyTunnelManagerFacade.selectOutboundTunnel(Hash destination) DummyTunnelManagerFacade.selectOutboundTunnel(Hash destination, Hash closestTo) Methods in net.i2p.router.dummy with parameters of type TunnelInfoModifier and TypeMethodDescriptionvoidDummyTunnelManagerFacade.forceTunnelFailure(TunnelInfo tunnel) booleanDummyTunnelManagerFacade.isValidTunnel(Hash client, TunnelInfo tunnel) voidDummyTunnelManagerFacade.reportSendFailure(TunnelInfo tunnel, int status) Uses of TunnelInfo in net.i2p.router.message
Fields in net.i2p.router.message declared as TunnelInfoModifier and TypeFieldDescriptionprivate TunnelInfoOutboundClientMessageOneShotJob._inTunnelThe inbound tunnel the reply arrived on.private TunnelInfoOutboundClientMessageOneShotJob._outTunnelThe outbound tunnel the message was sent on.Fields in net.i2p.router.message with type parameters of type TunnelInfoModifier and TypeFieldDescription(package private) final ConcurrentHashMap<OutboundCache.HashPair, TunnelInfo> OutboundCache.backloggedTunnelCacheCache for backlogged tunnels per source-destination pair.(package private) final ConcurrentHashMap<OutboundCache.HashPair, TunnelInfo> OutboundCache.stalledTunnelCacheCache for tunnels set aside because the stream to that destination stalled.(package private) final ConcurrentHashMap<OutboundCache.HashPair, TunnelInfo> OutboundCache.tunnelCacheCache for outbound tunnels per source-destination pair.Methods in net.i2p.router.message that return TunnelInfoModifier and TypeMethodDescription(package private) static TunnelInfoOutboundCache.pickDistinctTunnel(TunnelInfo old, List<TunnelInfo> candidates, Random rnd) Choose the outbound tunnel for a fresh connection, preferring a candidate different from the one used by the previous connection to the same destination.private TunnelInfoOutboundClientMessageOneShotJob.selectFreshConnectionTunnel()Try to pick a different outbound tunnel than the one the previous connection to this destination used.private TunnelInfoOutboundClientMessageOneShotJob.selectInboundTunnel()Pick an arbitrary inbound tunnel for any deliveryStatusMessage to come back in.private TunnelInfoOutboundClientMessageOneShotJob.selectOutboundTunnel()Pick an arbitrary outbound tunnel to send the message through, or null if there aren't any aroundprivate TunnelInfoOutboundClientMessageOneShotJob.selectOutboundTunnel(Destination _to) Choose our outbound tunnel to send the message through.Methods in net.i2p.router.message with parameters of type TunnelInfoModifier 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) voidOutboundCache.clearCaches(OutboundCache.HashPair hashPair, Lease lease, TunnelInfo inTunnel, TunnelInfo outTunnel) Clears cache entries related to the provided key and elements upon failure, allowing retries with fresh associations.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.(package private) static TunnelInfoOutboundCache.pickDistinctTunnel(TunnelInfo old, List<TunnelInfo> candidates, Random rnd) Choose the outbound tunnel for a fresh connection, preferring a candidate different from the one used by the previous connection to the same destination.Method parameters in net.i2p.router.message with type arguments of type TunnelInfoModifier and TypeMethodDescriptionprivate static voidOutboundCache.cleanTunnelCache(RouterContext ctx, Map<OutboundCache.HashPair, TunnelInfo> tc) Removes invalid or expired TunnelInfo entries from the provided tunnel cache.(package private) static TunnelInfoOutboundCache.pickDistinctTunnel(TunnelInfo old, List<TunnelInfo> candidates, Random rnd) Choose the outbound tunnel for a fresh connection, preferring a candidate different from the one used by the previous connection to the same destination.Uses of TunnelInfo in net.i2p.router.networkdb.kademlia
Fields in net.i2p.router.networkdb.kademlia declared as TunnelInfoModifier and TypeFieldDescriptionprivate final TunnelInfoSearchUpdateReplyFoundJob._outTunnelThe tunnel the request was sent through.private final TunnelInfoSearchUpdateReplyFoundJob._replyTunnelThe tunnel the reply came back through.private final TunnelInfoStoreJob.SendSuccessJob._sendThroughThe tunnel used for sending (null for direct).Methods in net.i2p.router.networkdb.kademlia with parameters of type TunnelInfoModifier and TypeMethodDescriptionprivate DatabaseLookupMessageFloodfillVerifyStoreJob.buildLookup(TunnelInfo replyTunnelInfo) Builds the database lookup message for verification.Constructors in net.i2p.router.networkdb.kademlia with parameters of type TunnelInfoModifierConstructorDescriptionSearchUpdateReplyFoundJob(RouterContext context, RouterInfo peer, SearchState state, KademliaNetworkDatabaseFacade facade, SearchJob job, TunnelInfo outTunnel, TunnelInfo replyTunnel) Create job with tunnel info for reply routing.SendSuccessJob(RouterContext enclosingContext, RouterInfo peer, TunnelInfo sendThrough, int size) Create a success job for tunnel delivery.Uses of TunnelInfo in net.i2p.router.peermanager
Fields in net.i2p.router.peermanager declared as TunnelInfoModifier and TypeFieldDescriptionprivate final TunnelInfoPeerTestJob.PeerReplyFoundJob._replyTunnelThe tunnel the reply arrived on.private final TunnelInfoPeerTestJob.PeerReplyTimeoutJob._replyTunnelThe tunnel the reply was expected on.private final TunnelInfoPeerTestJob.PeerReplyFoundJob._sendTunnelThe tunnel the test was sent on.private final TunnelInfoPeerTestJob.PeerReplyTimeoutJob._sendTunnelThe tunnel the test was sent on.Methods in net.i2p.router.peermanager that return TunnelInfoModifier and TypeMethodDescriptionprivate TunnelInfoPeerTestJob.getInboundTunnelId()What tunnel will we get replies through?private TunnelInfoPeerTestJob.getOutboundTunnelId()What tunnel will we send the test out through?Constructors in net.i2p.router.peermanager with parameters of type TunnelInfoModifierConstructorDescriptionPeerReplyFoundJob(RouterContext context, RouterInfo peer, TunnelInfo replyTunnel, TunnelInfo sendTunnel) Starts the clock when the tested peer's reply arrived.PeerReplyTimeoutJob(RouterContext context, RouterInfo peer, TunnelInfo replyTunnel, TunnelInfo sendTunnel, PeerTestJob.ReplySelector sel) Schedules timeout handling when no reply arrived in time.Uses of TunnelInfo in net.i2p.router.tunnel
Classes in net.i2p.router.tunnel that implement TunnelInfoModifier and TypeClassDescriptionclassCoordinate the info that the tunnel creator keeps track of, including what peers are in the tunnel and what their configuration isUses of TunnelInfo in net.i2p.router.tunnel.pool
Classes in net.i2p.router.tunnel.pool that implement TunnelInfoClasses in net.i2p.router.tunnel.pool that implement interfaces with type arguments of type TunnelInfoModifier and TypeClassDescriptionprivate static classFind the tunnel with the far-end that is XOR-closest to a given hash.Fields in net.i2p.router.tunnel.pool declared as TunnelInfoModifier and TypeFieldDescriptionprivate TunnelInfoTestJob._excludedPartnerThe partner whose failure triggered the current confirmation.private TunnelInfoTestJob._outTunnelThe outbound tunnel carrying the test.private TunnelInfoTestJob._replyTunnelThe inbound tunnel expected to carry the reply.(package private) final TunnelInfoTunnelPool.ScanResult.backloggedA tunnel held back for backlog, used if needed.(package private) final TunnelInfoTunnelPool.ScanResult.chosenThe tunnel selected for a lease.(package private) final TunnelInfoTunnelPool.ScanResult.lastResortA tunnel used only when nothing better exists.(package private) final TunnelInfoTunnelPool.LeaseTunnels.zeroHopA zero-hop tunnel, used only if the good list is short.Fields in net.i2p.router.tunnel.pool with type parameters of type TunnelInfoModifier and TypeFieldDescriptionprivate final List<TunnelInfo> TunnelPool._tunnelsThe pool's live tunnels.private static final Comparator<TunnelInfo> TunnelPool.EXPIRATION_COMPARATORSorts tunnel infos by expiration, soonest first.(package private) final List<TunnelInfo> TunnelPool.LeaseTunnels.goodThe tunnels chosen for the lease set.(package private) static final Comparator<TunnelInfo> TunnelPool.QUALITY_COMPARATORBest tunnels first for LeaseSet publication: freshest (longest remaining life) so the lease survives floodfill propagation, then lowest average latency, then fewest consecutive failures.Methods in net.i2p.router.tunnel.pool that return TunnelInfoModifier and TypeMethodDescriptionprivate TunnelInfoTestJob.currentPartner()The partner the current round was actually routed through.private TunnelInfoTunnelPool.findBestDegradedTunnel(List<TunnelInfo> tunnels, boolean isServerPool) Find the best degraded tunnel from a given list for emergency LS fallback.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 TunnelInfoTunnelPool.findReplacee()Find a tunnel that can be replaced: FAILED, or FAILING for non-server pools.(package private) static TunnelInfoTunnelPool.findReusableCandidate(List<TunnelInfo> tunnels, int len, long now, int idx) Scan the tunnel list from the given index for a reusable tunnel.private TunnelInfoTunnelPool.findReusableCandidateLocked(int len, long now, int idx) TunnelPool.findReusableCandidate(List, int, long, int)with the pool lock held, so the scan sees a stable tunnel list.private TunnelInfoTunnelPool.findReusedPredecessor(TunnelInfo successor) The active tunnel whose peer set matches the given newly built tunnel (matched by exact gateway-first peer-list equality), or null.Tunnel by its gateway tunnel ID.private TunnelInfoTunnelPool.handleBacklogged(TunnelPool.ScanResult pass) Handle a pass whose chosen tunnel was null but which recorded a backlogged candidate: warn and fall back to it.private TunnelInfoTunnelPool.pickAnyNonExpiredTunnel(long now) Pick any live tunnel from the pool, expired ones excluded.private TunnelInfoTunnelPool.pickDegradedTunnel(long now) Last-resort scan: accept any non-expired tunnel, even one over the consecutive-failure cap.TunnelPoolManager.selectAnyInboundTunnel()Pick a random inbound tunnel from any pool — client pools first, then exploratory.TunnelPoolManager.selectAnyOutboundTunnel()Pick a random outbound tunnel from any pool — client pools first, then exploratory.private TunnelInfoTunnelPool.selectFromPool(long now, long uptime, boolean avoidZeroHop) One selection pass over the pool: normal scan (long tunnels only when avoiding zero-hop), then backlogged/last-resort, then degraded.TunnelPoolManager.selectInboundExploratoryTunnel(Hash closestTo) Pick the inbound exploratory tunnel with the gateway closest to the given hash.TunnelPoolManager.selectInboundTunnel()Pick a random inbound exploratory tunnel.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()Pick a random outbound exploratory tunnel.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.private static TunnelInfoBuildRequestor.selectPairedTunnel(RouterContext ctx, TunnelPool pool, PooledTunnelCreatorConfig cfg, BuildExecutor exec, Log log) Selects an appropriate tunnel for sending the build reply.(package private) TunnelInfoAliasedTunnelPool.selectTunnel()(package private) TunnelInfoAliasedTunnelPool.selectTunnel(Hash closestTo) (package private) TunnelInfoTunnelPool.selectTunnel()Pull a random tunnel out of the pool.private TunnelInfoTunnelPool.selectTunnel(boolean allowRecurseOnFail) Select a tunnel for use, falling back to last-resort and degraded tunnels, then to a fresh zero-hop build, then to a retry.(package private) TunnelInfoTunnelPool.selectTunnel(Hash closestTo) Return the tunnel from the pool that is XOR-closest to the target.(package private) TunnelInfoTunnelPool.selectTunnelForTest()Select a tunnel to serve as a test round's partner, preferring partners that have demonstrated they work.private TunnelInfoTunnelPool.useLastResortOrBacklogged(TunnelInfo lastResort, TunnelInfo backlogged, long uptime) Prefer the recorded last-resort tunnel, then the backlogged fallback, when a scan pass found nothing better.Methods in net.i2p.router.tunnel.pool that return types with arguments of type TunnelInfoModifier and TypeMethodDescriptionprivate java.util.function.Predicate<TunnelInfo> TunnelPool.backlogTest()Backlog predicate matching the oneTunnelPool.scanPoolForTunnel(int, long, boolean, TunnelInfo)applies.private List<TunnelInfo> TunnelPool.collectNonPublishedTunnels(Set<Hash> publishedGateways, int latencyThreshold, long now) Scan for GOOD tunnels not included in the published LeaseSet.private List<TunnelInfo> TunnelPool.collectTrafficProvenUntested(List<TunnelInfo> tunnels, long expireAfter) UNTESTED tunnels that have verified delivering real inbound data recently.private List<TunnelInfo> TunnelPool.keepBestReserve(List<TunnelInfo> toRemove, int toPrune) Keep the reserve tunnels with the fewest failures, drop the worsttoPrune.(package private) static List<TunnelInfo> TunnelPool.leaseSurgeCandidates(List<TunnelInfo> tunnels, List<TunnelInfo> toRemove, long now) Tunnels a lease surge may schedule for early expiry: GOOD, past the lease admission floor (so they can no longer be advertised), not already being pruned, and not recently active.AliasedTunnelPool.listTunnels()TunnelPool.listTunnels()List of tunnels currently in the pool.Methods in net.i2p.router.tunnel.pool with parameters of type TunnelInfoModifier and TypeMethodDescriptionprivate booleanTunnelPool.addOrReplaceTunnel(TunnelInfo info, TunnelId gatewayId, long now, int usable, int maxUsable, int target) Add the tunnel unless the pool is at capacity; at capacity try replacing a non-GOOD tunnel instead of dropping the new build.protected voidAliasedTunnelPool.addTunnel(TunnelInfo info) protected voidTunnelPool.addTunnel(TunnelInfo info) Add a tunnel to the pool.private voidTunnelPool.analyzeFailurePattern(TunnelInfo cfg) Analyze tunnel failure patterns to identify root causes and suggest recovery strategies.private voidTestJob.attributeRoundToReplyPartner(boolean inbound, TunnelInfo replyPartner, boolean failed) Tally this round's result against the peer that relayed the reply.private booleanTestJob.beginConfirmationRound(TunnelInfo partner) Arm a confirming round: mark the failure as unconfirmed, remember the partner that must not be reused, and schedule the round ASAP.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 LeaseTunnelPool.buildLeaseFromTunnel(TunnelInfo cfg) Build a Lease from a single tunnel's gateway.TunnelPool.buildLeases(List<TunnelInfo> goodTunnels, TunnelInfo zeroHopTunnel) Assemble the Lease objects for the selected tunnels: the single zero-hop lease (if any), then the quality-sorted GOOD tunnels.private voidTunnelPool.clearLostSession(TunnelInfo t) Clear the missing-session timestamp when the session is back, so a tunnel that reconnects does not carry a duration towards its next loss.intTunnelPool.TunnelInfoComparator.compare(TunnelInfo lhs, TunnelInfo rhs) Compare tunnels by XOR distance to the target.private static intTunnelPool.compareAvgLatency(TunnelInfo a, TunnelInfo b) Latency ascending, tunnels with no measurements sort last.private intTunnelPool.computeBlamePct(TunnelInfo cfg, int i, int len, int start, int consecutiveFailures) Compute the blame percentage for a peer in a failed tunnel.private voidTunnelPool.countLiveTunnel(TunnelInfo t, TunnelPool.TunnelStats stats, long preBuildThreshold) Count a live non-UNTESTED tunnel: safe when it outlives the pre-build window, else near expiry.private StringTunnelPool.countZombieTransport(TunnelInfo t) Attribute one zombie exclusion to the transport its local hop used.private static TunnelBuildMessageBuildRequestor.createTunnelBuildMessage(RouterContext ctx, TunnelPool pool, PooledTunnelCreatorConfig cfg, TunnelInfo pairedTunnel, BuildExecutor exec) Creates a tunnel build message using the most efficient format supported by all hops and the local router.private static StringTunnelPool.describeHops(TunnelInfo cfg) Name the hops of a failed tunnel so a data-phase failure is attributable.private voidTunnelPool.fail(TunnelInfo cfg) Marks a tunnel as failed and schedules its replacement.private voidTunnelPool.failWithCount(TunnelInfo cfg, int failures) Mark a failing tunnel for retention using the count that triggered the decision.private TunnelInfoTunnelPool.findReusedPredecessor(TunnelInfo successor) The active tunnel whose peer set matches the given newly built tunnel (matched by exact gateway-first peer-list equality), or null.(package private) static booleanTestJob.firstReadingPending(TunnelInfo cfg) Whether a tunnel has never produced a latency reading, i.e.voidTunnelPool.forceTunnelFailure(TunnelInfo cfg) Force a tunnel to fail immediately and trigger a replacement build.voidTunnelPoolManager.forceTunnelFailure(TunnelInfo tunnel) Force a tunnel to fail immediately and trigger a replacement build.private TunnelIdTunnelPool.getGatewayTunnelId(TunnelInfo info) The tunnel ID used to dedupe additions: receive side for inbound pools, send side for outbound.(package private) static intTunnelPool.getTunnelAvgLatency(TunnelInfo t) Average test latency for a tunnel.private static booleanBuildRequestor.handleInboundBuild(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelInfo pairedTunnel, I2NPMessage msgIn, BuildExecutor exec, Log log) Dispatch an inbound build request through the paired tunnel, garlic-wrapping the ShortTBM when the IBGW differs from the paired tunnel's endpoint so the IBGW identity stays hidden.private static voidBuildRequestor.handleOutboundBuild(RouterContext ctx, PooledTunnelCreatorConfig cfg, TunnelInfo pairedTunnel, I2NPMessage msg, BuildExecutor exec, Log log, long firstHopTimeout) Builds and sends the records for one outbound tunnel.private voidTunnelPool.handleStaleUntested(Iterator<TunnelInfo> it, TunnelInfo t, TunnelPool.TunnelStats stats, long now, long wallNow, long preBuildThreshold) Handle an UNTESTED tunnel: a tunnel still UNTESTED within the pre-build window (expiring in < 3 min) is stuck — the test queue never reached it (saturated) or it was abandoned after a pool reset.private booleanTunnelPool.hasInboundGateway(TunnelInfo tunnel) Whether the tunnel has the required inbound gateway and tunnel ID.private booleanTunnelPool.isBackloggedNextHop(TunnelInfo t) Whether the tunnel's next hop is backlogged, meaning congested.private booleanTunnelPool.isBetterDegradedCandidate(TunnelInfo best, TunnelInfo t, int bestFailures, int failures) Whether the tunnel beats the current best: fewer consecutive failures, or equal failures with a later expiration.private booleanTunnelPool.isDuplicateInPool(TunnelInfo info, TunnelId gatewayId) Reject re-adds of the same object (buildComplete called twice) and different objects with the same gateway tunnel ID.private booleanTunnelPool.isEligibleDegradedCandidate(TunnelInfo t, boolean isServerPool, long now) Whether the tunnel may be replaced as a degraded candidate.private booleanTunnelPool.isEligibleForLease(TunnelInfo tunnel, boolean hasGoodTunnel, long expireAfter) Whether the tunnel may be included in the LeaseSet: not failed, GOOD (or UNTESTED when no GOOD exists), and expiring after the propagation deadline.private booleanTunnelPool.isLocalHopUnreachable(TunnelInfo t) Whether this tunnel's local path is unusable because we hold no transport session to the peer we actually send through.private booleanTunnelPool.isLongEnoughLived(TunnelInfo info, long now) Only keep tunnels that outlive the 60s add window.private booleanTunnelPool.isProtectedFromPruning(TunnelInfo info, boolean isServerPool, long now) A tunnel is protected from pruning if it is a server-pool GOOD or FAILING tunnel, is actively carrying traffic (non-exploratory pools only.private booleanTunnelPool.isProtectedInUse(TunnelInfo t, long wallNow) Whether an UNTESTED tunnel expiring within the pre-build window is protected: it recently carried verified traffic.private booleanTunnelPool.isPrunableNonGood(TunnelInfo t, boolean isServerPool) True for tunnels that should be pruned: FAILED/FAILING/unknown-status or failed in test.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 booleanTunnelPool.isRecentlyAddedDuplicate(TunnelInfo info, TunnelId gatewayId, long now) Check the recent-additions map for a duplicate gateway ID, cleaning stale entries so the map cannot grow unbounded.(package private) static booleanTunnelPool.isSoftDegraded(TunnelInfo t) Whether the tunnel is soft-degraded for ensure/deficit purposes: still in the pool and not FAILING, but soft failures have reachedTunnelPool.SOFT_DEGRADED_FOR_ENSURE.(package private) static booleanTunnelPool.isTrafficProvenUntestedLeaseCandidate(TunnelInfo tunnel, long expireAfter, long now) Whether an inbound UNTESTED tunnel has verified delivering real data recently enough to be published as a lease.booleanTunnelPoolManager.isValidTunnel(Hash client, TunnelInfo tunnel) Check if a tunnel is valid and belongs to the client's pool.private static longTunnelPool.leaseKeyOf(TunnelInfo tunnel) The identity a lease for this tunnel is keyed on: its receive tunnel id.private HashTunnelPool.localHop(TunnelInfo t) The peer whose transport session this tunnel sends through, or null when there is none.private StringTunnelPool.localHopTransportBucket(TunnelInfo t) The transport a tunnel's local hop uses, folded to one of the known names.(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.private voidTestJob.noteSuccess(long ms, TunnelInfo tunnel) Records a successful round trip and its time.(package private) static intTunnelPool.partnerPreferenceTier(TunnelInfo info) Rank a candidate test partner; lower is better.(package private) static booleanTunnelPool.passesScanGates(TunnelInfo info, long now, boolean longTunnelsOnly) Whether a pooled tunnel passes the scan eligibility gates: not failed, not over the consecutive-test-failure cap (test failures are often reply-path problems, not tunnel quality), non-expired, and — on the first pass.TunnelPool.peersEndpointFirst(TunnelInfo ti) The tunnel's peers, endpoint first, the order selectPeers() returns them in.private voidTestJob.probeFarEndpoint(TunnelInfo cfg) Probe the far endpoint of a tunnel whose test round just failed, and record whether it was still reachable.private voidTunnelPool.publishLeaseSetIfNeeded(TunnelInfo info, LeaseSet ls, long now) Publish a freshly-built LeaseSet, bypassing the refresh throttle when the pool is nearly empty AND the published LeaseSet is missing or expiring soon.private voidTunnelPool.recordPooledActivity(TunnelInfo info) Record activity on a pooled tunnel (no-op for non-pooled).(package private) static voidTestJob.recordTestRoundBytes(TunnelInfo outTunnel) Credit a completed test round's bytes to the tunnel that carried it, for the per-peer throughput profile only.private voidTunnelPool.removeFromDispatcherAndExpiration(TunnelInfo info) Remove a tunnel config from the dispatcher and the expiration queue, in that order.private voidTunnelPool.removeRotatedOutTunnel(TunnelInfo rotated) Remove a rotated-out tunnel from the pool.(package private) voidAliasedTunnelPool.removeTunnel(TunnelInfo info) (package private) voidTunnelPool.removeTunnel(TunnelInfo info) Remove a tunnel from the pool.private voidTunnelPool.removeTunnelFromPool(Iterator<TunnelInfo> it, TunnelInfo t) Remove a tunnel from the pool and, if it is a build config, from the dispatcher and the expiry map as well.(package private) booleanTunnelPool.removeTunnelSynchronous(TunnelInfo info) Synchronous tunnel removal for use during recovery or critical situations.private booleanTunnelPool.replaceNonGoodTunnel(TunnelInfo info, TunnelId gatewayId, long now, int usable, int maxUsable, int target) At capacity, swap the new tunnel in for the first replaceable one — only FAILED tunnels (or FAILING for non-server pools).private booleanTunnelPool.replaceZeroHopCandidate(TunnelInfo zeroHopTunnel, TunnelInfo tunnel) Whether the tunnel replaces the current zero-hop candidate: it expires later.(package private) static doubleTestJob.replyPartnerFailureRate(Map<Hash, long[]> tally, TunnelInfo replyPartner) Failure rate of a reply partner: failures divided by rounds it carried.(package private) voidTunnelPool.reportSendFailure(TunnelInfo cfg, int status) Report a data-phase dispatch failure for a tunnel in this pool.voidTunnelPoolManager.reportSendFailure(TunnelInfo tunnel, int status) Report a data-phase send failure for a specific outbound tunnel.private TunnelPool.ScanResultTunnelPool.scanPoolForTunnel(int startIdx, long now, boolean longTunnelsOnly, TunnelInfo lastResortTunnel) Scan the pool from a random start index for a usable tunnel.private booleanTunnelPool.shouldAnalyzeFailure(TunnelInfo cfg) Determine if we should perform detailed failure analysis Only analyze every Nth failure to avoid excessive processing.(package private) static booleanTestJob.shouldDeferForPartner(TunnelInfo partner, boolean partnerFallback) Whether a failed round should be deferred instead of charged to the tunnel under test, because the partner tunnel — the one the round was actually routed through — is itself suspect.private voidTunnelPool.stampLostSession(TunnelInfo t, long now) Record that this tunnel's local transport session was seen missing, keeping the first observation as the start of the duration.private voidTunnelPool.swapInReplacement(TunnelInfo replacee, TunnelInfo info, TunnelId gatewayId, long now) Swap the replacement into the pool and record it as recently added.private voidTunnelPool.tellProfileFailed(TunnelInfo cfg) Blame all peers in tunnel, with a probability inversely related to tunnel length Enhanced with intelligent blame distribution and recovery consideration.(package private) voidAliasedTunnelPool.tunnelFailed(TunnelInfo cfg) (package private) voidAliasedTunnelPool.tunnelFailed(TunnelInfo cfg, Hash blamePeer) (package private) voidTunnelPool.tunnelFailed(TunnelInfo cfg) Remove tunnel and blame all peers (not necessarily equally).(package private) voidTunnelPool.tunnelFailed(TunnelInfo cfg, Hash blamePeer) Remove the tunnel and blame only one peer.(package private) voidTunnelPool.tunnelFailedWithoutBlame(TunnelInfo cfg) Mark a tunnel failed without blaming any peer.private booleanTestJob.usablePartner(TunnelInfo t) Whether a candidate partner is usable for this round, i.e.(package private) static booleanTestJob.usablePartner(TunnelInfo candidate, TunnelInfo excluded) Whether a candidate partner may carry the confirming round.private TunnelInfoTunnelPool.useLastResortOrBacklogged(TunnelInfo lastResort, TunnelInfo backlogged, long uptime) Prefer the recorded last-resort tunnel, then the backlogged fallback, when a scan pass found nothing better.Method parameters in net.i2p.router.tunnel.pool with type arguments of type TunnelInfoModifier and TypeMethodDescriptionprivate voidTunnelPool.addDegradedFallbackLease(TreeSet<Lease> leases, List<TunnelInfo> tunnels, boolean isServerPool) Emergency fallback: when the LeaseSet has no leases but one has been published before, add the best degraded tunnel so clients don't lose the destination.TunnelPool.buildLeases(List<TunnelInfo> goodTunnels, TunnelInfo zeroHopTunnel) Assemble the Lease objects for the selected tunnels: the single zero-hop lease (if any), then the quality-sorted GOOD tunnels.private LeaseSetTunnelPool.buildNewLeaseSetFromTunnels(List<TunnelInfo> tunnels, boolean isServerPool, boolean rotateForPropagation, List<TunnelInfo> rotatedOut) Build a LeaseSet from a list of tunnels.(package private) static TunnelPool.PoolStateTunnelPool.classifyPoolState(List<TunnelInfo> tunnels, long now, java.util.function.Predicate<TunnelInfo> backlogged) Count the pool by selection outcome.(package private) static TunnelPool.PoolStateTunnelPool.classifyPoolState(List<TunnelInfo> tunnels, long now, java.util.function.Predicate<TunnelInfo> backlogged) Count the pool by selection outcome.private TunnelPool.LeaseTunnelsTunnelPool.collectLeaseTunnels(List<TunnelInfo> tunnels, long expireAfter, boolean hasGoodTunnel) Select the tunnels that qualify for a LeaseSet: GOOD tunnels (or UNTESTED fallback when no GOOD exists.private List<TunnelInfo> TunnelPool.collectTrafficProvenUntested(List<TunnelInfo> tunnels, long expireAfter) UNTESTED tunnels that have verified delivering real inbound data recently.private intTunnelPool.computeNonGoodReserve(List<TunnelInfo> toRemove, int goodCount) LS fallback reserve to keep among the pruned candidates.(package private) static BuildExecutor.ExpiryBucketsBuildExecutor.countExpiryBuckets(List<TunnelInfo> tunnels, long now) Count a pool's tunnels into cumulative expiry-window buckets.(package private) static intTunnelPool.countLeaseViableTunnels(List<TunnelInfo> tunnels, List<TunnelInfo> toRemove, long now) How many tunnels could still be advertised right now, on the same barselectLeaseTunnelsapplies, matching the wording of the sibling prune path.private voidTunnelPool.countLocalHopTransports(List<TunnelInfo> tunnels) Count the local hop's transport for every tunnel in the walk.private TunnelInfoTunnelPool.findBestDegradedTunnel(List<TunnelInfo> tunnels, boolean isServerPool) Find the best degraded tunnel from a given list for emergency LS fallback.(package private) static TunnelInfoTunnelPool.findReusableCandidate(List<TunnelInfo> tunnels, int len, long now, int idx) Scan the tunnel list from the given index for a reusable tunnel.private voidTunnelPool.handleStaleUntested(Iterator<TunnelInfo> it, TunnelInfo t, TunnelPool.TunnelStats stats, long now, long wallNow, long preBuildThreshold) Handle an UNTESTED tunnel: a tunnel still UNTESTED within the pre-build window (expiring in < 3 min) is stuck — the test queue never reached it (saturated) or it was abandoned after a pool reset.private booleanTunnelPool.hasGoodTunnel(List<TunnelInfo> tunnels, long expireAfter) Whether any tunnel in the list is GOOD and expiring after the propagation deadline — gates the UNTESTED fallback.private List<TunnelInfo> TunnelPool.keepBestReserve(List<TunnelInfo> toRemove, int toPrune) Keep the reserve tunnels with the fewest failures, drop the worsttoPrune.(package private) static List<TunnelInfo> TunnelPool.leaseSurgeCandidates(List<TunnelInfo> tunnels, List<TunnelInfo> toRemove, long now) Tunnels a lease surge may schedule for early expiry: GOOD, past the lease admission floor (so they can no longer be advertised), not already being pruned, and not recently active.private intTunnelPool.markExcessTunnels(List<TunnelInfo> toRemove, boolean isServerPool, int goodTarget, long now, int toPrune) Mark excess tunnels for early expiry, down to the prune threshold.private voidTunnelPool.markFailedTunnelsForEarlyExpiry(List<TunnelInfo> toRemove, int target, long now) Mark completely failed tunnels for early expiry (all pool types).private voidTunnelPool.markRotatedOut(Lease rotated, List<TunnelInfo> tunnels, List<TunnelInfo> rotatedOut) Record the tunnel matching the rotated lease as rotated out so the build path can exclude it from the next LeaseSet.private voidTunnelPool.processRemovalStats(List<TunnelInfo> removed) Process removal statistics for removed tunnels.private voidTunnelPool.pruneExcessGoodTunnels(List<TunnelInfo> toRemove, int toPrune, long now) Fallback prune for non-server pools: when only GOOD tunnels remain to prune, mark the soonest-expiring GOOD tunnels for early expiry, skipping tunnels actively carrying traffic.private voidTunnelPool.pruneForLeaseSurge(List<TunnelInfo> toRemove, int leaseSurge, long now) Schedule early expiry for the least lease-material GOOD tunnels while a lease surge is active.private voidTunnelPool.pruneOverBudget(List<TunnelInfo> toRemove, boolean isServerPool, long now, int currentSize, int pruneThreshold) When the pool exceeds the prune threshold, mark excess tunnels for early expiry, preferring GOOD tunnels for non-server pools.private voidTunnelPool.pruneOverReserve(List<TunnelInfo> toRemove, int goodCount) Prune the non-GOOD tunnels down to the LS fallback reserve, keeping the best (fewest failures), then refresh the published LeaseSet.private voidTunnelPool.removeTunnelFromPool(Iterator<TunnelInfo> it, TunnelInfo t) Remove a tunnel from the pool and, if it is a build config, from the dispatcher and the expiry map as well.private voidTunnelPool.removeTunnelsBatch(List<TunnelInfo> toRemove) Remove tunnels from the pool in one batch under the lock, then update stats outside the lock.private voidTunnelPool.reportZombies(String stat, int kept, List<TunnelInfo> zombies) Record how many tunnels the health counts excluded for want of a local transport session, alongside the count that survived the filter.private voidTunnelPool.rotateOldestLeaseForPropagation(TreeSet<Lease> leases, List<TunnelInfo> tunnels, List<TunnelInfo> rotatedOut) Rotate out the oldest lease when its end time matches the previous publication's earliest end time, so floodfill peers see wasNew=true and propagate the LeaseSet onward.Constructors in net.i2p.router.tunnel.pool with parameters of type TunnelInfoModifierConstructorDescription(package private)LeaseTunnels(List<TunnelInfo> good, TunnelInfo zeroHop) Holds the tunnels picked for a lease set.(package private)ScanResult(TunnelInfo chosen, TunnelInfo backlogged, TunnelInfo lastResort) Holds one pass over the tunnel list.Constructor parameters in net.i2p.router.tunnel.pool with type arguments of type TunnelInfoModifierConstructorDescription(package private)LeaseTunnels(List<TunnelInfo> good, TunnelInfo zeroHop) Holds the tunnels picked for a lease set.Uses of TunnelInfo in net.i2p.router.web.helpers
Classes in net.i2p.router.web.helpers that implement interfaces with type arguments of type TunnelInfoModifier and TypeClassDescriptionprivate static classSorts tunnel infos for the display.Methods in net.i2p.router.web.helpers with parameters of type TunnelInfoModifier and TypeMethodDescriptionprivate voidTunnelRenderer.appendPeerCells(StringBuilder buf, TunnelInfo info, int length, int maxLength, boolean isAdvanced, String localHopTip, String localLabel, String tunnelIdTip) Append the peer cells for one tunnel: the local hop renders as a "Local" badge with the tunnel id when advanced mode is on, other hops render as netdb links with their tunnel ids.intTunnelRenderer.TunnelInfoComparator.compare(TunnelInfo l, TunnelInfo r) private voidTunnelRenderer.renderTestStatus(StringBuilder buf, TunnelInfo info) Append the tunnel test status cell, with the status-specific tooltip.private intTunnelRenderer.renderTunnelRow(StringBuilder buf, TunnelInfo info, long timeLeft, int maxLength, String tib, String tob, String localHopTip, String localLabel, String tunnelIdTip) Append one tunnel row: direction badge, test status, expiry bar, latency, data transferred, and the peer cells.