summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2023-12-12 21:04:49 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2023-12-18 10:08:45 +0100
commitd8477d4bb534e37121c08b358fd923c703540ae0 (patch)
tree81867837d754387a3348f8602622b120ba3dba3b /lib
parentbgpd: rework bgp_zebra_announce() function, separate nexthop handling (diff)
downloadfrr-d8477d4bb534e37121c08b358fd923c703540ae0.tar.xz
frr-d8477d4bb534e37121c08b358fd923c703540ae0.zip
bgpd, lib: add zapi_route_set_nhg_id() support
There is no function that both sets the nhg id, and sets the ZAPI_MESSAGE_NHG flag if the nhg id is valid. Create a ZAPI API to do this, and apply the changes wherever needed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/zclient.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index 8b6aebc2f..f249afe61 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -1169,6 +1169,15 @@ static inline void zapi_route_set_blackhole(struct zapi_route *api,
SET_FLAG(api->message, ZAPI_MESSAGE_NEXTHOP);
};
+static inline void zapi_route_set_nhg_id(struct zapi_route *api,
+ uint32_t *nhg_id)
+{
+ api->nexthop_num = 0;
+ api->nhgid = *nhg_id;
+ if (api->nhgid)
+ SET_FLAG(api->message, ZAPI_MESSAGE_NHG);
+};
+
extern enum zclient_send_status
zclient_send_mlag_register(struct zclient *client, uint32_t bit_map);
extern enum zclient_send_status