]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Add the ability to grab a nhg starting id
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 22 Apr 2020 13:41:01 +0000 (09:41 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Mon, 28 Sep 2020 16:40:59 +0000 (12:40 -0400)
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>
lib/zclient.c
lib/zclient.h

index c5016d22e2c9c922c99da49b8a16830659d158e4..b0549bf84e8d44a0b15e1901c9a88851e0c0ef45 100644 (file)
@@ -4001,3 +4001,13 @@ int zclient_send_neigh_discovery_req(struct zclient *zclient,
        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;
+}
index 050877f27a221196d146f5eb30e13a30b6f84fac..d2f559c45d239051a7367304025e1d311cf2ffb4 100644 (file)
@@ -671,6 +671,14 @@ struct zclient_options {
 
 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);