X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/a719a4bedec2bc512b7f95f7446e02f6662ebbc7..9da4a044c4d2e0a960cf8f33c62774db02f4402d:/src/adns.h diff --git a/src/adns.h b/src/adns.h index 1b3e1d3..88b51f8 100644 --- a/src/adns.h +++ b/src/adns.h @@ -1,4 +1,8 @@ /* + * adns.h + * - adns user-visible API (single-threaded, without any locking) + */ +/* * This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson * * This program is free software; you can redistribute it and/or modify @@ -38,11 +42,13 @@ typedef enum { adns_if_debug= 0x0008, /* enable all output to stderr plus debug msgs */ adns_if_noautosys= 0x0010, /* do not make syscalls at every opportunity */ adns_if_eintr= 0x0020, /* allow _wait and _synchronous to return EINTR */ + adns_if_nosigpipe= 0x0040, /* applic has SIGPIPE set to SIG_IGN, do not protect */ } adns_initflags; typedef enum { adns_qf_search= 0x000001, /* use the searchlist */ adns_qf_usevc= 0x000002, /* use a virtual circuit (TCP connection) */ + adns_qf_owner= 0x000004, /* fill in the owner field in the answer */ adns_qf_quoteok_query= 0x000010, /* allow quote-requiring chars in query domain */ adns_qf_quoteok_cname= 0x000020, /* allow ... in CNAME we go via */ adns_qf_quoteok_anshost= 0x000040, /* allow ... in answers expected to be hostnames */ @@ -85,15 +91,15 @@ typedef enum { } adns_rrtype; -/* In queries without qtf_anyquote, all domains must have standard - * legal syntax. In queries _with_ qtf_anyquote, domains in the query - * or response may contain any characters, quoted according to - * RFC1035 5.1. On input to adns, the char* is a pointer to the - * interior of a " delimited string, except that " may appear in it, - * and on output, the char* is a pointer to a string which would be - * legal either inside or outside " delimiters, and any characters - * not usually legal in domain names will be quoted as \X - * (if the character is 33-126 except \ and ") or \DDD. +/* In queries without qf_quoteok_*, all domains must have standard + * legal syntax. In queries _with_ qf_quoteok_*, domains in the query + * or response may contain any characters, quoted according to RFC1035 + * 5.1. On input to adns, the char* is a pointer to the interior of a + * " delimited string, except that " may appear in it, and on output, + * the char* is a pointer to a string which would be legal either + * inside or outside " delimiters, and any characters not usually + * legal in domain names will be quoted as \X (if the character is + * 33-126 except \ and ") or \DDD. * * Do not ask for _raw records containing mailboxes without * specifying _qf_anyquote. @@ -190,7 +196,9 @@ typedef struct { typedef struct { adns_status status; char *cname; /* always NULL if query was for CNAME records */ + char *owner; /* only set if requested in query flags */ adns_rrtype type; /* guaranteed to be same as in query */ + time_t expires; /* expiry time, defined only if _s_ok, nxdomain or nodata. NOT TTL! */ int nrrs, rrsz; union { void *untyped; @@ -264,10 +272,6 @@ int adns_wait(adns_state ads, adns_query *query_io, adns_answer **answer_r, void **context_r); -/* fixme: merge _check and _wait into one func with flags wait and `remove'(?) */ -/* fixme: include TTL in answer somehow */ -/* fixme: multithreading/locking */ -/* fixme: easy way to get lists of fd's */ void adns_cancel(adns_query query); @@ -352,5 +356,6 @@ adns_status adns_rr_info(adns_rrtype type, */ const char *adns_strerror(adns_status st); +const char *adns_errabbrev(adns_status st); #endif