Commit 28fc90e6 authored by Mark Andrews's avatar Mark Andrews

#857 was incomplete, ISC_MAGIC was not being used everwhere it should have been.

'magic' was not being declared consistantly.
some #include <isc/magic.h> were missing from other include files.
NS_SERVER_VALID was not using ISC_MAGIC_VALID.
parent 31f4d4ac
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: client.h,v 1.59 2001/08/08 22:54:23 gson Exp $ */
/* $Id: client.h,v 1.60 2001/08/28 03:57:59 marka Exp $ */
#ifndef NAMED_CLIENT_H
#define NAMED_CLIENT_H 1
......@@ -64,6 +64,7 @@
***/
#include <isc/buffer.h>
#include <isc/magic.h>
#include <isc/stdtime.h>
#include <isc/quota.h>
......@@ -159,7 +160,7 @@ struct ns_client {
#define CLIENT_NUMATTRS 2
#endif /* DNS_OPT_NEWCODES */
#define NS_CLIENT_MAGIC 0x4E534363U /* NSCc */
#define NS_CLIENT_MAGIC ISC_MAGIC('N','S','C','c')
#define NS_CLIENT_VALID(c) ISC_MAGIC_VALID(c, NS_CLIENT_MAGIC)
#define NS_CLIENTATTR_TCP 0x01
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: interfacemgr.h,v 1.22 2001/01/09 21:40:14 bwelling Exp $ */
/* $Id: interfacemgr.h,v 1.23 2001/08/28 03:58:00 marka Exp $ */
#ifndef NAMED_INTERFACEMGR_H
#define NAMED_INTERFACEMGR_H 1
......@@ -62,7 +62,7 @@
*** Types
***/
#define IFACE_MAGIC 0x493A2D29U /* I:-). */
#define IFACE_MAGIC ISC_MAGIC('I',':','-',')')
#define NS_INTERFACE_VALID(t) ISC_MAGIC_VALID(t, IFACE_MAGIC)
struct ns_interface {
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwresd.h,v 1.11 2001/03/04 21:21:34 bwelling Exp $ */
/* $Id: lwresd.h,v 1.12 2001/08/28 03:58:02 marka Exp $ */
#ifndef NAMED_LWRESD_H
#define NAMED_LWRESD_H 1
......@@ -28,7 +28,7 @@
#include <dns/types.h>
struct ns_lwresd {
isc_uint32_t magic;
unsigned int magic;
isc_mutex_t lock;
dns_view_t *view;
......@@ -40,7 +40,7 @@ struct ns_lwresd {
};
struct ns_lwreslistener {
isc_uint32_t magic;
unsigned int magic;
isc_mutex_t lock;
isc_mem_t *mctx;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwsearch.h,v 1.3 2001/01/09 21:40:22 bwelling Exp $ */
/* $Id: lwsearch.h,v 1.4 2001/08/28 03:58:03 marka Exp $ */
#ifndef NAMED_LWSEARCH_H
#define NAMED_LWSEARCH_H 1
......@@ -38,7 +38,7 @@
*/
struct ns_lwsearchlist {
isc_uint32_t magic;
unsigned int magic;
isc_mutex_t lock;
isc_mem_t *mctx;
......
......@@ -15,13 +15,14 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.h,v 1.57 2001/05/31 01:21:09 bwelling Exp $ */
/* $Id: server.h,v 1.58 2001/08/28 03:58:04 marka Exp $ */
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
#include <isc/log.h>
#include <isc/sockaddr.h>
#include <isc/magic.h>
#include <isc/types.h>
#include <isc/quota.h>
......@@ -36,7 +37,7 @@
* Name server state. Better here than in lots of separate global variables.
*/
struct ns_server {
isc_uint32_t magic;
unsigned int magic;
isc_mem_t * mctx;
isc_task_t * task;
......@@ -81,9 +82,8 @@ struct ns_server {
ns_controls_t * controls; /* Control channels */
};
#define NS_SERVER_MAGIC 0x53564552 /* SVER */
#define NS_SERVER_VALID(s) ((s) != NULL && \
(s)->magic == NS_SERVER_MAGIC)
#define NS_SERVER_MAGIC ISC_MAGIC('S','V','E','R')
#define NS_SERVER_VALID(s) ISC_MAGIC_VALID(s, NS_SERVER_MAGIC)
void
ns_server_create(isc_mem_t *mctx, ns_server_t **serverp);
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acl.h,v 1.19 2001/03/26 21:33:02 bwelling Exp $ */
/* $Id: acl.h,v 1.20 2001/08/28 03:58:11 marka Exp $ */
#ifndef DNS_ACL_H
#define DNS_ACL_H 1
......@@ -71,7 +71,7 @@ struct dns_aclelement {
};
struct dns_acl {
isc_uint32_t magic;
unsigned int magic;
isc_mem_t *mctx;
isc_refcount_t refcount;
dns_aclelement_t *elements;
......@@ -87,7 +87,7 @@ struct dns_aclenv {
isc_boolean_t match_mapped;
};
#define DNS_ACL_MAGIC 0x4461636c /* Dacl */
#define DNS_ACL_MAGIC ISC_MAGIC('D','a','c','l')
#define DNS_ACL_VALID(a) ISC_MAGIC_VALID(a, DNS_ACL_MAGIC)
/***
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: adb.h,v 1.65 2001/04/11 20:37:48 bwelling Exp $ */
/* $Id: adb.h,v 1.66 2001/08/28 03:58:12 marka Exp $ */
#ifndef DNS_ADB_H
#define DNS_ADB_H 1
......@@ -88,9 +88,9 @@ ISC_LANG_BEGINDECLS
*** Magic number checks
***/
#define DNS_ADBFIND_MAGIC 0x61646248 /* adbH. */
#define DNS_ADBFIND_MAGIC ISC_MAGIC('a','d','b','H')
#define DNS_ADBFIND_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBFIND_MAGIC)
#define DNS_ADBADDRINFO_MAGIC 0x61644149 /* adAI. */
#define DNS_ADBADDRINFO_MAGIC ISC_MAGIC('a','d','A','I')
#define DNS_ADBADDRINFO_VALID(x) ISC_MAGIC_VALID(x, DNS_ADBADDRINFO_MAGIC)
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: db.h,v 1.66 2001/05/15 05:35:27 halley Exp $ */
/* $Id: db.h,v 1.67 2001/08/28 03:58:13 marka Exp $ */
#ifndef DNS_DB_H
#define DNS_DB_H 1
......@@ -152,7 +152,7 @@ typedef isc_result_t
unsigned int argc, char *argv[], void *driverarg,
dns_db_t **dbp);
#define DNS_DB_MAGIC 0x444E5344U /* DNSD. */
#define DNS_DB_MAGIC ISC_MAGIC('D','N','S','D')
#define DNS_DB_VALID(db) ISC_MAGIC_VALID(db, DNS_DB_MAGIC)
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dbiterator.h,v 1.17 2001/03/08 01:16:06 tale Exp $ */
/* $Id: dbiterator.h,v 1.18 2001/08/28 03:58:15 marka Exp $ */
#ifndef DNS_DBITERATOR_H
#define DNS_DBITERATOR_H 1
......@@ -87,7 +87,7 @@ typedef struct dns_dbiteratormethods {
dns_name_t *name);
} dns_dbiteratormethods_t;
#define DNS_DBITERATOR_MAGIC 0x444E5349U /* DNSI. */
#define DNS_DBITERATOR_MAGIC ISC_MAGIC('D','N','S','I')
#define DNS_DBITERATOR_VALID(dbi) ISC_MAGIC_VALID(dbi, DNS_DBITERATOR_MAGIC)
/*
* This structure is actually just the common prefix of a DNS db
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: diff.h,v 1.3 2001/01/09 21:52:46 bwelling Exp $ */
/* $Id: diff.h,v 1.4 2001/08/28 03:58:16 marka Exp $ */
#ifndef DNS_DIFF_H
#define DNS_DIFF_H 1
......@@ -68,7 +68,7 @@ typedef enum {
typedef struct dns_difftuple dns_difftuple_t;
#define DNS_DIFFTUPLE_MAGIC 0x44494654U /* DIFT. */
#define DNS_DIFFTUPLE_MAGIC ISC_MAGIC('D','I','F','T')
#define DNS_DIFFTUPLE_VALID(t) ISC_MAGIC_VALID(t, DNS_DIFFTUPLE_MAGIC)
struct dns_difftuple {
......@@ -89,7 +89,7 @@ struct dns_difftuple {
*/
typedef struct dns_diff dns_diff_t;
#define DNS_DIFF_MAGIC 0x44494646U /* DIFF. */
#define DNS_DIFF_MAGIC ISC_MAGIC('D','I','F','F')
#define DNS_DIFF_VALID(t) ISC_MAGIC_VALID(t, DNS_DIFF_MAGIC)
struct dns_diff {
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.h,v 1.99 2001/06/14 18:38:48 gson Exp $ */
/* $Id: message.h,v 1.100 2001/08/28 03:58:17 marka Exp $ */
#ifndef DNS_MESSAGE_H
#define DNS_MESSAGE_H 1
......@@ -103,7 +103,7 @@
#define DNS_MESSAGE_HEADERLEN 12 /* 6 isc_uint16_t's */
#define DNS_MESSAGE_MAGIC 0x4d534740U /* MSG@ */
#define DNS_MESSAGE_MAGIC ISC_MAGIC('M','S','G','@')
#define DNS_MESSAGE_VALID(msg) ISC_MAGIC_VALID(msg, DNS_MESSAGE_MAGIC)
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: name.h,v 1.94 2001/07/16 05:10:26 mayer Exp $ */
/* $Id: name.h,v 1.95 2001/08/28 03:58:19 marka Exp $ */
#ifndef DNS_NAME_H
#define DNS_NAME_H 1
......@@ -76,6 +76,7 @@
#include <isc/boolean.h>
#include <isc/lang.h>
#include <isc/magic.h>
#include <isc/region.h> /* Required for storage size of dns_label_t. */
#include <dns/types.h>
......@@ -195,7 +196,7 @@ struct dns_name {
ISC_LIST(dns_rdataset_t) list;
};
#define DNS_NAME_MAGIC 0x444E536EU /* DNSn. */
#define DNS_NAME_MAGIC ISC_MAGIC('D','N','S','n')
#define DNS_NAMEATTR_ABSOLUTE 0x0001
#define DNS_NAMEATTR_READONLY 0x0002
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: peer.h,v 1.15 2001/04/30 18:09:29 gson Exp $ */
/* $Id: peer.h,v 1.16 2001/08/28 03:58:20 marka Exp $ */
#ifndef DNS_PEER_H
#define DNS_PEER_H 1
......@@ -38,8 +38,8 @@
#include <dns/types.h>
#define DNS_PEERLIST_MAGIC 0x7365524c /* seRL */
#define DNS_PEER_MAGIC 0x53457276 /* SErv */
#define DNS_PEERLIST_MAGIC ISC_MAGIC('s','e','R','L')
#define DNS_PEER_MAGIC ISC_MAGIC('S','E','r','v')
#define DNS_PEERLIST_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_PEERLIST_MAGIC)
#define DNS_PEER_VALID(ptr) ISC_MAGIC_VALID(ptr, DNS_PEER_MAGIC)
......@@ -49,7 +49,7 @@
***/
struct dns_peerlist {
isc_uint32_t magic;
unsigned int magic;
isc_uint32_t refs;
isc_mem_t *mem;
......@@ -58,7 +58,7 @@ struct dns_peerlist {
};
struct dns_peer {
isc_uint32_t magic;
unsigned int magic;
isc_uint32_t refs;
isc_mem_t *mem;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdataset.h,v 1.40 2001/06/05 09:02:16 marka Exp $ */
/* $Id: rdataset.h,v 1.41 2001/08/28 03:58:21 marka Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
......@@ -70,7 +70,7 @@ typedef struct dns_rdatasetmethods {
unsigned int (*count)(dns_rdataset_t *rdataset);
} dns_rdatasetmethods_t;
#define DNS_RDATASET_MAGIC 0x444E5352U /* DNSR. */
#define DNS_RDATASET_MAGIC ISC_MAGIC('D','N','S','R')
#define DNS_RDATASET_VALID(set) ISC_MAGIC_VALID(set, DNS_RDATASET_MAGIC)
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdatasetiter.h,v 1.13 2001/01/09 21:53:18 bwelling Exp $ */
/* $Id: rdatasetiter.h,v 1.14 2001/08/28 03:58:22 marka Exp $ */
#ifndef DNS_RDATASETITER_H
#define DNS_RDATASETITER_H 1
......@@ -82,7 +82,7 @@ typedef struct dns_rdatasetitermethods {
dns_rdataset_t *rdataset);
} dns_rdatasetitermethods_t;
#define DNS_RDATASETITER_MAGIC 0x444E5369U /* DNSi. */
#define DNS_RDATASETITER_MAGIC ISC_MAGIC('D','N','S','i')
#define DNS_RDATASETITER_VALID(i) ISC_MAGIC_VALID(i, DNS_RDATASETITER_MAGIC)
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: view.h,v 1.72 2001/07/26 20:42:45 bwelling Exp $ */
/* $Id: view.h,v 1.73 2001/08/28 03:58:23 marka Exp $ */
#ifndef DNS_VIEW_H
#define DNS_VIEW_H 1
......@@ -136,7 +136,7 @@ struct dns_view {
ISC_LINK(struct dns_view) link;
};
#define DNS_VIEW_MAGIC 0x56696577 /* View. */
#define DNS_VIEW_MAGIC ISC_MAGIC('V','i','e','w')
#define DNS_VIEW_VALID(view) ISC_MAGIC_VALID(view, DNS_VIEW_MAGIC)
#define DNS_VIEWATTR_RESSHUTDOWN 0x01
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.c,v 1.121 2001/08/01 17:58:45 gson Exp $ */
/* $Id: master.c,v 1.122 2001/08/28 03:58:05 marka Exp $ */
#include <config.h>
......@@ -91,7 +91,7 @@ typedef struct dns_incctx dns_incctx_t;
*/
struct dns_loadctx {
isc_uint32_t magic;
unsigned int magic;
isc_mem_t *mctx;
isc_lex_t *lex;
dns_rdatacallbacks_t *callbacks;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: request.c,v 1.63 2001/08/08 22:54:42 gson Exp $ */
/* $Id: request.c,v 1.64 2001/08/28 03:58:07 marka Exp $ */
#include <config.h>
......@@ -48,7 +48,7 @@ typedef ISC_LIST(dns_request_t) dns_requestlist_t;
#define DNS_REQUEST_NLOCKS 7
struct dns_requestmgr {
isc_int32_t magic;
unsigned int magic;
isc_mutex_t lock;
isc_mem_t *mctx;
......@@ -69,7 +69,7 @@ struct dns_requestmgr {
};
struct dns_request {
isc_int32_t magic;
unsigned int magic;
unsigned int hash;
isc_mem_t *mctx;
isc_int32_t flags;
......
......@@ -17,7 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dst_internal.h,v 1.37 2001/07/10 21:38:01 bwelling Exp $ */
/* $Id: dst_internal.h,v 1.38 2001/08/28 03:58:25 marka Exp $ */
#ifndef DST_DST_INTERNAL_H
#define DST_DST_INTERNAL_H 1
......@@ -25,14 +25,15 @@
#include <isc/lang.h>
#include <isc/buffer.h>
#include <isc/int.h>
#include <isc/magic.h>
#include <isc/region.h>
#include <dst/dst.h>
ISC_LANG_BEGINDECLS
#define KEY_MAGIC 0x4453544BU /* DSTK */
#define CTX_MAGIC 0x44535443U /* DSTC */
#define KEY_MAGIC ISC_MAGIC('D','S','T','K')
#define CTX_MAGIC ISC_MAGIC('D','S','T','C')
#define VALID_KEY(x) ISC_MAGIC_VALID(x, KEY_MAGIC)
#define VALID_CTX(x) ISC_MAGIC_VALID(x, CTX_MAGIC)
......
......@@ -16,7 +16,7 @@
*/
/*
* $Id: ssu.c,v 1.21 2001/06/04 19:33:11 tale Exp $
* $Id: ssu.c,v 1.22 2001/08/28 03:58:08 marka Exp $
* Principal Author: Brian Wellington
*/
......@@ -37,7 +37,7 @@
#define VALID_SSURULE(table) ISC_MAGIC_VALID(table, SSURULEMAGIC)
struct dns_ssurule {
isc_uint32_t magic;
unsigned int magic;
isc_boolean_t grant; /* is this a grant or a deny? */
unsigned int matchtype; /* which type of pattern match? */
dns_name_t *identity; /* the identity to match */
......@@ -49,7 +49,7 @@ struct dns_ssurule {
};
struct dns_ssutable {
isc_uint32_t magic;
unsigned int magic;
isc_mem_t *mctx;
unsigned int references;
isc_mutex_t lock;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.332 2001/08/08 22:54:48 gson Exp $ */
/* $Id: zone.c,v 1.333 2001/08/28 03:58:10 marka Exp $ */
#include <config.h>
......@@ -294,7 +294,7 @@ struct dns_zonemgr {
* Hold notify state.
*/
struct dns_notify {
isc_int32_t magic;
unsigned int magic;
unsigned int flags;
isc_mem_t *mctx;
dns_zone_t *zone;
......@@ -315,7 +315,7 @@ struct dns_notify {
*/
struct dns_stub {
isc_int32_t magic;
unsigned int magic;
isc_mem_t *mctx;
dns_zone_t *zone;
dns_db_t *db;
......@@ -326,7 +326,7 @@ struct dns_stub {
* Hold load state.
*/
struct dns_load {
isc_int32_t magic;
unsigned int magic;
isc_mem_t *mctx;
dns_zone_t *zone;
dns_db_t *db;
......@@ -338,7 +338,7 @@ struct dns_load {
* Hold forward state.
*/
struct dns_forward {
isc_int32_t magic;
unsigned int magic;
isc_mem_t *mctx;
dns_zone_t *zone;
isc_buffer_t *msgbuf;
......@@ -353,7 +353,7 @@ struct dns_forward {
* Hold IO request state.
*/
struct dns_io {
isc_int32_t magic;
unsigned int magic;
dns_zonemgr_t *zmgr;
isc_boolean_t high;
isc_task_t *task;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: entropy.c,v 1.2 2001/06/22 17:05:52 tale Exp $ */
/* $Id: entropy.c,v 1.3 2001/08/28 03:58:26 marka Exp $ */
/*
* This is the system independent part of the entropy module. It is
......@@ -87,7 +87,6 @@
#define RND_INITIALIZE 128
typedef struct {
isc_uint32_t magic;
isc_uint32_t cursor; /* current add point in the pool */
isc_uint32_t entropy; /* current entropy estimate in bits */
isc_uint32_t pseudo; /* bits extracted in pseudorandom */
......@@ -96,7 +95,7 @@ typedef struct {
} isc_entropypool_t;
struct isc_entropy {
isc_uint32_t magic;
unsigned int magic;
isc_mem_t *mctx;
isc_mutex_t lock;
unsigned int refcnt;
......@@ -135,7 +134,7 @@ typedef struct {
} isc_entropyfilesource_t;
struct isc_entropysource {
isc_uint32_t magic;
unsigned int magic;
unsigned int type;
isc_entropy_t *ent;
isc_uint32_t total; /* entropy from this source */
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dir.h,v 1.14 2001/06/08 23:50:32 tale Exp $ */
/* $Id: dir.h,v 1.15 2001/08/28 03:58:27 marka Exp $ */
/* Principal Authors: DCL */
......@@ -43,7 +43,7 @@ typedef struct isc_direntry {
} isc_direntry_t;
typedef struct isc_dir {
int magic;
unsigned int magic;
/*
* As with isc_direntry_t->name, making this "right" for all systems
* is slightly problematic because AIX does not define PATH_MAX.
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dir.h,v 1.10 2001/07/08 05:09:24 mayer Exp $ */
/* $Id: dir.h,v 1.11 2001/08/28 03:58:29 marka Exp $ */
/* Principal Authors: DCL */
......@@ -39,7 +39,7 @@ typedef struct {
} isc_direntry_t;
typedef struct {
int magic;
unsigned int magic;
char dirname[ISC_DIR_PATHMAX];
isc_direntry_t entry;
isc_boolean_t entry_filled;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment