mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 17:48:35 +00:00
bgpd: add hooks for displaying debug information of a plugin
when a plugin is attached, some debugs may be attached to that plugin. For that, add one hook that is interacting with vty: a boolean indicates what the usage is for: either for impacting the 'show running-config', or for impacting the 'show debugging' command. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
f3517f58f1
commit
aa31aef359
@ -30,6 +30,7 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
|
#include "hook.h"
|
||||||
|
|
||||||
#include "bgpd/bgpd.h"
|
#include "bgpd/bgpd.h"
|
||||||
#include "bgpd/bgp_aspath.h"
|
#include "bgpd/bgp_aspath.h"
|
||||||
@ -47,6 +48,9 @@
|
|||||||
#include "bgpd/bgp_vty.h"
|
#include "bgpd/bgp_vty.h"
|
||||||
#include "bgpd/bgp_flowspec.h"
|
#include "bgpd/bgp_flowspec.h"
|
||||||
|
|
||||||
|
DEFINE_HOOK(bgp_hook_config_write_debug, (struct vty *vty, bool running),
|
||||||
|
(vty, running))
|
||||||
|
|
||||||
unsigned long conf_bgp_debug_as4;
|
unsigned long conf_bgp_debug_as4;
|
||||||
unsigned long conf_bgp_debug_neighbor_events;
|
unsigned long conf_bgp_debug_neighbor_events;
|
||||||
unsigned long conf_bgp_debug_events;
|
unsigned long conf_bgp_debug_events;
|
||||||
@ -2168,7 +2172,7 @@ DEFUN_NOSH (show_debugging_bgp,
|
|||||||
vty_out(vty, " BGP policy based routing debugging is on\n");
|
vty_out(vty, " BGP policy based routing debugging is on\n");
|
||||||
if (BGP_DEBUG(pbr, PBR_ERROR))
|
if (BGP_DEBUG(pbr, PBR_ERROR))
|
||||||
vty_out(vty, " BGP policy based routing error debugging is on\n");
|
vty_out(vty, " BGP policy based routing error debugging is on\n");
|
||||||
|
hook_call(bgp_hook_config_write_debug, vty, false);
|
||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -2284,6 +2288,9 @@ static int bgp_config_write_debug(struct vty *vty)
|
|||||||
vty_out(vty, "debug bgp graceful-restart\n");
|
vty_out(vty, "debug bgp graceful-restart\n");
|
||||||
write++;
|
write++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hook_call(bgp_hook_config_write_debug, vty, true))
|
||||||
|
write++;
|
||||||
return write;
|
return write;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,9 +21,15 @@
|
|||||||
#ifndef _QUAGGA_BGP_DEBUG_H
|
#ifndef _QUAGGA_BGP_DEBUG_H
|
||||||
#define _QUAGGA_BGP_DEBUG_H
|
#define _QUAGGA_BGP_DEBUG_H
|
||||||
|
|
||||||
|
#include "hook.h"
|
||||||
|
#include "vty.h"
|
||||||
|
|
||||||
#include "bgp_attr.h"
|
#include "bgp_attr.h"
|
||||||
#include "bgp_updgrp.h"
|
#include "bgp_updgrp.h"
|
||||||
|
|
||||||
|
DECLARE_HOOK(bgp_hook_config_write_debug, (struct vty *vty, bool running),
|
||||||
|
(vty, running))
|
||||||
|
|
||||||
/* sort of packet direction */
|
/* sort of packet direction */
|
||||||
#define DUMP_ON 1
|
#define DUMP_ON 1
|
||||||
#define DUMP_SEND 2
|
#define DUMP_SEND 2
|
||||||
|
Loading…
Reference in New Issue
Block a user