public class CircuitNodeImpl extends Object implements CircuitNode
| Modifier and Type | Method and Description |
|---|---|
boolean |
considerSendingSendme()
Examines the delivery window and determines if it would be an appropriate time to
send a RELAY_SENDME cell.
|
static CircuitNode |
createAnonymous(CircuitNode previous,
byte[] keyMaterial,
byte[] verifyDigest) |
static CircuitNode |
createFirstHop(Router r,
byte[] keyMaterial,
byte[] verifyDigest) |
static CircuitNode |
createNode(Router r,
CircuitNode previous,
byte[] keyMaterial,
byte[] verifyDigest) |
void |
decrementDeliverWindow()
This method is called when a RELAY_DATA cell is received from this node to decrement
the deliver window counter.
|
boolean |
decryptBackwardCell(Cell cell) |
void |
encryptForwardCell(RelayCell cell)
Encrypt a
RelayCell for this node with the current
'forward' cipher state. |
byte[] |
getForwardDigestBytes()
Return the current 'forward' running digest value for this
node as an array of
TOR_DIGEST_SIZE bytes. |
CircuitNode |
getPreviousNode()
Return the
CircuitNode which immediately preceeds this
one in the circuit node chain or null if this is
the first hop. |
Router |
getRouter()
Return the
Router associated with this node. |
void |
incrementSendWindow()
This method is called to signal that a RELAY_SENDME cell has been received from this
node and the packaging window should be incremented.
|
String |
toString() |
void |
updateForwardDigest(RelayCell cell)
Update the 'forward' cryptographic digest state for this
node with the contents of
cell |
void |
waitForSendWindow()
Return immediately if the packaging window for this node is open (ie: greater than 0), otherwise
block until the circuit is destroyed or the window is incremented by receiving a RELAY_SENDME cell
from this node.
|
void |
waitForSendWindowAndDecrement()
If the packaging window for this node is open (ie: greater than 0) this method
decrements the packaging window by 1 and returns immediately, otherwise it will
block until the circuit is destroyed or the window is incremented by receiving
a RELAY_SENDME cell from this node.
|
public static CircuitNode createAnonymous(CircuitNode previous, byte[] keyMaterial, byte[] verifyDigest)
public static CircuitNode createFirstHop(Router r, byte[] keyMaterial, byte[] verifyDigest)
public static CircuitNode createNode(Router r, CircuitNode previous, byte[] keyMaterial, byte[] verifyDigest)
public Router getRouter()
CircuitNodeRouter associated with this node.getRouter in interface CircuitNodeRouter for this hop of the circuit chain.public CircuitNode getPreviousNode()
CircuitNodeCircuitNode which immediately preceeds this
one in the circuit node chain or null if this is
the first hop.getPreviousNode in interface CircuitNodeCircuitNode in the chain or
null if this is the first node.public void encryptForwardCell(RelayCell cell)
CircuitNodeRelayCell for this node with the current
'forward' cipher state.encryptForwardCell in interface CircuitNodecell - The RelayCell to encrypt.public boolean decryptBackwardCell(Cell cell)
decryptBackwardCell in interface CircuitNodepublic void updateForwardDigest(RelayCell cell)
CircuitNodecellupdateForwardDigest in interface CircuitNodecell - The RelayCell to add to the digest.public byte[] getForwardDigestBytes()
CircuitNodeTOR_DIGEST_SIZE bytes.getForwardDigestBytes in interface CircuitNodepublic void decrementDeliverWindow()
CircuitNodedecrementDeliverWindow in interface CircuitNodepublic boolean considerSendingSendme()
CircuitNodeconsiderSendingSendme in interface CircuitNodepublic void waitForSendWindow()
CircuitNodewaitForSendWindow in interface CircuitNodepublic void waitForSendWindowAndDecrement()
CircuitNodewaitForSendWindowAndDecrement in interface CircuitNodepublic void incrementSendWindow()
CircuitNodeincrementSendWindow in interface CircuitNodeCopyright © 2015. All rights reserved.