| 1 |
/** BEGIN COPYRIGHT BLOCK |
| 2 |
* Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. |
| 3 |
* Copyright (C) 2005 Red Hat, Inc. |
| 4 |
* All rights reserved. |
| 5 |
* |
| 6 |
* License: GPL (version 3 or any later version). |
| 7 |
* See LICENSE for details. |
| 8 |
* END COPYRIGHT BLOCK **/ |
| 9 |
|
| 10 |
#ifdef HAVE_CONFIG_H |
| 11 |
#include <config.h> |
| 12 |
#endif |
| 13 |
|
| 14 |
#ifndef __dnfstruct_h |
| 15 |
#define __dnfstruct_h |
| 16 |
|
| 17 |
/* |
| 18 |
* Description (dnfstruct_h) |
| 19 |
* |
| 20 |
* This file defines types and structures used to represent a DNS |
| 21 |
* name filter in memory. A DNS name filter contains specifications |
| 22 |
* of fully or partially qualified DNS names. Each of these |
| 23 |
* specifications can be associated with whatever information is |
| 24 |
* appropriate for a particular use of a DNS name filter. |
| 25 |
*/ |
| 26 |
|
| 27 |
#include "nspr.h" |
| 28 |
#include "plhash.h" |
| 29 |
|
| 30 |
NSPR_BEGIN_EXTERN_C |
| 31 |
|
| 32 |
/* |
| 33 |
* Description (DNSLeaf_t) |
| 34 |
* |
| 35 |
* This type describes the structure of information associated with |
| 36 |
* an entry in a DNS filter. The filter itself is implemented as a |
| 37 |
* hash table, keyed by the DNS name specification string. The |
| 38 |
* value associated with a key is a pointer to a DNSLeaf_t structure. |
| 39 |
*/ |
| 40 |
|
| 41 |
typedef struct DNSLeaf_s DNSLeaf_t; |
| 42 |
struct DNSLeaf_s |
| 43 |
{ |
| 44 |
PLHashEntry dnl_he; /* NSPR hash table entry */ |
| 45 |
}; |
| 46 |
|
| 47 |
#define dnl_next dnl_he.next /* hash table collision link */ |
| 48 |
#define dnl_keyhash dnl_he.keyHash /* symbol hash value */ |
| 49 |
#define dnl_key dnl_he.key /* pointer to Symbol_t structure */ |
| 50 |
#define dnl_ref dnl_he.value /* pointer to named structure */ |
| 51 |
|
| 52 |
typedef struct DNSFilter_s DNSFilter_t; |
| 53 |
struct DNSFilter_s |
| 54 |
{ |
| 55 |
DNSFilter_t *dnf_next; /* link to next filter */ |
| 56 |
void *dnf_hash; /* pointer to constructed hash table */ |
| 57 |
}; |
| 58 |
|
| 59 |
NSPR_END_EXTERN_C |
| 60 |
|
| 61 |
#endif /* __dnfstruct_h */ |