dnfstruct.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright 2001 Sun Microsystems, Inc.
  3. * Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
  4. * All rights reserved.
  5. * END COPYRIGHT BLOCK **/
  6. #ifndef __dnfstruct_h
  7. #define __dnfstruct_h
  8. /*
  9. * Description (dnfstruct_h)
  10. *
  11. * This file defines types and structures used to represent a DNS
  12. * name filter in memory. A DNS name filter contains specifications
  13. * of fully or partially qualified DNS names. Each of these
  14. * specifications can be associated with whatever information is
  15. * appropriate for a particular use of a DNS name filter.
  16. */
  17. #include "nspr.h"
  18. #include "plhash.h"
  19. NSPR_BEGIN_EXTERN_C
  20. /*
  21. * Description (DNSLeaf_t)
  22. *
  23. * This type describes the structure of information associated with
  24. * an entry in a DNS filter. The filter itself is implemented as a
  25. * hash table, keyed by the DNS name specification string. The
  26. * value associated with a key is a pointer to a DNSLeaf_t structure.
  27. */
  28. typedef struct DNSLeaf_s DNSLeaf_t;
  29. struct DNSLeaf_s {
  30. PLHashEntry dnl_he; /* NSPR hash table entry */
  31. };
  32. #define dnl_next dnl_he.next /* hash table collision link */
  33. #define dnl_keyhash dnl_he.keyHash /* symbol hash value */
  34. #define dnl_key dnl_he.key /* pointer to Symbol_t structure */
  35. #define dnl_ref dnl_he.value /* pointer to named structure */
  36. typedef struct DNSFilter_s DNSFilter_t;
  37. struct DNSFilter_s {
  38. DNSFilter_t * dnf_next; /* link to next filter */
  39. void * dnf_hash; /* pointer to constructed hash table */
  40. };
  41. NSPR_END_EXTERN_C
  42. #endif /* __dnfstruct_h */