}
/** x86 CPU feature detection command */
-struct command cpuid_command __command = {
- .name = "cpuid",
- .exec = cpuid_exec,
-};
+COMMAND ( cpuid, cpuid_exec );
}
/** PXE commands */
-struct command pxe_commands[] __command = {
- {
- .name = "startpxe",
- .exec = startpxe_exec,
- },
- {
- .name = "stoppxe",
- .exec = stoppxe_exec,
- },
-};
+COMMAND ( startpxe, startpxe_exec );
+COMMAND ( stoppxe, stoppxe_exec );
}
/** "echo" command */
-struct command echo_command __command = {
- .name = "echo",
- .exec = echo_exec,
-};
+COMMAND ( echo, echo_exec );
/** "exit" options */
struct exit_options {};
}
/** "exit" command */
-struct command exit_command __command = {
- .name = "exit",
- .exec = exit_exec,
-};
+COMMAND ( exit, exit_exec );
/** "isset" options */
struct isset_options {};
}
/** "isset" command */
-struct command isset_command __command = {
- .name = "isset",
- .exec = isset_exec,
-};
+COMMAND ( isset, isset_exec );
/** "iseq" options */
struct iseq_options {};
}
/** "iseq" command */
-struct command iseq_command __command = {
- .name = "iseq",
- .exec = iseq_exec,
-};
+COMMAND ( iseq, iseq_exec );
/** "sleep" options */
struct sleep_options {};
}
/** "sleep" command */
-struct command sleep_command __command = {
- .name = "sleep",
- .exec = sleep_exec,
-};
+COMMAND ( sleep, sleep_exec );
return digest_exec ( argc, argv, &md4_algorithm );
}
-struct command md4sum_command __command = {
- .name = "md4sum",
- .exec = md4sum_exec,
-};
+COMMAND ( md4sum, md4sum_exec );
return digest_exec ( argc, argv, &sha224_algorithm );
}
-struct command sha224sum_command __command = {
- .name = "sha224sum",
- .exec = sha224sum_exec,
-};
+COMMAND ( sha224sum, sha224sum_exec );
return digest_exec ( argc, argv, &sha256_algorithm );
}
-struct command sha256sum_command __command = {
- .name = "sha256sum",
- .exec = sha256sum_exec,
-};
+COMMAND ( sha256sum, sha256sum_exec );
return digest_exec ( argc, argv, &sha384_algorithm );
}
-struct command sha384sum_command __command = {
- .name = "sha384sum",
- .exec = sha384sum_exec,
-};
+COMMAND ( sha384sum, sha384sum_exec );
return digest_exec ( argc, argv, &sha512_algorithm );
}
-struct command sha512sum_command __command = {
- .name = "sha512sum",
- .exec = sha512sum_exec,
-};
+COMMAND ( sha512sum, sha512sum_exec );
}
/** Booting commands */
-struct command autoboot_commands[] __command = {
- {
- .name = "autoboot",
- .exec = autoboot_exec,
- },
-};
+COMMAND ( autoboot, autoboot_exec );
}
/** Certificate management commands */
-struct command certmgmt_commands[] __command = {
- {
- .name = "certstat",
- .exec = certstat_exec,
- },
- {
- .name = "certstore",
- .exec = certstore_exec,
- },
- {
- .name = "certfree",
- .exec = certfree_exec,
- },
-};
+COMMAND ( certstat, certstat_exec );
+COMMAND ( certstore, certstore_exec );
+COMMAND ( certfree, certfree_exec );
}
/** Configuration UI commands */
-struct command config_command __command = {
- .name = "config",
- .exec = config_exec,
-};
+COMMAND ( config, config_exec );
}
/** Console management commands */
-struct command console_commands[] __command = {
- {
- .name = "console",
- .exec = console_exec,
- },
- {
- .name = "colour",
- .exec = colour_exec,
- },
- {
- .name = "cpair",
- .exec = cpair_exec,
- },
-};
+COMMAND ( console, console_exec );
+COMMAND ( colour, colour_exec );
+COMMAND ( cpair, cpair_exec );
}
/** DHCP management commands */
-struct command dhcp_commands[] __command = {
- {
- .name = "dhcp",
- .exec = ifconf_exec, /* synonym for "ifconf" */
- },
- {
- .name = "pxebs",
- .exec = pxebs_exec,
- },
-};
+COMMAND ( dhcp, ifconf_exec ); /* synonym for "ifconf" */
+COMMAND ( pxebs, pxebs_exec );
return digest_exec ( argc, argv, &sha1_algorithm );
}
-struct command md5sum_command __command = {
- .name = "md5sum",
- .exec = md5sum_exec,
-};
-
-struct command sha1sum_command __command = {
- .name = "sha1sum",
- .exec = sha1sum_exec,
-};
+COMMAND ( md5sum, md5sum_exec );
+COMMAND ( sha1sum, sha1sum_exec );
/* Drag in commands for any other enabled algorithms */
REQUIRING_SYMBOL ( digest_exec );
}
/** Dynamic user interface commands */
-struct command dynui_commands[] __command = {
- {
- .name = "menu",
- .exec = dynui_exec,
- },
- {
- .name = "form",
- .exec = dynui_exec,
- },
- {
- .name = "item",
- .exec = item_exec,
- },
- {
- .name = "choose",
- .exec = choose_exec,
- },
- {
- .name = "present",
- .exec = present_exec,
- },
-};
+COMMAND ( menu, dynui_exec );
+COMMAND ( form, dynui_exec );
+COMMAND ( item, item_exec );
+COMMAND ( choose, choose_exec );
+COMMAND ( present, present_exec );
}
/** Fibre Channel management commands */
-struct command fcmgmt_commands[] __command = {
- {
- .name = "fcstat",
- .exec = fcstat_exec,
- },
- {
- .name = "fcels",
- .exec = fcels_exec,
- },
-};
+COMMAND ( fcstat, fcstat_exec );
+COMMAND ( fcels, fcels_exec );
}
/** Flattened Device Tree commands */
-struct command fdt_commands[] __command = {
- {
- .name = "fdt",
- .exec = fdt_exec,
- },
-};
+COMMAND ( fdt, fdt_exec );
}
/** GDB stub commands */
-struct command gdbstub_commands[] __command = {
- {
- .name = "gdbstub",
- .exec = gdbstub_exec,
- },
-};
+COMMAND ( gdbstub, gdbstub_exec );
}
/** Infiniband commands */
-struct command ibmgmt_commands[] __command = {
- {
- .name = "ibstat",
- .exec = ibstat_exec,
- },
-};
+COMMAND ( ibstat, ibstat_exec );
}
/** Interface management commands */
-struct command ifmgmt_commands[] __command = {
- {
- .name = "ifopen",
- .exec = ifopen_exec,
- },
- {
- .name = "ifclose",
- .exec = ifclose_exec,
- },
- {
- .name = "ifstat",
- .exec = ifstat_exec,
- },
- {
- .name = "ifconf",
- .exec = ifconf_exec,
- },
- {
- .name = "iflinkwait",
- .exec = iflinkwait_exec,
- },
-};
+COMMAND ( ifopen, ifopen_exec );
+COMMAND ( ifclose, ifclose_exec );
+COMMAND ( ifstat, ifstat_exec );
+COMMAND ( ifconf, ifconf_exec );
+COMMAND ( iflinkwait, iflinkwait_exec );
}
/** Archive image commands */
-struct command image_archive_commands[] __command = {
- {
- .name = "imgextract",
- .exec = imgextract_exec,
- },
-};
+COMMAND ( imgextract, imgextract_exec );
return imgmulti_exec ( argc, argv, unregister_image );
}
-/** Image management commands */
-struct command image_commands[] __command = {
- {
- .name = "imgfetch",
- .exec = imgfetch_exec,
- },
- {
- .name = "module",
- .exec = imgfetch_exec, /* synonym for "imgfetch" */
- },
- {
- .name = "initrd",
- .exec = imgfetch_exec, /* synonym for "imgfetch" */
- },
- {
- .name = "kernel",
- .exec = imgselect_exec, /* synonym for "imgselect" */
- },
- {
- .name = "chain",
- .exec = imgexec_exec, /* synonym for "imgexec" */
- },
- {
- .name = "imgselect",
- .exec = imgselect_exec,
- },
- {
- .name = "imgload",
- .exec = imgselect_exec, /* synonym for "imgselect" */
- },
- {
- .name = "imgargs",
- .exec = imgargs_exec,
- },
- {
- .name = "imgexec",
- .exec = imgexec_exec,
- },
- {
- .name = "boot", /* synonym for "imgexec" */
- .exec = imgexec_exec,
- },
- {
- .name = "imgstat",
- .exec = imgstat_exec,
- },
- {
- .name = "imgfree",
- .exec = imgfree_exec,
- },
-};
+/* "imgfetch" and synonyms */
+COMMAND ( imgfetch, imgfetch_exec );
+COMMAND ( module, imgfetch_exec );
+COMMAND ( initrd, imgfetch_exec );
+
+/* "imgselect" and synonyms */
+COMMAND ( imgselect, imgselect_exec );
+COMMAND ( imgload, imgselect_exec );
+COMMAND ( kernel, imgselect_exec );
+
+/* "imgexec" and synonyms */
+COMMAND ( imgexec, imgexec_exec );
+COMMAND ( chain, imgexec_exec );
+COMMAND ( boot, imgexec_exec );
+
+/* Other image management commands */
+COMMAND ( imgargs, imgargs_exec );
+COMMAND ( imgstat, imgstat_exec );
+COMMAND ( imgfree, imgfree_exec );
}
/** Image encryption management commands */
-struct command image_crypt_commands[] __command = {
- {
- .name = "imgdecrypt",
- .exec = imgdecrypt_exec,
- },
-};
+COMMAND ( imgdecrypt, imgdecrypt_exec );
}
/** Read memory command */
-struct command imgmem_commands[] __command = {
- {
- .name = "imgmem",
- .exec = imgmem_exec,
- },
-};
+COMMAND ( imgmem, imgmem_exec );
}
/** Image trust management commands */
-struct command image_trust_commands[] __command = {
- {
- .name = "imgtrust",
- .exec = imgtrust_exec,
- },
- {
- .name = "imgverify",
- .exec = imgverify_exec,
- },
-};
+COMMAND ( imgtrust, imgtrust_exec );
+COMMAND ( imgverify, imgverify_exec );
}
/** Routing table management commands */
-struct command ipstat_commands[] __command = {
- {
- .name = "ipstat",
- .exec = ipstat_exec,
- },
-};
+COMMAND ( ipstat, ipstat_exec );
}
/** Wireless interface management commands */
-struct command iwmgmt_commands[] __command = {
- {
- .name = "iwstat",
- .exec = iwstat_exec,
- },
- {
- .name = "iwlist",
- .exec = iwlist_exec,
- },
-};
+COMMAND ( iwstat, iwstat_exec );
+COMMAND ( iwlist, iwlist_exec );
}
/** Login commands */
-struct command login_command __command = {
- .name = "login",
- .exec = login_exec,
-};
+COMMAND ( login, login_exec );
}
/** Loopback testing commands */
-struct command lotest_command __command = {
- .name = "lotest",
- .exec = lotest_exec,
-};
+COMMAND ( lotest, lotest_exec );
}
/** Neighbour management commands */
-struct command neighbour_commands[] __command = {
- {
- .name = "nstat",
- .exec = nstat_exec,
- },
-};
+COMMAND ( nstat, nstat_exec );
}
/** The "nslookup" command */
-struct command nslookup_command __command = {
- .name = "nslookup",
- .exec = nslookup_exec,
-};
+COMMAND ( nslookup, nslookup_exec );
}
/** NTP command */
-struct command ntp_command __command = {
- .name = "ntp",
- .exec = ntp_exec,
-};
+COMMAND ( ntp, ntp_exec );
}
/** Non-volatile option commands */
-struct command nvo_commands[] __command = {
- {
- .name = "show",
- .exec = show_exec,
- },
- {
- .name = "set",
- .exec = set_exec,
- },
- {
- .name = "clear",
- .exec = clear_exec,
- },
- {
- .name = "read",
- .exec = read_exec,
- },
- {
- .name = "inc",
- .exec = inc_exec,
- },
-};
+COMMAND ( show, show_exec );
+COMMAND ( set, set_exec );
+COMMAND ( clear, clear_exec );
+COMMAND ( read, read_exec );
+COMMAND ( inc, inc_exec );
}
/** Request parameter commands */
-struct command param_commands[] __command = {
- {
- .name = "params",
- .exec = params_exec,
- },
- {
- .name = "param",
- .exec = param_exec,
- },
-};
+COMMAND ( params, params_exec );
+COMMAND ( param, param_exec );
}
/** PCI commands */
-struct command pci_commands[] __command = {
- {
- .name = "pciscan",
- .exec = pciscan_exec,
- },
-};
+COMMAND ( pciscan, pciscan_exec );
}
/** Ping command */
-struct command ping_command __command = {
- .name = "ping",
- .exec = ping_exec,
-};
+COMMAND ( ping, ping_exec );
}
/** "poweroff" command */
-struct command poweroff_command __command = {
- .name = "poweroff",
- .exec = poweroff_exec,
-};
+COMMAND ( poweroff, poweroff_exec );
}
/** Profiling commands */
-struct command profstat_commands[] __command = {
- {
- .name = "profstat",
- .exec = profstat_exec,
- },
-};
+COMMAND ( profstat, profstat_exec );
}
/** "reboot" command */
-struct command reboot_command __command = {
- .name = "reboot",
- .exec = reboot_exec,
-};
+COMMAND ( reboot, reboot_exec );
}
/** Routing table management commands */
-struct command route_commands[] __command = {
- {
- .name = "route",
- .exec = route_exec,
- },
-};
+COMMAND ( route, route_exec );
}
/** SAN commands */
-struct command sanboot_commands[] __command = {
- {
- .name = "sanhook",
- .exec = sanhook_exec,
- },
- {
- .name = "sanboot",
- .exec = sanboot_exec,
- },
- {
- .name = "sanunhook",
- .exec = sanunhook_exec,
- },
-};
+COMMAND ( sanhook, sanhook_exec );
+COMMAND ( sanboot, sanboot_exec );
+COMMAND ( sanunhook, sanunhook_exec );
}
/** Shim commands */
-struct command shim_commands[] __command = {
- {
- .name = "shim",
- .exec = shim_exec,
- },
-};
+COMMAND ( shim, shim_exec );
}
/** Sync commands */
-struct command sync_command __command = {
- .name = "sync",
- .exec = sync_exec,
-};
+COMMAND ( sync, sync_exec );
}
/** "time" command */
-struct command time_command __command = {
- .name = "time",
- .exec = time_exec,
-};
+COMMAND ( time, time_exec );
}
/** USB commands */
-struct command usb_commands[] __command = {
- {
- .name = "usbscan",
- .exec = usbscan_exec,
- },
-};
+COMMAND ( usbscan, usbscan_exec );
}
/** VLAN commands */
-struct command vlan_commands[] __command = {
- {
- .name = "vcreate",
- .exec = vcreate_exec,
- },
- {
- .name = "vdestroy",
- .exec = vdestroy_exec,
- },
-};
+COMMAND ( vcreate, vcreate_exec );
+COMMAND ( vdestroy, vdestroy_exec );
}
/** "help" command */
-struct command help_command __command = {
- .name = "help",
- .exec = help_exec,
-};
+COMMAND ( help, help_exec );
/**
* Start command shell
}
/** "shell" command */
-struct command shell_command __command = {
- .name = "shell",
- .exec = shell_exec,
-};
+COMMAND ( shell, shell_exec );
}
/** "goto" command */
-struct command goto_command __command = {
- .name = "goto",
- .exec = goto_exec,
-};
+COMMAND ( goto, goto_exec );
/** "prompt" options */
struct prompt_options {
}
/** "prompt" command */
-struct command prompt_command __command = {
- .name = "prompt",
- .exec = prompt_exec,
-};
+COMMAND ( prompt, prompt_exec );
#define COMMANDS __table ( struct command, "commands" )
-#define __command __table_entry ( COMMANDS, 01 )
+#define __command( name ) __table_entry ( COMMANDS, _C2 ( 01., name ) )
+
+#define COMMAND( name, exec ) \
+ struct command name ## _command __command ( name ) = { \
+ #name, exec \
+ }
extern char * concat_args ( char **args );