/* hash.h - Manage hashes for cached dns records
Copyright (C) 2000 Thomas Moestl
Copyright (C) 2003, 2005 Paul A. Rombouts
This file is part of the pdnsd package.
pdnsd is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
pdnsd is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with pdnsd; see the file COPYING. If not, see
.
*/
#ifndef _HASH_H_
#define _HASH_H_
#include
#include "cache.h"
typedef struct dns_hash_ent_s {
struct dns_hash_ent_s *next;
unsigned long rhash; /* this is a better hash */
dns_cent_t *data;
} dns_hash_ent_t;
/* Redefine this if you want another hash size. Should work ;-).
* The number of hash buckets is computed as power of two;
* so, e.g. HASH_SZ set to 10 yields 1024 hash rows (2^10 or 1<<10).
* Only powers of two are possible conveniently.
* HASH_SZ may not be bigger than 32 (if you set it even close to that value,
* you are nuts.) */
/* #define HASH_SZ 10 */ /* Now defined in config.h */
#define HASH_NUM_BUCKETS (1<