Package net.i2p.router.tunnel
Class HopConfig
- java.lang.Object
-
- net.i2p.router.tunnel.HopConfig
-
public class HopConfig extends Object
Defines the general configuration for a hop in a tunnel.
-
-
Field Summary
Fields Modifier and Type Field Description static int
REPLY_IV_LENGTH
IV length forgetReplyIV()
-
Constructor Summary
Constructors Constructor Description HopConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
getAndResetRecentMessagesCount()
This returns the number of processed messages since the last time this was called, and resets the count.long
getCreation()
when was this tunnel created (in ms since the epoch)?long
getExpiration()
when does this tunnel expire (in ms since the epoch)?SessionKey
getIVKey()
what key should we use to encrypt the preIV before passing it on?SessionKey
getLayerKey()
what key should we use to encrypt the layer before passing it on?int
getProcessedMessagesCount()
Hash
getReceiveFrom()
what is the previous peer in the tunnel (null if gateway)TunnelId
getReceiveTunnel()
byte[]
getReceiveTunnelId()
what tunnel ID are we receiving on?int
getRecentMessagesCount()
This returns the number of processed messages since the last time getAndResetRecentMessagesCount() was called.byte[]
getReplyIV()
IV used to encrypt the reply sent for the new tunnel creation cryptoSessionKey
getReplyKey()
key to encrypt the reply sent for the new tunnel creation cryptoHash
getSendTo()
what is the next peer in the tunnel (null if endpoint)TunnelId
getSendTunnel()
what is the next tunnel we are sending to? (null if endpoint)byte[]
getSendTunnelId()
what is the next tunnel ID we are sending to? (null if endpoint)void
incrementProcessedMessages()
Take note of a message being pumped through this tunnel.void
setCreation(long when)
void
setExpiration(long when)
void
setIVKey(SessionKey key)
void
setLayerKey(SessionKey key)
void
setReceiveFrom(Hash from)
void
setReceiveTunnelId(byte[] id)
void
setReceiveTunnelId(TunnelId id)
void
setReplyIV(byte[] iv)
IV used to encrypt the reply sent for the new tunnel creation cryptovoid
setReplyKey(SessionKey key)
void
setSendTo(Hash to)
void
setSendTunnelId(byte[] id)
String
toString()
-
-
-
Field Detail
-
REPLY_IV_LENGTH
public static final int REPLY_IV_LENGTH
IV length forgetReplyIV()
- See Also:
- Constant Field Values
-
-
Method Detail
-
getReceiveTunnelId
public byte[] getReceiveTunnelId()
what tunnel ID are we receiving on?
-
getReceiveTunnel
public TunnelId getReceiveTunnel()
-
setReceiveTunnelId
public void setReceiveTunnelId(byte[] id)
-
setReceiveTunnelId
public void setReceiveTunnelId(TunnelId id)
-
getReceiveFrom
public Hash getReceiveFrom()
what is the previous peer in the tunnel (null if gateway)
-
setReceiveFrom
public void setReceiveFrom(Hash from)
-
getSendTunnelId
public byte[] getSendTunnelId()
what is the next tunnel ID we are sending to? (null if endpoint)
-
getSendTunnel
public TunnelId getSendTunnel()
what is the next tunnel we are sending to? (null if endpoint)
-
setSendTunnelId
public void setSendTunnelId(byte[] id)
-
getSendTo
public Hash getSendTo()
what is the next peer in the tunnel (null if endpoint)
-
setSendTo
public void setSendTo(Hash to)
-
getLayerKey
public SessionKey getLayerKey()
what key should we use to encrypt the layer before passing it on?
-
setLayerKey
public void setLayerKey(SessionKey key)
-
getIVKey
public SessionKey getIVKey()
what key should we use to encrypt the preIV before passing it on?
-
setIVKey
public void setIVKey(SessionKey key)
-
getReplyKey
public SessionKey getReplyKey()
key to encrypt the reply sent for the new tunnel creation crypto
-
setReplyKey
public void setReplyKey(SessionKey key)
-
getReplyIV
public byte[] getReplyIV()
IV used to encrypt the reply sent for the new tunnel creation crypto- Returns:
- 16 bytes
-
setReplyIV
public void setReplyIV(byte[] iv)
IV used to encrypt the reply sent for the new tunnel creation crypto- Throws:
IllegalArgumentException
- if not 16 bytes
-
getExpiration
public long getExpiration()
when does this tunnel expire (in ms since the epoch)?
-
setExpiration
public void setExpiration(long when)
-
getCreation
public long getCreation()
when was this tunnel created (in ms since the epoch)?
-
setCreation
public void setCreation(long when)
-
incrementProcessedMessages
public void incrementProcessedMessages()
Take note of a message being pumped through this tunnel. "processed" is for incoming and "sent" is for outgoing (could be dropped in between) We use synchronization instead of an AtomicInteger here to save space.
-
getProcessedMessagesCount
public int getProcessedMessagesCount()
-
getRecentMessagesCount
public int getRecentMessagesCount()
This returns the number of processed messages since the last time getAndResetRecentMessagesCount() was called. As of 0.9.23, does NOT reset the count, see getAndResetRecentMessagesCount().
-
getAndResetRecentMessagesCount
int getAndResetRecentMessagesCount()
This returns the number of processed messages since the last time this was called, and resets the count. It should only be called by code that updates the router stats. See TunnelDispatcher.updateParticipatingStats().- Since:
- 0.9.23
-
-