X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/9b86645c0f741697d64ccbab983bf2433a6fa06e..2c7b101bee6ae4f7cee1417ff769603eaa161ddf:/src/adns.h diff --git a/src/adns.h b/src/adns.h index 3e7b429..7e40ba5 100644 --- a/src/adns.h +++ b/src/adns.h @@ -1,11 +1,9 @@ /* - * Copyright (C)1998 Ian Jackson. - * This version provided for review and comment only. - * - * $Id: adns.h,v 1.35 1998/11/16 00:58:26 ian Exp $ + * adns.h + * - adns user-visible API (single-threaded, without any locking) */ /* - * This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson + * 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 * it under the terms of the GNU General Public License as published by @@ -19,7 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id: adns.h,v 1.42 1999/04/11 17:21:22 ian Exp $ */ #ifndef ADNS_H_INCLUDED @@ -30,6 +30,8 @@ #include #include +/* All struct in_addr anywhere in adns are in NETWORK byte order. */ + typedef struct adns__state *adns_state; typedef struct adns__query *adns_query; @@ -133,8 +135,6 @@ typedef enum { adns_s_max_misconfig= 199, - /* fixme: implement _s_cname */ - /* permanent problems with the query */ adns_s_querydomainwrong, adns_s_querydomaininvalid, @@ -195,6 +195,7 @@ typedef struct { adns_status status; char *cname; /* always NULL if query was for CNAME records */ 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; @@ -235,8 +236,11 @@ typedef struct { * If no (appropriate) requests are outstanding adns_query and adns_wait return ESRCH; */ -/* fixme: separate parsing from instantiation */ -int adns_init(adns_state *newstate_r, adns_initflags flags, FILE *diagfile/*0=>stderr*/); +int adns_init(adns_state *newstate_r, adns_initflags flags, + FILE *diagfile /*0=>stderr*/); + +int adns_init_strcfg(adns_state *newstate_r, adns_initflags flags, + FILE *diagfile /*0=>discard*/, const char *configtext); int adns_synchronous(adns_state ads, const char *owner, @@ -265,6 +269,8 @@ int adns_wait(adns_state ads, adns_query *query_io, adns_answer **answer_r, void **context_r); +/* fixme: easy way to get lists of fd's */ +/* fixme: minor cache */ void adns_cancel(adns_query query);