Package net.i2p.router.transport.udp
Class UDPAddress
- java.lang.Object
-
- net.i2p.router.transport.udp.UDPAddress
-
class UDPAddress extends Object
basic helper to parse out peer info from a udp address
-
-
Field Summary
Fields Modifier and Type Field Description static charCAPACITY_INTRODUCERstatic charCAPACITY_TESTING(package private) static intMAX_INTRODUCERSstatic StringPROP_CAPACITYstatic StringPROP_HOSTstatic StringPROP_INTRO_EXP_PREFIXstatic StringPROP_INTRO_HASH_PREFIXstatic StringPROP_INTRO_HOST_PREFIXstatic StringPROP_INTRO_KEYstatic StringPROP_INTRO_KEY_PREFIXstatic StringPROP_INTRO_PORT_PREFIX(package private) static String[]PROP_INTRO_TAGstatic StringPROP_INTRO_TAG_PREFIXstatic StringPROP_MTUstatic StringPROP_PORT
-
Constructor Summary
Constructors Constructor Description UDPAddress(RouterAddress addr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static voidclearCache()StringgetHost()(package private) InetAddressgetHostAddress()As of 0.9.32, will NOT resolve hostnames.(package private) intgetIntroducerCount()(package private) longgetIntroducerExpiration(int i)(package private) HashgetIntroducerHash(int i)(package private) InetAddressgetIntroducerHost(int i)As of 0.9.32, will NOT resolve hostnames.(package private) byte[]getIntroducerKey(int i)(package private) intgetIntroducerPort(int i)(package private) longgetIntroducerTag(int i)(package private) byte[]getIntroKey()(package private) intgetMTU()intgetPort()(package private) booleanisIPv4()(package private) booleanisIPv6()StringtoString()
-
-
-
Field Detail
-
PROP_PORT
public static final String PROP_PORT
- See Also:
- Constant Field Values
-
PROP_HOST
public static final String PROP_HOST
- See Also:
- Constant Field Values
-
PROP_INTRO_KEY
public static final String PROP_INTRO_KEY
- See Also:
- Constant Field Values
-
PROP_MTU
public static final String PROP_MTU
- See Also:
- Constant Field Values
-
PROP_CAPACITY
public static final String PROP_CAPACITY
- See Also:
- Constant Field Values
-
CAPACITY_TESTING
public static final char CAPACITY_TESTING
- See Also:
- Constant Field Values
-
CAPACITY_INTRODUCER
public static final char CAPACITY_INTRODUCER
- See Also:
- Constant Field Values
-
PROP_INTRO_HOST_PREFIX
public static final String PROP_INTRO_HOST_PREFIX
- See Also:
- Constant Field Values
-
PROP_INTRO_PORT_PREFIX
public static final String PROP_INTRO_PORT_PREFIX
- See Also:
- Constant Field Values
-
PROP_INTRO_KEY_PREFIX
public static final String PROP_INTRO_KEY_PREFIX
- See Also:
- Constant Field Values
-
PROP_INTRO_TAG_PREFIX
public static final String PROP_INTRO_TAG_PREFIX
- See Also:
- Constant Field Values
-
PROP_INTRO_EXP_PREFIX
public static final String PROP_INTRO_EXP_PREFIX
- Since:
- 0.9.30
- See Also:
- Constant Field Values
-
PROP_INTRO_HASH_PREFIX
public static final String PROP_INTRO_HASH_PREFIX
- Since:
- 0.9.55 for SSU2
- See Also:
- Constant Field Values
-
MAX_INTRODUCERS
static final int MAX_INTRODUCERS
- See Also:
- Constant Field Values
-
PROP_INTRO_TAG
static final String[] PROP_INTRO_TAG
-
-
Constructor Detail
-
UDPAddress
public UDPAddress(RouterAddress addr)
-
-
Method Detail
-
getHost
public String getHost()
-
getHostAddress
InetAddress getHostAddress()
As of 0.9.32, will NOT resolve hostnames.- Returns:
- InetAddress or null
-
getPort
public int getPort()
- Returns:
- 0 if unset or invalid
-
getIntroKey
byte[] getIntroKey()
- Returns:
- shouldn't be null but will be if invalid
-
getIntroducerCount
int getIntroducerCount()
-
getIntroducerHost
InetAddress getIntroducerHost(int i)
As of 0.9.32, will NOT resolve hostnames.- Returns:
- null if invalid or for SSU2
- Throws:
ArrayIndexOutOfBoundsException- if i < 0 or i >= getIntroducerCount()
-
getIntroducerPort
int getIntroducerPort(int i)
- Returns:
- greater than zero or zero for SSU2
- Throws:
ArrayIndexOutOfBoundsException- if i < 0 or i >= getIntroducerCount()
-
getIntroducerKey
byte[] getIntroducerKey(int i)
- Returns:
- null if no keys or for SSU2
- Throws:
ArrayIndexOutOfBoundsException- if i < 0 or i >= getIntroducerCount()
-
getIntroducerTag
long getIntroducerTag(int i)
- Returns:
- greater than zero
- Throws:
NullPointerException- if getIntroducerCount() == 0ArrayIndexOutOfBoundsException- if i < 0 or i >= getIntroducerCount()
-
getIntroducerExpiration
long getIntroducerExpiration(int i)
- Returns:
- ms since epoch, zero if unset
- Throws:
NullPointerException- if getIntroducerCount() == 0ArrayIndexOutOfBoundsException- if i < 0 or i >= getIntroducerCount()- Since:
- 0.9.30
-
getIntroducerHash
Hash getIntroducerHash(int i)
- Returns:
- null if no keys or for SSU1
- Throws:
ArrayIndexOutOfBoundsException- if i < 0 or i >= getIntroducerCount()- Since:
- 0.9.55
-
isIPv4
boolean isIPv4()
- Since:
- 0.9.55
-
isIPv6
boolean isIPv6()
- Since:
- 0.9.55
-
getMTU
int getMTU()
- Returns:
- 0 if unset or invalid; recitified via MTU.rectify()
- Since:
- 0.9.2
-
clearCache
static void clearCache()
- Since:
- IPv6
-
-