]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_errors.c
bgpd: implement zlog_ferr facility for enhance error messages in bgp
[mirror_frr.git] / bgpd / bgp_errors.c
CommitLineData
14454c9f
DS
1/*
2 * bgp_errors - code for error messages that may occur in the
3 * bgp process
4 * Copyright (C) 2018 Cumulus Networks, Inc.
5 * Don Slice
6 *
7 * FRR is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * FRR is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include <zebra.h>
22#include <bgp_errors.h>
23
24static struct ferr_ref ferr_lib_err[] = {
25 {
26 .code = BGP_ERR_ATTR_FLAG,
27 .title = "BGP attribute flag is incorrect",
28 .description = "BGP attribute flag is set to the wrong value (Optional/Transitive/Partial)",
29 .suggestion = "Determine the soure of the attribute and determine why the attribute\n flag has been set incorrectly"
30 },
31 {
32 .code = BGP_ERR_ATTR_LEN,
33 .title = "BGP attribute length is incorrect",
34 .description = "BGP attribute length is incorrect)",
35 .suggestion = "Determine the soure of the attribute and determine why the attribute\nlength has been set incorrectly"
36 },
37 {
38 .code = BGP_ERR_ATTR_ORIGIN,
39 .title = "BGP attribute origin value invalid",
40 .description = "BGP attribute origin value is invalid",
41 .suggestion = "Determine the soure of the attribute and determine why the origin\nattribute has been set incorrectly"
42 },
43 {
44 .code = BGP_ERR_ATTR_MAL_AS_PATH,
45 .title = "BGP as path is invalid",
46 .description = "BGP as path has been malformed",
47 .suggestion = "Determine the soure of the update and determine why the as path has\nbeen set incorrectly"
48 },
49 {
50 .code = BGP_ERR_ATTR_FIRST_AS,
51 .title = "BGP as path first as is invalid",
52 .description = "BGP update has invalid first as in as path",
53 .suggestion = "Determine the soure of the update and determine why the as path first\nas value has been set incorrectly"
54 },
55 {
56 .code = BGP_ERR_ATTR_PMSI_TYPE,
57 .title = "BGP PMSI tunnel attribute type is invalid",
58 .description = "BGP update has invalid type for PMSI tunnel",
59 .suggestion = "Determine the soure of the update and determine why the PMSI tunnel\nattribute type has been set incorrectly"
60 },
61 {
62 .code = BGP_ERR_ATTR_PMSI_LEN,
63 .title = "BGP PMSI tunnel attribute length is invalid",
64 .description = "BGP update has invalid length for PMSI tunnel",
65 .suggestion = "Determine the soure of the update and determine why the PMSI tunnel\nattribute length has been set incorrectly"
66 },
67 {
68 .code = BGP_ERR_NH_SEND_LEN,
69 .title = "BGP nethop length is invalid sending to peer",
70 .description = "BGP update has invalid length for nexthop sending to peer",
71 .suggestion = "Determine why the nexthop length has been set incorrectly"
72 },
73 {
74 .code = BGP_ERR_PEER_GROUP,
75 .title = "BGP peergroup operated on in error",
76 .description = "BGP operating on peer-group instead of peers included",
77 .suggestion = "Ensure the config doesn't contain peergroups contained within peergroups"
78 },
79 {
80 .code = BGP_ERR_PEER_DELETE,
81 .title = "BGP failed to delete peer structure",
82 .description = "BGP was unable to delete peer structure when address-family removed",
83 .suggestion = "Determine if all expected peers are removed and restart FRR if not.\nMost likely a bug"
84 },
85 {
86 .code = BGP_ERR_TABLE_CHUNK,
87 .title = "BGP failed to get table chunk memory",
88 .description = "BGP unable to get chunk memory for table manager",
89 .suggestion = "Ensure there is adequate memory on the device to support the table\nrequirements"
90 },
91 {
92 .code = BGP_ERR_MACIP_LEN,
93 .title = "BGP received MACIP with invalid IP addr len",
94 .description = "BGP received MACIP with invalid IP addr len from Zebra",
95 .suggestion = "Verify MACIP entries inserted in Zebra are correct. Most likely a bug"
96 },
97 {
98 .code = BGP_ERR_LM_ERROR,
99 .title = "BGP received invalid label manager message",
100 .description = "BGP received nvalid label manager message from label manager",
101 .suggestion = "Label manager sent invalid essage to BGP for wrong protocol, instance, etc.\nMost likely a bug"
102 },
103 {
104 .code = BGP_ERR_JSON_MEM_ERROR,
105 .title = "BGP unable to allocate memory for JSON output",
106 .description = "BGP attempted to generate JSON output and was unable to allocate\nthe memory required",
107 .suggestion = "Ensure that the device has adequate memory to suport the required functions"
108 },
109 {
110 .code = BGP_ERR_UPDGRP_ATTR_LEN,
111 .title = "BGP update had attributes too long to send",
112 .description = "BGP attempted to send an update but the attributes were too long to fit",
113 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
114 },
115 {
116 .code = BGP_ERR_UPDGRP_CREATE,
117 .title = "BGP update group creation failed",
118 .description = "BGP attempted to create an update group but was unable to",
119 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
120 },
121 {
122 .code = BGP_ERR_UPDATE_SND,
123 .title = "BGP error creating update packet",
124 .description = "BGP attempted to create an update packet but was unable to",
125 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
126 },
127 {
128 .code = BGP_ERR_PKT_OPEN,
129 .title = "BGP error receiving open packet",
130 .description = "BGP received an open from a peer that was invalid",
131 .suggestion = "Determine the sending peer and correct his invalid open packet"
132 },
133 {
134 .code = BGP_ERR_SOCKET,
135 .title = "Socket Error",
136 .description = "When attempting to access a socket a system error has occurred\nand we were unable to properly complete the request",
137 .suggestion = "Ensure that there are sufficient system resources available and\nensure that the frr user has sufficient permissions to work"
138 },
139 {
140 .code = BGP_ERR_SND_FAIL,
141 .title = "BGP error sending to peer",
142 .description = "BGP attempted to respond to open from a peer and failed",
143 .suggestion = "BGP attempted to respond to an open and could not sene the packet.\nCheck local IP address for source"
144 },
145 {
146 .code = BGP_ERR_INVALID_STATUS,
147 .title = "BGP error receiving from peer",
148 .description = "BGP received an update from a peer but status was incorrect",
149 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
150 },
151 {
152 .code = BGP_ERR_UPDATE_RCV,
153 .title = "BGP error receiving update packet",
154 .description = "BGP received an invalid update packet",
155 .suggestion = "Determine the source of the update and resolve the invalid update being sent"
156 },
157 {
158 .code = BGP_ERR_NO_CAP,
159 .title = "BGP error due to capability not enabled",
160 .description = "BGP attempted a function that did not have the capability enabled",
161 .suggestion = "Enable the capability if this functionality is desired"
162 },
163 {
164 .code = BGP_ERR_NOTIFY_RCV,
165 .title = "BGP error receiving notify message",
166 .description = "BGP unable to process notification message",
167 .suggestion = "BGP notify received while in stopped state. If the problem persists,\nreport for troubleshooting"
168 },
169 {
170 .code = BGP_ERR_KEEP_RCV,
171 .title = "BGP error receiving keepalive packet",
172 .description = "BGP unable to process keepalive packet",
173 .suggestion = "BGP keepalive received while in stopped state. If the problem persists,\nreport for troubleshooting"
174 },
175 {
176 .code = BGP_ERR_RFSH_RCV,
177 .title = "BGP error receiving route refresh message",
178 .description = "BGP unable to process route refresh message",
179 .suggestion = "BGP route refresh received while in stopped state. If the problem persists,\nreport for troubleshooting"},
180 {
181 .code = BGP_ERR_CAP_RCV,
182 .title = "BGP error capability message",
183 .description = "BGP unable to process received capability",
184 .suggestion = "BGP capability message received while in stopped state. If the problem\npersists, report for troubleshooting"
185 },
186 {
187 .code = BGP_ERR_NH_UPD,
188 .title = "BGP error with nexthopo update",
189 .description = "BGP unable to process nexthop update",
190 .suggestion = "BGP received nexthop update but nexthop is not reachable in this bgp\ninstance. Report for troubleshooting"
191 },
192 {
193 .code = BGP_ERR_PRIVILEGES,
194 .title = "Failure to raise or lower privileges",
195 .description = "FRR attempted to raise or lower its privileges and was unable to do so",
196 .suggestion = "Ensure that you are running FRR as the frr user and that the user has\nSufficient privileges to properly access root privileges"
197 },
198 {
199 .code = BGP_ERR_LABEL,
200 .title = "Failure to apply label",
201 .description = "BGP attempted to attempted to apply a label but could not",
202 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
203 },
204 {
205 .code = BGP_ERR_MULTIPATH,
206 .title = "Multipath specified is invalid",
207 .description = "BGP was started with an invalid ecmp/multipath value",
208 .suggestion = "Correct the ecmp/multipath value supplied when starting the BGP daemon"
209 },
210 {
211 .code = BGP_ERR_PKT_PROCESS,
212 .title = "Failure to process a packet",
213 .description = "BGP attempted to process a received packet but could not",
214 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
215 },
216 {
217 .code = BGP_ERR_CONNECT,
218 .title = "Failure to connect to peer",
219 .description = "BGP attempted to send open to peer but couldn't connect",
220 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
221 },
222 {
223 .code = BGP_ERR_FSM,
224 .title = "BGP FSM issue",
225 .description = "BGP neighbor transition problem",
226 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
227 },
228 {
229 .code = BGP_ERR_VNI,
230 title = "BGP VNI creation issue",
231 .description = "BGP could not create a new VNI",
232 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
233 },
234 {
235 .code = BGP_ERR_NO_DFLT,
236 .title = "BGP default instance missing",
237 .description = "BGP could not find default instance",
238 .suggestion = "Define a default instance of BGP since some feature requires it's existence"
239 },
240 {
241 .code = BGP_ERR_VTEP_INVALID,
242 .title = "BGP remote VTEP invalid",
243 .description = "BGP remote VTEP is invalid and cannot be used",
244 .suggestion = "Correct remote VTEP configuration or resolve the source of the problem"
245 },
246 {
247 .code = BGP_ERR_ES_INVALID,
248 .title = "BGP ES route error",
249 .description = "BGP ES route incorrect, learned both local and remote",
250 .suggestion = "Correct configuration or addressing so that same not learned both local and remote"
251 },
252 {
253 .code = BGP_ERR_EVPN_ROUTE_DELETE,
254 .title = "BGP EVPN route delete error",
255 .description = "BGP attempted to delete an EVPN route and failed",
256 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
257 },
258 {
259 .code = BGP_ERR_EVPN_FAIL,
260 .title = "BGP EVPN install/uninstall error",
261 .description = "BGP attempted to install or uninstall an EVPN prefix and failed",
262 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
263 },
264 {
265 .code = BGP_ERR_EVPN_ROUTE_INVALID,
266 .title = "BGP EVPN route received with invalid contents",
267 .description = "BGP received an EVPN route with invalid contents",
268 .suggestion = "Determine the source of the EVPN route and resolve whatever is causing\ninvalid contents"
269 },
270 {
271 .code = BGP_ERR_EVPN_ROUTE_CREATE,
272 .title = "BGP EVPN route create error",
273 .description = "BGP attempted to create an EVPN route and failed",
274 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
275 },
276 {
277 .code = BGP_ERR_ES_CREATE,
278 .title = "BGP EVPN ES entry create error",
279 .description = "BGP attempted to create an EVPN ES entry and failed",
280 .suggestion = "Most likely a bug. If the problem persists, report the problem for troubleshooting"
281 },
282 {
283 .code = BGP_ERR_MULTI_INSTANCE,
284 .title = "BGP config multi-instance issue",
285 .description = "BGP configuration attempting multiple instances without enabling the feature",
286 .suggestion = "Correct the configuration so that bgp multiple-instance is enabled if desired"
287 },
288 {
289 .code = BGP_ERR_EVPN_AS_MISMATCH,
290 .title = "BGP AS configuration issue",
291 .description = "BGP configuration attempted for a different AS than currently configured",
292 .suggestion = "Correct the configuration so that the correct BGP AS number is used"
293 },
294 {
295 .code = BGP_ERR_EVPN_INSTANCE_MISMATCH,
296 .title = "BGP EVPN AS and process name mismatch",
297 .description = "BGP configuration has AS and process name mismatch",
298 .suggestion = "Correct the configuration so that the BGP AS number and instance\nname are consistent"
299 },
300{
301 .code = END_FERR,
302}
303}
304;
305
306void BGP_error_init(void)
307{
308 ferr_ref_init();
309
310 ferr_ref_add(ferr_bgp_err);
311}