res_update.h revision 170244
16527Sache/*
26527Sache * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
36527Sache * Copyright (c) 1999 by Internet Software Consortium, Inc.
46527Sache *
56527Sache * Permission to use, copy, modify, and distribute this software for any
66527Sache * purpose with or without fee is hereby granted, provided that the above
76527Sache * copyright notice and this permission notice appear in all copies.
86527Sache *
96527Sache * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
106527Sache * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
116527Sache * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
126527Sache * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
136527Sache * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
146527Sache * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
156527Sache * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
166527Sache */
176527Sache
186527Sache/*
196527Sache *	$Id: res_update.h,v 1.2.18.1 2005/04/27 05:00:49 sra Exp $
206527Sache * $FreeBSD: head/include/res_update.h 170244 2007-06-03 17:20:27Z ume $
216527Sache */
226527Sache
236527Sache#ifndef __RES_UPDATE_H
246527Sache#define __RES_UPDATE_H
256527Sache
266527Sache/*! \file */
276527Sache
286527Sache#include <sys/types.h>
2987243Smarkm#include <arpa/nameser.h>
3087243Smarkm#include <resolv.h>
3187243Smarkm
32102659Sache/*%
336527Sache * This RR-like structure is particular to UPDATE.
3418950Sache */
356527Sachestruct ns_updrec {
366527Sache	struct {
3723706Speter		struct ns_updrec *prev;
386527Sache		struct ns_updrec *next;
396527Sache	} r_link, r_glink;
4087012Sache	ns_sect		r_section;	/*%< ZONE/PREREQUISITE/UPDATE */
416527Sache	char *		r_dname;	/*%< owner of the RR */
426527Sache	ns_class	r_class;	/*%< class number */
4387243Smarkm	ns_type		r_type;		/*%< type number */
4441568Sarchie	u_int32_t	r_ttl;		/*%< time to live */
4541568Sarchie	u_char *	r_data;		/*%< rdata fields as text string */
4687243Smarkm	u_int		r_size;		/*%< size of r_data field */
4787243Smarkm	int		r_opcode;	/*%< type of operation */
486527Sache	/* following fields for private use by the resolver/server routines */
4918950Sache	struct databuf *r_dp;		/*%< databuf to process */
50102299Sache	struct databuf *r_deldp;	/*%< databuf's deleted/overwritten */
5118950Sache	u_int		r_zone;		/*%< zone number on server */
5218950Sache};
5387012Sachetypedef struct ns_updrec ns_updrec;
54101866Sachetypedef struct {
55101866Sache	ns_updrec *head;
566527Sache	ns_updrec *tail;
57101866Sache} ns_updque;
586527Sache
59102640Sache#define res_mkupdate		__res_mkupdate
60101866Sache#define res_update		__res_update
61142686Sru#define res_mkupdrec		__res_mkupdrec
626527Sache#define res_freeupdrec		__res_freeupdrec
636527Sache#define res_nmkupdate		__res_nmkupdate
646527Sache#define res_nupdate		__res_nupdate
656527Sache
666527Sacheint		res_mkupdate(ns_updrec *, u_char *, int);
6787243Smarkmint		res_update(ns_updrec *);
686527Sachens_updrec *	res_mkupdrec(int, const char *, u_int, u_int, u_long);
696527Sachevoid		res_freeupdrec(ns_updrec *);
706527Sacheint		res_nmkupdate(res_state, ns_updrec *, u_char *, int);
7187052Sacheint		res_nupdate(res_state, ns_updrec *, ns_tsig_key *);
726527Sache
736527Sache#endif /*__RES_UPDATE_H*/
746527Sache
7518950Sache/*! \file */
766527Sache