diff --git a/src/commandline/commands/nvo_cmd.c b/src/commandline/commands/nvo_cmd.c index 3eb0059e..ea1478f3 100644 --- a/src/commandline/commands/nvo_cmd.c +++ b/src/commandline/commands/nvo_cmd.c @@ -6,20 +6,37 @@ #include #include #include +#include void nvo_cmd_req() {} extern struct nvo_block *ugly_nvo_hack; static int show_exec ( int argc, char **argv ) { + struct config_context dummy_context; + char buf[256]; + int rc; if ( ! ugly_nvo_hack ) { printf ( "No non-volatile option storage available\n" ); return 1; } - hex_dump ( ugly_nvo_hack->options->data, - ugly_nvo_hack->options->len ); + if ( argc != 2 ) { + printf ( "Syntax: %s \n", argv[0] ); + return 1; + } + + dummy_context.options = ugly_nvo_hack->options; + if ( ( rc = show_setting ( &dummy_context, argv[1], buf, + sizeof ( buf ) ) ) != 0 ) { + printf ( "Could not find \"%s\": %s\n", + argv[1], strerror ( -rc ) ); + return 1; + } + + printf ( "%s = %s\n", argv[1], buf ); + return 0; } struct command show_command __command = { @@ -30,8 +47,8 @@ struct command show_command __command = { }; static int set_exec ( int argc, char **argv ) { - unsigned long tag; - struct dhcp_option *option; + struct config_context dummy_context; + int rc; if ( ! ugly_nvo_hack ) { printf ( "No non-volatile option storage available\n" ); @@ -39,19 +56,18 @@ static int set_exec ( int argc, char **argv ) { } if ( argc != 3 ) { - printf ( "Syntax: %s