Vidalia
0.2.21
|
#include <RouterDescriptor.h>
Public Types | |
enum | RouterStatusEnum { Online, Hibernating, Offline } |
Public Member Functions | |
RouterDescriptor (bool microdesc=false) | |
RouterDescriptor (QStringList descriptor, bool microdesc=false) | |
QString | name () const |
QHostAddress | ip () const |
quint16 | orPort () const |
quint16 | dirPort () const |
QString | id () const |
QString | platform () const |
quint64 | uptime () const |
QString | contact () const |
QDateTime | published () const |
QString | fingerprint () const |
quint64 | averageBandwidth () const |
quint64 | burstBandwidth () const |
quint64 | observedBandwidth () const |
bool | online () const |
bool | offline () const |
bool | hibernating () const |
bool | isEmpty () |
QString | status () |
QString | location () const |
void | setLocation (QString location) |
void | setOffline (bool offline) |
QString | onionKey () const |
QString | family () const |
QString | exitPolicy () const |
void | appendRouterStatusInfo (const RouterStatus &rs) |
Private Member Functions | |
void | parseDescriptor (QStringList descriptor) |
Private Attributes | |
RouterStatusEnum | _status |
QString | _id |
QString | _name |
QString | _fingerprint |
QString | _platform |
QString | _contact |
QHostAddress | _ip |
quint16 | _orPort |
quint16 | _dirPort |
QDateTime | _published |
quint64 | _uptime |
quint64 | _avgBandwidth |
quint64 | _burstBandwidth |
quint64 | _observedBandwidth |
QString | _location |
bool | _microdesc |
QString | _onionKey |
QString | _exitPolicy |
QString | _family |
Definition at line 27 of file RouterDescriptor.h.
Possible router states.
Online |
Router is online and reachable. |
Hibernating |
Router is currently hibernating. |
Offline |
Router is unresponsive. |
Definition at line 33 of file RouterDescriptor.h.
|
inline |
Default constructor.
Definition at line 40 of file RouterDescriptor.h.
RouterDescriptor::RouterDescriptor | ( | QStringList | descriptor, |
bool | microdesc = false |
||
) |
Constructor.
Constructor. Just assigns the ID and determines whether the router is responsive or not based on the presence of a "!" at the start of the ID. See tor-spec.txt for details.
Definition at line 24 of file RouterDescriptor.cpp.
References _status, Online, and parseDescriptor().
void RouterDescriptor::appendRouterStatusInfo | ( | const RouterStatus & | rs | ) |
Uses the RouterStatus information to update key elements of the descriptor
Definition at line 102 of file RouterDescriptor.cpp.
References _avgBandwidth, _burstBandwidth, _dirPort, _id, _ip, _name, _observedBandwidth, _orPort, _published, RouterStatus::bandwidth(), RouterStatus::dirPort(), RouterStatus::id(), RouterStatus::ipAddress(), RouterStatus::name(), RouterStatus::orPort(), and RouterStatus::published().
Referenced by NetViewer::loadNetworkStatus().
|
inline |
Returns the average bandwidth for this router.
Definition at line 65 of file RouterDescriptor.h.
References _avgBandwidth.
Referenced by TorMapWidget::addRouter(), RouterDescriptorView::display(), and RouterListItem::update().
|
inline |
Returns the burst bandwidth for this router.
Definition at line 67 of file RouterDescriptor.h.
References _burstBandwidth.
Referenced by TorMapWidget::addRouter(), RouterDescriptorView::display(), and RouterListItem::update().
|
inline |
Returns the router's contact information.
Definition at line 59 of file RouterDescriptor.h.
References _contact.
Referenced by RouterInfoDialog::setRouterInfo().
|
inline |
Returns the router's DirPort.
Definition at line 51 of file RouterDescriptor.h.
References _dirPort.
|
inline |
Returns this router's exit policy
Definition at line 96 of file RouterDescriptor.h.
References _exitPolicy.
|
inline |
|
inline |
Returns the fingerprint for this router.
Definition at line 63 of file RouterDescriptor.h.
References _fingerprint.
|
inline |
Returns true if this router is hibernating.
Definition at line 75 of file RouterDescriptor.h.
References _status, and Hibernating.
Referenced by RouterInfoDialog::setRouterInfo(), and RouterListItem::update().
|
inline |
Returns the router's ID.
Definition at line 53 of file RouterDescriptor.h.
References _id.
Referenced by TorMapImageView::addRouter(), TorMapWidget::addRouter(), RouterListWidget::addRouter(), and RouterListItem::id().
|
inline |
Returns the router's IP address.
Definition at line 47 of file RouterDescriptor.h.
References _ip.
Referenced by NetViewer::addRouter(), RouterDescriptorView::display(), and RouterInfoDialog::setRouterInfo().
|
inline |
Returns true if the router has neither a nickname or an ID.
Definition at line 77 of file RouterDescriptor.h.
Referenced by RouterDescriptorView::display(), NetViewer::loadNetworkStatus(), and NetViewer::newDescriptors().
|
inline |
Returns geographic location information for this router. Note that this information is NOT part of the Tor directory protocol, but can be determined out of band and set using setLocation().
Definition at line 84 of file RouterDescriptor.h.
References _location.
Referenced by RouterDescriptorView::display(), and setLocation().
|
inline |
Returns the router's name.
Definition at line 45 of file RouterDescriptor.h.
References _name.
Referenced by TorMapWidget::addRouter(), RouterDescriptorView::display(), RouterListItem::name(), RouterInfoDialog::setRouterInfo(), and RouterListItem::update().
|
inline |
Returns the observed bandwidth for this router.
Definition at line 69 of file RouterDescriptor.h.
References _observedBandwidth.
Referenced by TorMapWidget::addRouter(), RouterDescriptorView::display(), RouterInfoDialog::setRouterInfo(), and RouterListItem::update().
|
inline |
Returns true if this router is unresponsive.
Definition at line 73 of file RouterDescriptor.h.
References _status, and Offline.
Referenced by RouterDescriptorView::display(), and RouterListItem::update().
|
inline |
Microdescriptor Returns the onion key for this router
Definition at line 92 of file RouterDescriptor.h.
References _onionKey.
|
inline |
Returns true if this router is online and responsive.
Definition at line 71 of file RouterDescriptor.h.
|
inline |
|
private |
Parses this router's descriptor for relevant information.
Definition at line 32 of file RouterDescriptor.cpp.
References _avgBandwidth, _burstBandwidth, _contact, _dirPort, _exitPolicy, _family, _fingerprint, _id, _ip, _microdesc, _name, _observedBandwidth, _onionKey, _orPort, _platform, _published, _status, _uptime, and Hibernating.
Referenced by RouterDescriptor().
|
inline |
Returns the platform on which this router is running.
Definition at line 55 of file RouterDescriptor.h.
References _platform.
Referenced by RouterDescriptorView::display(), RouterInfoDialog::setRouterInfo(), and RouterListItem::update().
|
inline |
Returns the date and time the router was published.
Definition at line 61 of file RouterDescriptor.h.
References _published.
Referenced by RouterDescriptorView::display(), and RouterInfoDialog::setRouterInfo().
|
inline |
Sets geographic location information for this router.
Definition at line 86 of file RouterDescriptor.h.
References _location, and location().
Referenced by RouterListItem::setLocation().
|
inline |
Sets the descriptors status to Offline if offline is true.
Definition at line 88 of file RouterDescriptor.h.
QString RouterDescriptor::status | ( | ) |
Returns a string representation of the status of this router.
Definition at line 91 of file RouterDescriptor.cpp.
References _status, Hibernating, and Online.
Referenced by RouterDescriptorView::display().
|
inline |
Returns the length of time this router has been up.
Definition at line 57 of file RouterDescriptor.h.
References _uptime.
Referenced by RouterDescriptorView::display(), and RouterInfoDialog::setRouterInfo().
|
private |
Average bandwidth.
Definition at line 117 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), averageBandwidth(), and parseDescriptor().
|
private |
Burst bandwidth.
Definition at line 118 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), burstBandwidth(), and parseDescriptor().
|
private |
Router operator contact information.
Definition at line 111 of file RouterDescriptor.h.
Referenced by contact(), and parseDescriptor().
|
private |
Router's DirPort.
Definition at line 114 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), dirPort(), and parseDescriptor().
|
private |
Router SSL key
Definition at line 125 of file RouterDescriptor.h.
Referenced by exitPolicy(), and parseDescriptor().
|
private |
Exit policy
Definition at line 126 of file RouterDescriptor.h.
Referenced by family(), and parseDescriptor().
|
private |
Router's fingerprint.
Definition at line 109 of file RouterDescriptor.h.
Referenced by fingerprint(), and parseDescriptor().
|
private |
Router's descriptor ID.
Definition at line 107 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), id(), isEmpty(), and parseDescriptor().
|
private |
Router's IP address.
Definition at line 112 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), ip(), and parseDescriptor().
|
private |
Geographic location information.
Definition at line 120 of file RouterDescriptor.h.
Referenced by location(), and setLocation().
|
private |
Microdescriptor info
Definition at line 123 of file RouterDescriptor.h.
Referenced by parseDescriptor().
|
private |
The router's name.
Definition at line 108 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), isEmpty(), name(), and parseDescriptor().
|
private |
Observed bandwidth.
Definition at line 119 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), observedBandwidth(), and parseDescriptor().
|
private |
Definition at line 124 of file RouterDescriptor.h.
Referenced by onionKey(), and parseDescriptor().
|
private |
Router's ORPort.
Definition at line 113 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), orPort(), and parseDescriptor().
|
private |
Platform on which router is running.
Definition at line 110 of file RouterDescriptor.h.
Referenced by parseDescriptor(), and platform().
|
private |
Date router descriptor was published.
Definition at line 115 of file RouterDescriptor.h.
Referenced by appendRouterStatusInfo(), parseDescriptor(), and published().
|
private |
Availability status of this router.
Definition at line 106 of file RouterDescriptor.h.
Referenced by hibernating(), offline(), online(), parseDescriptor(), RouterDescriptor(), setOffline(), and status().
|
private |
Time the router has been online.
Definition at line 116 of file RouterDescriptor.h.
Referenced by parseDescriptor(), and uptime().