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.
 This is used for both participating tunnels and tunnels we create.
 Data only stored for tunnels we create should be in
 TunnelCreatorConfig to save space.
- 
Constructor SummaryConstructors Constructor Description HopConfig()
- 
Method SummaryModifier and Type Method Description (package private) intgetAndResetRecentMessagesCount()This returns the number of processed messages since the last time this was called, and resets the count.longgetCreation()when was this tunnel created (in ms since the epoch)?longgetExpiration()when does this tunnel expire (in ms since the epoch)?SessionKeygetIVKey()what key should we use to encrypt the preIV before passing it on?SessionKeygetLayerKey()what key should we use to encrypt the layer before passing it on?intgetProcessedMessagesCount()HashgetReceiveFrom()what is the previous peer in the tunnel (null if gateway)TunnelIdgetReceiveTunnel()What tunnel ID are we receiving on? (null if uninitialized)longgetReceiveTunnelId()What tunnel ID are we receiving on? (0 if uninitialized)intgetRecentMessagesCount()This returns the number of processed messages since the last time getAndResetRecentMessagesCount() was called.HashgetSendTo()what is the next peer in the tunnel (null if endpoint)TunnelIdgetSendTunnel()What is the next tunnel ID we are sending to? (null if endpoint)longgetSendTunnelId()What is the next tunnel ID we are sending to? (0 if endpoint)voidincrementProcessedMessages()Take note of a message being pumped through this tunnel.voidsetCreation(long when)voidsetExpiration(long when)voidsetIVKey(SessionKey key)voidsetLayerKey(SessionKey key)voidsetReceiveFrom(Hash from)Do not set for gatewayvoidsetReceiveTunnelId(long id)voidsetReceiveTunnelId(TunnelId id)voidsetSendTo(Hash to)Do not set for endpointvoidsetSendTunnelId(long id)Do not set for endpointvoidsetSendTunnelId(TunnelId id)Do not set for endpointStringtoString()
- 
Constructor Details- 
HopConfigpublic HopConfig()
 
- 
- 
Method Details- 
getReceiveTunnelIdpublic long getReceiveTunnelId()What tunnel ID are we receiving on? (0 if uninitialized)
- 
getReceiveTunnelWhat tunnel ID are we receiving on? (null if uninitialized)
- 
setReceiveTunnelId
- 
setReceiveTunnelIdpublic void setReceiveTunnelId(long id)- Parameters:
- id- 1 to 0xffffffff
- Throws:
- IllegalArgumentException- if less than or equal to zero or greater than max value
- Since:
- 0.9.48
 
- 
getReceiveFromwhat is the previous peer in the tunnel (null if gateway)
- 
setReceiveFromDo not set for gateway
- 
getSendTunnelIdpublic long getSendTunnelId()What is the next tunnel ID we are sending to? (0 if endpoint)
- 
getSendTunnelWhat is the next tunnel ID we are sending to? (null if endpoint)
- 
setSendTunnelIdDo not set for endpoint- Since:
- 0.9.48
 
- 
setSendTunnelIdpublic void setSendTunnelId(long id)Do not set for endpoint- Parameters:
- id- 1 to 0xffffffff
- Throws:
- IllegalArgumentException- if less than or equal to zero or greater than max value
- Since:
- 0.9.48
 
- 
getSendTowhat is the next peer in the tunnel (null if endpoint)
- 
setSendToDo not set for endpoint
- 
getLayerKeywhat key should we use to encrypt the layer before passing it on?
- 
setLayerKey
- 
getIVKeywhat key should we use to encrypt the preIV before passing it on?
- 
setIVKey
- 
getExpirationpublic long getExpiration()when does this tunnel expire (in ms since the epoch)?
- 
setExpirationpublic void setExpiration(long when)
- 
getCreationpublic long getCreation()when was this tunnel created (in ms since the epoch)?
- 
setCreationpublic void setCreation(long when)
- 
incrementProcessedMessagespublic 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.
- 
getProcessedMessagesCountpublic int getProcessedMessagesCount()
- 
getRecentMessagesCountpublic 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().
- 
getAndResetRecentMessagesCountint 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
 
- 
toString
 
-