Vidalia 0.2.10
|
#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
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 24 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 43 of file Stream.cpp.
References _address, _circuitId, _port, _status, _streamId, circuitId(), i(), and status().
Stream::Stream | ( | const StreamId & | streamId, |
Status | status, | ||
const CircuitId & | circuitId, | ||
const QString & | address, | ||
quint16 | port | ||
) |
Constructor
Definition at line 31 of file Stream.cpp.
References _address, _circuitId, _port, _status, _streamId, circuitId(), and status().
CircuitId Stream::circuitId | ( | ) | const [inline] |
Returns the ID of the circuit to which this stream is assigned.
Definition at line 75 of file Stream.h.
References _circuitId.
Referenced by NetViewer::addStream(), CircuitListWidget::addStream(), and Stream().
Stream Stream::fromString | ( | const QString & | 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 64 of file Stream.cpp.
References status(), Stream(), target(), and toStatus().
Referenced by TorControl::getStreams(), and TorEvents::handleStreamStatus().
StreamId Stream::id | ( | ) | const [inline] |
Returns the ID for this stream.
Definition at line 69 of file Stream.h.
References _streamId.
Referenced by NetViewer::addStream(), CircuitListWidget::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 147 of file Stream.cpp.
References _address, _circuitId, _status, _streamId, Circuit::isValidCircuitId(), isValidStreamId(), and Unknown.
Referenced by TorControl::getStreams(), and TorEvents::handleStreamStatus().
bool Stream::isValidStreamId | ( | const StreamId & | streamId | ) | [static] |
Returns true iff streamId consists of only between 1 and 16 (inclusive) ASCII-encoded letters and numbers.
Definition at line 85 of file Stream.cpp.
References i().
Referenced by isValid().
Status Stream::status | ( | ) | const [inline] |
Returns the status for this stream.
Definition at line 71 of file Stream.h.
References _status.
Referenced by NetViewer::addStream(), CircuitListWidget::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 127 of file Stream.cpp.
References _status, Closed, Detached, Failed, New, NewResolve, Remap, SentConnect, SentResolve, status(), and Succeeded.
Referenced by StreamItem::update().
QString Stream::target | ( | ) | const [inline] |
Returns the target address and port for this stream.
Definition at line 77 of file Stream.h.
References _address, and _port.
Referenced by fromString(), and StreamItem::StreamItem().
QString Stream::targetAddress | ( | ) | const [inline] |
Returns the target address for this stream.
Definition at line 79 of file Stream.h.
References _address.
Referenced by NetViewer::addStream().
quint16 Stream::targetPort | ( | ) | const [inline] |
Returns the target port for this stream.
Definition at line 81 of file Stream.h.
References _port.
Referenced by NetViewer::addStream().
Stream::Status Stream::toStatus | ( | const QString & | strStatus | ) | [static] |
Converts a string description of a stream's status to its enum value
Definition at line 101 of file Stream.cpp.
References Closed, Detached, Failed, New, NewResolve, Remap, SentConnect, SentResolve, Succeeded, and Unknown.
Referenced by fromString().
QString Stream::_address [private] |
CircuitId Stream::_circuitId [private] |
ID of the circuit carrying this stream.
Definition at line 89 of file Stream.h.
Referenced by circuitId(), isValid(), and Stream().
quint16 Stream::_port [private] |
Status Stream::_status [private] |
StreamId Stream::_streamId [private] |