diff options
| author | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-04 00:08:53 +0100 |
| commit | 69aec538b456402170dc723af417ba5c05389c32 (patch) | |
| tree | e6f34c543f17c6392447ea337b2e2868212424d1 /dnsip.c | |
| download | qmail-69aec538b456402170dc723af417ba5c05389c32.tar.gz qmail-69aec538b456402170dc723af417ba5c05389c32.tar.bz2 qmail-69aec538b456402170dc723af417ba5c05389c32.zip | |
qmail 1.03 import
Diffstat (limited to 'dnsip.c')
| -rw-r--r-- | dnsip.c | 34 |
1 files changed, 34 insertions, 0 deletions
| @@ -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 | |||
| 10 | char temp[IPFMT]; | ||
| 11 | |||
| 12 | stralloc sa = {0}; | ||
| 13 | ipalloc ia = {0}; | ||
| 14 | |||
| 15 | void main(argc,argv) | ||
| 16 | int argc; | ||
| 17 | char **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 | } | ||
