Package net.i2p.router.transport
Class TransportUtil
- java.lang.Object
-
- net.i2p.router.transport.TransportUtil
-
public abstract class TransportUtil extends Object
- Since:
- IPv6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TransportUtil.IPv6Config
-
Field Summary
Fields Modifier and Type Field Description static TransportUtil.IPv6Config
DEFAULT_IPV6_CONFIG
static String
NTCP_IPV6_CONFIG
static String
PROP_IPV4_FIREWALLED
static String
PROP_IPV6_FIREWALLED
static String
SSU_IPV6_CONFIG
-
Constructor Summary
Constructors Constructor Description TransportUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TransportUtil.IPv6Config
getIPv6Config(String cfg)
static TransportUtil.IPv6Config
getIPv6Config(RouterContext ctx, String transportStyle)
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 Detail
-
NTCP_IPV6_CONFIG
public static final String NTCP_IPV6_CONFIG
- See Also:
- Constant Field Values
-
SSU_IPV6_CONFIG
public static final String SSU_IPV6_CONFIG
- See Also:
- Constant Field Values
-
PROP_IPV4_FIREWALLED
public static final String PROP_IPV4_FIREWALLED
- See Also:
- Constant Field Values
-
PROP_IPV6_FIREWALLED
public static final String PROP_IPV6_FIREWALLED
- Since:
- 0.9.28
- See Also:
- Constant Field Values
-
DEFAULT_IPV6_CONFIG
public static final TransportUtil.IPv6Config DEFAULT_IPV6_CONFIG
-
-
Method Detail
-
getIPv6Config
public static TransportUtil.IPv6Config getIPv6Config(RouterContext ctx, String transportStyle)
-
getIPv6Config
public static TransportUtil.IPv6Config getIPv6Config(String cfg)
-
isIPv4Firewalled
public static boolean isIPv4Firewalled(RouterContext ctx, String transportStyle)
This returns true if the force-firewalled setting is configured, false otherwise.- Parameters:
transportStyle
- ignored- Since:
- 0.9.20
-
isIPv6Firewalled
public static boolean isIPv6Firewalled(RouterContext ctx, String transportStyle)
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
public static boolean isIPv6(RouterAddress addr)
Addresses without a host (i.e. w/introducers) are assumed to be IPv4 unless a '6' cap is present- Parameters:
addr
- non-null
-
isYggdrasil
public static boolean isYggdrasil(RouterAddress addr)
- Since:
- 0.9.49
-
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
public static void logInvalidPort(Log log, String transportStyle, int port)
log an error- Since:
- 0.9.39 pulled out of UDPEndpoint
-
selectRandomPort
public static int selectRandomPort(RouterContext ctx, String transportStyle)
Pick a random port between the configured boundaries- Since:
- IPv6, moved from UDPEndpoint in 0.9.39 to support NTCP also
-
-