+static const struct command_registration ioutil_command_handlers[] = {
+ {
+ .name = "cat",
+ .handler = handle_cat_command,
+ .mode = COMMAND_ANY,
+ .help = "display text file content",
+ .usage= "file_name",
+ },
+ {
+ .name = "trunc",
+ .handler = handle_trunc_command,
+ .mode = COMMAND_ANY,
+ .help = "truncate a file to zero length",
+ .usage= "file_name",
+ },
+ {
+ .name = "cp",
+ .handler = handle_cp_command,
+ .mode = COMMAND_ANY,
+ .help = "copy a file",
+ .usage = "src_file_name dst_file_name",
+ },
+ {
+ .name = "append_file",
+ .handler = handle_append_command,
+ .mode = COMMAND_ANY,
+ .help = "append a variable number of strings to a file",
+ .usage= "file_name [string ...]",
+ },
+ {
+ .name = "meminfo",
+ .handler = handle_meminfo_command,
+ .mode = COMMAND_ANY,
+ .help = "display free heap space",
+ },
+ {
+ .name = "rm",
+ .mode = COMMAND_ANY,
+ .handler = handle_rm_command,
+ .help = "remove a directory or file",
+ .usage = "file_name",
+ },
+
+ /*
+ * REVISIT shouldn't most, or all, these zylinjtag_*()
+ * entries be #ifdef ZY1000? If not, why so they have
+ * those names?
+ *
+ * Peek and poke are security holes -- they manipulate
+ * server-internal addresses.
+ */
+
+ // jim handlers
+ {
+ .name = "peek",
+ .mode = COMMAND_ANY,
+ .jim_handler = zylinjtag_Jim_Command_peek,
+ .help = "peek at a memory address",
+ .usage = "address",
+ },
+ {
+ .name = "poke",
+ .mode = COMMAND_ANY,
+ .jim_handler = zylinjtag_Jim_Command_poke,
+ .help = "poke at a memory address",
+ .usage = "address value",
+ },
+ {
+ .name = "ls",
+ .mode = COMMAND_ANY,
+ .jim_handler = zylinjtag_Jim_Command_ls,
+ .help = "show a listing of files",
+ .usage = "dirname",
+ },
+ {
+ .name = "mac",
+ .mode = COMMAND_ANY,
+ .jim_handler = zylinjtag_Jim_Command_mac,
+ .help = "show MAC address",
+ },
+ {
+ .name = "ip",
+ .jim_handler = zylinjtag_Jim_Command_ip,
+ .mode = COMMAND_ANY,
+ .help = "show IP address",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
+int ioutil_init(struct command_context *cmd_ctx)