170 #include <sys/types.h> 172 #include <netinet/in.h> 201 struct iasubopt *tmp;
203 if (iasubopt == NULL) {
204 log_error(
"%s(%d): NULL pointer reference", file, line);
207 if (*iasubopt != NULL) {
208 log_error(
"%s(%d): non-NULL pointer", file, line);
212 tmp =
dmalloc(
sizeof(*tmp), file, line);
214 return ISC_R_NOMEMORY;
223 return ISC_R_SUCCESS;
235 if (iasubopt == NULL) {
236 log_error(
"%s(%d): NULL pointer reference", file, line);
239 if (*iasubopt != NULL) {
240 log_error(
"%s(%d): non-NULL pointer", file, line);
244 log_error(
"%s(%d): NULL pointer reference", file, line);
249 return ISC_R_SUCCESS;
261 struct iasubopt *tmp;
263 if ((iasubopt == NULL) || (*iasubopt == NULL)) {
264 log_error(
"%s(%d): NULL pointer", file, line);
273 log_error(
"%s(%d): negative refcnt", file, line);
277 if (tmp->
ia != NULL) {
283 if (tmp->
scope != NULL) {
300 dfree(tmp, file, line);
303 return ISC_R_SUCCESS;
311 const char *duid,
unsigned int duid_len,
314 memset(key, 0,
sizeof(*key));
315 key->
len = duid_len +
sizeof(iaid);
317 return ISC_R_NOMEMORY;
320 memcpy((
char *)key->
data, &iaid,
sizeof(iaid));
321 memcpy((
char *)key->
data +
sizeof(iaid), duid, duid_len);
323 return ISC_R_SUCCESS;
339 const char *duid,
unsigned int duid_len,
344 log_error(
"%s(%d): NULL pointer reference", file, line);
348 log_error(
"%s(%d): non-NULL pointer", file, line);
352 tmp =
dmalloc(
sizeof(*tmp), file, line);
354 return ISC_R_NOMEMORY;
358 duid, duid_len, file, line) != ISC_R_SUCCESS) {
359 dfree(tmp, file, line);
360 return ISC_R_NOMEMORY;
366 return ISC_R_SUCCESS;
379 log_error(
"%s(%d): NULL pointer reference", file, line);
383 log_error(
"%s(%d): non-NULL pointer", file, line);
387 log_error(
"%s(%d): NULL pointer reference", file, line);
392 return ISC_R_SUCCESS;
406 if ((ia == NULL) || (*ia == NULL)) {
407 log_error(
"%s(%d): NULL pointer", file, line);
416 log_error(
"%s(%d): negative refcnt", file, line);
428 dfree(tmp, file, line);
430 return ISC_R_SUCCESS;
441 struct iasubopt **
new;
452 new =
dmalloc(max *
sizeof(
struct iasubopt *), file, line);
454 return ISC_R_NOMEMORY;
466 return ISC_R_SUCCESS;
478 if (ia == NULL || iasubopt == NULL)
496 log_error(
"%s(%d): IAADDR/PREFIX not in IA", file, line);
568 sizeof(
struct in6_addr)) == 0) {
589 lease_older(
void *a,
void *b) {
607 lease_index_changed(
void *
iasubopt,
unsigned int new_heap_index) {
636 const struct in6_addr *start_addr,
int bits,
637 int units,
const char *
file,
int line) {
641 log_error(
"%s(%d): NULL pointer reference", file, line);
645 log_error(
"%s(%d): non-NULL pointer", file, line);
649 tmp =
dmalloc(
sizeof(*tmp), file, line);
651 return ISC_R_NOMEMORY;
660 dfree(tmp, file, line);
661 return ISC_R_NOMEMORY;
665 iasubopt_free_hash_table(&(tmp->
leases), file, line);
666 dfree(tmp, file, line);
667 return ISC_R_NOMEMORY;
672 iasubopt_free_hash_table(&(tmp->
leases), file, line);
673 dfree(tmp, file, line);
674 return ISC_R_NOMEMORY;
678 return ISC_R_SUCCESS;
704 log_error(
"%s(%d): NULL pointer reference", file, line);
708 log_error(
"%s(%d): non-NULL pointer", file, line);
712 log_error(
"%s(%d): NULL pointer reference", file, line);
717 return ISC_R_SUCCESS;
734 dereference_hash_entry(
const void *name,
unsigned len,
void *value) {
738 return ISC_R_SUCCESS;
746 dereference_heap_entry(
void *value,
void *dummy) {
775 if ((pool == NULL) || (*pool == NULL)) {
776 log_error(
"%s(%d): NULL pointer", file, line);
785 log_error(
"%s(%d): negative refcnt", file, line);
789 iasubopt_hash_foreach(tmp->
leases, dereference_hash_entry);
790 iasubopt_free_hash_table(&(tmp->
leases), file, line);
792 dereference_heap_entry, NULL);
795 dereference_heap_entry, NULL);
797 dfree(tmp, file, line);
800 return ISC_R_SUCCESS;
808 build_address6(
struct in6_addr *addr,
809 const struct in6_addr *net_start_addr,
int net_bits,
823 isc_md5_update(&ctx, input->
data, input->
len);
824 isc_md5_final(&ctx, (
unsigned char *)addr);
830 net_str = (
const char *)net_start_addr;
831 net_bytes = net_bits / 8;
832 for (i = 0; i < net_bytes; i++) {
835 switch (net_bits % 8) {
836 case 1: str[i] = (str[i] & 0x7F) | (net_str[i] & 0x80);
break;
837 case 2: str[i] = (str[i] & 0x3F) | (net_str[i] & 0xC0);
break;
838 case 3: str[i] = (str[i] & 0x1F) | (net_str[i] & 0xE0);
break;
839 case 4: str[i] = (str[i] & 0x0F) | (net_str[i] & 0xF0);
break;
840 case 5: str[i] = (str[i] & 0x07) | (net_str[i] & 0xF8);
break;
841 case 6: str[i] = (str[i] & 0x03) | (net_str[i] & 0xFC);
break;
842 case 7: str[i] = (str[i] & 0x01) | (net_str[i] & 0xFE);
break;
859 build_temporary6(
struct in6_addr *addr,
860 const struct in6_addr *net_start_addr,
int net_bits,
862 static u_int32_t history[2];
863 static u_int32_t counter = 0;
865 unsigned char md[16];
872 isc_random_get(&history[0]);
873 isc_random_get(&history[1]);
880 isc_md5_update(&ctx, (
unsigned char *)&history[0], 8UL);
881 isc_md5_update(&ctx, input->
data, input->
len);
882 isc_md5_final(&ctx, md);
887 if (net_bits == 64) {
888 memcpy(&addr->s6_addr[0], &net_start_addr->s6_addr[0], 8);
889 memcpy(&addr->s6_addr[8], md, 8);
890 addr->s6_addr[8] &= ~0x02;
901 net_str = (
const char *)net_start_addr;
902 net_bytes = net_bits / 8;
903 for (i = 0; i < net_bytes; i++) {
906 memcpy(str + net_bytes, md, 16 - net_bytes);
907 switch (net_bits % 8) {
908 case 1: str[i] = (str[i] & 0x7F) | (net_str[i] & 0x80);
break;
909 case 2: str[i] = (str[i] & 0x3F) | (net_str[i] & 0xC0);
break;
910 case 3: str[i] = (str[i] & 0x1F) | (net_str[i] & 0xE0);
break;
911 case 4: str[i] = (str[i] & 0x0F) | (net_str[i] & 0xF0);
break;
912 case 5: str[i] = (str[i] & 0x07) | (net_str[i] & 0xF8);
break;
913 case 6: str[i] = (str[i] & 0x03) | (net_str[i] & 0xFC);
break;
914 case 7: str[i] = (str[i] & 0x01) | (net_str[i] & 0xFE);
break;
922 memcpy((
unsigned char *)&history[0], md + 8, 8);
927 static struct in6_addr rtany;
929 static struct in6_addr resany;
954 unsigned int *attempts,
955 const struct data_string *uid, time_t soft_lifetime_end_time) {
962 isc_boolean_t reserved_iid;
963 static isc_boolean_t init_resiid = ISC_FALSE;
969 memset(&rtany, 0, 16);
970 memset(&resany, 0, 8);
971 resany.s6_addr[8] = 0xfd;
972 memset(&resany.s6_addr[9], 0xff, 6);
973 init_resiid = ISC_TRUE;
979 memset(&ds, 0,
sizeof(ds));
987 if (++(*attempts) > 100) {
989 return ISC_R_NORESOURCES;
1008 log_error(
"create_lease6: prefix pool.");
1011 log_error(
"create_lease6: untyped pool.");
1018 reserved_iid = ISC_FALSE;
1019 if (memcmp(&tmp.s6_addr[8], &rtany.s6_addr[8], 8) == 0) {
1020 reserved_iid = ISC_TRUE;
1022 if (!reserved_iid &&
1023 (memcmp(&tmp.s6_addr[8], &resany.s6_addr[8], 7) == 0) &&
1024 ((tmp.s6_addr[15] & 0x80) == 0x80)) {
1025 reserved_iid = ISC_TRUE;
1032 if (!reserved_iid &&
1033 (iasubopt_hash_lookup(&test_iaaddr, pool->
leases,
1034 &tmp,
sizeof(tmp),
MDL) == 0)) {
1037 if (test_iaaddr != NULL)
1043 memset(&new_ds, 0,
sizeof(new_ds));
1044 new_ds.
len = ds.
len +
sizeof(tmp);
1047 return ISC_R_NOMEMORY;
1064 result = iasubopt_allocate(&iaaddr,
MDL);
1065 if (result != ISC_R_SUCCESS) {
1069 memcpy(&iaaddr->
addr, &tmp,
sizeof(iaaddr->
addr));
1074 result =
add_lease6(pool, iaaddr, soft_lifetime_end_time);
1075 if (result == ISC_R_SUCCESS) {
1129 struct iasubopt *test_iasubopt, *tmp_iasubopt;
1130 struct ia_xx *old_ia;
1131 isc_result_t status = ISC_R_SUCCESS;
1133 test_iasubopt = NULL;
1140 if (iasubopt_hash_lookup(&test_iasubopt, pool->
leases,
1143 return (ISC_R_SUCCESS);
1146 if (test_iasubopt->
ia == NULL) {
1182 status = ISC_R_FAILURE;
1192 iasubopt_hash_delete(pool->
leases, &test_iasubopt->
addr,
1193 sizeof(test_iasubopt->
addr),
MDL);
1196 ia_hash_delete(ia_table,
1206 tmp_iasubopt = test_iasubopt;
1227 time_t valid_lifetime_end_time) {
1228 isc_result_t insert_result;
1233 if (lease->
state == 0)
1242 test_iasubopt = NULL;
1243 if (iasubopt_hash_lookup(&test_iasubopt, pool->
leases,
1262 iasubopt_hash_delete(pool->
leases, &test_iasubopt->
addr,
1263 sizeof(test_iasubopt->
addr),
MDL);
1273 tmp_iasubopt = test_iasubopt;
1281 tmp_iasubopt = NULL;
1286 iasubopt_hash_add(pool->
leases, &tmp_iasubopt->
addr,
1287 sizeof(tmp_iasubopt->
addr), lease,
MDL);
1290 if (insert_result == ISC_R_SUCCESS)
1296 if (insert_result == ISC_R_SUCCESS)
1299 if (insert_result != ISC_R_SUCCESS) {
1300 iasubopt_hash_delete(pool->
leases, &lease->
addr,
1303 return insert_result;
1311 return ISC_R_SUCCESS;
1322 if (iasubopt_hash_lookup(&test_iaaddr, pool->
leases,
1323 (
void *)addr,
sizeof(*addr),
MDL)) {
1348 isc_boolean_t status = ISC_TRUE;
1352 (
void *)&lease->
addr,
1354 if (test_iaaddr != lease) {
1368 isc_result_t insert_result;
1373 if (insert_result == ISC_R_SUCCESS) {
1374 iasubopt_hash_add(pool->
leases, &lease->
addr,
1375 sizeof(lease->
addr), lease,
MDL);
1381 return insert_result;
1428 return ISC_R_SUCCESS;
1430 char tmp_addr[INET6_ADDRSTRLEN];
1433 log_info(
"Reclaiming previously abandoned address %s",
1434 inet_ntop(AF_INET6, &(lease->
addr), tmp_addr,
1436 return ISC_R_SUCCESS;
1438 return move_lease_to_active(pool, lease);
1448 isc_result_t insert_result;
1453 if (insert_result == ISC_R_SUCCESS) {
1486 #if defined (NSUPDATE) 1496 if (lease->
scope != NULL) {
1500 iasubopt_hash_delete(pool->
leases,
1507 return insert_result;
1523 isc_result_t result;
1525 if (leasep == NULL) {
1529 if (*leasep != NULL) {
1538 result = move_lease_to_inactive(pool, tmp,
1540 if (result == ISC_R_SUCCESS) {
1546 return ISC_R_SUCCESS;
1556 isc_result_t result;
1560 result = move_lease_to_active(pool, lease);
1561 if (result != ISC_R_SUCCESS) {
1568 return ISC_R_SUCCESS;
1577 return move_lease_to_inactive(pool, lease,
FTS_RELEASED);
1579 return ISC_R_SUCCESS;
1589 const struct in6_addr *net_start_pref,
1590 int pool_bits,
int pref_bits,
1596 const char *net_str;
1604 isc_md5_update(&ctx, input->
data, input->
len);
1605 isc_md5_final(&ctx, (
unsigned char *)pref);
1611 net_str = (
const char *)net_start_pref;
1612 net_bytes = pool_bits / 8;
1613 for (i = 0; i < net_bytes; i++) {
1614 str[i] = net_str[i];
1617 switch (pool_bits % 8) {
1618 case 1: str[i] = (str[i] & 0x7F) | (net_str[i] & 0x80);
break;
1619 case 2: str[i] = (str[i] & 0x3F) | (net_str[i] & 0xC0);
break;
1620 case 3: str[i] = (str[i] & 0x1F) | (net_str[i] & 0xE0);
break;
1621 case 4: str[i] = (str[i] & 0x0F) | (net_str[i] & 0xF0);
break;
1622 case 5: str[i] = (str[i] & 0x07) | (net_str[i] & 0xF8);
break;
1623 case 6: str[i] = (str[i] & 0x03) | (net_str[i] & 0xFC);
break;
1624 case 7: str[i] = (str[i] & 0x01) | (net_str[i] & 0xFE);
break;
1629 net_bytes = pref_bits / 8;
1630 for (i=net_bytes+1; i<16; i++) {
1634 switch (pref_bits % 8) {
1635 case 0: str[i] &= 0;
break;
1636 case 1: str[i] &= 0x80;
break;
1637 case 2: str[i] &= 0xC0;
break;
1638 case 3: str[i] &= 0xE0;
break;
1639 case 4: str[i] &= 0xF0;
break;
1640 case 5: str[i] &= 0xF8;
break;
1641 case 6: str[i] &= 0xFC;
break;
1642 case 7: str[i] &= 0xFE;
break;
1669 unsigned int *attempts,
1673 struct in6_addr tmp;
1677 isc_result_t result;
1682 memset(&ds, 0,
sizeof(ds));
1690 if (++(*attempts) > 10) {
1692 return ISC_R_NORESOURCES;
1705 if (iasubopt_hash_lookup(&test_iapref, pool->
leases,
1706 &tmp,
sizeof(tmp),
MDL) == 0) {
1714 memset(&new_ds, 0,
sizeof(new_ds));
1715 new_ds.
len = ds.
len +
sizeof(tmp);
1718 return ISC_R_NOMEMORY;
1735 result = iasubopt_allocate(&iapref,
MDL);
1736 if (result != ISC_R_SUCCESS) {
1740 memcpy(&iapref->
addr, &tmp,
sizeof(iapref->
addr));
1745 result =
add_lease6(pool, iapref, soft_lifetime_end_time);
1746 if (result == ISC_R_SUCCESS) {
1758 const struct in6_addr *pref, u_int8_t
plen) {
1761 if ((
int)plen != pool->
units)
1765 if (iasubopt_hash_lookup(&test_iapref, pool->
leases,
1766 (
void *)pref,
sizeof(*pref),
MDL)) {
1782 isc_result_t result;
1784 dummy_iasubopt = NULL;
1785 result = iasubopt_allocate(&dummy_iasubopt,
MDL);
1786 if (result == ISC_R_SUCCESS) {
1788 iasubopt_hash_add(pool->
leases, &dummy_iasubopt->
addr,
1789 sizeof(*addr), dummy_iasubopt,
MDL);
1802 if (new_pools == NULL) {
1803 return ISC_R_NOMEMORY;
1807 memcpy(new_pools, pools,
1816 return ISC_R_SUCCESS;
1820 cleanup_old_expired(
struct ipv6_pool *pool) {
1823 struct ia_xx *ia_active;
1824 unsigned char *tmpd;
1843 if (tmp->
ia != NULL) {
1856 (ia_hash_lookup(&ia_active, ia_na_active, tmpd,
1858 (ia_active == ia)) {
1859 ia_hash_delete(ia_na_active, tmpd,
1864 (ia_hash_lookup(&ia_active, ia_ta_active, tmpd,
1866 (ia_active == ia)) {
1867 ia_hash_delete(ia_ta_active, tmpd,
1872 (ia_hash_lookup(&ia_active, ia_pd_active, tmpd,
1874 (ia_active == ia)) {
1875 ia_hash_delete(ia_pd_active, tmpd,
1885 lease_timeout_support(
void *vpool) {
1907 if (lease == NULL) {
1926 cleanup_old_expired(pool);
1942 time_t next_timeout;
1964 if (timeout < next_timeout) {
1965 next_timeout = timeout;
1970 tv.tv_sec = next_timeout;
2000 ipv6_network_portion(
struct in6_addr *result,
2001 const struct in6_addr *
addr,
int bits) {
2002 unsigned char *addrp;
2008 static const unsigned char bitmasks[] = {
2009 0x00, 0xFE, 0xFC, 0xF8,
2010 0xF0, 0xE0, 0xC0, 0x80,
2016 if ((bits < 0) || (bits > 128)) {
2017 log_fatal(
"ipv6_network_portion: bits %d not between 0 and 128",
2025 addrp = ((
unsigned char *)result) + 15;
2030 mask_bits = 128 - bits;
2031 bytes = mask_bits / 8;
2032 extra_bits = mask_bits % 8;
2034 for (i=0; i<bytes; i++) {
2039 *addrp &= bitmasks[extra_bits];
2048 struct in6_addr tmp;
2050 ipv6_network_portion(&tmp, addr, pool->
bits);
2051 if (memcmp(&tmp, &pool->
start_addr,
sizeof(tmp)) == 0) {
2066 const struct in6_addr *addr) {
2073 if (*pool != NULL) {
2079 if (pools[i]->pool_type != type)
2083 return ISC_R_SUCCESS;
2086 return ISC_R_NOTFOUND;
2094 change_leases(
struct ia_xx *ia,
2095 isc_result_t (*change_func)(
struct ipv6_pool *,
2097 isc_result_t retval;
2098 isc_result_t renew_retval;
2100 struct in6_addr *addr;
2103 retval = ISC_R_SUCCESS;
2108 addr) == ISC_R_SUCCESS) {
2109 renew_retval = change_func(pool, ia->
iasubopt[i]);
2110 if (renew_retval != ISC_R_SUCCESS) {
2111 retval = renew_retval;
2150 static int write_error;
2153 write_ia_leases(
const void *name,
unsigned len,
void *value) {
2161 return ISC_R_SUCCESS;
2173 nas = ia_hash_foreach(ia_na_active, write_ia_leases);
2177 tas = ia_hash_foreach(ia_ta_active, write_ia_leases);
2181 pds = ia_hash_foreach(ia_pd_active, write_ia_leases);
2186 log_info(
"Wrote %d NA, %d TA, %d PD leases to lease file.",
2193 mark_hosts_unavailable_support(
const void *name,
unsigned len,
void *value) {
2196 struct in6_addr addr;
2205 return ISC_R_SUCCESS;
2211 memset(&fixed_addr, 0,
sizeof(fixed_addr));
2215 "error evaluating host address.");
2216 return ISC_R_SUCCESS;
2218 if (fixed_addr.
len != 16) {
2220 "host address is not 128 bits.");
2221 return ISC_R_SUCCESS;
2223 memcpy(&addr, fixed_addr.
data, 16);
2241 return ISC_R_SUCCESS;
2250 mark_phosts_unavailable_support(
const void *
name,
unsigned len,
void *value) {
2253 struct in6_addr pref;
2262 return ISC_R_SUCCESS;
2291 return ISC_R_SUCCESS;
2306 while (ip != NULL) {
2348 log_error(
"%s(%d): NULL pointer reference", file, line);
2351 if (*pond != NULL) {
2352 log_error(
"%s(%d): non-NULL pointer", file, line);
2356 tmp =
dmalloc(
sizeof(*tmp), file, line);
2358 return ISC_R_NOMEMORY;
2364 return ISC_R_SUCCESS;
2390 log_error(
"%s(%d): NULL pointer reference", file, line);
2393 if (*pond != NULL) {
2394 log_error(
"%s(%d): non-NULL pointer", file, line);
2398 log_error(
"%s(%d): NULL pointer reference", file, line);
2403 return ISC_R_SUCCESS;
2430 if ((pond == NULL) || (*pond == NULL)) {
2431 log_error(
"%s(%d): NULL pointer", file, line);
2440 log_error(
"%s(%d): negative refcnt", file, line);
2444 dfree(tmp, file, line);
2447 return ISC_R_SUCCESS;
struct iaddrcidrnet cidrnet
void mark_interfaces_unavailable(void)
isc_boolean_t lease6_usable(struct iasubopt *lease)
Check if address is available to a lease.
isc_result_t mark_lease_unavailable(struct ipv6_pool *pool, const struct in6_addr *addr)
struct binding_scope * global_scope
isc_boolean_t prefix6_exists(const struct ipv6_pool *pool, const struct in6_addr *pref, u_int8_t plen)
int executable_statement_dereference(struct executable_statement **ptr, const char *file, int line)
isc_result_t create_prefix6(struct ipv6_pool *pool, struct iasubopt **pref, unsigned int *attempts, const struct data_string *uid, time_t soft_lifetime_end_time)
void * dmalloc(unsigned, const char *, int)
isc_result_t renew_lease6(struct ipv6_pool *pool, struct iasubopt *lease)
Renew a lease in the pool.
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)
isc_result_t ia_make_key(struct data_string *key, u_int32_t iaid, const char *duid, unsigned int duid_len, const char *file, int line)
isc_result_t iasubopt_dereference(struct iasubopt **iasubopt, const char *file, int line)
dhcp_context_t dhcp_gbl_ctx
#define DHCP_R_INVALIDARG
isc_result_t find_ipv6_pool(struct ipv6_pool **pool, u_int16_t type, const struct in6_addr *addr)
void build_prefix6(struct in6_addr *pref, const struct in6_addr *net_start_pref, int pool_bits, int pref_bits, const struct data_string *input)
struct executable_statement * on_release
isc_result_t ia_dereference(struct ia_xx **ia, const char *file, int line)
void data_string_forget(struct data_string *data, const char *file, int line)
isc_result_t ia_add_iasubopt(struct ia_xx *ia, struct iasubopt *iasubopt, const char *file, int line)
struct in6_addr start_addr
struct option_cache * fixed_addr
int log_error(const char *,...) __attribute__((__format__(__printf__
isc_result_t release_leases(struct ia_xx *ia)
int binding_scope_dereference(struct binding_scope **ptr, const char *file, int line)
struct binding_scope * scope
void add_timeout(struct timeval *when, void(*)(void *) where, void *what, tvref_t ref, tvunref_t unref)
void(* tvunref_t)(void *, const char *, int)
void ia_remove_all_lease(struct ia_xx *ia, const char *file, int line)
isc_result_t ipv6_pool_allocate(struct ipv6_pool **pool, u_int16_t type, const struct in6_addr *start_addr, int bits, int units, const char *file, int line)
Create a new IPv6 lease pool structure.
#define EXPIRED_IPV6_CLEANUP_TIME
isc_result_t isc_heap_create(isc_heapcompare_t compare, isc_heapindex_t index, unsigned int size_increment, isc_heap_t **heapp)
Create a new heap. The heap is implemented using a space-efficient storage method. When the heap elements are deleted space is not freed but will be reused when new elements are inserted.
void(* tvref_t)(void *, void *, const char *, int)
isc_result_t ia_allocate(struct ia_xx **ia, u_int32_t iaid, const char *duid, unsigned int duid_len, const char *file, int line)
void log_fatal(const char *,...) __attribute__((__format__(__printf__
isc_result_t create_lease6(struct ipv6_pool *pool, struct iasubopt **addr, unsigned int *attempts, const struct data_string *uid, time_t soft_lifetime_end_time)
isc_boolean_t lease6_exists(const struct ipv6_pool *pool, const struct in6_addr *addr)
void isc_heap_decreased(isc_heap_t *heap, unsigned int index)
Indicates to the heap that an element's priority has decreased. This function MUST be called whenever...
time_t hard_lifetime_end_time
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)
host_hash_t * host_name_hash
unsigned do_string_hash(const void *, unsigned, unsigned)
struct ipv6_pool * ipv6_pool
int buffer_allocate(struct buffer **ptr, unsigned len, const char *file, int line)
isc_result_t ipv6_pond_allocate(struct ipv6_pond **pond, const char *file, int line)
Create a new IPv6 pond structure.
int write_server_duid(void)
struct iaddrcidrnetlist * next
isc_boolean_t ia_equal(const struct ia_xx *a, const struct ia_xx *b)
struct data_string iaid_duid
void dfree(void *, const char *, int)
void isc_heap_foreach(isc_heap_t *heap, isc_heapaction_t action, void *uap)
Iterate over the heap, calling an action for each element. The order of iteration is not sorted...
isc_result_t renew_leases(struct ia_xx *ia)
isc_result_t decline_leases(struct ia_xx *ia)
int int log_info(const char *,...) __attribute__((__format__(__printf__
struct interface_info * interfaces
isc_result_t ipv6_pool_dereference(struct ipv6_pool **pool, const char *file, int line)
de-reference an IPv6 pool structure.
isc_result_t ipv6_pool_reference(struct ipv6_pool **pool, struct ipv6_pool *src, const char *file, int line)
reference an IPv6 pool structure.
#define DEFAULT_HASH_SIZE
void isc_heap_destroy(isc_heap_t **heapp)
Destroys a heap.
struct iaddrcidrnetlist * fixed_prefix
isc_result_t ddns_removals(struct lease *, struct iasubopt *, struct dhcp_ddns_cb *, isc_boolean_t)
int commit_leases_timed(void)
void isc_heap_increased(isc_heap_t *heap, unsigned int index)
Indicates to the heap that an element's priority has increased. This function MUST be called whenever...
void isc_heap_delete(isc_heap_t *heap, unsigned int index)
Deletes an element from a heap, by element index.
int hash_foreach(struct hash_table *, hash_foreach_func)
isc_result_t add_lease6(struct ipv6_pool *pool, struct iasubopt *lease, time_t valid_lifetime_end_time)
struct interface_info * next
isc_heap_t * inactive_timeouts
isc_result_t iasubopt_reference(struct iasubopt **iasubopt, struct iasubopt *src, const char *file, int line)
HASH_FUNCTIONS(ia, unsigned char *, struct ia_xx, ia_hash_t, ia_reference, ia_dereference, do_string_hash)
isc_heap_t * active_timeouts
isc_result_t decline_lease6(struct ipv6_pool *pool, struct iasubopt *lease)
void schedule_lease_timeout(struct ipv6_pool *pool)
time_t soft_lifetime_end_time
isc_result_t ipv6_pond_dereference(struct ipv6_pond **pond, const char *file, int line)
de-reference an IPv6 pond structure.
isc_boolean_t ipv6_in_pool(const struct in6_addr *addr, const struct ipv6_pool *pool)
void mark_phosts_unavailable(void)
isc_result_t expire_lease6(struct iasubopt **leasep, struct ipv6_pool *pool, time_t now)
isc_result_t release_lease6(struct ipv6_pool *pool, struct iasubopt *lease)
void * isc_heap_element(isc_heap_t *heap, unsigned int index)
Returns the element for a specific element index.
isc_result_t ipv6_pond_reference(struct ipv6_pond **pond, struct ipv6_pond *src, const char *file, int line)
reference an IPv6 pond structure.
struct ipv6_pool ** pools
struct iasubopt ** iasubopt
int write_ia(const struct ia_xx *)
struct executable_statement * on_expiry
isc_result_t ia_reference(struct ia_xx **ia, struct ia_xx *src, const char *file, int line)
struct executable_statement * on_commit
const unsigned char * data
isc_result_t add_ipv6_pool(struct ipv6_pool *pool)
void data_string_copy(struct data_string *dest, const struct data_string *src, const char *file, int line)
void mark_hosts_unavailable(void)
isc_result_t isc_heap_insert(isc_heap_t *heap, void *elt)
Inserts a new element into a heap.
void ia_remove_iasubopt(struct ia_xx *ia, struct iasubopt *iasubopt, const char *file, int line)
isc_result_t cleanup_lease6(ia_hash_t *ia_table, struct ipv6_pool *pool, struct iasubopt *lease, struct ia_xx *ia)
Cleans up leases when reading from a lease file.
void schedule_all_ipv6_lease_timeouts(void)
struct in6_addr * v6addresses