Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / libbind / dist / tests / res.h
blobf36c312ffd3bafa04b6e7db0c4f6af280812a5b4
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
20 * @(#)res.h 5.10 (Berkeley) 6/1/90
21 * Id: res.h,v 1.3 2009/03/03 23:49:07 tbox Exp
25 *******************************************************************************
27 * res.h --
29 * Definitions used by modules of the name server lookup program.
31 * Copyright (c) 1985
32 * Andrew Cherenson
33 * U.C. Berkeley
34 * CS298-26 Fall 1985
36 *******************************************************************************
39 #define TRUE 1
40 #define FALSE 0
41 typedef int Boolean;
43 #define MAXALIASES 35
44 #define MAXADDRS 35
45 #define MAXDOMAINS 35
46 #define MAXSERVERS 10
49 * Define return statuses in addtion to the ones defined in namserv.h
50 * let SUCCESS be a synonym for NOERROR
52 * TIME_OUT - a socket connection timed out.
53 * NO_INFO - the server didn't find any info about the host.
54 * ERROR - one of the following types of errors:
55 * dn_expand, res_mkquery failed
56 * bad command line, socket operation failed, etc.
57 * NONAUTH - the server didn't have the desired info but
58 * returned the name(s) of some servers who should.
59 * NO_RESPONSE - the server didn't respond.
63 #ifdef ERROR
64 #undef ERROR
65 #endif
67 #define SUCCESS 0
68 #define TIME_OUT -1
69 #define NO_INFO -2
70 #define ERROR -3
71 #define NONAUTH -4
72 #define NO_RESPONSE -5
75 * Define additional options for the resolver state structure.
77 * RES_DEBUG2 more verbose debug level
80 #define RES_DEBUG2 0x00400000
83 * Maximum length of server, host and file names.
86 #define NAME_LEN 256
90 * Modified struct hostent from <netdb.h>
92 * "Structures returned by network data base library. All addresses
93 * are supplied in host order, and returned in network order (suitable
94 * for use in system calls)."
97 typedef struct {
98 int addrType;
99 int addrLen;
100 char *addr;
101 } AddrInfo;
103 typedef struct {
104 char *name; /* official name of host */
105 char **domains; /* domains it serves */
106 AddrInfo **addrList; /* list of addresses from name server */
107 } ServerInfo;
109 typedef struct {
110 char *name; /* official name of host */
111 char **aliases; /* alias list */
112 AddrInfo **addrList; /* list of addresses from name server */
113 ServerInfo **servers;
114 } HostInfo;
117 * External routines:
120 extern int pickString(const char *, char *, size_t);
121 extern int matchString(const char *, const char *);
122 extern int StringToType(char *, int, FILE *);
123 extern int StringToClass(char *, int, FILE *);