forked from Mirror/frr
bgpd, doc: add bgp snmp traps rfc4382 command
Add a trap command to disable or enable the traps defined by the RFC4382. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
423e8076b5
commit
d95f9a35d4
|
@ -590,6 +590,11 @@ static int bgp_vrf_check_update_active(struct bgp *bgp, struct interface *ifp)
|
||||||
/* add trap in here */
|
/* add trap in here */
|
||||||
bgp->snmp_stats->active = new_active;
|
bgp->snmp_stats->active = new_active;
|
||||||
|
|
||||||
|
if (!CHECK_FLAG(bm->options, BGP_OPT_TRAPS_RFC4382)) {
|
||||||
|
bgp_mpls_l3vpn_update_last_changed(bgp);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* send relevent trap */
|
/* send relevent trap */
|
||||||
if (bgp->snmp_stats->active)
|
if (bgp->snmp_stats->active)
|
||||||
trap = MPLSL3VPNVRFUP;
|
trap = MPLSL3VPNVRFUP;
|
||||||
|
|
|
@ -50,6 +50,21 @@ DEFPY(bgp_snmp_traps_rfc4273, bgp_snmp_traps_rfc4273_cmd,
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFPY(bgp_snmp_traps_rfc4382, bgp_snmp_traps_rfc4382_cmd,
|
||||||
|
"[no$no] bgp snmp traps rfc4382",
|
||||||
|
NO_STR BGP_STR
|
||||||
|
"Configure BGP SNMP\n"
|
||||||
|
"Configure SNMP traps for BGP\n"
|
||||||
|
"Configure use of rfc4382 SNMP traps for BGP\n")
|
||||||
|
{
|
||||||
|
if (no) {
|
||||||
|
UNSET_FLAG(bm->options, BGP_OPT_TRAPS_RFC4382);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
SET_FLAG(bm->options, BGP_OPT_TRAPS_RFC4382);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
DEFPY(bgp_snmp_traps_bgp4_mibv2, bgp_snmp_traps_bgp4_mibv2_cmd,
|
DEFPY(bgp_snmp_traps_bgp4_mibv2, bgp_snmp_traps_bgp4_mibv2_cmd,
|
||||||
"[no$no] bgp snmp traps bgp4-mibv2",
|
"[no$no] bgp snmp traps bgp4-mibv2",
|
||||||
NO_STR BGP_STR
|
NO_STR BGP_STR
|
||||||
|
@ -69,9 +84,12 @@ static void bgp_snmp_traps_init(void)
|
||||||
{
|
{
|
||||||
install_element(CONFIG_NODE, &bgp_snmp_traps_rfc4273_cmd);
|
install_element(CONFIG_NODE, &bgp_snmp_traps_rfc4273_cmd);
|
||||||
install_element(CONFIG_NODE, &bgp_snmp_traps_bgp4_mibv2_cmd);
|
install_element(CONFIG_NODE, &bgp_snmp_traps_bgp4_mibv2_cmd);
|
||||||
|
install_element(CONFIG_NODE, &bgp_snmp_traps_rfc4382_cmd);
|
||||||
|
|
||||||
SET_FLAG(bm->options, BGP_OPT_TRAPS_RFC4273);
|
SET_FLAG(bm->options, BGP_OPT_TRAPS_RFC4273);
|
||||||
/* BGP4MIBv2 traps are disabled by default */
|
/* BGP4MIBv2 traps are disabled by default */
|
||||||
|
|
||||||
|
SET_FLAG(bm->options, BGP_OPT_TRAPS_RFC4382);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgp_cli_snmp_traps_config_write(struct vty *vty)
|
int bgp_cli_snmp_traps_config_write(struct vty *vty)
|
||||||
|
@ -86,6 +104,10 @@ int bgp_cli_snmp_traps_config_write(struct vty *vty)
|
||||||
vty_out(vty, "bgp snmp traps bgp4-mibv2\n");
|
vty_out(vty, "bgp snmp traps bgp4-mibv2\n");
|
||||||
write++;
|
write++;
|
||||||
}
|
}
|
||||||
|
if (!CHECK_FLAG(bm->options, BGP_OPT_TRAPS_RFC4382)) {
|
||||||
|
vty_out(vty, "no bgp snmp traps rfc4382\n");
|
||||||
|
write++;
|
||||||
|
}
|
||||||
|
|
||||||
return write;
|
return write;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,6 +131,7 @@ struct bgp_master {
|
||||||
#define BGP_OPT_NO_ZEBRA (1 << 2)
|
#define BGP_OPT_NO_ZEBRA (1 << 2)
|
||||||
#define BGP_OPT_TRAPS_RFC4273 (1 << 3)
|
#define BGP_OPT_TRAPS_RFC4273 (1 << 3)
|
||||||
#define BGP_OPT_TRAPS_BGP4MIBV2 (1 << 4)
|
#define BGP_OPT_TRAPS_BGP4MIBV2 (1 << 4)
|
||||||
|
#define BGP_OPT_TRAPS_RFC4382 (1 << 5)
|
||||||
|
|
||||||
uint64_t updgrp_idspace;
|
uint64_t updgrp_idspace;
|
||||||
uint64_t subgrp_idspace;
|
uint64_t subgrp_idspace;
|
||||||
|
|
|
@ -215,3 +215,9 @@ possibility to select the MIB he wants to receive traps from:
|
||||||
By default, only rfc4273 traps are enabled and sent.
|
By default, only rfc4273 traps are enabled and sent.
|
||||||
|
|
||||||
.. [Draft-IETF-idr-bgp4-mibv2-11] <https://tools.ietf.org/id/draft-ietf-idr-bgp4-mibv2-11.txt>
|
.. [Draft-IETF-idr-bgp4-mibv2-11] <https://tools.ietf.org/id/draft-ietf-idr-bgp4-mibv2-11.txt>
|
||||||
|
|
||||||
|
The :rfc:`4382` also defines traps to inform when an L3VPN network changes
|
||||||
|
the operational status of its VRF interface. The user can choose to suppress
|
||||||
|
those traps or not.
|
||||||
|
|
||||||
|
.. clicmd:: bgp snmp traps rfc4382
|
||||||
|
|
Loading…
Reference in a new issue