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