public abstract class TunnelPeerSelector extends ConnectChecker
Modifier and Type | Class and Description |
---|---|
protected class |
TunnelPeerSelector.Excluder
A Set of Hashes that automatically adds to the
Set in the contains() check.
|
ANY_V4, ctx, log
Modifier | Constructor and Description |
---|---|
protected |
TunnelPeerSelector(RouterContext context) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowAsIBGW(Hash h)
Should we allow as IBGW?
This just checks for the "R" capability and IPv4 support.
|
protected boolean |
allowAsOBEP(Hash h)
Should we allow as OBEP?
This just checks for IPv4 support.
|
protected boolean |
checkTunnel(boolean isInbound,
boolean isExploratory,
List<Hash> tunnel)
Connectivity check.
|
protected boolean |
filterSlow(boolean isInbound,
boolean isExploratory)
do we want to skip peers that are slow?
|
protected Set<Hash> |
getClosestHopExclude(boolean isInbound,
Set<Hash> toAdd)
Pick peers that we want to avoid for the first OB hop or last IB hop.
|
protected Set<Hash> |
getExclude(boolean isInbound,
boolean isExploratory)
As of 0.9.58, this returns a set populated only by TunnelManager.selectPeersInTooManyTunnels(),
for passing to ProfileOrganizer.
|
protected int |
getLength(TunnelPoolSettings settings) |
protected boolean |
isIPv6Only()
Are we IPv6 only?
|
protected void |
orderPeers(List<Hash> rv,
SessionKey key)
see HashComparator
|
protected List<Hash> |
selectExplicit(TunnelPoolSettings settings,
int length)
For debugging, also possibly for restricted routes?
Needs analysis and testing
|
abstract List<Hash> |
selectPeers(TunnelPoolSettings settings)
Which peers should go into the next tunnel for the given settings?
|
static boolean |
shouldExclude(RouterContext ctx,
RouterInfo peer)
Should the peer be excluded based on its published caps?
Warning, this is also called by ProfileOrganizer.isSelectable()
|
protected boolean |
shouldSelectExplicit(TunnelPoolSettings settings)
For debugging, also possibly for restricted routes?
Needs analysis and testing
|
canConnect, canConnect, canConnect, getInboundMask, getOutboundMask, isNTCPDisabled, isSSUDisabled
protected TunnelPeerSelector(RouterContext context)
public abstract List<Hash> selectPeers(TunnelPoolSettings settings)
protected int getLength(TunnelPoolSettings settings)
protected boolean shouldSelectExplicit(TunnelPoolSettings settings)
protected List<Hash> selectExplicit(TunnelPoolSettings settings, int length)
protected Set<Hash> getExclude(boolean isInbound, boolean isExploratory)
protected boolean isIPv6Only()
protected boolean allowAsOBEP(Hash h)
protected boolean allowAsIBGW(Hash h)
protected Set<Hash> getClosestHopExclude(boolean isInbound, Set<Hash> toAdd)
isInbound
- public static boolean shouldExclude(RouterContext ctx, RouterInfo peer)
protected boolean filterSlow(boolean isInbound, boolean isExploratory)
protected void orderPeers(List<Hash> rv, SessionKey key)
protected boolean checkTunnel(boolean isInbound, boolean isExploratory, List<Hash> tunnel)
tunnel
- ENDPOINT FIRST, GATEWAY LAST!!!!, length 2 or greater