blob: 90a378ba270c9593a1db42fa5af8cdafe23025e3 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/* BGP-4, BGP-4+ packet debug routine
2 Copyright (C) 1996, 97, 99 Kunihiro Ishiguro
3
4This file is part of GNU Zebra.
5
6GNU Zebra is free software; you can redistribute it and/or modify it
7under the terms of the GNU General Public License as published by the
8Free Software Foundation; either version 2, or (at your option) any
9later version.
10
11GNU Zebra is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Zebra; see the file COPYING. If not, write to the Free
18Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1902111-1307, USA. */
20
21#include <zebra.h>
22
gdt5e4fa162004-03-16 14:38:36 +000023#include <lib/version.h>
paul718e3742002-12-13 20:15:29 +000024#include "prefix.h"
25#include "linklist.h"
26#include "stream.h"
27#include "command.h"
28#include "str.h"
29#include "log.h"
30#include "sockunion.h"
Donald Sharp04907292016-01-07 10:03:01 -050031#include "filter.h"
paul718e3742002-12-13 20:15:29 +000032
33#include "bgpd/bgpd.h"
34#include "bgpd/bgp_aspath.h"
35#include "bgpd/bgp_route.h"
36#include "bgpd/bgp_attr.h"
37#include "bgpd/bgp_debug.h"
38#include "bgpd/bgp_community.h"
39
Paul Jakma0b2aa3a2007-10-14 22:32:21 +000040unsigned long conf_bgp_debug_as4;
paul718e3742002-12-13 20:15:29 +000041unsigned long conf_bgp_debug_fsm;
42unsigned long conf_bgp_debug_events;
43unsigned long conf_bgp_debug_packet;
44unsigned long conf_bgp_debug_filter;
45unsigned long conf_bgp_debug_keepalive;
46unsigned long conf_bgp_debug_update;
47unsigned long conf_bgp_debug_normal;
Andrew J. Schorra39275d2006-11-30 16:36:57 +000048unsigned long conf_bgp_debug_zebra;
Lou Bergerf53585d2016-05-17 07:10:36 -040049unsigned long conf_bgp_debug_allow_martians;
paul718e3742002-12-13 20:15:29 +000050
Paul Jakma0b2aa3a2007-10-14 22:32:21 +000051unsigned long term_bgp_debug_as4;
paul718e3742002-12-13 20:15:29 +000052unsigned long term_bgp_debug_fsm;
53unsigned long term_bgp_debug_events;
54unsigned long term_bgp_debug_packet;
55unsigned long term_bgp_debug_filter;
56unsigned long term_bgp_debug_keepalive;
57unsigned long term_bgp_debug_update;
58unsigned long term_bgp_debug_normal;
Andrew J. Schorra39275d2006-11-30 16:36:57 +000059unsigned long term_bgp_debug_zebra;
Lou Bergerf53585d2016-05-17 07:10:36 -040060unsigned long term_bgp_debug_allow_martians;
paul718e3742002-12-13 20:15:29 +000061
62/* messages for BGP-4 status */
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -070063const struct message bgp_status_msg[] =
paul718e3742002-12-13 20:15:29 +000064{
paul718e3742002-12-13 20:15:29 +000065 { Idle, "Idle" },
66 { Connect, "Connect" },
67 { Active, "Active" },
68 { OpenSent, "OpenSent" },
69 { OpenConfirm, "OpenConfirm" },
70 { Established, "Established" },
Paul Jakmaca058a32006-09-14 02:58:49 +000071 { Clearing, "Clearing" },
72 { Deleted, "Deleted" },
paul718e3742002-12-13 20:15:29 +000073};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -070074const int bgp_status_msg_max = BGP_STATUS_MAX;
paul718e3742002-12-13 20:15:29 +000075
76/* BGP message type string. */
paulfd79ac92004-10-13 05:06:08 +000077const char *bgp_type_str[] =
paul718e3742002-12-13 20:15:29 +000078{
79 NULL,
80 "OPEN",
81 "UPDATE",
82 "NOTIFICATION",
83 "KEEPALIVE",
84 "ROUTE-REFRESH",
85 "CAPABILITY"
86};
87
88/* message for BGP-4 Notify */
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -070089static const struct message bgp_notify_msg[] =
paul718e3742002-12-13 20:15:29 +000090{
paul718e3742002-12-13 20:15:29 +000091 { BGP_NOTIFY_HEADER_ERR, "Message Header Error"},
92 { BGP_NOTIFY_OPEN_ERR, "OPEN Message Error"},
93 { BGP_NOTIFY_UPDATE_ERR, "UPDATE Message Error"},
94 { BGP_NOTIFY_HOLD_ERR, "Hold Timer Expired"},
95 { BGP_NOTIFY_FSM_ERR, "Finite State Machine Error"},
96 { BGP_NOTIFY_CEASE, "Cease"},
97 { BGP_NOTIFY_CAPABILITY_ERR, "CAPABILITY Message Error"},
98};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -070099static const int bgp_notify_msg_max = BGP_NOTIFY_MAX;
paul718e3742002-12-13 20:15:29 +0000100
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700101static const struct message bgp_notify_head_msg[] =
paul718e3742002-12-13 20:15:29 +0000102{
hasso3950fda2004-05-20 10:22:49 +0000103 { BGP_NOTIFY_HEADER_NOT_SYNC, "/Connection Not Synchronized"},
104 { BGP_NOTIFY_HEADER_BAD_MESLEN, "/Bad Message Length"},
105 { BGP_NOTIFY_HEADER_BAD_MESTYPE, "/Bad Message Type"}
paul718e3742002-12-13 20:15:29 +0000106};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700107static const int bgp_notify_head_msg_max = BGP_NOTIFY_HEADER_MAX;
paul718e3742002-12-13 20:15:29 +0000108
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700109static const struct message bgp_notify_open_msg[] =
paul718e3742002-12-13 20:15:29 +0000110{
Dmitrij Tejblum4b4e07d2011-09-21 23:13:22 +0400111 { BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
hasso3950fda2004-05-20 10:22:49 +0000112 { BGP_NOTIFY_OPEN_UNSUP_VERSION, "/Unsupported Version Number" },
113 { BGP_NOTIFY_OPEN_BAD_PEER_AS, "/Bad Peer AS"},
114 { BGP_NOTIFY_OPEN_BAD_BGP_IDENT, "/Bad BGP Identifier"},
115 { BGP_NOTIFY_OPEN_UNSUP_PARAM, "/Unsupported Optional Parameter"},
116 { BGP_NOTIFY_OPEN_AUTH_FAILURE, "/Authentication Failure"},
117 { BGP_NOTIFY_OPEN_UNACEP_HOLDTIME, "/Unacceptable Hold Time"},
118 { BGP_NOTIFY_OPEN_UNSUP_CAPBL, "/Unsupported Capability"},
paul718e3742002-12-13 20:15:29 +0000119};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700120static const int bgp_notify_open_msg_max = BGP_NOTIFY_OPEN_MAX;
paul718e3742002-12-13 20:15:29 +0000121
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700122static const struct message bgp_notify_update_msg[] =
paul718e3742002-12-13 20:15:29 +0000123{
Dmitrij Tejblum4b4e07d2011-09-21 23:13:22 +0400124 { BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
hasso3950fda2004-05-20 10:22:49 +0000125 { BGP_NOTIFY_UPDATE_MAL_ATTR, "/Malformed Attribute List"},
126 { BGP_NOTIFY_UPDATE_UNREC_ATTR, "/Unrecognized Well-known Attribute"},
127 { BGP_NOTIFY_UPDATE_MISS_ATTR, "/Missing Well-known Attribute"},
128 { BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR, "/Attribute Flags Error"},
129 { BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, "/Attribute Length Error"},
130 { BGP_NOTIFY_UPDATE_INVAL_ORIGIN, "/Invalid ORIGIN Attribute"},
131 { BGP_NOTIFY_UPDATE_AS_ROUTE_LOOP, "/AS Routing Loop"},
132 { BGP_NOTIFY_UPDATE_INVAL_NEXT_HOP, "/Invalid NEXT_HOP Attribute"},
133 { BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, "/Optional Attribute Error"},
134 { BGP_NOTIFY_UPDATE_INVAL_NETWORK, "/Invalid Network Field"},
135 { BGP_NOTIFY_UPDATE_MAL_AS_PATH, "/Malformed AS_PATH"},
paul718e3742002-12-13 20:15:29 +0000136};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700137static const int bgp_notify_update_msg_max = BGP_NOTIFY_UPDATE_MAX;
paul718e3742002-12-13 20:15:29 +0000138
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700139static const struct message bgp_notify_cease_msg[] =
paul718e3742002-12-13 20:15:29 +0000140{
Dmitrij Tejblum4b4e07d2011-09-21 23:13:22 +0400141 { BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
hasso3950fda2004-05-20 10:22:49 +0000142 { BGP_NOTIFY_CEASE_MAX_PREFIX, "/Maximum Number of Prefixes Reached"},
143 { BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN, "/Administratively Shutdown"},
144 { BGP_NOTIFY_CEASE_PEER_UNCONFIG, "/Peer Unconfigured"},
145 { BGP_NOTIFY_CEASE_ADMIN_RESET, "/Administratively Reset"},
146 { BGP_NOTIFY_CEASE_CONNECT_REJECT, "/Connection Rejected"},
147 { BGP_NOTIFY_CEASE_CONFIG_CHANGE, "/Other Configuration Change"},
148 { BGP_NOTIFY_CEASE_COLLISION_RESOLUTION, "/Connection collision resolution"},
149 { BGP_NOTIFY_CEASE_OUT_OF_RESOURCE, "/Out of Resource"},
paul718e3742002-12-13 20:15:29 +0000150};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700151static const int bgp_notify_cease_msg_max = BGP_NOTIFY_CEASE_MAX;
paul718e3742002-12-13 20:15:29 +0000152
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700153static const struct message bgp_notify_capability_msg[] =
paul718e3742002-12-13 20:15:29 +0000154{
Dmitrij Tejblum4b4e07d2011-09-21 23:13:22 +0400155 { BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
hasso3950fda2004-05-20 10:22:49 +0000156 { BGP_NOTIFY_CAPABILITY_INVALID_ACTION, "/Invalid Action Value" },
157 { BGP_NOTIFY_CAPABILITY_INVALID_LENGTH, "/Invalid Capability Length"},
158 { BGP_NOTIFY_CAPABILITY_MALFORMED_CODE, "/Malformed Capability Value"},
paul718e3742002-12-13 20:15:29 +0000159};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700160static const int bgp_notify_capability_msg_max = BGP_NOTIFY_CAPABILITY_MAX;
paul718e3742002-12-13 20:15:29 +0000161
162/* Origin strings. */
paulfd79ac92004-10-13 05:06:08 +0000163const char *bgp_origin_str[] = {"i","e","?"};
164const char *bgp_origin_long_str[] = {"IGP","EGP","incomplete"};
paul718e3742002-12-13 20:15:29 +0000165
166/* Dump attribute. */
paule01f9cb2004-07-09 17:48:53 +0000167int
paul718e3742002-12-13 20:15:29 +0000168bgp_dump_attr (struct peer *peer, struct attr *attr, char *buf, size_t size)
169{
paul718e3742002-12-13 20:15:29 +0000170 if (! attr)
paule01f9cb2004-07-09 17:48:53 +0000171 return 0;
paul718e3742002-12-13 20:15:29 +0000172
paule01f9cb2004-07-09 17:48:53 +0000173 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP)))
174 snprintf (buf, size, "nexthop %s", inet_ntoa (attr->nexthop));
175
176 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ORIGIN)))
177 snprintf (buf + strlen (buf), size - strlen (buf), ", origin %s",
178 bgp_origin_str[attr->origin]);
paul718e3742002-12-13 20:15:29 +0000179
Paul Jakmafb982c22007-05-04 20:15:47 +0000180 if (attr->extra)
181 {
182 char addrbuf[BUFSIZ];
paul718e3742002-12-13 20:15:29 +0000183
Paul Jakmafb982c22007-05-04 20:15:47 +0000184 /* Add MP case. */
185 if (attr->extra->mp_nexthop_len == 16
186 || attr->extra->mp_nexthop_len == 32)
187 snprintf (buf + strlen (buf), size - strlen (buf), ", mp_nexthop %s",
188 inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global,
189 addrbuf, BUFSIZ));
paul718e3742002-12-13 20:15:29 +0000190
Paul Jakmafb982c22007-05-04 20:15:47 +0000191 if (attr->extra->mp_nexthop_len == 32)
192 snprintf (buf + strlen (buf), size - strlen (buf), "(%s)",
193 inet_ntop (AF_INET6, &attr->extra->mp_nexthop_local,
194 addrbuf, BUFSIZ));
195 }
paul718e3742002-12-13 20:15:29 +0000196
paule01f9cb2004-07-09 17:48:53 +0000197 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF)))
Jorge Boncompte [DTI2]ddc943d2012-04-13 13:46:07 +0200198 snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %u",
paul718e3742002-12-13 20:15:29 +0000199 attr->local_pref);
200
paule01f9cb2004-07-09 17:48:53 +0000201 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC)))
Jorge Boncompte [DTI2]ddc943d2012-04-13 13:46:07 +0200202 snprintf (buf + strlen (buf), size - strlen (buf), ", metric %u",
paul718e3742002-12-13 20:15:29 +0000203 attr->med);
204
paule01f9cb2004-07-09 17:48:53 +0000205 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES)))
paul718e3742002-12-13 20:15:29 +0000206 snprintf (buf + strlen (buf), size - strlen (buf), ", community %s",
207 community_str (attr->community));
208
paule01f9cb2004-07-09 17:48:53 +0000209 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ATOMIC_AGGREGATE)))
paul718e3742002-12-13 20:15:29 +0000210 snprintf (buf + strlen (buf), size - strlen (buf), ", atomic-aggregate");
211
paule01f9cb2004-07-09 17:48:53 +0000212 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_AGGREGATOR)))
Denis Ovsienkoaea339f2009-04-30 17:16:22 +0400213 snprintf (buf + strlen (buf), size - strlen (buf), ", aggregated by %u %s",
Paul Jakmafb982c22007-05-04 20:15:47 +0000214 attr->extra->aggregator_as,
215 inet_ntoa (attr->extra->aggregator_addr));
paul718e3742002-12-13 20:15:29 +0000216
paule01f9cb2004-07-09 17:48:53 +0000217 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ORIGINATOR_ID)))
paul718e3742002-12-13 20:15:29 +0000218 snprintf (buf + strlen (buf), size - strlen (buf), ", originator %s",
Paul Jakmafb982c22007-05-04 20:15:47 +0000219 inet_ntoa (attr->extra->originator_id));
paul718e3742002-12-13 20:15:29 +0000220
paule01f9cb2004-07-09 17:48:53 +0000221 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_CLUSTER_LIST)))
paul718e3742002-12-13 20:15:29 +0000222 {
223 int i;
224
paule01f9cb2004-07-09 17:48:53 +0000225 snprintf (buf + strlen (buf), size - strlen (buf), ", clusterlist");
Paul Jakmafb982c22007-05-04 20:15:47 +0000226 for (i = 0; i < attr->extra->cluster->length / 4; i++)
paule01f9cb2004-07-09 17:48:53 +0000227 snprintf (buf + strlen (buf), size - strlen (buf), " %s",
Paul Jakmafb982c22007-05-04 20:15:47 +0000228 inet_ntoa (attr->extra->cluster->list[i]));
paul718e3742002-12-13 20:15:29 +0000229 }
230
paule01f9cb2004-07-09 17:48:53 +0000231 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_AS_PATH)))
paul718e3742002-12-13 20:15:29 +0000232 snprintf (buf + strlen (buf), size - strlen (buf), ", path %s",
233 aspath_print (attr->aspath));
paule01f9cb2004-07-09 17:48:53 +0000234
235 if (strlen (buf) > 1)
236 return 1;
237 else
238 return 0;
paul718e3742002-12-13 20:15:29 +0000239}
240
241/* dump notify packet */
242void
paulfd79ac92004-10-13 05:06:08 +0000243bgp_notify_print(struct peer *peer, struct bgp_notify *bgp_notify,
244 const char *direct)
paul718e3742002-12-13 20:15:29 +0000245{
paulfd79ac92004-10-13 05:06:08 +0000246 const char *subcode_str;
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000247 const char *code_str;
paul718e3742002-12-13 20:15:29 +0000248
249 subcode_str = "";
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000250 code_str = LOOKUP_DEF (bgp_notify_msg, bgp_notify->code,
251 "Unrecognized Error Code");
paul718e3742002-12-13 20:15:29 +0000252
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000253 switch (bgp_notify->code)
paul718e3742002-12-13 20:15:29 +0000254 {
255 case BGP_NOTIFY_HEADER_ERR:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000256 subcode_str = LOOKUP_DEF (bgp_notify_head_msg, bgp_notify->subcode,
257 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000258 break;
259 case BGP_NOTIFY_OPEN_ERR:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000260 subcode_str = LOOKUP_DEF (bgp_notify_open_msg, bgp_notify->subcode,
261 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000262 break;
263 case BGP_NOTIFY_UPDATE_ERR:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000264 subcode_str = LOOKUP_DEF (bgp_notify_update_msg, bgp_notify->subcode,
265 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000266 break;
267 case BGP_NOTIFY_HOLD_ERR:
paul718e3742002-12-13 20:15:29 +0000268 break;
269 case BGP_NOTIFY_FSM_ERR:
paul718e3742002-12-13 20:15:29 +0000270 break;
271 case BGP_NOTIFY_CEASE:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000272 subcode_str = LOOKUP_DEF (bgp_notify_cease_msg, bgp_notify->subcode,
273 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000274 break;
275 case BGP_NOTIFY_CAPABILITY_ERR:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000276 subcode_str = LOOKUP_DEF (bgp_notify_capability_msg, bgp_notify->subcode,
277 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000278 break;
279 }
hasso3950fda2004-05-20 10:22:49 +0000280
281 if (bgp_flag_check (peer->bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES))
282 zlog_info ("%%NOTIFICATION: %s neighbor %s %d/%d (%s%s) %d bytes %s",
283 strcmp (direct, "received") == 0 ? "received from" : "sent to",
284 peer->host, bgp_notify->code, bgp_notify->subcode,
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000285 code_str, subcode_str, bgp_notify->length,
hasso3950fda2004-05-20 10:22:49 +0000286 bgp_notify->data ? bgp_notify->data : "");
287 else if (BGP_DEBUG (normal, NORMAL))
ajs557865c2004-12-08 19:59:11 +0000288 plog_debug (peer->log, "%s %s NOTIFICATION %d/%d (%s%s) %d bytes %s",
paul718e3742002-12-13 20:15:29 +0000289 peer ? peer->host : "",
290 direct, bgp_notify->code, bgp_notify->subcode,
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000291 code_str, subcode_str, bgp_notify->length,
paul718e3742002-12-13 20:15:29 +0000292 bgp_notify->data ? bgp_notify->data : "");
293}
David Lamparter6b0655a2014-06-04 06:53:35 +0200294
paul718e3742002-12-13 20:15:29 +0000295/* Debug option setting interface. */
296unsigned long bgp_debug_option = 0;
297
298int
299debug (unsigned int option)
300{
301 return bgp_debug_option & option;
302}
303
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000304DEFUN (debug_bgp_as4,
305 debug_bgp_as4_cmd,
306 "debug bgp as4",
307 DEBUG_STR
308 BGP_STR
309 "BGP AS4 actions\n")
310{
311 if (vty->node == CONFIG_NODE)
312 DEBUG_ON (as4, AS4);
313 else
314 {
315 TERM_DEBUG_ON (as4, AS4);
316 vty_out (vty, "BGP as4 debugging is on%s", VTY_NEWLINE);
317 }
318 return CMD_SUCCESS;
319}
320
321DEFUN (no_debug_bgp_as4,
322 no_debug_bgp_as4_cmd,
323 "no debug bgp as4",
324 NO_STR
325 DEBUG_STR
326 BGP_STR
327 "BGP AS4 actions\n")
328{
329 if (vty->node == CONFIG_NODE)
330 DEBUG_OFF (as4, AS4);
331 else
332 {
333 TERM_DEBUG_OFF (as4, AS4);
334 vty_out (vty, "BGP as4 debugging is off%s", VTY_NEWLINE);
335 }
336 return CMD_SUCCESS;
337}
338
339ALIAS (no_debug_bgp_as4,
340 undebug_bgp_as4_cmd,
341 "undebug bgp as4",
342 UNDEBUG_STR
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000343 BGP_STR
344 "BGP AS4 actions\n")
345
346DEFUN (debug_bgp_as4_segment,
347 debug_bgp_as4_segment_cmd,
348 "debug bgp as4 segment",
349 DEBUG_STR
350 BGP_STR
David Ward6e22b902011-01-17 10:58:52 +0300351 "BGP AS4 actions\n"
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000352 "BGP AS4 aspath segment handling\n")
353{
354 if (vty->node == CONFIG_NODE)
355 DEBUG_ON (as4, AS4_SEGMENT);
356 else
357 {
358 TERM_DEBUG_ON (as4, AS4_SEGMENT);
359 vty_out (vty, "BGP as4 segment debugging is on%s", VTY_NEWLINE);
360 }
361 return CMD_SUCCESS;
362}
363
364DEFUN (no_debug_bgp_as4_segment,
365 no_debug_bgp_as4_segment_cmd,
366 "no debug bgp as4 segment",
367 NO_STR
368 DEBUG_STR
369 BGP_STR
David Ward6e22b902011-01-17 10:58:52 +0300370 "BGP AS4 actions\n"
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000371 "BGP AS4 aspath segment handling\n")
372{
373 if (vty->node == CONFIG_NODE)
374 DEBUG_OFF (as4, AS4_SEGMENT);
375 else
376 {
377 TERM_DEBUG_OFF (as4, AS4_SEGMENT);
378 vty_out (vty, "BGP as4 segment debugging is off%s", VTY_NEWLINE);
379 }
380 return CMD_SUCCESS;
381}
382
383ALIAS (no_debug_bgp_as4_segment,
384 undebug_bgp_as4_segment_cmd,
385 "undebug bgp as4 segment",
386 UNDEBUG_STR
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000387 BGP_STR
David Ward6e22b902011-01-17 10:58:52 +0300388 "BGP AS4 actions\n"
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000389 "BGP AS4 aspath segment handling\n")
390
paul718e3742002-12-13 20:15:29 +0000391DEFUN (debug_bgp_fsm,
392 debug_bgp_fsm_cmd,
393 "debug bgp fsm",
394 DEBUG_STR
395 BGP_STR
396 "BGP Finite State Machine\n")
397{
398 if (vty->node == CONFIG_NODE)
399 DEBUG_ON (fsm, FSM);
400 else
401 {
402 TERM_DEBUG_ON (fsm, FSM);
403 vty_out (vty, "BGP fsm debugging is on%s", VTY_NEWLINE);
404 }
405 return CMD_SUCCESS;
406}
407
408DEFUN (no_debug_bgp_fsm,
409 no_debug_bgp_fsm_cmd,
410 "no debug bgp fsm",
411 NO_STR
412 DEBUG_STR
413 BGP_STR
414 "Finite State Machine\n")
415{
416 if (vty->node == CONFIG_NODE)
417 DEBUG_OFF (fsm, FSM);
418 else
419 {
420 TERM_DEBUG_OFF (fsm, FSM);
421 vty_out (vty, "BGP fsm debugging is off%s", VTY_NEWLINE);
422 }
423 return CMD_SUCCESS;
424}
425
426ALIAS (no_debug_bgp_fsm,
427 undebug_bgp_fsm_cmd,
428 "undebug bgp fsm",
429 UNDEBUG_STR
paul718e3742002-12-13 20:15:29 +0000430 BGP_STR
431 "Finite State Machine\n")
432
433DEFUN (debug_bgp_events,
434 debug_bgp_events_cmd,
435 "debug bgp events",
436 DEBUG_STR
437 BGP_STR
438 "BGP events\n")
439{
440 if (vty->node == CONFIG_NODE)
441 DEBUG_ON (events, EVENTS);
442 else
443 {
444 TERM_DEBUG_ON (events, EVENTS);
445 vty_out (vty, "BGP events debugging is on%s", VTY_NEWLINE);
446 }
447 return CMD_SUCCESS;
448}
449
450DEFUN (no_debug_bgp_events,
451 no_debug_bgp_events_cmd,
452 "no debug bgp events",
453 NO_STR
454 DEBUG_STR
455 BGP_STR
456 "BGP events\n")
457{
458 if (vty->node == CONFIG_NODE)
459 DEBUG_OFF (events, EVENTS);
460 else
461 {
462 TERM_DEBUG_OFF (events, EVENTS);
463 vty_out (vty, "BGP events debugging is off%s", VTY_NEWLINE);
464 }
465 return CMD_SUCCESS;
466}
467
468ALIAS (no_debug_bgp_events,
469 undebug_bgp_events_cmd,
470 "undebug bgp events",
471 UNDEBUG_STR
472 BGP_STR
473 "BGP events\n")
474
475DEFUN (debug_bgp_filter,
476 debug_bgp_filter_cmd,
477 "debug bgp filters",
478 DEBUG_STR
479 BGP_STR
480 "BGP filters\n")
481{
482 if (vty->node == CONFIG_NODE)
483 DEBUG_ON (filter, FILTER);
484 else
485 {
486 TERM_DEBUG_ON (filter, FILTER);
487 vty_out (vty, "BGP filters debugging is on%s", VTY_NEWLINE);
488 }
489 return CMD_SUCCESS;
490}
491
492DEFUN (no_debug_bgp_filter,
493 no_debug_bgp_filter_cmd,
494 "no debug bgp filters",
495 NO_STR
496 DEBUG_STR
497 BGP_STR
498 "BGP filters\n")
499{
500 if (vty->node == CONFIG_NODE)
501 DEBUG_OFF (filter, FILTER);
502 else
503 {
504 TERM_DEBUG_OFF (filter, FILTER);
505 vty_out (vty, "BGP filters debugging is off%s", VTY_NEWLINE);
506 }
507 return CMD_SUCCESS;
508}
509
510ALIAS (no_debug_bgp_filter,
511 undebug_bgp_filter_cmd,
512 "undebug bgp filters",
513 UNDEBUG_STR
514 BGP_STR
515 "BGP filters\n")
516
517DEFUN (debug_bgp_keepalive,
518 debug_bgp_keepalive_cmd,
519 "debug bgp keepalives",
520 DEBUG_STR
521 BGP_STR
522 "BGP keepalives\n")
523{
524 if (vty->node == CONFIG_NODE)
525 DEBUG_ON (keepalive, KEEPALIVE);
526 else
527 {
528 TERM_DEBUG_ON (keepalive, KEEPALIVE);
529 vty_out (vty, "BGP keepalives debugging is on%s", VTY_NEWLINE);
530 }
531 return CMD_SUCCESS;
532}
533
534DEFUN (no_debug_bgp_keepalive,
535 no_debug_bgp_keepalive_cmd,
536 "no debug bgp keepalives",
537 NO_STR
538 DEBUG_STR
539 BGP_STR
540 "BGP keepalives\n")
541{
542 if (vty->node == CONFIG_NODE)
543 DEBUG_OFF (keepalive, KEEPALIVE);
544 else
545 {
546 TERM_DEBUG_OFF (keepalive, KEEPALIVE);
547 vty_out (vty, "BGP keepalives debugging is off%s", VTY_NEWLINE);
548 }
549 return CMD_SUCCESS;
550}
551
552ALIAS (no_debug_bgp_keepalive,
553 undebug_bgp_keepalive_cmd,
554 "undebug bgp keepalives",
555 UNDEBUG_STR
556 BGP_STR
557 "BGP keepalives\n")
558
559DEFUN (debug_bgp_update,
560 debug_bgp_update_cmd,
561 "debug bgp updates",
562 DEBUG_STR
563 BGP_STR
564 "BGP updates\n")
565{
566 if (vty->node == CONFIG_NODE)
567 {
568 DEBUG_ON (update, UPDATE_IN);
569 DEBUG_ON (update, UPDATE_OUT);
570 }
571 else
572 {
573 TERM_DEBUG_ON (update, UPDATE_IN);
574 TERM_DEBUG_ON (update, UPDATE_OUT);
575 vty_out (vty, "BGP updates debugging is on%s", VTY_NEWLINE);
576 }
577 return CMD_SUCCESS;
578}
579
580DEFUN (debug_bgp_update_direct,
581 debug_bgp_update_direct_cmd,
582 "debug bgp updates (in|out)",
583 DEBUG_STR
584 BGP_STR
585 "BGP updates\n"
586 "Inbound updates\n"
587 "Outbound updates\n")
588{
589 if (vty->node == CONFIG_NODE)
590 {
591 if (strncmp ("i", argv[0], 1) == 0)
592 {
593 DEBUG_OFF (update, UPDATE_OUT);
594 DEBUG_ON (update, UPDATE_IN);
595 }
596 else
597 {
598 DEBUG_OFF (update, UPDATE_IN);
599 DEBUG_ON (update, UPDATE_OUT);
600 }
601 }
602 else
603 {
604 if (strncmp ("i", argv[0], 1) == 0)
605 {
606 TERM_DEBUG_OFF (update, UPDATE_OUT);
607 TERM_DEBUG_ON (update, UPDATE_IN);
608 vty_out (vty, "BGP updates debugging is on (inbound)%s", VTY_NEWLINE);
609 }
610 else
611 {
612 TERM_DEBUG_OFF (update, UPDATE_IN);
613 TERM_DEBUG_ON (update, UPDATE_OUT);
614 vty_out (vty, "BGP updates debugging is on (outbound)%s", VTY_NEWLINE);
615 }
616 }
617 return CMD_SUCCESS;
618}
619
620DEFUN (no_debug_bgp_update,
621 no_debug_bgp_update_cmd,
622 "no debug bgp updates",
623 NO_STR
624 DEBUG_STR
625 BGP_STR
626 "BGP updates\n")
627{
628 if (vty->node == CONFIG_NODE)
629 {
630 DEBUG_OFF (update, UPDATE_IN);
631 DEBUG_OFF (update, UPDATE_OUT);
632 }
633 else
634 {
635 TERM_DEBUG_OFF (update, UPDATE_IN);
636 TERM_DEBUG_OFF (update, UPDATE_OUT);
637 vty_out (vty, "BGP updates debugging is off%s", VTY_NEWLINE);
638 }
639 return CMD_SUCCESS;
640}
641
642ALIAS (no_debug_bgp_update,
643 undebug_bgp_update_cmd,
644 "undebug bgp updates",
645 UNDEBUG_STR
646 BGP_STR
647 "BGP updates\n")
648
649DEFUN (debug_bgp_normal,
650 debug_bgp_normal_cmd,
651 "debug bgp",
652 DEBUG_STR
653 BGP_STR)
654{
655 if (vty->node == CONFIG_NODE)
656 DEBUG_ON (normal, NORMAL);
657 else
658 {
659 TERM_DEBUG_ON (normal, NORMAL);
660 vty_out (vty, "BGP debugging is on%s", VTY_NEWLINE);
661 }
662 return CMD_SUCCESS;
663}
664
665DEFUN (no_debug_bgp_normal,
666 no_debug_bgp_normal_cmd,
667 "no debug bgp",
668 NO_STR
669 DEBUG_STR
670 BGP_STR)
671{
672 if (vty->node == CONFIG_NODE)
673 DEBUG_OFF (normal, NORMAL);
674 else
675 {
676 TERM_DEBUG_OFF (normal, NORMAL);
677 vty_out (vty, "BGP debugging is off%s", VTY_NEWLINE);
678 }
679 return CMD_SUCCESS;
680}
681
682ALIAS (no_debug_bgp_normal,
683 undebug_bgp_normal_cmd,
684 "undebug bgp",
685 UNDEBUG_STR
686 BGP_STR)
687
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000688DEFUN (debug_bgp_zebra,
689 debug_bgp_zebra_cmd,
690 "debug bgp zebra",
691 DEBUG_STR
692 BGP_STR
693 "BGP Zebra messages\n")
694{
695 if (vty->node == CONFIG_NODE)
696 DEBUG_ON (zebra, ZEBRA);
697 else
698 {
699 TERM_DEBUG_ON (zebra, ZEBRA);
700 vty_out (vty, "BGP zebra debugging is on%s", VTY_NEWLINE);
701 }
702 return CMD_SUCCESS;
703}
704
705DEFUN (no_debug_bgp_zebra,
706 no_debug_bgp_zebra_cmd,
707 "no debug bgp zebra",
708 NO_STR
709 DEBUG_STR
710 BGP_STR
711 "BGP Zebra messages\n")
712{
713 if (vty->node == CONFIG_NODE)
714 DEBUG_OFF (zebra, ZEBRA);
715 else
716 {
717 TERM_DEBUG_OFF (zebra, ZEBRA);
718 vty_out (vty, "BGP zebra debugging is off%s", VTY_NEWLINE);
719 }
720 return CMD_SUCCESS;
721}
722
723ALIAS (no_debug_bgp_zebra,
724 undebug_bgp_zebra_cmd,
725 "undebug bgp zebra",
726 UNDEBUG_STR
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000727 BGP_STR
728 "BGP Zebra messages\n")
729
Lou Bergerf53585d2016-05-17 07:10:36 -0400730DEFUN (debug_bgp_allow_martians,
731 debug_bgp_allow_martians_cmd,
732 "debug bgp allow-martians",
733 DEBUG_STR
734 BGP_STR
735 "BGP allow martian next hops\n")
736{
737 if (vty->node == CONFIG_NODE)
738 DEBUG_ON (allow_martians, ALLOW_MARTIANS);
739 else
740 {
741 TERM_DEBUG_ON (allow_martians, ALLOW_MARTIANS);
742 vty_out (vty, "BGP allow_martian next hop debugging is on%s", VTY_NEWLINE);
743 }
744 return CMD_SUCCESS;
745}
746
747DEFUN (no_debug_bgp_allow_martians,
748 no_debug_bgp_allow_martians_cmd,
749 "no debug bgp allow-martians",
750 NO_STR
751 DEBUG_STR
752 BGP_STR
753 "BGP allow martian next hops\n")
754{
755 if (vty->node == CONFIG_NODE)
756 DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
757 else
758 {
759 TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
760 vty_out (vty, "BGP allow martian next hop debugging is off%s", VTY_NEWLINE);
761 }
762 return CMD_SUCCESS;
763}
764
765ALIAS (no_debug_bgp_allow_martians,
766 undebug_bgp_allow_martians_cmd,
767 "undebug bgp allow-martians",
768 UNDEBUG_STR
769 BGP_STR
770 "BGP allow martian next hops\n")
771
paul718e3742002-12-13 20:15:29 +0000772DEFUN (no_debug_bgp_all,
773 no_debug_bgp_all_cmd,
774 "no debug all bgp",
775 NO_STR
776 DEBUG_STR
777 "Enable all debugging\n"
778 BGP_STR)
779{
780 TERM_DEBUG_OFF (normal, NORMAL);
781 TERM_DEBUG_OFF (events, EVENTS);
782 TERM_DEBUG_OFF (keepalive, KEEPALIVE);
783 TERM_DEBUG_OFF (update, UPDATE_IN);
784 TERM_DEBUG_OFF (update, UPDATE_OUT);
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000785 TERM_DEBUG_OFF (as4, AS4);
786 TERM_DEBUG_OFF (as4, AS4_SEGMENT);
paul718e3742002-12-13 20:15:29 +0000787 TERM_DEBUG_OFF (fsm, FSM);
788 TERM_DEBUG_OFF (filter, FILTER);
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000789 TERM_DEBUG_OFF (zebra, ZEBRA);
Lou Bergerf53585d2016-05-17 07:10:36 -0400790 TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
paul718e3742002-12-13 20:15:29 +0000791 vty_out (vty, "All possible debugging has been turned off%s", VTY_NEWLINE);
792
793 return CMD_SUCCESS;
794}
795
796ALIAS (no_debug_bgp_all,
797 undebug_bgp_all_cmd,
798 "undebug all bgp",
799 UNDEBUG_STR
800 "Enable all debugging\n"
801 BGP_STR)
802
803DEFUN (show_debugging_bgp,
804 show_debugging_bgp_cmd,
805 "show debugging bgp",
806 SHOW_STR
807 DEBUG_STR
808 BGP_STR)
809{
810 vty_out (vty, "BGP debugging status:%s", VTY_NEWLINE);
811
812 if (BGP_DEBUG (normal, NORMAL))
813 vty_out (vty, " BGP debugging is on%s", VTY_NEWLINE);
814 if (BGP_DEBUG (events, EVENTS))
815 vty_out (vty, " BGP events debugging is on%s", VTY_NEWLINE);
816 if (BGP_DEBUG (keepalive, KEEPALIVE))
817 vty_out (vty, " BGP keepalives debugging is on%s", VTY_NEWLINE);
818 if (BGP_DEBUG (update, UPDATE_IN) && BGP_DEBUG (update, UPDATE_OUT))
819 vty_out (vty, " BGP updates debugging is on%s", VTY_NEWLINE);
820 else if (BGP_DEBUG (update, UPDATE_IN))
821 vty_out (vty, " BGP updates debugging is on (inbound)%s", VTY_NEWLINE);
822 else if (BGP_DEBUG (update, UPDATE_OUT))
823 vty_out (vty, " BGP updates debugging is on (outbound)%s", VTY_NEWLINE);
824 if (BGP_DEBUG (fsm, FSM))
825 vty_out (vty, " BGP fsm debugging is on%s", VTY_NEWLINE);
826 if (BGP_DEBUG (filter, FILTER))
827 vty_out (vty, " BGP filter debugging is on%s", VTY_NEWLINE);
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000828 if (BGP_DEBUG (zebra, ZEBRA))
829 vty_out (vty, " BGP zebra debugging is on%s", VTY_NEWLINE);
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000830 if (BGP_DEBUG (as4, AS4))
831 vty_out (vty, " BGP as4 debugging is on%s", VTY_NEWLINE);
832 if (BGP_DEBUG (as4, AS4_SEGMENT))
833 vty_out (vty, " BGP as4 aspath segment debugging is on%s", VTY_NEWLINE);
Lou Bergerf53585d2016-05-17 07:10:36 -0400834 if (BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
835 vty_out (vty, " BGP allow martian next hop debugging is on%s", VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000836 vty_out (vty, "%s", VTY_NEWLINE);
837 return CMD_SUCCESS;
838}
839
paul94f2b392005-06-28 12:44:16 +0000840static int
paul718e3742002-12-13 20:15:29 +0000841bgp_config_write_debug (struct vty *vty)
842{
843 int write = 0;
844
845 if (CONF_BGP_DEBUG (normal, NORMAL))
846 {
847 vty_out (vty, "debug bgp%s", VTY_NEWLINE);
848 write++;
849 }
850
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000851 if (CONF_BGP_DEBUG (as4, AS4))
852 {
853 vty_out (vty, "debug bgp as4%s", VTY_NEWLINE);
854 write++;
855 }
856
857 if (CONF_BGP_DEBUG (as4, AS4_SEGMENT))
858 {
859 vty_out (vty, "debug bgp as4 segment%s", VTY_NEWLINE);
860 write++;
861 }
862
paul718e3742002-12-13 20:15:29 +0000863 if (CONF_BGP_DEBUG (events, EVENTS))
864 {
865 vty_out (vty, "debug bgp events%s", VTY_NEWLINE);
866 write++;
867 }
868
869 if (CONF_BGP_DEBUG (keepalive, KEEPALIVE))
870 {
871 vty_out (vty, "debug bgp keepalives%s", VTY_NEWLINE);
872 write++;
873 }
874
875 if (CONF_BGP_DEBUG (update, UPDATE_IN) && CONF_BGP_DEBUG (update, UPDATE_OUT))
876 {
877 vty_out (vty, "debug bgp updates%s", VTY_NEWLINE);
878 write++;
879 }
880 else if (CONF_BGP_DEBUG (update, UPDATE_IN))
881 {
882 vty_out (vty, "debug bgp updates in%s", VTY_NEWLINE);
883 write++;
884 }
885 else if (CONF_BGP_DEBUG (update, UPDATE_OUT))
886 {
887 vty_out (vty, "debug bgp updates out%s", VTY_NEWLINE);
888 write++;
889 }
890
891 if (CONF_BGP_DEBUG (fsm, FSM))
892 {
893 vty_out (vty, "debug bgp fsm%s", VTY_NEWLINE);
894 write++;
895 }
896
897 if (CONF_BGP_DEBUG (filter, FILTER))
898 {
899 vty_out (vty, "debug bgp filters%s", VTY_NEWLINE);
900 write++;
901 }
902
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000903 if (CONF_BGP_DEBUG (zebra, ZEBRA))
904 {
905 vty_out (vty, "debug bgp zebra%s", VTY_NEWLINE);
906 write++;
907 }
908
Lou Bergerf53585d2016-05-17 07:10:36 -0400909 if (CONF_BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
910 {
911 vty_out (vty, "debug bgp allow-martians%s", VTY_NEWLINE);
912 write++;
913 }
914
paul718e3742002-12-13 20:15:29 +0000915 return write;
916}
917
Stephen Hemminger7fc626d2008-12-01 11:10:34 -0800918static struct cmd_node debug_node =
paul718e3742002-12-13 20:15:29 +0000919{
920 DEBUG_NODE,
921 "",
922 1
923};
924
925void
paul94f2b392005-06-28 12:44:16 +0000926bgp_debug_init (void)
paul718e3742002-12-13 20:15:29 +0000927{
928 install_node (&debug_node, bgp_config_write_debug);
929
930 install_element (ENABLE_NODE, &show_debugging_bgp_cmd);
931
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000932 install_element (ENABLE_NODE, &debug_bgp_as4_cmd);
933 install_element (CONFIG_NODE, &debug_bgp_as4_cmd);
934 install_element (ENABLE_NODE, &debug_bgp_as4_segment_cmd);
935 install_element (CONFIG_NODE, &debug_bgp_as4_segment_cmd);
936
paul718e3742002-12-13 20:15:29 +0000937 install_element (ENABLE_NODE, &debug_bgp_fsm_cmd);
938 install_element (CONFIG_NODE, &debug_bgp_fsm_cmd);
939 install_element (ENABLE_NODE, &debug_bgp_events_cmd);
940 install_element (CONFIG_NODE, &debug_bgp_events_cmd);
941 install_element (ENABLE_NODE, &debug_bgp_filter_cmd);
942 install_element (CONFIG_NODE, &debug_bgp_filter_cmd);
943 install_element (ENABLE_NODE, &debug_bgp_keepalive_cmd);
944 install_element (CONFIG_NODE, &debug_bgp_keepalive_cmd);
945 install_element (ENABLE_NODE, &debug_bgp_update_cmd);
946 install_element (CONFIG_NODE, &debug_bgp_update_cmd);
947 install_element (ENABLE_NODE, &debug_bgp_update_direct_cmd);
948 install_element (CONFIG_NODE, &debug_bgp_update_direct_cmd);
949 install_element (ENABLE_NODE, &debug_bgp_normal_cmd);
950 install_element (CONFIG_NODE, &debug_bgp_normal_cmd);
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000951 install_element (ENABLE_NODE, &debug_bgp_zebra_cmd);
952 install_element (CONFIG_NODE, &debug_bgp_zebra_cmd);
Lou Bergerf53585d2016-05-17 07:10:36 -0400953 install_element (ENABLE_NODE, &debug_bgp_allow_martians_cmd);
954 install_element (CONFIG_NODE, &debug_bgp_allow_martians_cmd);
paul718e3742002-12-13 20:15:29 +0000955
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000956 install_element (ENABLE_NODE, &no_debug_bgp_as4_cmd);
957 install_element (ENABLE_NODE, &undebug_bgp_as4_cmd);
958 install_element (CONFIG_NODE, &no_debug_bgp_as4_cmd);
959 install_element (ENABLE_NODE, &no_debug_bgp_as4_segment_cmd);
960 install_element (ENABLE_NODE, &undebug_bgp_as4_segment_cmd);
961 install_element (CONFIG_NODE, &no_debug_bgp_as4_segment_cmd);
962
paul718e3742002-12-13 20:15:29 +0000963 install_element (ENABLE_NODE, &no_debug_bgp_fsm_cmd);
964 install_element (ENABLE_NODE, &undebug_bgp_fsm_cmd);
965 install_element (CONFIG_NODE, &no_debug_bgp_fsm_cmd);
966 install_element (ENABLE_NODE, &no_debug_bgp_events_cmd);
967 install_element (ENABLE_NODE, &undebug_bgp_events_cmd);
968 install_element (CONFIG_NODE, &no_debug_bgp_events_cmd);
969 install_element (ENABLE_NODE, &no_debug_bgp_filter_cmd);
970 install_element (ENABLE_NODE, &undebug_bgp_filter_cmd);
971 install_element (CONFIG_NODE, &no_debug_bgp_filter_cmd);
972 install_element (ENABLE_NODE, &no_debug_bgp_keepalive_cmd);
973 install_element (ENABLE_NODE, &undebug_bgp_keepalive_cmd);
974 install_element (CONFIG_NODE, &no_debug_bgp_keepalive_cmd);
975 install_element (ENABLE_NODE, &no_debug_bgp_update_cmd);
976 install_element (ENABLE_NODE, &undebug_bgp_update_cmd);
977 install_element (CONFIG_NODE, &no_debug_bgp_update_cmd);
978 install_element (ENABLE_NODE, &no_debug_bgp_normal_cmd);
979 install_element (ENABLE_NODE, &undebug_bgp_normal_cmd);
980 install_element (CONFIG_NODE, &no_debug_bgp_normal_cmd);
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000981 install_element (ENABLE_NODE, &no_debug_bgp_zebra_cmd);
982 install_element (ENABLE_NODE, &undebug_bgp_zebra_cmd);
983 install_element (CONFIG_NODE, &no_debug_bgp_zebra_cmd);
Lou Bergerf53585d2016-05-17 07:10:36 -0400984 install_element (ENABLE_NODE, &no_debug_bgp_allow_martians_cmd);
985 install_element (ENABLE_NODE, &undebug_bgp_allow_martians_cmd);
986 install_element (CONFIG_NODE, &no_debug_bgp_allow_martians_cmd);
paul718e3742002-12-13 20:15:29 +0000987 install_element (ENABLE_NODE, &no_debug_bgp_all_cmd);
988 install_element (ENABLE_NODE, &undebug_bgp_all_cmd);
989}