summaryrefslogtreecommitdiff
path: root/dhcpctl
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2001-05-18 00:29:59 +0000
committerTed Lemon <source@isc.org>2001-05-18 00:29:59 +0000
commit13d17468d752dc15390477c31ccf5a090eb94d58 (patch)
treecdcecc00ffe1ac7d2fd151d8ab9eb2364ee6b7ad /dhcpctl
parent98698054cc63929fbefbbf245e31d7ee0c1f9cfe (diff)
downloadisc-dhcp-13d17468d752dc15390477c31ccf5a090eb94d58.tar.gz
Fix up some error messages. Add refresh.
Diffstat (limited to 'dhcpctl')
-rw-r--r--dhcpctl/omshell.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/dhcpctl/omshell.c b/dhcpctl/omshell.c
index 32313f05..854ab11a 100644
--- a/dhcpctl/omshell.c
+++ b/dhcpctl/omshell.c
@@ -598,14 +598,18 @@ int main (int argc, char **argv, char **envp)
case REMOVE:
token = next_token (&val, (unsigned *)0, cfile);
if (token != END_OF_FILE && token != EOL) {
- printf ("usage: %s\n", val);
+ printf ("usage: remove\n");
skip_to_semi (cfile);
break;
}
if (!connected) {
printf ("not connected.\n");
- skip_to_semi (cfile);
+ break;
+ }
+
+ if (!oh) {
+ printf ("no object.\n");
break;
}
@@ -620,6 +624,38 @@ int main (int argc, char **argv, char **envp)
isc_result_totext (status));
break;
}
+ omapi_object_dereference (&oh, MDL);
+ break;
+
+ case REFRESH:
+ token = next_token (&val, (unsigned *)0, cfile);
+ if (token != END_OF_FILE && token != EOL) {
+ printf ("usage: refresh\n");
+ skip_to_semi (cfile);
+ break;
+ }
+
+ if (!connected) {
+ printf ("not connected.\n");
+ break;
+ }
+
+ if (!oh) {
+ printf ("no object.\n");
+ break;
+ }
+
+ status = dhcpctl_object_refresh(connection, oh);
+ if (status == ISC_R_SUCCESS)
+ status = dhcpctl_wait_for_completion
+ (oh, &waitstatus);
+ if (status == ISC_R_SUCCESS)
+ status = waitstatus;
+ if (status != ISC_R_SUCCESS) {
+ printf ("can't refresh object: %s\n",
+ isc_result_totext (status));
+ break;
+ }
break;
}