s/qmail
4.3.20
Next generation secure email transport
Loading...
Searching...
No Matches
4.3
sqmail-4.3.20
src
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
11
stralloc
sa
= {0};
12
stralloc
out
= {0};
13
14
int
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
24
DNS_INIT
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
}
main
int main()
Definition:
chkshsgr.c:6
stralloc_copys
int stralloc_copys(stralloc *, char const *)
dns.h
DNS_INIT
#define DNS_INIT
Definition:
dns.h:12
out
stralloc out
Definition:
dnstxt.c:12
sa
stralloc sa
Definition:
dnstxt.c:11
WHO
#define WHO
Definition:
dnstxt.c:9
exit.h
_exit
void _exit(int)
Generated on Thu Jan 16 2025 17:42:03 for s/qmail by
1.9.6