Vidalia 0.3.1
|
#include <Stream.h>
Public Types | |
enum | Status { Unknown , New , NewResolve , SentConnect , SentResolve , Succeeded , Failed , Closed , Detached , Remap } |
Public Member Functions | |
Stream () | |
Stream (const StreamId &streamId, Status status, const CircuitId &circuitId, const QString &target) | |
Stream (const StreamId &streamId, Status status, const CircuitId &circuitId, const QString &address, quint16 port) | |
bool | isValid () const |
StreamId | id () const |
Status | status () const |
QString | statusString () const |
CircuitId | circuitId () const |
QString | target () const |
QString | targetAddress () const |
quint16 | targetPort () const |
Static Public Member Functions | |
static Stream | fromString (const QString &stream) |
static Status | toStatus (const QString &strStatus) |
static bool | isValidStreamId (const StreamId &streamId) |
Private Attributes | |
StreamId | _streamId |
CircuitId | _circuitId |
QString | _address |
Status | _status |
quint16 | _port |
enum Stream::Status |
Stream status values
Enumerator | |
---|---|
Unknown | Unknown status type given |
New | New request to connect |
NewResolve | New request to resolve an address |
SentConnect | Sent a connect cell |
SentResolve | Sent a resolve cell |
Succeeded | Stream established |
Failed | Stream failed |
Closed | Stream closed |
Detached | Detached from circuit |
Remap | Address re-mapped to another |
Stream::Stream | ( | ) |
Default constructor
Default constructor.
Definition at line 23 of file Stream.cpp.
References _port, _status, and Unknown.
Referenced by fromString().
Stream::Stream | ( | const StreamId & | streamId, |
Status | status, | ||
const CircuitId & | circuitId, | ||
const QString & | target | ||
) |
Constructor
Definition at line 42 of file Stream.cpp.
References _address, _circuitId, _port, _status, _streamId, circuitId(), i(), status(), and target().
Stream::Stream | ( | const StreamId & | streamId, |
Status | status, | ||
const CircuitId & | circuitId, | ||
const QString & | address, | ||
quint16 | port | ||
) |
Constructor
Definition at line 30 of file Stream.cpp.
References _address, _circuitId, _port, _status, _streamId, circuitId(), and status().
|
inline |
Returns the ID of the circuit to which this stream is assigned.
Definition at line 74 of file Stream.h.
References _circuitId.
Referenced by CircuitListWidget::addStream(), NetViewer::addStream(), and Stream().
|
static |
Parses the given string for a stream, in Tor control protocol format.
Parses the given string for stream information, given in Tor control protocol format. The format is:
StreamID SP StreamStatus SP CircID SP Target
Definition at line 63 of file Stream.cpp.
References status(), Stream(), target(), and toStatus().
Referenced by TorControl::getStreams(), and TorEvents::handleStreamStatus().
|
inline |
Returns the ID for this stream.
Definition at line 68 of file Stream.h.
References _streamId.
Referenced by CircuitListWidget::addStream(), NetViewer::addStream(), and StreamItem::id().
bool Stream::isValid | ( | ) | const |
Returns true iff the Stream object's fields are all valid.
Returns true if all fields in this Stream object are valid.
Definition at line 146 of file Stream.cpp.
References _address, _circuitId, _status, _streamId, Circuit::isValidCircuitId(), isValidStreamId(), and Unknown.
Referenced by TorControl::getStreams(), and TorEvents::handleStreamStatus().
Returns true iff streamId consists of only between 1 and 16 (inclusive) ASCII-encoded letters and numbers.
Definition at line 84 of file Stream.cpp.
References i().
Referenced by isValid().
|
inline |
Returns the status for this stream.
Definition at line 70 of file Stream.h.
References _status.
Referenced by CircuitListWidget::addStream(), NetViewer::addStream(), fromString(), statusString(), and Stream().
QString Stream::statusString | ( | ) | const |
Returns a string representation of this stream's status.
Returns a human-understandable string representation of this stream's status.
Definition at line 126 of file Stream.cpp.
References _status, Closed, Detached, Failed, New, NewResolve, Remap, SentConnect, SentResolve, status(), and Succeeded.
Referenced by StreamItem::update().
|
inline |
Returns the target address and port for this stream.
Definition at line 76 of file Stream.h.
References _address, and _port.
Referenced by fromString(), Stream(), and StreamItem::StreamItem().
|
inline |
Returns the target address for this stream.
Definition at line 78 of file Stream.h.
References _address.
Referenced by NetViewer::addStream().
|
inline |
Returns the target port for this stream.
Definition at line 80 of file Stream.h.
References _port.
Referenced by NetViewer::addStream().
|
static |
Converts a string description of a stream's status to its enum value
Definition at line 100 of file Stream.cpp.
References Closed, Detached, Failed, New, NewResolve, Remap, SentConnect, SentResolve, Succeeded, and Unknown.
Referenced by fromString().
|
private |
|
private |
ID of the circuit carrying this stream.
Definition at line 88 of file Stream.h.
Referenced by circuitId(), isValid(), and Stream().
|
private |
|
private |
|
private |