From 1cfcab536cb501cdfab14deb9ebdcf930c4daee4 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Thu, 17 May 2018 17:48:55 +0200 Subject: [PATCH] nic_router: Ipv4_config::print method Issue #2815 --- repos/os/src/server/nic_router/ipv4_config.cc | 10 ++++++++++ repos/os/src/server/nic_router/ipv4_config.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/repos/os/src/server/nic_router/ipv4_config.cc b/repos/os/src/server/nic_router/ipv4_config.cc index 46542461f5..5200327140 100644 --- a/repos/os/src/server/nic_router/ipv4_config.cc +++ b/repos/os/src/server/nic_router/ipv4_config.cc @@ -30,3 +30,13 @@ Ipv4_config::Ipv4_config(Ipv4_address_prefix interface, error("Bad IP configuration"); } } + + +void Ipv4_config::print(Output &output) const +{ + if (valid) { + Genode::print(output, "interface ", interface, ", gateway ", gateway, + ", DNS server ", dns_server); } + else { + Genode::print(output, "none"); } +} diff --git a/repos/os/src/server/nic_router/ipv4_config.h b/repos/os/src/server/nic_router/ipv4_config.h index e52e0deff7..e6e060bc5b 100644 --- a/repos/os/src/server/nic_router/ipv4_config.h +++ b/repos/os/src/server/nic_router/ipv4_config.h @@ -42,6 +42,13 @@ struct Net::Ipv4_config gateway != other.gateway || dns_server != other.dns_server; } + + + /********* + ** log ** + *********/ + + void print(Genode::Output &output) const; }; #endif /* _IPV4_CONFIG_H_ */