dnfstruct.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. PLHashEntry dnl_he; /* NSPR hash table entry */
  37. };
  38. #define dnl_next dnl_he.next /* hash table collision link */
  39. #define dnl_keyhash dnl_he.keyHash /* symbol hash value */
  40. #define dnl_key dnl_he.key /* pointer to Symbol_t structure */
  41. #define dnl_ref dnl_he.value /* pointer to named structure */
  42. typedef struct DNSFilter_s DNSFilter_t;
  43. struct DNSFilter_s {
  44. DNSFilter_t * dnf_next; /* link to next filter */
  45. void * dnf_hash; /* pointer to constructed hash table */
  46. };
  47. NSPR_END_EXTERN_C
  48. #endif /* __dnfstruct_h */