]> git.proxmox.com Git - mirror_frr.git/blob - lib/lib_errors.c
lib: Remove unnecessary zebra.h include
[mirror_frr.git] / lib / lib_errors.c
1 /*
2 * Library-specific error messages.
3 * Copyright (C) 2018 Cumulus Networks, Inc.
4 * Donald Sharp
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <lib_errors.h>
22
23 /* clang-format off */
24 static struct ferr_ref ferr_lib_err[] = {
25 {
26 .code = LIB_ERR_PRIVILEGES,
27 .title = "Failure to raise or lower privileges",
28 .description = "FRR attempted to raise or lower its privileges and was unable to do so",
29 .suggestion = "Ensure that you are running FRR as the frr user and that the user has\nSufficient privileges to properly access root privileges"
30 },
31 {
32 .code = LIB_ERR_VRF_START,
33 .title = "VRF Failure on Start",
34 .description = "Upon startup FRR failed to properly initialize and startup the VRF subsystem",
35 .suggestion = "Ensure that there is sufficient memory to start processes and restart FRR",
36 },
37 {
38 .code = LIB_ERR_SOCKET,
39 .title = "Socket Error",
40 .description = "When attempting to access a socket a system error has occured\nand we were unable to properly complete the request",
41 .suggestion = "Ensure that there are sufficient system resources available and\nensure that the frr user has sufficient permisions to work",
42 },
43 {
44 .code = LIB_ERR_ZAPI_MISSMATCH,
45 .title = "ZAPI Error",
46 .description = "A version miss-match has been detected between zebra and client protocol",
47 .suggestion = "Two different versions of FRR have been installed and the install is\nnot properly setup. Completely stop FRR, remove it from the system and\nreinstall. Typically only developers should see this issue."
48 },
49 {
50 .code = LIB_ERR_ZAPI_ENCODE,
51 .title = "ZAPI Error",
52 .description = "The ZAPI subsystem has detected an encoding issue, between zebra and a client protocol",
53 .suggestion = "Restart FRR"
54 },
55 {
56 .code = LIB_ERR_ZAPI_SOCKET,
57 .title = "ZAPI Error",
58 .description = "The ZAPI subsystem has detected a socket error between zebra and a client",
59 .suggestion = "Restart FRR"
60 },
61 {
62 .code = LIB_ERR_SYSTEM_CALL,
63 .title = "System Call Error",
64 .description = "FRR has detected a error from using a vital system call and has probably\nalready exited",
65 .suggestion = "Ensure permissions are correct for FRR files, users and groups are correct.\nAdditionally check that sufficient system resources are available."
66 },
67 {
68 .code = LIB_ERR_VTY,
69 .title = "VTY Subsystem Error",
70 .description = "FRR has detected a problem with the specified configuration file",
71 .suggestion = "Ensure configuration file exists and has correct permissions for operations\nAdditionally ensure that all config lines are correct as well",
72 },
73 {
74 .code = LIB_ERR_SNMP,
75 .title = "SNMP Subsystem Error",
76 .description = "FRR has detected a problem with the snmp library it uses\nA callback from this subsystem has indicated some error",
77 .suggestion = "Examine callback message and ensure snmp is properly setup and working"
78 },
79 {
80 .code = LIB_ERR_INTERFACE,
81 .title = "Interface Subsystem Error",
82 .description = "FRR has detected a problem with interface data from the kernel as it deviates\nfrom what we would expect to happen via normal netlink messaging",
83 .suggestion = "Open an Issue with all relevant log files and restart FRR"
84 },
85 {
86 .code = LIB_ERR_NS,
87 .title = "NameSpace Subsystem Error",
88 .description = "FRR has detected a problem with NameSpace data from the kernel as it deviates\nfrom what we would expect to happen via normal kernel messaging",
89 .suggestion = "Open an Issue with all relevant log files and restart FRR"
90 },
91 {
92 .code = LIB_ERR_DEVELOPMENT,
93 .title = "Developmental Escape Error",
94 .description = "FRR has detected an issue where new development has not properly\nupdated all code paths.",
95 .suggestion = "Open an Issue with all relevant log files"
96 },
97 {
98 .code = LIB_ERR_ZMQ,
99 .title = "ZMQ Subsystem Error",
100 .description = "FRR has detected an issue with the Zero MQ subsystem and ZeroMQ\nis not working properly now",
101 .suggestion = "Open an Issue with all relevant log files and restart FRR"
102 },
103 {
104 .code = LIB_ERR_UNAVAILABLE,
105 .title = "Feature or system unavailable",
106 .description = "FRR was not compiled with support for a particular feature, or it is not available on the current platform",
107 .suggestion = "Recompile FRR with the feature enabled, or find out what platforms support the feature"
108 },
109 {
110 .code = END_FERR,
111 }
112 };
113 /* clang-format on */
114
115 void lib_error_init(void)
116 {
117 ferr_ref_init();
118 ferr_ref_add(ferr_lib_err);
119 }