32#if defined (COMPACT_LEASES)
33struct lease *free_leases;
35#if defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
36struct lease *lease_hunks;
40 struct lease *c, *n, **p;
44 for (n = lease_hunks; n; n = n->
next) {
45 for (i = 1; i < n->
starts + 1; i++) {
47 for (c = free_leases; c; c = c->
next) {
58#if defined (DEBUG_RC_HISTORY)
59 dump_rc_history(&n[i]);
65 for (c = lease_hunks; c; c = n) {
68 log_info(
"lease hunk %lx leases %ld free %ld",
69 (
unsigned long)c, (
unsigned long)(c->starts),
70 (
unsigned long)(c->ends));
76 for (c = free_leases; c; c = n) {
90#if defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
93 memset (rval, 0,
sizeof (
struct lease));
95 rval ->
next = lease_hunks;
129 free_leases = lt ->
next;
133 return ISC_R_NOMEMORY;
142#if !defined (NO_HOST_FREES)
158isc_result_t host_dereference (
struct host_decl **ptr,
161 if ((*ptr) -> refcnt == 1) {
162 log_error (
"host dereferenced with refcnt == 1.");
163#if defined (DEBUG_RC_HISTORY)
190 memset (rval, 0,
sizeof *rval);
219#if defined (DEBUG_MEMORY_LEAKAGE) || \
220 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
221void relinquish_free_lease_states ()
251 class_dereference (&
permit ->
class,
MDL);
void data_string_forget(struct data_string *data, const char *file, int line)
int option_state_allocate(struct option_state **ptr, const char *file, int line)
int option_state_dereference(struct option_state **ptr, const char *file, int line)
int packet_dereference(struct packet **ptr, const char *file, int line)
isc_result_t dhcp_lease_free(omapi_object_t *, const char *, int)
struct lease * new_leases(unsigned, const char *, int)
omapi_object_type_t * dhcp_type_lease
isc_result_t dhcp_lease_get(omapi_object_t **, const char *, int)
omapi_object_type_t * dhcp_type_pool
omapi_object_type_t * dhcp_type_subclass
omapi_object_type_t * dhcp_type_class
omapi_object_type_t * dhcp_type_host
void relinquish_lease_hunks(void)
struct iaddr ip_addr(struct iaddr subnet, struct iaddr mask, u_int32_t host_address)
const char * piaddr(const struct iaddr addr)
#define OMAPI_OBJECT_ALLOC(name, stype, type)
isc_result_t omapi_object_dereference(omapi_object_t **, const char *, int)
#define dmalloc_reuse(x, y, l, z)
struct __omapi_object omapi_object_t
isc_result_t omapi_object_reference(omapi_object_t **, omapi_object_t *, const char *, int)
void * dmalloc(size_t, const char *, int)
void dfree(void *, const char *, int)
isc_result_t omapi_object_allocate(omapi_object_t **, omapi_object_type_t *, size_t, const char *, int)
int log_error(const char *,...) __attribute__((__format__(__printf__
int int log_info(const char *,...) __attribute__((__format__(__printf__
#define DHCP_R_INVALIDARG
void free_permit(struct permit *permit, const char *file, int line)
struct permit * new_permit(char *file, int line) const
struct lease_state * free_lease_states
void free_lease_state(struct lease_state *ptr, const char *file, int line)
struct lease_state * new_lease_state(char *file, int line) const
struct lease_state * next
struct option_state * options
struct data_string filename server_name
struct data_string parameter_request_list
enum permit::@011051276256032144365216260061073130004016310224 type