blob: ba7972281342a4005cebab612baf0506b0fa75c1 [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;
Pradosh Mohapatra60cc9592015-11-09 20:21:41 -050050unsigned long conf_bgp_debug_nht;
paul718e3742002-12-13 20:15:29 +000051
Paul Jakma0b2aa3a2007-10-14 22:32:21 +000052unsigned long term_bgp_debug_as4;
paul718e3742002-12-13 20:15:29 +000053unsigned long term_bgp_debug_fsm;
54unsigned long term_bgp_debug_events;
55unsigned long term_bgp_debug_packet;
56unsigned long term_bgp_debug_filter;
57unsigned long term_bgp_debug_keepalive;
58unsigned long term_bgp_debug_update;
59unsigned long term_bgp_debug_normal;
Andrew J. Schorra39275d2006-11-30 16:36:57 +000060unsigned long term_bgp_debug_zebra;
Lou Bergerf53585d2016-05-17 07:10:36 -040061unsigned long term_bgp_debug_allow_martians;
Pradosh Mohapatra60cc9592015-11-09 20:21:41 -050062unsigned long term_bgp_debug_nht;
paul718e3742002-12-13 20:15:29 +000063
64/* messages for BGP-4 status */
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -070065const struct message bgp_status_msg[] =
paul718e3742002-12-13 20:15:29 +000066{
paul718e3742002-12-13 20:15:29 +000067 { Idle, "Idle" },
68 { Connect, "Connect" },
69 { Active, "Active" },
70 { OpenSent, "OpenSent" },
71 { OpenConfirm, "OpenConfirm" },
72 { Established, "Established" },
Paul Jakmaca058a32006-09-14 02:58:49 +000073 { Clearing, "Clearing" },
74 { Deleted, "Deleted" },
paul718e3742002-12-13 20:15:29 +000075};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -070076const int bgp_status_msg_max = BGP_STATUS_MAX;
paul718e3742002-12-13 20:15:29 +000077
78/* BGP message type string. */
paulfd79ac92004-10-13 05:06:08 +000079const char *bgp_type_str[] =
paul718e3742002-12-13 20:15:29 +000080{
81 NULL,
82 "OPEN",
83 "UPDATE",
84 "NOTIFICATION",
85 "KEEPALIVE",
86 "ROUTE-REFRESH",
87 "CAPABILITY"
88};
89
90/* message for BGP-4 Notify */
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -070091static const struct message bgp_notify_msg[] =
paul718e3742002-12-13 20:15:29 +000092{
paul718e3742002-12-13 20:15:29 +000093 { BGP_NOTIFY_HEADER_ERR, "Message Header Error"},
94 { BGP_NOTIFY_OPEN_ERR, "OPEN Message Error"},
95 { BGP_NOTIFY_UPDATE_ERR, "UPDATE Message Error"},
96 { BGP_NOTIFY_HOLD_ERR, "Hold Timer Expired"},
97 { BGP_NOTIFY_FSM_ERR, "Finite State Machine Error"},
98 { BGP_NOTIFY_CEASE, "Cease"},
99 { BGP_NOTIFY_CAPABILITY_ERR, "CAPABILITY Message Error"},
100};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700101static const int bgp_notify_msg_max = BGP_NOTIFY_MAX;
paul718e3742002-12-13 20:15:29 +0000102
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700103static const struct message bgp_notify_head_msg[] =
paul718e3742002-12-13 20:15:29 +0000104{
hasso3950fda2004-05-20 10:22:49 +0000105 { BGP_NOTIFY_HEADER_NOT_SYNC, "/Connection Not Synchronized"},
106 { BGP_NOTIFY_HEADER_BAD_MESLEN, "/Bad Message Length"},
107 { BGP_NOTIFY_HEADER_BAD_MESTYPE, "/Bad Message Type"}
paul718e3742002-12-13 20:15:29 +0000108};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700109static const int bgp_notify_head_msg_max = BGP_NOTIFY_HEADER_MAX;
paul718e3742002-12-13 20:15:29 +0000110
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700111static const struct message bgp_notify_open_msg[] =
paul718e3742002-12-13 20:15:29 +0000112{
Dmitrij Tejblum4b4e07d2011-09-21 23:13:22 +0400113 { BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
hasso3950fda2004-05-20 10:22:49 +0000114 { BGP_NOTIFY_OPEN_UNSUP_VERSION, "/Unsupported Version Number" },
115 { BGP_NOTIFY_OPEN_BAD_PEER_AS, "/Bad Peer AS"},
116 { BGP_NOTIFY_OPEN_BAD_BGP_IDENT, "/Bad BGP Identifier"},
117 { BGP_NOTIFY_OPEN_UNSUP_PARAM, "/Unsupported Optional Parameter"},
118 { BGP_NOTIFY_OPEN_AUTH_FAILURE, "/Authentication Failure"},
119 { BGP_NOTIFY_OPEN_UNACEP_HOLDTIME, "/Unacceptable Hold Time"},
120 { BGP_NOTIFY_OPEN_UNSUP_CAPBL, "/Unsupported Capability"},
paul718e3742002-12-13 20:15:29 +0000121};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700122static const int bgp_notify_open_msg_max = BGP_NOTIFY_OPEN_MAX;
paul718e3742002-12-13 20:15:29 +0000123
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700124static const struct message bgp_notify_update_msg[] =
paul718e3742002-12-13 20:15:29 +0000125{
Dmitrij Tejblum4b4e07d2011-09-21 23:13:22 +0400126 { BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
hasso3950fda2004-05-20 10:22:49 +0000127 { BGP_NOTIFY_UPDATE_MAL_ATTR, "/Malformed Attribute List"},
128 { BGP_NOTIFY_UPDATE_UNREC_ATTR, "/Unrecognized Well-known Attribute"},
129 { BGP_NOTIFY_UPDATE_MISS_ATTR, "/Missing Well-known Attribute"},
130 { BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR, "/Attribute Flags Error"},
131 { BGP_NOTIFY_UPDATE_ATTR_LENG_ERR, "/Attribute Length Error"},
132 { BGP_NOTIFY_UPDATE_INVAL_ORIGIN, "/Invalid ORIGIN Attribute"},
133 { BGP_NOTIFY_UPDATE_AS_ROUTE_LOOP, "/AS Routing Loop"},
134 { BGP_NOTIFY_UPDATE_INVAL_NEXT_HOP, "/Invalid NEXT_HOP Attribute"},
135 { BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, "/Optional Attribute Error"},
136 { BGP_NOTIFY_UPDATE_INVAL_NETWORK, "/Invalid Network Field"},
137 { BGP_NOTIFY_UPDATE_MAL_AS_PATH, "/Malformed AS_PATH"},
paul718e3742002-12-13 20:15:29 +0000138};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700139static const int bgp_notify_update_msg_max = BGP_NOTIFY_UPDATE_MAX;
paul718e3742002-12-13 20:15:29 +0000140
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700141static const struct message bgp_notify_cease_msg[] =
paul718e3742002-12-13 20:15:29 +0000142{
Dmitrij Tejblum4b4e07d2011-09-21 23:13:22 +0400143 { BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
hasso3950fda2004-05-20 10:22:49 +0000144 { BGP_NOTIFY_CEASE_MAX_PREFIX, "/Maximum Number of Prefixes Reached"},
145 { BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN, "/Administratively Shutdown"},
146 { BGP_NOTIFY_CEASE_PEER_UNCONFIG, "/Peer Unconfigured"},
147 { BGP_NOTIFY_CEASE_ADMIN_RESET, "/Administratively Reset"},
148 { BGP_NOTIFY_CEASE_CONNECT_REJECT, "/Connection Rejected"},
149 { BGP_NOTIFY_CEASE_CONFIG_CHANGE, "/Other Configuration Change"},
150 { BGP_NOTIFY_CEASE_COLLISION_RESOLUTION, "/Connection collision resolution"},
151 { BGP_NOTIFY_CEASE_OUT_OF_RESOURCE, "/Out of Resource"},
paul718e3742002-12-13 20:15:29 +0000152};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700153static const int bgp_notify_cease_msg_max = BGP_NOTIFY_CEASE_MAX;
paul718e3742002-12-13 20:15:29 +0000154
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700155static const struct message bgp_notify_capability_msg[] =
paul718e3742002-12-13 20:15:29 +0000156{
Dmitrij Tejblum4b4e07d2011-09-21 23:13:22 +0400157 { BGP_NOTIFY_SUBCODE_UNSPECIFIC, "/Unspecific"},
hasso3950fda2004-05-20 10:22:49 +0000158 { BGP_NOTIFY_CAPABILITY_INVALID_ACTION, "/Invalid Action Value" },
159 { BGP_NOTIFY_CAPABILITY_INVALID_LENGTH, "/Invalid Capability Length"},
160 { BGP_NOTIFY_CAPABILITY_MALFORMED_CODE, "/Malformed Capability Value"},
paul718e3742002-12-13 20:15:29 +0000161};
Stephen Hemmingerb2d933f2009-05-15 10:48:03 -0700162static const int bgp_notify_capability_msg_max = BGP_NOTIFY_CAPABILITY_MAX;
paul718e3742002-12-13 20:15:29 +0000163
164/* Origin strings. */
paulfd79ac92004-10-13 05:06:08 +0000165const char *bgp_origin_str[] = {"i","e","?"};
166const char *bgp_origin_long_str[] = {"IGP","EGP","incomplete"};
paul718e3742002-12-13 20:15:29 +0000167
168/* Dump attribute. */
paule01f9cb2004-07-09 17:48:53 +0000169int
paul718e3742002-12-13 20:15:29 +0000170bgp_dump_attr (struct peer *peer, struct attr *attr, char *buf, size_t size)
171{
paul718e3742002-12-13 20:15:29 +0000172 if (! attr)
paule01f9cb2004-07-09 17:48:53 +0000173 return 0;
paul718e3742002-12-13 20:15:29 +0000174
paule01f9cb2004-07-09 17:48:53 +0000175 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_NEXT_HOP)))
176 snprintf (buf, size, "nexthop %s", inet_ntoa (attr->nexthop));
177
178 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ORIGIN)))
179 snprintf (buf + strlen (buf), size - strlen (buf), ", origin %s",
180 bgp_origin_str[attr->origin]);
paul718e3742002-12-13 20:15:29 +0000181
Paul Jakmafb982c22007-05-04 20:15:47 +0000182 if (attr->extra)
183 {
184 char addrbuf[BUFSIZ];
paul718e3742002-12-13 20:15:29 +0000185
Paul Jakmafb982c22007-05-04 20:15:47 +0000186 /* Add MP case. */
187 if (attr->extra->mp_nexthop_len == 16
188 || attr->extra->mp_nexthop_len == 32)
189 snprintf (buf + strlen (buf), size - strlen (buf), ", mp_nexthop %s",
190 inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global,
191 addrbuf, BUFSIZ));
paul718e3742002-12-13 20:15:29 +0000192
Paul Jakmafb982c22007-05-04 20:15:47 +0000193 if (attr->extra->mp_nexthop_len == 32)
194 snprintf (buf + strlen (buf), size - strlen (buf), "(%s)",
195 inet_ntop (AF_INET6, &attr->extra->mp_nexthop_local,
196 addrbuf, BUFSIZ));
197 }
paul718e3742002-12-13 20:15:29 +0000198
paule01f9cb2004-07-09 17:48:53 +0000199 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF)))
Jorge Boncompte [DTI2]ddc943d2012-04-13 13:46:07 +0200200 snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %u",
paul718e3742002-12-13 20:15:29 +0000201 attr->local_pref);
202
paule01f9cb2004-07-09 17:48:53 +0000203 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC)))
Jorge Boncompte [DTI2]ddc943d2012-04-13 13:46:07 +0200204 snprintf (buf + strlen (buf), size - strlen (buf), ", metric %u",
paul718e3742002-12-13 20:15:29 +0000205 attr->med);
206
paule01f9cb2004-07-09 17:48:53 +0000207 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES)))
paul718e3742002-12-13 20:15:29 +0000208 snprintf (buf + strlen (buf), size - strlen (buf), ", community %s",
209 community_str (attr->community));
210
paule01f9cb2004-07-09 17:48:53 +0000211 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ATOMIC_AGGREGATE)))
paul718e3742002-12-13 20:15:29 +0000212 snprintf (buf + strlen (buf), size - strlen (buf), ", atomic-aggregate");
213
paule01f9cb2004-07-09 17:48:53 +0000214 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_AGGREGATOR)))
Denis Ovsienkoaea339f2009-04-30 17:16:22 +0400215 snprintf (buf + strlen (buf), size - strlen (buf), ", aggregated by %u %s",
Paul Jakmafb982c22007-05-04 20:15:47 +0000216 attr->extra->aggregator_as,
217 inet_ntoa (attr->extra->aggregator_addr));
paul718e3742002-12-13 20:15:29 +0000218
paule01f9cb2004-07-09 17:48:53 +0000219 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_ORIGINATOR_ID)))
paul718e3742002-12-13 20:15:29 +0000220 snprintf (buf + strlen (buf), size - strlen (buf), ", originator %s",
Paul Jakmafb982c22007-05-04 20:15:47 +0000221 inet_ntoa (attr->extra->originator_id));
paul718e3742002-12-13 20:15:29 +0000222
paule01f9cb2004-07-09 17:48:53 +0000223 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_CLUSTER_LIST)))
paul718e3742002-12-13 20:15:29 +0000224 {
225 int i;
226
paule01f9cb2004-07-09 17:48:53 +0000227 snprintf (buf + strlen (buf), size - strlen (buf), ", clusterlist");
Paul Jakmafb982c22007-05-04 20:15:47 +0000228 for (i = 0; i < attr->extra->cluster->length / 4; i++)
paule01f9cb2004-07-09 17:48:53 +0000229 snprintf (buf + strlen (buf), size - strlen (buf), " %s",
Paul Jakmafb982c22007-05-04 20:15:47 +0000230 inet_ntoa (attr->extra->cluster->list[i]));
paul718e3742002-12-13 20:15:29 +0000231 }
232
paule01f9cb2004-07-09 17:48:53 +0000233 if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_AS_PATH)))
paul718e3742002-12-13 20:15:29 +0000234 snprintf (buf + strlen (buf), size - strlen (buf), ", path %s",
235 aspath_print (attr->aspath));
paule01f9cb2004-07-09 17:48:53 +0000236
237 if (strlen (buf) > 1)
238 return 1;
239 else
240 return 0;
paul718e3742002-12-13 20:15:29 +0000241}
242
243/* dump notify packet */
244void
paulfd79ac92004-10-13 05:06:08 +0000245bgp_notify_print(struct peer *peer, struct bgp_notify *bgp_notify,
246 const char *direct)
paul718e3742002-12-13 20:15:29 +0000247{
paulfd79ac92004-10-13 05:06:08 +0000248 const char *subcode_str;
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000249 const char *code_str;
paul718e3742002-12-13 20:15:29 +0000250
251 subcode_str = "";
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000252 code_str = LOOKUP_DEF (bgp_notify_msg, bgp_notify->code,
253 "Unrecognized Error Code");
paul718e3742002-12-13 20:15:29 +0000254
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000255 switch (bgp_notify->code)
paul718e3742002-12-13 20:15:29 +0000256 {
257 case BGP_NOTIFY_HEADER_ERR:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000258 subcode_str = LOOKUP_DEF (bgp_notify_head_msg, bgp_notify->subcode,
259 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000260 break;
261 case BGP_NOTIFY_OPEN_ERR:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000262 subcode_str = LOOKUP_DEF (bgp_notify_open_msg, bgp_notify->subcode,
263 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000264 break;
265 case BGP_NOTIFY_UPDATE_ERR:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000266 subcode_str = LOOKUP_DEF (bgp_notify_update_msg, bgp_notify->subcode,
267 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000268 break;
269 case BGP_NOTIFY_HOLD_ERR:
paul718e3742002-12-13 20:15:29 +0000270 break;
271 case BGP_NOTIFY_FSM_ERR:
paul718e3742002-12-13 20:15:29 +0000272 break;
273 case BGP_NOTIFY_CEASE:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000274 subcode_str = LOOKUP_DEF (bgp_notify_cease_msg, bgp_notify->subcode,
275 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000276 break;
277 case BGP_NOTIFY_CAPABILITY_ERR:
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000278 subcode_str = LOOKUP_DEF (bgp_notify_capability_msg, bgp_notify->subcode,
279 "Unrecognized Error Subcode");
paul718e3742002-12-13 20:15:29 +0000280 break;
281 }
hasso3950fda2004-05-20 10:22:49 +0000282
283 if (bgp_flag_check (peer->bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES))
284 zlog_info ("%%NOTIFICATION: %s neighbor %s %d/%d (%s%s) %d bytes %s",
285 strcmp (direct, "received") == 0 ? "received from" : "sent to",
286 peer->host, bgp_notify->code, bgp_notify->subcode,
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000287 code_str, subcode_str, bgp_notify->length,
hasso3950fda2004-05-20 10:22:49 +0000288 bgp_notify->data ? bgp_notify->data : "");
289 else if (BGP_DEBUG (normal, NORMAL))
ajs557865c2004-12-08 19:59:11 +0000290 plog_debug (peer->log, "%s %s NOTIFICATION %d/%d (%s%s) %d bytes %s",
paul718e3742002-12-13 20:15:29 +0000291 peer ? peer->host : "",
292 direct, bgp_notify->code, bgp_notify->subcode,
Leonid Rosenboim1e0ce7c2012-12-07 21:31:07 +0000293 code_str, subcode_str, bgp_notify->length,
paul718e3742002-12-13 20:15:29 +0000294 bgp_notify->data ? bgp_notify->data : "");
295}
David Lamparter6b0655a2014-06-04 06:53:35 +0200296
paul718e3742002-12-13 20:15:29 +0000297/* Debug option setting interface. */
298unsigned long bgp_debug_option = 0;
299
300int
301debug (unsigned int option)
302{
303 return bgp_debug_option & option;
304}
305
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000306DEFUN (debug_bgp_as4,
307 debug_bgp_as4_cmd,
308 "debug bgp as4",
309 DEBUG_STR
310 BGP_STR
311 "BGP AS4 actions\n")
312{
313 if (vty->node == CONFIG_NODE)
314 DEBUG_ON (as4, AS4);
315 else
316 {
317 TERM_DEBUG_ON (as4, AS4);
318 vty_out (vty, "BGP as4 debugging is on%s", VTY_NEWLINE);
319 }
320 return CMD_SUCCESS;
321}
322
323DEFUN (no_debug_bgp_as4,
324 no_debug_bgp_as4_cmd,
325 "no debug bgp as4",
326 NO_STR
327 DEBUG_STR
328 BGP_STR
329 "BGP AS4 actions\n")
330{
331 if (vty->node == CONFIG_NODE)
332 DEBUG_OFF (as4, AS4);
333 else
334 {
335 TERM_DEBUG_OFF (as4, AS4);
336 vty_out (vty, "BGP as4 debugging is off%s", VTY_NEWLINE);
337 }
338 return CMD_SUCCESS;
339}
340
341ALIAS (no_debug_bgp_as4,
342 undebug_bgp_as4_cmd,
343 "undebug bgp as4",
344 UNDEBUG_STR
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000345 BGP_STR
346 "BGP AS4 actions\n")
347
348DEFUN (debug_bgp_as4_segment,
349 debug_bgp_as4_segment_cmd,
350 "debug bgp as4 segment",
351 DEBUG_STR
352 BGP_STR
David Ward6e22b902011-01-17 10:58:52 +0300353 "BGP AS4 actions\n"
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000354 "BGP AS4 aspath segment handling\n")
355{
356 if (vty->node == CONFIG_NODE)
357 DEBUG_ON (as4, AS4_SEGMENT);
358 else
359 {
360 TERM_DEBUG_ON (as4, AS4_SEGMENT);
361 vty_out (vty, "BGP as4 segment debugging is on%s", VTY_NEWLINE);
362 }
363 return CMD_SUCCESS;
364}
365
366DEFUN (no_debug_bgp_as4_segment,
367 no_debug_bgp_as4_segment_cmd,
368 "no debug bgp as4 segment",
369 NO_STR
370 DEBUG_STR
371 BGP_STR
David Ward6e22b902011-01-17 10:58:52 +0300372 "BGP AS4 actions\n"
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000373 "BGP AS4 aspath segment handling\n")
374{
375 if (vty->node == CONFIG_NODE)
376 DEBUG_OFF (as4, AS4_SEGMENT);
377 else
378 {
379 TERM_DEBUG_OFF (as4, AS4_SEGMENT);
380 vty_out (vty, "BGP as4 segment debugging is off%s", VTY_NEWLINE);
381 }
382 return CMD_SUCCESS;
383}
384
385ALIAS (no_debug_bgp_as4_segment,
386 undebug_bgp_as4_segment_cmd,
387 "undebug bgp as4 segment",
388 UNDEBUG_STR
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000389 BGP_STR
David Ward6e22b902011-01-17 10:58:52 +0300390 "BGP AS4 actions\n"
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000391 "BGP AS4 aspath segment handling\n")
392
paul718e3742002-12-13 20:15:29 +0000393DEFUN (debug_bgp_fsm,
394 debug_bgp_fsm_cmd,
395 "debug bgp fsm",
396 DEBUG_STR
397 BGP_STR
398 "BGP Finite State Machine\n")
399{
400 if (vty->node == CONFIG_NODE)
401 DEBUG_ON (fsm, FSM);
402 else
403 {
404 TERM_DEBUG_ON (fsm, FSM);
405 vty_out (vty, "BGP fsm debugging is on%s", VTY_NEWLINE);
406 }
407 return CMD_SUCCESS;
408}
409
410DEFUN (no_debug_bgp_fsm,
411 no_debug_bgp_fsm_cmd,
412 "no debug bgp fsm",
413 NO_STR
414 DEBUG_STR
415 BGP_STR
416 "Finite State Machine\n")
417{
418 if (vty->node == CONFIG_NODE)
419 DEBUG_OFF (fsm, FSM);
420 else
421 {
422 TERM_DEBUG_OFF (fsm, FSM);
423 vty_out (vty, "BGP fsm debugging is off%s", VTY_NEWLINE);
424 }
425 return CMD_SUCCESS;
426}
427
428ALIAS (no_debug_bgp_fsm,
429 undebug_bgp_fsm_cmd,
430 "undebug bgp fsm",
431 UNDEBUG_STR
paul718e3742002-12-13 20:15:29 +0000432 BGP_STR
433 "Finite State Machine\n")
434
435DEFUN (debug_bgp_events,
436 debug_bgp_events_cmd,
437 "debug bgp events",
438 DEBUG_STR
439 BGP_STR
440 "BGP events\n")
441{
442 if (vty->node == CONFIG_NODE)
443 DEBUG_ON (events, EVENTS);
444 else
445 {
446 TERM_DEBUG_ON (events, EVENTS);
447 vty_out (vty, "BGP events debugging is on%s", VTY_NEWLINE);
448 }
449 return CMD_SUCCESS;
450}
451
452DEFUN (no_debug_bgp_events,
453 no_debug_bgp_events_cmd,
454 "no debug bgp events",
455 NO_STR
456 DEBUG_STR
457 BGP_STR
458 "BGP events\n")
459{
460 if (vty->node == CONFIG_NODE)
461 DEBUG_OFF (events, EVENTS);
462 else
463 {
464 TERM_DEBUG_OFF (events, EVENTS);
465 vty_out (vty, "BGP events debugging is off%s", VTY_NEWLINE);
466 }
467 return CMD_SUCCESS;
468}
469
470ALIAS (no_debug_bgp_events,
471 undebug_bgp_events_cmd,
472 "undebug bgp events",
473 UNDEBUG_STR
474 BGP_STR
475 "BGP events\n")
476
Pradosh Mohapatra60cc9592015-11-09 20:21:41 -0500477DEFUN (debug_bgp_nht,
478 debug_bgp_nht_cmd,
479 "debug bgp nht",
480 DEBUG_STR
481 BGP_STR
482 "BGP nexthop tracking events\n")
483{
484 if (vty->node == CONFIG_NODE)
485 DEBUG_ON (nht, NHT);
486 else
487 {
488 TERM_DEBUG_ON (nht, NHT);
489 vty_out (vty, "BGP nexthop tracking debugging is on%s", VTY_NEWLINE);
490 }
491 return CMD_SUCCESS;
492}
493
494DEFUN (no_debug_bgp_nht,
495 no_debug_bgp_nht_cmd,
496 "no debug bgp nht",
497 NO_STR
498 DEBUG_STR
499 BGP_STR
500 "BGP nexthop tracking events\n")
501{
502 if (vty->node == CONFIG_NODE)
503 DEBUG_OFF (nht, NHT);
504 else
505 {
506 TERM_DEBUG_OFF (nht, NHT);
507 vty_out (vty, "BGP nexthop tracking debugging is off%s", VTY_NEWLINE);
508 }
509 return CMD_SUCCESS;
510}
511
512ALIAS (no_debug_bgp_nht,
513 undebug_bgp_nht_cmd,
514 "undebug bgp nht",
515 UNDEBUG_STR
516 BGP_STR
517 "BGP next-hop tracking updates\n")
518
paul718e3742002-12-13 20:15:29 +0000519DEFUN (debug_bgp_filter,
520 debug_bgp_filter_cmd,
521 "debug bgp filters",
522 DEBUG_STR
523 BGP_STR
524 "BGP filters\n")
525{
526 if (vty->node == CONFIG_NODE)
527 DEBUG_ON (filter, FILTER);
528 else
529 {
530 TERM_DEBUG_ON (filter, FILTER);
531 vty_out (vty, "BGP filters debugging is on%s", VTY_NEWLINE);
532 }
533 return CMD_SUCCESS;
534}
535
536DEFUN (no_debug_bgp_filter,
537 no_debug_bgp_filter_cmd,
538 "no debug bgp filters",
539 NO_STR
540 DEBUG_STR
541 BGP_STR
542 "BGP filters\n")
543{
544 if (vty->node == CONFIG_NODE)
545 DEBUG_OFF (filter, FILTER);
546 else
547 {
548 TERM_DEBUG_OFF (filter, FILTER);
549 vty_out (vty, "BGP filters debugging is off%s", VTY_NEWLINE);
550 }
551 return CMD_SUCCESS;
552}
553
554ALIAS (no_debug_bgp_filter,
555 undebug_bgp_filter_cmd,
556 "undebug bgp filters",
557 UNDEBUG_STR
558 BGP_STR
559 "BGP filters\n")
560
561DEFUN (debug_bgp_keepalive,
562 debug_bgp_keepalive_cmd,
563 "debug bgp keepalives",
564 DEBUG_STR
565 BGP_STR
566 "BGP keepalives\n")
567{
568 if (vty->node == CONFIG_NODE)
569 DEBUG_ON (keepalive, KEEPALIVE);
570 else
571 {
572 TERM_DEBUG_ON (keepalive, KEEPALIVE);
573 vty_out (vty, "BGP keepalives debugging is on%s", VTY_NEWLINE);
574 }
575 return CMD_SUCCESS;
576}
577
578DEFUN (no_debug_bgp_keepalive,
579 no_debug_bgp_keepalive_cmd,
580 "no debug bgp keepalives",
581 NO_STR
582 DEBUG_STR
583 BGP_STR
584 "BGP keepalives\n")
585{
586 if (vty->node == CONFIG_NODE)
587 DEBUG_OFF (keepalive, KEEPALIVE);
588 else
589 {
590 TERM_DEBUG_OFF (keepalive, KEEPALIVE);
591 vty_out (vty, "BGP keepalives debugging is off%s", VTY_NEWLINE);
592 }
593 return CMD_SUCCESS;
594}
595
596ALIAS (no_debug_bgp_keepalive,
597 undebug_bgp_keepalive_cmd,
598 "undebug bgp keepalives",
599 UNDEBUG_STR
600 BGP_STR
601 "BGP keepalives\n")
602
603DEFUN (debug_bgp_update,
604 debug_bgp_update_cmd,
605 "debug bgp updates",
606 DEBUG_STR
607 BGP_STR
608 "BGP updates\n")
609{
610 if (vty->node == CONFIG_NODE)
611 {
612 DEBUG_ON (update, UPDATE_IN);
613 DEBUG_ON (update, UPDATE_OUT);
614 }
615 else
616 {
617 TERM_DEBUG_ON (update, UPDATE_IN);
618 TERM_DEBUG_ON (update, UPDATE_OUT);
619 vty_out (vty, "BGP updates debugging is on%s", VTY_NEWLINE);
620 }
621 return CMD_SUCCESS;
622}
623
624DEFUN (debug_bgp_update_direct,
625 debug_bgp_update_direct_cmd,
626 "debug bgp updates (in|out)",
627 DEBUG_STR
628 BGP_STR
629 "BGP updates\n"
630 "Inbound updates\n"
631 "Outbound updates\n")
632{
633 if (vty->node == CONFIG_NODE)
634 {
635 if (strncmp ("i", argv[0], 1) == 0)
636 {
637 DEBUG_OFF (update, UPDATE_OUT);
638 DEBUG_ON (update, UPDATE_IN);
639 }
640 else
641 {
642 DEBUG_OFF (update, UPDATE_IN);
643 DEBUG_ON (update, UPDATE_OUT);
644 }
645 }
646 else
647 {
648 if (strncmp ("i", argv[0], 1) == 0)
649 {
650 TERM_DEBUG_OFF (update, UPDATE_OUT);
651 TERM_DEBUG_ON (update, UPDATE_IN);
652 vty_out (vty, "BGP updates debugging is on (inbound)%s", VTY_NEWLINE);
653 }
654 else
655 {
656 TERM_DEBUG_OFF (update, UPDATE_IN);
657 TERM_DEBUG_ON (update, UPDATE_OUT);
658 vty_out (vty, "BGP updates debugging is on (outbound)%s", VTY_NEWLINE);
659 }
660 }
661 return CMD_SUCCESS;
662}
663
664DEFUN (no_debug_bgp_update,
665 no_debug_bgp_update_cmd,
666 "no debug bgp updates",
667 NO_STR
668 DEBUG_STR
669 BGP_STR
670 "BGP updates\n")
671{
672 if (vty->node == CONFIG_NODE)
673 {
674 DEBUG_OFF (update, UPDATE_IN);
675 DEBUG_OFF (update, UPDATE_OUT);
676 }
677 else
678 {
679 TERM_DEBUG_OFF (update, UPDATE_IN);
680 TERM_DEBUG_OFF (update, UPDATE_OUT);
681 vty_out (vty, "BGP updates debugging is off%s", VTY_NEWLINE);
682 }
683 return CMD_SUCCESS;
684}
685
686ALIAS (no_debug_bgp_update,
687 undebug_bgp_update_cmd,
688 "undebug bgp updates",
689 UNDEBUG_STR
690 BGP_STR
691 "BGP updates\n")
692
693DEFUN (debug_bgp_normal,
694 debug_bgp_normal_cmd,
695 "debug bgp",
696 DEBUG_STR
697 BGP_STR)
698{
699 if (vty->node == CONFIG_NODE)
700 DEBUG_ON (normal, NORMAL);
701 else
702 {
703 TERM_DEBUG_ON (normal, NORMAL);
704 vty_out (vty, "BGP debugging is on%s", VTY_NEWLINE);
705 }
706 return CMD_SUCCESS;
707}
708
709DEFUN (no_debug_bgp_normal,
710 no_debug_bgp_normal_cmd,
711 "no debug bgp",
712 NO_STR
713 DEBUG_STR
714 BGP_STR)
715{
716 if (vty->node == CONFIG_NODE)
717 DEBUG_OFF (normal, NORMAL);
718 else
719 {
720 TERM_DEBUG_OFF (normal, NORMAL);
721 vty_out (vty, "BGP debugging is off%s", VTY_NEWLINE);
722 }
723 return CMD_SUCCESS;
724}
725
726ALIAS (no_debug_bgp_normal,
727 undebug_bgp_normal_cmd,
728 "undebug bgp",
729 UNDEBUG_STR
730 BGP_STR)
731
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000732DEFUN (debug_bgp_zebra,
733 debug_bgp_zebra_cmd,
734 "debug bgp zebra",
735 DEBUG_STR
736 BGP_STR
737 "BGP Zebra messages\n")
738{
739 if (vty->node == CONFIG_NODE)
740 DEBUG_ON (zebra, ZEBRA);
741 else
742 {
743 TERM_DEBUG_ON (zebra, ZEBRA);
744 vty_out (vty, "BGP zebra debugging is on%s", VTY_NEWLINE);
745 }
746 return CMD_SUCCESS;
747}
748
749DEFUN (no_debug_bgp_zebra,
750 no_debug_bgp_zebra_cmd,
751 "no debug bgp zebra",
752 NO_STR
753 DEBUG_STR
754 BGP_STR
755 "BGP Zebra messages\n")
756{
757 if (vty->node == CONFIG_NODE)
758 DEBUG_OFF (zebra, ZEBRA);
759 else
760 {
761 TERM_DEBUG_OFF (zebra, ZEBRA);
762 vty_out (vty, "BGP zebra debugging is off%s", VTY_NEWLINE);
763 }
764 return CMD_SUCCESS;
765}
766
767ALIAS (no_debug_bgp_zebra,
768 undebug_bgp_zebra_cmd,
769 "undebug bgp zebra",
770 UNDEBUG_STR
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000771 BGP_STR
772 "BGP Zebra messages\n")
773
Lou Bergerf53585d2016-05-17 07:10:36 -0400774DEFUN (debug_bgp_allow_martians,
775 debug_bgp_allow_martians_cmd,
776 "debug bgp allow-martians",
777 DEBUG_STR
778 BGP_STR
779 "BGP allow martian next hops\n")
780{
781 if (vty->node == CONFIG_NODE)
782 DEBUG_ON (allow_martians, ALLOW_MARTIANS);
783 else
784 {
785 TERM_DEBUG_ON (allow_martians, ALLOW_MARTIANS);
786 vty_out (vty, "BGP allow_martian next hop debugging is on%s", VTY_NEWLINE);
787 }
788 return CMD_SUCCESS;
789}
790
791DEFUN (no_debug_bgp_allow_martians,
792 no_debug_bgp_allow_martians_cmd,
793 "no debug bgp allow-martians",
794 NO_STR
795 DEBUG_STR
796 BGP_STR
797 "BGP allow martian next hops\n")
798{
799 if (vty->node == CONFIG_NODE)
800 DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
801 else
802 {
803 TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
804 vty_out (vty, "BGP allow martian next hop debugging is off%s", VTY_NEWLINE);
805 }
806 return CMD_SUCCESS;
807}
808
809ALIAS (no_debug_bgp_allow_martians,
810 undebug_bgp_allow_martians_cmd,
811 "undebug bgp allow-martians",
812 UNDEBUG_STR
813 BGP_STR
814 "BGP allow martian next hops\n")
815
paul718e3742002-12-13 20:15:29 +0000816DEFUN (no_debug_bgp_all,
817 no_debug_bgp_all_cmd,
818 "no debug all bgp",
819 NO_STR
820 DEBUG_STR
821 "Enable all debugging\n"
822 BGP_STR)
823{
824 TERM_DEBUG_OFF (normal, NORMAL);
825 TERM_DEBUG_OFF (events, EVENTS);
826 TERM_DEBUG_OFF (keepalive, KEEPALIVE);
827 TERM_DEBUG_OFF (update, UPDATE_IN);
828 TERM_DEBUG_OFF (update, UPDATE_OUT);
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000829 TERM_DEBUG_OFF (as4, AS4);
830 TERM_DEBUG_OFF (as4, AS4_SEGMENT);
paul718e3742002-12-13 20:15:29 +0000831 TERM_DEBUG_OFF (fsm, FSM);
832 TERM_DEBUG_OFF (filter, FILTER);
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000833 TERM_DEBUG_OFF (zebra, ZEBRA);
Lou Bergerf53585d2016-05-17 07:10:36 -0400834 TERM_DEBUG_OFF (allow_martians, ALLOW_MARTIANS);
paul718e3742002-12-13 20:15:29 +0000835 vty_out (vty, "All possible debugging has been turned off%s", VTY_NEWLINE);
836
837 return CMD_SUCCESS;
838}
839
840ALIAS (no_debug_bgp_all,
841 undebug_bgp_all_cmd,
842 "undebug all bgp",
843 UNDEBUG_STR
844 "Enable all debugging\n"
845 BGP_STR)
846
847DEFUN (show_debugging_bgp,
848 show_debugging_bgp_cmd,
849 "show debugging bgp",
850 SHOW_STR
851 DEBUG_STR
852 BGP_STR)
853{
854 vty_out (vty, "BGP debugging status:%s", VTY_NEWLINE);
855
856 if (BGP_DEBUG (normal, NORMAL))
857 vty_out (vty, " BGP debugging is on%s", VTY_NEWLINE);
858 if (BGP_DEBUG (events, EVENTS))
859 vty_out (vty, " BGP events debugging is on%s", VTY_NEWLINE);
860 if (BGP_DEBUG (keepalive, KEEPALIVE))
861 vty_out (vty, " BGP keepalives debugging is on%s", VTY_NEWLINE);
862 if (BGP_DEBUG (update, UPDATE_IN) && BGP_DEBUG (update, UPDATE_OUT))
863 vty_out (vty, " BGP updates debugging is on%s", VTY_NEWLINE);
864 else if (BGP_DEBUG (update, UPDATE_IN))
865 vty_out (vty, " BGP updates debugging is on (inbound)%s", VTY_NEWLINE);
866 else if (BGP_DEBUG (update, UPDATE_OUT))
867 vty_out (vty, " BGP updates debugging is on (outbound)%s", VTY_NEWLINE);
868 if (BGP_DEBUG (fsm, FSM))
869 vty_out (vty, " BGP fsm debugging is on%s", VTY_NEWLINE);
870 if (BGP_DEBUG (filter, FILTER))
871 vty_out (vty, " BGP filter debugging is on%s", VTY_NEWLINE);
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000872 if (BGP_DEBUG (zebra, ZEBRA))
873 vty_out (vty, " BGP zebra debugging is on%s", VTY_NEWLINE);
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000874 if (BGP_DEBUG (as4, AS4))
875 vty_out (vty, " BGP as4 debugging is on%s", VTY_NEWLINE);
876 if (BGP_DEBUG (as4, AS4_SEGMENT))
877 vty_out (vty, " BGP as4 aspath segment debugging is on%s", VTY_NEWLINE);
Lou Bergerf53585d2016-05-17 07:10:36 -0400878 if (BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
879 vty_out (vty, " BGP allow martian next hop debugging is on%s", VTY_NEWLINE);
Pradosh Mohapatra60cc9592015-11-09 20:21:41 -0500880 if (BGP_DEBUG (nht, NHT))
881 vty_out (vty, " BGP next-hop tracking debugging is on%s", VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000882 vty_out (vty, "%s", VTY_NEWLINE);
883 return CMD_SUCCESS;
884}
885
paul94f2b392005-06-28 12:44:16 +0000886static int
paul718e3742002-12-13 20:15:29 +0000887bgp_config_write_debug (struct vty *vty)
888{
889 int write = 0;
890
891 if (CONF_BGP_DEBUG (normal, NORMAL))
892 {
893 vty_out (vty, "debug bgp%s", VTY_NEWLINE);
894 write++;
895 }
896
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000897 if (CONF_BGP_DEBUG (as4, AS4))
898 {
899 vty_out (vty, "debug bgp as4%s", VTY_NEWLINE);
900 write++;
901 }
902
903 if (CONF_BGP_DEBUG (as4, AS4_SEGMENT))
904 {
905 vty_out (vty, "debug bgp as4 segment%s", VTY_NEWLINE);
906 write++;
907 }
908
paul718e3742002-12-13 20:15:29 +0000909 if (CONF_BGP_DEBUG (events, EVENTS))
910 {
911 vty_out (vty, "debug bgp events%s", VTY_NEWLINE);
912 write++;
913 }
914
915 if (CONF_BGP_DEBUG (keepalive, KEEPALIVE))
916 {
917 vty_out (vty, "debug bgp keepalives%s", VTY_NEWLINE);
918 write++;
919 }
920
921 if (CONF_BGP_DEBUG (update, UPDATE_IN) && CONF_BGP_DEBUG (update, UPDATE_OUT))
922 {
923 vty_out (vty, "debug bgp updates%s", VTY_NEWLINE);
924 write++;
925 }
926 else if (CONF_BGP_DEBUG (update, UPDATE_IN))
927 {
928 vty_out (vty, "debug bgp updates in%s", VTY_NEWLINE);
929 write++;
930 }
931 else if (CONF_BGP_DEBUG (update, UPDATE_OUT))
932 {
933 vty_out (vty, "debug bgp updates out%s", VTY_NEWLINE);
934 write++;
935 }
936
937 if (CONF_BGP_DEBUG (fsm, FSM))
938 {
939 vty_out (vty, "debug bgp fsm%s", VTY_NEWLINE);
940 write++;
941 }
942
943 if (CONF_BGP_DEBUG (filter, FILTER))
944 {
945 vty_out (vty, "debug bgp filters%s", VTY_NEWLINE);
946 write++;
947 }
948
Andrew J. Schorra39275d2006-11-30 16:36:57 +0000949 if (CONF_BGP_DEBUG (zebra, ZEBRA))
950 {
951 vty_out (vty, "debug bgp zebra%s", VTY_NEWLINE);
952 write++;
953 }
954
Lou Bergerf53585d2016-05-17 07:10:36 -0400955 if (CONF_BGP_DEBUG (allow_martians, ALLOW_MARTIANS))
956 {
957 vty_out (vty, "debug bgp allow-martians%s", VTY_NEWLINE);
958 write++;
959 }
Pradosh Mohapatra60cc9592015-11-09 20:21:41 -0500960
961 if (CONF_BGP_DEBUG (nht, NHT))
962 {
963 vty_out (vty, "debug bgp nht%s", VTY_NEWLINE);
964 write++;
965 }
Lou Bergerf53585d2016-05-17 07:10:36 -0400966
paul718e3742002-12-13 20:15:29 +0000967 return write;
968}
969
Stephen Hemminger7fc626d2008-12-01 11:10:34 -0800970static struct cmd_node debug_node =
paul718e3742002-12-13 20:15:29 +0000971{
972 DEBUG_NODE,
973 "",
974 1
975};
976
977void
paul94f2b392005-06-28 12:44:16 +0000978bgp_debug_init (void)
paul718e3742002-12-13 20:15:29 +0000979{
980 install_node (&debug_node, bgp_config_write_debug);
981
982 install_element (ENABLE_NODE, &show_debugging_bgp_cmd);
983
Paul Jakma0b2aa3a2007-10-14 22:32:21 +0000984 install_element (ENABLE_NODE, &debug_bgp_as4_cmd);
985 install_element (CONFIG_NODE, &debug_bgp_as4_cmd);
986 install_element (ENABLE_NODE, &debug_bgp_as4_segment_cmd);
987 install_element (CONFIG_NODE, &debug_bgp_as4_segment_cmd);
988
paul718e3742002-12-13 20:15:29 +0000989 install_element (ENABLE_NODE, &debug_bgp_fsm_cmd);
990 install_element (CONFIG_NODE, &debug_bgp_fsm_cmd);
991 install_element (ENABLE_NODE, &debug_bgp_events_cmd);
992 install_element (CONFIG_NODE, &debug_bgp_events_cmd);
Pradosh Mohapatra60cc9592015-11-09 20:21:41 -0500993 install_element (ENABLE_NODE, &debug_bgp_nht_cmd);
994 install_element (CONFIG_NODE, &debug_bgp_nht_cmd);
paul718e3742002-12-13 20:15:29 +0000995 install_element (ENABLE_NODE, &debug_bgp_filter_cmd);
996 install_element (CONFIG_NODE, &debug_bgp_filter_cmd);
997 install_element (ENABLE_NODE, &debug_bgp_keepalive_cmd);
998 install_element (CONFIG_NODE, &debug_bgp_keepalive_cmd);
999 install_element (ENABLE_NODE, &debug_bgp_update_cmd);
1000 install_element (CONFIG_NODE, &debug_bgp_update_cmd);
1001 install_element (ENABLE_NODE, &debug_bgp_update_direct_cmd);
1002 install_element (CONFIG_NODE, &debug_bgp_update_direct_cmd);
1003 install_element (ENABLE_NODE, &debug_bgp_normal_cmd);
1004 install_element (CONFIG_NODE, &debug_bgp_normal_cmd);
Andrew J. Schorra39275d2006-11-30 16:36:57 +00001005 install_element (ENABLE_NODE, &debug_bgp_zebra_cmd);
1006 install_element (CONFIG_NODE, &debug_bgp_zebra_cmd);
Lou Bergerf53585d2016-05-17 07:10:36 -04001007 install_element (ENABLE_NODE, &debug_bgp_allow_martians_cmd);
1008 install_element (CONFIG_NODE, &debug_bgp_allow_martians_cmd);
paul718e3742002-12-13 20:15:29 +00001009
Paul Jakma0b2aa3a2007-10-14 22:32:21 +00001010 install_element (ENABLE_NODE, &no_debug_bgp_as4_cmd);
1011 install_element (ENABLE_NODE, &undebug_bgp_as4_cmd);
1012 install_element (CONFIG_NODE, &no_debug_bgp_as4_cmd);
1013 install_element (ENABLE_NODE, &no_debug_bgp_as4_segment_cmd);
1014 install_element (ENABLE_NODE, &undebug_bgp_as4_segment_cmd);
1015 install_element (CONFIG_NODE, &no_debug_bgp_as4_segment_cmd);
1016
paul718e3742002-12-13 20:15:29 +00001017 install_element (ENABLE_NODE, &no_debug_bgp_fsm_cmd);
1018 install_element (ENABLE_NODE, &undebug_bgp_fsm_cmd);
1019 install_element (CONFIG_NODE, &no_debug_bgp_fsm_cmd);
1020 install_element (ENABLE_NODE, &no_debug_bgp_events_cmd);
1021 install_element (ENABLE_NODE, &undebug_bgp_events_cmd);
1022 install_element (CONFIG_NODE, &no_debug_bgp_events_cmd);
Pradosh Mohapatra60cc9592015-11-09 20:21:41 -05001023 install_element (ENABLE_NODE, &no_debug_bgp_nht_cmd);
1024 install_element (ENABLE_NODE, &undebug_bgp_nht_cmd);
1025 install_element (CONFIG_NODE, &no_debug_bgp_nht_cmd);
paul718e3742002-12-13 20:15:29 +00001026 install_element (ENABLE_NODE, &no_debug_bgp_filter_cmd);
1027 install_element (ENABLE_NODE, &undebug_bgp_filter_cmd);
1028 install_element (CONFIG_NODE, &no_debug_bgp_filter_cmd);
1029 install_element (ENABLE_NODE, &no_debug_bgp_keepalive_cmd);
1030 install_element (ENABLE_NODE, &undebug_bgp_keepalive_cmd);
1031 install_element (CONFIG_NODE, &no_debug_bgp_keepalive_cmd);
1032 install_element (ENABLE_NODE, &no_debug_bgp_update_cmd);
1033 install_element (ENABLE_NODE, &undebug_bgp_update_cmd);
1034 install_element (CONFIG_NODE, &no_debug_bgp_update_cmd);
1035 install_element (ENABLE_NODE, &no_debug_bgp_normal_cmd);
1036 install_element (ENABLE_NODE, &undebug_bgp_normal_cmd);
1037 install_element (CONFIG_NODE, &no_debug_bgp_normal_cmd);
Andrew J. Schorra39275d2006-11-30 16:36:57 +00001038 install_element (ENABLE_NODE, &no_debug_bgp_zebra_cmd);
1039 install_element (ENABLE_NODE, &undebug_bgp_zebra_cmd);
1040 install_element (CONFIG_NODE, &no_debug_bgp_zebra_cmd);
Lou Bergerf53585d2016-05-17 07:10:36 -04001041 install_element (ENABLE_NODE, &no_debug_bgp_allow_martians_cmd);
1042 install_element (ENABLE_NODE, &undebug_bgp_allow_martians_cmd);
1043 install_element (CONFIG_NODE, &no_debug_bgp_allow_martians_cmd);
paul718e3742002-12-13 20:15:29 +00001044 install_element (ENABLE_NODE, &no_debug_bgp_all_cmd);
1045 install_element (ENABLE_NODE, &undebug_bgp_all_cmd);
1046}