xref: /freebsd/include/resolv.h (revision bb28f3c29b4c91af1b0e79e456294bb08735648a)
159deaec5SRodney W. Grimes /*-
259deaec5SRodney W. Grimes  * Copyright (c) 1983, 1987, 1989, 1993
359deaec5SRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
459deaec5SRodney W. Grimes  *
559deaec5SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
659deaec5SRodney W. Grimes  * modification, are permitted provided that the following conditions
759deaec5SRodney W. Grimes  * are met:
859deaec5SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
959deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
1059deaec5SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
1159deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
1259deaec5SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
1359deaec5SRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
1459deaec5SRodney W. Grimes  *    must display the following acknowledgement:
1559deaec5SRodney W. Grimes  *	This product includes software developed by the University of
1659deaec5SRodney W. Grimes  *	California, Berkeley and its contributors.
1759deaec5SRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
1859deaec5SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
1959deaec5SRodney W. Grimes  *    without specific prior written permission.
2059deaec5SRodney W. Grimes  *
2159deaec5SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2259deaec5SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2359deaec5SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2459deaec5SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2559deaec5SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2659deaec5SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2759deaec5SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2859deaec5SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2959deaec5SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3059deaec5SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3159deaec5SRodney W. Grimes  * SUCH DAMAGE.
320160f9c0SPeter Wemm  */
330160f9c0SPeter Wemm 
340160f9c0SPeter Wemm /*
350160f9c0SPeter Wemm  * Portions Copyright (c) 1996 by Internet Software Consortium.
3659deaec5SRodney W. Grimes  *
3759deaec5SRodney W. Grimes  * Permission to use, copy, modify, and distribute this software for any
3859deaec5SRodney W. Grimes  * purpose with or without fee is hereby granted, provided that the above
390160f9c0SPeter Wemm  * copyright notice and this permission notice appear in all copies.
4059deaec5SRodney W. Grimes  *
410160f9c0SPeter Wemm  * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
420160f9c0SPeter Wemm  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
430160f9c0SPeter Wemm  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
440160f9c0SPeter Wemm  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
4559deaec5SRodney W. Grimes  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
4659deaec5SRodney W. Grimes  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
4759deaec5SRodney W. Grimes  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
4859deaec5SRodney W. Grimes  * SOFTWARE.
490160f9c0SPeter Wemm  */
500160f9c0SPeter Wemm 
510160f9c0SPeter Wemm /*
521363f04cSPaul Traina  *	@(#)resolv.h	8.1 (Berkeley) 6/2/93
530160f9c0SPeter Wemm  *	From Id: resolv.h,v 8.12 1998/04/28 19:36:46 halley Exp $
54a4add9a9SPeter Wemm  * $FreeBSD$
5559deaec5SRodney W. Grimes  */
5659deaec5SRodney W. Grimes 
5759deaec5SRodney W. Grimes #ifndef _RESOLV_H_
5859deaec5SRodney W. Grimes #define	_RESOLV_H_
5959deaec5SRodney W. Grimes 
601363f04cSPaul Traina #include <sys/param.h>
6159deaec5SRodney W. Grimes #include <sys/types.h>
621363f04cSPaul Traina #include <sys/cdefs.h>
637d56d374SYoshinobu Inoue #include <sys/socket.h>
641363f04cSPaul Traina #include <stdio.h>
651363f04cSPaul Traina 
661363f04cSPaul Traina /*
67315d6d9cSPeter Wemm  * Revision information.  This is the release date in YYYYMMDD format.
68315d6d9cSPeter Wemm  * It can change every day so the right thing to do with it is use it
69315d6d9cSPeter Wemm  * in preprocessor commands such as "#if (__RES > 19931104)".  Do not
701363f04cSPaul Traina  * compare for equality; rather, use it to determine whether your resolver
711363f04cSPaul Traina  * is new enough to contain a certain feature.
721363f04cSPaul Traina  */
731363f04cSPaul Traina 
74315d6d9cSPeter Wemm #define	__RES	19960801
751363f04cSPaul Traina 
7659deaec5SRodney W. Grimes /*
7759deaec5SRodney W. Grimes  * Resolver configuration file.
7859deaec5SRodney W. Grimes  * Normally not present, but may contain the address of the
7959deaec5SRodney W. Grimes  * inital name server(s) to query and the domain search list.
8059deaec5SRodney W. Grimes  */
8159deaec5SRodney W. Grimes 
8259deaec5SRodney W. Grimes #ifndef _PATH_RESCONF
8359deaec5SRodney W. Grimes #define	_PATH_RESCONF        "/etc/resolv.conf"
8459deaec5SRodney W. Grimes #endif
8559deaec5SRodney W. Grimes 
8659deaec5SRodney W. Grimes /*
8759deaec5SRodney W. Grimes  * Global defines and variables for resolver stub.
8859deaec5SRodney W. Grimes  */
8959deaec5SRodney W. Grimes #define	MAXNS			3	/* max # name servers we'll track */
9059deaec5SRodney W. Grimes #define	MAXDFLSRCH		3	/* # default domain levels to try */
9159deaec5SRodney W. Grimes #define	MAXDNSRCH		6	/* max # domains in search path */
9259deaec5SRodney W. Grimes #define	LOCALDOMAINPARTS	2	/* min levels in name that is "local" */
9359deaec5SRodney W. Grimes 
9459deaec5SRodney W. Grimes #define	RES_TIMEOUT		5	/* min. seconds between retries */
951363f04cSPaul Traina #define	MAXRESOLVSORT		10	/* number of net to sort on */
961363f04cSPaul Traina #define	RES_MAXNDOTS		15	/* should reflect bit field size */
9759deaec5SRodney W. Grimes 
9859deaec5SRodney W. Grimes struct __res_state {
9959deaec5SRodney W. Grimes 	int	retrans;	 	/* retransmition time interval */
10059deaec5SRodney W. Grimes 	int	retry;			/* number of times to retransmit */
1011363f04cSPaul Traina 	u_long	options;		/* option flags - see below. */
10259deaec5SRodney W. Grimes 	int	nscount;		/* number of name servers */
1031363f04cSPaul Traina 	struct sockaddr_in
1041363f04cSPaul Traina 		nsaddr_list[MAXNS];	/* address of name server */
10559deaec5SRodney W. Grimes #define	nsaddr	nsaddr_list[0]		/* for backward compatibility */
106315d6d9cSPeter Wemm 	u_short	id;			/* current message id */
10759deaec5SRodney W. Grimes 	char	*dnsrch[MAXDNSRCH+1];	/* components of domain to search */
108315d6d9cSPeter Wemm 	char	defdname[256];		/* default domain (deprecated) */
1091363f04cSPaul Traina 	u_long	pfcode;			/* RES_PRF_ flags - see below. */
1101363f04cSPaul Traina 	unsigned ndots:4;		/* threshold for initial abs. query */
1111363f04cSPaul Traina 	unsigned nsort:4;		/* number of elements in sort_list[] */
1121363f04cSPaul Traina 	char	unused[3];
1131363f04cSPaul Traina 	struct {
1141363f04cSPaul Traina 		struct in_addr	addr;
1151363f04cSPaul Traina 		u_int32_t	mask;
1161363f04cSPaul Traina 	} sort_list[MAXRESOLVSORT];
117315d6d9cSPeter Wemm 	char	pad[72];		/* on an i386 this means 512b total */
11859deaec5SRodney W. Grimes };
11959deaec5SRodney W. Grimes 
1207d56d374SYoshinobu Inoue /* for INET6 */
1217d56d374SYoshinobu Inoue /*
1227d56d374SYoshinobu Inoue  * replacement of __res_state, separated to keep binary compatibility.
1237d56d374SYoshinobu Inoue  */
1247d56d374SYoshinobu Inoue struct __res_state_ext {
1257d56d374SYoshinobu Inoue 	struct sockaddr_storage nsaddr_list[MAXNS];
1267d56d374SYoshinobu Inoue 	struct {
1277d56d374SYoshinobu Inoue 		int	af;		/* address family for addr, mask */
1287d56d374SYoshinobu Inoue 		union {
1297d56d374SYoshinobu Inoue 			struct	in_addr ina;
1307d56d374SYoshinobu Inoue 			struct	in6_addr in6a;
1317d56d374SYoshinobu Inoue 		} addr, mask;
1327d56d374SYoshinobu Inoue 	} sort_list[MAXRESOLVSORT];
1337d56d374SYoshinobu Inoue };
1347d56d374SYoshinobu Inoue 
13559deaec5SRodney W. Grimes /*
13659deaec5SRodney W. Grimes  * Resolver options (keep these in synch with res_debug.c, please)
13759deaec5SRodney W. Grimes  */
1381363f04cSPaul Traina #define RES_INIT	0x00000001	/* address initialized */
1391363f04cSPaul Traina #define RES_DEBUG	0x00000002	/* print debug messages */
140d58a9efdSPeter Wemm #define RES_AAONLY	0x00000004	/* authoritative answers only (!IMPL)*/
1411363f04cSPaul Traina #define RES_USEVC	0x00000008	/* use virtual circuit */
142d58a9efdSPeter Wemm #define RES_PRIMARY	0x00000010	/* query primary server only (!IMPL) */
14371d9c781SMike Pritchard #define RES_IGNTC	0x00000020	/* ignore truncation errors */
1441363f04cSPaul Traina #define RES_RECURSE	0x00000040	/* recursion desired */
1451363f04cSPaul Traina #define RES_DEFNAMES	0x00000080	/* use default domain name */
1461363f04cSPaul Traina #define RES_STAYOPEN	0x00000100	/* Keep TCP socket open */
1471363f04cSPaul Traina #define RES_DNSRCH	0x00000200	/* search up local domain tree */
1481363f04cSPaul Traina #define	RES_INSECURE1	0x00000400	/* type 1 security disabled */
1491363f04cSPaul Traina #define	RES_INSECURE2	0x00000800	/* type 2 security disabled */
150d58a9efdSPeter Wemm #define	RES_NOALIASES	0x00001000	/* shuts off HOSTALIASES feature */
15174b3fad6SPeter Wemm #define	RES_USE_INET6	0x00002000	/* use/map IPv6 in gethostbyname() */
152a367bd9eSBrian Somers #define	RES_NOTLDQUERY	0x00004000	/* Don't query TLD names */
153ce6282dbSHajimu UMEMOTO /* KAME extensions: use higher bit to avoid conflict with ISC use */
154ce6282dbSHajimu UMEMOTO #define	RES_USE_EDNS0	0x40000000	/* use EDNS0 */
15559deaec5SRodney W. Grimes 
15659deaec5SRodney W. Grimes #define RES_DEFAULT	(RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
15759deaec5SRodney W. Grimes 
15859deaec5SRodney W. Grimes /*
15959deaec5SRodney W. Grimes  * Resolver "pfcode" values.  Used by dig.
16059deaec5SRodney W. Grimes  */
1611363f04cSPaul Traina #define	RES_PRF_STATS	0x00000001
1620160f9c0SPeter Wemm #define	RES_PRF_UPDATE	0x00000002
1631363f04cSPaul Traina #define	RES_PRF_CLASS   0x00000004
1641363f04cSPaul Traina #define	RES_PRF_CMD	0x00000008
1651363f04cSPaul Traina #define	RES_PRF_QUES	0x00000010
1661363f04cSPaul Traina #define	RES_PRF_ANS	0x00000020
1671363f04cSPaul Traina #define	RES_PRF_AUTH	0x00000040
1681363f04cSPaul Traina #define	RES_PRF_ADD	0x00000080
1691363f04cSPaul Traina #define	RES_PRF_HEAD1	0x00000100
1701363f04cSPaul Traina #define	RES_PRF_HEAD2	0x00000200
1711363f04cSPaul Traina #define	RES_PRF_TTLID	0x00000400
1721363f04cSPaul Traina #define	RES_PRF_HEADX	0x00000800
1731363f04cSPaul Traina #define	RES_PRF_QUERY	0x00001000
1741363f04cSPaul Traina #define	RES_PRF_REPLY	0x00002000
1751363f04cSPaul Traina #define	RES_PRF_INIT    0x00004000
1761363f04cSPaul Traina /*			0x00008000	*/
17759deaec5SRodney W. Grimes 
1781363f04cSPaul Traina typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
1791363f04cSPaul Traina 	res_sendhookact;
1801363f04cSPaul Traina 
181bb28f3c2SWarner Losh typedef res_sendhookact (*res_send_qhook)(struct sockaddr_in * const *ns,
1821363f04cSPaul Traina 					  const u_char **query,
1831363f04cSPaul Traina 					  int *querylen,
1841363f04cSPaul Traina 					  u_char *ans,
1851363f04cSPaul Traina 					  int anssiz,
186bb28f3c2SWarner Losh 					  int *resplen);
1871363f04cSPaul Traina 
188bb28f3c2SWarner Losh typedef res_sendhookact (*res_send_rhook)(const struct sockaddr_in *ns,
1891363f04cSPaul Traina 					  const u_char *query,
1901363f04cSPaul Traina 					  int querylen,
1911363f04cSPaul Traina 					  u_char *ans,
1921363f04cSPaul Traina 					  int anssiz,
193bb28f3c2SWarner Losh 					  int *resplen);
19459deaec5SRodney W. Grimes 
195315d6d9cSPeter Wemm struct res_sym {
196315d6d9cSPeter Wemm 	int	number;		/* Identifying number, like T_MX */
197315d6d9cSPeter Wemm 	char *	name;		/* Its symbolic name, like "MX" */
198315d6d9cSPeter Wemm 	char *	humanname;	/* Its fun name, like "mail exchanger" */
199315d6d9cSPeter Wemm };
200315d6d9cSPeter Wemm 
20159deaec5SRodney W. Grimes extern struct __res_state _res;
2027d56d374SYoshinobu Inoue /* for INET6 */
2037d56d374SYoshinobu Inoue extern struct __res_state_ext _res_ext;
2047d56d374SYoshinobu Inoue 
205315d6d9cSPeter Wemm extern const struct res_sym __p_class_syms[];
206315d6d9cSPeter Wemm extern const struct res_sym __p_type_syms[];
20759deaec5SRodney W. Grimes 
20859deaec5SRodney W. Grimes /* Private routines shared between libc/net, named, nslookup and others. */
20974b3fad6SPeter Wemm #define	res_hnok	__res_hnok
21074b3fad6SPeter Wemm #define	res_ownok	__res_ownok
21174b3fad6SPeter Wemm #define	res_mailok	__res_mailok
21274b3fad6SPeter Wemm #define	res_dnok	__res_dnok
213315d6d9cSPeter Wemm #define	sym_ston	__sym_ston
214315d6d9cSPeter Wemm #define	sym_ntos	__sym_ntos
215315d6d9cSPeter Wemm #define	sym_ntop	__sym_ntop
216315d6d9cSPeter Wemm #define	b64_ntop	__b64_ntop
217315d6d9cSPeter Wemm #define	b64_pton	__b64_pton
21874b3fad6SPeter Wemm #define	loc_ntoa	__loc_ntoa
21974b3fad6SPeter Wemm #define	loc_aton	__loc_aton
22071e8a85cSPeter Wemm #define	fp_resstat	__fp_resstat
22171e8a85cSPeter Wemm #define	p_query		__p_query
22259deaec5SRodney W. Grimes #define	dn_skipname	__dn_skipname
223315d6d9cSPeter Wemm #define	fp_resstat	__fp_resstat
22459deaec5SRodney W. Grimes #define	fp_query	__fp_query
2251363f04cSPaul Traina #define	fp_nquery	__fp_nquery
22659deaec5SRodney W. Grimes #define	hostalias	__hostalias
22759deaec5SRodney W. Grimes #define	putlong		__putlong
22859deaec5SRodney W. Grimes #define	putshort	__putshort
22959deaec5SRodney W. Grimes #define	p_class		__p_class
23059deaec5SRodney W. Grimes #define	p_time		__p_time
23159deaec5SRodney W. Grimes #define	p_type		__p_type
232315d6d9cSPeter Wemm #define	p_query		__p_query
2331363f04cSPaul Traina #define	p_cdnname	__p_cdnname
23471e8a85cSPeter Wemm #define	p_section	__p_section
2351363f04cSPaul Traina #define	p_cdname	__p_cdname
236315d6d9cSPeter Wemm #define	p_fqnname	__p_fqnname
2371363f04cSPaul Traina #define	p_fqname	__p_fqname
2381363f04cSPaul Traina #define	p_option	__p_option
239315d6d9cSPeter Wemm #define	p_secstodate	__p_secstodate
240315d6d9cSPeter Wemm #define	dn_count_labels	__dn_count_labels
241315d6d9cSPeter Wemm #define	dn_comp		__dn_comp
24271e8a85cSPeter Wemm #define	dn_expand	__dn_expand
24371e8a85cSPeter Wemm #define	res_init	__res_init
244d58a9efdSPeter Wemm #define	res_randomid	__res_randomid
24571e8a85cSPeter Wemm #define	res_query	__res_query
24671e8a85cSPeter Wemm #define	res_search	__res_search
24771e8a85cSPeter Wemm #define	res_querydomain	__res_querydomain
24871e8a85cSPeter Wemm #define	res_mkquery	__res_mkquery
24971e8a85cSPeter Wemm #define	res_send	__res_send
250d58a9efdSPeter Wemm #define	res_isourserver	__res_isourserver
251d58a9efdSPeter Wemm #define	res_nameinquery	__res_nameinquery
252d58a9efdSPeter Wemm #define	res_queriesmatch __res_queriesmatch
253315d6d9cSPeter Wemm #define	res_close	__res_close
254ce6282dbSHajimu UMEMOTO #define	res_opt		__res_opt
25571e8a85cSPeter Wemm #define	res_mkupdate	__res_mkupdate
25671e8a85cSPeter Wemm #define	res_mkupdrec	__res_mkupdrec
25771e8a85cSPeter Wemm #define	res_freeupdrec	__res_freeupdrec
2581363f04cSPaul Traina 
25959deaec5SRodney W. Grimes __BEGIN_DECLS
260bb28f3c2SWarner Losh int		res_hnok(const char *);
261bb28f3c2SWarner Losh int		res_ownok(const char *);
262bb28f3c2SWarner Losh int		res_mailok(const char *);
263bb28f3c2SWarner Losh int		res_dnok(const char *);
264bb28f3c2SWarner Losh int		sym_ston(const struct res_sym *, const char *, int *);
265bb28f3c2SWarner Losh const char *	sym_ntos(const struct res_sym *, int, int *);
266bb28f3c2SWarner Losh const char *	sym_ntop(const struct res_sym *, int, int *);
267bb28f3c2SWarner Losh int		b64_ntop(u_char const *, size_t, char *, size_t);
268bb28f3c2SWarner Losh int		b64_pton(char const *, u_char *, size_t);
269bb28f3c2SWarner Losh int		loc_aton(const char *, u_char *);
270bb28f3c2SWarner Losh const char *	loc_ntoa(const u_char *, char *);
271bb28f3c2SWarner Losh int		dn_skipname(const u_char *, const u_char *);
272bb28f3c2SWarner Losh void		fp_resstat(struct __res_state *, FILE *);
273bb28f3c2SWarner Losh void		fp_query(const u_char *, FILE *);
274bb28f3c2SWarner Losh void		fp_nquery(const u_char *, int, FILE *);
275bb28f3c2SWarner Losh const char *	hostalias(const char *);
276bb28f3c2SWarner Losh void		putlong(u_int32_t, u_char *);
277bb28f3c2SWarner Losh void		putshort(u_int16_t, u_char *);
278bb28f3c2SWarner Losh const char *	p_class(int);
279bb28f3c2SWarner Losh const char *	p_time(u_int32_t);
280bb28f3c2SWarner Losh const char *	p_type(int);
281bb28f3c2SWarner Losh void		p_query(const u_char *);
282bb28f3c2SWarner Losh const u_char *	p_cdnname(const u_char *, const u_char *, int, FILE *);
283bb28f3c2SWarner Losh const u_char *	p_cdname(const u_char *, const u_char *, FILE *);
284bb28f3c2SWarner Losh const u_char *	p_fqnname(const u_char *, const u_char *,
285bb28f3c2SWarner Losh 			  int, char *, int);
286bb28f3c2SWarner Losh const u_char *	p_fqname(const u_char *, const u_char *, FILE *);
287bb28f3c2SWarner Losh const char *	p_option(u_long);
288bb28f3c2SWarner Losh char *		p_secstodate(u_long);
289bb28f3c2SWarner Losh int		dn_count_labels(const char *);
290bb28f3c2SWarner Losh int		dn_comp(const char *, u_char *, int, u_char **, u_char **);
291bb28f3c2SWarner Losh int		dn_expand(const u_char *, const u_char *, const u_char *,
292bb28f3c2SWarner Losh 			  char *, int);
293bb28f3c2SWarner Losh int		res_init(void);
294bb28f3c2SWarner Losh u_int		res_randomid(void);
295bb28f3c2SWarner Losh int		res_query(const char *, int, int, u_char *, int);
296bb28f3c2SWarner Losh int		res_search(const char *, int, int, u_char *, int);
297bb28f3c2SWarner Losh int		res_querydomain(const char *, const char *, int, int,
298bb28f3c2SWarner Losh 				u_char *, int);
299bb28f3c2SWarner Losh int		res_mkquery(int, const char *, int, int, const u_char *,
300bb28f3c2SWarner Losh 			    int, const u_char *, u_char *, int);
301bb28f3c2SWarner Losh int		res_send(const u_char *, int, u_char *, int);
302bb28f3c2SWarner Losh int		res_isourserver(const struct sockaddr_in *);
303bb28f3c2SWarner Losh int		res_nameinquery(const char *, int, int,
304bb28f3c2SWarner Losh 				const u_char *, const u_char *);
305bb28f3c2SWarner Losh int		res_queriesmatch(const u_char *, const u_char *,
306bb28f3c2SWarner Losh 				 const u_char *, const u_char *);
307bb28f3c2SWarner Losh void		res_close(void);
308bb28f3c2SWarner Losh int		res_opt(int, u_char *, int, int);
309bb28f3c2SWarner Losh const char *	p_section(int, int);
31071e8a85cSPeter Wemm /* XXX The following depend on the ns_updrec typedef in arpa/nameser.h */
31171e8a85cSPeter Wemm #ifdef _ARPA_NAMESER_H_
312bb28f3c2SWarner Losh int		res_update(ns_updrec *);
313bb28f3c2SWarner Losh int		res_mkupdate(ns_updrec *, u_char *, int);
314bb28f3c2SWarner Losh ns_updrec *	res_mkupdrec(int, const char *, u_int, u_int, u_long);
315bb28f3c2SWarner Losh void		res_freeupdrec(ns_updrec *);
31671e8a85cSPeter Wemm #endif
31759deaec5SRodney W. Grimes __END_DECLS
31859deaec5SRodney W. Grimes 
31959deaec5SRodney W. Grimes #endif /* !_RESOLV_H_ */
320