diff options
| author | Pat Ruddy <pat@voltanet.io> | 2020-09-28 16:35:35 +0100 |
|---|---|---|
| committer | Pat Ruddy <pat@voltanet.io> | 2021-02-02 09:37:06 +0000 |
| commit | 0d020cd6d98f454f22723f404da99fa48b7b2751 (patch) | |
| tree | fe2605ddf46460c25b38c03276b21b93dc049f25 /bgpd/bgp_zebra.c | |
| parent | aa53f69348d2d6c5817e10b32b85345ea4399025 (diff) | |
bgpd, lib: add mplsL3VpnVrf table
Add SNMP support for L3vpn Vrf table as defined in [RFC4382]
Keep track of vrf status for the table and for future traps.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
Diffstat (limited to 'bgpd/bgp_zebra.c')
| -rw-r--r-- | bgpd/bgp_zebra.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index f7c4b04adf..ca7da8070c 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -67,6 +67,10 @@ /* All information about zebra. */ struct zclient *zclient = NULL; +/* hook to indicate vrf status change for SNMP */ +DEFINE_HOOK(bgp_vrf_status_changed, (struct bgp *bgp, struct interface *ifp), + (bgp, ifp)) + /* Can we install into zebra? */ static inline bool bgp_install_info_to_zebra(struct bgp *bgp) { @@ -212,8 +216,10 @@ static int bgp_ifp_destroy(struct interface *ifp) if (BGP_DEBUG(zebra, ZEBRA)) zlog_debug("Rx Intf del VRF %u IF %s", ifp->vrf_id, ifp->name); - if (bgp) + if (bgp) { bgp_update_interface_nbrs(bgp, ifp, NULL); + hook_call(bgp_vrf_status_changed, bgp, ifp); + } bgp_mac_del_mac_entry(ifp); @@ -243,6 +249,7 @@ static int bgp_ifp_up(struct interface *ifp) for (ALL_LIST_ELEMENTS(ifp->nbr_connected, node, nnode, nc)) bgp_nbr_connected_add(bgp, nc); + hook_call(bgp_vrf_status_changed, bgp, ifp); return 0; } @@ -297,6 +304,7 @@ static int bgp_ifp_down(struct interface *ifp) } } + hook_call(bgp_vrf_status_changed, bgp, ifp); return 0; } @@ -461,6 +469,8 @@ static int bgp_interface_vrf_update(ZAPI_CALLBACK_ARGS) for (ALL_LIST_ELEMENTS(ifp->nbr_connected, node, nnode, nc)) bgp_nbr_connected_add(bgp, nc); + + hook_call(bgp_vrf_status_changed, bgp, ifp); return 0; } @@ -2963,6 +2973,7 @@ static int bgp_ifp_create(struct interface *ifp) bgp_mac_add_mac_entry(ifp); bgp_update_interface_nbrs(bgp, ifp, ifp); + hook_call(bgp_vrf_status_changed, bgp, ifp); return 0; } |
