36 #include <dns/result.h>
43 #if defined (DEBUG_DNS_UPDATES)
44 static char* dump_ddns_cb_func(
void *func);
50 static void ddns_fwd_srv_connector(
struct lease *
lease,
54 isc_result_t eresult);
56 static void copy_conflict_flags(u_int16_t *target, u_int16_t source);
58 static void ddns_fwd_srv_add3(
dhcp_ddns_cb_t *ddns_cb, isc_result_t eresult);
83 static void data_string_append (
struct data_string *ds1,
86 memcpy (ds1 ->
buffer -> data + ds1 -> len,
89 ds1 -> len += ds2 -> len;
112 int server_updates_a = 1;
114 int ignorep = 0, client_ignorep = 0;
133 if ((old != NULL) && (old->
ddns_cb != NULL)) {
137 }
else if (lease6 != NULL) {
138 if ((old6 != NULL) && (old6->
ddns_cb != NULL)) {
151 if (ddns_cb == NULL) {
167 scope = &(lease->
scope);
171 }
else if (lease6 != NULL) {
172 scope = &(lease6->
scope);
184 memset (&d1, 0,
sizeof(d1));
185 memset (&ddns_hostname, 0,
sizeof (ddns_hostname));
186 memset (&ddns_domainname, 0,
sizeof (ddns_domainname));
187 memset (&old_ddns_fwd_name, 0,
sizeof (ddns_fwd_name));
188 memset (&ddns_fwd_name, 0,
sizeof (ddns_fwd_name));
189 memset (&ddns_dhcid, 0,
sizeof (ddns_dhcid));
196 packet->
options, options, scope,
205 options, scope, oc,
MDL))
216 options, scope, oc,
MDL))
219 server_updates_a = 0;
230 options, scope, oc,
MDL)) {
243 options, scope, oc,
MDL))
254 options, scope, oc,
MDL);
261 if ((s1 == 0) && (lease && lease->
host && lease->
host->
name)) {
266 options, scope, oc,
MDL)) {
270 MDL) && ddns_hostname.len > 0));
278 options, scope, oc,
MDL);
283 if (ddns_hostname.len + ddns_domainname.len > 253) {
284 log_error (
"ddns_update: host.domain name too long");
291 ddns_domainname.len + 2,
MDL)) {
292 ddns_fwd_name.data = ddns_fwd_name.buffer->data;
293 data_string_append (&ddns_fwd_name, &ddns_hostname);
294 ddns_fwd_name.buffer->data[ddns_fwd_name.len] =
'.';
296 data_string_append (&ddns_fwd_name, &ddns_domainname);
297 ddns_fwd_name.buffer->data[ddns_fwd_name.len] =
'\0';
298 ddns_fwd_name.terminated = 1;
306 if (old_ddns_fwd_name.len != ddns_fwd_name.len ||
307 memcmp (old_ddns_fwd_name.data, ddns_fwd_name.data,
308 old_ddns_fwd_name.len)) {
317 #if defined (DDNS_UPDATE_SLOW_TRANSITION)
341 options, scope, oc,
MDL)) {
350 "ddns-client-fqdn")) {
353 if (old_ddns_fwd_name.len == ddns_fwd_name.len &&
354 !memcmp (old_ddns_fwd_name.data, ddns_fwd_name.data,
355 old_ddns_fwd_name.len) &&
360 options, scope, oc,
MDL))) {
369 if ((!ddns_fwd_name.len) || (ddns_fwd_name.len > 255)) {
370 if (ddns_fwd_name.len > 255) {
371 log_error (
"client provided fqdn: too long");
375 if (do_remove != 0) {
405 #ifndef USE_OLD_DDNS_TTL
406 else if (lease6 != NULL) {
407 ddns_ttl = lease6->
prefer/2;
419 if (d1.len == sizeof (u_int32_t))
425 ddns_cb->
ttl = ddns_ttl;
445 rev_name_len = snprintf(buf,
sizeof(buf),
"%u.%u.%u.%u.",
452 rev_name_len += d1.len;
454 if (rev_name_len > 255) {
455 log_error(
"ddns_update: Calculated rev domain "
466 rev_name_len =
sizeof(
"0.1.2.3.4.5.6.7."
491 rev_name_len,
MDL)) {
508 data_string_append(rname, &d1);
513 for (i=0; i<16; i++) {
515 (*a & 0xF), ((*a >> 4) & 0xF));
519 strcat(p,
"ip6.arpa.");
520 rname->
len = strlen((
const char *)rname->
data);
567 if (lease6 != NULL) {
573 }
else if ((lease != NULL) &&
574 (lease->
uid != NULL) &&
580 (lease->
uid[0] == 255)) {
591 }
else if (lease != NULL)
624 ddns_fwd_srv_connector(lease, lease6, scope, ddns_cb,
650 }
else if (client_ignorep &&
717 memcpy(&bp->
data[5], d1.data, d1.len);
719 bp, &bp->
data[5], d1.len,
734 bp ->
data [0] = server_updates_a;
736 bp, &bp->
data [0], 1,
739 bp ->
data [1] = server_updates_a;
741 bp, &bp->
data [1], 1,
748 options, scope, oc,
MDL))
753 bp, &bp->
data [2], 1,
756 bp ->
data [3] = 255;
758 bp, &bp->
data [3], 1,
761 bp ->
data [4] = 255;
763 bp, &bp->
data [4], 1,
766 if (ddns_fwd_name.len) {
767 memcpy (&bp ->
data [5],
768 ddns_fwd_name.data, ddns_fwd_name.len);
782 if (ddns_cb != NULL) {
783 destroy_ddns_cb(ddns_cb,
MDL);
827 struct lease *lease = NULL;
830 struct in6_addr
addr;
848 if (inscope != NULL) {
852 scope = &(lease->
scope);
860 if (iasubopt_hash_lookup(&lease6, pool->
leases,
862 scope = &(lease6->
scope);
873 lease_dereference(&lease,
MDL);
879 return(ISC_R_FAILURE);
883 switch(ddns_cb->
state) {
885 unset(*scope,
"ddns-rev-name");
887 unset(*scope,
"ddns-client-fqdn");
910 memset(&lease_dhcid, 0,
sizeof(lease_dhcid));
920 unset(*scope,
"ddns-fwd-name");
928 lease_dereference(&lease,
MDL);
955 update_lease_failed(
struct lease *lease,
959 const char * file,
int line)
964 sprintf(reason,
"unknown");
965 sprintf(lease_address,
"unknown");
972 if (ddns_cb != NULL) {
977 sprintf(reason,
"duplicate IPv4 fixed-address entry");
979 sprintf(reason,
"duplicate IPv6 fixed-address6 entry "
980 "or overlapping pools");
986 sprintf(reason,
"corrupted ddns_cb structure (address "
991 log_error(
"Failed to properly update internal lease structure with "
993 log_error(
"control block structures. Tried to update lease for"
994 "%s address, ddns_cb=%p.", lease_address, ddns_cb);
997 log_error(
"This condition can occur, if DHCP server configuration is "
999 log_error(
"In particular, please do check that your configuration:");
1000 log_error(
"a) does not have overlapping pools (especially containing");
1001 log_error(
" %s address).", lease_address);
1002 log_error(
"b) there are no duplicate fixed-address or fixed-address6");
1003 log_error(
"entries for the %s address.", lease_address);
1005 log_error(
"Possible reason for this failure: %s", reason);
1007 log_fatal(
"%s(%d): Failed to update lease database with DDNS info for "
1008 "address %s. Lease database inconsistent. Unable to recover."
1009 " Terminating.", file, line, lease_address);
1020 safe_lease_update(
struct lease *lease,
1023 const char *file,
int line)
1025 if (lease == NULL) {
1027 log_fatal(
"Impossible condition at %s:%d (called from %s:%d).",
1031 if ( (lease->
ddns_cb == NULL) && (newcb == NULL) ) {
1043 log_error(
"%s(%d): Invalid lease update. Tried to "
1044 "clear already NULL DDNS control block "
1045 "pointer for lease %s.",
1048 #if defined (DNS_UPDATES_MEMORY_CHECKS)
1049 update_lease_failed(lease, NULL, oldcb, newcb, file, line);
1064 log_error(
"%s(%d): Failed to update internal lease "
1065 "structure with DDNS control block. Existing"
1066 " ddns_cb structure does not match "
1067 "expectations.IPv4=%s, old ddns_cb=%p, tried"
1068 "to update to new ddns_cb=%p", file, line,
1071 #if defined (DNS_UPDATES_MEMORY_CHECKS)
1072 update_lease_failed(lease, NULL, oldcb, newcb, file, line);
1088 safe_lease6_update(
struct iasubopt *lease6,
1091 const char *file,
int line)
1095 if (lease6 == NULL) {
1097 log_fatal(
"Impossible condition at %s:%d (called from %s:%d).",
1101 if ( (lease6->
ddns_cb == NULL) && (newcb == NULL) ) {
1102 inet_ntop(AF_INET6, &lease6->
addr, addrbuf,
1108 log_error(
"%s(%d): Failed to update internal lease "
1109 "structure. Tried to clear already NULL "
1110 "DDNS control block pointer for lease %s.",
1111 file, line, addrbuf);
1113 #if defined (DNS_UPDATES_MEMORY_CHECKS)
1114 update_lease_failed(NULL, lease6, oldcb, newcb, file, line);
1130 inet_ntop(AF_INET6, &lease6->
addr, addrbuf,
1133 log_error(
"%s(%d): Failed to update internal lease "
1134 "structure with DDNS control block. Existing"
1135 " ddns_cb structure does not match "
1136 "expectations.IPv6=%s, old ddns_cb=%p, tried"
1137 "to update to new ddns_cb=%p", file, line,
1138 addrbuf, oldcb, newcb);
1140 #if defined (DNS_UPDATES_MEMORY_CHECKS)
1141 update_lease_failed(NULL, lease6, oldcb, newcb, file, line);
1171 ddns_update_lease_ptr(
struct lease *lease,
1175 const char * file,
int line)
1178 sprintf(ddns_address,
"unknown");
1179 if (ddns_cb == NULL) {
1180 log_info(
"%s(%d): No control block for lease update",
1182 return (ISC_R_FAILURE);
1187 #if defined (DEBUG_DNS_UPDATES)
1188 log_info(
"%s(%d): Updating lease_ptr for ddns_cp=%p (addr=%s)",
1189 file, line, ddns_cb, ddns_address );
1197 #if defined (DEBUG_DNS_UPDATES)
1198 log_info(
"lease is static, returning");
1212 if (lease != NULL) {
1213 safe_lease_update(lease, ddns_cb, ddns_cb_set,
1215 }
else if (lease6 != NULL) {
1216 safe_lease6_update(lease6, ddns_cb, ddns_cb_set,
1222 #if defined (DEBUG_DNS_UPDATES)
1223 log_info(
"%s(%d): find_lease_by_ip_addr(%s) successful:"
1224 "lease=%p", file, line, ddns_address,
1228 safe_lease_update(find_lease, ddns_cb,
1229 ddns_cb_set, file, line);
1230 lease_dereference(&find_lease,
MDL);
1233 log_error(
"%s(%d): ddns_update_lease_ptr failed. "
1234 "Lease for %s not found.",
1237 #if defined (DNS_UPDATES_MEMORY_CHECKS)
1238 update_lease_failed(NULL, NULL, ddns_cb, ddns_cb_set,
1245 return(ISC_R_FAILURE);
1249 struct iasubopt *find_lease6 = NULL;
1251 struct in6_addr
addr;
1259 inet_ntop(AF_INET6, &
addr, addrbuf,
1261 log_error(
"%s(%d): Pool for lease %s not found.",
1262 file, line, addrbuf);
1263 #if defined (DNS_UPDATES_MEMORY_CHECKS)
1264 update_lease_failed(NULL, NULL, ddns_cb, ddns_cb_set,
1271 return(ISC_R_FAILURE);
1274 if (iasubopt_hash_lookup(&find_lease6, pool->
leases,
1276 find_lease6->
ddns_cb = ddns_cb_set;
1279 inet_ntop(AF_INET6, &
addr, addrbuf,
1281 log_error(
"%s(%d): Lease %s not found within pool.",
1282 file, line, addrbuf);
1283 #if defined (DNS_UPDATES_MEMORY_CHECKS)
1284 update_lease_failed(NULL, NULL, ddns_cb, ddns_cb_set,
1291 return(ISC_R_FAILURE);
1296 log_fatal(
"Impossible condition at %s:%d, called from %s:%d.",
1305 isc_result_t eresult)
1308 log_info(
"Added reverse map from %.*s to %.*s",
1314 ddns_update_lease_text(ddns_cb, NULL);
1316 log_error(
"Unable to add reverse map from %.*s to %.*s: %s",
1321 isc_result_totext (eresult));
1324 ddns_update_lease_ptr(NULL, NULL, ddns_cb, NULL,
MDL);
1325 destroy_ddns_cb(ddns_cb,
MDL);
1349 isc_result_t eresult)
1351 isc_result_t result = eresult;
1355 log_info(
"Removed reverse map on %.*s",
1360 case DNS_R_NXDOMAIN:
1364 ddns_update_lease_text(ddns_cb, NULL);
1368 #if defined (DEBUG_DNS_UPDATES)
1369 log_info(
"DDNS: removed map or no reverse map to remove %.*s",
1376 log_error(
"Can't remove reverse map on %.*s: %s",
1379 isc_result_totext (eresult));
1387 result = ISC_R_FAILURE;
1389 ddns_update_lease_ptr(NULL, NULL, ddns_cb, NULL,
MDL);
1390 ddns_fwd_srv_connector(NULL, NULL, NULL, ddns_cb->
next_op, result);
1391 destroy_ddns_cb(ddns_cb,
MDL);
1430 isc_result_t eresult)
1432 isc_result_t result;
1433 const char *logstr = NULL;
1436 #if defined (DEBUG_DNS_UPDATES)
1437 log_info (
"DDNS:ddns_fwd_srv_add2: %s eresult: %d",
1438 dump_ddns_cb(ddns_cb), eresult);
1446 log_info(
"Added new forward map from %.*s to %s",
1451 ddns_update_lease_text(ddns_cb, NULL);
1455 if (ddns_cb->
zone != NULL) {
1470 case DNS_R_YXDOMAIN:
1471 logstr =
"DHCID mismatch, belongs to another client.";
1474 case DNS_R_NXDOMAIN:
1479 ddns_cb->
cur_func = ddns_fwd_srv_add3;
1489 logstr =
"Has an address record but no DHCID, not mine.";
1493 logstr = isc_result_totext(eresult);
1497 if (logstr != NULL) {
1498 log_error(
"Forward map from %.*s to %s FAILED: %s",
1501 ddns_address, logstr);
1504 ddns_update_lease_ptr(NULL, NULL, ddns_cb, NULL,
MDL);
1505 destroy_ddns_cb(ddns_cb,
MDL);
1522 isc_result_t eresult)
1524 isc_result_t result;
1527 #if defined (DEBUG_DNS_UPDATES)
1528 log_info (
"DDNS: ddns_fwd_srv_add1: %s eresult: %d",
1529 dump_ddns_cb(ddns_cb), eresult);
1537 log_info (
"Added new forward map from %.*s to %s",
1542 ddns_update_lease_text(ddns_cb, NULL);
1546 if (ddns_cb->
zone != NULL) {
1560 case DNS_R_YXDOMAIN:
1563 ddns_cb->
cur_func = ddns_fwd_srv_add2;
1571 log_error (
"Unable to add forward map from %.*s to %s: %s",
1575 isc_result_totext (eresult));
1579 ddns_update_lease_ptr(NULL, NULL, ddns_cb, NULL,
MDL);
1580 destroy_ddns_cb(ddns_cb,
MDL);
1602 isc_result_t eresult)
1604 isc_result_t result;
1605 const char *logstr = NULL;
1608 #if defined (DEBUG_DNS_UPDATES)
1609 log_info (
"DDNS: ddns_fwd_srv_add3: %s eresult: %d",
1610 dump_ddns_cb(ddns_cb), eresult);
1614 memset(ddns_address, 0x0,
sizeof(ddns_address));
1616 sizeof(ddns_address) - 1);
1620 log_info(
"Added new forward map from %.*s to %s",
1625 ddns_update_lease_text(ddns_cb, NULL);
1629 if (ddns_cb->
zone != NULL) {
1644 logstr =
"an entry that is either static or "
1645 "owned by another client exists.";
1649 logstr =
"static entry of the other protocol type exists.";
1653 logstr = isc_result_totext(eresult);
1657 if (logstr != NULL) {
1658 log_error(
"Forward map from %.*s to %s FAILED: %s",
1661 ddns_address, logstr);
1664 ddns_update_lease_ptr(NULL, NULL, ddns_cb, NULL,
MDL);
1665 destroy_ddns_cb(ddns_cb,
MDL);
1681 ddns_fwd_srv_connector(
struct lease *lease,
1685 isc_result_t eresult)
1687 isc_result_t result = ISC_R_FAILURE;
1689 #if defined (DEBUG_DNS_UPDATES)
1690 log_info (
"DDNS: ddns_fwd_srv_connector: %s eresult: %d",
1691 dump_ddns_cb(ddns_cb), eresult);
1694 if (ddns_cb == NULL) {
1707 ddns_cb->
cur_func = ddns_fwd_srv_add1;
1715 ddns_update_lease_text(ddns_cb, inscope);
1721 ddns_update_lease_ptr(lease, lease6, ddns_cb, ddns_cb,
MDL);
1723 destroy_ddns_cb(ddns_cb,
MDL);
1744 isc_result_t eresult)
1746 #if defined (DEBUG_DNS_UPDATES)
1747 log_info (
"DDNS: ddns_fwd_srv_rem2: %s eresult: %d",
1748 dump_ddns_cb(ddns_cb), eresult);
1766 (eresult == DNS_R_YXRRSET)) {
1767 ddns_update_lease_text(ddns_cb, NULL);
1774 if (ddns_cb->
zone != NULL) {
1779 ddns_cb->
cur_func = ddns_ptr_remove;
1789 ddns_update_lease_ptr(NULL, NULL, ddns_cb, NULL,
MDL);
1790 ddns_fwd_srv_connector(NULL, NULL, NULL, ddns_cb->
next_op, eresult);
1791 destroy_ddns_cb(ddns_cb,
MDL);
1805 isc_result_t eresult)
1807 isc_result_t result = eresult;
1810 #if defined (DEBUG_DNS_UPDATES)
1811 log_info (
"DDNS: ddns_fwd_srv_rem1: %s eresult: %d",
1812 dump_ddns_cb(ddns_cb), eresult);
1819 log_info(
"Removed forward map from %.*s to %s",
1826 ddns_cb->
cur_func = ddns_fwd_srv_rem2;
1834 case DNS_R_NXDOMAIN:
1843 #define DSMM_OGD (DDNS_DUAL_STACK_MIXED_MODE | \
1844 DDNS_OTHER_GUARD_IS_DYNAMIC)
1845 if ((ddns_cb->
flags & DSMM_OGD) == DSMM_OGD) {
1847 ddns_cb->
cur_func = ddns_fwd_srv_rem2;
1855 ddns_update_lease_text(ddns_cb, NULL);
1857 #if defined (DEBUG_DNS_UPDATES)
1858 log_info(
"DDNS: no forward map to remove. %p", ddns_cb);
1876 if (ddns_cb->
zone != NULL) {
1881 ddns_cb->
cur_func = ddns_ptr_remove;
1893 ddns_update_lease_ptr(NULL, NULL, ddns_cb, NULL,
MDL);
1894 ddns_fwd_srv_connector(NULL, NULL, NULL, ddns_cb->
next_op, eresult);
1895 destroy_ddns_cb(ddns_cb,
MDL);
1926 isc_boolean_t active)
1928 isc_result_t rcode, execute_add = ISC_R_FAILURE;
1930 isc_result_t result = ISC_R_FAILURE;
1934 #if defined (DEBUG_DNS_UPDATES)
1935 log_info (
"DDNS: ddns_removals: %s",
1936 dump_ddns_cb(add_ddns_cb));
1962 if (add_ddns_cb == NULL) {
1963 if ((lease != NULL) && (lease->
ddns_cb != NULL)) {
1973 ((active == ISC_FALSE) &&
1980 if (ddns_cb->
next_op != NULL) {
1984 #if defined (DEBUG_DNS_UPDATES)
1985 log_info(
"DDNS %s(%d): removal already in "
1986 "progress new ddns_cb=%p",
1991 }
else if ((lease6 != NULL) && (lease6->
ddns_cb != NULL)) {
2001 ((active == ISC_FALSE) &&
2008 if (ddns_cb->
next_op != NULL) {
2012 #if defined (DEBUG_DNS_UPDATES)
2013 log_info(
"DDNS %s(%d): removal already in "
2014 "progress new ddns_cb=%p",
2025 if (ddns_cb == NULL) {
2037 if (lease != NULL) {
2038 scope = &(lease->
scope);
2042 }
else if (lease6 != NULL) {
2043 scope = &(lease6->
scope);
2056 if (active == ISC_TRUE) {
2087 execute_add = ISC_R_FAILURE;
2091 "ddns-client-fqdn")) {
2102 memset(&leaseid, 0,
sizeof(leaseid));
2142 ddns_cb->
next_op = add_ddns_cb;
2155 ddns_cb->
cur_func = ddns_fwd_srv_rem1;
2159 ddns_update_lease_ptr(lease, lease6, ddns_cb,
2168 execute_add = ISC_R_FAILURE;
2173 unset(*scope,
"ddns-fwd-name");
2180 ddns_cb->
cur_func = ddns_ptr_remove;
2190 ddns_fwd_srv_connector(lease, lease6, scope,
2191 add_ddns_cb, execute_add);
2200 ddns_update_lease_ptr(lease, lease6, ddns_cb, ddns_cb,
2207 execute_add = ISC_R_FAILURE;
2218 ddns_fwd_srv_connector(lease, lease6, scope, add_ddns_cb, execute_add);
2219 if (ddns_cb != NULL)
2220 destroy_ddns_cb(ddns_cb,
MDL);
2226 void set_flag (u_int16_t *flags,
2242 void copy_conflict_flags(u_int16_t *target,
2260 int ddns_update_conflict_detection = 1;
2261 int ddns_dual_stack_mixed_mode = 0;
2262 int ddns_guard_id_must_match = 1;
2263 int ddns_other_guard_is_dynamic = 0;
2269 ddns_update_conflict_detection =
2275 ddns_update_conflict_detection);
2277 if (!ddns_update_conflict_detection) {
2278 #if defined (DEBUG_DNS_UPDATES)
2279 log_info (
"DDNS conflict detection: off");
2292 ddns_dual_stack_mixed_mode =
2300 ddns_guard_id_must_match =
2308 ddns_other_guard_is_dynamic =
2315 ddns_dual_stack_mixed_mode);
2318 ddns_guard_id_must_match);
2321 ddns_other_guard_is_dynamic);
2323 #if defined (DEBUG_DNS_UPDATES)
2324 log_info (
"DDNS conflict behavior:\n"
2325 "\tddns-update-style: %s\n"
2326 "\tupdate-conflict-detection: %d\n"
2327 "\tddns-dual-stack-mixed-mode: %d\n"
2328 "\tddns-guard-id-must-match %d\n"
2329 "\tddns-other-guard-is-dynamic: %d\n",
2331 ddns_update_conflict_detection,
2332 ddns_dual_stack_mixed_mode,
2333 ddns_guard_id_must_match,
2334 ddns_other_guard_is_dynamic);
2339 #if defined (DEBUG_DNS_UPDATES)
2348 dump_ddns_cb_func(
void *func) {
2349 static LabeledPtr funcs[] = {
2350 { ddns_ptr_add,
"ddns_ptr_add" },
2351 { ddns_fwd_srv_add2,
"ddns_fwd_srv_add2" },
2352 { ddns_fwd_srv_add1,
"ddns_fwd_srv_add1" },
2353 { ddns_ptr_remove,
"ddns_ptr_remove" },
2354 { ddns_fwd_srv_rem2,
"ddns_fwd_srv_rem2" },
2355 { ddns_fwd_srv_rem1,
"ddns_fwd_srv_rem1" },
2356 { ddns_fwd_srv_add3,
"ddns_fwd_srv_adde" },
2360 LabeledPtr* lp = funcs;
2365 while ((lp->ptr) && (lp->ptr != func)) {
2375 static char output_buf[4096];
2377 return (
"<ddns_cb is null>");
2380 sprintf (output_buf,
"ddns_cb: %p flags: %x state: %s cur_func: %s",
2381 ddns_cb, ddns_cb->
flags,
2383 dump_ddns_cb_func(ddns_cb->
cur_func));
#define SV_DDNS_GUARD_ID_MUST_MATCH
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.
int find_lease(struct lease **, struct packet *, struct shared_network *, int *, int *, struct lease *, const char *, int)
for(i=0;i< addr->len;i++)
#define DDNS_STATIC_LEASE
struct binding_scope * global_scope
#define SV_USE_HOST_DECL_NAMES
const char * piaddr(const struct iaddr addr)
#define FQDN_NO_CLIENT_UPDATE
struct dhcp_ddns_cb * ddns_cb
#define DDNS_STATE_ADD_FW_NXDOMAIN
int get_dhcid(dhcp_ddns_cb_t *, int, const u_int8_t *, unsigned)
isc_result_t ia_dereference(struct ia_xx **ia, const char *file, int line)
struct universe server_universe
isc_result_t ddns_modify_ptr(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
#define DDNS_EXECUTE_NEXT
#define DDNS_STATE_REM_PTR
struct dhcp_ddns_cb * ddns_cb
#define SV_DDNS_REV_DOMAIN_NAME
#define DDNS_GUARD_ID_MUST_MATCH
int find_bound_string(struct data_string *value, struct binding_scope *scope, const char *name)
dhcp_ddns_cb_t * ddns_cb_alloc(const char *file, int line)
void data_string_forget(struct data_string *data, const char *file, int line)
int log_error(const char *,...) __attribute__((__format__(__printf__
char * ddns_state_name(int state)
#define DDNS_UPDATE_STYLE_STANDARD
struct binding_scope * scope
#define DDNS_STATE_REM_FW_YXDHCID
struct data_string fwd_name
log_fatal("no memory for uname information.")
#define DDNS_ACTIVE_LEASE
#define DDNS_CLIENT_DID_UPDATE
struct option_state * options
void ddns_cb_free(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
#define SV_DDNS_HOST_NAME
void dhcid_tolease(struct data_string *, struct data_string *)
struct data_string rev_name
struct hardware hardware_addr
int unset(struct binding_scope *scope, const char *name)
u_int16_t ddns_conflict_mask
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)
#define MAX_ADDRESS_STRING_LEN
dns_rdataclass_t dhcid_class
#define SV_UPDATE_OPTIMIZATION
#define DDNS_STATE_ADD_PTR
int buffer_allocate(struct buffer **ptr, unsigned len, const char *file, int line)
int write_lease(struct lease *lease)
struct dhcp_ddns_cb * next_op
#define DDNS_OTHER_GUARD_IS_DYNAMIC
struct data_string iaid_duid
#define DDNS_UPDATE_STYLE_INTERIM
int save_option_buffer(struct universe *universe, struct option_state *options, struct buffer *bp, unsigned char *buffer, unsigned length, unsigned code, int terminatep)
isc_result_t dhcid_fromlease(struct data_string *, struct data_string *)
void ddns_cancel(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)
struct option_cache * lookup_option(struct universe *universe, struct option_state *options, unsigned code)
int int log_info(const char *,...) __attribute__((__format__(__printf__
u_int32_t getULong(const unsigned char *)
isc_result_t ipv6_pool_dereference(struct ipv6_pool **pool, const char *file, int line)
de-reference an IPv6 pool structure.
isc_result_t find_ipv6_pool(struct ipv6_pool **pool, u_int16_t type, const struct in6_addr *addr)
#define SV_DO_REVERSE_UPDATES
#define SV_DDNS_DOMAIN_NAME
isc_result_t ddns_removals(struct lease *, struct iasubopt *, struct dhcp_ddns_cb *, isc_boolean_t)
int evaluate_boolean_option_cache(int *ignorep, 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)
int ddns_updates(struct packet *, struct lease *, struct lease *, struct iasubopt *, struct iasubopt *, struct option_state *)
#define DDNS_DUAL_STACK_MIXED_MODE
isc_result_t iasubopt_dereference(struct iasubopt **iasubopt, const char *file, int line)
struct enumeration_value ddns_styles_values[]
#define SV_DDNS_OTHER_GUARD_IS_DYNAMIC
#define FQDN_SERVER_UPDATE
#define DDNS_STATE_REM_FW_DSMM_OTHER
#define DDNS_STATE_ADD_FW_YXDHCID
u_int16_t get_conflict_mask(struct option_state *input_options)
u_int8_t hbuf[HARDWARE_ADDR_LEN+1]
dns_rdataclass_t other_dhcid_class
void ddns_cb_forget_zone(dhcp_ddns_cb_t *ddns_cb)
struct universe fqdn_universe
int write_ia(const struct ia_xx *)
#define DDNS_CONFLICT_DETECTION
#define SV_DDNS_CONFLICT_DETECT
#define DHO_DHCP_CLIENT_IDENTIFIER
isc_result_t ia_reference(struct ia_xx **ia, struct ia_xx *src, const char *file, int line)
const unsigned char * data
int bind_ds_value(struct binding_scope **scope, const char *name, struct data_string *value)
struct binding_scope * scope
void data_string_copy(struct data_string *dest, const struct data_string *src, const char *file, int line)
#define SV_UPDATE_STATIC_LEASES
#define DDNS_STATE_DSMM_FW_ADD3
int find_lease_by_ip_addr(struct lease **, struct iaddr, const char *, int)
#define DDNS_STATE_CLEANUP
#define DDNS_STATE_REM_FW_NXRR
#define MAX_DEFAULT_DDNS_TTL
#define SV_DDNS_DUAL_STACK_MIXED_MODE
#define SV_CLIENT_UPDATES
#define SV_DO_FORWARD_UPDATES
int buffer_dereference(struct buffer **ptr, const char *file, int line)
isc_result_t ddns_modify_fwd(dhcp_ddns_cb_t *ddns_cb, const char *file, int line)