]>
git.ipfire.org Git - thirdparty/strongswan.git/blob - programs/pluto/adns.h
1 /* Pluto Asynchronous DNS Helper Program's Header
2 * Copyright (C) 2002 D. Hugh Redelmeier.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * RCSID $Id: adns.h,v 1.1 2004/03/15 20:35:28 as Exp $
17 #ifndef USE_LWRES /* whole file! */
19 /* The interface in RHL6.x and BIND distribution 8.2.2 are different,
20 * so we build some of our own :-(
24 # define NS_MAXDNAME MAXDNAME /* I hope this is long enough for IPv6 */
28 # define NS_PACKETSZ PACKETSZ
31 /* protocol version */
33 #define ADNS_Q_MAGIC (((((('d' << 8) + 'n') << 8) + 's') << 8) + 4)
34 #define ADNS_A_MAGIC (((((('d' << 8) + 'n') << 8) + 's') << 8) + 128 + 4)
36 /* note: both struct adns_query and struct adns_answer must start with
44 lset_t debugging
; /* only used #ifdef DEBUG, but don't want layout to change */
45 u_char name_buf
[NS_MAXDNAME
+ 2];
46 int type
; /* T_KEY or T_TXT */
53 struct adns_continuation
*continuation
;
56 u_char ans
[NS_PACKETSZ
* 10]; /* very probably bigger than necessary */
59 enum helper_exit_status
{
60 HES_CONTINUE
= -1, /* not an exit */
61 HES_OK
= 0, /* all's well that ends well (perhaps EOF) */
62 HES_INVOCATION
, /* improper invocation */
63 HES_IO_ERROR_SELECT
, /* IO error in select() */
64 HES_MALLOC
, /* malloc failed */
65 HES_IO_ERROR_IN
, /* error reading pipe */
66 HES_IO_ERROR_OUT
, /* error reading pipe */
67 HES_PIPE
, /* pipe(2) failed */
68 HES_SYNC
, /* answer from worker doesn't match query */
69 HES_FORK
, /* fork(2) failed */
70 HES_RES_INIT
, /* resolver initialization failed */
71 HES_BAD_LEN
, /* implausible .len field */
72 HES_BAD_MAGIC
, /* .magic field wrong */
75 #endif /* !USE_LWRES */