mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
Commmit the code from Thunder
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2754 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c79d55a7a7
commit
948e4fb61d
15 changed files with 204 additions and 5 deletions
|
@ -123,5 +123,15 @@ bool isExternalNet(struct in_addr *addr)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool getIPAddressFromString (const char *addr_str, struct in_addr *addr)
|
||||
{
|
||||
if (addr_str && addr) {
|
||||
hostent *pHost = gethostbyname (addr_str);
|
||||
if (pHost) {
|
||||
addr->s_addr = *(unsigned long*) (pHost->h_addr);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -68,5 +68,7 @@ bool isLoopbackNet(struct in_addr *addr);
|
|||
bool isPrivateNet(struct in_addr *addr);
|
||||
bool isExternalNet(struct in_addr *addr);
|
||||
|
||||
/* convert addresses */
|
||||
bool getIPAddressFromString (const char *addr_str, struct in_addr *addr);
|
||||
|
||||
#endif /* RS_UNIVERSAL_NETWORK_HEADER */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue