Add new function zclient_get_nhg_start that will allow an
upper level protocol to get a starting point for it's own
nhg space. Give each protocol a space of 50 million.
zebra will own the space from 0 -
199999999 because
of SYSTEM, KERNEL and CONNECT route types.
This is the start of some work that will allow upper
level protocols to install and maintain their own NHG's.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
stream_putw_at(s, 0, stream_get_endp(s));
return zclient_send_message(zclient);
}
+
+/*
+ * Get a starting nhg point for a routing protocol
+ */
+uint32_t zclient_get_nhg_start(uint32_t proto)
+{
+ assert(proto < ZEBRA_ROUTE_MAX);
+
+ return ZEBRA_NHG_SPACING * proto;
+}
extern struct zclient_options zclient_options_default;
+/*
+ * Each client is going to get it's own nexthop group space
+ * and we'll separate them by 50 million, we'll figure out where
+ * to start based upon the route_types.h
+ */
+#define ZEBRA_NHG_SPACING 50000000
+extern uint32_t zclient_get_nhg_start(uint32_t proto);
+
extern struct zclient *zclient_new(struct thread_master *m,
struct zclient_options *opt);