Package com.biglybt.core.util
Class AddressUtils
java.lang.Object
com.biglybt.core.util.AddressUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionchecks if the provided address is a global-scope ipv6 unicast addressprivate static Map
private static boolean
private static ClientInstanceManager
static final byte
static final byte
static final byte
private static TimerEventPeriodic
private static Set<InetSocketAddress>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
addHostRedirect
(String from_host, String to_host) private static InetSocketAddress
adjustAddress
(InetSocketAddress address, boolean ext_to_lan, int port_type) static InetSocketAddress
adjustDHTAddress
(InetSocketAddress address, boolean ext_to_lan) static InetSocketAddress
adjustTCPAddress
(InetSocketAddress address, boolean ext_to_lan) static InetSocketAddress
adjustUDPAddress
(InetSocketAddress address, boolean ext_to_lan) static URL
static boolean
applyLANRateLimits
(InetSocketAddress address) static String
convertToShortForm
(String address) static byte[]
getAddressBytes
(InetSocketAddress address) static InetAddress[]
getAllByName
(String host) static InetAddress
static String
getHostAddress
(InetSocketAddress address) static String
getHostAddressForURL
(InetSocketAddress address) static String
getHostNameNoResolve
(InetSocketAddress address) private static ClientInstanceManager
getLANAddresses
(String address) private static String
getShortForm
(String str) static String
static InetSocketAddress
getSocketAddress
(String host) static boolean
is6to4
(InetAddress addr) static boolean
static boolean
static boolean
isGlobalAddressV6
(InetAddress addr) static byte
isLANLocalAddress
(String address) static byte
isLANLocalAddress
(InetSocketAddress socket_address) static boolean
static boolean
isTeredo
(InetAddress addr) static boolean
matchesCIDR
(byte[] prefix, int len, byte[] bytes) static boolean
matchesCIDR
(String address_mask, int len, InetAddress address) static List<InetAddress>
pickBestGlobalV6Addresses
(List<InetAddress> addrs) picks 1 global-scoped address out of a list based on the heuristic "true" ipv6/tunnel broker > 6to4 > teredostatic void
static boolean
-
Field Details
-
LAN_LOCAL_MAYBE
public static final byte LAN_LOCAL_MAYBE- See Also:
-
LAN_LOCAL_YES
public static final byte LAN_LOCAL_YES- See Also:
-
LAN_LOCAL_NO
public static final byte LAN_LOCAL_NO- See Also:
-
i2p_is_lan_limit
private static boolean i2p_is_lan_limit -
instance_manager
-
host_map
-
pending_addresses
-
pa_timer
-
extra_ipv6_globals
checks if the provided address is a global-scope ipv6 unicast address
-
-
Constructor Details
-
AddressUtils
public AddressUtils()
-
-
Method Details
-
getInstanceManager
-
adjustURL
-
addHostRedirect
-
adjustTCPAddress
-
adjustUDPAddress
-
adjustDHTAddress
-
adjustAddress
private static InetSocketAddress adjustAddress(InetSocketAddress address, boolean ext_to_lan, int port_type) -
getLANAddresses
-
isLANLocalAddress
-
isLANLocalAddress
-
addExplicitLANRateLimitAddress
-
isExplicitLANRateLimitAddress
-
isExplicitLANRateLimitAddress
-
removeExplicitLANRateLimitAddress
-
applyLANRateLimits
-
isGlobalAddressV6
-
isTeredo
-
is6to4
-
pickBestGlobalV6Addresses
picks 1 global-scoped address out of a list based on the heuristic "true" ipv6/tunnel broker > 6to4 > teredo- Returns:
- empty list if no proper v6 address is found, best one otherwise
-
getByName
- Throws:
UnknownHostException
-
getAllByName
- Throws:
UnknownHostException
-
getAddressBytes
-
getHostAddress
-
sameHost
-
getSocketAddress
- Throws:
UnknownHostException
-
getHostAddressForURL
-
getHostNameNoResolve
-
convertToShortForm
-
isPotentialLiteralOrHostAddress
-
matchesCIDR
-
matchesCIDR
public static boolean matchesCIDR(byte[] prefix, int len, byte[] bytes) -
getShortForm
-
getShortForm
-