#include <config.h>
Inheritance diagram for Config::
Public Methods | |
Config () | |
Creates a default configuration. More... | |
virtual | ~Config () |
int | save () |
Save to default configuration file. More... | |
int | save (string path) |
Write the configuration to the file specified. More... | |
void | save (std::ostream &out) |
Write configuration to specified output stream. More... | |
int | load () |
Load configuration from the default configuration file. More... | |
int | load (string path) |
Read in a configuration file from the specified path. More... | |
void | load (std::istream &in) |
Read in a configuration. More... | |
void | setValue (string category, string var, string val) |
void | setValue (string var, string val) |
Sets a value in the global namespace. More... | |
void | setValue (string var, bool val) |
void | setValue (string var, double val) |
void | setValue (string var, int val) |
string | getString (string category, string var) |
string | getString (string var) |
bool | getBool (string var) |
int | getInt (string var) |
double | getDouble (string var) |
bool | set (string var, string val) |
Set one of the config variables. More... | |
void | getHelpForVariables (std::ostream &out) |
prints out help for the set command. More... | |
ConnectionTableEntry * | getSelf () |
int | getMaxConnections () |
int | getMaxHosts () |
string | getPeerListFileName () |
double | getConnectPropagationProbability () |
double | getDiscoveryPropagationProbability () |
double | getDiscoveryResponseProbability () |
const string | getCertPath (void) |
int | getMinConnections (void) |
int | getRWTimeout (void) |
bool | doFastRouting () |
bool | avoidCensoredNodes () |
virtual void | toStream (std::ostream &out) |
Prints out the state of the Config object in human-readable format. More... | |
SslCtx * | getServerSslCtx (void) |
SslCtx * | getClientSslCtx (void) |
Static Public Methods | |
bool | matchTag (string buf, string tag) |
Returns true if tag is found as the first thing in buf. More... | |
bool | readBool (string buf, string tag) |
int | readInt (string buf, string tag) |
double | readDouble (string buf, string tag) |
string | readString (string buf, string tag) |
Static Public Attributes | |
const string | MAX_CONNECTIONS_TAG = "MaxConnections" |
const string | MAX_HOSTS_TAG = "MaxHosts" |
const string | CERTIFICATE_PATH_TAG = "CertPath" |
const string | MIN_CONNECTIONS_TAG = "MinConnections" |
const string | CPP_TAG = "ConnectPropagationProbability" |
const string | DPP_TAG = "DiscoveryPropagationProbability" |
const string | DRP_TAG = "DiscoveryResponseProbability" |
const string | RW_TIMEOUT_TAG = "ReadWriteTimeout" |
const string | DO_FAST_ROUTING_TAG = "DoFastRouting" |
const string | AVOID_CENSORED_NODES_TAG = "AvoidCensoredNodes" |
Private Attributes | |
int | m_maxConnections |
maximum size of connection tables - set this to one less than what you want. More... | |
int | m_maxHosts |
maximum size of each host list. More... | |
double | m_cpp |
Connect Propagation Probability. This represents the chance that the connect will propagate. More... | |
double | m_dpp |
Discovery Propagation Probability. More... | |
double | m_drp |
Discovery Response Probability. More... | |
bool | m_doFastRouting |
User wants to do fast routing. More... | |
bool | m_avoidCensoredNodes |
User wants connections to avoid censored nodes. More... | |
ConnectionTableEntry * | m_selfNode |
A Node describing yourself. More... | |
string | m_certPath |
path to our key/x509 cert file. More... | |
int | m_minConnections |
min. connections to create and keep open. More... | |
string | m_hostFile |
file name where list of nodes is stored. More... | |
int | m_rwTimeout |
read/write timeout in seconds. if zero, wait forever. More... | |
SslCtx * | m_serverSslCtx |
SSL Context for server side. More... | |
SslCtx * | m_clientSslCtx |
SSL Context for client side. More... | |
map< string, VariableList > | m_categoryList |
Most of the variables can be set by the user or developer. This class can read and write the configuration to/from a file.
Definition at line 8 of file config.h.
|
Creates a default configuration.
Definition at line 24 of file config.cpp. |
|
Definition at line 71 of file config.cpp. |
|
Definition at line 133 of file config.cpp. Referenced by SummaryScreenCommand::getHtmlInterface().
|
|
Definition at line 127 of file config.cpp. Referenced by SummaryScreenCommand::getHtmlInterface().
|
|
Definition at line 370 of file config.cpp. |
|
|
|
Definition at line 60 of file config.h. Referenced by SslConnection::connect().
|
|
Definition at line 109 of file config.cpp. Referenced by NetworkLayer::handleConnectPacket().
|
|
Definition at line 115 of file config.cpp. Referenced by NetworkLayer::handleDiscoveryPacket().
|
|
Definition at line 121 of file config.cpp. Referenced by NetworkLayer::handleDiscoveryPacket().
|
|
Definition at line 384 of file config.cpp. |
|
prints out help for the set command.
Definition at line 445 of file config.cpp. |
|
Definition at line 377 of file config.cpp. |
|
Definition at line 91 of file config.cpp. Referenced by LinkLayerInterface::accept(), LinkLayerInterface::connect(), LinkLayerInterface::listenImpl(), and LinkLayerInterface::toStream().
|
|
Definition at line 97 of file config.cpp. Referenced by Catcher::addNode().
|
|
Definition at line 52 of file config.h. Referenced by LinkLayerInterface::peerConnectImpl(), and LinkLayerInterface::toStream().
|
|
Definition at line 103 of file config.cpp. Referenced by toStream().
|
|
Definition at line 53 of file config.h. Referenced by SslConnection::accept(), and SslConnection::connect().
|
|
|
Definition at line 59 of file config.h. Referenced by SslConnection::accept().
|
|
Definition at line 364 of file config.cpp. |
|
Definition at line 341 of file config.cpp. Referenced by getBool(), getDouble(), getInt(), and getString().
|
|
Read in a configuration.
Definition at line 207 of file config.cpp. |
|
Read in a configuration file from the specified path.
Definition at line 153 of file config.cpp. |
|
Load configuration from the default configuration file.
Definition at line 143 of file config.cpp. Referenced by GlobalObjects::init(), and load().
|
|
Returns true if tag is found as the first thing in buf.
Definition at line 174 of file config.cpp. Referenced by load(), and operator>>().
|
|
Definition at line 180 of file config.cpp. Referenced by load().
|
|
Definition at line 192 of file config.cpp. Referenced by load().
|
|
Definition at line 186 of file config.cpp. Referenced by load().
|
|
Definition at line 198 of file config.cpp. Referenced by load().
|
|
Write configuration to specified output stream.
Definition at line 287 of file config.cpp. |
|
Write the configuration to the file specified.
Definition at line 264 of file config.cpp. |
|
Save to default configuration file.
Definition at line 254 of file config.cpp. Referenced by GlobalObjects::destroyImpl(), BasicConfigurationCommand::run(), save(), and toStream().
|
|
Set one of the config variables. Return true if value was set, false otherwise. Definition at line 395 of file config.cpp. Referenced by BasicConfigurationCommand::run(), and AdvancedConfigurationCommand::run().
|
|
Definition at line 333 of file config.cpp. |
|
Definition at line 325 of file config.cpp. |
|
Definition at line 318 of file config.cpp. |
|
Sets a value in the global namespace.
Definition at line 312 of file config.cpp. |
|
Definition at line 303 of file config.cpp. Referenced by setValue().
|
|
Prints out the state of the Config object in human-readable format.
Reimplemented from BasicObject. Definition at line 460 of file config.cpp. |
|
Definition at line 18 of file config.cpp. |
|
Definition at line 11 of file config.cpp. |
|
Definition at line 13 of file config.cpp. |
|
Definition at line 17 of file config.cpp. |
|
Definition at line 14 of file config.cpp. |
|
Definition at line 15 of file config.cpp. |
|
Definition at line 9 of file config.cpp. |
|
Definition at line 10 of file config.cpp. |
|
Definition at line 12 of file config.cpp. |
|
Definition at line 16 of file config.cpp. |
|
User wants connections to avoid censored nodes.
|
|
|
|
path to our key/x509 cert file.
|
|
SSL Context for client side.
|
|
Connect Propagation Probability. This represents the chance that the connect will propagate.
|
|
User wants to do fast routing.
|
|
Discovery Propagation Probability.
|
|
Discovery Response Probability.
|
|
file name where list of nodes is stored.
|
|
maximum size of connection tables - set this to one less than what you want.
|
|
maximum size of each host list.
|
|
min. connections to create and keep open.
|
|
read/write timeout in seconds. if zero, wait forever.
|
|
A Node describing yourself.
|
|
SSL Context for server side.
|