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

@ -1779,6 +1779,13 @@ void p3NetMgrIMPL::updateNetStateBox_startup()
#endif
mNetStateBox.setAddressWebIP(false, &tmpip);
}
/* finally - if the user has set Forwarded, pass it on */
if (mNetMode & RS_NET_MODE_TRY_EXT)
{
mNetStateBox.setPortForwarded(true, 0); // Port unknown for now.
}
}
}

View file

@ -105,6 +105,19 @@ void pqiNetStateBox::setAddressWebIP(bool active, struct sockaddr_in *addr)
}
void pqiNetStateBox::setPortForwarded(bool active, uint16_t port)
{
if ((!mPortForwardSet) || (mPortForwarded != port))
{
mPortForwardSet = true;
mPortForwarded = port;
mStatusOkay = false;
}
}
void pqiNetStateBox::setDhtState(bool on, bool active)
{
if ((!mDhtSet) || (mDhtActive != active) || (mDhtOn != on))
@ -197,8 +210,8 @@ void pqiNetStateBox::reset()
mWebIPActive = false;
//struct sockaddr_in mWebIPAddr;
mPortForwardedSet = false;
mPortForwarded = 0;
mPortForwardSet = false;
mPortForwarded = false;
mDhtSet = false;
mDhtActive = false;
@ -412,7 +425,7 @@ void pqiNetStateBox::determineNetworkState()
//mExtAddrStable = true;
}
else if (mPortForwardedSet)
else if (mPortForwardSet)
{
mNetworkMode = RSNET_NETWORK_BEHINDNAT;
// Use Fallback Guess.
@ -476,7 +489,7 @@ void pqiNetStateBox::determineNetworkState()
//mExtAddrStable = true;
mNetStateMode = RSNET_NETSTATE_WARNING_NODHT;
}
else if (mPortForwardedSet)
else if (mPortForwardSet)
{
mNetworkMode = RSNET_NETWORK_BEHINDNAT;
mNatTypeMode = RSNET_NATTYPE_UNKNOWN;

View file

@ -28,6 +28,8 @@ class pqiNetStateBox
void setAddressNatPMP(bool active, struct sockaddr_in *addr);
void setAddressWebIP(bool active, struct sockaddr_in *addr);
void setPortForwarded(bool active, uint16_t port);
void setDhtState(bool dhtOn, bool dhtActive);
uint32_t getNetStateMode();
@ -89,7 +91,7 @@ class pqiNetStateBox
bool mWebIPActive;
time_t mWebIPTS;
bool mPortForwardedSet;
bool mPortForwardSet;
uint16_t mPortForwarded;
};