14 logmsg(
WHO,111,FATAL,
"out of memory");
17 static char seed[128];
24 int main(
int argc,
char **argv)
35 if (!stralloc_copys(&fqdn,*argv))
nomem();
36 if (
dns_mx(&out,&fqdn) < 0)
37 logmsg(
WHO,111,FATAL,B(
"unable to find MX records for: ",*argv));
41 if (!stralloc_copys(&out,
"0 "))
nomem();
43 if (!stralloc_cats(&out,
"\n"))
nomem();
44 buffer_put(buffer_1,out.s,out.len);
48 while (i + 2 < out.len) {
49 j = byte_chr(out.s + i + 2,out.len - i - 2,0);
50 uint16_unpack_big(out.s + i,&pref);
52 buffer_puts(buffer_1,
" ");
53 buffer_put(buffer_1,out.s + i + 2,j);
54 buffer_puts(buffer_1,
"\n");
62 buffer_flush(buffer_1);
int dns_domain_fromdot(char **, const char *, unsigned int)
int dns_domain_todot_cat(stralloc *, const char *)
int dns_mx(stralloc *, const stralloc *)
void dns_random_init(const char *)
int main(int argc, char **argv)