s/qmail 4.3.21
Next generation secure email transport
Loading...
Searching...
No Matches
dnstxt.c
Go to the documentation of this file.
1#include <unistd.h>
2#include "buffer.h"
3#include "stralloc.h"
4#include "dnsresolv.h"
5#include "dns.h"
6#include "exit.h"
7#include "logmsg.h"
8
9#define WHO "dnstext"
10
11stralloc sa = {0};
12stralloc out = {0};
13
14int main(int argc,char * const *argv)
15{
16 int r;
17
18 if (!argv[1])
19 logmsg(WHO,100,USAGE,"dnstxt fqdn");
20
21 if (!stralloc_copys(&sa,argv[1]))
22 logmsg(WHO,111,FATAL,"out of memory");
23
25 if ((r = dns_txt(&out,&sa)) < 0) _exit(1);
26 if (r > 0) {
27 buffer_put(buffer_1,out.s,out.len);
28 buffer_putsflush(buffer_1,"\0");
29 }
30
31 _exit(0);
32}
#define WHO
Definition bouncesaying.c:8
int main()
Definition chkshsgr.c:6
int stralloc_copys(stralloc *, char const *)
#define DNS_INIT
Definition dns.h:12
stralloc out
Definition dnscname.c:12
stralloc sa
Definition dnscname.c:11
void _exit(int)