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