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 Mapprivate static booleanprivate static ClientInstanceManagerstatic final bytestatic final bytestatic final byteprivate static TimerEventPeriodicprivate static Set<InetSocketAddress> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidaddHostRedirect(String from_host, String to_host) private static InetSocketAddressadjustAddress(InetSocketAddress address, boolean ext_to_lan, int port_type) static InetSocketAddressadjustDHTAddress(InetSocketAddress address, boolean ext_to_lan) static InetSocketAddressadjustTCPAddress(InetSocketAddress address, boolean ext_to_lan) static InetSocketAddressadjustUDPAddress(InetSocketAddress address, boolean ext_to_lan) static URLstatic booleanapplyLANRateLimits(InetSocketAddress address) static StringconvertToShortForm(String address) static byte[]getAddressBytes(InetSocketAddress address) static InetAddress[]getAllByName(String host) static InetAddressstatic StringgetHostAddress(InetSocketAddress address) static StringgetHostAddressForURL(InetAddress address) static StringgetHostAddressForURL(InetSocketAddress address) static StringgetHostAddressWithoutScopeID(InetAddress address) static StringgetHostNameNoResolve(InetSocketAddress address) private static ClientInstanceManagergetLANAddresses(String address) private static StringgetShortForm(String str) static Stringstatic InetSocketAddressgetSocketAddress(String host) static booleanis6to4(InetAddress addr) static booleanstatic booleanstatic booleanisGlobalAddressV6(InetAddress addr) static byteisLANLocalAddress(String address) static byteisLANLocalAddress(InetSocketAddress socket_address) static booleanstatic booleanisTeredo(InetAddress addr) static booleanmatchesCIDR(byte[] prefix, int len, byte[] bytes) static booleanmatchesCIDR(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 voidstatic 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
-
-
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
-
getHostAddressForURL
-
getHostAddressWithoutScopeID
-
getHostNameNoResolve
-
convertToShortForm
-
isPotentialLiteralOrHostAddress
-
matchesCIDR
-
matchesCIDR
public static boolean matchesCIDR(byte[] prefix, int len, byte[] bytes) -
getShortForm
-
getShortForm
-