ospf6d: add SPF logs, statistics, and display of SPF parameters
Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com>
[DL: adapted to rebase / readded randomly lost line]
[DL: killed timeval_subtract]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h
index 13699d6..0c86386 100644
--- a/ospf6d/ospf6d.h
+++ b/ospf6d/ospf6d.h
@@ -101,6 +101,17 @@
zlog_warn ("strftime error"); \
} while (0)
+#define threadtimer_string(now, t, buf, size) \
+ do { \
+ struct timeval result; \
+ if (!t) \
+ snprintf(buf, size, "inactive"); \
+ else { \
+ timersub(&t->u.sands, &now, &result); \
+ timerstring(&result, buf, size); \
+ } \
+} while (0)
+
/* for commands */
#define OSPF6_AREA_STR "Area information\n"
#define OSPF6_AREA_ID_STR "Area ID (as an IPv4 notation)\n"