firedns.h: always make ipv6 members available in state struct
[rofl0r-firedns.git] / examples / fdnsip6.c
blob3e974d680be7101e91a0c59b8700719cfab2e81b
1 #include <stdio.h>
2 #include "../include/firedns.h"
4 int main(int argc, char **argv) {
5 struct in6_addr *result;
6 firedns_state dns, *d = &dns;
7 char ntoabuf[256];
9 if (argc != 2) {
10 fprintf(stderr,"usage: %s <hostname>\n",argv[0]);
11 return 2;
14 firedns_init(d);
15 firedns_add_servers_from_resolv_conf(d);
17 result = firedns_resolveip6(d, argv[1]);
18 if (result) {
19 printf("%s\n",firedns_ntoa6(result, ntoabuf));
20 return 0;
23 return 1;