diff options
author | Chirag Shah <chirag@cumulusnetworks.com> | 2019-02-04 02:29:59 +0100 |
---|---|---|
committer | Chirag Shah <chirag@cumulusnetworks.com> | 2019-02-07 04:57:40 +0100 |
commit | a80161574cfbecd17c83a9b85307f5fcd0329d4a (patch) | |
tree | d72a683674039121b32ae882e9d2b7a507bc1db8 /bgpd | |
parent | lib: advertise svi ip as macip opcode (diff) | |
download | frr-a80161574cfbecd17c83a9b85307f5fcd0329d4a.tar.xz frr-a80161574cfbecd17c83a9b85307f5fcd0329d4a.zip |
bgpd: advertise svi ip as macip zebra parse api
Ticket:CM-23782
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_zebra.c | 23 | ||||
-rw-r--r-- | bgpd/bgp_zebra.h | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index a477c3d34..3f18d69a2 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1936,6 +1936,29 @@ int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni) return zclient_send_message(zclient); } +int bgp_zebra_advertise_svi_macip(struct bgp *bgp, int advertise, vni_t vni) +{ + struct stream *s = NULL; + + /* Check socket. */ + if (!zclient || zclient->sock < 0) + return 0; + + /* Don't try to register if Zebra doesn't know of this instance. */ + if (!IS_BGP_INST_KNOWN_TO_ZEBRA(bgp)) + return 0; + + s = zclient->obuf; + stream_reset(s); + + zclient_create_header(s, ZEBRA_ADVERTISE_SVI_MACIP, bgp->vrf_id); + stream_putc(s, advertise); + stream_putl(s, vni); + stream_putw_at(s, 0, stream_get_endp(s)); + + return zclient_send_message(zclient); +} + int bgp_zebra_advertise_gw_macip(struct bgp *bgp, int advertise, vni_t vni) { struct stream *s = NULL; diff --git a/bgpd/bgp_zebra.h b/bgpd/bgp_zebra.h index c6520c43e..fc19c5e17 100644 --- a/bgpd/bgp_zebra.h +++ b/bgpd/bgp_zebra.h @@ -72,6 +72,8 @@ extern struct interface *if_lookup_by_ipv6_exact(struct in6_addr *, ifindex_t, extern int bgp_zebra_advertise_subnet(struct bgp *bgp, int advertise, vni_t vni); extern int bgp_zebra_advertise_gw_macip(struct bgp *, int, vni_t); +extern int bgp_zebra_advertise_svi_macip(struct bgp *bgp, int advertise, + vni_t vni); extern int bgp_zebra_advertise_all_vni(struct bgp *, int); extern int bgp_zebra_dup_addr_detection(struct bgp *bgp); extern int bgp_zebra_vxlan_flood_control(struct bgp *bgp, |