summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2001-10-18 20:31:40 +0000
committerTed Lemon <source@isc.org>2001-10-18 20:31:40 +0000
commitc838f9dd8bb5a03c453a77770cee6762555a423f (patch)
tree89bfdf1ee9563ac91bc5dcef668773c4e9fb1321
parentdd051385e9014ed398de20d15c9ac0b46a4e9566 (diff)
downloadisc-dhcp-c838f9dd8bb5a03c453a77770cee6762555a423f.tar.gz
Add rc_flags argument to omapi_object_type_register.
-rw-r--r--omapip/alloc.c36
-rw-r--r--omapip/support.c25
-rw-r--r--server/omapi.c23
3 files changed, 49 insertions, 35 deletions
diff --git a/omapip/alloc.c b/omapip/alloc.c
index 42161ca2..5a32bf03 100644
--- a/omapip/alloc.c
+++ b/omapip/alloc.c
@@ -128,7 +128,7 @@ VOIDPTR dmalloc (size, file, line)
#endif
#endif
#ifdef DEBUG_REFCNT_DMALLOC_FREE
- rc_register (file, line, 0, foo + DMDOFFSET, 1, 0);
+ rc_register (file, line, 0, foo + DMDOFFSET, 1, 0, RC_MALLOC);
#endif
return bar;
}
@@ -192,7 +192,8 @@ void dfree (ptr, file, line)
}
#endif
#ifdef DEBUG_REFCNT_DMALLOC_FREE
- rc_register (file, line, 0, (unsigned char *)ptr + DMDOFFSET, 0, 1);
+ rc_register (file, line,
+ 0, (unsigned char *)ptr + DMDOFFSET, 0, 1, RC_MALLOC);
#endif
free (ptr);
}
@@ -578,7 +579,7 @@ isc_result_t omapi_object_reference (omapi_object_t **r,
}
*r = h;
h -> refcnt++;
- rc_register (file, line, r, h, h -> refcnt, 0);
+ rc_register (file, line, r, h, h -> refcnt, 0, h -> type -> rc_flag);
return ISC_R_SUCCESS;
}
@@ -684,7 +685,8 @@ isc_result_t omapi_object_dereference (omapi_object_t **h,
omapi_object_dereference
(&hp -> outer, file, line);
/* if (!hp -> type -> freer) */
- rc_register (file, line, h, hp, 0, 1);
+ rc_register (file, line, h, hp,
+ 0, 1, (*h) -> type -> rc_flag);
if (hp -> type -> destroy)
(*(hp -> type -> destroy)) (hp, file, line);
if (hp -> type -> freer)
@@ -695,12 +697,14 @@ isc_result_t omapi_object_dereference (omapi_object_t **h,
(*h) -> refcnt--;
/* if (!(*h) -> type -> freer) */
rc_register (file, line,
- h, *h, (*h) -> refcnt, 1);
+ h, *h, (*h) -> refcnt, 1,
+ (*h) -> type -> rc_flag);
}
} else {
(*h) -> refcnt--;
/* if (!(*h) -> type -> freer) */
- rc_register (file, line, h, *h, (*h) -> refcnt, 1);
+ rc_register (file, line, h, *h, (*h) -> refcnt, 1,
+ (*h) -> type -> rc_flag);
}
*h = 0;
return ISC_R_SUCCESS;
@@ -741,7 +745,7 @@ isc_result_t omapi_buffer_reference (omapi_buffer_t **r,
}
*r = h;
h -> refcnt++;
- rc_register (file, line, r, h, h -> refcnt, 0);
+ rc_register (file, line, r, h, h -> refcnt, 0, RC_MISC);
return ISC_R_SUCCESS;
}
@@ -775,7 +779,7 @@ isc_result_t omapi_buffer_dereference (omapi_buffer_t **h,
}
--(*h) -> refcnt;
- rc_register (file, line, h, *h, (*h) -> refcnt, 1);
+ rc_register (file, line, h, *h, (*h) -> refcnt, 1, RC_MISC);
if ((*h) -> refcnt == 0)
dfree (*h, file, line);
*h = 0;
@@ -866,7 +870,7 @@ isc_result_t omapi_typed_data_reference (omapi_typed_data_t **r,
}
*r = h;
h -> refcnt++;
- rc_register (file, line, r, h, h -> refcnt, 0);
+ rc_register (file, line, r, h, h -> refcnt, 0, RC_MISC);
return ISC_R_SUCCESS;
}
@@ -900,7 +904,7 @@ isc_result_t omapi_typed_data_dereference (omapi_typed_data_t **h,
}
--((*h) -> refcnt);
- rc_register (file, line, h, *h, (*h) -> refcnt, 1);
+ rc_register (file, line, h, *h, (*h) -> refcnt, 1, RC_MISC);
if ((*h) -> refcnt <= 0 ) {
switch ((*h) -> type) {
case omapi_datatype_int:
@@ -949,7 +953,7 @@ isc_result_t omapi_data_string_reference (omapi_data_string_t **r,
}
*r = h;
h -> refcnt++;
- rc_register (file, line, r, h, h -> refcnt, 0);
+ rc_register (file, line, r, h, h -> refcnt, 0, RC_MISC);
return ISC_R_SUCCESS;
}
@@ -983,7 +987,7 @@ isc_result_t omapi_data_string_dereference (omapi_data_string_t **h,
}
--((*h) -> refcnt);
- rc_register (file, line, h, *h, (*h) -> refcnt, 1);
+ rc_register (file, line, h, *h, (*h) -> refcnt, 1, RC_MISC);
if ((*h) -> refcnt <= 0 ) {
dfree (*h, file, line);
}
@@ -1021,7 +1025,7 @@ isc_result_t omapi_value_reference (omapi_value_t **r,
}
*r = h;
h -> refcnt++;
- rc_register (file, line, r, h, h -> refcnt, 0);
+ rc_register (file, line, r, h, h -> refcnt, 0, RC_MISC);
return ISC_R_SUCCESS;
}
@@ -1055,7 +1059,7 @@ isc_result_t omapi_value_dereference (omapi_value_t **h,
}
--((*h) -> refcnt);
- rc_register (file, line, h, *h, (*h) -> refcnt, 1);
+ rc_register (file, line, h, *h, (*h) -> refcnt, 1, RC_MISC);
if ((*h) -> refcnt == 0) {
if ((*h) -> name)
omapi_data_string_dereference (&(*h) -> name,
@@ -1103,7 +1107,7 @@ isc_result_t omapi_addr_list_reference (omapi_addr_list_t **r,
}
*r = h;
h -> refcnt++;
- rc_register (file, line, r, h, h -> refcnt, 0);
+ rc_register (file, line, r, h, h -> refcnt, 0, RC_MISC);
return ISC_R_SUCCESS;
}
@@ -1137,7 +1141,7 @@ isc_result_t omapi_addr_list_dereference (omapi_addr_list_t **h,
}
--((*h) -> refcnt);
- rc_register (file, line, h, *h, (*h) -> refcnt, 1);
+ rc_register (file, line, h, *h, (*h) -> refcnt, 1, RC_MISC);
if ((*h) -> refcnt <= 0 ) {
dfree (*h, file, line);
}
diff --git a/omapip/support.c b/omapip/support.c
index 78fd0461..1fb98032 100644
--- a/omapip/support.c
+++ b/omapip/support.c
@@ -88,7 +88,8 @@ isc_result_t omapi_init (void)
omapi_connection_stuff_values,
0, 0, 0, 0, 0, 0,
sizeof
- (omapi_connection_object_t), 0);
+ (omapi_connection_object_t), 0,
+ RC_MISC);
if (status != ISC_R_SUCCESS)
return status;
@@ -101,7 +102,7 @@ isc_result_t omapi_init (void)
omapi_listener_stuff_values,
0, 0, 0, 0, 0, 0,
sizeof (omapi_listener_object_t),
- 0);
+ 0, RC_MISC);
if (status != ISC_R_SUCCESS)
return status;
@@ -113,7 +114,8 @@ isc_result_t omapi_init (void)
omapi_io_signal_handler,
omapi_io_stuff_values,
0, 0, 0, 0, 0, 0,
- sizeof (omapi_io_object_t), 0);
+ sizeof (omapi_io_object_t),
+ 0, RC_MISC);
if (status != ISC_R_SUCCESS)
return status;
@@ -126,7 +128,7 @@ isc_result_t omapi_init (void)
omapi_generic_stuff_values,
0, 0, 0, 0, 0, 0,
sizeof (omapi_generic_object_t),
- 0);
+ 0, RC_MISC);
if (status != ISC_R_SUCCESS)
return status;
@@ -139,7 +141,7 @@ isc_result_t omapi_init (void)
omapi_protocol_stuff_values,
0, 0, 0, 0, 0, 0,
sizeof (omapi_protocol_object_t),
- 0);
+ 0, RC_MISC);
if (status != ISC_R_SUCCESS)
return status;
@@ -151,7 +153,7 @@ isc_result_t omapi_init (void)
omapi_protocol_listener_signal,
omapi_protocol_listener_stuff,
0, 0, 0, 0, 0, 0,
- sizeof (omapi_protocol_listener_object_t), 0));
+ sizeof (omapi_protocol_listener_object_t), 0, RC_MISC));
if (status != ISC_R_SUCCESS)
return status;
@@ -164,7 +166,7 @@ isc_result_t omapi_init (void)
omapi_message_stuff_values,
0, 0, 0, 0, 0, 0,
sizeof (omapi_message_object_t),
- 0);
+ 0, RC_MISC);
if (status != ISC_R_SUCCESS)
return status;
@@ -176,7 +178,7 @@ isc_result_t omapi_init (void)
omapi_waiter_signal_handler, 0,
0, 0, 0, 0, 0, 0,
sizeof (omapi_waiter_object_t),
- 0);
+ 0, RC_MISC);
if (status != ISC_R_SUCCESS)
return status;
@@ -189,7 +191,8 @@ isc_result_t omapi_init (void)
omapi_auth_key_stuff_values,
omapi_auth_key_lookup,
0, 0, 0, 0, 0,
- sizeof (omapi_auth_key_t), 0);
+ sizeof (omapi_auth_key_t), 0,
+ RC_MISC);
if (status != ISC_R_SUCCESS)
return status;
@@ -246,7 +249,8 @@ isc_result_t omapi_object_type_register (omapi_object_type_t **type,
size_t size,
isc_result_t (*initialize)
(omapi_object_t *,
- const char *, int))
+ const char *, int),
+ int rc_flag)
{
omapi_object_type_t *t;
@@ -270,6 +274,7 @@ isc_result_t omapi_object_type_register (omapi_object_type_t **type,
t -> freer = freer;
t -> allocator = allocator;
t -> initialize = initialize;
+ t -> rc_flag = rc_flag;
omapi_object_types = t;
if (type)
*type = t;
diff --git a/server/omapi.c b/server/omapi.c
index 6d86587f..b5f4db01 100644
--- a/server/omapi.c
+++ b/server/omapi.c
@@ -50,7 +50,7 @@
#ifndef lint
static char copyright[] =
-"$Id: omapi.c,v 1.46.2.9 2001/10/17 03:31:50 mellon Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
+"$Id: omapi.c,v 1.46.2.10 2001/10/18 20:31:40 mellon Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -88,7 +88,8 @@ void dhcp_db_objects_setup ()
0, 0,
#endif
0,
- sizeof (struct lease), 0);
+ sizeof (struct lease),
+ 0, RC_LEASE);
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register lease object type: %s",
isc_result_totext (status));
@@ -103,7 +104,8 @@ void dhcp_db_objects_setup ()
dhcp_class_lookup,
dhcp_class_create,
dhcp_class_remove, 0, 0, 0,
- sizeof (struct class), 0);
+ sizeof (struct class), 0,
+ RC_MISC);
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register class object type: %s",
isc_result_totext (status));
@@ -118,7 +120,7 @@ void dhcp_db_objects_setup ()
dhcp_subclass_lookup,
dhcp_subclass_create,
dhcp_subclass_remove, 0, 0, 0,
- sizeof (struct class), 0);
+ sizeof (struct class), 0, RC_MISC);
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register subclass object type: %s",
isc_result_totext (status));
@@ -133,7 +135,7 @@ void dhcp_db_objects_setup ()
dhcp_pool_lookup,
dhcp_pool_create,
dhcp_pool_remove, 0, 0, 0,
- sizeof (struct pool), 0);
+ sizeof (struct pool), 0, RC_MISC);
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register pool object type: %s",
@@ -149,7 +151,8 @@ void dhcp_db_objects_setup ()
dhcp_host_lookup,
dhcp_host_create,
dhcp_host_remove, 0, 0, 0,
- sizeof (struct host_decl), 0);
+ sizeof (struct host_decl),
+ 0, RC_MISC);
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register host object type: %s",
@@ -168,7 +171,7 @@ void dhcp_db_objects_setup ()
dhcp_failover_state_remove,
0, 0, 0,
sizeof (dhcp_failover_state_t),
- 0);
+ 0, RC_MISC);
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register failover state object type: %s",
@@ -182,7 +185,8 @@ void dhcp_db_objects_setup ()
dhcp_failover_link_signal,
dhcp_failover_link_stuff_values,
0, 0, 0, 0, 0, 0,
- sizeof (dhcp_failover_link_t), 0);
+ sizeof (dhcp_failover_link_t), 0,
+ RC_MISC);
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register failover link object type: %s",
@@ -197,7 +201,8 @@ void dhcp_db_objects_setup ()
dhcp_failover_listener_stuff,
0, 0, 0, 0, 0, 0,
sizeof
- (dhcp_failover_listener_t), 0);
+ (dhcp_failover_listener_t), 0,
+ RC_MISC);
if (status != ISC_R_SUCCESS)
log_fatal ("Can't register failover listener object type: %s",