]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Convert ospf_routemap.c to use error card subsystem
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 20 Aug 2018 18:45:25 +0000 (14:45 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 6 Sep 2018 20:50:58 +0000 (20:50 +0000)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
ospfd/ospf_errors.c
ospfd/ospf_errors.h
ospfd/ospf_routemap.c

index 2927f7cb14159dc542c23bf649175773c7d101f4..e321a03b841d3e3e7eea05ab34851d3b31f39e80 100644 (file)
 #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);
 }
index c3f101855025a40b906b6b98fc741770b7d840fb..ef1431ba7b67b44ca2fff020b5599f510b18a22c 100644 (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);
index c5ec1db336a93a14a93c4777efa1ba17c4461e77..d4513eebd35e0e6f949ebd9cba4da91871da84ea 100644 (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;
        }