1147072Sbrooks/*	$OpenBSD: tree.h,v 1.5 2004/05/06 22:29:15 deraadt Exp $	*/
2147072Sbrooks
3147072Sbrooks/* Definitions for address trees... */
4147072Sbrooks
5147072Sbrooks/*
6147072Sbrooks * Copyright (c) 1995 The Internet Software Consortium.  All rights reserved.
7147072Sbrooks *
8147072Sbrooks * Redistribution and use in source and binary forms, with or without
9147072Sbrooks * modification, are permitted provided that the following conditions
10147072Sbrooks * are met:
11147072Sbrooks *
12147072Sbrooks * 1. Redistributions of source code must retain the above copyright
13147072Sbrooks *    notice, this list of conditions and the following disclaimer.
14147072Sbrooks * 2. Redistributions in binary form must reproduce the above copyright
15147072Sbrooks *    notice, this list of conditions and the following disclaimer in the
16147072Sbrooks *    documentation and/or other materials provided with the distribution.
17147072Sbrooks * 3. Neither the name of The Internet Software Consortium nor the names
18147072Sbrooks *    of its contributors may be used to endorse or promote products derived
19147072Sbrooks *    from this software without specific prior written permission.
20147072Sbrooks *
21147072Sbrooks * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
22147072Sbrooks * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23147072Sbrooks * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24147072Sbrooks * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25147072Sbrooks * DISCLAIMED.  IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
26147072Sbrooks * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27147072Sbrooks * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28147072Sbrooks * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
29147072Sbrooks * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30147072Sbrooks * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31147072Sbrooks * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32147072Sbrooks * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33147072Sbrooks * SUCH DAMAGE.
34147072Sbrooks *
35147072Sbrooks * This software has been written for the Internet Software Consortium
36147072Sbrooks * by Ted Lemon <mellon@fugue.com> in cooperation with Vixie
37147072Sbrooks * Enterprises.  To learn more about the Internet Software Consortium,
38147072Sbrooks * see ``http://www.vix.com/isc''.  To learn more about Vixie
39147072Sbrooks * Enterprises, see ``http://www.vix.com''.
40147072Sbrooks */
41147072Sbrooks
42147072Sbrooks/* A pair of pointers, suitable for making a linked list. */
43147072Sbrookstypedef struct _pair {
44147072Sbrooks	caddr_t car;
45147072Sbrooks	struct _pair *cdr;
46147072Sbrooks} *pair;
47147072Sbrooks
48147072Sbrooksstruct tree_cache {
49147072Sbrooks	unsigned char *value;
50147072Sbrooks	int len;
51147072Sbrooks	int buf_size;
52147072Sbrooks	time_t timeout;
53147072Sbrooks};
54147072Sbrooks
55147072Sbrooksstruct universe {
56147072Sbrooks	char *name;
57147072Sbrooks	struct hash_table *hash;
58147072Sbrooks	struct option *options[256];
59147072Sbrooks};
60147072Sbrooks
61147072Sbrooksstruct option {
62147072Sbrooks	char *name;
63147072Sbrooks	char *format;
64147072Sbrooks	struct universe *universe;
65147072Sbrooks	unsigned char code;
66147072Sbrooks};
67