summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-config.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-12-16 13:20:01 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-12-18 09:52:42 +0800
commitdf46fcfe4867fd16729bb10dfb82dcd43595c6c2 (patch)
treee1a086150319b7d9ad35910424deaf05d11c5db5 /ui/ncurses/nc-config.c
parent675d604772d99346e804b120c0c27cced985899a (diff)
downloadtalos-petitboot-df46fcfe4867fd16729bb10dfb82dcd43595c6c2.tar.gz
talos-petitboot-df46fcfe4867fd16729bb10dfb82dcd43595c6c2.zip
ui/ncurses: Add link status to system info & system config screens
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-config.c')
-rw-r--r--ui/ncurses/nc-config.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/ncurses/nc-config.c b/ui/ncurses/nc-config.c
index 4eeeff8..6c25260 100644
--- a/ui/ncurses/nc-config.c
+++ b/ui/ncurses/nc-config.c
@@ -471,17 +471,22 @@ static void config_screen_setup_widgets(struct config_screen *screen,
config_screen_network_change, screen);
screen->widgets.iface_l = widget_new_label(set, 0, 0, "Device:");
- screen->widgets.iface_f = widget_new_select(set, 0, 0, 20);
+ screen->widgets.iface_f = widget_new_select(set, 0, 0, 50);
for (i = 0; i < sysinfo->n_interfaces; i++) {
struct interface_info *info = sysinfo->interfaces[i];
+ char str[50], mac[20];
bool is_default;
is_default = ifcfg && !memcmp(ifcfg->hwaddr, info->hwaddr,
sizeof(ifcfg->hwaddr));
+ mac_str(info->hwaddr, info->hwaddr_size, mac, sizeof(mac));
+ snprintf(str, sizeof(str), "%s [%s, %s]", info->name, mac,
+ info->link ? "link up" : "link down");
+
widget_select_add_option(screen->widgets.iface_f,
- i, info->name, is_default);
+ i, str, is_default);
}
gw = ip = mask = NULL;
OpenPOWER on IntegriCloud