ISC DHCP  4.3.3-P1
A reference DHCPv4 and DHCPv6 implementation
alloc.c File Reference
#include "dhcpd.h"
#include <omapip/omapip_p.h>

Go to the source code of this file.

Functions

int option_chain_head_allocate (struct option_chain_head **ptr, 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)
 
int option_chain_head_dereference (struct option_chain_head **ptr, const char *file, int line)
 
int group_allocate (struct group **ptr, const char *file, int line)
 
int group_reference (struct group **ptr, struct group *bp, const char *file, int line)
 
int group_dereference (struct group **ptr, const char *file, int line)
 
struct dhcp_packetnew_dhcp_packet (char *file, int line) const
 
struct protocolnew_protocol (char *file, int line) const
 
struct domain_search_listnew_domain_search_list (char *file, int line) const
 
struct name_servernew_name_server (char *file, int line) const
 
void free_name_server (struct name_server *ptr, const char *file, int line)
 
struct optionnew_option (char *name, const char *file, int line) const
 
struct universenew_universe (char *file, int line) const
 
void free_universe (struct universe *ptr, const char *file, int line)
 
void free_domain_search_list (struct domain_search_list *ptr, const char *file, int line)
 
void free_protocol (struct protocol *ptr, const char *file, int line)
 
void free_dhcp_packet (struct dhcp_packet *ptr, const char *file, int line)
 
struct client_leasenew_client_lease (char *file, int line) const
 
void free_client_lease (struct client_lease *lease, const char *file, int line)
 
pair new_pair (char *file, int line) const
 
void free_pair (pair foo, const char *file, int line)
 
int expression_allocate (struct expression **cptr, const char *file, int line)
 
int expression_reference (struct expression **ptr, struct expression *src, const char *file, int line)
 
void free_expression (struct expression *expr, const char *file, int line)
 
int binding_value_allocate (struct binding_value **cptr, const char *file, int line)
 
int binding_value_reference (struct binding_value **ptr, struct binding_value *src, const char *file, int line)
 
void free_binding_value (struct binding_value *bv, const char *file, int line)
 
int fundef_allocate (struct fundef **cptr, const char *file, int line)
 
int fundef_reference (struct fundef **ptr, struct fundef *src, const char *file, int line)
 
int option_cache_allocate (struct option_cache **cptr, const char *file, int line)
 
int option_cache_reference (struct option_cache **ptr, struct option_cache *src, const char *file, int line)
 
int buffer_allocate (struct buffer **ptr, unsigned len, const char *file, int line)
 
int buffer_reference (struct buffer **ptr, struct buffer *bp, const char *file, int line)
 
int buffer_dereference (struct buffer **ptr, const char *file, int line)
 
int dns_host_entry_allocate (struct dns_host_entry **ptr, const char *hostname, 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)
 
int dns_host_entry_dereference (struct dns_host_entry **ptr, const char *file, int line)
 
int option_state_allocate (struct option_state **ptr, const char *file, int line)
 
int option_state_reference (struct option_state **ptr, struct option_state *bp, const char *file, int line)
 
int option_state_dereference (struct option_state **ptr, const char *file, int line)
 
int executable_statement_allocate (struct executable_statement **ptr, const char *file, int line)
 
int executable_statement_reference (struct executable_statement **ptr, struct executable_statement *bp, const char *file, int line)
 
int packet_allocate (struct packet **ptr, const char *file, int line)
 
int packet_reference (struct packet **ptr, struct packet *bp, const char *file, int line)
 
int packet_dereference (struct packet **ptr, const char *file, int line)
 
int dns_zone_allocate (struct dns_zone **ptr, const char *file, int line)
 
int dns_zone_reference (struct dns_zone **ptr, struct dns_zone *bp, const char *file, int line)
 
int binding_scope_allocate (struct binding_scope **ptr, const char *file, int line)
 
int binding_scope_reference (struct binding_scope **ptr, struct binding_scope *bp, 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. More...
 
void data_string_copy (struct data_string *dest, const struct data_string *src, const char *file, int line)
 
void data_string_forget (struct data_string *data, const char *file, int line)
 
void data_string_truncate (struct data_string *dp, int len)
 

Variables

struct dhcp_packetdhcp_free_list
 
struct packetpacket_free_list
 
pair free_pairs
 
struct expressionfree_expressions
 
struct binding_valuefree_binding_values
 
struct option_cachefree_option_caches
 

Function Documentation

int binding_scope_allocate ( struct binding_scope **  ptr,
const char *  file,
int  line 
)

Definition at line 1195 of file alloc.c.

int binding_scope_reference ( struct binding_scope **  ptr,
struct binding_scope bp,
const char *  file,
int  line 
)

Definition at line 1228 of file alloc.c.

int binding_value_allocate ( struct binding_value **  cptr,
const char *  file,
int  line 
)

Definition at line 501 of file alloc.c.

int binding_value_reference ( struct binding_value **  ptr,
struct binding_value src,
const char *  file,
int  line 
)

Definition at line 521 of file alloc.c.

int buffer_allocate ( struct buffer **  ptr,
unsigned  len,
const char *  file,
int  line 
)

Definition at line 680 of file alloc.c.

int buffer_dereference ( struct buffer **  ptr,
const char *  file,
int  line 
)

Definition at line 727 of file alloc.c.

int buffer_reference ( struct buffer **  ptr,
struct buffer bp,
const char *  file,
int  line 
)

Definition at line 699 of file alloc.c.

void data_string_copy ( struct data_string dest,
const struct data_string src,
const char *  file,
int  line 
)

Definition at line 1324 of file alloc.c.

void data_string_forget ( struct data_string data,
const char *  file,
int  line 
)

Definition at line 1340 of file alloc.c.

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.

Allocates a data_string and copies into it the given length of bytes from the given source, adding a terminating null if not present in the source at length-1.

Parameters
new_stringpointer to the data_string to construct. Cannot be NULL. Note that its contents will be overwritten. Passing in the address of an allocated data_string will result in memory leaks.
srcdata to be copied. Cannot be NULL.
lenlength of the data to copied
Returns
1 - if the data_string is constructed successfully, 0 if target data_struct is NULL or the buffer allocation fails.

Definition at line 1273 of file alloc.c.

void data_string_truncate ( struct data_string dp,
int  len 
)

Definition at line 1353 of file alloc.c.

int dns_host_entry_allocate ( struct dns_host_entry **  ptr,
const char *  hostname,
const char *  file,
int  line 
)

Definition at line 769 of file alloc.c.

int dns_host_entry_dereference ( struct dns_host_entry **  ptr,
const char *  file,
int  line 
)

Definition at line 814 of file alloc.c.

int dns_host_entry_reference ( struct dns_host_entry **  ptr,
struct dns_host_entry bp,
const char *  file,
int  line 
)

Definition at line 786 of file alloc.c.

int dns_zone_allocate ( struct dns_zone **  ptr,
const char *  file,
int  line 
)

Definition at line 1135 of file alloc.c.

int dns_zone_reference ( struct dns_zone **  ptr,
struct dns_zone bp,
const char *  file,
int  line 
)

Definition at line 1167 of file alloc.c.

int executable_statement_allocate ( struct executable_statement **  ptr,
const char *  file,
int  line 
)

Definition at line 959 of file alloc.c.

int executable_statement_reference ( struct executable_statement **  ptr,
struct executable_statement bp,
const char *  file,
int  line 
)

Definition at line 973 of file alloc.c.

int expression_allocate ( struct expression **  cptr,
const char *  file,
int  line 
)

Definition at line 427 of file alloc.c.

int expression_reference ( struct expression **  ptr,
struct expression src,
const char *  file,
int  line 
)

Definition at line 447 of file alloc.c.

void free_binding_value ( struct binding_value bv,
const char *  file,
int  line 
)

Definition at line 549 of file alloc.c.

void free_client_lease ( struct client_lease lease,
const char *  file,
int  line 
)

Definition at line 370 of file alloc.c.

void free_dhcp_packet ( struct dhcp_packet ptr,
const char *  file,
int  line 
)

Definition at line 354 of file alloc.c.

void free_domain_search_list ( struct domain_search_list ptr,
const char *  file,
int  line 
)

Definition at line 338 of file alloc.c.

void free_expression ( struct expression expr,
const char *  file,
int  line 
)

Definition at line 475 of file alloc.c.

void free_name_server ( struct name_server ptr,
const char *  file,
int  line 
)

Definition at line 293 of file alloc.c.

void free_pair ( pair  foo,
const char *  file,
int  line 
)

Definition at line 401 of file alloc.c.

void free_protocol ( struct protocol ptr,
const char *  file,
int  line 
)

Definition at line 346 of file alloc.c.

void free_universe ( struct universe ptr,
const char *  file,
int  line 
)

Definition at line 330 of file alloc.c.

int fundef_allocate ( struct fundef **  cptr,
const char *  file,
int  line 
)

Definition at line 573 of file alloc.c.

int fundef_reference ( struct fundef **  ptr,
struct fundef src,
const char *  file,
int  line 
)

Definition at line 587 of file alloc.c.

int group_allocate ( struct group **  ptr,
const char *  file,
int  line 
)

Definition at line 146 of file alloc.c.

int group_dereference ( struct group **  ptr,
const char *  file,
int  line 
)

Definition at line 206 of file alloc.c.

int group_reference ( struct group **  ptr,
struct group bp,
const char *  file,
int  line 
)

Definition at line 178 of file alloc.c.

struct client_lease* new_client_lease ( char *  file,
int  line 
) const

Definition at line 362 of file alloc.c.

struct dhcp_packet* new_dhcp_packet ( char *  file,
int  line 
) const

Definition at line 257 of file alloc.c.

struct domain_search_list* new_domain_search_list ( char *  file,
int  line 
) const

Definition at line 275 of file alloc.c.

struct name_server* new_name_server ( char *  file,
int  line 
) const

Definition at line 284 of file alloc.c.

struct option* new_option ( char *  name,
const char *  file,
int  line 
) const

Definition at line 301 of file alloc.c.

pair new_pair ( char *  file,
int  line 
) const

Definition at line 380 of file alloc.c.

struct protocol* new_protocol ( char *  file,
int  line 
) const

Definition at line 267 of file alloc.c.

struct universe* new_universe ( char *  file,
int  line 
) const

Definition at line 321 of file alloc.c.

int option_cache_allocate ( struct option_cache **  cptr,
const char *  file,
int  line 
)

Definition at line 631 of file alloc.c.

int option_cache_reference ( struct option_cache **  ptr,
struct option_cache src,
const char *  file,
int  line 
)

Definition at line 652 of file alloc.c.

int option_chain_head_allocate ( struct option_chain_head **  ptr,
const char *  file,
int  line 
)

Definition at line 36 of file alloc.c.

int option_chain_head_dereference ( struct option_chain_head **  ptr,
const char *  file,
int  line 
)

Definition at line 96 of file alloc.c.

int option_chain_head_reference ( struct option_chain_head **  ptr,
struct option_chain_head bp,
const char *  file,
int  line 
)

Definition at line 68 of file alloc.c.

int option_state_allocate ( struct option_state **  ptr,
const char *  file,
int  line 
)

Definition at line 847 of file alloc.c.

int option_state_dereference ( struct option_state **  ptr,
const char *  file,
int  line 
)

Definition at line 912 of file alloc.c.

int option_state_reference ( struct option_state **  ptr,
struct option_state bp,
const char *  file,
int  line 
)

Definition at line 884 of file alloc.c.

int packet_allocate ( struct packet **  ptr,
const char *  file,
int  line 
)

Definition at line 1016 of file alloc.c.

int packet_dereference ( struct packet **  ptr,
const char *  file,
int  line 
)

Definition at line 1082 of file alloc.c.

int packet_reference ( struct packet **  ptr,
struct packet bp,
const char *  file,
int  line 
)

Definition at line 1054 of file alloc.c.

Variable Documentation

struct dhcp_packet* dhcp_free_list

Definition at line 33 of file alloc.c.

struct binding_value* free_binding_values

Definition at line 499 of file alloc.c.

struct expression* free_expressions

Definition at line 425 of file alloc.c.

struct option_cache* free_option_caches

Definition at line 615 of file alloc.c.

pair free_pairs

Definition at line 378 of file alloc.c.

struct packet* packet_free_list

Definition at line 34 of file alloc.c.