dnfstruct.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. #ifdef HAVE_CONFIG_H
  10. #include <config.h>
  11. #endif
  12. #ifndef __dnfstruct_h
  13. #define __dnfstruct_h
  14. /*
  15. * Description (dnfstruct_h)
  16. *
  17. * This file defines types and structures used to represent a DNS
  18. * name filter in memory. A DNS name filter contains specifications
  19. * of fully or partially qualified DNS names. Each of these
  20. * specifications can be associated with whatever information is
  21. * appropriate for a particular use of a DNS name filter.
  22. */
  23. #include "nspr.h"
  24. #include "plhash.h"
  25. NSPR_BEGIN_EXTERN_C
  26. /*
  27. * Description (DNSLeaf_t)
  28. *
  29. * This type describes the structure of information associated with
  30. * an entry in a DNS filter. The filter itself is implemented as a
  31. * hash table, keyed by the DNS name specification string. The
  32. * value associated with a key is a pointer to a DNSLeaf_t structure.
  33. */
  34. typedef struct DNSLeaf_s DNSLeaf_t;
  35. struct DNSLeaf_s
  36. {
  37. PLHashEntry dnl_he; /* NSPR hash table entry */
  38. };
  39. #define dnl_next dnl_he.next /* hash table collision link */
  40. #define dnl_keyhash dnl_he.keyHash /* symbol hash value */
  41. #define dnl_key dnl_he.key /* pointer to Symbol_t structure */
  42. #define dnl_ref dnl_he.value /* pointer to named structure */
  43. typedef struct DNSFilter_s DNSFilter_t;
  44. struct DNSFilter_s
  45. {
  46. DNSFilter_t *dnf_next; /* link to next filter */
  47. void *dnf_hash; /* pointer to constructed hash table */
  48. };
  49. NSPR_END_EXTERN_C
  50. #endif /* __dnfstruct_h */