 |
ISC DHCP
4.4.2b1
A reference DHCPv4 and DHCPv6 implementation
|
|
Go to the documentation of this file.
44 #if defined (POINTER_DEBUG)
52 #if defined (POINTER_DEBUG)
61 memset (h, 0,
sizeof *h);
75 #if defined (POINTER_DEBUG)
83 #if defined (POINTER_DEBUG)
105 #if defined (POINTER_DEBUG)
122 #if defined (DEBUG_RC_HISTORY)
125 #if defined (POINTER_DEBUG)
154 #if defined (POINTER_DEBUG)
162 #if defined (POINTER_DEBUG)
165 *ptr = (
struct group *)0;
171 memset (g, 0,
sizeof *g);
185 #if defined (POINTER_DEBUG)
193 #if defined (POINTER_DEBUG)
196 *ptr = (
struct group *)0;
214 #if defined (POINTER_DEBUG)
222 *ptr = (
struct group *)0;
230 #if defined (DEBUG_RC_HISTORY)
231 dump_rc_history (
group);
233 #if defined (POINTER_DEBUG)
313 memcpy(rval + 1,
name, len);
314 rval->
name = (
char *)(rval + 1);
388 memset (foo, 0,
sizeof *foo);
396 memset (foo, 0,
sizeof *foo);
410 #if defined (DEBUG_MEMORY_LEAKAGE) || \
411 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
412 void relinquish_free_pairs ()
442 memset (rval, 0,
sizeof *rval);
454 #if defined (POINTER_DEBUG)
462 #if defined (POINTER_DEBUG)
484 #if defined (DEBUG_MEMORY_LEAKAGE) || \
485 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
486 void relinquish_free_expressions ()
516 memset (rval, 0,
sizeof *rval);
528 #if defined (POINTER_DEBUG)
536 #if defined (POINTER_DEBUG)
558 #if defined (DEBUG_MEMORY_LEAKAGE) || \
559 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
560 void relinquish_free_binding_values ()
582 memset (rval, 0,
sizeof *rval);
594 #if defined (POINTER_DEBUG)
602 #if defined (POINTER_DEBUG)
605 *ptr = (
struct fundef *)0;
616 #if defined (DEBUG_MEMORY_LEAKAGE) || \
617 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
618 void relinquish_free_option_caches ()
647 memset (rval, 0,
sizeof *rval);
659 #if defined (POINTER_DEBUG)
667 #if defined (POINTER_DEBUG)
693 memset (bp, 0,
sizeof *bp);
706 #if defined (POINTER_DEBUG)
714 #if defined (POINTER_DEBUG)
717 *ptr = (
struct buffer *)0;
733 #if defined (POINTER_DEBUG)
742 #if defined (POINTER_DEBUG)
753 }
else if ((*ptr) ->
refcnt < 0) {
755 #if defined (DEBUG_RC_HISTORY)
756 dump_rc_history (*ptr);
758 #if defined (POINTER_DEBUG)
764 *ptr = (
struct buffer *)0;
779 memset (bp, 0,
sizeof *bp);
793 #if defined (POINTER_DEBUG)
801 #if defined (POINTER_DEBUG)
820 #if defined (POINTER_DEBUG)
829 if ((*ptr)->refcnt == 0) {
831 }
else if ((*ptr)->refcnt < 0) {
833 #if defined (DEBUG_RC_HISTORY)
834 dump_rc_history (*ptr);
836 #if defined (POINTER_DEBUG)
855 #if defined (POINTER_DEBUG)
863 #if defined (POINTER_DEBUG)
873 memset (*ptr, 0, size);
891 #if defined (POINTER_DEBUG)
899 #if defined (POINTER_DEBUG)
921 #if defined (POINTER_DEBUG)
932 if (options ->
refcnt > 0)
935 if (options ->
refcnt < 0) {
937 #if defined (DEBUG_RC_HISTORY)
938 dump_rc_history (options);
940 #if defined (POINTER_DEBUG)
968 memset (bp, 0,
sizeof *bp);
980 #if defined (POINTER_DEBUG)
988 #if defined (POINTER_DEBUG)
1000 static struct packet *free_packets;
1002 #if defined (DEBUG_MEMORY_LEAKAGE) || \
1003 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
1004 void relinquish_free_packets ()
1007 for (p = free_packets; p; p = n) {
1011 free_packets = (
struct packet *)0;
1024 #if defined (POINTER_DEBUG)
1032 #if defined (POINTER_DEBUG)
1035 *ptr = (
struct packet *)0;
1041 free_packets = (
struct packet *)(p ->
raw);
1047 memset (p, 0,
sizeof *p);
1061 #if defined (POINTER_DEBUG)
1069 #if defined (POINTER_DEBUG)
1072 *ptr = (
struct packet *)0;
1089 if (!ptr || !*ptr) {
1091 #if defined (POINTER_DEBUG)
1099 *ptr = (
struct packet *)0;
1107 #if defined (DEBUG_RC_HISTORY)
1108 dump_rc_history (
packet);
1110 #if defined (POINTER_DEBUG)
1143 #if defined (POINTER_DEBUG)
1151 #if defined (POINTER_DEBUG)
1160 memset (d, 0,
sizeof *d);
1174 #if defined (POINTER_DEBUG)
1182 #if defined (POINTER_DEBUG)
1203 #if defined (POINTER_DEBUG)
1212 #if defined (POINTER_DEBUG)
1222 memset (bp, 0,
sizeof *bp);
1235 #if defined (POINTER_DEBUG)
1243 #if defined (POINTER_DEBUG)
1273 const char *src,
unsigned int len,
1276 unsigned int copy_len = 0;
1278 if (new_string == NULL) {
1279 log_error(
"data_string_new: new_string cannot be NULL %s(%d)",
1285 log_error(
"data_string_new: src cannot be NULL %s(%d)",
1290 memset(new_string, 0,
sizeof (
struct data_string));
1294 copy_len = (len > 0 && src[len - 1] == 0) ? len - 1 : len;
1304 memcpy(new_string->
buffer->
data, src, copy_len);
1313 new_string->
len = copy_len;
1331 dest -> data = src -> data;
1332 dest -> terminated = src -> terminated;
1333 dest -> len = src -> len;
1357 if (len < dp ->
len) {
1391 memset(&temp, 0,
sizeof(temp));
struct universe * new_universe(char *file, int line) const
int buffer_dereference(struct buffer **ptr, const char *file, int line)
int executable_statement_reference(struct executable_statement **ptr, struct executable_statement *bp, const char *file, int line)
void free_domain_search_list(struct domain_search_list *ptr, const char *file, int line)
int executable_statement_allocate(struct executable_statement **ptr, const char *file, int line)
int fundef_reference(struct fundef **ptr, struct fundef *src, const char *file, int line)
struct option_cache * free_option_caches
int executable_statement_dereference(struct executable_statement **ptr, const char *file, int line)
int group_reference(struct group **ptr, struct group *bp, const char *file, int line)
void data_string_forget(struct data_string *data, const char *file, int line)
void free_universe(struct universe *ptr, const char *file, int line)
int expression_allocate(struct expression **cptr, const char *file, int line)
struct universe ** universes
int option_cache_reference(struct option_cache **ptr, struct option_cache *src, const char *file, int line)
int dns_zone_reference(struct dns_zone **ptr, struct dns_zone *bp, const char *file, int line)
int binding_value_reference(struct binding_value **ptr, struct binding_value *src, const char *file, int line)
union expression::expr_union data
const unsigned char * data
struct name_server * new_name_server(char *file, int line) const
pair new_pair(char *file, int line) const
#define PACKET_MAX_CLASSES
int fundef_allocate(struct fundef **cptr, const char *file, int line)
void free_name_server(struct name_server *ptr, const char *file, int line)
struct domain_search_list * new_domain_search_list(char *file, int line) const
int option_state_reference(struct option_state **ptr, struct option_state *bp, const char *file, int line)
int option_state_allocate(struct option_state **ptr, const char *file, int line)
void data_string_truncate(struct data_string *dp, int len)
int buffer_reference(struct buffer **ptr, struct buffer *bp, const char *file, int line)
int binding_value_allocate(struct binding_value **cptr, const char *file, int line)
int option_cache_allocate(struct option_cache **cptr, const char *file, int line)
int group_allocate(struct group **ptr, const char *file, int line)
struct binding_value * free_binding_values
struct expression * free_expressions
int option_chain_head_dereference(struct option_chain_head **ptr, const char *file, int line)
void * dmalloc(size_t size, const char *file, int line)
struct option * new_option(char *name, const char *file, int line) const
int packet_reference(struct packet **ptr, struct packet *bp, const char *file, int line)
int option_chain_head_reference(struct option_chain_head **ptr, struct option_chain_head *bp, const char *file, int line)
#define dmalloc_reuse(x, y, l, z)
int buffer_allocate(struct buffer **ptr, unsigned len, const char *file, int line)
int binding_scope_allocate(struct binding_scope **ptr, const char *file, int line)
int group_dereference(struct group **ptr, const char *file, int line)
#define rc_register(file, line, reference, addr, refcnt, d, f)
int log_error(const char *,...) __attribute__((__format__(__printf__
void dfree(void *ptr, const char *file, int line)
int option_cache_dereference(struct option_cache **ptr, const char *file, int line)
struct packet * packet_free_list
struct dhcp_packet * dhcp_free_list
int option_state_dereference(struct option_state **ptr, const char *file, int line)
void free_client_lease(struct client_lease *lease, const char *file, int line)
int binding_scope_reference(struct binding_scope **ptr, struct binding_scope *bp, const char *file, int line)
int packet_dereference(struct packet **ptr, const char *file, int line)
struct executable_statement * statements
void free_expression(struct expression *expr, const char *file, int line)
struct class * classes[PACKET_MAX_CLASSES]
int expression_reference(struct expression **ptr, struct expression *src, const char *file, int line)
struct option_state * options
int dns_host_entry_allocate(struct dns_host_entry **ptr, const char *hostname, const char *file, int line)
void free_protocol(struct protocol *ptr, const char *file, int line)
void free_pair(pair foo, const char *file, int line)
int packet_allocate(struct packet **ptr, const char *file, int line)
int option_chain_head_allocate(struct option_chain_head **ptr, const char *file, int line)
struct client_lease * new_client_lease(char *file, int line) const
struct protocol * new_protocol(char *file, int line) const
int dns_host_entry_dereference(struct dns_host_entry **ptr, const char *file, int line)
int dns_zone_allocate(struct dns_zone **ptr, const char *file, int line)
void free_dhcp_packet(struct dhcp_packet *ptr, const char *file, int line)
struct interface_info * interface
int data_string_terminate(struct data_string *str, const char *file, int line)
int data_string_new(struct data_string *new_string, const char *src, unsigned int len, const char *file, int line)
Constructs a null-terminated data_string from a char* and length.
void data_string_copy(struct data_string *dest, const struct data_string *src, const char *file, int line)
isc_result_t omapi_object_dereference(omapi_object_t **h, const char *file, int line)
void free_binding_value(struct binding_value *bv, const char *file, int line)
int dns_host_entry_reference(struct dns_host_entry **ptr, struct dns_host_entry *bp, const char *file, int line)
struct dhcp_packet * new_dhcp_packet(char *file, int line) const