1ebd1706eSgtb /*
2*159d09a2SMark Phalan  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3ebd1706eSgtb  * Use is subject to license terms.
4ebd1706eSgtb  */
6505d05c7Sgtb /*
7505d05c7Sgtb  * lib/krb5/os/dnsglue.h
8505d05c7Sgtb  *
9505d05c7Sgtb  * Copyright 2004 by the Massachusetts Institute of Technology.
10505d05c7Sgtb  * All Rights Reserved.
11505d05c7Sgtb  *
12505d05c7Sgtb  * Export of this software from the United States of America may
13505d05c7Sgtb  *   require a specific license from the United States Government.
14505d05c7Sgtb  *   It is the responsibility of any person or organization contemplating
15505d05c7Sgtb  *   export to obtain such a license before exporting.
16505d05c7Sgtb  *
17505d05c7Sgtb  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
18505d05c7Sgtb  * distribute this software and its documentation for any purpose and
19505d05c7Sgtb  * without fee is hereby granted, provided that the above copyright
20505d05c7Sgtb  * notice appear in all copies and that both that copyright notice and
21505d05c7Sgtb  * this permission notice appear in supporting documentation, and that
22505d05c7Sgtb  * the name of M.I.T. not be used in advertising or publicity pertaining
23505d05c7Sgtb  * to distribution of the software without specific, written prior
24505d05c7Sgtb  * permission.  Furthermore if you modify this software you must label
25505d05c7Sgtb  * your software as modified software and not distribute it in such a
26505d05c7Sgtb  * fashion that it might be confused with the original M.I.T. software.
27505d05c7Sgtb  * M.I.T. makes no representations about the suitability of
28505d05c7Sgtb  * this software for any purpose.  It is provided "as is" without express
29505d05c7Sgtb  * or implied warranty.
30505d05c7Sgtb  *
31505d05c7Sgtb  * Glue layer for DNS resolver, to make parsing of replies easier
32505d05c7Sgtb  * whether we are using BIND 4, 8, or 9.
33505d05c7Sgtb  */
35505d05c7Sgtb /*
36505d05c7Sgtb  * BIND 4 doesn't have the ns_initparse() API, so we need to do some
37505d05c7Sgtb  * manual parsing via the HEADER struct.  BIND 8 does have
38505d05c7Sgtb  * ns_initparse(), but has enums for the various protocol constants
39505d05c7Sgtb  * rather than the BIND 4 macros.  BIND 9 (at least on Mac OS X
40505d05c7Sgtb  * Panther) appears to disable res_nsearch() if BIND_8_COMPAT is
41505d05c7Sgtb  * defined (which is necessary to obtain the HEADER struct).
42505d05c7Sgtb  *
43505d05c7Sgtb  * We use ns_initparse() if available at all, and never define
44505d05c7Sgtb  * BIND_8_COMPAT.  If there is no ns_initparse(), we do manual parsing
45505d05c7Sgtb  * by using the HEADER struct.
46505d05c7Sgtb  */
48505d05c7Sgtb #ifndef KRB5_DNSGLUE_H
49505d05c7Sgtb #define KRB5_DNSGLUE_H
51*159d09a2SMark Phalan #include "autoconf.h"
52505d05c7Sgtb #ifdef KRB5_DNS_LOOKUP
54505d05c7Sgtb #include "k5-int.h"
55505d05c7Sgtb #include "os-proto.h"
56505d05c7Sgtb #ifdef WSHELPER
57505d05c7Sgtb #include <wshelper.h>
58505d05c7Sgtb #else /* WSHELPER */
59505d05c7Sgtb #include <netinet/in.h>
60505d05c7Sgtb #include <arpa/inet.h>
61505d05c7Sgtb #include <arpa/nameser.h>
62505d05c7Sgtb #include <resolv.h>
63505d05c7Sgtb #include <netdb.h>
64505d05c7Sgtb #endif /* WSHELPER */
66505d05c7Sgtb #if HAVE_SYS_PARAM_H
67505d05c7Sgtb #include <sys/param.h>		/* for MAXHOSTNAMELEN */
68505d05c7Sgtb #endif