Package net.i2p.router.tunnel.pool
Class ConnectChecker
java.lang.Object
net.i2p.router.tunnel.pool.ConnectChecker
- Direct Known Subclasses:
TunnelPeerSelector
public class ConnectChecker extends Object
Tools to check transport compatibility.
- Since:
- 0.9.34
-
Field Summary
Fields Modifier and Type Field Description static int
ANY_V4
protected RouterContext
ctx
protected Log
log
-
Constructor Summary
Constructors Constructor Description ConnectChecker(RouterContext context)
-
Method Summary
Modifier and Type Method Description boolean
canConnect(int ourMask, RouterInfo to)
Can we connect to "to" based on published addresses? This is intended for tunnel candidates, where we already have the RI.boolean
canConnect(Hash from, Hash to)
Can "from" connect to "to" based on published addresses? This is intended for tunnel candidates, where we already have the RI.boolean
canConnect(RouterInfo from, int ourMask)
Can "from" connect to us based on published addresses? This is intended for tunnel candidates, where we already have the RI.int
getInboundMask(RouterInfo us)
Our inbound mask.int
getOutboundMask(RouterInfo us)
Our outbound mask.protected boolean
isNTCPDisabled()
Is NTCP disabled?protected boolean
isSSUDisabled()
Is SSU disabled?
-
Field Details
-
ctx
-
log
-
ANY_V4
public static final int ANY_V4- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
isNTCPDisabled
protected boolean isNTCPDisabled()Is NTCP disabled?- Since:
- 0.9.34
-
isSSUDisabled
protected boolean isSSUDisabled()Is SSU disabled?- Since:
- 0.9.34
-
canConnect
Can "from" connect to "to" based on published addresses? This is intended for tunnel candidates, where we already have the RI. Will not force RI lookups. Either from or to may be us. This is best effort, as we can't know for sure. Published addresses or introducers may have changed. Even if a can't connect to b, they may already be connected as b connected to a.- Returns:
- true if we don't have either RI
- Since:
- 0.9.34
-
canConnect
Can we connect to "to" based on published addresses? This is intended for tunnel candidates, where we already have the RI. Will not force RI lookups. This is best effort, as we can't know for sure. Does not check isEstablished(); do that first.- Since:
- 0.9.34
-
canConnect
Can "from" connect to us based on published addresses? This is intended for tunnel candidates, where we already have the RI. Will not force RI lookups. This is best effort, as we can't know for sure. Does not check isEstablished(); do that first.- Since:
- 0.9.34
-
getInboundMask
Our inbound mask. For most cases, we use what we published, i.e. getConnectMask()- Returns:
- bitmask for accepting connections
- Since:
- 0.9.34
-
getOutboundMask
Our outbound mask. For most cases, we use our comm system status.- Returns:
- bitmask for initiating connections
- Since:
- 0.9.34
-