Implemented sockaddr_storage functions.

Fixed interfaces for UPnP.

Some further tweaks to get TCP connections working again:
 - hiddenNode issue in p3peers.cc
 - fixed socklen_t for bind() and connect() calls.
 - initialise addr to IPv4 for netmgr.
 - change netAssist (Upnp) interfaces.

Still todo: tou address functions, test UDP functionality.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6755 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2013-09-24 05:30:01 +00:00
parent 6290d8fed9
commit 34ea22d5f6
15 changed files with 1076 additions and 40 deletions

View file

@ -999,12 +999,14 @@ bool p3Peers::loadDetailsFromStringCert(const std::string &certstr, RsPeerDetai
pd.isOnlyGPGdetail = pd.id.empty();
pd.service_perm_flags = RS_SERVICE_PERM_ALL ;
if (pd.isHiddenNode)
if (!cert.hidden_node_string().empty())
{
pd.isHiddenNode = true;
pd.hiddenNodeAddress = cert.hidden_node_string();
}
else
{
pd.isHiddenNode = false;
pd.localAddr = cert.loc_ip_string();
pd.localPort = cert.loc_port_us();
pd.extAddr = cert.ext_ip_string();

View file

@ -2110,22 +2110,16 @@ int RsServer::StartupRetroShare()
// NOW WE BUILD THE SECOND STACK.
// Create the Second UdpStack... Port should be random (but openable!).
//#define MIN_RANDOM_PORT 30000
//#define MAX_RANDOM_PORT 50000
// We do this by binding to xx.xx.xx.xx:0 which which gives us a random port.
struct sockaddr_in sndladdr;
sockaddr_clear(&sndladdr);
// #ifdef LOCALNET_TESTING
#ifdef LOCALNET_TESTING
// // HACK Proxy Port near Dht Port - For Relay Testing.
// uint16_t rndport = RsInitConfig::port + 3;
// sndladdr.sin_port = htons(rndport);
// #else
// uint16_t rndport = MIN_RANDOM_PORT + RSRandom::random_u32() % (MAX_RANDOM_PORT - MIN_RANDOM_PORT);
// #endif
#ifdef LOCALNET_TESTING
rsFixedUdpStack *mProxyStack = new rsFixedUdpStack(UDP_TEST_RESTRICTED_LAYER, sndladdr);