Update mud and show status in path

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-11-08 17:47:00 +00:00
parent 3898afd524
commit 6bcc46c757
2 changed files with 9 additions and 2 deletions

2
mud

Submodule mud updated: ccaac70a04...ff55d6a173

View File

@@ -50,7 +50,13 @@ gt_path_status(int fd)
default: return -2; default: return -2;
} }
const char *statusstr = "DEGRADED";
if (res.path_status.ok)
statusstr = "OK";
printf(term ? "path %s\n" printf(term ? "path %s\n"
" status: %s\n"
" bind: %s port %"PRIu16"\n" " bind: %s port %"PRIu16"\n"
" public: %s port %"PRIu16"\n" " public: %s port %"PRIu16"\n"
" peer: %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" " download: %"PRIu64" bytes/s (max: %"PRIu64")\n"
" output: %"PRIu64" packets\n" " output: %"PRIu64" packets\n"
" input: %"PRIu64" packets\n" " input: %"PRIu64" packets\n"
: "path %s" : "path %s %s"
" %s %"PRIu16 " %s %"PRIu16
" %s %"PRIu16 " %s %"PRIu16
" %s %"PRIu16 " %s %"PRIu16
@@ -75,6 +81,7 @@ gt_path_status(int fd)
" %"PRIu64 " %"PRIu64
"\n", "\n",
statestr, statestr,
statusstr,
bindstr[0] ? bindstr : "-", bindstr[0] ? bindstr : "-",
gt_get_port((struct sockaddr *)&res.path_status.local_addr), gt_get_port((struct sockaddr *)&res.path_status.local_addr),
publstr[0] ? publstr : "-", publstr[0] ? publstr : "-",