diff options
| author | Carmine Scarpitta <cscarpit@cisco.com> | 2024-03-23 19:40:13 +0100 |
|---|---|---|
| committer | Carmine Scarpitta <cscarpit@cisco.com> | 2024-06-18 18:33:29 +0200 |
| commit | 73bfc5865f4ded8297096bbdb3cc67b1ba54600f (patch) | |
| tree | 682a1770155e1600dc74fcdeb88656f34d2734c8 | |
| parent | 7834c38ab38fe56a7384e77aa051316f9c6ec82b (diff) | |
isisd: Add API to get SRv6 locator info
Add an API to request information from the SRv6 SID Manager (zebra)
regarding a specific SRv6 locator.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
| -rw-r--r-- | isisd/isis_zebra.c | 18 | ||||
| -rw-r--r-- | isisd/isis_zebra.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 2412ec5e84..f5b3f712be 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -1368,6 +1368,24 @@ int isis_zebra_srv6_manager_release_locator_chunk(const char *name) return srv6_manager_release_locator_chunk(zclient, name); } +/** + * Ask the SRv6 Manager (zebra) about a specific locator + * + * @param name Locator name + * @return 0 on success, -1 otherwise + */ +int isis_zebra_srv6_manager_get_locator(const char *name) +{ + if (!name) + return -1; + + /* + * Send the Get Locator request to the SRv6 Manager and return the + * result + */ + return srv6_manager_get_locator(zclient, name); +} + static zclient_handler *const isis_handlers[] = { [ZEBRA_ROUTER_ID_UPDATE] = isis_router_id_update_zebra, [ZEBRA_INTERFACE_ADDRESS_ADD] = isis_zebra_if_address_add, diff --git a/isisd/isis_zebra.h b/isisd/isis_zebra.h index f1684b7c25..bfd23f69f4 100644 --- a/isisd/isis_zebra.h +++ b/isisd/isis_zebra.h @@ -68,4 +68,6 @@ void isis_zebra_srv6_adj_sid_uninstall(struct srv6_adjacency *sra); extern int isis_zebra_srv6_manager_get_locator_chunk(const char *name); extern int isis_zebra_srv6_manager_release_locator_chunk(const char *name); +extern int isis_zebra_srv6_manager_get_locator(const char *name); + #endif /* _ZEBRA_ISIS_ZEBRA_H */ |
