xref: /titanic_44/usr/src/lib/libresolv2/include/res_update.h (revision a60349c89adffc0902b2353230891d8e7f2b24d9)
1 /*
2  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 
7 /*
8  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
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 ISC DISCLAIMS ALL WARRANTIES
16  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
18  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  */
23 
24 /*
25  *	$Id: res_update.h,v 1.3 2005/04/27 04:56:15 sra Exp $
26  */
27 
28 #ifndef __RES_UPDATE_H
29 #define __RES_UPDATE_H
30 
31 /*! \file */
32 
33 #include <sys/types.h>
34 #include <arpa/nameser.h>
35 #include <isc/list.h>
36 #include <resolv.h>
37 
38 #ifndef	ORIGINAL_ISC_CODE
39 /* definition of u_int32_t needed on Solaris */
40 #include <sys/bitypes.h>
41 /* need to rename ns_updrec before we define it here */
42 #include "arpa/port_nameser.h"
43 #endif	/* ORIGINAL_ISC_CODE */
44 
45 
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 typedef	LIST(ns_updrec)	ns_updque;
66 
67 #ifdef	ORIGINAL_ISC_CODE
68 #define res_mkupdate		__res_mkupdate
69 #define res_update		__res_update
70 #define res_mkupdrec		__res_mkupdrec
71 #define res_freeupdrec		__res_freeupdrec
72 #define res_nmkupdate		__res_nmkupdate
73 #define res_nupdate		__res_nupdate
74 #else
75 /* these are renamed in "port_nameser.h" */
76 #endif	/* ORIGINAL_ISC_CODE */
77 
78 
79 int		res_mkupdate __P((ns_updrec *, u_char *, int));
80 int		res_update __P((ns_updrec *));
81 ns_updrec *	res_mkupdrec __P((int, const char *, u_int, u_int, u_long));
82 void		res_freeupdrec __P((ns_updrec *));
83 int		res_nmkupdate __P((res_state, ns_updrec *, u_char *, int));
84 int		res_nupdate __P((res_state, ns_updrec *, ns_tsig_key *));
85 
86 #endif /*__RES_UPDATE_H*/
87 
88 /*! \file */
89