summaryrefslogtreecommitdiffstats
path: root/include/libaccess/dnfstruct.h
blob: d1ab28a3f6e86f9b677a8e67f6fa27119d5834bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/** BEGIN COPYRIGHT BLOCK
 * Copyright 2001 Sun Microsystems, Inc.
 * Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
 * All rights reserved.
 * END COPYRIGHT BLOCK **/
#ifndef __dnfstruct_h
#define __dnfstruct_h

/*
 * Description (dnfstruct_h)
 *
 *	This file defines types and structures used to represent a DNS
 *	name filter in memory.  A DNS name filter contains specifications
 *	of fully or partially qualified DNS names.  Each of these
 *	specifications can be associated with whatever information is
 *	appropriate for a particular use of a DNS name filter.
 */

#include "nspr.h"
#include "plhash.h"

NSPR_BEGIN_EXTERN_C

/*
 * Description (DNSLeaf_t)
 *
 *	This type describes the structure of information associated with
 *	an entry in a DNS filter.  The filter itself is implemented as a
 *	hash table, keyed by the DNS name specification string.  The
 *	value associated with a key is a pointer to a DNSLeaf_t structure.
 */

typedef struct DNSLeaf_s DNSLeaf_t;
struct DNSLeaf_s {
    PLHashEntry dnl_he;		/* NSPR hash table entry */
};

#define dnl_next dnl_he.next		/* hash table collision link */
#define dnl_keyhash dnl_he.keyHash	/* symbol hash value */
#define dnl_key dnl_he.key		/* pointer to Symbol_t structure */
#define dnl_ref dnl_he.value		/* pointer to named structure */

typedef struct DNSFilter_s DNSFilter_t;
struct DNSFilter_s {
    DNSFilter_t * dnf_next;	/* link to next filter */
    void * dnf_hash;		/* pointer to constructed hash table */
};

NSPR_END_EXTERN_C

#endif /* __dnfstruct_h */