summaryrefslogtreecommitdiffstats
path: root/dnsip.c
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
committermanuel <manuel@mausz.at>2013-02-04 00:08:53 +0100
commit69aec538b456402170dc723af417ba5c05389c32 (patch)
treee6f34c543f17c6392447ea337b2e2868212424d1 /dnsip.c
downloadqmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz
qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2
qmail-69aec538b456402170dc723af417ba5c05389c32.zip
qmail 1.03 import
Diffstat (limited to 'dnsip.c')
-rw-r--r--dnsip.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/dnsip.c b/dnsip.c
new file mode 100644
index 0000000..e7b671c
--- /dev/null
+++ b/dnsip.c
@@ -0,0 +1,34 @@
1#include "substdio.h"
2#include "subfd.h"
3#include "stralloc.h"
4#include "dns.h"
5#include "dnsdoe.h"
6#include "ip.h"
7#include "ipalloc.h"
8#include "exit.h"
9
10char temp[IPFMT];
11
12stralloc sa = {0};
13ipalloc ia = {0};
14
15void main(argc,argv)
16int argc;
17char **argv;
18{
19 int j;
20
21 if (!argv[1]) _exit(100);
22
23 if (!stralloc_copys(&sa,argv[1]))
24 { substdio_putsflush(subfderr,"out of memory\n"); _exit(111); }
25
26 dns_init(0);
27 dnsdoe(dns_ip(&ia,&sa));
28 for (j = 0;j < ia.len;++j)
29 {
30 substdio_put(subfdout,temp,ip_fmt(temp,&ia.ix[j].ip));
31 substdio_putsflush(subfdout,"\n");
32 }
33 _exit(0);
34}