14 logmsg(
WHO,111,FATAL,
"out of memory");
26int main(
int argc,
char **argv)
37 if (!stralloc_copys(&fqdn,*argv))
nomem();
38 if (
dns_mx(&out,&fqdn) < 0)
39 logmsg(
WHO,111,FATAL,B(
"unable to find MX records for: ",*argv));
43 if (!stralloc_copys(&out,
"0 "))
nomem();
45 if (!stralloc_cats(&out,
"\n"))
nomem();
46 buffer_put(buffer_1,out.s,out.len);
50 while (i + 2 < out.len) {
51 j = byte_chr(out.s + i + 2,out.len - i - 2,0);
52 uint16_unpack_big(out.s + i,&pref);
54 buffer_puts(buffer_1,
" ");
55 buffer_put(buffer_1,out.s + i + 2,j);
56 buffer_puts(buffer_1,
"\n");
64 buffer_flush(buffer_1);
int dns_domain_fromdot(char **out, const char *buf, unsigned int n)
int dns_domain_todot_cat(stralloc *out, const char *d)
int dns_mx(stralloc *out, const stralloc *fqdn)
void dns_random_init(const char data[128])