--- /dev/null
+/*
+ * rip_errors - code for error messages that may occur in the
+ * rip process
+ * Copyright (C) 2018 Cumulus Networks, Inc.
+ * Donald Sharp
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <zebra.h>
+
+#include "rip_errors.h"
+
+static struct ferr_ref ferr_rip_err[] = {
+ {
+ .code = RIP_ERR_PACKET,
+ .title = "RIP Packet Error",
+ .description = "RIP has detected a packet encode/decode issue",
+ .suggestion = "Gather log files from both sides and open a Issue"
+ },
+ {
+ .code = END_FERR,
+ }
+};
+
+void rip_error_init(void)
+{
+ ferr_ref_init();
+
+ ferr_ref_add(ferr_rip_err);
+}
--- /dev/null
+/*
+ * rip_errors - header for error messages that may occur in the rip process
+ * Copyright (C) 2018 Cumulus Networks, Inc.
+ * Donald Sharp
+ *
+ * FRR is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRR is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef __RIP_ERRORS_H__
+#define __RIP_ERRORS_H__
+
+#include "ferr.h"
+#include "rip_errors.h"
+
+enum rip_ferr_refs {
+ RIP_ERR_PACKET = RIP_FERR_START,
+ RIP_ERR_CONFIG,
+};
+
+extern void rip_error_init(void);
+
+#endif
#include "libfrr.h"
#include "ripd/ripd.h"
+#include "ripd/rip_errors.h"
/* ripd options. */
#if CONFDATE > 20190521
master = frr_init();
/* Library initialization. */
+ rip_error_init();
keychain_init();
vrf_init(NULL, NULL, NULL, NULL);
#include "ripd/ripd.h"
#include "ripd/rip_debug.h"
+#include "ripd/rip_errors.h"
DEFINE_QOBJ_TYPE(rip)
/* Check packet length. */
if (len < (RIP_HEADER_SIZE + RIP_RTE_SIZE)) {
- zlog_err(
- "rip_auth_md5_set(): packet length %ld is less than minimum length.",
- len);
+ zlog_ferr(RIP_ERR_PACKET,
+ "rip_auth_md5_set(): packet length %ld is less than minimum length.",
+ len);
return;
}
ripd_librip_a_SOURCES = \
ripd/rip_debug.c \
+ ripd/rip_errors.c \
ripd/rip_interface.c \
ripd/rip_memory.c \
ripd/rip_offset.c \
noinst_HEADERS += \
ripd/rip_debug.h \
+ ripd/rip_errors.h \
ripd/rip_interface.h \
ripd/rip_memory.h \
ripd/ripd.h \