-const char *adns__diag_domain(adns_state ads, int serv, adns_query qu, vbuf *vb,
- int flags, const byte *dgram, int dglen, int cbyte) {
- adns_status st;
-
- st= adns__parse_domain(ads,serv,vb,qu->flags, dgram,dglen, &cbyte,dglen);
- if (st == adns_s_nomemory) {
- return "<cannot report domain... out of memory>";
- }
- if (st) {
- vb->used= 0;
- if (!(adns__vbuf_appendstr(vb,"<bad format... ") &&
- adns__vbuf_appendstr(vb,adns_strerror(st)) &&
- adns__vbuf_appendstr(vb,">") &&
- adns__vbuf_append(vb,"",1))) {
- return "<cannot report bad format... out of memory>";
- }
- }
- if (!vb.used) {
- adns__vbuf_appendstr(vb,"<truncated ...>");
- adns__vbuf_append(vb,"",1);
- }
- return vb->buf;
-}
-