ospfd: Add OSPF_WARN_OPAQUE_REGISTRATION

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-08-20 19:47:59 -04:00 committed by Quentin Young
parent 34f74c7a37
commit 85c9b43949
6 changed files with 25 additions and 11 deletions

View File

@ -54,6 +54,7 @@
#include "ospfd/ospf_route.h" #include "ospfd/ospf_route.h"
#include "ospfd/ospf_ase.h" #include "ospfd/ospf_ase.h"
#include "ospfd/ospf_zebra.h" #include "ospfd/ospf_zebra.h"
#include "ospfd/ospf_errors.h"
#include "ospfd/ospf_api.h" #include "ospfd/ospf_api.h"
#include "ospfd/ospf_apiserver.h" #include "ospfd/ospf_apiserver.h"
@ -152,7 +153,7 @@ int ospf_apiserver_init(void)
NULL, /* ospf_apiserver_lsa_refresher */ NULL, /* ospf_apiserver_lsa_refresher */
ospf_apiserver_lsa_update, ospf_apiserver_lsa_delete); ospf_apiserver_lsa_update, ospf_apiserver_lsa_delete);
if (rc != 0) { if (rc != 0) {
zlog_warn( flog_warn(OSPF_WARN_OPAQUE_REGISTRATION,
"ospf_apiserver_init: Failed to register opaque type [0/0]"); "ospf_apiserver_init: Failed to register opaque type [0/0]");
} }
@ -867,7 +868,8 @@ int ospf_apiserver_register_opaque_type(struct ospf_apiserver *apiserv,
NULL /* ospf_apiserver_lsa_delete */); NULL /* ospf_apiserver_lsa_delete */);
if (rc != 0) { if (rc != 0) {
zlog_warn("Failed to register opaque type [%d/%d]", lsa_type, flog_warn(OSPF_WARN_OPAQUE_REGISTRATION,
"Failed to register opaque type [%d/%d]", lsa_type,
opaque_type); opaque_type);
return OSPF_API_OPAQUETYPEINUSE; return OSPF_API_OPAQUETYPEINUSE;
} }

View File

@ -61,6 +61,12 @@ static struct log_ref ferr_ospf_warn[] = {
.description = "During handling of a LSA, OSPF has discovered that the LSA's internal state is inconsistent", .description = "During handling of a LSA, OSPF has discovered that the LSA's internal state is inconsistent",
.suggestion = "Gather log data and open an Issue", .suggestion = "Gather log data and open an Issue",
}, },
{
.code = OSPF_WARN_OPAQUE_REGISTRATION,
.title = "OSPF has failed to properly register Opaque Handler",
.description = "During initialization OSPF has detected a failure to install an opaque handler",
.suggestion = "Gather log data and open an Issue",
},
{ {
.code = END_FERR, .code = END_FERR,
} }

View File

@ -38,6 +38,7 @@ enum ospf_log_refs {
OSPF_WARN_LARGE_LSA, OSPF_WARN_LARGE_LSA,
OSPF_WARN_LSA_UNEXPECTED, OSPF_WARN_LSA_UNEXPECTED,
OSPF_WARN_LSA, OSPF_WARN_LSA,
OSPF_WARN_OPAQUE_REGISTRATION,
}; };
extern void ospf_error_init(void); extern void ospf_error_init(void);

View File

@ -62,6 +62,7 @@
#include "ospfd/ospf_zebra.h" #include "ospfd/ospf_zebra.h"
#include "ospfd/ospf_sr.h" #include "ospfd/ospf_sr.h"
#include "ospfd/ospf_ext.h" #include "ospfd/ospf_ext.h"
#include "ospfd/ospf_errors.h"
/* Following structure are internal use only. */ /* Following structure are internal use only. */
@ -136,7 +137,8 @@ int ospf_ext_init(void)
NULL); /* del_lsa_hook */ NULL); /* del_lsa_hook */
if (rc != 0) { if (rc != 0) {
zlog_warn("EXT (%s): Failed to register Extended Link LSA", flog_warn(OSPF_WARN_OPAQUE_REGISTRATION,
"EXT (%s): Failed to register Extended Link LSA",
__func__); __func__);
return rc; return rc;
} }
@ -157,7 +159,8 @@ int ospf_ext_init(void)
ospf_ext_pref_lsa_update, /* new_lsa_hook */ ospf_ext_pref_lsa_update, /* new_lsa_hook */
NULL); /* del_lsa_hook */ NULL); /* del_lsa_hook */
if (rc != 0) { if (rc != 0) {
zlog_warn("EXT (%s): Failed to register Extended Prefix LSA", flog_warn(OSPF_WARN_OPAQUE_REGISTRATION,
"EXT (%s): Failed to register Extended Prefix LSA",
__func__); __func__);
return rc; return rc;
} }

View File

@ -57,6 +57,7 @@
#include "ospfd/ospf_zebra.h" #include "ospfd/ospf_zebra.h"
#include "ospfd/ospf_sr.h" #include "ospfd/ospf_sr.h"
#include "ospfd/ospf_ri.h" #include "ospfd/ospf_ri.h"
#include "ospfd/ospf_errors.h"
/* Store Router Information PCE TLV and SubTLV in network byte order. */ /* Store Router Information PCE TLV and SubTLV in network byte order. */
struct ospf_pce_info { struct ospf_pce_info {
@ -185,7 +186,7 @@ static int ospf_router_info_register(uint8_t scope)
NULL); /* del_lsa_hook */ NULL); /* del_lsa_hook */
if (rc != 0) { if (rc != 0) {
zlog_warn( flog_warn(OSPF_WARN_OPAQUE_REGISTRATION,
"ospf_router_info_init: Failed to register functions"); "ospf_router_info_init: Failed to register functions");
return rc; return rc;
} }

View File

@ -61,6 +61,7 @@
#include "ospfd/ospf_zebra.h" #include "ospfd/ospf_zebra.h"
#include "ospfd/ospf_te.h" #include "ospfd/ospf_te.h"
#include "ospfd/ospf_vty.h" #include "ospfd/ospf_vty.h"
#include "ospfd/ospf_errors.h"
/* /*
* Global variable to manage Opaque-LSA/MPLS-TE on this node. * Global variable to manage Opaque-LSA/MPLS-TE on this node.
@ -102,7 +103,7 @@ int ospf_mpls_te_init(void)
ospf_mpls_te_lsa_refresh, NULL, /* ospf_mpls_te_new_lsa_hook */ ospf_mpls_te_lsa_refresh, NULL, /* ospf_mpls_te_new_lsa_hook */
NULL /* ospf_mpls_te_del_lsa_hook */); NULL /* ospf_mpls_te_del_lsa_hook */);
if (rc != 0) { if (rc != 0) {
zlog_warn( flog_warn(OSPF_WARN_OPAQUE_REGISTRATION,
"ospf_mpls_te_init: Failed to register Traffic Engineering functions"); "ospf_mpls_te_init: Failed to register Traffic Engineering functions");
return rc; return rc;
} }
@ -139,7 +140,7 @@ static int ospf_mpls_te_register(enum inter_as_mode mode)
ospf_mpls_te_lsa_refresh, NULL, NULL); ospf_mpls_te_lsa_refresh, NULL, NULL);
if (rc != 0) { if (rc != 0) {
zlog_warn( flog_warn(OSPF_WARN_OPAQUE_REGISTRATION,
"ospf_router_info_init: Failed to register Inter-AS functions"); "ospf_router_info_init: Failed to register Inter-AS functions");
return rc; return rc;
} }