eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit ef7d33ee861ecf73c6b945a2d13c8b898e29a348
parent 62810ca3e76e162f80d0e619b43dd7f71bf2004c
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Wed,  4 Nov 2020 13:33:26 -0600

monitor: Pretty-print RTPROT_* values

Diffstat:
Mmonitor/nlmon.c | 21++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/monitor/nlmon.c b/monitor/nlmon.c @@ -6871,6 +6871,24 @@ static const char *family_to_string(uint8_t family) } } +static const char *protocol_to_string(uint8_t proto) +{ + switch (proto) { + case RTPROT_DHCP: + return "dhcp"; + case RTPROT_RA: + return "ra"; + case RTPROT_KERNEL: + return "kernel"; + case RTPROT_BOOT: + return "boot"; + case RTPROT_STATIC: + return "static"; + default: + return "Unknown"; + } +} + static void print_ifinfomsg(const struct ifinfomsg *info) { static struct flag_names iff_flags[] = { @@ -6936,7 +6954,8 @@ static void print_rtmsg(const struct rtmsg *msg) print_field("RTM Source Len: %hhu", msg->rtm_src_len); print_field("RTM TOS Field: %hhu", msg->rtm_tos); print_field("RTM Table: %hhu", msg->rtm_table); - print_field("RTM Protocol: %hhu", msg->rtm_protocol); + print_field("RTM Protocol: %s", + protocol_to_string(msg->rtm_protocol)); print_field("RTM Scope: %s", scope_to_string(msg->rtm_scope)); print_field("RTM Type: %hhu", msg->rtm_type); flags_str(rtm_flags, str, sizeof(str), msg->rtm_flags);