Massive commit - changing from sockaddr_in => sockaddr_storage.

In preparation for making RS support IPv6.

NB: This breaks the build of retroshare-gui, as the
sockaddr_storage_xxx fns are only defined as prototypes for now.

All the aux libraries like udp / stun / tcponudp / dht have still to be converted.

These changes will probably break various things and need to be tested thoroughly.




git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6735 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2013-09-13 14:35:19 +00:00
parent fd071161bf
commit 6290d8fed9
66 changed files with 1182 additions and 1046 deletions

View file

@ -62,13 +62,20 @@ class rsUdpStack: public UdpStack, public pqiNetListener
:UdpStack(testmode, local) { return; }
/* from pqiNetListener */
virtual bool resetListener(struct sockaddr_in &local)
virtual bool resetListener(const struct sockaddr_storage &local)
{
// The const_cast below is not so nice but without it, the compiler can't
// find the correct operator<<(). No idea why!
std::cerr << "rsUdpStack::resetListener(" << const_cast<const struct sockaddr_in &>(local) << ")";
std::cerr << "rsUdpStack::resetListener(" << sockaddr_storage_tostring(local) << ")";
std::cerr << std::endl;
return resetAddress(local);
if (local.ss_family != AF_INET)
{
std::cerr << "rsUdpStack::resetListener() NOT IPv4 ERROR";
std::cerr << std::endl;
abort();
}
struct sockaddr_in *addr = (struct sockaddr_in *) &local;
return resetAddress(*addr);
}
};
@ -83,14 +90,14 @@ class rsFixedUdpStack: public UdpStack, public pqiNetListener
:UdpStack(testmode, local) { return; }
/* from pqiNetListener */
virtual bool resetListener(struct sockaddr_in &local)
virtual bool resetListener(const struct sockaddr_storage &local)
{
struct sockaddr_in addr;
getLocalAddress(addr);
// The const_cast below is not so nice but without it, the compiler can't
// find the correct operator<<(). No idea why!
std::cerr << "rsFixedUdpStack::resetListener(" << const_cast<const struct sockaddr_in &>(local) << ")";
std::cerr << "rsFixedUdpStack::resetListener(" << sockaddr_storage_tostring(local) << ")";
std::cerr << " Resetting with original addr: " << const_cast<const struct sockaddr_in &>(addr);
std::cerr << std::endl;