diff options
author | Michael Brown | 2013-11-05 00:05:48 +0100 |
---|---|---|
committer | Michael Brown | 2013-11-05 18:42:55 +0100 |
commit | 452fb2d0a2fc9d090e070fcf47b3c58ff1f0deb2 (patch) | |
tree | ab17124a556a4c58eb371335b0ff7f920c91f72c /src/hci | |
parent | [cmdline] Add "ifconf" command (diff) | |
download | ipxe-452fb2d0a2fc9d090e070fcf47b3c58ff1f0deb2.tar.gz ipxe-452fb2d0a2fc9d090e070fcf47b3c58ff1f0deb2.tar.xz ipxe-452fb2d0a2fc9d090e070fcf47b3c58ff1f0deb2.zip |
[cmdline] Make "dhcp" command a synonym for "ifconf"
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci')
-rw-r--r-- | src/hci/commands/dhcp_cmd.c | 49 | ||||
-rw-r--r-- | src/hci/commands/ifmgmt_cmd.c | 2 |
2 files changed, 2 insertions, 49 deletions
diff --git a/src/hci/commands/dhcp_cmd.c b/src/hci/commands/dhcp_cmd.c index 1b7df765..feeb55ee 100644 --- a/src/hci/commands/dhcp_cmd.c +++ b/src/hci/commands/dhcp_cmd.c @@ -41,53 +41,6 @@ FILE_LICENCE ( GPL2_OR_LATER ); * */ -/** "dhcp" options */ -struct dhcp_options {}; - -/** "dhcp" option list */ -static struct option_descriptor dhcp_opts[] = {}; - -/** - * Execute "dhcp" command for a network device - * - * @v netdev Network device - * @v opts Command options - * @ret rc Return status code - */ -static int dhcp_payload ( struct net_device *netdev, - struct dhcp_options *opts __unused ) { - int rc; - - if ( ( rc = dhcp ( netdev ) ) != 0 ) { - printf ( "Could not configure %s: %s\n", - netdev->name, strerror ( rc ) ); - - /* Close device on failure, to avoid memory exhaustion */ - netdev_close ( netdev ); - - return rc; - } - - return 0; -} - -/** "dhcp" command descriptor */ -static struct ifcommon_command_descriptor dhcp_cmd = - IFCOMMON_COMMAND_DESC ( struct dhcp_options, dhcp_opts, - 0, MAX_ARGUMENTS, "[<interface>...]", - dhcp_payload, 1 ); - -/** - * The "dhcp" command - * - * @v argc Argument count - * @v argv Argument list - * @ret rc Return status code - */ -static int dhcp_exec ( int argc, char **argv ) { - return ifcommon_exec ( argc, argv, &dhcp_cmd ); -} - /** "pxebs" options */ struct pxebs_options {}; @@ -138,7 +91,7 @@ static int pxebs_exec ( int argc, char **argv ) { struct command dhcp_commands[] __command = { { .name = "dhcp", - .exec = dhcp_exec, + .exec = ifconf_exec, /* synonym for "ifconf" */ }, { .name = "pxebs", diff --git a/src/hci/commands/ifmgmt_cmd.c b/src/hci/commands/ifmgmt_cmd.c index 2fd56ce5..f3d00ca3 100644 --- a/src/hci/commands/ifmgmt_cmd.c +++ b/src/hci/commands/ifmgmt_cmd.c @@ -238,7 +238,7 @@ static struct ifcommon_command_descriptor ifconf_cmd = * @v argv Argument list * @ret rc Return status code */ -static int ifconf_exec ( int argc, char **argv ) { +int ifconf_exec ( int argc, char **argv ) { return ifcommon_exec ( argc, argv, &ifconf_cmd ); } |