Package net.i2p.router.tunnel
Class TunnelCreatorConfig
java.lang.Object
net.i2p.router.tunnel.TunnelCreatorConfig
- All Implemented Interfaces:
TunnelInfo
- Direct Known Subclasses:
PooledTunnelCreatorConfig
Coordinate the info that the tunnel creator keeps track of, including what
peers are in the tunnel and what their configuration is
See PooledTunnelCreatorConfig for the non-abstract class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RouterContextstatic final intIV length forgetAESReplyIV(int) -
Constructor Summary
ConstructorsConstructorDescriptionTunnelCreatorConfig(RouterContext ctx, int length, boolean isInbound) For exploratory only (null destination)TunnelCreatorConfig(RouterContext ctx, int length, boolean isInbound, Hash destination) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getAESReplyIV(int hop) IV used to encrypt the reply sent for the tunnel creation crypto.getAESReplyKey(int hop) Key to encrypt the reply sent for the tunnel creation crypto.Checksum for blank recordbyte[]getChaChaReplyAD(int hop) Get ECIES reply ADgetChaChaReplyKey(int hop) Get ECIES reply keygetConfig(int hop) retrieve the config for the given hop.If this is a client tunnel, what destination is it for?For conveniencelongFor convenienceECIES short OBEP record only.For convenienceintHow many hops are there in the tunnel? INCLUDING US.getPeer(int hop) retrieve the peer at the given hop.intOutbound message priority - for outbound tunnels onlyintgetReceiveTunnelId(int hop) retrieve the tunnelId that the given hop receives messages on.longnew style reply message idcomponent ordering in the new style requestgetSendTunnelId(int hop) retrieve the tunnelId that the given hop sends messages on.booleanHas the tunnel failed completely?intlongwe know for sure that this many bytes travelled through the tunnel in its lifetimevoidtake note of a message being pumped through this tunnelvoidincrementVerifiedBytesTransferred(int bytes) This calls profile manager tunnelDataPushed1m() for each peerbooleanisEC(int hop) Is it an ECIES hop?booleanis this an inbound tunnel?voidsetAESReplyKeys(int hop, SessionKey key, byte[] iv) Key and IV to encrypt the reply sent for the tunnel creation crypto.voidsetBlankHash(Hash h) Checksum for blank recordvoidsetChaChaReplyKeys(int hop, SessionKey key, byte[] ad) Set ECIES reply key and IVvoidsetExpiration(long when) voidECIES short OBEP record only.voidvoidsetPriority(int priority) Outbound message priority - for outbound tunnels onlyvoidsetReplyMessageId(long id) voidsetReplyOrder(List<Integer> order) voidNote that we reused this tunnelvoidtestSuccessful(int ms) take note that the tunnel was able to measurably Do Good in the given timetoString()booleanThe tunnel failed a test, so (maybe) stop using itvoidThe tunnel failed completely, so definitely stop using itbooleanDid we reuse this tunnel?
-
Field Details
-
_context
-
REPLY_IV_LENGTH
public static final int REPLY_IV_LENGTHIV length forgetAESReplyIV(int)- Since:
- 0.9.48 moved from HopConfig
- See Also:
-
-
Constructor Details
-
TunnelCreatorConfig
For exploratory only (null destination)- Parameters:
length- 1 minimum (0 hop is length 1)
-
TunnelCreatorConfig
- Parameters:
length- 1 minimum (0 hop is length 1)destination- null for exploratory
-
-
Method Details
-
getLength
public int getLength()How many hops are there in the tunnel? INCLUDING US. i.e. one more than the TunnelCreatorConfig length.- Specified by:
getLengthin interfaceTunnelInfo
-
getOptions
-
getConfig
retrieve the config for the given hop. the gateway is hop 0. -
getReceiveTunnelId
retrieve the tunnelId that the given hop receives messages on. the gateway is hop 0.- Specified by:
getReceiveTunnelIdin interfaceTunnelInfo
-
getSendTunnelId
retrieve the tunnelId that the given hop sends messages on. the gateway is hop 0.- Specified by:
getSendTunnelIdin interfaceTunnelInfo
-
getPeer
retrieve the peer at the given hop. the gateway is hop 0- Specified by:
getPeerin interfaceTunnelInfo
-
setPeer
-
getGateway
For convenience- Specified by:
getGatewayin interfaceTunnelInfo- Returns:
- getPeer(0)
- Since:
- 0.8.9
-
getEndpoint
For convenience- Specified by:
getEndpointin interfaceTunnelInfo- Returns:
- getPeer(getLength() - 1)
- Since:
- 0.8.9
-
getFarEnd
For convenience- Specified by:
getFarEndin interfaceTunnelInfo- Returns:
- isInbound() ? getGateway() : getEndpoint()
- Since:
- 0.8.9
-
isInbound
public boolean isInbound()is this an inbound tunnel?- Specified by:
isInboundin interfaceTunnelInfo
-
getDestination
If this is a client tunnel, what destination is it for?- Specified by:
getDestinationin interfaceTunnelInfo- Returns:
- null for exploratory
-
getExpiration
public long getExpiration()- Specified by:
getExpirationin interfaceTunnelInfo
-
setExpiration
public void setExpiration(long when) -
getReplyOrder
component ordering in the new style request -
setReplyOrder
-
getReplyMessageId
public long getReplyMessageId()new style reply message id -
setReplyMessageId
public void setReplyMessageId(long id) -
incrementProcessedMessages
public void incrementProcessedMessages()take note of a message being pumped through this tunnel -
getProcessedMessagesCount
public int getProcessedMessagesCount()- Specified by:
getProcessedMessagesCountin interfaceTunnelInfo
-
incrementVerifiedBytesTransferred
public void incrementVerifiedBytesTransferred(int bytes) This calls profile manager tunnelDataPushed1m() for each peer- Specified by:
incrementVerifiedBytesTransferredin interfaceTunnelInfo
-
getVerifiedBytesTransferred
public long getVerifiedBytesTransferred()Description copied from interface:TunnelInfowe know for sure that this many bytes travelled through the tunnel in its lifetime- Specified by:
getVerifiedBytesTransferredin interfaceTunnelInfo
-
tunnelFailed
public boolean tunnelFailed()The tunnel failed a test, so (maybe) stop using it- Returns:
- false if we stopped using it, true if still ok
-
tunnelFailedCompletely
public void tunnelFailedCompletely()The tunnel failed completely, so definitely stop using it- Since:
- 0.9.53
-
getTunnelFailed
public boolean getTunnelFailed()Has the tunnel failed completely?- Specified by:
getTunnelFailedin interfaceTunnelInfo- Since:
- 0.9.53
-
getTunnelFailures
public int getTunnelFailures() -
testSuccessful
public void testSuccessful(int ms) Description copied from interface:TunnelInfotake note that the tunnel was able to measurably Do Good in the given time- Specified by:
testSuccessfulin interfaceTunnelInfo
-
wasReused
public boolean wasReused()Did we reuse this tunnel?- Specified by:
wasReusedin interfaceTunnelInfo- Since:
- 0.8.11
-
setReused
public void setReused()Note that we reused this tunnel- Specified by:
setReusedin interfaceTunnelInfo- Since:
- 0.8.11
-
getPriority
public int getPriority()Outbound message priority - for outbound tunnels only- Returns:
- -25 to +25, default 0
- Since:
- 0.9.4
-
setPriority
public void setPriority(int priority) Outbound message priority - for outbound tunnels only- Parameters:
priority- -25 to +25, default 0- Since:
- 0.9.4
-
setAESReplyKeys
Key and IV to encrypt the reply sent for the tunnel creation crypto.- Throws:
IllegalArgumentException- if iv not 16 bytes- Since:
- 0.9.48 moved from HopConfig
-
getAESReplyKey
Key to encrypt the reply sent for the tunnel creation crypto. Null for short build record.- Returns:
- key or null
- Throws:
IllegalArgumentException- if iv not 16 bytes- Since:
- 0.9.48 moved from HopConfig
-
getAESReplyIV
public byte[] getAESReplyIV(int hop) IV used to encrypt the reply sent for the tunnel creation crypto. Null for short build record.- Returns:
- 16 bytes or null
- Since:
- 0.9.48 moved from HopConfig
-
getBlankHash
Checksum for blank record- Since:
- 0.9.48
-
setBlankHash
Checksum for blank record- Since:
- 0.9.48
-
setChaChaReplyKeys
Set ECIES reply key and IV- Since:
- 0.9.48
-
isEC
public boolean isEC(int hop) Is it an ECIES hop?- Since:
- 0.9.48
-
getChaChaReplyKey
Get ECIES reply key- Since:
- 0.9.48
-
getChaChaReplyAD
public byte[] getChaChaReplyAD(int hop) Get ECIES reply AD- Since:
- 0.9.48
-
setGarlicReplyKeys
ECIES short OBEP record only.- Since:
- 0.9.51
-
getGarlicReplyKeys
ECIES short OBEP record only.- Returns:
- null for ElGamal or ECIES long record or non-OBEP
- Since:
- 0.9.51
-
toString
-
toStringFull
- Since:
- 0.9.51
-