Package net.i2p.router
Class CommSystemFacade
java.lang.Object
net.i2p.router.CommSystemFacade
- All Implemented Interfaces:
Service
- Direct Known Subclasses:
CommSystemFacadeImpl
,VMCommSystem
Manages the communication subsystem between peers, including connections,
listeners, transports, connection keys, etc.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
static final short
We are behind a symmetric NAT which will make our 'from' address look differently when we talk to multiple peoplestatic final short
We have no network interface at all enabled transportsstatic final short
Our detection system is broken (SSU bind port failed)static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
We are behind a symmetric NAT which will make our 'from' address look differently when we talk to multiple people We can receive unsolicited connections on IPv6.static final short
We are behind a symmetric NAT which will make our 'from' address look differently when we talk to multiple people We might be able to receive unsolicited connections on IPv6.static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
We have an IPv6 transport enabled and a public IPv6 address.static final short
These must be increasing in "badness" (see TransportManager.java), but UNKNOWN must be last.static final short
We are able to talk to peers that we initiate communication with, but cannot receive unsolicited connections, i.e.static final short
Our reachability is unknown on all -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
How many peers are we currently connected to, that we have sent a message to or received a message from in the last five minutes.abstract int
How many peers are we currently connected to, that we have sent a message to in the last minute.Create the list of RouterAddress structures based on the router's configvoid
forceDisconnect
(Hash peer) Tell the comm system to disconnect from this peer.Get the country code mapgetCountry
(Hash peer) getCountryName
(String code) Hook for pluggable transport creation.Get all the peers we are connected to.long
getFramedAveragePeerClockSkew
(int percentToInclude) Return framed average clock skew of connected peers in seconds, or null if we cannot answer.byte[]
getStatus().toStatusString(), translated if available.Median clock skew of connected peers in seconds, or null if we cannot answer.short
Deprecated.use getStatus()Determine under what conditions we are remotely reachable.Factory for making X25519 key pairs.boolean
boolean
haveInboundCapacity
(int pct) boolean
haveOutboundCapacity
(int pct) void
Router must call after netdb is initializedboolean
isBacklogged
(Hash peer) boolean
isDummy()
abstract boolean
isEstablished
(Hash peer) boolean
boolean
isInStrictCountry
(Hash peer) boolean
boolean
void
mayDisconnect
(Hash peer) Tell the comm system that we may disconnect from this peer.void
notifyRemoveAddress
(boolean ipv6) Tell other transports our address changedvoid
notifyRemoveAddress
(RouterAddress address) Tell other transports our address changedvoid
notifyReplaceAddress
(RouterAddress address) Tell other transports our address changedabstract void
void
queueLookup
(byte[] ip) void
Deprecated.unusedvoid
Pluggable transportrenderPeerHTML
(Hash peer) void
renderStatusHTML
(Writer out) void
renderStatusHTML
(Writer out, String urlBase, int sortFlags) void
Pluggable transportboolean
wasUnreachable
(Hash peer)
-
Field Details
-
ROUTER_BUNDLE_NAME
- Since:
- 0.9.45
- See Also:
-
STATUS_OK
public static final short STATUS_OKThese must be increasing in "badness" (see TransportManager.java), but UNKNOWN must be last. We are able to receive unsolicited connections on all enabled transports- See Also:
-
STATUS_IPV4_OK_IPV6_UNKNOWN
public static final short STATUS_IPV4_OK_IPV6_UNKNOWNWe have an IPv6 transport enabled and a public IPv6 address. We can receive unsolicited connections on IPv4. We might be able to receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_IPV4_OK_IPV6_FIREWALLED
public static final short STATUS_IPV4_OK_IPV6_FIREWALLEDWe have an IPv6 transport enabled and a public IPv6 address. We can receive unsolicited connections on IPv4. We cannot receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_IPV4_UNKNOWN_IPV6_OK
public static final short STATUS_IPV4_UNKNOWN_IPV6_OKWe have an IPv6 transport enabled and a public IPv6 address. We may be able to receive unsolicited connections on IPv4. We can receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_IPV4_FIREWALLED_IPV6_OK
public static final short STATUS_IPV4_FIREWALLED_IPV6_OKWe have an IPv6 transport enabled and a public IPv6 address. We cannot receive unsolicited connections on IPv4. We can receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_IPV4_DISABLED_IPV6_OK
public static final short STATUS_IPV4_DISABLED_IPV6_OKWe have an IPv6 transport enabled and a public IPv6 address. IPv4 is disabled. We can receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_IPV4_SNAT_IPV6_OK
public static final short STATUS_IPV4_SNAT_IPV6_OKWe are behind a symmetric NAT which will make our 'from' address look differently when we talk to multiple people We can receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_DIFFERENT
public static final short STATUS_DIFFERENTWe are behind a symmetric NAT which will make our 'from' address look differently when we talk to multiple people- See Also:
-
STATUS_IPV4_SNAT_IPV6_UNKNOWN
public static final short STATUS_IPV4_SNAT_IPV6_UNKNOWNWe are behind a symmetric NAT which will make our 'from' address look differently when we talk to multiple people We might be able to receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_IPV4_FIREWALLED_IPV6_UNKNOWN
public static final short STATUS_IPV4_FIREWALLED_IPV6_UNKNOWNWe have an IPv6 transport enabled and a public IPv6 address. We cannot receive unsolicited connections on IPv4. We might be able to receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_REJECT_UNSOLICITED
public static final short STATUS_REJECT_UNSOLICITEDWe are able to talk to peers that we initiate communication with, but cannot receive unsolicited connections, i.e. Firewalled, on all enabled transports.- See Also:
-
STATUS_IPV4_UNKNOWN_IPV6_FIREWALLED
public static final short STATUS_IPV4_UNKNOWN_IPV6_FIREWALLEDWe have an IPv6 transport enabled and a public IPv6 address. We may be able to receive unsolicited connections on IPv4. We cannot receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_IPV4_DISABLED_IPV6_UNKNOWN
public static final short STATUS_IPV4_DISABLED_IPV6_UNKNOWNWe have an IPv6 transport enabled and a public IPv6 address. IPv4 is disabled. We might be able to receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_IPV4_DISABLED_IPV6_FIREWALLED
public static final short STATUS_IPV4_DISABLED_IPV6_FIREWALLEDWe have an IPv6 transport enabled and a public IPv6 address. IPv4 is disabled. We can receive unsolicited connections on IPv6.- Since:
- 0.9.20
- See Also:
-
STATUS_DISCONNECTED
public static final short STATUS_DISCONNECTEDWe have no network interface at all enabled transports- Since:
- 0.9.4
- See Also:
-
STATUS_HOSED
public static final short STATUS_HOSEDOur detection system is broken (SSU bind port failed)- See Also:
-
STATUS_UNKNOWN
public static final short STATUS_UNKNOWNOur reachability is unknown on all- See Also:
-
-
Constructor Details
-
CommSystemFacade
public CommSystemFacade()
-
-
Method Details
-
processMessage
-
renderStatusHTML
- Throws:
IOException
-
renderStatusHTML
- Specified by:
renderStatusHTML
in interfaceService
- Throws:
IOException
-
createAddresses
Create the list of RouterAddress structures based on the router's config -
countActivePeers
public abstract int countActivePeers()How many peers are we currently connected to, that we have sent a message to or received a message from in the last five minutes. -
countActiveSendPeers
public abstract int countActiveSendPeers()How many peers are we currently connected to, that we have sent a message to in the last minute. Unused for anything, to be removed. -
haveInboundCapacity
public boolean haveInboundCapacity(int pct) -
haveOutboundCapacity
public boolean haveOutboundCapacity(int pct) -
haveHighOutboundCapacity
public boolean haveHighOutboundCapacity() -
getMostRecentErrorMessages
-
getMedianPeerClockSkew
Median clock skew of connected peers in seconds, or null if we cannot answer. CommSystemFacadeImpl overrides this. -
getFramedAveragePeerClockSkew
public long getFramedAveragePeerClockSkew(int percentToInclude) Return framed average clock skew of connected peers in seconds, or null if we cannot answer. CommSystemFacadeImpl overrides this. -
getReachabilityStatus
Deprecated.use getStatus()Determine under what conditions we are remotely reachable. For internal use only. Not recommended for plugins or embedded applications, as the integer codes may change. Use getStatus() instead. -
getStatus
Determine under what conditions we are remotely reachable.- Since:
- 0.9.20
-
getLocalizedStatusString
getStatus().toStatusString(), translated if available.- Since:
- 0.9.45
-
recheckReachability
Deprecated.unused -
isBacklogged
-
wasUnreachable
-
isEstablished
-
getIP
-
queueLookup
public void queueLookup(byte[] ip) -
mayDisconnect
Tell the comm system that we may disconnect from this peer. This is advisory only.- Since:
- 0.9.24
-
forceDisconnect
Tell the comm system to disconnect from this peer.- Since:
- 0.9.38
-
getOurCountry
- Since:
- 0.8.11
-
isInStrictCountry
public boolean isInStrictCountry()- Since:
- 0.8.13
-
isInStrictCountry
- Since:
- 0.9.16
-
isInStrictCountry
- Since:
- 0.9.16
-
getCountry
-
getCountryName
-
getCountries
Get the country code map- Returns:
- Map of two-letter lower case code to untranslated country name, unmodifiable
- Since:
- 0.9.53
-
renderPeerHTML
-
getTransports
- Returns:
- SortedMap of style to Transport (a copy)
- Since:
- 0.9.31
-
getEstablished
Get all the peers we are connected to. This should be more efficient than repeated calls to isEstablished() if you have to check a lot.- Returns:
- the hashes of all the routers we are connected to, non-null
- Since:
- 0.9.34
-
isDummy
public boolean isDummy()- Since:
- 0.8.13
-
isRunning
public boolean isRunning()- Since:
- 0.9.53
-
notifyReplaceAddress
Tell other transports our address changed -
notifyRemoveAddress
Tell other transports our address changed- Since:
- 0.9.20
-
notifyRemoveAddress
public void notifyRemoveAddress(boolean ipv6) Tell other transports our address changed- Since:
- 0.9.20
-
registerTransport
Pluggable transport- Since:
- 0.9.16
-
unregisterTransport
Pluggable transport- Since:
- 0.9.16
-
getDHFactory
Hook for pluggable transport creation.- Since:
- 0.9.16
-
getXDHFactory
Factory for making X25519 key pairs.- Since:
- 0.9.46
-
initGeoIP
public void initGeoIP()Router must call after netdb is initialized- Since:
- 0.9.41
-