1
0
mirror of https://github.com/rofl0r/proxychains-ng synced 2025-01-06 21:02:55 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
rofl0r
86408cd806 add libc gethostbyname test 2019-09-07 15:23:02 +01:00
rofl0r
ea187938e1 test_gethostent: improve compileability 2019-09-07 15:22:41 +01:00
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,23 @@
#include <stdio.h>
#include <netdb.h>
#include "../src/common.c"
void printhostent(struct hostent *hp) {
char ipbuf[16];
pc_stringfromipv4(hp->h_addr_list[0], ipbuf);
printf("alias: %p, len: %d, name: %s, addrlist: %p, addrtype: %d, ip: %s\n",
hp->h_aliases,
hp->h_length,
hp->h_name,
hp->h_addr_list,
hp->h_addrtype,
ipbuf
);
}
int main(int argc, char**argv) {
struct hostent* ret;
if(argc == 1) return 1;
ret = gethostbyname(argv[1]);
if(ret) printhostent(ret);
return 0;
}

View File

@ -1,6 +1,6 @@
#include <netdb.h>
#include <stdio.h>
#include "../src/common.h"
#include "../src/common.c"
void printhostent(struct hostent *hp) {
char ipbuf[16];