summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_mplsvpn.h
diff options
context:
space:
mode:
authorHiroki Shirokura <slank.dev@gmail.com>2020-12-19 03:04:40 +0100
committerMark Stapp <mjs@voltanet.io>2021-06-02 16:24:48 +0200
commitb72c9e14756feba0af0ebff2159069c5b55224fc (patch)
tree4e37970a9abda68e6838302c2e6dc5feb679bbec /bgpd/bgp_mplsvpn.h
parentbgpd: cli for srv6-locator assignment (step4) (diff)
downloadfrr-b72c9e14756feba0af0ebff2159069c5b55224fc.tar.xz
frr-b72c9e14756feba0af0ebff2159069c5b55224fc.zip
bgpd: cli for SRv6 SID alloc to redirect to vrf (step4)
This commit add cil to configure BGP SRv6-VPN sid allocation. Almost mechanism are based on BGP MPLS-VPN. User can allocate and export sid with using following config. Then bgpd try to allocate new SID to redirect vpn to vrf using SRv6 localsid End.DT4/DT6. Currently linux kernel will regect End.DT4 route install due to no-implementation. (at-least today's FRR's ci kernel.) So now we only supports BGP SRv6-VPNv6. router bgp 1 segment-routing srv6 locator loc1 ! address-family ipv6 vpn exit-address-family ! router bgp 1 vrf vrf10 address-family ipv6 unicast sid vpn export 1 !!(option1)!! sid vpn export auto !!(option2)!! exit-address-family ! Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Diffstat (limited to 'bgpd/bgp_mplsvpn.h')
-rw-r--r--bgpd/bgp_mplsvpn.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/bgpd/bgp_mplsvpn.h b/bgpd/bgp_mplsvpn.h
index 91a073d5d..172372bdf 100644
--- a/bgpd/bgp_mplsvpn.h
+++ b/bgpd/bgp_mplsvpn.h
@@ -77,7 +77,10 @@ extern void vpn_leak_to_vrf_withdraw(struct bgp *bgp_vpn,
extern void vpn_leak_zebra_vrf_label_update(struct bgp *bgp, afi_t afi);
extern void vpn_leak_zebra_vrf_label_withdraw(struct bgp *bgp, afi_t afi);
+extern void vpn_leak_zebra_vrf_sid_update(struct bgp *bgp, afi_t afi);
+extern void vpn_leak_zebra_vrf_sid_withdraw(struct bgp *bgp, afi_t afi);
extern int vpn_leak_label_callback(mpls_label_t label, void *lblid, bool alloc);
+extern void ensure_vrf_tovpn_sid(struct bgp *vpn, struct bgp *vrf, afi_t afi);
extern void vrf_import_from_vrf(struct bgp *to_bgp, struct bgp *from_bgp,
afi_t afi, safi_t safi);
void vrf_unimport_from_vrf(struct bgp *to_bgp, struct bgp *from_bgp,
@@ -237,6 +240,15 @@ static inline void vpn_leak_postchange(vpn_policy_direction_t direction,
vpn_leak_zebra_vrf_label_update(bgp_vrf, afi);
}
+ if (!bgp_vrf->vpn_policy[afi].tovpn_sid)
+ ensure_vrf_tovpn_sid(bgp_vpn, bgp_vrf, afi);
+
+ if (sid_diff(bgp_vrf->vpn_policy[afi].tovpn_sid,
+ bgp_vrf->vpn_policy[afi].
+ tovpn_zebra_vrf_sid_last_sent)) {
+ vpn_leak_zebra_vrf_sid_update(bgp_vrf, afi);
+ }
+
vpn_leak_from_vrf_update_all(bgp_vpn, bgp_vrf, afi);
}
}