|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.tor.Circuit
public final class Circuit
Field Summary | |
---|---|
private boolean |
m_bReceivedCreatedOrExtendedCell
|
private CellQueue |
m_cellqueueSend
|
private int |
m_circID
|
private int |
m_circuitLength
|
private boolean |
m_destroyed
|
private OnionRouter |
m_FirstOR
|
private FirstOnionRouterConnection |
m_FirstORConnection
|
private int |
m_iRelayErrors
|
private ORDescriptor |
m_lastORDescription
|
private int |
m_MaxStreamsPerCircuit
|
private java.lang.Object |
m_oDestroyedByPeerSync
|
private java.util.Vector |
m_onionRouters
|
private java.lang.Object |
m_oNotifySync
|
private java.lang.Object |
m_oResolveSync
|
private java.lang.Object |
m_oSendCellCounterSync
|
private java.lang.Object |
m_oSendSync
|
private MyRandom |
m_rand
|
private int |
m_recvCellCounter
|
private byte[] |
m_resolvedData
|
private int |
m_sendCellCounter
|
private int |
m_State
|
private int |
m_streamCounter
|
private java.util.Hashtable |
m_streams
|
private java.lang.Thread |
m_threadSendCellLoop
|
static int |
MAX_STREAMS_OVER_CIRCUIT
|
private static int |
STATE_CLOSED
|
private static int |
STATE_CREATING
|
private static int |
STATE_READY
|
private static int |
STATE_SHUTDOWN
|
Constructor Summary | |
---|---|
Circuit(int circID,
FirstOnionRouterConnection onionProxy,
java.util.Vector orList)
constructor |
Method Summary | |
---|---|
private void |
addToSendCellCounter(int value)
|
void |
close()
closes the circuit immediately. |
protected void |
close(int streamID)
closes a stream |
protected int |
connectChannel(TorChannel channel,
java.lang.String addr,
int port)
creates a channel through the tor-network |
protected void |
create()
creates a circuit and connects to all onionrouters |
TorChannel |
createChannel(java.lang.String addr,
int port)
creates a channel through the tor-network |
void |
destroyedByPeer()
circuit was destroyed by peer. |
void |
dispatchCell(Cell cell)
dispatches cells to the opended channels |
int |
getCircID()
returns the ID of this circuit |
boolean |
isAllowed(java.lang.String adr,
int port)
Checks if it is possible to connect to given host on a given port via this circuit |
boolean |
isClosed()
check if the circuit is already destroyed |
boolean |
isShutdown()
check if the circuit is already shutdown |
java.lang.String |
resolveDNS(java.lang.String name)
Returns a address to a given name |
void |
run()
|
void |
send(Cell cell)
sends a cell through the circuit - the cells are placed in a queue for sending |
void |
sendUrgent(Cell cell)
urgently sends a cell through the circuit (send it directly without placing it in the send queue) |
void |
setMaxNrOfStreams(int i)
Sets the maximum number of possible streams over this circuit |
void |
shutdown()
shutdown this circuit so that it cannot be used for new connections but leaves the circuit opened for all currently used channels to close the circuit immediately use close() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_STREAMS_OVER_CIRCUIT
private OnionRouter m_FirstOR
private ORDescriptor m_lastORDescription
private FirstOnionRouterConnection m_FirstORConnection
private java.util.Vector m_onionRouters
private int m_circID
private java.util.Hashtable m_streams
private volatile int m_State
private volatile int m_iRelayErrors
private static final int STATE_CLOSED
private static final int STATE_SHUTDOWN
private static final int STATE_READY
private static final int STATE_CREATING
private int m_streamCounter
private int m_circuitLength
private int m_MaxStreamsPerCircuit
private volatile int m_recvCellCounter
private volatile int m_sendCellCounter
private boolean m_destroyed
private byte[] m_resolvedData
private java.lang.Object m_oResolveSync
private java.lang.Object m_oSendCellCounterSync
private java.lang.Object m_oSendSync
private java.lang.Object m_oDestroyedByPeerSync
private volatile boolean m_bReceivedCreatedOrExtendedCell
private java.lang.Object m_oNotifySync
private MyRandom m_rand
private java.lang.Thread m_threadSendCellLoop
private CellQueue m_cellqueueSend
Constructor Detail |
---|
public Circuit(int circID, FirstOnionRouterConnection onionProxy, java.util.Vector orList) throws java.io.IOException
circID
- ID of this circuitorList
- list of onionrouters to use for this circuitonionProxy
- FirstOnionRouter, where all the data will be send. the onionProxy has to be the firstOR in the orList
java.io.IOException
Method Detail |
---|
private void addToSendCellCounter(int value)
protected void create() throws java.io.IOException
java.io.IOException
public void shutdown()
java.lang.Exception
public void close()
java.lang.Exception
public void destroyedByPeer()
java.lang.Exception
public boolean isClosed()
public boolean isShutdown()
public void dispatchCell(Cell cell) throws java.io.IOException
cell
- cell
java.io.IOException
public void send(Cell cell) throws java.io.IOException, java.lang.Exception
cell
- cell to send
java.io.IOException
java.lang.Exception
public void sendUrgent(Cell cell) throws java.io.IOException, java.lang.Exception
cell
- cell to send
java.io.IOException
java.lang.Exception
public java.lang.String resolveDNS(java.lang.String name)
name
-
protected void close(int streamID) throws java.lang.Exception
streamID
- streamID
java.lang.Exception
public int getCircID()
public TorChannel createChannel(java.lang.String addr, int port) throws java.io.IOException
addr
- address of the server you want do connectport
- port
java.io.IOException
protected int connectChannel(TorChannel channel, java.lang.String addr, int port)
addr
- address of the server you want do connectport
- port
public boolean isAllowed(java.lang.String adr, int port)
adr
- addressport
- port
public void setMaxNrOfStreams(int i)
i
- number of streamspublic void run()
run
in interface java.lang.Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |