res_update.h revision 158787
11573Srgrimes/*
21573Srgrimes * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
31573Srgrimes * Copyright (c) 1999 by Internet Software Consortium, Inc.
41573Srgrimes *
51573Srgrimes * Permission to use, copy, modify, and distribute this software for any
61573Srgrimes * purpose with or without fee is hereby granted, provided that the above
71573Srgrimes * copyright notice and this permission notice appear in all copies.
81573Srgrimes *
91573Srgrimes * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
101573Srgrimes * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
111573Srgrimes * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
121573Srgrimes * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
131573Srgrimes * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
141573Srgrimes * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
151573Srgrimes * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
161573Srgrimes */
171573Srgrimes
181573Srgrimes/*
191573Srgrimes *	$Id: res_update.h,v 1.1.206.1 2004/03/09 08:33:29 marka Exp $
201573Srgrimes * $FreeBSD: head/include/res_update.h 158787 2006-05-21 11:19:36Z ume $
211573Srgrimes */
221573Srgrimes
231573Srgrimes#ifndef __RES_UPDATE_H
241573Srgrimes#define __RES_UPDATE_H
251573Srgrimes
261573Srgrimes#include <sys/types.h>
271573Srgrimes#include <arpa/nameser.h>
281573Srgrimes#include <resolv.h>
291573Srgrimes
301573Srgrimes/*
311573Srgrimes * This RR-like structure is particular to UPDATE.
321573Srgrimes */
331573Srgrimesstruct ns_updrec {
341573Srgrimes	struct {
3574307Sjlemon		struct ns_updrec *prev;
3674307Sjlemon		struct ns_updrec *next;
371573Srgrimes	} r_link, r_glink;
381573Srgrimes	ns_sect		r_section;	/* ZONE/PREREQUISITE/UPDATE */
391573Srgrimes	char *		r_dname;	/* owner of the RR */
401573Srgrimes	ns_class	r_class;	/* class number */
411573Srgrimes	ns_type		r_type;		/* type number */
421573Srgrimes	u_int32_t	r_ttl;		/* time to live */
431573Srgrimes	u_char *	r_data;		/* rdata fields as text string */
441573Srgrimes	u_int		r_size;		/* size of r_data field */
451573Srgrimes	int		r_opcode;	/* type of operation */
461573Srgrimes	/* following fields for private use by the resolver/server routines */
471573Srgrimes	struct databuf *r_dp;		/* databuf to process */
481573Srgrimes	struct databuf *r_deldp;	/* databuf's deleted/overwritten */
491573Srgrimes	u_int		r_zone;		/* zone number on server */
501573Srgrimes};
511573Srgrimestypedef struct ns_updrec ns_updrec;
521573Srgrimestypedef struct {
531573Srgrimes	ns_updrec *head;
541573Srgrimes	ns_updrec *tail;
551573Srgrimes} ns_updque;
561573Srgrimes
571573Srgrimes#define res_mkupdate		__res_mkupdate
581573Srgrimes#define res_update		__res_update
591573Srgrimes#define res_mkupdrec		__res_mkupdrec
601573Srgrimes#define res_freeupdrec		__res_freeupdrec
611573Srgrimes#define res_nmkupdate		__res_nmkupdate
621573Srgrimes#define res_nupdate		__res_nupdate
638870Srgrimes
641573Srgrimesint		res_mkupdate(ns_updrec *, u_char *, int);
651573Srgrimesint		res_update(ns_updrec *);
661573Srgrimesns_updrec *	res_mkupdrec(int, const char *, u_int, u_int, u_long);
671573Srgrimesvoid		res_freeupdrec(ns_updrec *);
681573Srgrimesint		res_nmkupdate(res_state, ns_updrec *, u_char *, int);
691573Srgrimesint		res_nupdate(res_state, ns_updrec *, ns_tsig_key *);
701573Srgrimes
711573Srgrimes#endif /*__RES_UPDATE_H*/
721573Srgrimes