zebra: count iface up/down events and keep last time of their occurrence

It is quite useful to be able to assert whether specific interfaces have
flapped or also to verify that specific interfaces have not flapped.

By having counters for those events and storing the last time of their
occurrence, this is made possible.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Tested-by: NetDEF CI System <cisystem@netdef.org>
diff --git a/zebra/interface.h b/zebra/interface.h
index dbb33c5..8baf186 100644
--- a/zebra/interface.h
+++ b/zebra/interface.h
@@ -23,6 +23,7 @@
 #define _ZEBRA_INTERFACE_H
 
 #include "redistribute.h"
+#include "event_counter.h"
 
 #ifdef HAVE_IRDP
 #include "zebra/irdp.h"
@@ -188,6 +189,10 @@
   /* Installed addresses chains tree. */
   struct route_table *ipv4_subnets;
 
+  /* Information about up/down changes */
+  struct event_counter up_events;
+  struct event_counter down_events;
+
 #if defined(HAVE_RTADV)
   struct rtadvconf rtadv;
 #endif /* RTADV */
@@ -222,6 +227,7 @@
 extern void if_down (struct interface *);
 extern void if_refresh (struct interface *);
 extern void if_flags_update (struct interface *, uint64_t);
+extern void if_startup_count_up (void);
 extern int if_subnet_add (struct interface *, struct connected *);
 extern int if_subnet_delete (struct interface *, struct connected *);