Package net.i2p.router.tunnel.pool
Class TunnelPeerSelector
java.lang.Object
net.i2p.router.tunnel.pool.ConnectChecker
net.i2p.router.tunnel.pool.TunnelPeerSelector
- Direct Known Subclasses:
- ClientPeerSelector,- ExploratoryPeerSelector
Coordinate the selection of peers to go into a tunnel for one particular
 pool.
- 
Field SummaryFields inherited from class net.i2p.router.tunnel.pool.ConnectCheckerANY_V4, ctx, log
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleancheckTunnel(boolean isInbound, List<Hash> tunnel) Connectivity check.protected booleanfilterSlow(boolean isInbound, boolean isExploratory) do we want to skip peers that are slow?getClosestHopExclude(boolean isInbound) Pick peers that we want to avoid for the first OB hop or last IB hop.getExclude(boolean isInbound, boolean isExploratory) Pick peers that we want to avoidprotected intgetLength(TunnelPoolSettings settings) protected booleanAre we IPv6 only?protected voidorderPeers(List<Hash> rv, SessionKey key) see HashComparatorselectExplicit(TunnelPoolSettings settings, int length) For debugging, also possibly for restricted routes? Needs analysis and testingselectPeers(TunnelPoolSettings settings) Which peers should go into the next tunnel for the given settings?static booleanshouldExclude(RouterContext ctx, RouterInfo peer) warning, this is also called by ProfileOrganizer.isSelectable()protected booleanshouldSelectExplicit(TunnelPoolSettings settings) For debugging, also possibly for restricted routes? Needs analysis and testingMethods inherited from class net.i2p.router.tunnel.pool.ConnectCheckercanConnect, canConnect, canConnect, getInboundMask, getOutboundMask, isNTCPDisabled, isSSUDisabled
- 
Constructor Details- 
TunnelPeerSelector
 
- 
- 
Method Details- 
selectPeersWhich peers should go into the next tunnel for the given settings?- Returns:
- ordered list of Hash objects (one per peer) specifying what order they should appear in a tunnel (ENDPOINT FIRST). This includes the local router in the list. If there are no tunnels or peers to build through, and the settings reject 0 hop tunnels, this will return null.
 
- 
getLength- Returns:
- randomized number of hops 0-7, not including ourselves
 
- 
shouldSelectExplicitFor debugging, also possibly for restricted routes? Needs analysis and testing- Returns:
- usually false
 
- 
selectExplicitFor debugging, also possibly for restricted routes? Needs analysis and testing- Returns:
- the peers
 
- 
getExcludePick peers that we want to avoid
- 
isIPv6Onlyprotected boolean isIPv6Only()Are we IPv6 only?- Since:
- 0.9.34
 
- 
getClosestHopExcludePick peers that we want to avoid for the first OB hop or last IB hop. There's several cases of importance:- Inbound and we are hidden - Exclude all unless connected. This is taken care of in ClientPeerSelector and TunnelPeerSelector selectPeers(), not here.
- We are IPv6-only. Exclude all v4-only peers, unless connected This is taken care of here.
- We have NTCP or SSU disabled. Exclude all incompatible peers, unless connected This is taken care of here.
- Minimum version check, if we are some brand-new sig type, or are using some new tunnel build method. Not currently used, but this is where to implement the checks if needed. Make sure that ClientPeerSelector and TunnelPeerSelector selectPeers() call this when needed.
 - Parameters:
- isInbound-
- Returns:
- null if none
- Since:
- 0.9.17
 
- 
shouldExcludewarning, this is also called by ProfileOrganizer.isSelectable()
- 
filterSlowprotected boolean filterSlow(boolean isInbound, boolean isExploratory) do we want to skip peers that are slow?- Returns:
- true unless configured otherwise
 
- 
orderPeerssee HashComparator
- 
checkTunnelConnectivity check. Check that each hop can connect to the next, including us. Check that the OBEP is not IPv6-only, and the IBGW is reachable and not hidden or IPv6-only. Tells the profile manager to blame the hop, and returns false on failure.- Parameters:
- tunnel- ENDPOINT FIRST, GATEWAY LAST!!!!, length 2 or greater
- Returns:
- ok
- Since:
- 0.9.34
 
 
-