1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * Copyright (c) 1999 by Sun Microsystems, Inc.
3*0Sstevel@tonic-gate  * All rights reserved.
4*0Sstevel@tonic-gate  */
5*0Sstevel@tonic-gate 
6*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
7*0Sstevel@tonic-gate 
8*0Sstevel@tonic-gate /*
9*0Sstevel@tonic-gate  * Copyright (c) 1999 by Internet Software Consortium, Inc.
10*0Sstevel@tonic-gate  *
11*0Sstevel@tonic-gate  * Permission to use, copy, modify, and distribute this software for any
12*0Sstevel@tonic-gate  * purpose with or without fee is hereby granted, provided that the above
13*0Sstevel@tonic-gate  * copyright notice and this permission notice appear in all copies.
14*0Sstevel@tonic-gate  *
15*0Sstevel@tonic-gate  * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
16*0Sstevel@tonic-gate  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
17*0Sstevel@tonic-gate  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
18*0Sstevel@tonic-gate  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
19*0Sstevel@tonic-gate  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
20*0Sstevel@tonic-gate  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
21*0Sstevel@tonic-gate  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
22*0Sstevel@tonic-gate  * SOFTWARE.
23*0Sstevel@tonic-gate  */
24*0Sstevel@tonic-gate 
25*0Sstevel@tonic-gate /*
26*0Sstevel@tonic-gate  *	$Id: res_update.h,v 8.1 1999/10/07 08:24:13 vixie Exp $
27*0Sstevel@tonic-gate  */
28*0Sstevel@tonic-gate 
29*0Sstevel@tonic-gate #ifndef __RES_UPDATE_H
30*0Sstevel@tonic-gate #define __RES_UPDATE_H
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate #include <sys/types.h>
33*0Sstevel@tonic-gate #include <sys/bitypes.h>
34*0Sstevel@tonic-gate #include <arpa/nameser.h>
35*0Sstevel@tonic-gate #include <isc/list.h>
36*0Sstevel@tonic-gate #include <resolv.h>
37*0Sstevel@tonic-gate 
38*0Sstevel@tonic-gate #ifdef	ORIGINAL_ISC_CODE
39*0Sstevel@tonic-gate #else
40*0Sstevel@tonic-gate /*
41*0Sstevel@tonic-gate  * ISC changed the ns_updrec structure. However, it's a public interface
42*0Sstevel@tonic-gate  * in Solaris, so it's time to break out that old #define magic.
43*0Sstevel@tonic-gate  */
44*0Sstevel@tonic-gate #define	ns_updrec	__ISC_ns_updrec
45*0Sstevel@tonic-gate #endif	/* ORIGINAL_ISC_CODE */
46*0Sstevel@tonic-gate /*
47*0Sstevel@tonic-gate  * This RR-like structure is particular to UPDATE.
48*0Sstevel@tonic-gate  */
49*0Sstevel@tonic-gate struct ns_updrec {
50*0Sstevel@tonic-gate 	LINK(struct ns_updrec) r_link, r_glink;
51*0Sstevel@tonic-gate 	ns_sect		r_section;	/* ZONE/PREREQUISITE/UPDATE */
52*0Sstevel@tonic-gate 	char *		r_dname;	/* owner of the RR */
53*0Sstevel@tonic-gate 	ns_class	r_class;	/* class number */
54*0Sstevel@tonic-gate 	ns_type		r_type;		/* type number */
55*0Sstevel@tonic-gate 	u_int32_t	r_ttl;		/* time to live */
56*0Sstevel@tonic-gate 	u_char *	r_data;		/* rdata fields as text string */
57*0Sstevel@tonic-gate 	u_int		r_size;		/* size of r_data field */
58*0Sstevel@tonic-gate 	int		r_opcode;	/* type of operation */
59*0Sstevel@tonic-gate 	/* following fields for private use by the resolver/server routines */
60*0Sstevel@tonic-gate 	struct databuf *r_dp;		/* databuf to process */
61*0Sstevel@tonic-gate 	struct databuf *r_deldp;	/* databuf's deleted/overwritten */
62*0Sstevel@tonic-gate 	u_int		r_zone;		/* zone number on server */
63*0Sstevel@tonic-gate };
64*0Sstevel@tonic-gate typedef struct ns_updrec ns_updrec;
65*0Sstevel@tonic-gate 
66*0Sstevel@tonic-gate typedef	LIST(ns_updrec)	ns_updque;
67*0Sstevel@tonic-gate 
68*0Sstevel@tonic-gate #ifdef	ORIGINAL_ISC_CODE
69*0Sstevel@tonic-gate #define res_mkupdate		__res_mkupdate
70*0Sstevel@tonic-gate #define res_update		__res_update
71*0Sstevel@tonic-gate #define res_mkupdrec		__res_mkupdrec
72*0Sstevel@tonic-gate #define res_freeupdrec		__res_freeupdrec
73*0Sstevel@tonic-gate #define res_nmkupdate		__res_nmkupdate
74*0Sstevel@tonic-gate #define res_nupdate		__res_nupdate
75*0Sstevel@tonic-gate #else
76*0Sstevel@tonic-gate /*
77*0Sstevel@tonic-gate  * For BIND 8.2.2, ISC removed the dynamic update functions, and the
78*0Sstevel@tonic-gate  * definition of the ns_updrec structure, from the public include files
79*0Sstevel@tonic-gate  * (<resolv.h>, <arpa/nameser.h>. However, res_update(), res_mkupdate(),
80*0Sstevel@tonic-gate  * and res_mkupdrec() are in the public libresolv interface in Solaris,
81*0Sstevel@tonic-gate  * so we can't easily remove them. Thus, ISC's new versions of res_mkupdate()
82*0Sstevel@tonic-gate  * etc. can't be exposed under their original names.
83*0Sstevel@tonic-gate  *
84*0Sstevel@tonic-gate  * res_nmkupdate() and res_nupdate are new. We could either change them
85*0Sstevel@tonic-gate  * to accept the <arpa/nameser.h> ns_updrec, or leave them unchanged and
86*0Sstevel@tonic-gate  * undocumented. Since ISC may change ns_updrec again, we pick the latter
87*0Sstevel@tonic-gate  * solution for now.
88*0Sstevel@tonic-gate  */
89*0Sstevel@tonic-gate #define	res_mkupdate	__ISC_res_mkupdate
90*0Sstevel@tonic-gate #define	res_update	__ISC_res_update
91*0Sstevel@tonic-gate #define	res_mkupdrec	__ISC_res_mkupdrec
92*0Sstevel@tonic-gate #define	res_freeupdrec	__ISC_res_freeupdrec
93*0Sstevel@tonic-gate #define	res_nmkupdate	__ISC_res_nmkupdate
94*0Sstevel@tonic-gate #define	res_nupdate	__ISC_res_nupdate
95*0Sstevel@tonic-gate #endif	/* ORIGINAL_ISC_CODE */
96*0Sstevel@tonic-gate 
97*0Sstevel@tonic-gate int		res_mkupdate __P((ns_updrec *, u_char *, int));
98*0Sstevel@tonic-gate int		res_update __P((ns_updrec *));
99*0Sstevel@tonic-gate ns_updrec *	res_mkupdrec __P((int, const char *, u_int, u_int, u_long));
100*0Sstevel@tonic-gate void		res_freeupdrec __P((ns_updrec *));
101*0Sstevel@tonic-gate int		res_nmkupdate __P((res_state, ns_updrec *, u_char *, int));
102*0Sstevel@tonic-gate int		res_nupdate __P((res_state, ns_updrec *, ns_tsig_key *));
103*0Sstevel@tonic-gate 
104*0Sstevel@tonic-gate #endif /*__RES_UPDATE_H*/
105