mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-07 10:35:42 -05:00
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:
parent
a9953c081c
commit
f9ad63f74a
@ -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)
|
bool operator==(const struct sockaddr_in &addr, const struct sockaddr_in &addr2)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <deque>
|
#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);
|
||||||
bool operator<(const struct sockaddr_in &addr, const struct sockaddr_in &addr2);
|
bool operator<(const struct sockaddr_in &addr, const struct sockaddr_in &addr2);
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdlib.h> /* Included because GCC4.4 wants it */
|
#include <stdlib.h> /* Included because GCC4.4 wants it */
|
||||||
#include <string.h> /* Included because GCC4.4 wants it */
|
#include <string.h> /* Included because GCC4.4 wants it */
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
|
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
|
||||||
#ifndef WINDOWS_SYS
|
#ifndef WINDOWS_SYS
|
||||||
@ -68,5 +69,6 @@ bool isLoopbackNet(const struct in_addr *addr);
|
|||||||
bool isPrivateNet(const struct in_addr *addr);
|
bool isPrivateNet(const struct in_addr *addr);
|
||||||
bool isExternalNet(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 */
|
#endif /* RS_UNIVERSAL_NETWORK_HEADER */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user