public class TunnelPoolSettings extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean | DEFAULT_ALLOW_ZERO_HOPDEFAULT_ALLOW_ZERO_HOP. |
static int | DEFAULT_BACKUP_QUANTITYDEFAULT_BACKUP_QUANTITY. |
static int | DEFAULT_DURATIONDEFAULT_DURATION. |
static int | DEFAULT_IP_RESTRICTIONB. |
static int | DEFAULT_QUANTITYDEFAULT_QUANTITY. |
static String | PREFIX_INBOUND_EXPLORATORYPrefix used to configure the inbound exploratory pool |
static String | PREFIX_OUTBOUND_EXPLORATORYPrefix used to configure the outbound exploratory pool |
static String | PROP_ALLOW_ZERO_HOPConfig property allowing zero-hop tunnels; unreliable, zero hops are always possible |
static String | PROP_BACKUP_QUANTITYPROP_BACKUP_QUANTITY. |
static String | PROP_DURATIONPROP_DURATION. |
static String | PROP_IP_RESTRICTIONPROP_IP_RESTRICTION. |
static String | PROP_LENGTHPROP_LENGTH. |
static String | PROP_LENGTH_VARIANCEPROP_LENGTH_VARIANCE. |
static String | PROP_NICKNAMEPROP_NICKNAME. |
static String | PROP_PRIORITYPROP_PRIORITY. |
static String | PROP_QUANTITYPROP_QUANTITY. |
static String | PROP_RANDOM_KEY |
static String | PROP_SHOULD_TESTPROP_SHOULD_TEST. |
| Constructor and Description |
|---|
TunnelPoolSettings(boolean isInbound)Exploratory tunnel |
TunnelPoolSettings(Hash dest,
boolean isInbound)Client tunnel unless dest == null |
| Modifier and Type | Method and Description |
|---|---|
Set<Hash> | getAliases()Other destinations that use the same tunnel (or null if exploratory). |
Hash | getAliasOf()Other destination that this is an alias of (or null). |
boolean | getAllowZeroHop()If there are no tunnels to build with, will this pool allow 0 hop tunnels?
As of 0.9.44, same goes for exploratory:
Prior to 0.9.35, generally true for client. |
int | getBackupQuantity()How many backup tunnels should be kept waiting in the wings |
Hash | getDestination()What destination is this a client tunnel for (or null if exploratory) |
String | getDestinationNickname()What user supplied name was given to the client connected (can be null) |
Set<Hash> | getFirstPeerExclusions()First peer exclusions for diversity. |
int | getIPRestriction()How many bytes to match to determine if a router's IP is too close to another's
to be in the same tunnel
(1-4, 0 to disable)
Support removed in the ClientPeerSelector in 0.8.6; restored in 0.9.53 |
Set<Hash> | getLastPeerExclusions()Last peer exclusions for diversity. |
int | getLength()How many remote hops should be in the tunnel NOT including us |
int | getLengthOverride()A temporary length to be used due to network conditions. |
int | getLengthVariance()How the length should be varied. |
long | getMsgIdBloomXor()The msg ID bloom xor value used to randomize message IDs. |
int | getPriority()Outbound message priority - for outbound tunnels only |
int | getQuantity()How many tunnels should be available at all times |
SessionKey | getRandomKey()Random key used for peer ordering. |
int | getTotalQuantity()Convenience |
Properties | getUnknownOptions()Options not recognized when reading from properties. |
boolean | isExploratory()Is this an exploratory tunnel (or a client tunnel) |
boolean | isInbound()Is this an inbound tunnel? |
boolean | isZeroHop()Whether the pool is expressly configured for zero-hop tunnels,
by length 0 or lengthOverride 0. |
void | readFromProperties(String prefix,
Properties props)Defaults in props are NOT honored. |
void | setAliasOf(Hash h)Other destination that this is an alias of (or null). |
void | setBackupQuantity(int quantity)How many backup tunnels should be kept waiting in the wings. |
void | setDestinationNickname(String name)User supplied name given to the connected client. |
void | setFirstPeerExclusions(Set<Hash> exclusions)First peer exclusions for diversity. |
void | setLastPeerExclusions(Set<Hash> exclusions)Last peer exclusions for diversity. |
void | setLength(int length)How many remote hops should be in the tunnel NOT including us |
void | setLengthOverride(int length)A temporary length to be used due to network conditions. |
void | setLengthVariance(int variance)How the length should be varied. |
void | setQuantity(int quantity)How many tunnels should be available at all times. |
boolean | shouldTest()Should tunnels in this pool be tested? |
String | toString()String representation of these settings for debugging. |
void | writeToProperties(String prefix,
Properties props)Write the settings into the given properties map. |
public static final boolean DEFAULT_ALLOW_ZERO_HOP
public static final int DEFAULT_BACKUP_QUANTITY
public static final int DEFAULT_DURATION
public static final int DEFAULT_IP_RESTRICTION
public static final int DEFAULT_QUANTITY
public static final String PREFIX_INBOUND_EXPLORATORY
public static final String PREFIX_OUTBOUND_EXPLORATORY
public static final String PROP_ALLOW_ZERO_HOP
public static final String PROP_BACKUP_QUANTITY
public static final String PROP_DURATION
public static final String PROP_IP_RESTRICTION
public static final String PROP_LENGTH
public static final String PROP_LENGTH_VARIANCE
public static final String PROP_NICKNAME
public static final String PROP_PRIORITY
public static final String PROP_QUANTITY
public static final String PROP_RANDOM_KEY
public static final String PROP_SHOULD_TEST
public TunnelPoolSettings(boolean isInbound)
public TunnelPoolSettings(Hash dest, boolean isInbound)
public Set<Hash> getAliases()
public Hash getAliasOf()
public boolean getAllowZeroHop()
public int getBackupQuantity()
public Hash getDestination()
public String getDestinationNickname()
public Set<Hash> getFirstPeerExclusions()
public int getIPRestriction()
public Set<Hash> getLastPeerExclusions()
public int getLength()
public int getLengthOverride()
public int getLengthVariance()
public long getMsgIdBloomXor()
public int getPriority()
public int getQuantity()
public SessionKey getRandomKey()
public int getTotalQuantity()
public Properties getUnknownOptions()
public boolean isExploratory()
public boolean isInbound()
public boolean isZeroHop()
public void readFromProperties(String prefix, Properties props)
prefix - non-nullpublic void setAliasOf(Hash h)
public void setBackupQuantity(int quantity)
quantity - the desired backup quantitypublic void setDestinationNickname(String name)
name - the nickname, or nullpublic void setFirstPeerExclusions(Set<Hash> exclusions)
exclusions - Set of peer hashes to exclude, or null to clearpublic void setLastPeerExclusions(Set<Hash> exclusions)
exclusions - Set of peer hashes to exclude, or null to clearpublic void setLength(int length)
length - 0 to 7 (not enforced here)public void setLengthOverride(int length)
public void setLengthVariance(int variance)
variance - the length variancepublic void setQuantity(int quantity)
quantity - the desired quantitypublic boolean shouldTest()
public String toString()
public void writeToProperties(String prefix, Properties props)
prefix - non-null