Vidalia 0.2.12
|
#include <ServiceSettings.h>
Public Member Functions | |
ServiceSettings (TorControl *torControl) | |
QString | getVirtualPort () |
void | setVirtualPort (QString servicePort) |
QString | getServiceAddress () |
void | setServiceAddress (QString serviceAddress) |
QString | getPhysicalAddressPort () |
void | setPhysicalAddressPort (QString physicalAddress) |
bool | isEnabled () |
void | setEnabled (bool enabled) |
ServiceList | getServices () |
void | setServices (ServiceList services) |
QString | getHiddenServiceDirectories () |
void | applyServices (QString value, QString *errmsg) |
void | unpublishAllServices (QString *errmsg) |
Private Attributes | |
TorControl * | _torControl |
Definition at line 22 of file ServiceSettings.h.
ServiceSettings::ServiceSettings | ( | TorControl * | torControl | ) |
Constructor
Constructor.
torControl | a TorControl object used to read and apply the Service configuration settings. |
Definition at line 27 of file ServiceSettings.cpp.
References _torControl, VSettings::setDefault(), SETTING_SERVICE_ENABLED, SETTING_SERVICE_PHYSICAL_ADDRESS, and SETTING_SERVICE_VIRTUAL_PORT.
void ServiceSettings::applyServices | ( | QString | value, |
QString * | errmsg | ||
) |
Set all services the user wants to start and send it to the Tor Controller
Definition at line 154 of file ServiceSettings.cpp.
References _torControl, TorControl::saveConf(), and TorControl::setConf().
Referenced by ServicePage::startServicesInTor().
QString ServiceSettings::getHiddenServiceDirectories | ( | ) |
Get Service Directories
Get all service directories from Tor
Definition at line 143 of file ServiceSettings.cpp.
References _torControl, TorControl::getHiddenServiceConf(), and VSettings::value().
Referenced by ServicePage::load().
QString ServiceSettings::getPhysicalAddressPort | ( | ) |
Returns the service address or hostname for a specific service
Returns the physical address for a specific service
Definition at line 114 of file ServiceSettings.cpp.
References SETTING_SERVICE_PHYSICAL_ADDRESS, and VSettings::value().
QString ServiceSettings::getServiceAddress | ( | ) |
Returns the .onion - service address for a specific service
Definition at line 99 of file ServiceSettings.cpp.
References SETTING_SERVICE_ADDRESS, and VSettings::value().
ServiceList ServiceSettings::getServices | ( | ) |
Returns a ServiceList containing all services
Get serialised ServiceList
Definition at line 51 of file ServiceSettings.cpp.
References ServiceList::addService(), Service::setAdditionalServiceOptions(), SETTING_TOR_SERVICES, and VSettings::value().
Referenced by ServicePage::load().
QString ServiceSettings::getVirtualPort | ( | ) |
Returns the service port for a specific service
Returns the virtual port for a specific service
Definition at line 84 of file ServiceSettings.cpp.
References SETTING_SERVICE_VIRTUAL_PORT, and VSettings::value().
bool ServiceSettings::isEnabled | ( | ) |
Returns if the Service is enabled
Definition at line 129 of file ServiceSettings.cpp.
References SETTING_SERVICE_ENABLED, and VSettings::value().
void ServiceSettings::setEnabled | ( | bool | boolean | ) |
Set the service enabled
Definition at line 136 of file ServiceSettings.cpp.
References SETTING_SERVICE_ENABLED, and VSettings::setValue().
void ServiceSettings::setPhysicalAddressPort | ( | QString | addr | ) |
Set the service address or hostname for a specific service
Set the physical address or hostname for a specific service
Definition at line 122 of file ServiceSettings.cpp.
References SETTING_SERVICE_PHYSICAL_ADDRESS, and VSettings::setValue().
void ServiceSettings::setServiceAddress | ( | QString | addr | ) |
Set the .onion - service address for a specific service
Set the .onion - service address or hostname for a specific service
Definition at line 107 of file ServiceSettings.cpp.
References SETTING_SERVICE_ADDRESS, and VSettings::setValue().
void ServiceSettings::setServices | ( | ServiceList | service | ) |
Set ServiceList to serialise it
Definition at line 37 of file ServiceSettings.cpp.
References ServiceList::services(), SETTING_TOR_SERVICES, VSettings::setValue(), and Service::toString().
Referenced by ServicePage::save().
void ServiceSettings::setVirtualPort | ( | QString | servicePort | ) |
Set the service port for a specific service
Set the virtual port for a specific service
Definition at line 92 of file ServiceSettings.cpp.
References SETTING_SERVICE_VIRTUAL_PORT, and VSettings::setValue().
void ServiceSettings::unpublishAllServices | ( | QString * | errmsg | ) |
Unpublish all services
Unpublish all HiddenServices
Definition at line 162 of file ServiceSettings.cpp.
References _torControl, TorControl::resetConf(), and TorControl::saveConf().
Referenced by ServicePage::save().
TorControl* ServiceSettings::_torControl [private] |
A TorControl object used to talk to Tor.
Definition at line 57 of file ServiceSettings.h.
Referenced by applyServices(), getHiddenServiceDirectories(), ServiceSettings(), and unpublishAllServices().