jsoninfo: simplify /mid output
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 17 Mar 2016 14:04:53 +0000 (15:04 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 17 Mar 2016 14:05:40 +0000 (15:05 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index 3ddfcf4..0b73bea 100644 (file)
@@ -627,8 +627,12 @@ void ipc_print_mid(struct autobuf *abuf) {
 
     while (entry != &mid_set[idx]) {
       abuf_json_mark_array_entry(true, abuf);
+
+      abuf_json_mark_object(true, false, abuf, "main");
       abuf_json_ip_address(abuf, "ipAddress", &entry->main_addr);
       abuf_json_int(abuf, "validityTime", entry->mid_timer ? (entry->mid_timer->timer_clock - now_times) : 0);
+      abuf_json_mark_object(false, false, abuf, NULL); // main
+
       {
         struct mid_address * alias = entry->aliases;