ISC DHCP 4.4.3-P1
A reference DHCPv4 and DHCPv6 implementation
 
Loading...
Searching...
No Matches
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.
 
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)
 
int data_string_terminate (struct data_string *str, const char *file, int line)
 

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

◆ binding_scope_allocate()

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

Definition at line 1194 of file alloc.c.

◆ binding_scope_reference()

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

Definition at line 1227 of file alloc.c.

◆ binding_value_allocate()

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

Definition at line 500 of file alloc.c.

◆ binding_value_reference()

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

Definition at line 520 of file alloc.c.

◆ buffer_allocate()

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

Definition at line 679 of file alloc.c.

◆ buffer_dereference()

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

Definition at line 726 of file alloc.c.

◆ buffer_reference()

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

Definition at line 698 of file alloc.c.

◆ data_string_copy()

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

Definition at line 1323 of file alloc.c.

◆ data_string_forget()

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

Definition at line 1339 of file alloc.c.

◆ data_string_new()

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 1272 of file alloc.c.

◆ data_string_terminate()

int data_string_terminate ( struct data_string* str,
const char * file,
int line )

Definition at line 1382 of file alloc.c.

◆ data_string_truncate()

void data_string_truncate ( struct data_string * dp,
int len )

Definition at line 1352 of file alloc.c.

◆ dns_host_entry_allocate()

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

Definition at line 768 of file alloc.c.

◆ dns_host_entry_dereference()

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

Definition at line 813 of file alloc.c.

◆ dns_host_entry_reference()

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

Definition at line 785 of file alloc.c.

◆ dns_zone_allocate()

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

Definition at line 1134 of file alloc.c.

◆ dns_zone_reference()

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

Definition at line 1166 of file alloc.c.

◆ executable_statement_allocate()

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

Definition at line 958 of file alloc.c.

◆ executable_statement_reference()

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

Definition at line 972 of file alloc.c.

◆ expression_allocate()

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

Definition at line 426 of file alloc.c.

◆ expression_reference()

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

Definition at line 446 of file alloc.c.

◆ free_binding_value()

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

Definition at line 548 of file alloc.c.

◆ free_client_lease()

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

Definition at line 369 of file alloc.c.

◆ free_dhcp_packet()

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

Definition at line 353 of file alloc.c.

◆ free_domain_search_list()

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

Definition at line 337 of file alloc.c.

◆ free_expression()

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

Definition at line 474 of file alloc.c.

◆ free_name_server()

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

Definition at line 292 of file alloc.c.

◆ free_pair()

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

Definition at line 400 of file alloc.c.

◆ free_protocol()

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

Definition at line 345 of file alloc.c.

◆ free_universe()

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

Definition at line 329 of file alloc.c.

◆ fundef_allocate()

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

Definition at line 572 of file alloc.c.

◆ fundef_reference()

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

Definition at line 586 of file alloc.c.

◆ group_allocate()

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

Definition at line 145 of file alloc.c.

◆ group_dereference()

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

Definition at line 205 of file alloc.c.

◆ group_reference()

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

Definition at line 177 of file alloc.c.

◆ new_client_lease()

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

Definition at line 361 of file alloc.c.

◆ new_dhcp_packet()

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

Definition at line 256 of file alloc.c.

◆ new_domain_search_list()

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

Definition at line 274 of file alloc.c.

◆ new_name_server()

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

Definition at line 283 of file alloc.c.

◆ new_option()

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

Definition at line 300 of file alloc.c.

◆ new_pair()

pair new_pair ( char * file,
int line ) const

Definition at line 379 of file alloc.c.

◆ new_protocol()

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

Definition at line 266 of file alloc.c.

◆ new_universe()

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

Definition at line 320 of file alloc.c.

◆ option_cache_allocate()

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

Definition at line 630 of file alloc.c.

◆ option_cache_reference()

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

Definition at line 651 of file alloc.c.

◆ option_chain_head_allocate()

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

Definition at line 35 of file alloc.c.

◆ option_chain_head_dereference()

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

Definition at line 95 of file alloc.c.

◆ option_chain_head_reference()

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

Definition at line 67 of file alloc.c.

◆ option_state_allocate()

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

Definition at line 846 of file alloc.c.

◆ option_state_dereference()

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

Definition at line 911 of file alloc.c.

◆ option_state_reference()

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

Definition at line 883 of file alloc.c.

◆ packet_allocate()

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

Definition at line 1015 of file alloc.c.

◆ packet_dereference()

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

Definition at line 1081 of file alloc.c.

◆ packet_reference()

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

Definition at line 1053 of file alloc.c.

Variable Documentation

◆ dhcp_free_list

struct dhcp_packet* dhcp_free_list

Definition at line 32 of file alloc.c.

◆ free_binding_values

struct binding_value* free_binding_values

Definition at line 498 of file alloc.c.

◆ free_expressions

struct expression* free_expressions

Definition at line 424 of file alloc.c.

◆ free_option_caches

struct option_cache* free_option_caches

Definition at line 614 of file alloc.c.

◆ free_pairs

pair free_pairs

Definition at line 377 of file alloc.c.

◆ packet_free_list

struct packet* packet_free_list

Definition at line 33 of file alloc.c.