xref: /minix3/external/bsd/bind/dist/contrib/zkt-1.1.3/zone.h (revision 00b67f09dd46474d133c95011a48590a8e8f94c7)
1 /*	$NetBSD: zone.h,v 1.1.1.1 2015/07/08 15:37:48 christos Exp $	*/
2 
3 /*****************************************************************
4 **
5 **	@(#) zone.h -- Header file for zone info
6 **
7 **	Copyright (c) Mar 2005, Holger Zuleger HZnet. All rights reserved.
8 **
9 **	This software is open source.
10 **
11 **	Redistribution and use in source and binary forms, with or without
12 **	modification, are permitted provided that the following conditions
13 **	are met:
14 **
15 **	Redistributions of source code must retain the above copyright notice,
16 **	this list of conditions and the following disclaimer.
17 **
18 **	Redistributions in binary form must reproduce the above copyright notice,
19 **	this list of conditions and the following disclaimer in the documentation
20 **	and/or other materials provided with the distribution.
21 **
22 **	Neither the name of Holger Zuleger HZnet nor the names of its contributors may
23 **	be used to endorse or promote products derived from this software without
24 **	specific prior written permission.
25 **
26 **	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 **	"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 **	TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 **	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
30 **	LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 **	CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 **	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 **	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 **	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 **	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 **	POSSIBILITY OF SUCH DAMAGE.
37 **
38 *****************************************************************/
39 #ifndef ZONE_H
40 # define ZONE_H
41 
42 # include <sys/types.h>
43 # include <stdio.h>
44 # include <time.h>
45 # include "dki.h"
46 
47 /* all we have to know about a zone */
48 typedef	struct	Zone {
49 	const	char	*zone;	/* domain name or label */
50 	const	char	*dir;	/* directory of zone data */
51 	const	char	*file;	/* file name (zone.db)  */
52 	const	char	*sfile;	/* file name of secured zone (zone.db.signed)  */
53 	const	zconf_t	*conf;	/* ptr to config */	/* TODO: Should this be only a ptr to a local config ? */
54 		dki_t	*keys;	/* ptr to keylist */
55 	struct	Zone	*next;		/* ptr to next entry in list */
56 } zone_t;
57 
58 extern	void	zone_free (zone_t *zp);
59 extern	void	zone_freelist (zone_t **listp);
60 extern	zone_t	*zone_new (zone_t **zp, const char *zone, const char *dir, const char *file, const char *signed_ext, const zconf_t *cp);
61 extern	const	char	*zone_geterrstr ();
62 extern	zone_t	*zone_add (zone_t **list, zone_t *new);
63 extern	const zone_t	*zone_search (const zone_t *list, const char *name);
64 extern	int	zone_readdir (const char *dir, const char *zone, const char *zfile, zone_t **listp, const zconf_t *conf, int dyn_zone);
65 extern	const	char	*zone_geterrstr (void);
66 extern	int	zone_print (const char *mesg, const zone_t *z);
67 
68 #endif
69