public abstract class TunnelCreatorConfig extends Object implements TunnelInfo
| Modifier and Type | Field and Description |
|---|---|
protected RouterContext |
_context |
static int |
MAX_CONSECUTIVE_TEST_FAILURES |
static int |
REPLY_IV_LENGTH
IV length for
getAESReplyIV(int) |
| Constructor and Description |
|---|
TunnelCreatorConfig(RouterContext ctx,
int length,
boolean isInbound)
For exploratory only (null destination)
|
TunnelCreatorConfig(RouterContext ctx,
int length,
boolean isInbound,
Hash destination) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getAESReplyIV(int hop)
IV used to encrypt the reply sent for the tunnel creation crypto.
|
SessionKey |
getAESReplyKey(int hop)
Key to encrypt the reply sent for the tunnel creation crypto.
|
Hash |
getBlankHash()
Checksum for blank record
|
byte[] |
getChaChaReplyAD(int hop)
Get ECIES reply AD
|
SessionKey |
getChaChaReplyKey(int hop)
Get ECIES reply key
|
HopConfig |
getConfig(int hop)
retrieve the config for the given hop.
|
int |
getConsecutiveFailures()
Get the number of consecutive test failures.
|
Hash |
getDestination()
If this is a client tunnel, what destination is it for?
|
Hash |
getEndpoint()
For convenience
|
long |
getExpiration()
Get the tunnel's expiration time.
|
Hash |
getFarEnd()
For convenience
|
MessageWrapper.OneTimeSession |
getGarlicReplyKeys()
ECIES short OBEP record only.
|
Hash |
getGateway()
For convenience
|
int |
getLastLatency()
Get the last recorded round-trip latency for this tunnel from the most recent test.
|
int |
getLength()
How many hops are there in the tunnel?
INCLUDING US.
|
Properties |
getOptions() |
Hash |
getPeer(int hop)
retrieve the peer at the given hop.
|
int |
getPriority()
Outbound message priority - for outbound tunnels only
|
int |
getProcessedMessagesCount()
Get the count of messages that have been processed through this tunnel.
|
TunnelId |
getReceiveTunnelId(int hop)
retrieve the tunnelId that the given hop receives messages on.
|
long |
getReplyMessageId()
new style reply message id
|
List<Integer> |
getReplyOrder()
component ordering in the new style request
|
TunnelId |
getSendTunnelId(int hop)
retrieve the tunnelId that the given hop sends messages on.
|
TunnelTestStatus |
getTestStatus()
Get the current test status for UI display.
|
boolean |
getTunnelFailed()
Has the tunnel failed completely?
|
int |
getTunnelFailures() |
long |
getVerifiedBytesTransferred()
we know for sure that this many bytes travelled through the tunnel in its lifetime
|
void |
incrementProcessedMessages()
take note of a message being pumped through this tunnel
|
void |
incrementVerifiedBytesTransferred(int bytes)
This calls profile manager tunnelDataPushed1m() for each peer
|
boolean |
isDuplicate()
Check if this tunnel was rejected as a duplicate.
|
boolean |
isEC(int hop)
Is it an ECIES hop?
|
boolean |
isInbound()
is this an inbound tunnel?
|
void |
setAESReplyKeys(int hop,
SessionKey key,
byte[] iv)
Key and IV to encrypt the reply sent for the tunnel creation crypto.
|
void |
setBlankHash(Hash h)
Checksum for blank record
|
void |
setChaChaReplyKeys(int hop,
SessionKey key,
byte[] ad)
Set ECIES reply key and IV
|
void |
setDuplicate()
Mark this tunnel as a duplicate (rejected to prevent identical tunnel chains).
|
void |
setExpiration(long when) |
void |
setGarlicReplyKeys(MessageWrapper.OneTimeSession keys)
ECIES short OBEP record only.
|
void |
setPeer(int hop,
Hash peer) |
void |
setPriority(int priority)
Outbound message priority - for outbound tunnels only
|
void |
setReplyMessageId(long id) |
void |
setReplyOrder(List<Integer> order) |
void |
setReused()
Note that we reused this tunnel
|
void |
setTestFailed()
Called when a test fails.
|
void |
setTestStarted()
Called when a test is started.
|
void |
testSuccessful(int ms)
Record that the tunnel successfully processed a test with the given response time.
|
String |
toString() |
String |
toStringFull() |
boolean |
tunnelFailed()
The tunnel failed a test, so (maybe) stop using it
|
void |
tunnelFailedCompletely()
The tunnel failed completely, so definitely stop using it
|
boolean |
wasReused()
Did we reuse this tunnel?
|
protected final RouterContext _context
public static final int MAX_CONSECUTIVE_TEST_FAILURES
public static final int REPLY_IV_LENGTH
getAESReplyIV(int)public TunnelCreatorConfig(RouterContext ctx, int length, boolean isInbound)
length - 1 minimum (0 hop is length 1)public TunnelCreatorConfig(RouterContext ctx, int length, boolean isInbound, Hash destination)
length - 1 minimum (0 hop is length 1)destination - null for exploratorypublic byte[] getAESReplyIV(int hop)
public SessionKey getAESReplyKey(int hop)
IllegalArgumentException - if iv not 16 bytespublic Hash getBlankHash()
public byte[] getChaChaReplyAD(int hop)
public SessionKey getChaChaReplyKey(int hop)
public HopConfig getConfig(int hop)
public int getConsecutiveFailures()
getConsecutiveFailures in interface TunnelInfopublic Hash getDestination()
getDestination in interface TunnelInfopublic Hash getEndpoint()
getEndpoint in interface TunnelInfopublic long getExpiration()
TunnelInfogetExpiration in interface TunnelInfopublic Hash getFarEnd()
getFarEnd in interface TunnelInfopublic MessageWrapper.OneTimeSession getGarlicReplyKeys()
public Hash getGateway()
getGateway in interface TunnelInfopublic int getLastLatency()
getLastLatency in interface TunnelInfopublic int getLength()
getLength in interface TunnelInfopublic Properties getOptions()
public Hash getPeer(int hop)
getPeer in interface TunnelInfopublic int getPriority()
public int getProcessedMessagesCount()
TunnelInfogetProcessedMessagesCount in interface TunnelInfopublic TunnelId getReceiveTunnelId(int hop)
getReceiveTunnelId in interface TunnelInfopublic long getReplyMessageId()
public TunnelId getSendTunnelId(int hop)
getSendTunnelId in interface TunnelInfopublic TunnelTestStatus getTestStatus()
getTestStatus in interface TunnelInfopublic boolean getTunnelFailed()
getTunnelFailed in interface TunnelInfopublic int getTunnelFailures()
public long getVerifiedBytesTransferred()
TunnelInfogetVerifiedBytesTransferred in interface TunnelInfopublic void incrementProcessedMessages()
public void incrementVerifiedBytesTransferred(int bytes)
incrementVerifiedBytesTransferred in interface TunnelInfobytes - the number of bytes to add to the verified totalpublic boolean isDuplicate()
public boolean isEC(int hop)
public boolean isInbound()
isInbound in interface TunnelInfopublic void setAESReplyKeys(int hop,
SessionKey key,
byte[] iv)
IllegalArgumentException - if iv not 16 bytespublic void setBlankHash(Hash h)
public void setChaChaReplyKeys(int hop,
SessionKey key,
byte[] ad)
public void setDuplicate()
public void setExpiration(long when)
public void setGarlicReplyKeys(MessageWrapper.OneTimeSession keys)
public void setPeer(int hop,
Hash peer)
public void setPriority(int priority)
priority - -25 to +25, default 0public void setReplyMessageId(long id)
public void setReused()
setReused in interface TunnelInfopublic void setTestFailed()
setTestFailed in interface TunnelInfopublic void setTestStarted()
setTestStarted in interface TunnelInfopublic void testSuccessful(int ms)
TunnelInfotestSuccessful in interface TunnelInfoms - the response time in millisecondspublic String toStringFull()
public boolean tunnelFailed()
public void tunnelFailedCompletely()
public boolean wasReused()
wasReused in interface TunnelInfo