From d8477d4bb534e37121c08b358fd923c703540ae0 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Tue, 12 Dec 2023 21:04:49 +0100 Subject: 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 --- lib/zclient.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3