--- /dev/null
+/*
+ * eigrp_errors - code for error messages that may occur in the
+ * eigrp 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 "eigrp_errors.h"
+
+static struct ferr_ref ferr_eigrp_err[] = {
+ {
+ .code = EIGRP_ERR_PACKET,
+ .title = "EIGRP Packet Error",
+ .description = "EIGRP has a packet that does not correctly decode or encode",
+ .suggestion = "Gather log files from both sides of the neighbor relationship and open an issue"
+ },
+ {
+ .code = EIGRP_ERR_CONFIG,
+ .title = "EIGRP Configuration Error",
+ .description = "EIGRP has detected a configuration error",
+ .suggestion = "Correct the configuration issue, if it still persists open an Issue"
+ },
+ {
+ .code = END_FERR,
+ }
+};
+
+void eigrp_error_init(void)
+{
+ ferr_ref_init();
+
+ ferr_ref_add(ferr_eigrp_err);
+}
--- /dev/null
+/*
+ * eigrp_errors - header for error messages that may occur in the eigrp 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 __EIGRP_ERRORS_H__
+#define __EIGRP_ERRORS_H__
+
+#include "ferr.h"
+#include "eigrp_errors.h"
+
+enum eigrp_ferr_refs {
+ EIGRP_ERR_PACKET = EIGRP_FERR_START,
+ EIGRP_ERR_CONFIG,
+};
+
+extern void eigrp_error_init(void);
+
+#endif
#include "eigrpd/eigrp_vty.h"
#include "eigrpd/eigrp_dump.h"
#include "eigrpd/eigrp_macros.h"
+#include "eigrpd/eigrp_errors.h"
/* Packet Type String. */
static const struct message eigrp_general_tlv_type_str[] = {
ret = sscanf(ver_string, "%" SCNu32 ".%" SCNu32, &FRR_MAJOR,
&FRR_MINOR);
if (ret != 2)
- zlog_err("Did not Properly parse %s, please fix VERSION string",
- VERSION);
+ zlog_ferr(EIGRP_ERR_PACKET,
+ "Did not Properly parse %s, please fix VERSION string",
+ VERSION);
}
/**
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_snmp.h"
#include "eigrpd/eigrp_filter.h"
+#include "eigrpd/eigrp_errors.h"
//#include "eigrpd/eigrp_routemap.h"
/* eigprd privileges */
eigrp_om->master = frr_init();
master = eigrp_om->master;
+ eigrp_error_init();
vrf_init(NULL, NULL, NULL, NULL);
/*EIGRPd init*/
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_memory.h"
+#include "eigrpd/eigrp_errors.h"
struct eigrp_neighbor *eigrp_nbr_new(struct eigrp_interface *ei)
{
void eigrp_nbr_hard_restart(struct eigrp_neighbor *nbr, struct vty *vty)
{
if (nbr == NULL) {
- zlog_err("Nbr Hard restart: Neighbor not specified.");
+ zlog_ferr(EIGRP_ERR_CONFIG,
+ "Nbr Hard restart: Neighbor not specified.");
return;
}
if (eigrp_sock < 0) {
int save_errno = errno;
if (eigrpd_privs.change(ZPRIVS_LOWER))
- zlog_err("eigrp_sock_init: could not lower privs, %s",
- safe_strerror(errno));
+ zlog_ferr(LIB_ERR_PRIVILEGES,
+ "eigrp_sock_init: could not lower privs, %s",
+ safe_strerror(errno));
zlog_ferr(LIB_ERR_SOCKET, "eigrp_read_sock_init: socket: %s",
safe_strerror(save_errno));
exit(1);
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h"
+#include "eigrpd/eigrp_errors.h"
/* Packet Type String. */
const struct message eigrp_packet_type_str[] = {
/* Get one packet from queue. */
ep = eigrp_fifo_next(ei->obuf);
if (!ep) {
- zlog_err("%s: Interface %s no packet on queue?",
- __PRETTY_FUNCTION__, ei->ifp->name);
+ zlog_ferr(LIB_ERR_DEVELOPMENT,
+ "%s: Interface %s no packet on queue?",
+ __PRETTY_FUNCTION__, ei->ifp->name);
goto out;
}
if (ep->length < EIGRP_HEADER_LEN) {
- zlog_err("%s: Packet just has a header?", __PRETTY_FUNCTION__);
+ zlog_ferr(EIGRP_ERR_PACKET,
+ "%s: Packet just has a header?", __PRETTY_FUNCTION__);
eigrp_header_dump((struct eigrp_header *)ep->s->data);
eigrp_packet_delete(ei);
goto out;
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h"
+#include "eigrpd/eigrp_errors.h"
void eigrp_send_reply(struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
{
if (!dest) {
char buf[PREFIX_STRLEN];
- zlog_err(
- "%s: Received prefix %s which we do not know about",
- __PRETTY_FUNCTION__,
- prefix2str(&dest_addr, buf, sizeof(buf)));
+ zlog_ferr(EIGRP_ERR_PACKET,
+ "%s: Received prefix %s which we do not know about",
+ __PRETTY_FUNCTION__,
+ prefix2str(&dest_addr, buf, sizeof(buf)));
eigrp_IPv4_InternalTLV_free(tlv);
continue;
}
#include "sockopt.h"
#include "keychain.h"
#include "libfrr.h"
+#include "lib_errors.h"
#include "eigrpd/eigrp_structs.h"
#include "eigrpd/eigrpd.h"
eigrp->networks = eigrp_topology_new();
if ((eigrp_socket = eigrp_sock_init()) < 0) {
- zlog_err(
- "eigrp_new: fatal error: eigrp_sock_init was unable to open "
- "a socket");
+ zlog_ferr(LIB_ERR_SOCKET,
+ "eigrp_new: fatal error: eigrp_sock_init was unable to open a socket");
exit(1);
}
eigrpd_libeigrp_a_SOURCES = \
eigrpd/eigrp_dump.c \
+ eigrpd/eigrp_errors.c \
eigrpd/eigrp_filter.c \
eigrpd/eigrp_fsm.c \
eigrpd/eigrp_hello.c \
noinst_HEADERS += \
eigrpd/eigrp_const.h \
+ eigrpd/eigrp_errors.h \
eigrpd/eigrp_filter.h \
eigrpd/eigrp_fsm.h \
eigrpd/eigrp_interface.h \