moved operator<<(ostream&,sockaddr_in) to rsnet.h, as it is used at different places

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@3099 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-06-10 12:39:14 +00:00
parent a9953c081c
commit f9ad63f74a
4 changed files with 12 additions and 8 deletions

View File

@ -89,13 +89,6 @@ class udpPacket
};
std::ostream &operator<<(std::ostream &out, const struct sockaddr_in &addr)
{
out << "[" << inet_ntoa(addr.sin_addr) << ":";
out << htons(addr.sin_port) << "]";
return out;
}
bool operator==(const struct sockaddr_in &addr, const struct sockaddr_in &addr2)
{

View File

@ -45,7 +45,6 @@
#include <list>
#include <deque>
std::ostream &operator<<(std::ostream &out, const struct sockaddr_in &addr);
bool operator==(const struct sockaddr_in &addr, const struct sockaddr_in &addr2);
bool operator<(const struct sockaddr_in &addr, const struct sockaddr_in &addr2);

View File

@ -125,3 +125,13 @@ bool isExternalNet(const struct in_addr *addr)
std::ostream &operator<<(std::ostream &out, const struct sockaddr_in &addr)
{
out << "[" << inet_ntoa(addr.sin_addr) << ":";
out << htons(addr.sin_port) << "]";
return out;
}

View File

@ -29,6 +29,7 @@
#include <inttypes.h>
#include <stdlib.h> /* Included because GCC4.4 wants it */
#include <string.h> /* Included because GCC4.4 wants it */
#include <iostream>
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
#ifndef WINDOWS_SYS
@ -68,5 +69,6 @@ bool isLoopbackNet(const struct in_addr *addr);
bool isPrivateNet(const struct in_addr *addr);
bool isExternalNet(const struct in_addr *addr);
std::ostream& operator<<(std::ostream& o,const struct sockaddr_in&) ;
#endif /* RS_UNIVERSAL_NETWORK_HEADER */