From 8cc6b6dd69cee050c16a1c871c986ed933141866 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 24 Jul 2014 23:35:20 +0200 Subject: Completely log simulations --- mmss/monitor_file.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mmss/monitor_file.cpp') diff --git a/mmss/monitor_file.cpp b/mmss/monitor_file.cpp index 249d779..0de8a92 100644 --- a/mmss/monitor_file.cpp +++ b/mmss/monitor_file.cpp @@ -55,6 +55,20 @@ void monitor_file_t::handle_init(node_t *node, const uint8_t *node_id, size_t le std::fprintf(file, "\n"); } +void monitor_file_t::handle_network(network_t *net) { + std::fprintf(file, "%llu NETWORK %s\n", (unsigned long long)net->get_context()->now(), net->get_name().c_str()); +} + +void monitor_file_t::handle_iface(node_t *node, iface_t *iface) { + std::fprintf(file, "%llu IFACE %s %s %s ", (unsigned long long)node->get_context()->now(), node->get_name().c_str(), iface->get_name().c_str(), iface->get_network()->get_name().c_str()); + + const gmrf_addr_t *addr = iface->get_address(); + for (size_t i = 0; i < GMRF_ADDR_LEN; i++) + std::fprintf(file, "%02x", addr->d[i]); + + std::fprintf(file, "\n"); +} + void monitor_file_t::handle_neigh(node_t *node, iface_t *iface, const gmrf_addr_t *addr, float rxcost, float txcost) { std::fprintf(file, "%llu NEIGH %s %s ", (unsigned long long)node->get_context()->now(), node->get_name().c_str(), iface->get_name().c_str()); for (size_t i = 0; i < GMRF_ADDR_LEN; i++) -- cgit v1.2.3