Net, Dht and Configuration changes.

* set PortForward in NetStateBox when the Network has been setup.
 * add GeneralConfig to rsConfig external interface.
 * enabled ADVANCED configuration option.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4500 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2011-07-30 16:57:40 +00:00
parent a1e112934d
commit 31ec7a074b
7 changed files with 96 additions and 9 deletions

View file

@ -28,13 +28,15 @@
RsServerConfig *rsConfig = NULL;
p3ServerConfig::p3ServerConfig(p3PeerMgr *peerMgr, p3LinkMgr *linkMgr, p3NetMgr *netMgr)
p3ServerConfig::p3ServerConfig(p3PeerMgr *peerMgr, p3LinkMgr *linkMgr, p3NetMgr *netMgr, p3GeneralConfig *genCfg)
:configMtx("p3ServerConfig")
{
mPeerMgr = peerMgr;
mLinkMgr = linkMgr;
mNetMgr = netMgr;
mGeneralConfig = genCfg;
mUserLevel = RSCONFIG_USER_LEVEL_NEW; /* START LEVEL */
rsConfig = this;
@ -46,6 +48,53 @@ p3ServerConfig::~p3ServerConfig()
return;
}
#define RS_CONFIG_ADVANCED_STRING "AdvMode"
bool p3ServerConfig::findConfigurationOption(uint32_t key, std::string &keystr)
{
bool found = false;
switch(key)
{
case RS_CONFIG_ADVANCED:
keystr = RS_CONFIG_ADVANCED_STRING;
found = true;
break;
}
return found;
}
bool p3ServerConfig::getConfigurationOption(uint32_t key, std::string &opt)
{
std::string strkey;
if (!findConfigurationOption(key, strkey))
{
std::cerr << "p3ServerConfig::getConfigurationOption() OPTION NOT VALID: " << key;
std::cerr << std::endl;
return false;
}
opt = mGeneralConfig->getSetting(strkey);
return true;
}
bool p3ServerConfig::setConfigurationOption(uint32_t key, const std::string &opt)
{
std::string strkey;
if (!findConfigurationOption(key, strkey))
{
std::cerr << "p3ServerConfig::setConfigurationOption() OPTION NOT VALID: " << key;
std::cerr << std::endl;
return false;
}
mGeneralConfig->setSetting(strkey, opt);
return true;
}
/* From RsIface::RsConfig */
int p3ServerConfig::getConfigNetStatus(RsConfigNetStatus &status)