X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/adns/blobdiff_plain/680d2a652d5185d75c206444e9e8db9b82b3121c..1e9efa7116ea04acfc29e7b0a7672d06db5cf00c:/src/adns.h diff --git a/src/adns.h b/src/adns.h index 63e7537..2bb6780 100644 --- a/src/adns.h +++ b/src/adns.h @@ -2,7 +2,7 @@ * Copyright (C)1998 Ian Jackson. * This version provided for review and comment only. * - * $Id: adns.h,v 1.23 1998/11/08 16:16:09 ian Exp $ + * $Id: adns.h,v 1.24 1998/11/10 01:03:54 ian Exp $ */ /* * This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson @@ -163,7 +163,7 @@ typedef struct { typedef struct { adns_status status; char *cname; /* always NULL if query was for CNAME records */ - adns_rrtype type; + adns_rrtype type; /* guaranteed to be same as in query */ int nrrs, rrsz; union { void *untyped; @@ -288,6 +288,34 @@ void adns_interest(adns_state, int *maxfd_io, fd_set *readfds_io, * } */ +adns_status adns_rr_info(adns_rrtype type, + const char **rrtname_r, const char **fmtname_r, + int *len_r, + const void *datap, char **data_r); +/* Gets information in human-readable (but non-i18n) form + * for eg debugging purposes. type must be specified, + * and the official name of the corresponding RR type will + * be returned in *rrtname_r, and information about the processing + * style in *fmtname_r. The length of the table entry in an answer + * for that type will be returned in in *len_r. + * Any or all of rrtname_r, fmtname_r and len_r may be 0. + * If fmtname_r is non-null then *fmtname_r may be + * null on return, indicating that no special processing is + * involved. + * + * data_r be must be non-null iff datap is. In this case + * *data_r will be set to point to a human-readable text + * string representing the RR data. The text will have + * been obtained from malloc() and must be freed by the caller. + * + * Usually this routine will succeed. Possible errors include: + * adns_s_nomemory + * adns_s_notimplemented (RR type not known) + * adns_s_invaliddata (*datap contained garbage) + * If an error occurs then no memory has been allocated, + * and *rrtname_r, *fmtname_r, *len_r and *data_r are undefined. + */ + const char *adns_strerror(adns_status st); #endif