From 6bcc46c7578ffb6b55ada2c5604631b572b2eefe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Thu, 8 Nov 2018 17:47:00 +0000 Subject: [PATCH] Update mud and show status in path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud | 2 +- src/path.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mud b/mud index ccaac70..ff55d6a 160000 --- a/mud +++ b/mud @@ -1 +1 @@ -Subproject commit ccaac70a04df082f1f6f0f0a5f346d90ac131701 +Subproject commit ff55d6a17356947a6479d2d926c9addd08de116c diff --git a/src/path.c b/src/path.c index 66a92dc..702c298 100644 --- a/src/path.c +++ b/src/path.c @@ -50,7 +50,13 @@ gt_path_status(int fd) default: return -2; } + const char *statusstr = "DEGRADED"; + + if (res.path_status.ok) + statusstr = "OK"; + printf(term ? "path %s\n" + " status: %s\n" " bind: %s port %"PRIu16"\n" " public: %s port %"PRIu16"\n" " peer: %s port %"PRIu16"\n" @@ -61,7 +67,7 @@ gt_path_status(int fd) " download: %"PRIu64" bytes/s (max: %"PRIu64")\n" " output: %"PRIu64" packets\n" " input: %"PRIu64" packets\n" - : "path %s" + : "path %s %s" " %s %"PRIu16 " %s %"PRIu16 " %s %"PRIu16 @@ -75,6 +81,7 @@ gt_path_status(int fd) " %"PRIu64 "\n", statestr, + statusstr, bindstr[0] ? bindstr : "-", gt_get_port((struct sockaddr *)&res.path_status.local_addr), publstr[0] ? publstr : "-",