getip46() added

int getip46(int family, unsigned char *name,  struct sockaddr_storage
*sa)
family: IPv4/IPv6 preference order 4, 6, 46, 64 or 0 for getip()
compatibility.
name - hostname,
sa - destination sockaddr (must be large enougth)
returns:
0 fo failed resolution
IP address for family = 0
AF_INET/AF_INET6 overwise.
This commit is contained in:
Vladimir Dubrovin committed 2014-05-12 01:10:31 +04:00
1 parent aad2559004
commit 6b99de69c4
2 files changed
+69 -3

No files matched your search

+9
View File
@@ -47,6 +47,10 @@
#ifdef _WIN32
#include <winsock2.h>
#ifndef NOIPV6
#include <Ws2tcpip.h>
#endif
#ifndef _WINCE
#include <io.h>
#else
@@ -188,6 +192,11 @@ int myinet_ntoa(struct in_addr in, char * buf);
extern unsigned long nservers[MAXNSERVERS];
extern unsigned long authnserver;
unsigned long getip(unsigned char *name);
#ifdef NOIPV6
unsigned long getip46(int family, unsigned char *name, struct sockaddr_in *sa){
#else
unsigned long getip46(int family, unsigned char *name, struct sockaddr_storage *sa){
#endif
unsigned long myresolver(unsigned char *);
unsigned long fakeresolver (unsigned char *name);
int initdnshashtable(unsigned nhashsize);