Vidalia
0.2.21
|
#include <ExitPolicy.h>
Public Types | |
enum | SpecialExitPolicy { Default, Middleman } |
Public Member Functions | |
ExitPolicy () | |
ExitPolicy (SpecialExitPolicy exitPolicy) | |
ExitPolicy (QString exitPolicy) | |
void | addAcceptedPorts (QStringList portList) |
bool | acceptsPorts (QStringList portList) |
void | addRejectedPorts (QStringList portList) |
bool | rejectsPorts (QStringList portList) |
void | addPolicy (Policy policy) |
void | removePolicy (Policy policy) |
bool | contains (Policy policy) |
QList< Policy > | policyList () |
QString | toString () |
Private Attributes | |
QList< Policy > | _exitPolicy |
Definition at line 26 of file ExitPolicy.h.
Special exit policy types.
Default |
Specifies the default exit policy. |
Middleman |
Specifies a middleman-only exit policy. |
Definition at line 30 of file ExitPolicy.h.
ExitPolicy::ExitPolicy | ( | ) |
ExitPolicy::ExitPolicy | ( | SpecialExitPolicy | exitPolicy | ) |
Creates an exit policy of the given special type.
Constructor. Creates an exit policy based on the given type.
Definition at line 27 of file ExitPolicy.cpp.
References _exitPolicy, Default, Middleman, and Policy::RejectAll.
ExitPolicy::ExitPolicy | ( | QString | exitPolicy | ) |
Creates an exit policy from the given comma-delimited list of policies.
Parses the given string for a comma-delimited list of policies and adds them to this this policy.
Definition at line 49 of file ExitPolicy.cpp.
References addPolicy(), and policyList().
bool ExitPolicy::acceptsPorts | ( | QStringList | portList | ) |
Returns true if this exit policy accepts all ports specified in portList. Ports in portList may be given either individually or as ranges.
Returns true if this exit policy accepts all ports specified in portList. Ports in portList may be given either individually or in ranges (e.g., "6660-6669").
Definition at line 94 of file ExitPolicy.cpp.
References contains().
Referenced by ServerPage::loadExitPolicies().
void ExitPolicy::addAcceptedPorts | ( | QStringList | portList | ) |
Adds the ports specified in portList to a list of ports accepted by this exit policy. Ports may be given either individually or as ranges.
Definition at line 83 of file ExitPolicy.cpp.
References addPolicy().
Referenced by ServerPage::saveExitPolicies().
void ExitPolicy::addPolicy | ( | Policy | policy | ) |
Adds a rule to the exit policy.
Adds a policy to this exit policy.
Definition at line 61 of file ExitPolicy.cpp.
References _exitPolicy, and contains().
Referenced by addAcceptedPorts(), addRejectedPorts(), ExitPolicy(), and ServerPage::saveExitPolicies().
void ExitPolicy::addRejectedPorts | ( | QStringList | portList | ) |
Adds the ports specified in portList to a list of ports rejected by this exit policy. Ports may be given either individually or as ranges.
Definition at line 107 of file ExitPolicy.cpp.
References addPolicy().
Referenced by ServerPage::saveExitPolicies().
bool ExitPolicy::contains | ( | Policy | policy | ) |
Checks if the current exit policy contains the given rule.
Returns true if this exit policy contains the given policy.
Definition at line 130 of file ExitPolicy.cpp.
References _exitPolicy, Policy::AcceptAll, Default, ExitPolicy(), Policy::matches(), p(), and Policy::RejectAll.
Referenced by acceptsPorts(), addPolicy(), ServerPage::loadExitPolicies(), and rejectsPorts().
|
inline |
Returns the list of policies for this exit policy.
Definition at line 65 of file ExitPolicy.h.
References _exitPolicy.
Referenced by ExitPolicy(), and toString().
bool ExitPolicy::rejectsPorts | ( | QStringList | portList | ) |
Returns true if this exit policy rejects all ports specified in portList. Ports in portList may be given either individually or as ranges.
Returns true if this exit policy rejects all ports specified in portList. Ports in portList may be given either individually or in ranges (e.g., "6660-6669").
Definition at line 118 of file ExitPolicy.cpp.
References contains().
Referenced by ServerPage::loadExitPolicies().
void ExitPolicy::removePolicy | ( | Policy | policy | ) |
Removes a rule from the exit policy.
Removes a policy from this exit policy.
Definition at line 70 of file ExitPolicy.cpp.
References _exitPolicy, and i().
QString ExitPolicy::toString | ( | ) |
Converts the exit policy to a format Tor understands.
Definition at line 156 of file ExitPolicy.cpp.
References _exitPolicy, policyList(), and Policy::toString().
Referenced by ServerPage::load(), and ServerSettings::setExitPolicy().
|
private |
A collection of policies forming the exit policy.
Definition at line 72 of file ExitPolicy.h.
Referenced by addPolicy(), contains(), ExitPolicy(), policyList(), removePolicy(), and toString().