mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
zebra: Add knowledge about RA and RFC 5549 to show zebra
Add to `show zebra` whether or not RA is compiled into FRR and whether or not BGP is using RFC 5549 at the moment. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
281686819d
commit
954e1a2bc9
@ -47,6 +47,8 @@
|
|||||||
|
|
||||||
extern struct zebra_privs_t zserv_privs;
|
extern struct zebra_privs_t zserv_privs;
|
||||||
|
|
||||||
|
static uint32_t interfaces_configured_for_ra_from_bgp;
|
||||||
|
|
||||||
#if defined(HAVE_RTADV)
|
#if defined(HAVE_RTADV)
|
||||||
|
|
||||||
#ifndef VTYSH_EXTRACT_PL
|
#ifndef VTYSH_EXTRACT_PL
|
||||||
@ -1282,6 +1284,9 @@ static void zebra_interface_radv_set(ZAPI_HANDLER_ARGS, int enable)
|
|||||||
|
|
||||||
zif = ifp->info;
|
zif = ifp->info;
|
||||||
if (enable) {
|
if (enable) {
|
||||||
|
if (!CHECK_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED))
|
||||||
|
interfaces_configured_for_ra_from_bgp++;
|
||||||
|
|
||||||
SET_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED);
|
SET_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED);
|
||||||
ipv6_nd_suppress_ra_set(ifp, RA_ENABLE);
|
ipv6_nd_suppress_ra_set(ifp, RA_ENABLE);
|
||||||
if (ra_interval
|
if (ra_interval
|
||||||
@ -1290,6 +1295,9 @@ static void zebra_interface_radv_set(ZAPI_HANDLER_ARGS, int enable)
|
|||||||
VTY_RA_INTERVAL_CONFIGURED))
|
VTY_RA_INTERVAL_CONFIGURED))
|
||||||
zif->rtadv.MaxRtrAdvInterval = ra_interval * 1000;
|
zif->rtadv.MaxRtrAdvInterval = ra_interval * 1000;
|
||||||
} else {
|
} else {
|
||||||
|
if (CHECK_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED))
|
||||||
|
interfaces_configured_for_ra_from_bgp--;
|
||||||
|
|
||||||
UNSET_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED);
|
UNSET_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED);
|
||||||
if (!CHECK_FLAG(zif->rtadv.ra_configured,
|
if (!CHECK_FLAG(zif->rtadv.ra_configured,
|
||||||
VTY_RA_INTERVAL_CONFIGURED))
|
VTY_RA_INTERVAL_CONFIGURED))
|
||||||
@ -2766,6 +2774,8 @@ void rtadv_vrf_terminate(struct zebra_vrf *zvrf)
|
|||||||
|
|
||||||
void rtadv_cmd_init(void)
|
void rtadv_cmd_init(void)
|
||||||
{
|
{
|
||||||
|
interfaces_configured_for_ra_from_bgp = 0;
|
||||||
|
|
||||||
hook_register(zebra_if_extra_info, nd_dump_vty);
|
hook_register(zebra_if_extra_info, nd_dump_vty);
|
||||||
hook_register(zebra_if_config_wr, rtadv_config_write);
|
hook_register(zebra_if_config_wr, rtadv_config_write);
|
||||||
|
|
||||||
@ -2865,6 +2875,11 @@ static int if_leave_all_router(int sock, struct interface *ifp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool rtadv_compiled_in(void)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
void rtadv_vrf_init(struct zebra_vrf *zvrf)
|
void rtadv_vrf_init(struct zebra_vrf *zvrf)
|
||||||
{
|
{
|
||||||
@ -2920,4 +2935,14 @@ void zebra_interface_radv_enable(ZAPI_HANDLER_ARGS)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool rtadv_compiled_in(void)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* HAVE_RTADV */
|
#endif /* HAVE_RTADV */
|
||||||
|
|
||||||
|
uint32_t rtadv_get_interfaces_configured_from_bgp(void)
|
||||||
|
{
|
||||||
|
return interfaces_configured_for_ra_from_bgp;
|
||||||
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#ifndef _ZEBRA_RTADV_H
|
#ifndef _ZEBRA_RTADV_H
|
||||||
#define _ZEBRA_RTADV_H
|
#define _ZEBRA_RTADV_H
|
||||||
|
|
||||||
|
#include "zebra.h"
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "zebra/interface.h"
|
#include "zebra/interface.h"
|
||||||
|
|
||||||
@ -161,6 +162,8 @@ extern void zebra_interface_radv_disable(ZAPI_HANDLER_ARGS);
|
|||||||
extern void zebra_interface_radv_enable(ZAPI_HANDLER_ARGS);
|
extern void zebra_interface_radv_enable(ZAPI_HANDLER_ARGS);
|
||||||
extern void rtadv_add_prefix(struct zebra_if *zif, const struct prefix_ipv6 *p);
|
extern void rtadv_add_prefix(struct zebra_if *zif, const struct prefix_ipv6 *p);
|
||||||
extern void rtadv_delete_prefix(struct zebra_if *zif, const struct prefix *p);
|
extern void rtadv_delete_prefix(struct zebra_if *zif, const struct prefix *p);
|
||||||
|
extern uint32_t rtadv_get_interfaces_configured_from_bgp(void);
|
||||||
|
extern bool rtadv_compiled_in(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
#include "zebra/kernel_netlink.h"
|
#include "zebra/kernel_netlink.h"
|
||||||
#include "zebra/table_manager.h"
|
#include "zebra/table_manager.h"
|
||||||
#include "zebra/zebra_script.h"
|
#include "zebra/zebra_script.h"
|
||||||
|
#include "zebra/rtadv.h"
|
||||||
|
|
||||||
extern int allow_delete;
|
extern int allow_delete;
|
||||||
|
|
||||||
@ -3994,6 +3995,14 @@ DEFUN (show_zebra,
|
|||||||
else
|
else
|
||||||
vty_out(vty, "Asic offload is not being used\n");
|
vty_out(vty, "Asic offload is not being used\n");
|
||||||
|
|
||||||
|
if (rtadv_compiled_in()) {
|
||||||
|
vty_out(vty, "Router Advertisements are compiled with FRR\n");
|
||||||
|
if (rtadv_get_interfaces_configured_from_bgp())
|
||||||
|
vty_out(vty, "RFC 5549 is being used by BGP\n");
|
||||||
|
} else
|
||||||
|
vty_out(vty,
|
||||||
|
"Router Advertisements are not compiled with FRR\n");
|
||||||
|
|
||||||
vty_out(vty, "Kernel %ssupport Nexthop Groups\n",
|
vty_out(vty, "Kernel %ssupport Nexthop Groups\n",
|
||||||
zrouter.supports_nhgs ? "does " : "does not ");
|
zrouter.supports_nhgs ? "does " : "does not ");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user