diff options
author | Ted Lemon <source@isc.org> | 2000-02-02 08:01:52 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-02-02 08:01:52 +0000 |
commit | 88c32c8c258a64bc68447297ef089e275d365eba (patch) | |
tree | c2786c859c51ec9603322e8efc4bd0d482d4ce74 | |
parent | 16d82ab30583c2e1b9a8fdd7b4de5f55c77822b2 (diff) | |
download | isc-dhcp-88c32c8c258a64bc68447297ef089e275d365eba.tar.gz |
Hack private resolver namespace to avoid link clashes.
-rw-r--r-- | common/execute.c | 4 | ||||
-rw-r--r-- | common/tree.c | 22 | ||||
-rw-r--r-- | includes/minires/minires.h | 83 | ||||
-rw-r--r-- | includes/site.h | 13 | ||||
-rw-r--r-- | minires/Makefile.dist | 2 |
5 files changed, 98 insertions, 26 deletions
diff --git a/common/execute.c b/common/execute.c index d64f889d..8f3a4e22 100644 --- a/common/execute.c +++ b/common/execute.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: execute.c,v 1.26 2000/01/27 22:40:49 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: execute.c,v 1.27 2000/02/02 08:01:45 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -167,7 +167,7 @@ int execute_statements (packet, lease, in_options, out_options, scope, dfree (nut -> r_dname, MDL); nut -> r_dname = (char *)0; } - res_freeupdrec (nut); + minires_freeupdrec (nut); } #endif } else { diff --git a/common/tree.c b/common/tree.c index 89589694..f0dd0283 100644 --- a/common/tree.c +++ b/common/tree.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: tree.c,v 1.72 2000/02/02 07:22:33 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; +"$Id: tree.c,v 1.73 2000/02/02 08:01:45 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -471,11 +471,13 @@ int evaluate_dns_expression (result, packet, lease, in_options, } else r2 = 0; if (r0 && r1 && (r2 || expr -> op != expr_ns_add)) { - *result = res_mkupdrec (((expr -> op == expr_ns_add || - expr -> op == expr_ns_delete) - ? S_UPDATE : S_PREREQ), - tname, expr -> data.ns_add.rrclass, - expr -> data.ns_add.rrtype, ttl); + *result = minires_mkupdrec (((expr -> op == expr_ns_add || + expr -> op == expr_ns_delete) + ? S_UPDATE : S_PREREQ), + tname, + expr -> data.ns_add.rrclass, + expr -> data.ns_add.rrtype, + ttl); if (!*result) { ngood: if (r2) { @@ -508,7 +510,7 @@ int evaluate_dns_expression (result, packet, lease, in_options, MDL); if (!(*result) -> r_data) { dpngood: /* double plus ungood. */ - res_freeupdrec (*result); + minires_freeupdrec (*result); *result = 0; goto ngood; } @@ -1768,7 +1770,7 @@ int evaluate_numeric_expression (result, packet, lease, return 0; #else if (!inited) { - res_ninit (&res); + minires_ninit (&res); inited = 1; } ISC_LIST_INIT (uq); @@ -1787,7 +1789,7 @@ int evaluate_numeric_expression (result, packet, lease, /* Do the update and record the error code, if there was an error; otherwise set it to NOERROR. */ - if (res_nupdate (&res, ISC_LIST_HEAD (uq), NULL)) + if (minires_nupdate (&res, ISC_LIST_HEAD (uq), NULL)) *result = NOERROR; else /* The resolver doesn't return any actual error @@ -1806,7 +1808,7 @@ int evaluate_numeric_expression (result, packet, lease, dfree (tmp -> r_data, MDL); tmp -> r_data = (char *)0; } - res_freeupdrec (tmp); + minires_freeupdrec (tmp); } return status; #endif /* NSUPDATE */ diff --git a/includes/minires/minires.h b/includes/minires/minires.h index e43daaf5..e888720e 100644 --- a/includes/minires/minires.h +++ b/includes/minires/minires.h @@ -26,6 +26,80 @@ * <viraj_bais@ccm.fm.intel.com> */ +int minires_mkupdate (ns_updrec *, unsigned char *, unsigned); +int minires_update (ns_updrec *); +ns_updrec *minires_mkupdrec (int, const char *, unsigned int, + unsigned int, unsigned long); +void minires_freeupdrec (ns_updrec *); +int minires_nmkupdate (res_state, ns_updrec *, unsigned char *, unsigned); +int minires_nupdate (res_state, ns_updrec *, ns_tsig_key *); +int minires_ninit (res_state); + +#if defined (MINIRES_LIB) +#define res_update minires_update +#define res_mkupdate minires_mkupdate +#define res_mkupdrec minires_mkupdrec +#define res_freeupdrec minires_freeupdrec +#define res_nmkupdate minires_nmkupdate +#define res_nupdate minires_nupdate +#define __p_type_syms MR__p_type_syms +#define dn_comp MRdn_comp +#define loc_aton MRloc_aton +#define sym_ston MRsym_ston +#define res_buildservicelist MRres_buildservicelist +#define res_destroyservicelist MRres_destroyservicelist +#define res_buildprotolist MRres_buildprotolist +#define res_destroyprotolist MRres_destroyprotolist +#define res_servicenumber MRres_servicenumber +#define res_protocolnumber MRres_protocolnumber +#define res_protocolname MRres_protocolname +#define res_servicename MRres_servicename +#define ns_datetosecs MRns_datetosecs +#define b64_pton MRb64_pton +#define res_ninit minires_ninit +#define res_randomid MRres_randomid +#define res_findzonecut MRres_findzonecut +#define res_nsend MRres_nsend +#define res_nsendsigned MRres_nsendsigned +#define ns_samename MRns_samename +#define res_nameinquery MRres_nameinquery +#define res_queriesmatch MRres_queriesmatch +#define dn_expand MRdn_expand +#define ns_get16 MRns_get16 +#define res_close MRres_close +#define res_nclose MRres_nclose +#define res_ourserver_p MRres_ourserver_p +#define ns_sign MRns_sign +#define p_class MRp_class +#define p_section MRp_section +#define ns_makecanon MRns_makecanon +#define ns_parserr MRns_parserr +#define ns_samedomain MRns_samedomain +#define ns_name_uncompress MRns_name_uncompress +#define res_nmkquery MRres_nmkquery +#define ns_initparse MRns_initparse +#define res_nquery MRres_nquery +#define res_nsearch MRres_nsearch +#define res_hostalias MRres_hostalias +#define res_nquerydomain MRres_nquerydomain +#define ns_skiprr MRns_skiprr +#define dn_skipname MRdn_skipname +#define ns_name_ntol MRns_name_ntol +#define ns_sign_tcp_init MRns_sign_tcp_init +#define ns_sign_tcp MRns_sign_tcp +#define ns_name_ntop MRns_name_ntop +#define ns_name_pton MRns_name_pton +#define ns_name_unpack MRns_name_unpack +#define ns_name_pack MRns_name_pack +#define ns_name_compress MRns_name_compress +#define ns_name_skip MRns_name_skip +#define ns_subdomain MRns_subdomain +#define ns_find_tsig MRns_find_tsig +#define ns_verify MRns_verify +#define ns_verify_tcp_init MRns_verify_tcp_init +#define ns_verify_tcp MRns_verify_tcp +#define b64_ntop MRb64_ntop + extern const struct res_sym __p_type_syms[]; extern time_t cur_time; @@ -43,7 +117,6 @@ const char *res_protocolname(int); const char *res_servicename(u_int16_t, const char *); u_int32_t ns_datetosecs (const char *cp, int *errp); int b64_pton (char const *, unsigned char *, size_t); -int res_ninit (res_state); unsigned int res_randomid (void); int res_findzonecut (res_state, const char *, ns_class, int, char *, size_t, struct in_addr *, int); @@ -84,13 +157,6 @@ const char *res_hostalias (const res_state, const char *, char *, size_t); int res_nquerydomain(res_state, const char *, const char *, ns_class class, ns_class type, unsigned char *, unsigned); -int res_mkupdate (ns_updrec *, unsigned char *, unsigned); -int res_update (ns_updrec *); -ns_updrec *res_mkupdrec (int, const char *, unsigned int, - unsigned int, unsigned long); -void res_freeupdrec (ns_updrec *); -int res_nmkupdate (res_state, ns_updrec *, unsigned char *, unsigned); -int res_nupdate (res_state, ns_updrec *, ns_tsig_key *); int ns_skiprr(const unsigned char *, const unsigned char *, ns_sect, int); int dn_skipname (const unsigned char *, const unsigned char *); u_int32_t getULong (const unsigned char *); @@ -135,3 +201,4 @@ int b64_ntop (unsigned char const *, size_t, char *, size_t); #define DPRINTF(x) #define USE_MD5 +#endif diff --git a/includes/site.h b/includes/site.h index dc38922e..fe396353 100644 --- a/includes/site.h +++ b/includes/site.h @@ -45,28 +45,31 @@ /* Define this if you want to track memory usage for the purpose of noticing memory leaks quickly. */ -/* #define DEBUG_MEMORY_LEAKAGE */ +#define DEBUG_MEMORY_LEAKAGE /* Define this if you want exhaustive (and very slow) checking of the malloc pool for corruption. */ -/* #define DEBUG_MALLOC_POOL */ +#define DEBUG_MALLOC_POOL /* Define this if you want to maintain a history of the last N operations that changed reference counts on objects. This can be used to debug cases where an object is dereferenced too often, or not often enough. */ -/* #define DEBUG_RC_HISTORY */ +#define DEBUG_RC_HISTORY +/* Define this if you want to see the history every cycle. */ + +/* #define DEBUG_RC_HISTORY_EXHAUSTIVELY */ /* This is the number of history entries to maintain - by default, 256. */ -/* #define RC_HISTORY_MAX 1024 */ +#define RC_HISTORY_MAX 1024 /* Define this if you want dhcpd to dump core when a non-fatal memory allocation error is detected (i.e., something that would cause a memory leak rather than a memory smash). */ -/* #define POINTER_DEBUG */ +#define POINTER_DEBUG /* Define this if you want debugging output for DHCP failover protocol messages. */ diff --git a/minires/Makefile.dist b/minires/Makefile.dist index 62177f34..cb9a9e4e 100644 --- a/minires/Makefile.dist +++ b/minires/Makefile.dist @@ -30,7 +30,7 @@ OBJ = res_mkupdate.o res_init.o res_update.o res_send.o res_comp.o \ DEBUG = -g INCLUDES = $(BINDINC) -I../includes -CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) -DHMAC_MD5 +CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) -DHMAC_MD5 -DMINIRES_LIB all: libres.a |