BootstrapStatus Class Reference

#include <bootstrapstatus.h>

List of all members.

Public Types

 UnrecognizedStatus
 ConnectingToDirMirror
 HandshakingWithDirMirror
 CreatingOneHopCircuit
 RequestingNetworkStatus
 LoadingNetworkStatus
 LoadingAuthorityCertificates
 RequestingDescriptors
 LoadingDescriptors
 ConnectingToEntryGuard
 HandshakingWithEntryGuard
 EstablishingCircuit
 BootstrappingDone
 UnrecognizedRecommendation
 RecommendIgnore
 RecommendWarn
enum  Status {
  UnrecognizedStatus, ConnectingToDirMirror, HandshakingWithDirMirror, CreatingOneHopCircuit,
  RequestingNetworkStatus, LoadingNetworkStatus, LoadingAuthorityCertificates, RequestingDescriptors,
  LoadingDescriptors, ConnectingToEntryGuard, HandshakingWithEntryGuard, EstablishingCircuit,
  BootstrappingDone
}
enum  Recommendation { UnrecognizedRecommendation, RecommendIgnore, RecommendWarn }

Public Member Functions

 BootstrapStatus ()
 BootstrapStatus (tc::Severity severity, Status status, int percentComplete, const QString &description, const QString &warning=QString(), tc::ConnectionStatusReason reason=tc::UnrecognizedReason, Recommendation action=UnrecognizedRecommendation)
tc::Severity severity () const
Status status () const
int percentComplete () const
QString description () const
QString warning () const
tc::ConnectionStatusReason reason () const
Recommendation recommendedAction () const
bool isValid () const

Static Public Member Functions

static Status statusFromString (const QString &tag)
static Recommendation actionFromString (const QString &str)

Private Attributes

tc::Severity _severity
Status _status
int _percentComplete
QString _description
QString _warning
tc::ConnectionStatusReason _reason
Recommendation _action


Detailed Description

Definition at line 24 of file bootstrapstatus.h.


Member Enumeration Documentation

enum BootstrapStatus::Recommendation

Actions the Tor software might recommend controllers take in response to a bootstrap status problem event.

Enumerator:
UnrecognizedRecommendation 
RecommendIgnore 
RecommendWarn 

Definition at line 46 of file bootstrapstatus.h.

enum BootstrapStatus::Status

Currently enumerated bootstrapping states defined by Tor's control protocol (Tor >= 0.2.1.0-alpha-dev.

Enumerator:
UnrecognizedStatus 
ConnectingToDirMirror 
HandshakingWithDirMirror 
CreatingOneHopCircuit 
RequestingNetworkStatus 
LoadingNetworkStatus 
LoadingAuthorityCertificates 
RequestingDescriptors 
LoadingDescriptors 
ConnectingToEntryGuard 
HandshakingWithEntryGuard 
EstablishingCircuit 
BootstrappingDone 

Definition at line 29 of file bootstrapstatus.h.


Constructor & Destructor Documentation

BootstrapStatus::BootstrapStatus (  ) 

Default constructor.

Definition at line 20 of file bootstrapstatus.cpp.

References _action, _percentComplete, _reason, _severity, _status, tc::UnrecognizedReason, UnrecognizedRecommendation, tc::UnrecognizedSeverity, and UnrecognizedStatus.

BootstrapStatus::BootstrapStatus ( tc::Severity  severity,
Status  status,
int  percentComplete,
const QString &  description,
const QString &  warning = QString(),
tc::ConnectionStatusReason  reason = tc::UnrecognizedReason,
Recommendation  action = UnrecognizedRecommendation 
)

Constructor.

Definition at line 30 of file bootstrapstatus.cpp.

References _action, _description, _percentComplete, _reason, _severity, _status, and _warning.


Member Function Documentation

BootstrapStatus::Recommendation BootstrapStatus::actionFromString ( const QString &  str  )  [static]

Converts a string RECOMMENDATION value to a RecommendAction enum value.

Definition at line 80 of file bootstrapstatus.cpp.

References RecommendIgnore, RecommendWarn, and UnrecognizedRecommendation.

Referenced by TorControl::bootstrapStatus(), and TorEvents::dispatchClientStatusEvent().

QString BootstrapStatus::description (  )  const [inline]

Returns a description of Tor's current bootstrapping status.

Definition at line 75 of file bootstrapstatus.h.

References _description.

Referenced by BootstrapStatusEvent::description().

bool BootstrapStatus::isValid (  )  const

Returns true if this object represents a valid bootstrap status phase.

Definition at line 91 of file bootstrapstatus.cpp.

References _percentComplete, _severity, _status, tc::UnrecognizedSeverity, and UnrecognizedStatus.

int BootstrapStatus::percentComplete (  )  const [inline]

Returns an integer between 0 and 100 representing an estimate of how much of Tor's bootstrapping process it has completed.

Definition at line 72 of file bootstrapstatus.h.

References _percentComplete.

Referenced by MainWindow::bootstrapStatusChanged(), and BootstrapStatusEvent::percentComplete().

tc::ConnectionStatusReason BootstrapStatus::reason (  )  const [inline]

Returns a ConnectionStatusReason enum value describing the most recent error Tor encountered while attempting to bootstrap, if this event's severity is 'warn'. Otherwise, this simply returns tc::UnrecognizedReason.

Definition at line 86 of file bootstrapstatus.h.

References _reason.

Referenced by MainWindow::bootstrapStatusChanged(), and BootstrapStatusEvent::reason().

Recommendation BootstrapStatus::recommendedAction (  )  const [inline]

Returns the action that the Tor software recommended be taken in response to this bootstrap status event.

Definition at line 90 of file bootstrapstatus.h.

References _action.

Referenced by MainWindow::bootstrapStatusChanged(), and BootstrapStatusEvent::recommendedAction().

tc::Severity BootstrapStatus::severity (  )  const [inline]

Returns the severity of this bootstrap status event.

Definition at line 64 of file bootstrapstatus.h.

References _severity.

Referenced by MainWindow::bootstrapStatusChanged().

Status BootstrapStatus::status (  )  const [inline]

Returns the BootstrapStatus enum value indicated by this bootstrap status event.

Definition at line 68 of file bootstrapstatus.h.

References _status.

Referenced by MainWindow::bootstrapStatusChanged().

BootstrapStatus::Status BootstrapStatus::statusFromString ( const QString &  tag  )  [static]

Converts a string TAG value to a BootstrapStatus enum value.

Definition at line 48 of file bootstrapstatus.cpp.

References BootstrappingDone, ConnectingToDirMirror, ConnectingToEntryGuard, CreatingOneHopCircuit, EstablishingCircuit, HandshakingWithDirMirror, HandshakingWithEntryGuard, LoadingAuthorityCertificates, LoadingDescriptors, LoadingNetworkStatus, RequestingDescriptors, RequestingNetworkStatus, and UnrecognizedStatus.

Referenced by TorControl::bootstrapStatus(), and TorEvents::dispatchClientStatusEvent().

QString BootstrapStatus::warning (  )  const [inline]

Returns a description of the most recent error Tor encountered while attempting to bootstrap, if this event's severity is 'warn'. Otherwise, this returns a default-constructed QString.

Definition at line 80 of file bootstrapstatus.h.

References _warning.

Referenced by BootstrapStatusEvent::warning().


Member Data Documentation

Recommendation BootstrapStatus::_action [private]

Recommendation enum value describing Tor's suggested response to this bootstrap status event.

See also:
recommendedAction

Definition at line 139 of file bootstrapstatus.h.

Referenced by BootstrapStatus(), and recommendedAction().

QString BootstrapStatus::_description [private]

Description of Tor's current bootstrapping status.

See also:
description

Definition at line 121 of file bootstrapstatus.h.

Referenced by BootstrapStatus(), and description().

int BootstrapStatus::_percentComplete [private]

Approximate percentage of Tor's bootstrapping process that is complete.

See also:
percentComplete

Definition at line 116 of file bootstrapstatus.h.

Referenced by BootstrapStatus(), isValid(), and percentComplete().

tc::ConnectionStatusReason BootstrapStatus::_reason [private]

ConnectionStatusReason enum value describing the most recent error Tor encountered while attempting to bootstrap.

See also:
reason

Definition at line 133 of file bootstrapstatus.h.

Referenced by BootstrapStatus(), and reason().

tc::Severity BootstrapStatus::_severity [private]

Severity of the current bootstrap status.

See also:
severity

Definition at line 106 of file bootstrapstatus.h.

Referenced by BootstrapStatus(), isValid(), and severity().

Status BootstrapStatus::_status [private]

Current bootstrapping status value.

See also:
status

Definition at line 111 of file bootstrapstatus.h.

Referenced by BootstrapStatus(), isValid(), and status().

QString BootstrapStatus::_warning [private]

Description of the most recent error Tor encountered while attempting to bootstrap.

See also:
warning

Definition at line 127 of file bootstrapstatus.h.

Referenced by BootstrapStatus(), and warning().


The documentation for this class was generated from the following files:
Generated on Tue Jul 7 16:58:27 2009 for Vidalia by  doxygen 1.4.7