Commit 92ef1a9b authored by David Lawrence's avatar David Lawrence

use ISC_MAGIC for all magic numbers, for our friends in EBCDIC land

parent b5a86fe4
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: client.c,v 1.169 2001/05/28 05:16:54 marka Exp $ */
/* $Id: client.c,v 1.170 2001/06/04 19:32:52 tale Exp $ */
#include <config.h>
......@@ -100,9 +100,8 @@ struct ns_clientmgr {
client_list_t inactive; /* To be recycled */
};
#define MANAGER_MAGIC 0x4E53436DU /* NSCm */
#define VALID_MANAGER(m) ((m) != NULL && \
(m)->magic == MANAGER_MAGIC)
#define MANAGER_MAGIC ISC_MAGIC('N', 'S', 'C', 'm')
#define VALID_MANAGER(m) ISC_MAGIC_VALID(m, MANAGER_MAGIC)
/*
* Client object states. Ordering is significant: higher-numbered
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: interfacemgr.c,v 1.57 2001/02/27 04:20:44 bwelling Exp $ */
/* $Id: interfacemgr.c,v 1.58 2001/06/04 19:32:53 tale Exp $ */
#include <config.h>
......@@ -31,8 +31,8 @@
#include <named/log.h>
#include <named/interfacemgr.h>
#define IFMGR_MAGIC 0x49464D47U /* IFMG. */
#define NS_INTERFACEMGR_VALID(t) ISC_MAGIC_VALID(t, IFMGR_MAGIC)
#define IFMGR_MAGIC ISC_MAGIC('I', 'F', 'M', 'G')
#define NS_INTERFACEMGR_VALID(t) ISC_MAGIC_VALID(t, IFMGR_MAGIC)
#define IFMGR_COMMON_LOGARGS \
ns_g_lctx, NS_LOGCATEGORY_NETWORK, NS_LOGMODULE_INTERFACEMGR
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: a6.c,v 1.19 2001/01/09 21:50:35 bwelling Exp $ */
/* $Id: a6.c,v 1.20 2001/06/04 19:32:54 tale Exp $ */
#include <config.h>
......@@ -26,7 +26,7 @@
#include <dns/rdata.h>
#include <dns/rdataset.h>
#define A6CONTEXT_MAGIC 0x41365858U /* A6XX. */
#define A6CONTEXT_MAGIC ISC_MAGIC('A', '6', 'X', 'X')
#define VALID_A6CONTEXT(ac) ISC_MAGIC_VALID(ac, A6CONTEXT_MAGIC)
#define MAX_CHAINS 8
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: adb.c,v 1.178 2001/05/29 22:44:12 bwelling Exp $ */
/* $Id: adb.c,v 1.179 2001/06/04 19:32:55 tale Exp $ */
/*
* Implementation notes
......@@ -57,19 +57,19 @@
#include <dns/resolver.h>
#include <dns/result.h>
#define DNS_ADB_MAGIC 0x44616462 /* Dadb. */
#define DNS_ADB_MAGIC ISC_MAGIC('D', 'a', 'd', 'b')
#define DNS_ADB_VALID(x) ISC_MAGIC_VALID(x, DNS_ADB_MAGIC)
#define DNS_ADBNAME_MAGIC 0x6164624e /* adbN. */
#define DNS_ADBNAME_MAGIC ISC_MAGIC('a', 'd', 'b', 'N')
#define DNS_ADBNAME_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBNAME_MAGIC)
#define DNS_ADBNAMEHOOK_MAGIC 0x61644e48 /* adNH. */
#define DNS_ADBNAMEHOOK_MAGIC ISC_MAGIC('a', 'd', 'N', 'H')
#define DNS_ADBNAMEHOOK_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBNAMEHOOK_MAGIC)
#define DNS_ADBZONEINFO_MAGIC 0x6164625a /* adbZ. */
#define DNS_ADBZONEINFO_MAGIC ISC_MAGIC('a', 'd', 'b', 'Z')
#define DNS_ADBZONEINFO_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBZONEINFO_MAGIC)
#define DNS_ADBENTRY_MAGIC 0x61646245 /* adbE. */
#define DNS_ADBENTRY_MAGIC ISC_MAGIC('a', 'd', 'b', 'E')
#define DNS_ADBENTRY_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBENTRY_MAGIC)
#define DNS_ADBFETCH_MAGIC 0x61644634 /* adF4. */
#define DNS_ADBFETCH_MAGIC ISC_MAGIC('a', 'd', 'F', '4')
#define DNS_ADBFETCH_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBFETCH_MAGIC)
#define DNS_ADBFETCH6_MAGIC 0x61644636 /* adF6. */
#define DNS_ADBFETCH6_MAGIC ISC_MAGIC('a', 'd', 'F', '6')
#define DNS_ADBFETCH6_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBFETCH6_MAGIC)
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: byaddr.c,v 1.28 2001/01/09 21:50:39 bwelling Exp $ */
/* $Id: byaddr.c,v 1.29 2001/06/04 19:32:57 tale Exp $ */
#include <config.h>
......@@ -54,9 +54,8 @@ struct dns_byaddr {
isc_boolean_t canceled;
};
#define BYADDR_MAGIC 0x42794164U /* ByAd. */
#define VALID_BYADDR(b) ((b) != NULL && \
(b)->magic == BYADDR_MAGIC)
#define BYADDR_MAGIC ISC_MAGIC('B', 'y', 'A', 'd')
#define VALID_BYADDR(b) ISC_MAGIC_VALID(b, BYADDR_MAGIC)
#define MAX_RESTARTS 16
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cache.c,v 1.38 2001/05/31 10:53:42 tale Exp $ */
/* $Id: cache.c,v 1.39 2001/06/04 19:32:58 tale Exp $ */
#include <config.h>
......@@ -33,7 +33,7 @@
#include <dns/masterdump.h>
#include <dns/result.h>
#define CACHE_MAGIC 0x24242424U /* $$$$. */
#define CACHE_MAGIC ISC_MAGIC('$', '$', '$', '$')
#define VALID_CACHE(cache) ISC_MAGIC_VALID(cache, CACHE_MAGIC)
/***
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: compress.c,v 1.49 2001/02/15 01:14:16 bwelling Exp $ */
/* $Id: compress.c,v 1.50 2001/06/04 19:32:59 tale Exp $ */
#define DNS_NAME_USEINLINE 1
......@@ -30,10 +30,10 @@
#include <dns/rbt.h>
#include <dns/result.h>
#define CCTX_MAGIC 0x43435458U /* CCTX */
#define CCTX_MAGIC ISC_MAGIC('C', 'C', 'T', 'X')
#define VALID_CCTX(x) ISC_MAGIC_VALID(x, CCTX_MAGIC)
#define DCTX_MAGIC 0x44435458U /* DCTX */
#define DCTX_MAGIC ISC_MAGIC('D', 'C', 'T', 'X')
#define VALID_DCTX(x) ISC_MAGIC_VALID(x, DCTX_MAGIC)
/***
......
......@@ -16,7 +16,7 @@
*/
/*
* $Id: dbtable.c,v 1.24 2001/01/12 00:31:50 marka Exp $
* $Id: dbtable.c,v 1.25 2001/06/04 19:33:00 tale Exp $
*/
/*
......@@ -48,9 +48,8 @@ struct dns_dbtable {
dns_db_t * default_db;
};
#define DBTABLE_MAGIC 0x44422D2DU /* DB--. */
#define VALID_DBTABLE(dbtable) ((dbtable) != NULL && \
(dbtable)->magic == DBTABLE_MAGIC)
#define DBTABLE_MAGIC ISC_MAGIC('D', 'B', '-', '-')
#define VALID_DBTABLE(dbtable) ISC_MAGIC_VALID(dbtable, DBTABLE_MAGIC)
static void
dbdetach(void *data, void *arg) {
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: forward.c,v 1.4 2001/01/15 19:54:12 bwelling Exp $ */
/* $Id: forward.c,v 1.5 2001/06/04 19:33:01 tale Exp $ */
#include <config.h>
......@@ -39,7 +39,7 @@ struct dns_fwdtable {
dns_rbt_t *table;
};
#define FWDTABLEMAGIC 0x46776454U /* FwdT */
#define FWDTABLEMAGIC ISC_MAGIC('F', 'w', 'd', 'T')
#define VALID_FWDTABLE(ft) ISC_MAGIC_VALID(ft, FWDTABLEMAGIC)
static void
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: journal.c,v 1.75 2001/05/21 23:56:31 gson Exp $ */
/* $Id: journal.c,v 1.76 2001/06/04 19:33:02 tale Exp $ */
#include <config.h>
......@@ -331,7 +331,7 @@ struct dns_journal {
} it;
};
#define DNS_JOURNAL_MAGIC 0x4a4f5552U /* JOUR. */
#define DNS_JOURNAL_MAGIC ISC_MAGIC('J', 'O', 'U', 'R')
#define DNS_JOURNAL_VALID(t) ISC_MAGIC_VALID(t, DNS_JOURNAL_MAGIC)
static void
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: keytable.c,v 1.25 2001/01/24 02:22:50 bwelling Exp $ */
/* $Id: keytable.c,v 1.26 2001/06/04 19:33:03 tale Exp $ */
#include <config.h>
......@@ -42,7 +42,7 @@ struct dns_keytable {
dns_rbt_t *table;
};
#define KEYTABLE_MAGIC 0x4b54626cU /* KTbl */
#define KEYTABLE_MAGIC ISC_MAGIC('K', 'T', 'b', 'l')
#define VALID_KEYTABLE(kt) ISC_MAGIC_VALID(kt, KEYTABLE_MAGIC)
struct dns_keynode {
......@@ -51,7 +51,7 @@ struct dns_keynode {
struct dns_keynode * next;
};
#define KEYNODE_MAGIC 0x4b4e6f64U /* KNod */
#define KEYNODE_MAGIC ISC_MAGIC('K', 'N', 'o', 'd')
#define VALID_KEYNODE(kn) ISC_MAGIC_VALID(kn, KEYNODE_MAGIC)
static void
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbt.c,v 1.114 2001/05/31 22:32:46 tale Exp $ */
/* $Id: rbt.c,v 1.115 2001/06/04 19:33:05 tale Exp $ */
/* Principal Authors: DCL */
......@@ -44,7 +44,7 @@
* chain junk, and replace with dns_rbt_firstnode, _previousnode, _nextnode,
* _lastnode. This would involve pretty major change to the API.
*/
#define CHAIN_MAGIC 0x302d302dU /* 0-0-. */
#define CHAIN_MAGIC ISC_MAGIC('0', '-', '0', '-')
#define VALID_CHAIN(chain) ISC_MAGIC_VALID(chain, CHAIN_MAGIC)
#define RBT_HASH_SIZE 64
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbtdb.c,v 1.165 2001/05/15 05:35:24 halley Exp $ */
/* $Id: rbtdb.c,v 1.166 2001/06/04 19:33:06 tale Exp $ */
/*
* Principal Author: Bob Halley
......@@ -52,14 +52,12 @@
#endif
#ifdef DNS_RBTDB_VERSION64
#define RBTDB_MAGIC 0x52424438U /* RBD8. */
#define RBTDB_MAGIC ISC_MAGIC('R', 'B', 'D', '8')
#else
#define RBTDB_MAGIC 0x52424434U /* RBD4. */
#define RBTDB_MAGIC ISC_MAGIC('R', 'B', 'D', '4')
#endif
#define VALID_RBTDB(rbtdb) ((rbtdb) != NULL && \
(rbtdb)->common.impmagic == \
RBTDB_MAGIC)
#define VALID_RBTDB(rbtdb) ISC_MAGIC_VALID(rbtdb, RBTDB_MAGIC)
#ifdef DNS_RBTDB_VERSION64
typedef isc_uint64_t rbtdb_serial_t;
......
......@@ -15,10 +15,11 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: request.c,v 1.60 2001/04/16 21:14:27 bwelling Exp $ */
/* $Id: request.c,v 1.61 2001/06/04 19:33:08 tale Exp $ */
#include <config.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/task.h>
#include <isc/timer.h>
......@@ -36,13 +37,11 @@
#include <dns/result.h>
#include <dns/tsig.h>
#define REQUESTMGR_MAGIC 0x5271754dU /* RquM */
#define VALID_REQUESTMGR(mgr) ((mgr) != NULL && \
(mgr)->magic == REQUESTMGR_MAGIC)
#define REQUESTMGR_MAGIC ISC_MAGIC('R', 'q', 'u', 'M')
#define VALID_REQUESTMGR(mgr) ISC_MAGIC_VALID(mgr, REQUESTMGR_MAGIC)
#define REQUEST_MAGIC 0x52717521U /* Rqu! */
#define VALID_REQUEST(request) ((request) != NULL && \
(request)->magic == REQUEST_MAGIC)
#define REQUEST_MAGIC ISC_MAGIC('R', 'q', 'u', '!')
#define VALID_REQUEST(request) ISC_MAGIC_VALID(request, REQUEST_MAGIC)
typedef ISC_LIST(dns_request_t) dns_requestlist_t;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.216 2001/05/29 23:07:28 bwelling Exp $ */
/* $Id: resolver.c,v 1.217 2001/06/04 19:33:09 tale Exp $ */
#include <config.h>
......@@ -123,9 +123,8 @@ typedef struct query {
unsigned char data[512];
} resquery_t;
#define QUERY_MAGIC 0x51212121U /* Q!!! */
#define VALID_QUERY(query) ((query) != NULL && \
(query)->magic == QUERY_MAGIC)
#define QUERY_MAGIC ISC_MAGIC('Q', '!', '!', '!')
#define VALID_QUERY(query) ISC_MAGIC_VALID(query, QUERY_MAGIC)
#define RESQUERY_ATTR_CANCELED 0x02
......@@ -199,9 +198,8 @@ struct fetchctx {
unsigned int timeouts;
};
#define FCTX_MAGIC 0x46212121U /* F!!! */
#define VALID_FCTX(fctx) ((fctx) != NULL && \
(fctx)->magic == FCTX_MAGIC)
#define FCTX_MAGIC ISC_MAGIC('F', '!', '!', '!')
#define VALID_FCTX(fctx) ISC_MAGIC_VALID(fctx, FCTX_MAGIC)
#define FCTX_ATTR_HAVEANSWER 0x01
#define FCTX_ATTR_GLUING 0x02
......@@ -228,9 +226,8 @@ struct dns_fetch {
fetchctx_t * private;
};
#define DNS_FETCH_MAGIC 0x46746368U /* Ftch */
#define DNS_FETCH_VALID(fetch) ((fetch) != NULL && \
(fetch)->magic == DNS_FETCH_MAGIC)
#define DNS_FETCH_MAGIC ISC_MAGIC('F', 't', 'c', 'h')
#define DNS_FETCH_VALID(fetch) ISC_MAGIC_VALID(fetch, DNS_FETCH_MAGIC)
typedef struct fctxbucket {
isc_task_t * task;
......@@ -266,9 +263,8 @@ struct dns_resolver {
dns_fetch_t * primefetch;
};
#define RES_MAGIC 0x52657321U /* Res! */
#define VALID_RESOLVER(res) ((res) != NULL && \
(res)->magic == RES_MAGIC)
#define RES_MAGIC ISC_MAGIC('R', 'e', 's', '!')
#define VALID_RESOLVER(res) ISC_MAGIC_VALID(res, RES_MAGIC)
/*
* Private addrinfo flags. These must not conflict with DNS_FETCHOPT_NOEDNS0,
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sdb.c,v 1.32 2001/05/29 18:34:24 bwelling Exp $ */
/* $Id: sdb.c,v 1.33 2001/06/04 19:33:10 tale Exp $ */
#include <config.h>
......@@ -98,9 +98,8 @@ typedef struct sdb_rdatasetiter {
dns_rdatalist_t *current;
} sdb_rdatasetiter_t;
#define SDB_MAGIC 0x5344422d /* SDB- */
#define VALID_SDB(sdb) ((sdb) != NULL && \
(sdb)->common.impmagic == SDB_MAGIC)
#define SDB_MAGIC ISC_MAGIC('S', 'D', 'B', '-')
#define VALID_SDB(sdb) ISC_MAGIC_VALID(sdb, SDB_MAGIC)
#define SDBLOOKUP_MAGIC ISC_MAGIC('S','D','B','L')
#define VALID_SDBLOOKUP(sdbl) ISC_MAGIC_VALID(sdbl, SDBLOOKUP_MAGIC)
......
......@@ -16,7 +16,7 @@
*/
/*
* $Id: ssu.c,v 1.20 2001/01/09 21:51:33 bwelling Exp $
* $Id: ssu.c,v 1.21 2001/06/04 19:33:11 tale Exp $
* Principal Author: Brian Wellington
*/
......@@ -30,10 +30,11 @@
#include <dns/name.h>
#include <dns/ssu.h>
#define SSUTABLEMAGIC 0x53535554 /* SSUT */
#define VALID_SSUTABLE(table) ISC_MAGIC_VALID((table), SSUTABLEMAGIC)
#define SSURULEMAGIC 0x53535552 /* SSUR */
#define VALID_SSURULE(table) ISC_MAGIC_VALID((table), SSURULEMAGIC)
#define SSUTABLEMAGIC ISC_MAGIC('S', 'S', 'U', 'T')
#define VALID_SSUTABLE(table) ISC_MAGIC_VALID(table, SSUTABLEMAGIC)
#define SSURULEMAGIC ISC_MAGIC('S', 'S', 'U', 'R')
#define VALID_SSURULE(table) ISC_MAGIC_VALID(table, SSURULEMAGIC)
struct dns_ssurule {
isc_uint32_t magic;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: tcpmsg.c,v 1.23 2001/01/09 21:51:35 bwelling Exp $ */
/* $Id: tcpmsg.c,v 1.24 2001/06/04 19:33:12 tale Exp $ */
#include <config.h>
......@@ -34,7 +34,7 @@
#define XDEBUG(x)
#endif
#define TCPMSG_MAGIC 0x5443506d /* TCPm */
#define TCPMSG_MAGIC ISC_MAGIC('T', 'C', 'P', 'm')
#define VALID_TCPMSG(foo) ISC_MAGIC_VALID(foo, TCPMSG_MAGIC)
static void recv_length(isc_task_t *, isc_event_t *);
......
......@@ -16,7 +16,7 @@
*/
/*
* $Id: tsig.c,v 1.108 2001/05/06 02:23:06 mayer Exp $
* $Id: tsig.c,v 1.109 2001/06/04 19:33:14 tale Exp $
*/
#include <config.h>
......@@ -42,7 +42,7 @@
#include <dst/result.h>
#define TSIG_MAGIC 0x54534947 /* TSIG */
#define TSIG_MAGIC ISC_MAGIC('T', 'S', 'I', 'G')
#define VALID_TSIG_KEY(x) ISC_MAGIC_VALID(x, TSIG_MAGIC)
#define is_response(msg) (msg->flags & DNS_MESSAGEFLAG_QR)
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: validator.c,v 1.89 2001/02/21 19:57:38 bwelling Exp $ */
/* $Id: validator.c,v 1.90 2001/06/04 19:33:15 tale Exp $ */
#include <config.h>
......@@ -40,7 +40,7 @@
#include <dns/validator.h>
#include <dns/view.h>
#define VALIDATOR_MAGIC 0x56616c3fU /* Val?. */
#define VALIDATOR_MAGIC ISC_MAGIC('V', 'a', 'l', '?')
#define VALID_VALIDATOR(v) ISC_MAGIC_VALID(v, VALIDATOR_MAGIC)
#define VALATTR_SHUTDOWN 0x01
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: xfrin.c,v 1.120 2001/06/01 15:22:56 marka Exp $ */
/* $Id: xfrin.c,v 1.121 2001/06/04 19:33:16 tale Exp $ */
#include <config.h>
......@@ -166,7 +166,7 @@ struct dns_xfrin_ctx {
} ixfr;
};
#define XFRIN_MAGIC 0x58667269U /* XfrI. */
#define XFRIN_MAGIC ISC_MAGIC('X', 'f', 'r', 'I')
#define VALID_XFRIN(x) ISC_MAGIC_VALID(x, XFRIN_MAGIC)
/**************************************************************************/
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.325 2001/05/14 20:44:12 bwelling Exp $ */
/* $Id: zone.c,v 1.326 2001/06/04 19:33:17 tale Exp $ */
#include <config.h>
......@@ -57,31 +57,32 @@
#include <dns/xfrin.h>
#include <dns/zone.h>
#define ZONE_MAGIC 0x5a4f4e45U /* ZONE */
#define NOTIFY_MAGIC 0x4e746679U /* Ntfy */
#define STUB_MAGIC 0x53747562U /* Stub */
#define ZONEMGR_MAGIC 0x5a6d6772U /* Zmgr */
#define LOAD_MAGIC ISC_MAGIC('L','o','a','d')
#define FORWARD_MAGIC ISC_MAGIC('F','o','r','w')
#define IO_MAGIC ISC_MAGIC('Z','m','I','O')
#define DNS_ZONE_VALID(zone) \
ISC_MAGIC_VALID(zone, ZONE_MAGIC)
#define DNS_NOTIFY_VALID(notify) \
ISC_MAGIC_VALID(notify, NOTIFY_MAGIC)
#define DNS_STUB_VALID(stub) \
ISC_MAGIC_VALID(stub, STUB_MAGIC)
#define DNS_ZONEMGR_VALID(stub) \
ISC_MAGIC_VALID(stub, ZONEMGR_MAGIC)
#define DNS_LOAD_VALID(load) \
ISC_MAGIC_VALID(load, LOAD_MAGIC)
#define DNS_FORWARD_VALID(load) \
ISC_MAGIC_VALID(load, FORWARD_MAGIC)
#define DNS_IO_VALID(load) \
ISC_MAGIC_VALID(load, IO_MAGIC)
#define RANGE(a, b, c) (((a) < (b)) ? (b) : ((a) < (c) ? (a) : (c)))
#define ZONE_MAGIC ISC_MAGIC('Z', 'O', 'N', 'E')
#define DNS_ZONE_VALID(zone) ISC_MAGIC_VALID(zone, ZONE_MAGIC)
#define NOTIFY_MAGIC ISC_MAGIC('N', 't', 'f', 'y')
#define DNS_NOTIFY_VALID(notify) ISC_MAGIC_VALID(notify, NOTIFY_MAGIC)
#define STUB_MAGIC ISC_MAGIC('S', 't', 'u', 'b')
#define DNS_STUB_VALID(stub) ISC_MAGIC_VALID(stub, STUB_MAGIC)
#define ZONEMGR_MAGIC ISC_MAGIC('Z', 'm', 'g', 'r')
#define DNS_ZONEMGR_VALID(stub) ISC_MAGIC_VALID(stub, ZONEMGR_MAGIC)
#define LOAD_MAGIC ISC_MAGIC('L', 'o', 'a', 'd')
#define DNS_LOAD_VALID(load) ISC_MAGIC_VALID(load, LOAD_MAGIC)
#define FORWARD_MAGIC ISC_MAGIC('F', 'o', 'r', 'w')
#define DNS_FORWARD_VALID(load) ISC_MAGIC_VALID(load, FORWARD_MAGIC)
#define IO_MAGIC ISC_MAGIC('Z', 'm', 'I', 'O')
#define DNS_IO_VALID(load) ISC_MAGIC_VALID(load, IO_MAGIC)
/*
* Ensure 'a' is at least 'min' but not more than 'max'.
*/
#define RANGE(a, min, max) \
(((a) < (min)) ? (min) : ((a) < (max) ? (a) : (max)))
/*
* Default values.
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zt.c,v 1.32 2001/05/14 19:06:43 bwelling Exp $ */
/* $Id: zt.c,v 1.33 2001/06/04 19:33:19 tale Exp $ */
#include <config.h>
......@@ -39,7 +39,7 @@ struct dns_zt {
dns_rbt_t *table;
};
#define ZTMAGIC 0x5a54626cU /* ZTbl */
#define ZTMAGIC ISC_MAGIC('Z', 'T', 'b', 'l')
#define VALID_ZT(zt) ISC_MAGIC_VALID(zt, ZTMAGIC)
static void
......
......@@ -15,12 +15,13 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: bitstring.c,v 1.11 2001/01/09 21:55:55 bwelling Exp $ */
/* $Id: bitstring.c,v 1.12 2001/06/04 19:33:20 tale Exp $ */
#include <config.h>
#include <stddef.h>
#include <isc/magic.h>
#include <isc/bitstring.h>
#include <isc/util.h>
......@@ -33,9 +34,8 @@
#define SETBIT(bs, n) (bs)->data[DIV8(n)] |= (1 << (7 - MOD8(n)))
#define CLEARBIT(bs, n) (bs)->data[DIV8(n)] &= ~(1 << (7 - MOD8(n)))
#define BITSTRING_MAGIC 0x42537472U /* BStr. */
#define VALID_BITSTRING(b) ((b) != NULL && \
(b)->magic == BITSTRING_MAGIC)
#define BITSTRING_MAGIC ISC_MAGIC('B', 'S', 't', 'r')
#define VALID_BITSTRING(b) ISC_MAGIC_VALID(b, BITSTRING_MAGIC)
void
isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data,
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: heap.c,v 1.27 2001/01/09 21:56:03 bwelling Exp $ */
/* $Id: heap.c,v 1.28 2001/06/04 19:33:21 tale Exp $ */
/*
* Heap implementation of priority queues adapted from the following:
......@@ -30,6 +30,7 @@
#include <config.h>
#include <isc/heap.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/string.h> /* Required for memcpy. */
#include <isc/util.h>
......@@ -44,9 +45,8 @@
#define SIZE_INCREMENT 1024
#define HEAP_MAGIC 0x48454150U /* HEAP. */
#define VALID_HEAP(h) ((h) != NULL && \
(h)->magic == HEAP_MAGIC)
#define HEAP_MAGIC ISC_MAGIC('H', 'E', 'A', 'P')
#define VALID_HEAP(h) ISC_MAGIC_VALID(h, HEAP_MAGIC)
/*
* When the heap is in a consistent state, the following invariant
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lex.c,v 1.62 2001/01/24 21:12:48 bwelling Exp $ */
/* $Id: lex.c,v 1.63 2001/06/04 19:33:22 tale Exp $ */
#include <config.h>
......@@ -46,9 +46,8 @@ typedef struct inputsource {
ISC_LINK(struct inputsource) link;
} inputsource;
#define LEX_MAGIC 0x4C657821U /* Lex!. */