#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 21 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 26 of file servicesettings.cpp.
References _torControl, VSettings::setDefault(), SETTING_SERVICE_ENABLED, SETTING_SERVICE_PHYSICAL_ADDRESS, and SETTING_SERVICE_VIRTUAL_PORT.
QString ServiceSettings::getVirtualPort | ( | ) |
Returns the service port for a specific service
Returns the virtual port for a specific service
Definition at line 83 of file servicesettings.cpp.
References SETTING_SERVICE_VIRTUAL_PORT, and VSettings::value().
void ServiceSettings::setVirtualPort | ( | QString | servicePort | ) |
Set the service port for a specific service
Set the virtual port for a specific service
Definition at line 91 of file servicesettings.cpp.
References SETTING_SERVICE_VIRTUAL_PORT, and VSettings::setValue().
QString ServiceSettings::getServiceAddress | ( | ) |
Returns the .onion - service address for a specific service
Definition at line 98 of file servicesettings.cpp.
References SETTING_SERVICE_ADDRESS, and VSettings::value().
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 106 of file servicesettings.cpp.
References SETTING_SERVICE_ADDRESS, and VSettings::setValue().
QString ServiceSettings::getPhysicalAddressPort | ( | ) |
Returns the service address or hostname for a specific service
Returns the physical address for a specific service
Definition at line 113 of file servicesettings.cpp.
References SETTING_SERVICE_PHYSICAL_ADDRESS, and VSettings::value().
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 121 of file servicesettings.cpp.
References SETTING_SERVICE_PHYSICAL_ADDRESS, and VSettings::setValue().
bool ServiceSettings::isEnabled | ( | ) |
Returns if the Service is enabled
Definition at line 128 of file servicesettings.cpp.
References SETTING_SERVICE_ENABLED, and VSettings::value().
void ServiceSettings::setEnabled | ( | bool | boolean | ) |
Set the service enabled
Definition at line 135 of file servicesettings.cpp.
References SETTING_SERVICE_ENABLED, and VSettings::setValue().
ServiceList ServiceSettings::getServices | ( | ) |
Returns a ServiceList containing all services
Get serialised ServiceList
Definition at line 50 of file servicesettings.cpp.
References ServiceList::addService(), Service::setAdditionalServiceOptions(), SETTING_TOR_SERVICES, and VSettings::value().
Referenced by ServicePage::load().
void ServiceSettings::setServices | ( | ServiceList | service | ) |
Set ServiceList to serialise it
Definition at line 36 of file servicesettings.cpp.
References ServiceList::services(), SETTING_TOR_SERVICES, VSettings::setValue(), and Service::toString().
Referenced by ServicePage::save().
QString ServiceSettings::getHiddenServiceDirectories | ( | ) |
Get Service Directories
Get all service directories from Tor
Definition at line 142 of file servicesettings.cpp.
References _torControl, TorControl::getHiddenServiceConf(), and VSettings::value().
Referenced by ServicePage::load().
void ServiceSettings::applyServices | ( | QString | value, | |
QString * | errmsg | |||
) |
Set all services the user wants to start and send it to the Tor Controller
Set all services the user wants to start and send it to the Tor Controller
Definition at line 153 of file servicesettings.cpp.
References _torControl, TorControl::saveConf(), and TorControl::setConf().
Referenced by ServicePage::startServicesInTor().
void ServiceSettings::unpublishAllServices | ( | QString * | errmsg | ) |
Unpublish all services
Unpublish all HiddenServices
Definition at line 161 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 56 of file servicesettings.h.
Referenced by applyServices(), getHiddenServiceDirectories(), ServiceSettings(), and unpublishAllServices().