Package net.i2p.router.transport
Class TransportUtil
java.lang.Object
net.i2p.router.transport.TransportUtil
- Since:
- IPv6
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TransportUtil.IPv6Config
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TransportUtil.IPv6Config
getIPv6Config
(String cfg) static TransportUtil.IPv6Config
getIPv6Config
(RouterContext ctx, String transportStyle) static AddressType
getType
(byte[] ip) static AddressType
static AddressType
getType
(RouterAddress addr) static boolean
isIPv4Firewalled
(RouterContext ctx, String transportStyle) This returns true if the force-firewalled setting is configured, false otherwise.static boolean
isIPv6
(RouterAddress addr) Addresses without a host (i.e.static boolean
isIPv6Firewalled
(RouterContext ctx, String transportStyle) This returns true if the force-firewalled setting is configured, false otherwise.static boolean
isPubliclyRoutable
(byte[] addr, boolean allowIPv6) static boolean
isPubliclyRoutable
(byte[] addr, boolean allowIPv4, boolean allowIPv6) Ref: RFC 5735static boolean
isValidPort
(int port) Is this a valid port for us or a remote router? ref: http://i2p-projekt.i2p/en/docs/ports ref: https://cs.chromium.org/chromium/src/net/base/port_util.ccstatic boolean
isYggdrasil
(RouterAddress addr) static void
logInvalidPort
(Log log, String transportStyle, int port) log an errorstatic int
selectRandomPort
(RouterContext ctx, String transportStyle) Pick a random port between the configured boundaries
-
Field Details
-
NTCP_IPV6_CONFIG
- See Also:
-
SSU_IPV6_CONFIG
- See Also:
-
PROP_IPV4_FIREWALLED
- See Also:
-
PROP_IPV6_FIREWALLED
- Since:
- 0.9.28
- See Also:
-
DEFAULT_IPV6_CONFIG
-
-
Constructor Details
-
TransportUtil
public TransportUtil()
-
-
Method Details
-
getIPv6Config
-
getIPv6Config
-
isIPv4Firewalled
This returns true if the force-firewalled setting is configured, false otherwise.- Parameters:
transportStyle
- ignored- Since:
- 0.9.20
-
isIPv6Firewalled
This returns true if the force-firewalled setting is configured, false otherwise.- Parameters:
transportStyle
- ignored- Since:
- 0.9.27, implemented in 0.9.28
-
isIPv6
Addresses without a host (i.e. w/introducers) are assumed to be IPv4 unless a '6' cap is present- Parameters:
addr
- non-null
-
isYggdrasil
- Since:
- 0.9.49
-
getType
- Returns:
- null if unknown
- Since:
- 0.9.54
-
getType
- Returns:
- null if unknown
- Since:
- 0.9.54
-
getType
- Returns:
- null if unknown
- Since:
- 0.9.54
-
isPubliclyRoutable
public static boolean isPubliclyRoutable(byte[] addr, boolean allowIPv6) - Parameters:
addr
- non-null- Since:
- IPv6 moved from TransportImpl
-
isPubliclyRoutable
public static boolean isPubliclyRoutable(byte[] addr, boolean allowIPv4, boolean allowIPv6) Ref: RFC 5735- Parameters:
addr
- non-null- Since:
- IPv6
-
isValidPort
public static boolean isValidPort(int port) Is this a valid port for us or a remote router? ref: http://i2p-projekt.i2p/en/docs/ports ref: https://cs.chromium.org/chromium/src/net/base/port_util.cc- Since:
- 0.9.17 moved from logic in individual transports
-
logInvalidPort
log an error- Since:
- 0.9.39 pulled out of UDPEndpoint
-
selectRandomPort
Pick a random port between the configured boundaries- Since:
- IPv6, moved from UDPEndpoint in 0.9.39 to support NTCP also
-