xref: /dragonfly/include/res_update.h (revision 86d7f5d3)
1*86d7f5d3SJohn Marino /*
2*86d7f5d3SJohn Marino  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3*86d7f5d3SJohn Marino  * Copyright (c) 1999 by Internet Software Consortium, Inc.
4*86d7f5d3SJohn Marino  *
5*86d7f5d3SJohn Marino  * Permission to use, copy, modify, and distribute this software for any
6*86d7f5d3SJohn Marino  * purpose with or without fee is hereby granted, provided that the above
7*86d7f5d3SJohn Marino  * copyright notice and this permission notice appear in all copies.
8*86d7f5d3SJohn Marino  *
9*86d7f5d3SJohn Marino  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
10*86d7f5d3SJohn Marino  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*86d7f5d3SJohn Marino  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
12*86d7f5d3SJohn Marino  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*86d7f5d3SJohn Marino  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*86d7f5d3SJohn Marino  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15*86d7f5d3SJohn Marino  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*86d7f5d3SJohn Marino  */
17*86d7f5d3SJohn Marino 
18*86d7f5d3SJohn Marino /*
19*86d7f5d3SJohn Marino  *	$Id: res_update.h,v 1.2.18.1 2005/04/27 05:00:49 sra Exp $
20*86d7f5d3SJohn Marino  * $FreeBSD: src/include/res_update.h,v 1.3 2007/06/03 17:20:25 ume Exp $
21*86d7f5d3SJohn Marino  */
22*86d7f5d3SJohn Marino 
23*86d7f5d3SJohn Marino #ifndef __RES_UPDATE_H
24*86d7f5d3SJohn Marino #define __RES_UPDATE_H
25*86d7f5d3SJohn Marino 
26*86d7f5d3SJohn Marino /*! \file */
27*86d7f5d3SJohn Marino 
28*86d7f5d3SJohn Marino #include <sys/types.h>
29*86d7f5d3SJohn Marino #include <arpa/nameser.h>
30*86d7f5d3SJohn Marino #include <resolv.h>
31*86d7f5d3SJohn Marino 
32*86d7f5d3SJohn Marino /*%
33*86d7f5d3SJohn Marino  * This RR-like structure is particular to UPDATE.
34*86d7f5d3SJohn Marino  */
35*86d7f5d3SJohn Marino struct ns_updrec {
36*86d7f5d3SJohn Marino 	struct {
37*86d7f5d3SJohn Marino 		struct ns_updrec *prev;
38*86d7f5d3SJohn Marino 		struct ns_updrec *next;
39*86d7f5d3SJohn Marino 	} r_link, r_glink;
40*86d7f5d3SJohn Marino 	ns_sect		r_section;	/*%< ZONE/PREREQUISITE/UPDATE */
41*86d7f5d3SJohn Marino 	char *		r_dname;	/*%< owner of the RR */
42*86d7f5d3SJohn Marino 	ns_class	r_class;	/*%< class number */
43*86d7f5d3SJohn Marino 	ns_type		r_type;		/*%< type number */
44*86d7f5d3SJohn Marino 	u_int32_t	r_ttl;		/*%< time to live */
45*86d7f5d3SJohn Marino 	u_char *	r_data;		/*%< rdata fields as text string */
46*86d7f5d3SJohn Marino 	u_int		r_size;		/*%< size of r_data field */
47*86d7f5d3SJohn Marino 	int		r_opcode;	/*%< type of operation */
48*86d7f5d3SJohn Marino 	/* following fields for private use by the resolver/server routines */
49*86d7f5d3SJohn Marino 	struct databuf *r_dp;		/*%< databuf to process */
50*86d7f5d3SJohn Marino 	struct databuf *r_deldp;	/*%< databuf's deleted/overwritten */
51*86d7f5d3SJohn Marino 	u_int		r_zone;		/*%< zone number on server */
52*86d7f5d3SJohn Marino };
53*86d7f5d3SJohn Marino typedef struct ns_updrec ns_updrec;
54*86d7f5d3SJohn Marino typedef struct {
55*86d7f5d3SJohn Marino 	ns_updrec *head;
56*86d7f5d3SJohn Marino 	ns_updrec *tail;
57*86d7f5d3SJohn Marino } ns_updque;
58*86d7f5d3SJohn Marino 
59*86d7f5d3SJohn Marino #define res_mkupdate		__res_mkupdate
60*86d7f5d3SJohn Marino #define res_update		__res_update
61*86d7f5d3SJohn Marino #define res_mkupdrec		__res_mkupdrec
62*86d7f5d3SJohn Marino #define res_freeupdrec		__res_freeupdrec
63*86d7f5d3SJohn Marino #define res_nmkupdate		__res_nmkupdate
64*86d7f5d3SJohn Marino #define res_nupdate		__res_nupdate
65*86d7f5d3SJohn Marino 
66*86d7f5d3SJohn Marino int		res_mkupdate(ns_updrec *, u_char *, int);
67*86d7f5d3SJohn Marino int		res_update(ns_updrec *);
68*86d7f5d3SJohn Marino ns_updrec *	res_mkupdrec(int, const char *, u_int, u_int, u_long);
69*86d7f5d3SJohn Marino void		res_freeupdrec(ns_updrec *);
70*86d7f5d3SJohn Marino int		res_nmkupdate(res_state, ns_updrec *, u_char *, int);
71*86d7f5d3SJohn Marino int		res_nupdate(res_state, ns_updrec *, ns_tsig_key *);
72*86d7f5d3SJohn Marino 
73*86d7f5d3SJohn Marino #endif /*__RES_UPDATE_H*/
74