|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.tor.Circuit
public class Circuit
Field Summary | |
---|---|
private boolean |
m_bReceivedCreatedOrExtendedCell
|
private CellQueue |
m_cellQueue
|
private int |
m_circID
|
private int |
m_circuitLength
|
private boolean |
m_destroyed
|
private java.util.Date |
m_destroyTime
|
private OnionRouter |
m_FirstOR
|
private FirstOnionRouterConnection |
m_FirstORConnection
|
private ORDescription |
m_lastORDescription
|
private int |
m_MaxStreamsPerCircuit
|
private static long |
m_minCircuitLifetime
|
private java.lang.Object |
m_oDeliverSync
|
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_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
|
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 | |
---|---|
void |
close()
closes the circuit immediately. |
protected void |
close(int streamID)
closes a stream |
protected void |
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 |
private void |
deliverCells()
delivers the cells if the FOR accept more cells |
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 |
send(Cell cell)
sends a cell through the circuit |
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 ORDescription 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 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 int m_recvCellCounter
private int m_sendCellCounter
private boolean m_destroyed
private CellQueue m_cellQueue
private byte[] m_resolvedData
private java.lang.Object m_oResolveSync
private java.lang.Object m_oDeliverSync
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.util.Date m_destroyTime
private static long m_minCircuitLifetime
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 |
---|
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
private void deliverCells() throws java.io.IOException
java.lang.Exception
java.io.IOException
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 void connectChannel(TorChannel channel, java.lang.String addr, int port) throws java.io.IOException
addr
- address of the server you want do connectport
- port
java.io.IOException
public boolean isAllowed(java.lang.String adr, int port)
adr
- addressport
- port
public void setMaxNrOfStreams(int i)
i
- number of streams
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |