in addition to non default vrf, once a new vrf is available, the static
daemon registers to events from that vrf, including presence of
interfaces. this permits to create static route with nexthop=interface.
Reversely, an unregistration is scheduled too when vrf disappears.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
#include "static_memory.h"
#include "static_vrf.h"
#include "static_routes.h"
+#include "static_zebra.h"
#include "static_vty.h"
static void zebra_stable_node_cleanup(struct route_table *table,
static int static_vrf_enable(struct vrf *vrf)
{
+ static_zebra_vrf_register(vrf);
+
static_fixup_vrf_ids(vrf->info);
/*
static int static_vrf_disable(struct vrf *vrf)
{
+ static_zebra_vrf_unregister(vrf);
return 0;
}
static_nht_hash_cmp,
"Static Nexthop Tracking hash");
}
+
+void static_zebra_vrf_register(struct vrf *vrf)
+{
+ if (vrf->vrf_id == VRF_DEFAULT)
+ return;
+ zclient_send_reg_requests(zclient, vrf->vrf_id);
+}
+
+void static_zebra_vrf_unregister(struct vrf *vrf)
+{
+ if (vrf->vrf_id == VRF_DEFAULT)
+ return;
+ zclient_send_dereg_requests(zclient, vrf->vrf_id);
+}
struct static_route *si_changed,
vrf_id_t vrf_id, safi_t safi, bool install);
extern void static_zebra_init(void);
+extern void static_zebra_vrf_register(struct vrf *vrf);
+extern void static_zebra_vrf_unregister(struct vrf *vrf);
+
#endif