diff options
| author | Carmine Scarpitta <cscarpit@cisco.com> | 2024-03-23 19:07:33 +0100 |
|---|---|---|
| committer | Carmine Scarpitta <cscarpit@cisco.com> | 2024-09-05 10:59:59 +0200 |
| commit | c50b4b9afc2a23369f1fd26e5c8bd47a412fa04f (patch) | |
| tree | def8b9a3743bc8dbc32b8e042fcecae0646be9e1 | |
| parent | 4f185c5c9d0efe8d046aa361868e1e97108de192 (diff) | |
bgpd: 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-- | bgpd/bgp_zebra.c | 18 | ||||
| -rw-r--r-- | bgpd/bgp_zebra.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 6e2efabf8f..b2d63cb4f6 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -4090,6 +4090,24 @@ int bgp_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 bgp_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); +} + void bgp_zebra_send_nexthop_label(int cmd, mpls_label_t label, ifindex_t ifindex, vrf_id_t vrf_id, enum lsp_types_t ltype, struct prefix *p, diff --git a/bgpd/bgp_zebra.h b/bgpd/bgp_zebra.h index 55a4185bde..737ffb6b99 100644 --- a/bgpd/bgp_zebra.h +++ b/bgpd/bgp_zebra.h @@ -117,6 +117,8 @@ extern int bgp_zebra_update(struct bgp *bgp, afi_t afi, safi_t safi, extern int bgp_zebra_stale_timer_update(struct bgp *bgp); extern int bgp_zebra_srv6_manager_get_locator_chunk(const char *name); extern int bgp_zebra_srv6_manager_release_locator_chunk(const char *name); +extern int bgp_zebra_srv6_manager_get_locator(const char *name); + extern void bgp_zebra_send_nexthop_label(int cmd, mpls_label_t label, ifindex_t index, vrf_id_t vrfid, enum lsp_types_t ltype, |
