diff --git a/src/commandline/commands/nvo_cmd.c b/src/commandline/commands/nvo_cmd.c new file mode 100644 index 00000000..3eb0059e --- /dev/null +++ b/src/commandline/commands/nvo_cmd.c @@ -0,0 +1,68 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +void nvo_cmd_req() {} + +extern struct nvo_block *ugly_nvo_hack; + +static int show_exec ( int argc, char **argv ) { + + 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 ); +} + +struct command show_command __command = { + .name = "show", + .usage = "show\n", + .desc = "Show stored options", + .exec = show_exec, +}; + +static int set_exec ( int argc, char **argv ) { + unsigned long tag; + struct dhcp_option *option; + + if ( ! ugly_nvo_hack ) { + printf ( "No non-volatile option storage available\n" ); + return 1; + } + + if ( argc != 3 ) { + printf ( "Syntax: %s