summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorOleg.Karfich@wago.com <Oleg.Karfich@wago.com>2018-08-31 09:01:32 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2018-09-04 10:07:52 +0200
commit14e668647e122e6a09bdfd2a077a8721fc46081b (patch)
tree28a6a77330f8555de6ed0cb95df29f61b4740846 /commands
parente9321ffd79bbf58549e2ed56d91728204b5f3b83 (diff)
downloadbarebox-14e668647e122e6a09bdfd2a077a8721fc46081b.tar.gz
commands: dhcp: add parameter for private data
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/Kconfig5
-rw-r--r--commands/dhcp.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/commands/Kconfig b/commands/Kconfig
index 951a869..675bd1c 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -1127,7 +1127,7 @@ config CMD_DHCP
help
DHCP client to obtain IP or boot params
- Usage: dhcp [-HvcuUr]
+ Usage: dhcp [-HvcuUro]
Options:
-H HOSTNAME hostname to send to the DHCP server
@@ -1135,7 +1135,8 @@ config CMD_DHCP
-c ID DHCP Client ID (code 61) submitted in DHCP requests
-u UUID DHCP Client UUID (code 97) submitted in DHCP requests
-U CLASS DHCP User class (code 77) submitted in DHCP requests
- -r RETRY retry limit (default 20)#
+ -r RETRY retry limit (default 20)
+ -o PRIVATE DATA private data (code 224) submitted in DHCP requests
config CMD_HOST
tristate
diff --git a/commands/dhcp.c b/commands/dhcp.c
index 1f07b2f..d9e844b 100644
--- a/commands/dhcp.c
+++ b/commands/dhcp.c
@@ -24,7 +24,7 @@ static int do_dhcp(int argc, char *argv[])
struct eth_device *edev;
const char *edevname;
- while ((opt = getopt(argc, argv, "H:v:c:u:U:r:")) > 0) {
+ while ((opt = getopt(argc, argv, "H:v:c:u:U:r:o:")) > 0) {
switch (opt) {
case 'H':
dhcp_param.hostname = optarg;
@@ -44,6 +44,9 @@ static int do_dhcp(int argc, char *argv[])
case 'r':
dhcp_param.retries = simple_strtoul(optarg, NULL, 10);
break;
+ case 'o':
+ dhcp_param.option224 = optarg;
+ break;
default:
return COMMAND_ERROR_USAGE;
}
@@ -72,13 +75,14 @@ BAREBOX_CMD_HELP_OPT("-v ID\t", "DHCP Vendor ID (code 60) submitted in DHCP requ
BAREBOX_CMD_HELP_OPT("-c ID\t", "DHCP Client ID (code 61) submitted in DHCP requests")
BAREBOX_CMD_HELP_OPT("-u UUID\t", "DHCP Client UUID (code 97) submitted in DHCP requests")
BAREBOX_CMD_HELP_OPT("-U CLASS", "DHCP User class (code 77) submitted in DHCP requests")
-BAREBOX_CMD_HELP_OPT("-r RETRY", "retry limit (default 20)");
+BAREBOX_CMD_HELP_OPT("-r RETRY", "retry limit (default 20)")
+BAREBOX_CMD_HELP_OPT("-o PRIVATE DATA", "private data (code 224) submitted in DHCP requests");
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(dhcp)
.cmd = do_dhcp,
BAREBOX_CMD_DESC("DHCP client to obtain IP or boot params")
- BAREBOX_CMD_OPTS("[-HvcuUr] [device]")
+ BAREBOX_CMD_OPTS("[-HvcuUro] [device]")
BAREBOX_CMD_GROUP(CMD_GRP_NET)
BAREBOX_CMD_HELP(cmd_dhcp_help)
BAREBOX_CMD_COMPLETE(eth_complete)