summaryrefslogtreecommitdiffstats
path: root/zebra/test_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/test_main.c')
-rw-r--r--zebra/test_main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/zebra/test_main.c b/zebra/test_main.c
index f98bb419..a92cd618 100644
--- a/zebra/test_main.c
+++ b/zebra/test_main.c
@@ -29,6 +29,7 @@
#include "log.h"
#include "privs.h"
#include "sigevent.h"
+#include "vrf.h"
#include "zebra/rib.h"
#include "zebra/zserv.h"
@@ -196,6 +197,29 @@ struct quagga_signal_t zebra_signals[] =
},
};
+/* Callback upon creating a new VRF. */
+static int
+zebra_vrf_new (vrf_id_t vrf_id, void **info)
+{
+ struct zebra_vrf *zvrf = *info;
+
+ if (! zvrf)
+ {
+ zvrf = zebra_vrf_alloc (vrf_id);
+ *info = (void *)zvrf;
+ }
+
+ return 0;
+}
+
+/* Zebra VRF initialization. */
+static void
+zebra_vrf_init (void)
+{
+ vrf_add_hook (VRF_NEW_HOOK, zebra_vrf_new);
+ vrf_init ();
+}
+
/* Main startup routine. */
int
main (int argc, char **argv)
@@ -294,6 +318,7 @@ main (int argc, char **argv)
access_list_init ();
/* Make kernel routing socket. */
+ zebra_vrf_init ();
kernel_init ();
route_read ();
zebra_vty_init();