diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-06-08 07:15:47 +0200 |
---|---|---|
committer | Carmine Scarpitta <cscarpit@cisco.com> | 2024-06-17 17:09:45 +0200 |
commit | 36a310cc9f6ef7694d30fe3527a9462bb7155fd3 (patch) | |
tree | a9813807791799990611cb8240ac1e506e097617 /zebra/zapi_msg.c | |
parent | zebra: fix sid allocation should be different with 2 isis instances (diff) | |
download | frr-36a310cc9f6ef7694d30fe3527a9462bb7155fd3.tar.xz frr-36a310cc9f6ef7694d30fe3527a9462bb7155fd3.zip |
zebra, lib: add locator name in sid notify messages
In the near future, some daemons may only register SIDs. This may be
the case for the pathd daemon when creating SRv6 binding SIDs.
When a locator is getting deleted at ZEBRA level, the daemon may have
an easy way to find out the SIds to unregister to.
This commit proposes to add the locator name to the SID_SRV6_NOTIFY
message whenever possible. Only case when an allocation failure happens,
the locator will not be present. In all other places, the notify API
at procol levels has the locator name extra-parameter.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Diffstat (limited to 'zebra/zapi_msg.c')
-rw-r--r-- | zebra/zapi_msg.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 164c0dd68..2a1eea959 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1001,7 +1001,9 @@ void zsend_neighbor_notify(int cmd, struct interface *ifp, void zsend_srv6_sid_notify(struct zserv *client, const struct srv6_sid_ctx *ctx, struct in6_addr *sid_value, uint32_t func, - uint32_t wide_func, enum zapi_srv6_sid_notify note) + uint32_t wide_func, const char *locator_name, + enum zapi_srv6_sid_notify note) + { struct stream *s; uint16_t cmd = ZEBRA_SRV6_SID_NOTIFY; @@ -1027,6 +1029,13 @@ void zsend_srv6_sid_notify(struct zserv *client, const struct srv6_sid_ctx *ctx, stream_putl(s, func); /* SRv6 wide SID function */ stream_putl(s, wide_func); + /* SRv6 locator name optional */ + if (locator_name) { + stream_putw(s, strlen(locator_name)); + stream_put(s, locator_name, strlen(locator_name)); + } else + stream_putw(s, 0); + stream_putw_at(s, 0, stream_get_endp(s)); zserv_send_message(client, s); |