diff options
author | Thomas Markwalder <tmark@isc.org> | 2020-01-23 16:21:52 -0500 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2022-01-20 16:30:49 -0500 |
commit | 7f1524669755d7a6e6cd1c3fb80084df273f3dc1 (patch) | |
tree | 6a377a3ccee3135da05adf12e138aec3c3e40d4e /dhcpctl/omshell.c | |
parent | 7de26fe7a1a2822f667ccaf7c633673cb2d0cead (diff) | |
download | isc-dhcp-7f1524669755d7a6e6cd1c3fb80084df273f3dc1.tar.gz |
[#76] Initial implemention to dhcpctl_timed_wait_for_completion
common/conflex.c
includes/dhctoken.h
dhcpctl/omshell.c
Added support for "disconnect"
dhcpctl/cltest.2 - new file that exercizes timed waits and disconnect
dhcpctl/Makefile.am.in
Added cltest2.c
dhcpctl/dhcpctl.*
dhcpctl_timed_wait_for_completion() - new function
dhcpctl_disconnect() - new function
Added debug logging
omapip/dispatch.c
Added protocol logging
omapi_wait_for_completion()
Fixed dangling waiter reference
omapi_one_dispatch()
Added logic to skip emit writefds from select list
omapip/support.c
Changed annoying DEBUG logs to DEBUG_PROTOCOL
Diffstat (limited to 'dhcpctl/omshell.c')
-rw-r--r-- | dhcpctl/omshell.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dhcpctl/omshell.c b/dhcpctl/omshell.c index d5d31aa8..785f59a6 100644 --- a/dhcpctl/omshell.c +++ b/dhcpctl/omshell.c @@ -208,6 +208,7 @@ main(int argc, char **argv) { printf (" server <server address>\n"); printf (" key <key name> <key value>\n"); printf (" connect\n"); + printf (" disconnect\n"); printf (" new <object-type>\n"); printf (" set <name> = <value>\n"); printf (" create\n"); @@ -427,6 +428,28 @@ main(int argc, char **argv) { connected = 1; break; + case DISCONNECT: + token = next_token (&val, (unsigned *)0, cfile); + if (token != END_OF_FILE && token != EOL) { + printf ("usage: disconnect\n"); + skip_to_semi (cfile); + break; + } + + if (!connected || !connection) { + fprintf (stderr, "not connected\n"); + break; + } + + status = dhcpctl_disconnect (&connection, 0); + if (status != ISC_R_SUCCESS) { + fprintf (stderr, "dhcpctl_disconnect: %s\n", + isc_result_totext (status)); + break; + } + connected = 0; + break; + case TOKEN_NEW: token = next_token (&val, (unsigned *)0, cfile); if ((!is_identifier (token) && token != STRING)) { |