summaryrefslogtreecommitdiff
path: root/dhcpctl/dhcpctl.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2001-06-27 00:31:20 +0000
committerTed Lemon <source@isc.org>2001-06-27 00:31:20 +0000
commitd758ad8cac9c00c70cfe4dd459bf7e87c268c579 (patch)
tree85d7e10e40b0e1061a40f45ef0e9f44073346482 /dhcpctl/dhcpctl.c
parent07b958004f4e39f9b222115b1b050044a2434ea1 (diff)
downloadisc-dhcp-d758ad8cac9c00c70cfe4dd459bf7e87c268c579.tar.gz
Merge changes between 3.0rc7 and 3.0rc8pl2.
Diffstat (limited to 'dhcpctl/dhcpctl.c')
-rw-r--r--dhcpctl/dhcpctl.c47
1 files changed, 38 insertions, 9 deletions
diff --git a/dhcpctl/dhcpctl.c b/dhcpctl/dhcpctl.c
index 9e3fafa3..4560b84d 100644
--- a/dhcpctl/dhcpctl.c
+++ b/dhcpctl/dhcpctl.c
@@ -267,7 +267,6 @@ dhcpctl_status dhcpctl_set_value (dhcpctl_handle h, dhcpctl_data_string value,
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
int len;
- int ip;
status = omapi_data_string_new (&name, strlen (value_name), MDL);
if (status != ISC_R_SUCCESS)
@@ -302,7 +301,6 @@ dhcpctl_status dhcpctl_set_string_value (dhcpctl_handle h, const char *value,
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
int len;
- int ip;
status = omapi_data_string_new (&name, strlen (value_name), MDL);
if (status != ISC_R_SUCCESS)
@@ -323,10 +321,10 @@ dhcpctl_status dhcpctl_set_string_value (dhcpctl_handle h, const char *value,
/* dhcpctl_set_buffer_value
- Sets a NUL-terminated ASCII value on an object referred to by
- a dhcpctl_handle. like dhcpctl_set_value, but saves the
- trouble of creating a data_string for a NUL-terminated string.
- Does not update the server - just sets the value on the handle. */
+ Sets a value on an object referred to by a dhcpctl_handle. like
+ dhcpctl_set_value, but saves the trouble of creating a data_string
+ for string for which we have a buffer and length. Does not update
+ the server - just sets the value on the handle. */
dhcpctl_status dhcpctl_set_data_value (dhcpctl_handle h,
const char *value, unsigned len,
@@ -335,7 +333,6 @@ dhcpctl_status dhcpctl_set_data_value (dhcpctl_handle h,
isc_result_t status;
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
- int ip;
unsigned ll;
ll = strlen (value_name);
@@ -358,6 +355,29 @@ dhcpctl_status dhcpctl_set_data_value (dhcpctl_handle h,
return status;
}
+/* dhcpctl_set_null_value
+
+ Sets a null value on an object referred to by a dhcpctl_handle. */
+
+dhcpctl_status dhcpctl_set_null_value (dhcpctl_handle h,
+ const char *value_name)
+{
+ isc_result_t status;
+ omapi_data_string_t *name = (omapi_data_string_t *)0;
+ unsigned ll;
+
+ ll = strlen (value_name);
+ status = omapi_data_string_new (&name, ll, MDL);
+ if (status != ISC_R_SUCCESS)
+ return status;
+ memcpy (name -> value, value_name, ll);
+
+ status = omapi_set_value (h, (omapi_object_t *)0, name,
+ (omapi_typed_data_t *)0);
+ omapi_data_string_dereference (&name, MDL);
+ return status;
+}
+
/* dhcpctl_set_boolean_value
Sets a boolean value on an object - like dhcpctl_set_value,
@@ -370,7 +390,6 @@ dhcpctl_status dhcpctl_set_boolean_value (dhcpctl_handle h, int value,
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
int len;
- int ip;
status = omapi_data_string_new (&name, strlen (value_name), MDL);
if (status != ISC_R_SUCCESS)
@@ -401,7 +420,6 @@ dhcpctl_status dhcpctl_set_int_value (dhcpctl_handle h, int value,
omapi_typed_data_t *tv = (omapi_typed_data_t *)0;
omapi_data_string_t *name = (omapi_data_string_t *)0;
int len;
- int ip;
status = omapi_data_string_new (&name, strlen (value_name), MDL);
if (status != ISC_R_SUCCESS)
@@ -508,6 +526,17 @@ dhcpctl_status dhcpctl_object_refresh (dhcpctl_handle connection,
status = omapi_protocol_send_message (connection -> outer,
(omapi_object_t *)0,
message, (omapi_object_t *)0);
+
+ /* We don't want to send the contents of the object down the
+ wire, but we do need to reference it so that we know what
+ to do with the update. */
+ status = omapi_set_object_value (message, (omapi_object_t *)0,
+ "object", h);
+ if (status != ISC_R_SUCCESS) {
+ omapi_object_dereference (&message, MDL);
+ return status;
+ }
+
omapi_object_dereference (&message, MDL);
return status;
}