org.gudy.azureus2.core3.util
Class AddressUtils
java.lang.Object
org.gudy.azureus2.core3.util.AddressUtils
public class AddressUtils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LAN_LOCAL_MAYBE
public static final byte LAN_LOCAL_MAYBE
- See Also:
- Constant Field Values
LAN_LOCAL_YES
public static final byte LAN_LOCAL_YES
- See Also:
- Constant Field Values
LAN_LOCAL_NO
public static final byte LAN_LOCAL_NO
- See Also:
- Constant Field Values
AddressUtils
public AddressUtils()
adjustURL
public static URL adjustURL(URL url)
addHostRedirect
public static void addHostRedirect(String from_host,
String to_host)
adjustTCPAddress
public static InetSocketAddress adjustTCPAddress(InetSocketAddress address,
boolean ext_to_lan)
adjustUDPAddress
public static InetSocketAddress adjustUDPAddress(InetSocketAddress address,
boolean ext_to_lan)
adjustDHTAddress
public static InetSocketAddress adjustDHTAddress(InetSocketAddress address,
boolean ext_to_lan)
getLANAddresses
public static List getLANAddresses(String address)
isLANLocalAddress
public static byte isLANLocalAddress(InetSocketAddress socket_address)
isLANLocalAddress
public static byte isLANLocalAddress(InetAddress address)
isLANLocalAddress
public static byte isLANLocalAddress(String address)
applyLANRateLimits
public static boolean applyLANRateLimits(InetSocketAddress address)
isGlobalAddressV6
public static boolean isGlobalAddressV6(InetAddress addr)
- checks if the provided address is a global-scope ipv6 unicast address
isTeredo
public static boolean isTeredo(InetAddress addr)
is6to4
public static boolean is6to4(InetAddress addr)
pickBestGlobalV6Address
public static InetAddress pickBestGlobalV6Address(List<InetAddress> addrs)
- picks 1 global-scoped address out of a list based on the heuristic
"true" ipv6/tunnel broker > 6to4 > teredo
- Returns:
- null if no proper v6 address is found, best one otherwise
getByName
public static InetAddress getByName(String host)
throws UnknownHostException
- Throws:
UnknownHostException
getAllByName
public static InetAddress[] getAllByName(String host)
throws UnknownHostException
- Throws:
UnknownHostException
getAddressBytes
public static byte[] getAddressBytes(InetSocketAddress address)
getHostAddress
public static String getHostAddress(InetSocketAddress address)
getHostNameNoResolve
public static String getHostNameNoResolve(InetSocketAddress address)
convertToShortForm
public static String convertToShortForm(String address)