Skip to content

Commit

Permalink
bgpd: add example error reference card
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
  • Loading branch information
qlyoung committed Jun 13, 2018
1 parent 781f42c commit 3cd7795
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "bfd.h"
#include "libfrr.h"
#include "ns.h"
#include "ferr.h"

#include "bgpd/bgpd.h"
#include "bgpd/bgp_attr.h"
Expand Down Expand Up @@ -85,6 +86,19 @@ void sigusr1(void);
static void bgp_exit(int);
static void bgp_vrf_terminate(void);

enum bgp_ferr_refs {
BGP_ERR_START = BGP_FERR_START,
BGP_EXAMPLE_ERR,
BGP_ERR_END = BGP_FERR_END,
};

static struct ferr_ref example_err = {
.code = BGP_EXAMPLE_ERR,
.title = "Example Error",
.description = "An example error made to be used as an example of the error reference system.",
.suggestion = "Ignore this error."
};

static struct quagga_signal_t bgp_signals[] = {
{
.signal = SIGHUP,
Expand Down Expand Up @@ -416,6 +430,12 @@ int main(int argc, char **argv)
/* BGP related initialization. */
bgp_init();

ferr_ref_init();
ferr_ref_add(&example_err);

zlog_ferr(BGP_EXAMPLE_ERR, "additional information %d", 42);


snprintf(bgpd_di.startinfo, sizeof(bgpd_di.startinfo), ", bgp@%s:%d",
(bm->address ? bm->address : "<all>"), bm->port);

Expand Down

0 comments on commit 3cd7795

Please sign in to comment.