[systemd-commits] 2 commits - TODO src/network

Lennart Poettering lennart at kemper.freedesktop.org
Tue Aug 12 06:42:43 PDT 2014


 TODO                     |   17 +++++++++++++++++
 src/network/networkctl.c |   30 ++++++++++++++++++++++++------
 2 files changed, 41 insertions(+), 6 deletions(-)

New commits:
commit b873d33ec9583c92a0c2bc6807d010720fa31595
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 12 15:41:13 2014 +0200

    update TODO

diff --git a/TODO b/TODO
index 067691f..f3ba55a 100644
--- a/TODO
+++ b/TODO
@@ -28,6 +28,23 @@ Features:
   - I don't think there should be a client side object for dhcp
     releases (probably not even a directory in /run for it)
 
+* networkd:
+  - ipv4ll with multiple interfaces doesn't work when both dhcp and
+    ipv4ll is used. for some reasons the kernel will currently pick an
+    ipv4ll source address to reach non-ipv4ll gateways.
+  - dhcp and ipv4ll should probably be skipped for "lo" devices, even
+    if the user has a catchall .network file installed, that might
+    theoretically match it.
+  - when I plug/unplug my wired ethernet the operational state changes
+    between "unknown" and "carrier", not "dormant" and "carrier".
+  - we probably should introduce a new operational state that
+    indicates that we are trying to acquire some configuration for a
+    link but haven't acquired any yet. Just to inform the admin that
+    networkd cares about an interface, but is still in progress..
+
+* networkctl:
+  - sort output of "networkctl list" and "networkctl status -a" by ifindex
+
 * resolved:
   - DNSSEC
         - use base64 for key presentation?

commit df3fb561b2df486a495a5f0bcc83168bd1860533
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 12 15:41:01 2014 +0200

    networkctl: add a bit of color to the output

diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 2da5c83..9aec3f4 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -125,12 +125,13 @@ static int list_links(char **args, unsigned n) {
         }
 
         if (arg_legend)
-                printf("%3s %-16s %-10s %-10s %-10s\n", "IDX", "LINK", "TYPE", "STATE", "OPERATIONAL");
+                printf("%3s %-16s %-10s %-10s %-10s\n", "IDX", "LINK", "TYPE", "ADMIN", "OPERATIONAL");
 
         for (i = reply; i; i = sd_rtnl_message_next(i)) {
                 _cleanup_free_ char *state = NULL, *operational_state = NULL;
                 _cleanup_udev_device_unref_ struct udev_device *d = NULL;
-                char devid[2 + DECIMAL_STR_MAX(int)];
+                const char *on_color = "", *off_color = "";
+                 char devid[2 + DECIMAL_STR_MAX(int)];
                 _cleanup_free_ char *t = NULL;
                 const char *name;
                 unsigned iftype;
@@ -164,7 +165,15 @@ static int list_links(char **args, unsigned n) {
 
                 link_get_type_string(iftype, d, &t);
 
-                printf("%3i %-16s %-10s %-10s %-10s\n", ifindex, name, strna(t), strna(state), strna(operational_state));
+                if (streq_ptr(operational_state, "routable")) {
+                        on_color = ansi_highlight_green();
+                        off_color = ansi_highlight_off();
+                } else if (streq_ptr(operational_state, "degraded")) {
+                        on_color = ansi_highlight_yellow();
+                        off_color = ansi_highlight_off();
+                }
+
+                printf("%3i %-16s %-10s %-10s %s%-10s%s\n", ifindex, name, strna(t), strna(state), on_color, strna(operational_state), off_color);
                 c++;
         }
 
@@ -217,6 +226,7 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
         char devid[2 + DECIMAL_STR_MAX(int)];
         _cleanup_free_ char *t = NULL;
         const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL;
+        const char *on_color = "", *off_color = "";
         struct ether_addr e;
         unsigned iftype;
         int r, ifindex;
@@ -300,12 +310,20 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
                         model = udev_device_get_property_value(d, "ID_MODEL");
         }
 
-        printf("%i: %s\n", ifindex, name);
+        if (streq_ptr(operational_state, "routable")) {
+                on_color = ansi_highlight_green();
+                off_color = ansi_highlight_off();
+        } else if (streq_ptr(operational_state, "degraded")) {
+                on_color = ansi_highlight_yellow();
+                off_color = ansi_highlight_off();
+        }
+
+        printf("%s%s%s %i: %s\n", on_color, draw_special_char(DRAW_BLACK_CIRCLE), off_color, ifindex, name);
 
         printf("        Type: %s\n"
-               "       State: %s (%s)\n",
+               "       State: %s%s%s (%s)\n",
                strna(t),
-               strna(operational_state),
+               on_color, strna(operational_state), off_color,
                strna(state));
 
         if (path)



More information about the systemd-commits mailing list