ifconfig: Support ifconfig interface and update arg limit

From comment in cmd_ifconfig, it seems that we support `ifconfig [interface]`, but actually not considering the interface param now. After this commit, we only print the information of interface specified in param, just like linux.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng
2022-12-29 15:35:26 +08:00
committed by Xiang Xiao
parent a275567ad0
commit 93b4dc2692
3 changed files with 10 additions and 4 deletions

View File

@@ -244,9 +244,10 @@ static const struct cmdmap_s g_cmdmap[] =
#ifdef CONFIG_NET
# ifndef CONFIG_NSH_DISABLE_IFCONFIG
{ "ifconfig", cmd_ifconfig, 1, 11,
"[interface [<ip-address>|dhcp]] [dr|gw|gateway <dr-address>] "
"[netmask <net-mask>] [dns <dns-address>] [hw <hw-mac>]" },
{ "ifconfig", cmd_ifconfig, 1, 12,
"[interface [address_family] [<ip-address>|dhcp]] "
"[dr|gw|gateway <dr-address>] [netmask <net-mask>|prefixlen <len>] "
"[dns <dns-address>] [hw <hw-mac>]" },
# endif
# ifndef CONFIG_NSH_DISABLE_IFUPDOWN
{ "ifdown", cmd_ifdown, 2, 2, "<interface>" },