170 #include <sys/types.h> 172 #include <netinet/in.h> 214 return ISC_R_NOMEMORY;
224 return ISC_R_SUCCESS;
250 return ISC_R_SUCCESS;
278 if (tmp->
ia != NULL) {
284 if (tmp->
scope != NULL) {
304 return ISC_R_SUCCESS;
312 const char *duid,
unsigned int duid_len,
315 memset(key, 0,
sizeof(*key));
316 key->
len = duid_len +
sizeof(iaid);
318 return ISC_R_NOMEMORY;
321 memcpy((
char *)key->
data, &iaid,
sizeof(iaid));
322 memcpy((
char *)key->
data +
sizeof(iaid), duid, duid_len);
324 return ISC_R_SUCCESS;
340 const char *duid,
unsigned int duid_len,
355 return ISC_R_NOMEMORY;
359 duid, duid_len,
file,
line) != ISC_R_SUCCESS) {
361 return ISC_R_NOMEMORY;
367 return ISC_R_SUCCESS;
393 return ISC_R_SUCCESS;
407 if ((ia == NULL) || (*ia == NULL)) {
431 return ISC_R_SUCCESS;
455 return ISC_R_NOMEMORY;
467 return ISC_R_SUCCESS;
569 sizeof(
struct in6_addr)) == 0) {
590 lease_older(
void *a,
void *b) {
608 active_changed(
void *
iasubopt,
unsigned int new_heap_index) {
613 inactive_changed(
void *
iasubopt,
unsigned int new_heap_index) {
641 const struct in6_addr *start_addr,
int bits,
642 int units,
const char *
file,
int line) {
656 return ISC_R_NOMEMORY;
666 return ISC_R_NOMEMORY;
672 return ISC_R_NOMEMORY;
679 return ISC_R_NOMEMORY;
683 return ISC_R_SUCCESS;
722 return ISC_R_SUCCESS;
739 dereference_hash_entry(
const void *name,
unsigned len,
void *value) {
743 return ISC_R_SUCCESS;
751 dereference_heap_entry(
void *value,
void *dummy) {
780 if ((
pool == NULL) || (*
pool == NULL)) {
794 iasubopt_hash_foreach(tmp->
leases, dereference_hash_entry);
797 dereference_heap_entry, NULL);
800 dereference_heap_entry, NULL);
805 return ISC_R_SUCCESS;
813 build_address6(
struct in6_addr *addr,
814 const struct in6_addr *net_start_addr,
int net_bits,
828 isc_md5_update(&ctx, input->
data, input->
len);
829 isc_md5_final(&ctx, (
unsigned char *)addr);
835 net_str = (
const char *)net_start_addr;
836 net_bytes = net_bits / 8;
837 for (i = 0; i < net_bytes; i++) {
840 switch (net_bits % 8) {
841 case 1: str[i] = (str[i] & 0x7F) | (net_str[i] & 0x80);
break;
842 case 2: str[i] = (str[i] & 0x3F) | (net_str[i] & 0xC0);
break;
843 case 3: str[i] = (str[i] & 0x1F) | (net_str[i] & 0xE0);
break;
844 case 4: str[i] = (str[i] & 0x0F) | (net_str[i] & 0xF0);
break;
845 case 5: str[i] = (str[i] & 0x07) | (net_str[i] & 0xF8);
break;
846 case 6: str[i] = (str[i] & 0x03) | (net_str[i] & 0xFC);
break;
847 case 7: str[i] = (str[i] & 0x01) | (net_str[i] & 0xFE);
break;
864 build_temporary6(
struct in6_addr *addr,
865 const struct in6_addr *net_start_addr,
int net_bits,
867 static u_int32_t history[2];
868 static u_int32_t counter = 0;
870 unsigned char md[16];
877 isc_random_get(&history[0]);
878 isc_random_get(&history[1]);
885 isc_md5_update(&ctx, (
unsigned char *)&history[0], 8UL);
886 isc_md5_update(&ctx, input->
data, input->
len);
887 isc_md5_final(&ctx, md);
892 if (net_bits == 64) {
893 memcpy(&addr->s6_addr[0], &net_start_addr->s6_addr[0], 8);
894 memcpy(&addr->s6_addr[8], md, 8);
895 addr->s6_addr[8] &= ~0x02;
906 net_str = (
const char *)net_start_addr;
907 net_bytes = net_bits / 8;
908 for (i = 0; i < net_bytes; i++) {
911 memcpy(str + net_bytes, md, 16 - net_bytes);
912 switch (net_bits % 8) {
913 case 1: str[i] = (str[i] & 0x7F) | (net_str[i] & 0x80);
break;
914 case 2: str[i] = (str[i] & 0x3F) | (net_str[i] & 0xC0);
break;
915 case 3: str[i] = (str[i] & 0x1F) | (net_str[i] & 0xE0);
break;
916 case 4: str[i] = (str[i] & 0x0F) | (net_str[i] & 0xF0);
break;
917 case 5: str[i] = (str[i] & 0x07) | (net_str[i] & 0xF8);
break;
918 case 6: str[i] = (str[i] & 0x03) | (net_str[i] & 0xFC);
break;
919 case 7: str[i] = (str[i] & 0x01) | (net_str[i] & 0xFE);
break;
927 memcpy((
unsigned char *)&history[0], md + 8, 8);
932 static struct in6_addr rtany;
934 static struct in6_addr resany;
959 unsigned int *attempts,
960 const struct data_string *uid, time_t soft_lifetime_end_time) {
967 isc_boolean_t reserved_iid;
968 static isc_boolean_t init_resiid = ISC_FALSE;
974 memset(&rtany, 0, 16);
975 memset(&resany, 0, 8);
976 resany.s6_addr[8] = 0xfd;
977 memset(&resany.s6_addr[9], 0xff, 6);
978 init_resiid = ISC_TRUE;
984 memset(&ds, 0,
sizeof(ds));
992 if (++(*attempts) > 100) {
994 return ISC_R_NORESOURCES;
1000 switch (
pool->pool_type) {
1003 build_address6(&tmp, &
pool->start_addr,
1008 build_temporary6(&tmp, &
pool->start_addr,
1013 log_error(
"create_lease6: prefix pool.");
1016 log_error(
"create_lease6: untyped pool.");
1023 reserved_iid = ISC_FALSE;
1024 if (memcmp(&tmp.s6_addr[8], &rtany.s6_addr[8], 8) == 0) {
1025 reserved_iid = ISC_TRUE;
1027 if (!reserved_iid &&
1028 (memcmp(&tmp.s6_addr[8], &resany.s6_addr[8], 7) == 0) &&
1029 ((tmp.s6_addr[15] & 0x80) == 0x80)) {
1030 reserved_iid = ISC_TRUE;
1037 if (!reserved_iid &&
1038 (iasubopt_hash_lookup(&test_iaaddr,
pool->leases,
1039 &tmp,
sizeof(tmp),
MDL) == 0)) {
1042 if (test_iaaddr != NULL)
1048 memset(&new_ds, 0,
sizeof(new_ds));
1049 new_ds.
len = ds.
len +
sizeof(tmp);
1052 return ISC_R_NOMEMORY;
1069 result = iasubopt_allocate(&iaaddr,
MDL);
1070 if (result != ISC_R_SUCCESS) {
1074 memcpy(&iaaddr->
addr, &tmp,
sizeof(iaaddr->
addr));
1080 if (result == ISC_R_SUCCESS) {
1134 struct iasubopt *test_iasubopt, *tmp_iasubopt;
1135 struct ia_xx *old_ia;
1136 isc_result_t status = ISC_R_SUCCESS;
1138 test_iasubopt = NULL;
1145 if (iasubopt_hash_lookup(&test_iasubopt,
pool->leases,
1148 return (ISC_R_SUCCESS);
1151 if (test_iasubopt->
ia == NULL) {
1187 status = ISC_R_FAILURE;
1196 if (
pool->ipv6_pond)
1197 pool->ipv6_pond->num_active--;
1200 pool->num_abandoned--;
1201 if (
pool->ipv6_pond)
1202 pool->ipv6_pond->num_abandoned--;
1205 iasubopt_hash_delete(
pool->leases, &test_iasubopt->
addr,
1206 sizeof(test_iasubopt->
addr),
MDL);
1209 ia_hash_delete(ia_table,
1219 tmp_iasubopt = test_iasubopt;
1240 time_t valid_lifetime_end_time) {
1241 isc_result_t insert_result;
1255 test_iasubopt = NULL;
1256 if (iasubopt_hash_lookup(&test_iasubopt,
pool->leases,
1269 if (
pool->ipv6_pond)
1270 pool->ipv6_pond->num_active--;
1273 pool->num_abandoned--;
1274 if (
pool->ipv6_pond)
1275 pool->ipv6_pond->num_abandoned--;
1280 pool->num_inactive--;
1283 iasubopt_hash_delete(
pool->leases, &test_iasubopt->
addr,
1284 sizeof(test_iasubopt->
addr),
MDL);
1294 tmp_iasubopt = test_iasubopt;
1302 tmp_iasubopt = NULL;
1307 iasubopt_hash_add(
pool->leases, &tmp_iasubopt->
addr,
1311 if (insert_result == ISC_R_SUCCESS) {
1313 if (
pool->ipv6_pond)
1314 pool->ipv6_pond->num_active++;
1317 pool->num_abandoned++;
1318 if (
pool->ipv6_pond)
1319 pool->ipv6_pond->num_abandoned++;
1327 if (insert_result == ISC_R_SUCCESS)
1328 pool->num_inactive++;
1330 if (insert_result != ISC_R_SUCCESS) {
1331 iasubopt_hash_delete(
pool->leases, &
lease->addr,
1334 return insert_result;
1342 return ISC_R_SUCCESS;
1353 if (iasubopt_hash_lookup(&test_iaaddr,
pool->leases,
1379 isc_boolean_t status = ISC_TRUE;
1382 if (iasubopt_hash_lookup(&test_iaaddr,
lease->ipv6_pool->leases,
1383 (
void *)&
lease->addr,
1385 if (test_iaaddr !=
lease) {
1399 isc_result_t insert_result;
1402 if (insert_result == ISC_R_SUCCESS) {
1403 iasubopt_hash_add(
pool->leases, &
lease->addr,
1406 lease->inactive_index);
1408 pool->num_inactive--;
1410 if (
pool->ipv6_pond)
1411 pool->ipv6_pond->num_active++;
1414 return insert_result;
1449 time_t old_end_time =
lease->hard_lifetime_end_time;
1450 lease->hard_lifetime_end_time =
lease->soft_lifetime_end_time;
1451 lease->soft_lifetime_end_time = 0;
1456 lease->active_index);
1459 lease->active_index);
1461 return ISC_R_SUCCESS;
1463 char tmp_addr[INET6_ADDRSTRLEN];
1466 log_info(
"Reclaiming previously abandoned address %s",
1467 inet_ntop(AF_INET6, &(
lease->addr), tmp_addr,
1470 pool->num_abandoned--;
1471 if (
pool->ipv6_pond)
1472 pool->ipv6_pond->num_abandoned--;
1474 return ISC_R_SUCCESS;
1476 return move_lease_to_active(
pool,
lease);
1486 isc_result_t insert_result;
1489 if (insert_result == ISC_R_SUCCESS) {
1522 #if defined (NSUPDATE) 1536 iasubopt_hash_delete(
pool->leases,
1541 pool->num_inactive++;
1542 if (
pool->ipv6_pond)
1543 pool->ipv6_pond->num_active--;
1546 pool->num_abandoned--;
1547 if (
pool->ipv6_pond)
1548 pool->ipv6_pond->num_abandoned--;
1551 return insert_result;
1567 isc_result_t result;
1569 if (leasep == NULL) {
1573 if (*leasep != NULL) {
1578 if (
pool->num_active > 0) {
1582 result = move_lease_to_inactive(
pool, tmp,
1584 if (result == ISC_R_SUCCESS) {
1590 return ISC_R_SUCCESS;
1600 isc_result_t result;
1604 result = move_lease_to_active(
pool,
lease);
1605 if (result != ISC_R_SUCCESS) {
1611 pool->num_abandoned++;
1612 if (
pool->ipv6_pond)
1613 pool->ipv6_pond->num_abandoned++;
1617 return ISC_R_SUCCESS;
1628 return ISC_R_SUCCESS;
1638 const struct in6_addr *net_start_pref,
1639 int pool_bits,
int pref_bits,
1645 const char *net_str;
1653 isc_md5_update(&ctx, input->
data, input->
len);
1654 isc_md5_final(&ctx, (
unsigned char *)pref);
1660 net_str = (
const char *)net_start_pref;
1661 net_bytes = pool_bits / 8;
1662 for (i = 0; i < net_bytes; i++) {
1663 str[i] = net_str[i];
1666 switch (pool_bits % 8) {
1667 case 1: str[i] = (str[i] & 0x7F) | (net_str[i] & 0x80);
break;
1668 case 2: str[i] = (str[i] & 0x3F) | (net_str[i] & 0xC0);
break;
1669 case 3: str[i] = (str[i] & 0x1F) | (net_str[i] & 0xE0);
break;
1670 case 4: str[i] = (str[i] & 0x0F) | (net_str[i] & 0xF0);
break;
1671 case 5: str[i] = (str[i] & 0x07) | (net_str[i] & 0xF8);
break;
1672 case 6: str[i] = (str[i] & 0x03) | (net_str[i] & 0xFC);
break;
1673 case 7: str[i] = (str[i] & 0x01) | (net_str[i] & 0xFE);
break;
1678 net_bytes = pref_bits / 8;
1679 for (i=net_bytes+1; i<16; i++) {
1683 switch (pref_bits % 8) {
1684 case 0: str[i] &= 0;
break;
1685 case 1: str[i] &= 0x80;
break;
1686 case 2: str[i] &= 0xC0;
break;
1687 case 3: str[i] &= 0xE0;
break;
1688 case 4: str[i] &= 0xF0;
break;
1689 case 5: str[i] &= 0xF8;
break;
1690 case 6: str[i] &= 0xFC;
break;
1691 case 7: str[i] &= 0xFE;
break;
1718 unsigned int *attempts,
1722 struct in6_addr tmp;
1726 isc_result_t result;
1731 memset(&ds, 0,
sizeof(ds));
1739 if (++(*attempts) > 10) {
1741 return ISC_R_NORESOURCES;
1754 if (iasubopt_hash_lookup(&test_iapref,
pool->leases,
1755 &tmp,
sizeof(tmp),
MDL) == 0) {
1763 memset(&new_ds, 0,
sizeof(new_ds));
1764 new_ds.
len = ds.
len +
sizeof(tmp);
1767 return ISC_R_NOMEMORY;
1784 result = iasubopt_allocate(&iapref,
MDL);
1785 if (result != ISC_R_SUCCESS) {
1788 iapref->
plen = (u_int8_t)
pool->units;
1789 memcpy(&iapref->
addr, &tmp,
sizeof(iapref->
addr));
1795 if (result == ISC_R_SUCCESS) {
1807 const struct in6_addr *pref, u_int8_t
plen) {
1814 if (iasubopt_hash_lookup(&test_iapref,
pool->leases,
1815 (
void *)pref,
sizeof(*pref),
MDL)) {
1831 isc_result_t result;
1833 dummy_iasubopt = NULL;
1834 result = iasubopt_allocate(&dummy_iasubopt,
MDL);
1835 if (result == ISC_R_SUCCESS) {
1837 iasubopt_hash_add(
pool->leases, &dummy_iasubopt->
addr,
1838 sizeof(*
addr), dummy_iasubopt,
MDL);
1851 if (new_pools == NULL) {
1852 return ISC_R_NOMEMORY;
1856 memcpy(new_pools,
pools,
1865 return ISC_R_SUCCESS;
1872 struct ia_xx *ia_active;
1873 unsigned char *tmpd;
1876 while (
pool->num_inactive > 0) {
1890 pool->num_inactive--;
1892 if (tmp->
ia != NULL) {
1907 (ia_active ==
ia)) {
1915 (ia_active ==
ia)) {
1923 (ia_active ==
ia)) {
1934 lease_timeout_support(
void *vpool) {
1956 if (
lease == NULL) {
1975 cleanup_old_expired(
pool);
1991 time_t next_timeout;
1996 if (
pool->num_active > 0) {
2004 if (
pool->num_inactive > 0) {
2019 tv.tv_sec = next_timeout;
2049 ipv6_network_portion(
struct in6_addr *result,
2050 const struct in6_addr *
addr,
int bits) {
2051 unsigned char *addrp;
2057 static const unsigned char bitmasks[] = {
2058 0x00, 0xFE, 0xFC, 0xF8,
2059 0xF0, 0xE0, 0xC0, 0x80,
2065 if ((bits < 0) || (bits > 128)) {
2066 log_fatal(
"ipv6_network_portion: bits %d not between 0 and 128",
2074 addrp = ((
unsigned char *)result) + 15;
2079 mask_bits = 128 - bits;
2080 bytes = mask_bits / 8;
2081 extra_bits = mask_bits % 8;
2083 for (i=0; i<bytes; i++) {
2088 *addrp &= bitmasks[extra_bits];
2097 struct in6_addr tmp;
2099 ipv6_network_portion(&tmp, addr,
pool->bits);
2100 if (memcmp(&tmp, &
pool->start_addr,
sizeof(tmp)) == 0) {
2115 const struct in6_addr *addr) {
2122 if (*
pool != NULL) {
2128 if (
pools[i]->pool_type != type)
2132 return ISC_R_SUCCESS;
2135 return ISC_R_NOTFOUND;
2143 change_leases(
struct ia_xx *ia,
2144 isc_result_t (*change_func)(
struct ipv6_pool *,
2146 isc_result_t retval;
2147 isc_result_t renew_retval;
2149 struct in6_addr *addr;
2152 retval = ISC_R_SUCCESS;
2157 addr) == ISC_R_SUCCESS) {
2159 if (renew_retval != ISC_R_SUCCESS) {
2160 retval = renew_retval;
2199 static int write_error;
2202 write_ia_leases(
const void *name,
unsigned len,
void *value) {
2210 return ISC_R_SUCCESS;
2235 log_info(
"Wrote %d NA, %d TA, %d PD leases to lease file.",
2242 mark_hosts_unavailable_support(
const void *name,
unsigned len,
void *value) {
2245 struct in6_addr addr;
2254 return ISC_R_SUCCESS;
2264 "error evaluating host address.");
2265 return ISC_R_SUCCESS;
2269 "host address is not 128 bits.");
2270 return ISC_R_SUCCESS;
2290 return ISC_R_SUCCESS;
2299 mark_phosts_unavailable_support(
const void *
name,
unsigned len,
void *value) {
2302 struct in6_addr pref;
2311 return ISC_R_SUCCESS;
2340 return ISC_R_SUCCESS;
2355 while (
ip != NULL) {
2356 for (i=0; i<
ip->v6address_count; i++) {
2361 &
ip->v6addresses[i]);
2367 &
ip->v6addresses[i]);
2400 if (*pond != NULL) {
2407 return ISC_R_NOMEMORY;
2413 return ISC_R_SUCCESS;
2442 if (*pond != NULL) {
2452 return ISC_R_SUCCESS;
2479 if ((pond == NULL) || (*pond == NULL)) {
2496 return ISC_R_SUCCESS;
2523 char *bufptr = log_buf;
2524 size_t space_left =
sizeof(log_buf) - 1;
2532 (space_left > (INET6_ADDRSTRLEN + 6))) {
2542 inet_ntop(AF_INET6, &
pool->start_addr,
2543 bufptr, INET6_ADDRSTRLEN);
2545 used = strlen(bufptr);
2550 sprintf (bufptr,
"/%d",
pool->bits);
2551 used = strlen(bufptr);
2557 log_info(
"Threshold logging disabled for shared" 2558 " subnet of ranges: %s", log_buf);
2586 static int log_once = 0;
2588 if (htype & 0xFF00) {
2590 log_error(
"Attention: At least one client advertises a " 2591 "hardware type of %d, which exceeds the software " 2592 "limitation of 255.", htype);
2639 log_debug(
"find_hosts_by_haddr6: using packet->haddr," 2640 " type: %d, len: %d", htype, hlen);
2663 memset(&rel_addr, 0,
sizeof(rel_addr));
2668 "Error evaluating option cache");
2676 hlen = rel_addr.
len - 2;
2682 "using relayed haddr" 2683 " type: %d, len: %d", htype, hlen);
2705 const unsigned char *chaddr;
2711 if (client_id->
len < 4)
2725 if (client_id->
len > 8) {
2726 hlen = client_id->
len - 8;
2727 chaddr = client_id->
data + 8;
2736 hlen = client_id->
len - 4;
2737 chaddr = client_id->
data + 4;
struct iaddrcidrnet cidrnet
void mark_interfaces_unavailable(void)
int find_hosts_by_haddr6(struct host_decl **hp, struct packet *packet, struct option_state *opt_state, const char *file, int line)
Look for hosts by MAC address if it's available.
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)
void report_jumbo_ranges()
int executable_statement_dereference(struct executable_statement **ptr, const char *file, int line)
struct shared_network * shared_networks
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)
struct lease_state * state
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)
struct ipv6_pond * ipv6_pond
isc_result_t iasubopt_dereference(struct iasubopt **iasubopt, const char *file, int line)
int find_hosts_by_option(struct host_decl **, struct packet *, struct option_state *, const char *, int)
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)
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
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)
#define D6O_CLIENT_LINKLAYER_ADDR
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 find_hosts_by_duid_chaddr(struct host_decl **host, const struct data_string *client_id)
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)
int find_hosts_by_haddr(struct host_decl **, int, const unsigned char *, unsigned, const char *, int)
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)
struct option_state * options
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
u_int32_t getUShort(const unsigned char *)
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)
struct option_cache * lookup_option(struct universe *universe, struct option_state *options, unsigned code)
int int log_info(const char *,...) __attribute__((__format__(__printf__
struct ipv6_pool ** ipv6_pools
void * dmalloc(size_t, const char *, int)
struct interface_info * interfaces
int find_hosts_by_uid(struct host_decl **, const unsigned char *, unsigned, const char *, int)
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 universe dhcpv6_universe
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)
int find_hosts6(struct host_decl **host, struct packet *packet, const struct data_string *client_id, char *file, int line)
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)
u_int8_t hbuf[HARDWARE_ADDR_LEN+1]
isc_result_t release_lease6(struct ipv6_pool *pool, struct iasubopt *lease)
#define HARDWARE_ADDR_LEN
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
struct shared_network * next
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)
struct binding_scope * scope
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.
int htype_bounds_check(uint16_t htype)
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 packet * dhcpv6_container_packet