--- /dev/null
+/*
+ * pim_errors - code for error messages that may occur in the
+ * pim 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 "pim_errors.h"
+
+static struct ferr_ref ferr_pim_err[] = {
+ {
+ .code = PIM_ERR_MSDP_PACKET,
+ .title = "PIM MSDP Packet Error",
+ .description = "PIM has received a packet from a peer that does not correctly decode",
+ .suggestion = "Check MSDP peer and ensure it is correctly working"
+ },
+ {
+ .code = PIM_ERR_CONFIG,
+ .title = "PIM Configuration Error",
+ .description = "Pim has detected a configuration error",
+ .suggestion = "Ensure the configuration is correct and apply correct configuration"
+ },
+ {
+ .code = END_FERR,
+ }
+};
+
+void pim_error_init(void)
+{
+ ferr_ref_init();
+
+ ferr_ref_add(ferr_pim_err);
+}
--- /dev/null
+/*
+ * pim_errors - header for error messages that may occur in the pim 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 __PIM_ERRORS_H__
+#define __PIM_ERRORS_H__
+
+#include "ferr.h"
+#include "pim_errors.h"
+
+enum pim_ferr_refs {
+ PIM_ERR_MSDP_PACKET = PIM_FERR_START,
+ PIM_ERR_CONFIG,
+};
+
+extern void pim_error_init(void);
+
+#endif
#include "pim_msdp.h"
#include "pim_iface.h"
#include "pim_bfd.h"
+#include "pim_errors.h"
extern struct host host;
/*
* Initializations
*/
+ pim_error_init();
pim_vrf_init();
access_list_init();
prefix_list_init();
#include "pimd.h"
#include "pim_str.h"
+#include "pim_errors.h"
#include "pim_msdp.h"
#include "pim_msdp_packet.h"
if (prefix_len != 32) {
/* ignore SA update if the prefix length is not 32 */
- zlog_err("rxed sa update with invalid prefix length %d",
- prefix_len);
+ zlog_ferr(PIM_ERR_MSDP_PACKET,
+ "rxed sa update with invalid prefix length %d",
+ prefix_len);
return;
}
if (PIM_DEBUG_MSDP_PACKETS) {
#include "pimd.h"
#include "pim_sock.h"
+#include "pim_errors.h"
#include "pim_msdp.h"
#include "pim_msdp_socket.h"
if (!mp || !PIM_MSDP_PEER_IS_LISTENER(mp)) {
++pim->msdp.rejected_accepts;
if (PIM_DEBUG_MSDP_EVENTS) {
- zlog_err("msdp peer connection refused from %s",
- sockunion2str(&su, buf, SU_ADDRSTRLEN));
+ zlog_ferr(PIM_ERR_MSDP_PACKET,
+ "msdp peer connection refused from %s",
+ sockunion2str(&su, buf, SU_ADDRSTRLEN));
}
close(msdp_sock);
return -1;
#include "pim_assert.h"
#include "pim_msg.h"
#include "pim_register.h"
+#include "pim_errors.h"
static int on_pim_hello_send(struct thread *t);
static int pim_hello_send(struct interface *ifp, uint16_t holdtime);
delete_message);
if (!ifp->info) {
- zlog_err("%s: %s: but PIM not enabled on interface %s (!)",
- __PRETTY_FUNCTION__, delete_message, ifp->name);
+ zlog_ferr(PIM_ERR_CONFIG,
+ "%s: %s: but PIM not enabled on interface %s (!)",
+ __PRETTY_FUNCTION__, delete_message, ifp->name);
return;
}
rp_info = XCALLOC(MTYPE_PIM_RP, sizeof(*rp_info));
if (!str2prefix("224.0.0.0/4", &rp_info->group)) {
- zlog_err("Unable to convert 224.0.0.0/4 to prefix");
+ zlog_ferr(LIB_ERR_DEVELOPMENT,
+ "Unable to convert 224.0.0.0/4 to prefix");
list_delete_and_null(&pim->rp_list);
route_table_finish(pim->rp_table);
XFREE(MTYPE_PIM_RP, rp_info);
#include <lib/vty.h>
#include <lib/vrf.h>
#include <lib/plist.h>
+#include <lib/lib_errors.h>
#include "pimd.h"
#include "pim_ssm.h"
if (first) {
if (!str2prefix(PIM_SSM_STANDARD_RANGE, &group_ssm))
- zlog_err("%s: Failure to Read Group Address: %s",
- __PRETTY_FUNCTION__, PIM_SSM_STANDARD_RANGE);
+ zlog_ferr(LIB_ERR_DEVELOPMENT,
+ "%s: Failure to Read Group Address: %s",
+ __PRETTY_FUNCTION__, PIM_SSM_STANDARD_RANGE);
first = 0;
}
/* Check socket. */
if (zlookup->sock < 0) {
- zlog_err("%s: zclient lookup socket is not connected",
- __PRETTY_FUNCTION__);
+ zlog_ferr(LIB_ERR_ZAPI_SOCKET,
+ "%s: zclient lookup socket is not connected",
+ __PRETTY_FUNCTION__);
zclient_lookup_failed(zlookup);
return -1;
}
if (pim->vrf->vrf_id == VRF_UNKNOWN) {
- zlog_err(
+ zlog_notice(
"%s: VRF: %s does not fully exist yet, delaying lookup",
__PRETTY_FUNCTION__, pim->vrf->name);
return -1;
pimd/pim_bfd.c \
pimd/pim_br.c \
pimd/pim_cmd.c \
+ pimd/pim_errors.c \
pimd/pim_hello.c \
pimd/pim_iface.c \
pimd/pim_ifchannel.c \
pimd/pim_bfd.h \
pimd/pim_br.h \
pimd/pim_cmd.h \
+ pimd/pim_errors.h \
pimd/pim_hello.h \
pimd/pim_iface.h \
pimd/pim_ifchannel.h \