83 }
else if (cd->
name != NULL) {
87 class_dereference(&c,
MDL);
95 class_reference (&c ->
nic, cd,
MDL);
98 if (dynamicp && commit) {
107 return ISC_R_IOERROR;
121static int server_starting = 0;
136 log_error (
"dhcp client identifier may not be %s",
137 "specified conditionally.");
138 }
else if (!(*evp)) {
142 log_error (
"only one dhcp client identifier may be %s",
151find_host_id_info(
unsigned int option_code,
int relays) {
166print_host(
const void *
name,
unsigned len,
void *
value) {
168 printf(
"--------------\n");
170 printf(
"len:%d\n", len);
172 printf(
"host @%p is '%s'\n", h, h->
name);
179 printf(
"--------------\n");
188 log_fatal(
"Can't allocate host/uid hash");
233 log_fatal (
"Can't allocate host name hash");
235 (
unsigned char *)hd ->
name,
239 (
unsigned char *)hd ->
name,
245 (
unsigned char *)hd ->
name,
252 host_dereference (&hp,
MDL);
257 if (hp && hp == hd) {
258 host_dereference (&hp,
MDL);
261 return ISC_R_IOERROR;
269 (
unsigned char *)hd ->
name,
274 host_dereference (&hp,
MDL);
280 host_dereference (&hd -> n_ipaddr,
MDL);
285 if (hd -> interface.hlen) {
289 log_fatal (
"Can't allocate host/hw hash");
294 hd -> interface.hbuf,
295 hd -> interface.hlen,
MDL);
299 hd -> interface.hlen, hd,
MDL);
304 for (np = hp; np -> n_ipaddr; np = np -> n_ipaddr)
306 host_reference (&np -> n_ipaddr, hd,
MDL);
307 host_dereference (&hp,
MDL);
316 find_uid_statement, &esp, 0)) {
318 memset(&cid, 0,
sizeof(cid));
320 NULL, NULL, NULL, NULL, NULL,
329 sizeof(uid_buf) - 1, uid_buf);
332 sizeof(cid_buf) - 1, cid_buf);
334 log_error (
"Warning, host declaration '%s'"
335 " already has uid '%s',"
336 " ignoring dhcp-client-identifier '%s'",
337 hd->
name, uid_buf, cid_buf);
347 if (hd -> client_identifier.len) {
353 log_fatal (
"Can't allocate host/uid hash");
356 hd -> client_identifier.data,
357 hd -> client_identifier.len,
364 hd -> client_identifier.data,
365 hd -> client_identifier.len,
369 for (np = hp; np -> n_ipaddr;
370 np = np -> n_ipaddr) {
375 host_reference (&np -> n_ipaddr,
378 host_dereference (&hp,
MDL);
381 hd -> client_identifier.data,
382 hd -> client_identifier.len,
399 if (h_id_info == NULL) {
401 if (h_id_info == NULL) {
402 log_fatal(
"No memory for host-identifier "
403 "option information.");
409 log_fatal(
"No memory for host-identifier "
438 host_dereference(&hp,
MDL);
447 if (dynamicp && commit) {
449 return ISC_R_IOERROR;
451 return ISC_R_IOERROR;
470 return ISC_R_IOERROR;
497 int hw_head = 0, uid_head = 1;
519 host_reference (&foo, hp,
MDL);
524 host_dereference (&np,
MDL);
525 host_reference (&np, foo,
MDL);
526 host_dereference (&foo,
MDL);
536 host_dereference (&foo,
MDL);
539 host_dereference (&np,
MDL);
541 host_dereference (&hp,
MDL);
561 host_reference (&foo, hp,
MDL);
566 host_dereference (&np,
MDL);
567 host_reference (&np, foo,
MDL);
568 host_dereference (&foo,
MDL);
578 host_dereference (&foo,
MDL);
581 host_dereference (&np,
MDL);
583 host_dereference (&hp,
MDL);
612 (
unsigned char *)hd ->
name,
616 (
unsigned char *)hd ->
name,
619 host_dereference (&hp,
MDL);
625 return ISC_R_IOERROR;
627 return ISC_R_IOERROR;
633 const unsigned char *haddr,
unsigned hlen,
637#if defined(LDAP_CONFIGURATION)
640 if ((ret = find_haddr_in_ldap (hp, htype,
hlen, haddr,
file,
line)))
653 const unsigned char *data,
unsigned len,
668 struct packet *relay_packet;
671#if defined(LDAP_CONFIGURATION)
672 if ((found = find_client_in_ldap (hp,
packet, opt_state,
file,
line)))
678 relay_state = opt_state;
698 relay_state = relay_packet->
options;
704 memset(&data, 0,
sizeof(data));
707 NULL, relay_state, NULL,
710 log_error(
"Error evaluating option cache");
740 struct iaddr ip_address;
744 memset (&fixed_addr, 0,
sizeof fixed_addr);
746 for (hp = *host; hp; hp = hp -> n_ipaddr) {
747 if (!hp -> fixed_addr)
755 hp -> fixed_addr,
MDL))
757 for (i = 0; i < fixed_addr.
len; i += 4) {
759 memcpy (ip_address.
iabuf,
760 fixed_addr.
data + i, 4);
769 host_reference (&tmp, *host,
MDL);
770 host_dereference (host,
MDL);
771 host_reference (host, hp,
MDL);
772 host_dereference (&tmp,
MDL);
784 struct iaddr low, high;
787 struct lease **lpchain;
789#if defined(COMPACT_LEASES)
790 struct lease *address_range;
793 unsigned min, max, i, num_addrs;
794 char lowbuf [16], highbuf [16], netbuf [16];
797#if !defined(COMPACT_LEASES)
804 log_fatal (
"No shared network for network %s (%s)",
811 log_fatal (
"Can't allocate lease/uid hash");
816 log_fatal (
"Can't allocate lease/ip hash");
821 log_fatal (
"Can't allocate lease/hw hash");
826 strcpy(lowbuf,
piaddr(low));
828 log_fatal(
"bad range, address %s not in subnet %s netmask %s",
833 strcpy(highbuf,
piaddr(high));
835 log_fatal(
"bad range, address %s not in subnet %s netmask %s",
853 num_addrs = max - min + 1;
854#if defined (BINARY_LEASES)
859#if defined (COMPACT_LEASES)
860 s = (num_addrs + 1) *
sizeof (
struct lease);
864 if (((s %
sizeof (
struct lease)) != 0) ||
865 ((s /
sizeof (
struct lease)) != (num_addrs + 1))) {
866 strcpy (lowbuf,
piaddr (low));
867 strcpy (highbuf,
piaddr (high));
868 parse_warn (cfile,
"%s-%s is an overly large address range.",
873 if (!address_range) {
874 strcpy (lowbuf,
piaddr (low));
875 strcpy (highbuf,
piaddr (high));
876 log_fatal (
"No memory for address range %s-%s.",
882 for (i = 0; i < num_addrs; i++) {
884#if defined (COMPACT_LEASES)
888 lease_reference (&lp, &address_range [i],
MDL);
890 status = lease_allocate (&lp,
MDL);
896 isc_result_totext (status));
912 "lease %s is declared twice!",
916 lease_dereference (<,
MDL);
924 lease_reference (&lp ->
next, *lpchain,
MDL);
925 lease_dereference (lpchain,
MDL);
927 lease_reference (lpchain, lp,
MDL);
929 lease_dereference (&lp,
MDL);
944 if (subnet_reference (sp, rv,
965 if (subnet_reference (sp, rv,
977 const struct subnet *scan,
985 char n1buf[
sizeof(
"ffff:ffff:ffff:ffff:ffff:ffff:255.255.255")];
987 for (i = 0; i < 128; i++)
991 for (j = 0; j < 128; j++)
997 log_error(
"Warning: subnet %s/%d overlaps subnet %s/%d",
1019 subnet_reference (&scan, next,
MDL);
1020 subnet_dereference (&next,
MDL);
1030 subnet_dereference (&prev,
MDL);
1036 subnet_dereference (&scan,
MDL);
1039 subnet_reference (&prev, scan,
MDL);
1040 subnet_dereference (&scan,
MDL);
1043 subnet_dereference (&prev,
MDL);
1059 shared_network_reference (&share ->
next,
1067 struct parse *cfile;
1072 isc_result_t status;
1074 if (share -> interface) {
1076 "A subnet or shared network can't be connected %s",
1077 "to two interfaces.");
1085 status = interface_allocate (&
ip,
MDL);
1087 log_fatal (
"new_shared_network_interface %s: %s",
1088 name, isc_result_totext (status));
1102 interface_reference (&share -> interface,
ip,
MDL);
1118 if (!comp ->
pool) {
1119 log_error (
"undeclared lease found in database: %s",
1130 lease_dereference (&comp,
MDL);
1164#if defined (FAILOVER_PROTOCOL)
1165 int do_pool_check = 0;
1170 if (pimmediate && !commit)
1193 (((comp -> uid &&
lease -> uid) &&
1194 (comp -> uid_len !=
lease -> uid_len ||
1195 memcmp (comp -> uid,
lease -> uid, comp -> uid_len))) ||
1197 ((comp -> hardware_addr.hlen !=
1198 lease -> hardware_addr.hlen) ||
1199 memcmp (comp -> hardware_addr.hbuf,
1200 lease -> hardware_addr.hbuf,
1201 comp -> hardware_addr.hlen))))) {
1215 comp -> uid = (
unsigned char *)0;
1225 if (comp -> billing_class !=
lease -> billing_class) {
1228 if (
lease -> billing_class)
1233 comp -> starts =
lease -> starts;
1235 if (
lease -> uid_len <=
sizeof (
lease -> uid_buf)) {
1236 memcpy (comp -> uid_buf,
1238 comp -> uid = &comp -> uid_buf [0];
1239 comp -> uid_max =
sizeof comp -> uid_buf;
1240 comp -> uid_len =
lease -> uid_len;
1241 }
else if (
lease -> uid != &
lease -> uid_buf [0]) {
1242 comp -> uid =
lease -> uid;
1243 comp -> uid_max =
lease -> uid_max;
1244 lease -> uid = (
unsigned char *)0;
1245 lease -> uid_max = 0;
1246 comp -> uid_len =
lease -> uid_len;
1247 lease -> uid_len = 0;
1252 comp -> uid = (
unsigned char *)0;
1253 comp -> uid_len = comp -> uid_max = 0;
1256 host_dereference (&comp -> host,
MDL);
1257 host_reference (&comp -> host,
lease -> host,
MDL);
1258 comp -> hardware_addr =
lease -> hardware_addr;
1261 if (
lease -> scope) {
1280 if (comp -> client_hostname)
1281 dfree (comp -> client_hostname,
MDL);
1282 comp -> client_hostname =
lease -> client_hostname;
1283 lease -> client_hostname = (
char *)0;
1319#if defined (FAILOVER_PROTOCOL)
1338#if defined (FAILOVER_PROTOCOL)
1348 if (!comp ->
pool) {
1349 log_error (
"Supersede_lease: lease %s with no pool.",
1355 switch (comp -> binding_state) {
1364#if defined(FAILOVER_PROTOCOL)
1370 lq = &comp ->
pool -> active;
1376 lq = &comp ->
pool -> expired;
1380 lq = &comp ->
pool -> abandoned;
1391#if defined(FAILOVER_PROTOCOL)
1397 log_error (
"Lease with bogus binding state: %d",
1398 comp -> binding_state);
1399#if defined (BINDING_STATE_DEBUG)
1418 if (commit || !pimmediate)
1437 if ((commit || !pimmediate) &&
1440 (comp -> sort_time < comp ->
pool -> next_event_time ||
1442 comp ->
pool -> next_event_time = comp -> sort_time;
1443 tv . tv_sec = comp ->
pool -> next_event_time;
1452#if defined(FAILOVER_PROTOCOL)
1472 if ((server_starting &
SS_NOSYNC) == 0) {
1478#if defined (FAILOVER_PROTOCOL)
1480 comp -> desired_binding_state = comp -> binding_state;
1494 if ((from_pool == 0) &&
1495 (commit || !pimmediate) &&
1506#if defined (FAILOVER_PROTOCOL)
1507 dhcp_failover_state_t *peer;
1512 peer = (dhcp_failover_state_t *)0;
1517 if (
lease -> next_binding_state !=
lease -> binding_state &&
1529#if defined (NSUPDATE)
1554 if (
lease -> client_hostname) {
1556 lease -> client_hostname = (
char *)0;
1559 host_dereference (&
lease -> host,
MDL);
1567 if (
lease -> next_binding_state !=
lease -> binding_state &&
1578#if defined (NSUPDATE)
1618 if (
lease -> client_hostname) {
1620 lease -> client_hostname = (
char *)0;
1623 host_dereference (&
lease -> host,
MDL);
1630#if defined (DEBUG_LEASE_STATE_TRANSITIONS)
1631 log_debug (
"lease %s moves from %s to %s",
1637 lease -> binding_state =
lease -> next_binding_state;
1638 switch (
lease -> binding_state) {
1640#if defined (FAILOVER_PROTOCOL)
1653#if defined(FAILOVER_PROTOCOL)
1669 lease -> next_binding_state =
lease -> binding_state;
1672#if defined (DEBUG_LEASE_STATE_TRANSITIONS)
1673 log_debug (
"lease %s: next binding state %s",
1685 isc_result_t status;
1687 status = lease_allocate (<,
MDL);
1700 lt ->
uid = (
unsigned char *)0;
1704 lease_dereference (<,
MDL);
1713 lease_dereference (<,
MDL);
1749 status = lease_reference(lp, lt,
file,
line);
1750 lease_dereference(<,
MDL);
1761#if defined (NSUPDATE)
1801#if defined (FAILOVER_PROTOCOL)
1803 dhcp_failover_state_t *peer = NULL;
1809 (((peer->i_am == primary) &&
1811 ((peer->i_am == secondary) &&
1832 const char *message;
1834 struct lease *lt = NULL;
1835#if defined (NSUPDATE)
1867 lease_dereference(<,
MDL);
1881void dissociate_lease (
lease)
1885#if defined (NSUPDATE)
1892#if defined (FAILOVER_PROTOCOL)
1905 lt ->
uid = (
unsigned char *)0;
1909 lease_dereference (<,
MDL);
1920 struct lease *ltemp = NULL;
1921#define FREE_LEASES 0
1922#define ACTIVE_LEASES 1
1923#define EXPIRED_LEASES 2
1924#define ABANDONED_LEASES 3
1925#define BACKUP_LEASES 4
1926#define RESERVED_LEASES 5
1946#if defined (FAILOVER_PROTOCOL)
1979 lease_dereference(&
next,
MDL);
1982 lease_reference(&
next, ltemp,
MDL);
1999#if defined(FAILOVER_PROTOCOL)
2000 dhcp_failover_state_t *peer = NULL;
2009 ((peer->i_am == primary &&
2012 (peer->i_am == secondary &&
2026 lease_dereference(&
next,
MDL);
2060 unsigned len,
const char *
file,
int line)
2068 const unsigned char *hwaddr,
unsigned hwlen,
2136 struct lease *head = NULL;
2137 struct lease *cand = NULL;
2153 lease_reference(&cand, head,
MDL);
2154 while (cand != NULL) {
2155 if (client_lease_preferred(cand,
lease))
2159 lease_dereference(&
prev,
MDL);
2160 lease_reference(&
prev, cand,
MDL);
2162 if (cand->
n_uid != NULL)
2165 lease_dereference(&cand,
MDL);
2168 lease_reference(&cand,
next,
MDL);
2169 lease_dereference(&
next,
MDL);
2190 lease_dereference(&
prev,
MDL);
2194 lease_dereference(&cand,
MDL);
2195 lease_dereference(&head,
MDL);
2217 if (head ==
lease) {
2230 for (scan = head; scan ->
n_uid; scan = scan ->
n_uid) {
2232 lease_dereference (&scan ->
n_uid,
MDL);
2234 lease_reference (&scan ->
n_uid,
2243 lease_dereference (&head,
MDL);
2253 struct lease *head = NULL;
2254 struct lease *cand = NULL;
2280 lease_reference(&cand, head,
MDL);
2281 while (cand != NULL) {
2282 if (client_lease_preferred(cand,
lease))
2286 lease_dereference(&
prev,
MDL);
2287 lease_reference(&
prev, cand,
MDL);
2289 if (cand->
n_hw != NULL)
2292 lease_dereference(&cand,
MDL);
2295 lease_reference(&cand,
next,
MDL);
2296 lease_dereference(&
next,
MDL);
2320 lease_dereference(&
prev,
MDL);
2324 lease_dereference(&cand,
MDL);
2325 lease_dereference(&head,
MDL);
2356 if (head ==
lease) {
2371 while (head ->
n_hw) {
2373 lease_dereference (&head ->
n_hw,
MDL);
2375 lease_reference (&head ->
n_hw,
2383 lease_dereference (&head,
MDL);
2384 lease_reference (&head,
next,
MDL);
2385 lease_dereference (&
next,
MDL);
2389 lease_dereference (&head,
MDL);
2398 int num_written = 0, i;
2414#if !defined (DEBUG_DUMP_ALL_LEASES)
2428 log_info (
"Wrote %d leases to leases file.", num_written);
2448 for (cp = colp->
classes ; cp ; cp = cp->
nic) {
2450 (
unsigned char *)cp->
name,
2456 log_info (
"Wrote %d class decls to leases file.",
2466 hb; hb = hb ->
next) {
2477 log_info (
"Wrote %d group decls to leases file.", num_written);
2485 hb; hb = hb -> next) {
2495 log_info (
"Wrote %d deleted host decls to leases file.",
2504 hb; hb = hb -> next) {
2512 log_info (
"Wrote %d new dynamic host decls to leases file.",
2516#if defined (FAILOVER_PROTOCOL)
2540#if !defined (BINARY_LEASES)
2543 struct lease *lp, *ln = NULL;
2556 lease_reference(&lp, *lq,
MDL);
2557 lease_dereference(lq,
MDL);
2562 lease_reference(&ln, lp->
next,
MDL);
2563 lease_dereference(&lp->
next,
MDL);
2567 lease_dereference(&lp,
MDL);
2572 }
while (lp != NULL);
2586 for (lp = *lq; lp != NULL; lp = lp->
next) {
2593 log_fatal(
"Lease with binding state %s not on its queue.",
2604 lease_dereference (&comp->
next,
MDL);
2607 lease_dereference(lq,
MDL);
2609 lease_reference(lq, comp->
next,
MDL);
2610 lease_dereference(&comp->
next,
MDL);
2622 static struct lease **last_lq = NULL;
2623 static struct lease *last_insert_point = NULL;
2630 if ((server_starting &
SS_QFOLLOW) && (lq == last_lq) &&
2631 (comp != last_insert_point) &&
2633 prev = last_insert_point;
2641 for (; lp != NULL ; lp = lp->
next) {
2655 lease_reference (&comp->
next, *lq,
MDL);
2656 lease_dereference(lq,
MDL);
2658 lease_reference(lq, comp,
MDL);
2660 last_insert_point = comp;
2700 lq = &comp ->
pool -> active;
2707 lq = &comp ->
pool -> expired;
2708#if defined(FAILOVER_PROTOCOL)
2732 lq = &comp ->
pool -> abandoned;
2747 log_error (
"Lease with bogus binding state: %d",
2749#if defined (BINDING_STATE_DEBUG)
2768 struct class *
class;
2778#if defined (FAILOVER_PROTOCOL)
2809 if (
lease -> hardware_addr.hlen) {
2814 if (
lease -> billing_class) {
2815 class = (struct
class *)0;
2816 class_reference (&
class,
lease -> billing_class,
MDL);
2817 class_dereference (&
lease -> billing_class,
MDL);
2825 class_dereference (&
class,
MDL);
2846#if defined (BINARY_LEASES)
2853 for (p = s ->
pools; p != NULL; p = p ->
next) {
2854 size_t num_f = 100, num_a = 50, num_e = 20;
2882 for (p = s ->
pools; p; p = p ->
next) {
2885 p -> lease_count = 0;
2886 p -> free_leases = 0;
2887 p -> backup_leases = 0;
2916#if defined (FAILOVER_PROTOCOL)
2917 if (p -> failover_peer &&
2930 server_starting = 0;
2943 for (n =
subnets; n; n = n -> next_subnet) {
2951 for (p = s ->
pools; p; p = p ->
next) {
2973 lease_reference, lease_dereference,
do_id_hash)
2979#if defined (DEBUG_MEMORY_LEAKAGE) && \
2980 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
2993#if defined (COMPACT_LEASES)
2994extern struct lease *lease_hunks;
2997void free_everything(
void)
3002 struct pool *pc = (
struct pool *)0, *pn = (
struct pool *)0;
3003 struct lease *
lc = NULL, *ln = NULL, *ltemp = NULL;
3006 struct class *cc = (
struct class *)0, *cn = (
struct class *)0;
3043 auth_key_free_hash_table (&auth_key_hash,
MDL);
3055 class_reference (&cc, cn,
MDL);
3056 class_dereference (&cn,
MDL);
3059 class_reference (&cn, cc -> nic,
MDL);
3060 class_dereference (&cc -> nic,
MDL);
3064 class_free_hash_table (&cc -> hash,
MDL);
3067 class_dereference (&cc,
MDL);
3069 class_dereference (&lp -> classes,
MDL);
3086 interface_reference (&ic, in,
MDL);
3087 interface_dereference (&in,
MDL);
3090 interface_reference (&in, ic -> next,
MDL);
3091 interface_dereference (&ic -> next,
MDL);
3096 interface_dereference
3100 interface_dereference (&ic,
MDL);
3110 subnet_reference (&sc, sn,
MDL);
3111 subnet_dereference (&sn,
MDL);
3113 if (sc -> next_subnet) {
3114 subnet_reference (&sn, sc -> next_subnet,
MDL);
3115 subnet_dereference (&sc -> next_subnet,
MDL);
3117 if (sc -> next_sibling)
3118 subnet_dereference (&sc -> next_sibling,
MDL);
3122 if (sc -> interface)
3123 interface_dereference (&sc -> interface,
MDL);
3124 subnet_dereference (&sc,
MDL);
3142 shared_network_reference (&nc, nn,
MDL);
3143 shared_network_dereference (&nn,
MDL);
3146 shared_network_reference (&nn, nc -> next,
MDL);
3147 shared_network_dereference (&nc -> next,
MDL);
3152 pool_reference (&pn, nc ->
pools,
MDL);
3157 pool_reference (&pc, pn,
MDL);
3158 pool_dereference (&pn,
MDL);
3161 pool_reference (&pn, pc -> next,
MDL);
3162 pool_dereference (&pc -> next,
MDL);
3178 lease_reference (&lc, ln,
MDL);
3179 lease_dereference (&ln,
MDL);
3183 if (ltemp != NULL) {
3184 lease_reference(&ln, ltemp,
MDL);
3190 if (lc -> billing_class)
3191 class_dereference (&lc -> billing_class,
3197 lease_dereference (&lc -> n_hw,
MDL);
3199 lease_dereference (&lc -> n_uid,
MDL);
3200 lease_dereference (&lc,
MDL);
3209 pool_dereference (&pc,
MDL);
3211 pool_dereference (&nc ->
pools,
MDL);
3216 shared_network_dereference (&nc,
MDL);
3223#if defined(DELAYED_ACK)
3224 relinquish_ackqueue();
3249 option_name_free_hash_table(
3253 option_code_free_hash_table(
3257 if (
universes [i] -> name > (
char *)&end) {
3268 relinquish_free_lease_states ();
3269 relinquish_free_pairs ();
3270 relinquish_free_expressions ();
3271 relinquish_free_binding_values ();
3272 relinquish_free_option_caches ();
3273 relinquish_free_packets ();
3274#if defined(COMPACT_LEASES)
int group_dereference(struct group **ptr, const char *file, int line)
int buffer_allocate(struct buffer **ptr, unsigned len, const char *file, int line)
void data_string_forget(struct data_string *data, 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 executable_statement_reference(struct executable_statement **ptr, struct executable_statement *bp, const char *file, int line)
int binding_scope_reference(struct binding_scope **ptr, struct binding_scope *bp, const char *file, int line)
int option_chain_head_dereference(struct option_chain_head **ptr, const char *file, int line)
void add_timeout(struct timeval *when, void *where, void *what, tvref_t ref, tvunref_t unref)
struct option_cache * lookup_option(struct universe *universe, struct option_state *options, unsigned code)
struct collection * collections
int parse_warn(struct parse *cfile, const char *fmt,...)
void print_lease(struct lease *lease)
void print_hex_or_string(unsigned len, const u_int8_t *data, unsigned limit, char *buf)
#define FAILOVER_PROTOCOL
int write_host(struct host_decl *host)
isc_result_t find_class(struct class **c, const char *s, const char *file, int line)
void unbill_class(struct lease *lease)
int write_lease(struct lease *lease)
#define DHO_DHCP_CLIENT_IDENTIFIER
#define DHO_PXE_CLIENT_ID
void cancel_all_timeouts(void)
host_hash_t * host_hw_addr_hash
struct lease * new_leases(unsigned, const char *, int)
void(* tvunref_t)(void *, const char *, int)
#define INTERFACE_REQUESTED
int bill_class(struct lease *, struct class *)
struct hash_table lease_id_hash_t
#define HOST_DECL_DYNAMIC
void relinquish_timeouts(void)
int write_group(struct group_object *)
#define GROUP_OBJECT_DELETED
#define HOST_DECL_DELETED
lease_id_hash_t * lease_hw_addr_hash
omapi_object_type_t * dhcp_type_lease
struct shared_network * shared_networks
void free_lease_state(struct lease_state *, const char *, int)
#define LEASE_INSERTP(LQ, LEASE)
dhcp_control_object_t * dhcp_control_object
void(* tvref_t)(void *, void *, const char *, int)
u_int32_t abandon_lease_time
int find_lease_by_uid(struct lease **, const unsigned char *, unsigned, const char *, int)
struct ipv6_pool ** pools
lease_id_hash_t * lease_uid_hash
int lease_copy(struct lease **, struct lease *, const char *, int)
@ shutdown_drop_omapi_connections
void dhcp_failover_pool_check(struct pool *)
int find_grouped_subnet(struct subnet **, struct shared_network *, struct iaddr, const char *, int)
isc_result_t lease_instantiate(const void *, unsigned, void *)
host_hash_t * host_name_hash
int dhcp_failover_queue_update(struct lease *, int)
int find_lease_by_hw_addr(struct lease **, const unsigned char *, unsigned, const char *, int)
#define LEASE_REMOVEP(LQ, LEASE)
struct hash_table lease_ip_hash_t
host_hash_t * host_uid_hash
void lc_init_growth(struct leasechain *lc, size_t growth)
int dhcp_failover_write_all_states(void)
enum dhcp_shutdown_state shutdown_state
struct hash_table host_hash_t
struct executable_statement * default_classification_rules
#define GROUP_OBJECT_STATIC
struct universe dhcp_universe
isc_result_t unlink_class(struct class **class)
int subnet_inner_than(const struct subnet *, const struct subnet *, int)
#define GROUP_OBJECT_DYNAMIC
int find_lease_by_ip_addr(struct lease **, struct iaddr, const char *, int)
#define LEASE_NOT_EMPTYP(LQ)
int lease_enqueue(struct lease *)
struct hash_table class_hash_t
isc_result_t ddns_removals(struct lease *, struct iasubopt *, struct dhcp_ddns_cb *, isc_boolean_t)
#define CLASS_DECL_DELETED
isc_result_t dhcp_io_shutdown(omapi_object_t *, void *)
const char * binding_state_names[]
#define LEASE_GET_FIRSTP(LQ)
isc_result_t write_named_billing_class(const void *, unsigned, void *)
lease_ip_hash_t * lease_ip_addr_hash
omapi_object_type_t * dhcp_type_host
#define print_hex_1(len, data, limit)
#define LEASE_GET_NEXTP(LQ, LEASE)
void relinquish_lease_hunks(void)
struct interface_info * interfaces
struct interface_info ** interface_vector
dns_zone_hash_t * dns_zone_hash
int execute_statements(struct binding_value **result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *out_options, struct binding_scope **scope, struct executable_statement *statements, struct on_star *on_star)
int executable_statement_foreach(struct executable_statement *stmt, int(*callback)(struct executable_statement *, void *, int), void *vp, int condp)
int executable_statement_dereference(struct executable_statement **ptr, const char *file, int line)
const char * binding_state_print(enum failover_state state)
int hash_foreach(struct hash_table *, hash_foreach_func)
void relinquish_hash_bucket_hunks(void)
unsigned do_id_hash(const void *, unsigned, unsigned)
#define HASH_FUNCTIONS(name, bufarg, type, hashtype, ref, deref, hasher)
unsigned do_string_hash(const void *, unsigned, unsigned)
unsigned do_ip4_hash(const void *, unsigned, unsigned)
u_int32_t host_addr(struct iaddr addr, struct iaddr mask)
struct iaddr ip_addr(struct iaddr subnet, struct iaddr mask, u_int32_t host_address)
const char * piaddr(const struct iaddr addr)
int addr_eq(struct iaddr addr1, struct iaddr addr2)
struct iaddr subnet_number(struct iaddr addr, struct iaddr mask)
@ supersede_option_statement
int lease_enqueue(struct lease *comp)
int lease_copy(struct lease **lp, struct lease *lease, const char *file, int line)
void hw_hash_add(struct lease *lease)
int find_grouped_subnet(struct subnet **sp, struct shared_network *share, struct iaddr addr, const char *file, int line)
void lease_insert(struct lease **lq, struct lease *comp)
void hw_hash_delete(struct lease *lease)
void enter_subnet(struct subnet *subnet)
isc_result_t lease_instantiate(const void *key, unsigned len, void *object)
struct host_id_info host_id_info_t
void enter_lease(struct lease *lease)
int supersede_lease(struct lease *comp, struct lease *lease, int commit, int propogate, int pimmediate, int from_pool)
void uid_hash_add(struct lease *lease)
int find_hosts_by_uid(struct host_decl **hp, const unsigned char *data, unsigned len, const char *file, int line)
void new_address_range(struct parse *cfile, struct iaddr low, struct iaddr high, struct subnet *subnet, struct pool *pool, struct lease **lpchain)
isc_result_t enter_class(struct class *cd, int dynamicp, int commit)
void change_host_uid(struct host_decl *host, const char *uid, int len)
void lease_remove_all(struct lease **lq)
void enter_shared_network(struct shared_network *share)
int find_host_for_network(struct subnet **sp, struct host_decl **host, struct iaddr *addr, struct shared_network *share)
isc_result_t enter_host(struct host_decl *hd, int dynamicp, int commit)
void pool_timer(void *vpool)
int find_hosts_by_option(struct host_decl **hp, struct packet *packet, struct option_state *opt_state, const char *file, int line)
int find_lease_by_uid(struct lease **lp, const unsigned char *uid, unsigned len, const char *file, int line)
isc_result_t delete_class(struct class *cp, int commit)
int find_subnet(struct subnet **sp, struct iaddr addr, const char *file, int line)
int find_lease_by_hw_addr(struct lease **lp, const unsigned char *hwaddr, unsigned hwlen, const char *file, int line)
int find_lease_by_ip_addr(struct lease **lp, struct iaddr addr, const char *file, int line)
int find_hosts_by_haddr(struct host_decl **hp, int htype, const unsigned char *haddr, unsigned hlen, const char *file, int line)
void lease_remove(struct lease **lq, struct lease *comp)
void new_shared_network_interface(struct parse *cfile, struct shared_network *share, const char *name)
void uid_hash_delete(struct lease *lease)
isc_result_t delete_host(struct host_decl *hd, int commit)
int subnet_inner_than(const struct subnet *subnet, const struct subnet *scan, int warnp)
void release_lease(struct lease *lease, struct packet *packet)
void make_binding_state_transition(struct lease *lease)
void abandon_lease(struct lease *lease, const char *message)
struct group * root_group
group_hash_t * group_name_hash
struct __omapi_object_type_t omapi_object_type_t
isc_result_t omapi_object_dereference(omapi_object_t **, const char *, int)
isc_result_t omapi_unregister_io_object(omapi_object_t *)
struct __omapi_object omapi_object_t
isc_result_t omapi_io_state_foreach(isc_result_t(*func)(omapi_object_t *, void *), void *p)
calls a given function on every object
void omapi_type_relinquish(void)
void * dmalloc(size_t, const char *, int)
void dfree(void *, const char *, int)
isc_result_t omapi_object_initialize(omapi_object_t *, omapi_object_type_t *, size_t, size_t, const char *, int)
int log_error(const char *,...) __attribute__((__format__(__printf__
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
void log_fatal(const char *,...) __attribute__((__format__(__printf__
int int log_info(const char *,...) __attribute__((__format__(__printf__
#define DHCP_R_INVALIDARG
struct class * superclass
struct data_string hash_string
const unsigned char * data
enum executable_statement::statement_op op
union executable_statement::@336221350347175166011011356261373334214214051201 data
struct option_cache * option
struct executable_statement * statements
u_int8_t hbuf[HARDWARE_ADDR_LEN+1]
struct option_cache * fixed_addr
struct data_string client_identifier
struct data_string host_id
struct option * host_id_option
struct host_decl * n_ipaddr
struct hardware interface
struct host_id_info * next
host_hash_t * values_hash
struct interface_info * next
binding_state_t next_binding_state
struct dhcp_ddns_cb * ddns_cb
struct binding_scope * scope
struct hardware hardware_addr
binding_state_t rewind_binding_state
binding_state_t desired_binding_state
struct class * billing_class
binding_state_t binding_state
struct executable_statement * on_commit
struct executable_statement * on_expiry
struct executable_statement * on_release
struct universe * universe
struct packet * dhcpv6_container_packet
struct option_state * options
dhcp_failover_state_t * failover_peer
struct shared_network * next
struct subnet * next_subnet
struct subnet * next_sibling
int option_reference(struct option **dest, struct option *src, const char *file, int line)
int option_dereference(struct option **dest, const char *file, int line)
universe_hash_t * universe_hash
struct universe ** universes
void trace_free_all(void)
int binding_scope_dereference(struct binding_scope **ptr, const char *file, int line)
int evaluate_option_cache(struct data_string *result, struct packet *packet, struct lease *lease, struct client_state *client_state, struct option_state *in_options, struct option_state *cfg_options, struct binding_scope **scope, struct option_cache *oc, const char *file, int line)
struct binding_scope * global_scope