From: <Oleg.Karfich@wago.com>
To: barebox@lists.infradead.org
Cc: Oleg.Karfich@wago.com
Subject: [PATCH 2/3] commands: dhcp: add parameter for private data
Date: Fri, 31 Aug 2018 09:01:32 +0000 [thread overview]
Message-ID: <1535706079-10439-3-git-send-email-oleg.karfich@wago.com> (raw)
In-Reply-To: <1535706079-10439-1-git-send-email-oleg.karfich@wago.com>
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com>
---
commands/Kconfig | 5 +++--
commands/dhcp.c | 10 +++++++---
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)
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2018-08-31 9:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 9:01 [PATCH 0/3] extend dhcp functionality Oleg.Karfich
2018-08-31 9:01 ` [PATCH 1/3] net: dhcp: use private extension 224 also in discover requests Oleg.Karfich
2018-08-31 9:01 ` [PATCH 3/3] net: dhcp: add global variable for retries Oleg.Karfich
2018-09-04 6:12 ` Sascha Hauer
2018-09-04 7:02 ` Oleg.Karfich
2018-08-31 9:01 ` Oleg.Karfich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1535706079-10439-3-git-send-email-oleg.karfich@wago.com \
--to=oleg.karfich@wago.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox