summaryrefslogtreecommitdiff
path: root/dhcpctl
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-01-26 17:24:30 +0000
committerTed Lemon <source@isc.org>2000-01-26 17:24:30 +0000
commit032aca19ea3acefb63b7bbd577e3948932df16b9 (patch)
treeb3ff113891358d33e16cb7660ae22668c0a07b8d /dhcpctl
parent5d959a403dd85b874c048e9b8e88a65a83170321 (diff)
downloadisc-dhcp-032aca19ea3acefb63b7bbd577e3948932df16b9.tar.gz
Demonstrate removal of an object.
Diffstat (limited to 'dhcpctl')
-rw-r--r--dhcpctl/test.c44
1 files changed, 39 insertions, 5 deletions
diff --git a/dhcpctl/test.c b/dhcpctl/test.c
index 42a34799..3f41cf06 100644
--- a/dhcpctl/test.c
+++ b/dhcpctl/test.c
@@ -114,7 +114,7 @@ option domain-name-servers 10.0.0.1, 10.0.0.2;",
exit (1);
}
-#if 1
+/*#if 0 */
memset (&cid, 0, sizeof cid);
status = omapi_data_string_new (&cid, 6, MDL);
if (status != ISC_R_SUCCESS) {
@@ -127,17 +127,19 @@ option domain-name-servers 10.0.0.1, 10.0.0.2;",
cid -> value [2] = 0x5a; cid -> value [3] = 0xf8;
cid -> value [4] = 0x00; cid -> value [5] = 0xbb;
+ doitagain:
status = dhcpctl_set_value (host_handle,
cid, "dhcp-client-identifier");
-#else
- status = dhcpctl_set_string_value (host_handle, "grosse",
- "dhcp-client-identifier");
+/*#else
+ doitagain: */
+ status = dhcpctl_set_string_value (host_handle, "gnorf",
+ "name");
if (status != ISC_R_SUCCESS) {
fprintf (stderr, "dhcpctl_set_value: %s\n",
isc_result_totext (status));
exit (1);
}
-#endif
+/*#endif*/
status = dhcpctl_set_value (host_handle, groupname, "group");
if (status != ISC_R_SUCCESS) {
@@ -218,6 +220,38 @@ option smtp-server 10.0.0.1;",
isc_result_totext (waitstatus));
exit (1);
}
+
+ status = dhcpctl_object_remove (connection, host_handle);
+ if (status != ISC_R_SUCCESS) {
+ fprintf (stderr, "dhcpctl_object_remove: %s\n",
+ isc_result_totext (status));
+ exit (1);
+ }
+ status = dhcpctl_wait_for_completion (host_handle,
+ &waitstatus);
+ if (status != ISC_R_SUCCESS) {
+ fprintf (stderr,
+ "remove: dhcpctl_wait_for_completion: %s\n",
+ isc_result_totext (status));
+ exit (1);
+ }
+ if (waitstatus != ISC_R_SUCCESS) {
+ fprintf (stderr,
+ "remove: dhcpctl_wait_for_completion: %s\n",
+ isc_result_totext (waitstatus));
+ exit (1);
+ }
+
+ omapi_object_dereference (&host_handle, MDL);
+
+ status = dhcpctl_new_object (&host_handle, connection, "host");
+ if (status != ISC_R_SUCCESS) {
+ fprintf (stderr, "dhcpctl_new_object: %s\n",
+ isc_result_totext (status));
+ exit (1);
+ }
+
+ goto doitagain;
}
memset (&result, 0, sizeof result);