ospfd: Convert ospf_routemap.c to use error card subsystem

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-08-20 14:45:25 -04:00 committed by Quentin Young
parent abcc171c93
commit 45301f8cb2
3 changed files with 17 additions and 2 deletions

View File

@ -23,6 +23,18 @@
#include "lib/ferr.h"
#include "ospf_errors.h"
static struct log_ref ferr_ospf_warn[] = {
{
.code = OSPF_WARN_SET_METRIC_PLUS,
.title = "OSPF does not support `set metric +rtt/-rtt`",
.description = "This implementation of OSPF does not currently support `set metric +rtt/-rtt`",
.suggestion = "Do not use this particular set command for an ospf route-map",
},
{
.code = END_FERR,
}
};
static struct log_ref ferr_ospf_err[] = {
{
.code = OSPF_ERR_PKT_PROCESS,
@ -72,7 +84,6 @@ static struct log_ref ferr_ospf_err[] = {
.description = "OSPF Segment Routing invalid Algorithm",
.suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
},
{
.code = END_FERR,
}
@ -80,5 +91,6 @@ static struct log_ref ferr_ospf_err[] = {
void ospf_error_init(void)
{
log_ref_add(ferr_ospf_warn);
log_ref_add(ferr_ospf_err);
}

View File

@ -32,6 +32,7 @@ enum ospf_log_refs {
OSPF_ERR_SR_NODE_CREATE,
OSPF_ERR_SR_INVALID_LSA_ID,
OSPF_ERR_SR_INVALID_ALGORITHM,
OSPF_WARN_SET_METRIC_PLUS,
};
extern void ospf_error_init(void);

View File

@ -40,6 +40,7 @@
#include "ospfd/ospf_lsa.h"
#include "ospfd/ospf_route.h"
#include "ospfd/ospf_zebra.h"
#include "ospfd/ospf_errors.h"
/* Hook function for updating route_map assignment. */
static void ospf_route_map_update(const char *name)
@ -392,7 +393,8 @@ static void *route_set_metric_compile(const char *arg)
metric->type = metric_absolute;
if (strmatch(arg, "+rtt") || strmatch(arg, "-rtt")) {
zlog_warn("OSPF does not support 'set metric +rtt / -rtt'");
flog_warn(OSPF_WARN_SET_METRIC_PLUS,
"OSPF does not support 'set metric +rtt / -rtt'");
return metric;
}