2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 22:35:25 +00:00

Support for asynchronous ddns per ticket 19216 - convert to using isclib and

dnslib.
This commit is contained in:
Shawn Routhier
2009-10-28 04:12:30 +00:00
parent 571c38b093
commit 98bf16077d
95 changed files with 4938 additions and 4043 deletions

View File

@@ -140,7 +140,7 @@ isc_result_t dhcp_group_set_value (omapi_object_t *h,
isc_result_t status;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
group = (struct group_object *)h;
/* XXX For now, we can only set these values on new group objects.
@@ -159,7 +159,7 @@ isc_result_t dhcp_group_set_value (omapi_object_t *h,
value -> u.buffer.len);
group -> name [value -> u.buffer.len] = 0;
} else
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
return ISC_R_SUCCESS;
}
@@ -185,19 +185,19 @@ isc_result_t dhcp_group_set_value (omapi_object_t *h,
(&group -> group -> statements, parse, &lose,
context_any))) {
end_parse (&parse);
return ISC_R_BADPARSE;
return DHCP_R_BADPARSE;
}
end_parse (&parse);
return ISC_R_SUCCESS;
} else
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
}
/* Try to find some inner object that can take the value. */
if (h -> inner && h -> inner -> type -> set_value) {
status = ((*(h -> inner -> type -> set_value))
(h -> inner, id, name, value));
if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)
if (status == ISC_R_SUCCESS || status == DHCP_R_UNCHANGED)
return status;
}
@@ -213,7 +213,7 @@ isc_result_t dhcp_group_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t status;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
group = (struct group_object *)h;
if (!omapi_ds_strcmp (name, "name"))
@@ -235,7 +235,7 @@ isc_result_t dhcp_group_destroy (omapi_object_t *h, const char *file, int line)
struct group_object *group, *t;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
group = (struct group_object *)h;
if (group -> name) {
@@ -268,14 +268,14 @@ isc_result_t dhcp_group_signal_handler (omapi_object_t *h,
int updatep = 0;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
group = (struct group_object *)h;
if (!strcmp (name, "updated")) {
/* A group object isn't valid if a subgroup hasn't yet been
associated with it. */
if (!group -> group)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
/* Group objects always have to have names. */
if (!group -> name) {
@@ -313,7 +313,7 @@ isc_result_t dhcp_group_stuff_values (omapi_object_t *c,
isc_result_t status;
if (h -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
group = (struct group_object *)h;
/* Write out all the values. */
@@ -345,7 +345,7 @@ isc_result_t dhcp_group_lookup (omapi_object_t **lp,
struct group_object *group;
if (!ref)
return ISC_R_NOKEYS;
return DHCP_R_NOKEYS;
/* First see if we were sent a handle. */
status = omapi_get_value_str (ref, id, "handle", &tv);
@@ -359,7 +359,7 @@ isc_result_t dhcp_group_lookup (omapi_object_t **lp,
/* Don't return the object if the type is wrong. */
if ((*lp) -> type != dhcp_type_group) {
omapi_object_dereference (lp, MDL);
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
}
}
@@ -377,7 +377,7 @@ isc_result_t dhcp_group_lookup (omapi_object_t **lp,
if (*lp && *lp != (omapi_object_t *)group) {
group_object_dereference (&group, MDL);
omapi_object_dereference (lp, MDL);
return ISC_R_KEYCONFLICT;
return DHCP_R_KEYCONFLICT;
} else if (!*lp) {
/* XXX fix so that hash lookup itself creates
XXX the reference. */
@@ -393,7 +393,7 @@ isc_result_t dhcp_group_lookup (omapi_object_t **lp,
/* If we get to here without finding a group, no valid key was
specified. */
if (!*lp)
return ISC_R_NOKEYS;
return DHCP_R_NOKEYS;
if (((struct group_object *)(*lp)) -> flags & GROUP_OBJECT_DELETED) {
omapi_object_dereference (lp, MDL);
@@ -424,7 +424,7 @@ isc_result_t dhcp_group_remove (omapi_object_t *lp,
struct group_object *group;
isc_result_t status;
if (lp -> type != dhcp_type_group)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
group = (struct group_object *)lp;
group -> flags |= GROUP_OBJECT_DELETED;
@@ -448,7 +448,7 @@ isc_result_t dhcp_control_set_value (omapi_object_t *h,
unsigned long newstate;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
control = (dhcp_control_object_t *)h;
if (!omapi_ds_strcmp (name, "state")) {
@@ -465,7 +465,7 @@ isc_result_t dhcp_control_set_value (omapi_object_t *h,
if (h -> inner && h -> inner -> type -> set_value) {
status = ((*(h -> inner -> type -> set_value))
(h -> inner, id, name, value));
if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)
if (status == ISC_R_SUCCESS || status == DHCP_R_UNCHANGED)
return status;
}
@@ -481,7 +481,7 @@ isc_result_t dhcp_control_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t status;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
control = (dhcp_control_object_t *)h;
if (!omapi_ds_strcmp (name, "state"))
@@ -502,7 +502,7 @@ isc_result_t dhcp_control_destroy (omapi_object_t *h,
const char *file, int line)
{
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
/* Can't destroy the control object. */
return ISC_R_NOPERM;
@@ -515,7 +515,7 @@ isc_result_t dhcp_control_signal_handler (omapi_object_t *h,
isc_result_t status;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
control = (dhcp_control_object_t *)h;
/* Try to find some inner object that can take the value. */
@@ -536,7 +536,7 @@ isc_result_t dhcp_control_stuff_values (omapi_object_t *c,
isc_result_t status;
if (h -> type != dhcp_type_control)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
control = (dhcp_control_object_t *)h;
/* Write out all the values. */
@@ -580,7 +580,7 @@ isc_result_t dhcp_control_lookup (omapi_object_t **lp,
/* Don't return the object if the type is wrong. */
if ((*lp) -> type != dhcp_type_control) {
omapi_object_dereference (lp, MDL);
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
}
}
}
@@ -616,7 +616,7 @@ isc_result_t dhcp_subnet_set_value (omapi_object_t *h,
isc_result_t status;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
subnet = (struct subnet *)h;
/* No values to set yet. */
@@ -625,7 +625,7 @@ isc_result_t dhcp_subnet_set_value (omapi_object_t *h,
if (h -> inner && h -> inner -> type -> set_value) {
status = ((*(h -> inner -> type -> set_value))
(h -> inner, id, name, value));
if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)
if (status == ISC_R_SUCCESS || status == DHCP_R_UNCHANGED)
return status;
}
@@ -641,7 +641,7 @@ isc_result_t dhcp_subnet_get_value (omapi_object_t *h, omapi_object_t *id,
isc_result_t status;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
subnet = (struct subnet *)h;
/* No values to get yet. */
@@ -661,7 +661,7 @@ isc_result_t dhcp_subnet_destroy (omapi_object_t *h, const char *file, int line)
struct subnet *subnet;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
subnet = (struct subnet *)h;
#if defined (DEBUG_MEMORY_LEAKAGE) || \
@@ -690,7 +690,7 @@ isc_result_t dhcp_subnet_signal_handler (omapi_object_t *h,
int updatep = 0;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
subnet = (struct subnet *)h;
/* Can't write subnets yet. */
@@ -715,7 +715,7 @@ isc_result_t dhcp_subnet_stuff_values (omapi_object_t *c,
isc_result_t status;
if (h -> type != dhcp_type_subnet)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
subnet = (struct subnet *)h;
/* Can't stuff subnet values yet. */
@@ -740,7 +740,7 @@ isc_result_t dhcp_subnet_lookup (omapi_object_t **lp,
/* If we get to here without finding a subnet, no valid key was
specified. */
if (!*lp)
return ISC_R_NOKEYS;
return DHCP_R_NOKEYS;
return ISC_R_SUCCESS;
}
@@ -765,7 +765,7 @@ isc_result_t dhcp_shared_network_set_value (omapi_object_t *h,
isc_result_t status;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
shared_network = (struct shared_network *)h;
/* No values to set yet. */
@@ -774,7 +774,7 @@ isc_result_t dhcp_shared_network_set_value (omapi_object_t *h,
if (h -> inner && h -> inner -> type -> set_value) {
status = ((*(h -> inner -> type -> set_value))
(h -> inner, id, name, value));
if (status == ISC_R_SUCCESS || status == ISC_R_UNCHANGED)
if (status == ISC_R_SUCCESS || status == DHCP_R_UNCHANGED)
return status;
}
@@ -791,7 +791,7 @@ isc_result_t dhcp_shared_network_get_value (omapi_object_t *h,
isc_result_t status;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
shared_network = (struct shared_network *)h;
/* No values to get yet. */
@@ -812,7 +812,7 @@ isc_result_t dhcp_shared_network_destroy (omapi_object_t *h,
struct shared_network *shared_network;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
shared_network = (struct shared_network *)h;
#if defined (DEBUG_MEMORY_LEAKAGE) || \
@@ -854,7 +854,7 @@ isc_result_t dhcp_shared_network_signal_handler (omapi_object_t *h,
int updatep = 0;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
shared_network = (struct shared_network *)h;
/* Can't write shared_networks yet. */
@@ -879,7 +879,7 @@ isc_result_t dhcp_shared_network_stuff_values (omapi_object_t *c,
isc_result_t status;
if (h -> type != dhcp_type_shared_network)
return ISC_R_INVALIDARG;
return DHCP_R_INVALIDARG;
shared_network = (struct shared_network *)h;
/* Can't stuff shared_network values yet. */
@@ -904,7 +904,7 @@ isc_result_t dhcp_shared_network_lookup (omapi_object_t **lp,
/* If we get to here without finding a shared_network, no valid key was
specified. */
if (!*lp)
return ISC_R_NOKEYS;
return DHCP_R_NOKEYS;
return ISC_R_SUCCESS;
}