diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-08-01 15:18:25 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-08-01 15:18:25 +0200 |
commit | 6d53a10e4cf873ff61a3dada644d15be83dd54c0 (patch) | |
tree | c5c59a7b402956be4e78a5028a93554a3141d8d1 | |
parent | lib: Retab command_match.c (diff) | |
download | frr-6d53a10e4cf873ff61a3dada644d15be83dd54c0.tar.xz frr-6d53a10e4cf873ff61a3dada644d15be83dd54c0.zip |
lib: Add partial matching support
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r-- | feed.x | 14 | ||||
-rw-r--r-- | lib/.command.h.swo | bin | 0 -> 16384 bytes | |||
-rw-r--r-- | lib/command_graph.c | 2 | ||||
-rw-r--r-- | lib/command_lex.l | 2 | ||||
-rw-r--r-- | lib/command_match.c | 40 | ||||
-rw-r--r-- | lib/grammar_sandbox.c | 2 | ||||
-rw-r--r-- | opt.txt | 905 | ||||
-rwxr-xr-x | quagga_parser_to_network_docopt.py | 1327 |
8 files changed, 2281 insertions, 11 deletions
@@ -0,0 +1,14 @@ +#!/bin/expect + +set f [open "copt.txt"] +set cmds [split [read $f] "\n"] +close $f + +spawn vtysh + +foreach command $cmds { + expect "dell-s6000-16#" + send "$command\r" +} + +interact diff --git a/lib/.command.h.swo b/lib/.command.h.swo Binary files differnew file mode 100644 index 000000000..71a42cc20 --- /dev/null +++ b/lib/.command.h.swo diff --git a/lib/command_graph.c b/lib/command_graph.c index 7c09a5cd6..3e52f4259 100644 --- a/lib/command_graph.c +++ b/lib/command_graph.c @@ -92,7 +92,7 @@ struct graph_node * copy_node (struct graph_node *node) { struct graph_node *new = new_node(node->type); - new->children = vector_copy (node->children); + new->children = NULL; new->is_start = node->is_start; new->end = node->end; new->text = node->text ? XSTRDUP(MTYPE_CMD_TOKENS, node->text) : NULL; diff --git a/lib/command_lex.l b/lib/command_lex.l index 5a0e76d41..ce09c5bf2 100644 --- a/lib/command_lex.l +++ b/lib/command_lex.l @@ -9,7 +9,7 @@ IPV4 A\.B\.C\.D IPV4_PREFIX A\.B\.C\.D\/M IPV6 X:X::X:X IPV6_PREFIX X:X::X:X\/M -VARIABLE [A-Z][A-Z_]+ +VARIABLE [A-Z][A-Z_:]+ NUMBER [0-9]{1,20} RANGE \({NUMBER}\-{NUMBER}\) diff --git a/lib/command_match.c b/lib/command_match.c index f02b7c821..7b9c5f15d 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -13,6 +13,9 @@ match_command_r (struct graph_node *, vector, unsigned int); static int score_precedence (struct graph_node *); +static enum match_type +min_match_level(enum node_type type); + /* token matcher prototypes */ static enum match_type match_ipv4 (const char *); @@ -30,7 +33,7 @@ static enum match_type match_range (struct graph_node *, const char *str); static enum match_type -match_word (struct graph_node *, enum filter_type, const char *); +match_word (struct graph_node *, const char *, enum filter_type); static enum match_type match_number (struct graph_node *, const char *); @@ -137,8 +140,11 @@ match_command (struct graph_node *start, const char *line, struct list **argv) static struct list * match_command_r (struct graph_node *start, vector vline, unsigned int n) { + // get the minimum match level that can count as a full match + enum match_type minmatch = min_match_level(start->type); + // if we don't match this node, die - if (match_token(start, vector_slot(vline, n), FILTER_STRICT) != exact_match) + if (match_token(start, vector_slot(vline, n), FILTER_RELAXED) < minmatch) return NULL; // arg list for this subgraph @@ -313,12 +319,30 @@ add_nexthops(struct list *l, struct graph_node *node) /* matching utility functions */ +/** + * Determines the minimum acceptable matching level + * for a given node type that can be accepted as a + * full match. Used for things like abbreviating + * commands, e.g. `conf t`. + */ +static enum match_type +min_match_level(enum node_type type) +{ + switch (type) { + case WORD_GN: + return partly_match; + default: + return exact_match; + } +} + static int score_precedence (struct graph_node *node) { switch (node->type) { - // these should be mutually exclusive + // these should be mutually exclusive, + // or never compared case IPV4_GN: case IPV4_PREFIX_GN: case IPV6_GN: @@ -344,11 +368,11 @@ match_token (struct graph_node *node, char *token, enum filter_type filter) case IPV4_GN: return match_ipv4 (token); case IPV4_PREFIX_GN: - return match_ipv4_prefix (token, filter); + return match_ipv4_prefix (token); case IPV6_GN: - return match_ipv6 (token, filter); + return match_ipv6 (token); case IPV6_PREFIX_GN: - return match_ipv6_prefix (token, filter); + return match_ipv6_prefix (token); case RANGE_GN: return match_range (node, token); case NUMBER_GN: @@ -584,8 +608,8 @@ match_range (struct graph_node *rangenode, const char *str) static enum match_type match_word(struct graph_node *wordnode, - enum filter_type filter, - const char *word) + const char *word, + enum filter_type filter) { if (filter == FILTER_RELAXED) { diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c index 2443b8471..66e530595 100644 --- a/lib/grammar_sandbox.c +++ b/lib/grammar_sandbox.c @@ -56,7 +56,7 @@ DEFUN (grammar_test_complete, // print possible next hops, if any for (ALL_LIST_ELEMENTS_RO(result,node,cnode)) { if (cnode->type == END_GN) - fprintf(stderr, "<cr>\n"); + fprintf(stderr, "<cr> %p\n", cnode->element->func); else fprintf(stderr, "%s\n", describe_node(cnode, desc, 50)); } diff --git a/opt.txt b/opt.txt new file mode 100644 index 000000000..a63e0b85f --- /dev/null +++ b/opt.txt @@ -0,0 +1,905 @@ +address-family encap +address-family encapv4 +address-family encapv6 +address-family ipv4 +address-family ipv4 <unicast|multicast> +address-family ipv6 +address-family ipv6 <unicast|multicast> +address-family vpnv4 +address-family vpnv4 unicast +address-family vpnv6 +address-family vpnv6 unicast +aggregate-address A.B.C.D A.B.C.D +aggregate-address A.B.C.D A.B.C.D as-set +aggregate-address A.B.C.D A.B.C.D as-set summary-only +aggregate-address A.B.C.D A.B.C.D summary-only +aggregate-address A.B.C.D A.B.C.D summary-only as-set +aggregate-address A.B.C.D/M +aggregate-address A.B.C.D/M as-set +aggregate-address A.B.C.D/M as-set summary-only +aggregate-address A.B.C.D/M summary-only +aggregate-address A.B.C.D/M summary-only as-set +aggregate-address X:X::X:X/M +aggregate-address X:X::X:X/M summary-only +bgp always-compare-med +bgp bestpath as-path confed +bgp bestpath as-path ignore +bgp bestpath as-path multipath-relax <as-set|no-as-set> +bgp bestpath compare-routerid +bgp bestpath med <confed|missing-as-worst> +bgp bestpath med confed missing-as-worst +bgp bestpath med missing-as-worst confed +bgp client-to-client reflection +bgp cluster-id (1-4294967295) +bgp cluster-id A.B.C.D +bgp confederation identifier (1-4294967295) +bgp confederation peers . (1-4294967295) +bgp config-type <cisco|zebra> +bgp dampening +bgp dampening (1-45) +bgp dampening (1-45) (1-20000) (1-20000) (1-255) +bgp default ipv4-unicast +bgp default local-preference (0-4294967295) +bgp default show-hostname +bgp default subgroup-pkt-queue-max (20-100) +bgp deterministic-med +bgp disable-ebgp-connected-route-check +bgp enforce-first-as +bgp fast-external-failover +bgp graceful-restart +bgp graceful-restart stalepath-time (1-3600) +bgp listen limit (1-5000) +bgp listen range <A.B.C.D/M|X:X::X:X/M> peer-group WORD +bgp log-neighbor-changes +bgp max-med administrative +bgp max-med administrative (0-4294967294) +bgp max-med on-startup (5-86400) +bgp max-med on-startup (5-86400) (0-4294967294) +bgp multiple-instance +bgp network import-check +bgp route-map delay-timer (0-600) +bgp route-reflector allow-outbound-policy +bgp router-id A.B.C.D +bgp router-id IFNAME +clear bgp <A.B.C.D|X:X::X:X|WORD> +clear bgp <A.B.C.D|X:X::X:X|WORD> in +clear bgp <A.B.C.D|X:X::X:X|WORD> in prefix-filter +clear bgp <A.B.C.D|X:X::X:X|WORD> out +clear bgp <A.B.C.D|X:X::X:X|WORD> soft +clear bgp <A.B.C.D|X:X::X:X|WORD> soft in +clear bgp <A.B.C.D|X:X::X:X|WORD> soft out +clear bgp * +clear bgp * in +clear bgp * in prefix-filter +clear bgp * out +clear bgp * soft +clear bgp * soft in +clear bgp * soft out +clear bgp (1-4294967295) +clear bgp (1-4294967295) in +clear bgp (1-4294967295) in prefix-filter +clear bgp (1-4294967295) out +clear bgp (1-4294967295) soft +clear bgp (1-4294967295) soft in +clear bgp (1-4294967295) soft out +clear bgp BGP_INSTANCE_CMD <A.B.C.D|X:X::X:X|WORD> +clear bgp BGP_INSTANCE_CMD <A.B.C.D|X:X::X:X|WORD> in +clear bgp BGP_INSTANCE_CMD <A.B.C.D|X:X::X:X|WORD> out +clear bgp BGP_INSTANCE_CMD <A.B.C.D|X:X::X:X|WORD> soft +clear bgp BGP_INSTANCE_CMD <A.B.C.D|X:X::X:X|WORD> soft in +clear bgp BGP_INSTANCE_CMD <A.B.C.D|X:X::X:X|WORD> soft out +clear bgp BGP_INSTANCE_CMD * +clear bgp BGP_INSTANCE_CMD * in +clear bgp BGP_INSTANCE_CMD * out +clear bgp BGP_INSTANCE_CMD * soft +clear bgp BGP_INSTANCE_CMD * soft in +clear bgp BGP_INSTANCE_CMD * soft out +clear bgp BGP_INSTANCE_CMD (1-4294967295) +clear bgp BGP_INSTANCE_CMD (1-4294967295) in +clear bgp BGP_INSTANCE_CMD (1-4294967295) out +clear bgp BGP_INSTANCE_CMD (1-4294967295) soft +clear bgp BGP_INSTANCE_CMD (1-4294967295) soft in +clear bgp BGP_INSTANCE_CMD (1-4294967295) soft out +clear bgp BGP_INSTANCE_CMD external +clear bgp BGP_INSTANCE_CMD external in +clear bgp BGP_INSTANCE_CMD external out +clear bgp BGP_INSTANCE_CMD external soft +clear bgp BGP_INSTANCE_CMD external soft in +clear bgp BGP_INSTANCE_CMD external soft out +clear bgp BGP_INSTANCE_CMD ipv6 <A.B.C.D|X:X::X:X|WORD> +clear bgp BGP_INSTANCE_CMD ipv6 <A.B.C.D|X:X::X:X|WORD> in +clear bgp BGP_INSTANCE_CMD ipv6 <A.B.C.D|X:X::X:X|WORD> out +clear bgp BGP_INSTANCE_CMD ipv6 <A.B.C.D|X:X::X:X|WORD> soft +clear bgp BGP_INSTANCE_CMD ipv6 <A.B.C.D|X:X::X:X|WORD> soft in +clear bgp BGP_INSTANCE_CMD ipv6 <A.B.C.D|X:X::X:X|WORD> soft out +clear bgp BGP_INSTANCE_CMD ipv6 <unicast|multicast> prefix X:X::X:X/M +clear bgp BGP_INSTANCE_CMD ipv6 * +clear bgp BGP_INSTANCE_CMD ipv6 * in +clear bgp BGP_INSTANCE_CMD ipv6 * out +clear bgp BGP_INSTANCE_CMD ipv6 * soft +clear bgp BGP_INSTANCE_CMD ipv6 * soft in +clear bgp BGP_INSTANCE_CMD ipv6 * soft out +clear bgp BGP_INSTANCE_CMD ipv6 (1-4294967295) +clear bgp BGP_INSTANCE_CMD ipv6 (1-4294967295) in +clear bgp BGP_INSTANCE_CMD ipv6 (1-4294967295) out +clear bgp BGP_INSTANCE_CMD ipv6 (1-4294967295) soft +clear bgp BGP_INSTANCE_CMD ipv6 (1-4294967295) soft in +clear bgp BGP_INSTANCE_CMD ipv6 (1-4294967295) soft out +clear bgp BGP_INSTANCE_CMD ipv6 external +clear bgp BGP_INSTANCE_CMD ipv6 external WORD in +clear bgp BGP_INSTANCE_CMD ipv6 external WORD out +clear bgp BGP_INSTANCE_CMD ipv6 external soft +clear bgp BGP_INSTANCE_CMD ipv6 external soft in +clear bgp BGP_INSTANCE_CMD ipv6 external soft out +clear bgp BGP_INSTANCE_CMD ipv6 peer-group WORD +clear bgp BGP_INSTANCE_CMD ipv6 peer-group WORD in +clear bgp BGP_INSTANCE_CMD ipv6 peer-group WORD out +clear bgp BGP_INSTANCE_CMD ipv6 peer-group WORD soft +clear bgp BGP_INSTANCE_CMD ipv6 peer-group WORD soft in +clear bgp BGP_INSTANCE_CMD ipv6 peer-group WORD soft out +clear bgp BGP_INSTANCE_CMD peer-group WORD +clear bgp BGP_INSTANCE_CMD peer-group WORD in +clear bgp BGP_INSTANCE_CMD peer-group WORD out +clear bgp BGP_INSTANCE_CMD peer-group WORD soft +clear bgp BGP_INSTANCE_CMD peer-group WORD soft in +clear bgp BGP_INSTANCE_CMD peer-group WORD soft out +clear bgp external +clear bgp external in +clear bgp external in prefix-filter +clear bgp external out +clear bgp external soft +clear bgp external soft in +clear bgp external soft out +clear bgp ipv6 <A.B.C.D|X:X::X:X|WORD> +clear bgp ipv6 <A.B.C.D|X:X::X:X|WORD> in +clear bgp ipv6 <A.B.C.D|X:X::X:X|WORD> in prefix-filter +clear bgp ipv6 <A.B.C.D|X:X::X:X|WORD> out +clear bgp ipv6 <A.B.C.D|X:X::X:X|WORD> soft +clear bgp ipv6 <A.B.C.D|X:X::X:X|WORD> soft in +clear bgp ipv6 <A.B.C.D|X:X::X:X|WORD> soft out +clear bgp ipv6 <unicast|multicast> prefix X:X::X:X/M +clear bgp ipv6 * +clear bgp ipv6 * in +clear bgp ipv6 * in prefix-filter +clear bgp ipv6 * out +clear bgp ipv6 * soft +clear bgp ipv6 * soft in +clear bgp ipv6 * soft out +clear bgp ipv6 (1-4294967295) +clear bgp ipv6 (1-4294967295) in +clear bgp ipv6 (1-4294967295) in prefix-filter +clear bgp ipv6 (1-4294967295) out +clear bgp ipv6 (1-4294967295) soft +clear bgp ipv6 (1-4294967295) soft in +clear bgp ipv6 (1-4294967295) soft out +clear bgp ipv6 external +clear bgp ipv6 external WORD in +clear bgp ipv6 external WORD out +clear bgp ipv6 external in prefix-filter +clear bgp ipv6 external soft +clear bgp ipv6 external soft in +clear bgp ipv6 external soft out +clear bgp ipv6 peer-group WORD +clear bgp ipv6 peer-group WORD in +clear bgp ipv6 peer-group WORD in prefix-filter +clear bgp ipv6 peer-group WORD out +clear bgp ipv6 peer-group WORD soft +clear bgp ipv6 peer-group WORD soft in +clear bgp ipv6 peer-group WORD soft out +clear bgp peer-group WORD +clear bgp peer-group WORD in +clear bgp peer-group WORD in prefix-filter +clear bgp peer-group WORD out +clear bgp peer-group WORD soft +clear bgp peer-group WORD soft in +clear bgp peer-group WORD soft out +clear ip bgp <A.B.C.D|WORD> in +clear ip bgp <A.B.C.D|WORD> in prefix-filter +clear ip bgp <A.B.C.D|WORD> ipv4 <unicast|multicast> in +clear ip bgp <A.B.C.D|WORD> ipv4 <unicast|multicast> in prefix-filter +clear ip bgp <A.B.C.D|WORD> ipv4 <unicast|multicast> out +clear ip bgp <A.B.C.D|WORD> ipv4 <unicast|multicast> soft +clear ip bgp <A.B.C.D|WORD> ipv4 <unicast|multicast> soft in +clear ip bgp <A.B.C.D|WORD> ipv4 <unicast|multicast> soft out +clear ip bgp <A.B.C.D|WORD> out +clear ip bgp <A.B.C.D|WORD> soft +clear ip bgp <A.B.C.D|WORD> soft in +clear ip bgp <A.B.C.D|WORD> soft out +clear ip bgp <A.B.C.D|WORD> vpnv4 unicast in +clear ip bgp <A.B.C.D|WORD> vpnv4 unicast out +clear ip bgp <A.B.C.D|WORD> vpnv4 unicast soft +clear ip bgp <A.B.C.D|WORD> vpnv4 unicast soft in +clear ip bgp <A.B.C.D|WORD> vpnv4 unicast soft out +clear ip bgp <A.B.C.D|X:X::X:X|WORD> +clear ip bgp * +clear ip bgp * encap unicast in +clear ip bgp * encap unicast out +clear ip bgp * encap unicast soft +clear ip bgp * encap unicast soft in +clear ip bgp * encap unicast soft out +clear ip bgp * in +clear ip bgp * in prefix-filter +clear ip bgp * ipv4 <unicast|multicast> in +clear ip bgp * ipv4 <unicast|multicast> in prefix-filter +clear ip bgp * ipv4 <unicast|multicast> out +clear ip bgp * ipv4 <unicast|multicast> soft +clear ip bgp * ipv4 <unicast|multicast> soft in +clear ip bgp * ipv4 <unicast|multicast> soft out +clear ip bgp * out +clear ip bgp * soft +clear ip bgp * soft in +clear ip bgp * soft out +clear ip bgp * vpnv4 unicast in +clear ip bgp * vpnv4 unicast out +clear ip bgp * vpnv4 unicast soft +clear ip bgp * vpnv4 unicast soft in +clear ip bgp * vpnv4 unicast soft out +clear ip bgp (1-4294967295) +clear ip bgp (1-4294967295) encap unicast in +clear ip bgp (1-4294967295) encap unicast out +clear ip bgp (1-4294967295) encap unicast soft +clear ip bgp (1-4294967295) encap unicast soft in +clear ip bgp (1-4294967295) encap unicast soft out +clear ip bgp (1-4294967295) in +clear ip bgp (1-4294967295) in prefix-filter +clear ip bgp (1-4294967295) ipv4 <unicast|multicast> in +clear ip bgp (1-4294967295) ipv4 <unicast|multicast> in prefix-filter +clear ip bgp (1-4294967295) ipv4 <unicast|multicast> out +clear ip bgp (1-4294967295) ipv4 <unicast|multicast> soft +clear ip bgp (1-4294967295) ipv4 <unicast|multicast> soft in +clear ip bgp (1-4294967295) ipv4 <unicast|multicast> soft out +clear ip bgp (1-4294967295) out +clear ip bgp (1-4294967295) soft +clear ip bgp (1-4294967295) soft in +clear ip bgp (1-4294967295) soft out +clear ip bgp (1-4294967295) vpnv4 unicast in +clear ip bgp (1-4294967295) vpnv4 unicast out +clear ip bgp (1-4294967295) vpnv4 unicast soft +clear ip bgp (1-4294967295) vpnv4 unicast soft in +clear ip bgp (1-4294967295) vpnv4 unicast soft out +clear ip bgp A.B.C.D encap unicast in +clear ip bgp A.B.C.D encap unicast out +clear ip bgp A.B.C.D encap unicast soft +clear ip bgp A.B.C.D encap unicast soft in +clear ip bgp A.B.C.D encap unicast soft out +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> in +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> ipv4 <unicast|multicast> in +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> ipv4 <unicast|multicast> out +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> ipv4 <unicast|multicast> soft +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> ipv4 <unicast|multicast> soft in +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> ipv4 <unicast|multicast> soft out +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> out +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> soft +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> soft in +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|WORD> soft out +clear ip bgp BGP_INSTANCE_CMD <A.B.C.D|X:X::X:X|WORD> +clear ip bgp BGP_INSTANCE_CMD * +clear ip bgp BGP_INSTANCE_CMD * in +clear ip bgp BGP_INSTANCE_CMD * ipv4 <unicast|multicast> in +clear ip bgp BGP_INSTANCE_CMD * ipv4 <unicast|multicast> out +clear ip bgp BGP_INSTANCE_CMD * ipv4 <unicast|multicast> soft +clear ip bgp BGP_INSTANCE_CMD * ipv4 <unicast|multicast> soft in +clear ip bgp BGP_INSTANCE_CMD * ipv4 <unicast|multicast> soft out +clear ip bgp BGP_INSTANCE_CMD * out +clear ip bgp BGP_INSTANCE_CMD * soft +clear ip bgp BGP_INSTANCE_CMD * soft in +clear ip bgp BGP_INSTANCE_CMD * soft out +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) in +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 <unicast|multicast> in +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 <unicast|multicast> out +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 <unicast|multicast> soft +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 <unicast|multicast> soft in +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 <unicast|multicast> soft out +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) out +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) soft +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) soft in +clear ip bgp BGP_INSTANCE_CMD (1-4294967295) soft out +clear ip bgp BGP_INSTANCE_CMD external +clear ip bgp BGP_INSTANCE_CMD external in +clear ip bgp BGP_INSTANCE_CMD external ipv4 <unicast|multicast> in +clear ip bgp BGP_INSTANCE_CMD external ipv4 <unicast|multicast> out +clear ip bgp BGP_INSTANCE_CMD external ipv4 <unicast|multicast> soft +clear ip bgp BGP_INSTANCE_CMD external ipv4 <unicast|multicast> soft in +clear ip bgp BGP_INSTANCE_CMD external ipv4 <unicast|multicast> soft out +clear ip bgp BGP_INSTANCE_CMD external out +clear ip bgp BGP_INSTANCE_CMD external soft +clear ip bgp BGP_INSTANCE_CMD external soft in +clear ip bgp BGP_INSTANCE_CMD external soft out +clear ip bgp BGP_INSTANCE_CMD peer-group WORD +clear ip bgp BGP_INSTANCE_CMD peer-group WORD in +clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 <unicast|multicast> in +clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 <unicast|multicast> out +clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 <unicast|multicast> soft +clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 <unicast|multicast> soft in +clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 <unicast|multicast> soft out +clear ip bgp BGP_INSTANCE_CMD peer-group WORD out +clear ip bgp BGP_INSTANCE_CMD peer-group WORD soft +clear ip bgp BGP_INSTANCE_CMD peer-group WORD soft in +clear ip bgp BGP_INSTANCE_CMD peer-group WORD soft out +clear ip bgp BGP_INSTANCE_CMD prefix A.B.C.D/M +clear ip bgp dampening +clear ip bgp dampening A.B.C.D +clear ip bgp dampening A.B.C.D A.B.C.D +clear ip bgp dampening A.B.C.D/M +clear ip bgp external +clear ip bgp external in +clear ip bgp external in prefix-filter +clear ip bgp external ipv4 <unicast|multicast> in +clear ip bgp external ipv4 <unicast|multicast> in prefix-filter +clear ip bgp external ipv4 <unicast|multicast> out +clear ip bgp external ipv4 <unicast|multicast> soft +clear ip bgp external ipv4 <unicast|multicast> soft in +clear ip bgp external ipv4 <unicast|multicast> soft out +clear ip bgp external out +clear ip bgp external soft +clear ip bgp external soft in +clear ip bgp external soft out +clear ip bgp peer-group WORD +clear ip bgp peer-group WORD in +clear ip bgp peer-group WORD in prefix-filter +clear ip bgp peer-group WORD ipv4 <unicast|multicast> in +clear ip bgp peer-group WORD ipv4 <unicast|multicast> in prefix-filter +clear ip bgp peer-group WORD ipv4 <unicast|multicast> out +clear ip bgp peer-group WORD ipv4 <unicast|multicast> soft +clear ip bgp peer-group WORD ipv4 <unicast|multicast> soft in +clear ip bgp peer-group WORD ipv4 <unicast|multicast> soft out +clear ip bgp peer-group WORD out +clear ip bgp peer-group WORD soft +clear ip bgp peer-group WORD soft in +clear ip bgp peer-group WORD soft out +clear ip bgp prefix A.B.C.D/M +coalesce-time (0-4294967295) +debug bgp as4 +debug bgp as4 segment +debug bgp bestpath <A.B.C.D/M|X:X::X:X/M> +debug bgp keepalives +debug bgp keepalives <A.B.C.D|X:X::X:X|WORD> +debug bgp neighbor-events +debug bgp neighbor-events <A.B.C.D|X:X::X:X|WORD> +debug bgp nht +debug bgp update-groups +debug bgp updates +debug bgp updates <in|out> +debug bgp updates <in|out> <A.B.C.D|X:X::X:X|WORD> +debug bgp updates prefix <A.B.C.D/M|X:X::X:X/M> +debug bgp zebra +debug bgp zebra prefix <A.B.C.D/M|X:X::X:X/M> +distance (1-255) A.B.C.D/M +distance (1-255) A.B.C.D/M WORD +distance bgp (1-255) (1-255) (1-255) +dump bgp <all|all-et|updates|updates-et|routes-mrt> PATH [INTERVAL] +exit-address-family +ip community-list (1-99) <deny|permit> +ip community-list (1-99) <deny|permit> AA:NN +ip community-list (100-500) <deny|permit> LINE +ip community-list expanded WORD <deny|permit> LINE +ip community-list standard WORD <deny|permit> +ip community-list standard WORD <deny|permit> AA:NN +ip extcommunity-list (1-99) <deny|permit> +ip extcommunity-list (1-99) <deny|permit> AA:NN +ip extcommunity-list (100-500) <deny|permit> LINE +ip extcommunity-list expanded WORD <deny|permit> LINE +ip extcommunity-list standard WORD <deny|permit> +ip extcommunity-list standard WORD <deny|permit> AA:NN +ipv6 bgp aggregate-address X:X::X:X/M +ipv6 bgp aggregate-address X:X::X:X/M summary-only +ipv6 bgp network X:X::X:X/M +match as-path WORD +match community <(1-99)|(100-500)|WORD> +match community <(1-99)|(100-500)|WORD> exact-match +match extcommunity <(1-99)|(100-500)|WORD> +match interface WORD +match ip address <(1-199)|(1300-2699)|WORD> +match ip address prefix-list WORD +match ip next-hop <(1-199)|(1300-2699)|WORD> +match ip next-hop prefix-list WORD +match ip route-source <(1-199)|(1300-2699)|WORD> +match ip route-source prefix-list WORD +match ipv6 address WORD +match ipv6 address prefix-list WORD +match ipv6 next-hop X:X::X:X +match local-preference (0-4294967295) +match metric (0-4294967295) +match origin <egp|igp|incomplete> +match peer <A.B.C.D|X:X::X:X> +match peer local +match probability (0-100) +match tag (1-65535) +maximum-paths (1-255) +maximum-paths ibgp (1-255) +maximum-paths ibgp (1-255) equal-cluster-length +neighbor <A.B.C.D|X:X::X:X> interface WORD +neighbor <A.B.C.D|X:X::X:X> port (0-65535) +neighbor <A.B.C.D|X:X::X:X> strict-capability-match +neighbor <A.B.C.D|X:X::X:X|WORD> activate +neighbor <A.B.C.D|X:X::X:X|WORD> addpath-tx-all-paths +neighbor <A.B.C.D|X:X::X:X|WORD> addpath-tx-bestpath-per-AS +neighbor <A.B.C.D|X:X::X:X|WORD> advertisement-interval (0-600) +neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in +neighbor <A.B.C.D|X:X::X:X|WORD> allowas-in (1-10) +neighbor <A.B.C.D|X:X::X:X|WORD> as-override +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged <as-path|next-hop|med> +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path <next-hop|med> +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path med next-hop +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged as-path next-hop med +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med <as-path|next-hop> +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med as-path next-hop +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged med next-hop as-path +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop <as-path|med> +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop as-path med +neighbor <A.B.C.D|X:X::X:X|WORD> attribute-unchanged next-hop med as-path +neighbor <A.B.C.D|X:X::X:X|WORD> bfd +neighbor <A.B.C.D|X:X::X:X|WORD> bfd (2-255) BFD_CMD_MIN_RX_RANGE (50-60000) +neighbor <A.B.C.D|X:X::X:X|WORD> capability dynamic +neighbor <A.B.C.D|X:X::X:X|WORD> capability extended-nexthop +neighbor <A.B.C.D|X:X::X:X|WORD> capability orf prefix-list <both|send|receive> +neighbor <A.B.C.D|X:X::X:X|WORD> default-originate +neighbor <A.B.C.D|X:X::X:X|WORD> default-originate route-map WORD +neighbor <A.B.C.D|X:X::X:X|WORD> description LINE +neighbor <A.B.C.D|X:X::X:X|WORD> disable-connected-check +neighbor <A.B.C.D|X:X::X:X|WORD> distribute-list <(1-199)|(1300-2699)|WORD> <in|out> +neighbor <A.B.C.D|X:X::X:X|WORD> dont-capability-negotiate +neighbor <A.B.C.D|X:X::X:X|WORD> ebgp-multihop +neighbor <A.B.C.D|X:X::X:X|WORD> ebgp-multihop (1-255) +neighbor <A.B.C.D|X:X::X:X|WORD> enforce-multihop +neighbor <A.B.C.D|X:X::X:X|WORD> filter-list WORD <in|out> +neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295) +neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295) no-prepend +neighbor <A.B.C.D|X:X::X:X|WORD> local-as (1-4294967295) no-prepend replace-as +neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix (1-4294967295) +neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix (1-4294967295) (1-100) +neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix (1-4294967295) (1-100) restart (1-65535) +neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix (1-4294967295) (1-100) warning-only +neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix (1-4294967295) restart (1-65535) +neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix (1-4294967295) warning-only +neighbor <A.B.C.D|X:X::X:X|WORD> next-hop-self +neighbor <A.B.C.D|X:X::X:X|WORD> next-hop-self force +neighbor <A.B.C.D|X:X::X:X|WORD> nexthop-local unchanged +neighbor <A.B.C.D|X:X::X:X|WORD> override-capability +neighbor <A.B.C.D|X:X::X:X|WORD> passive +neighbor <A.B.C.D|X:X::X:X|WORD> password LINE +neighbor <A.B.C.D|X:X::X:X|WORD> peer-group WORD +neighbor <A.B.C.D|X:X::X:X|WORD> prefix-list WORD <in|out> +neighbor <A.B.C.D|X:X::X:X|WORD> remote-as <(1-4294967295)|external|internal> +neighbor <A.B.C.D|X:X::X:X|WORD> remove-private-AS +neighbor <A.B.C.D|X:X::X:X|WORD> remove-private-AS all +neighbor <A.B.C.D|X:X::X:X|WORD> remove-private-AS all replace-AS +neighbor <A.B.C.D|X:X::X:X|WORD> remove-private-AS replace-AS +neighbor <A.B.C.D|X:X::X:X|WORD> route-map WORD <in|out> +neighbor <A.B.C.D|X:X::X:X|WORD> route-reflector-client +neighbor <A.B.C.D|X:X::X:X|WORD> route-server-client +neighbor <A.B.C.D|X:X::X:X|WORD> send-community +neighbor <A.B.C.D|X:X::X:X|WORD> send-community <both|extended|standard> +neighbor <A.B.C.D|X:X::X:X|WORD> shutdown +neighbor <A.B.C.D|X:X::X:X|WORD> soft-reconfiguration inbound +neighbor <A.B.C.D|X:X::X:X|WORD> solo +neighbor <A.B.C.D|X:X::X:X|WORD> timers (0-65535) (0-65535) +neighbor <A.B.C.D|X:X::X:X|WORD> timers connect (1-65535) +neighbor <A.B.C.D|X:X::X:X|WORD> ttl-security hops (1-254) +neighbor <A.B.C.D|X:X::X:X|WORD> unsuppress-map WORD +neighbor <A.B.C.D|X:X::X:X|WORD> update-source <A.B.C.D|X:X::X:X|WORD> +neighbor <A.B.C.D|X:X::X:X|WORD> weight (0-65535) +neighbor WORD interface +neighbor WORD interface peer-group WORD +neighbor WORD interface v6only +neighbor WORD interface v6only peer-group WORD +neighbor WORD peer-group +network A.B.C.D +network A.B.C.D backdoor +network A.B.C.D mask A.B.C.D +network A.B.C.D mask A.B.C.D backdoor +network A.B.C.D mask A.B.C.D route-map WORD +network A.B.C.D route-map WORD +network A.B.C.D/M +network A.B.C.D/M backdoor +network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD +network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD route-map WORD +network A.B.C.D/M route-map WORD +network X:X::X:X/M +network X:X::X:X/M route-map WORD +redistribute <kernel|connected|static|ripng|ospf6|isis> +redistribute <kernel|connected|static|ripng|ospf6|isis> metric (0-4294967295) +redistribute <kernel|connected|static|ripng|ospf6|isis> metric (0-4294967295) route-map WORD +redistribute <kernel|connected|static|ripng|ospf6|isis> route-map WORD +redistribute <kernel|connected|static|ripng|ospf6|isis> route-map WORD metric (0-4294967295) +redistribute <kernel|connected|static|rip|ospf|isis> +redistribute <kernel|connected|static|rip|ospf|isis> metric (0-4294967295) +redistribute <kernel|connected|static|rip|ospf|isis> metric (0-4294967295) route-map WORD +redistribute <kernel|connected|static|rip|ospf|isis> route-map WORD +redistribute <kernel|connected|static|rip|ospf|isis> route-map WORD metric (0-4294967295) +redistribute <ospf|table> (1-65535) +redistribute <ospf|table> (1-65535) metric (0-4294967295) +redistribute <ospf|table> (1-65535) metric (0-4294967295) route-map WORD +redistribute <ospf|table> (1-65535) route-map WORD +redistribute <ospf|table> (1-65535) route-map WORD metric (0-4294967295) +router bgp +router bgp (1-4294967295) +router bgp (1-4294967295) <view|vrf> WORD +set aggregator as (1-4294967295) A.B.C.D +set as-path exclude . (1-4294967295) +set as-path prepend (last-as) (1-10) +set as-path prepend . (1-4294967295) +set atomic-aggregate +set comm-list <(1-99)|(100-500)|WORD> delete +set community AA:NN +set community none +set extcommunity rt .ASN:nn_or_IP-address:nn +set extcommunity soo .ASN:nn_or_IP-address:nn +set ip next-hop A.B.C.D +set ip next-hop peer-address +set ip next-hop unchanged +set ipv6 next-hop global X:X::X:X +set ipv6 next-hop local X:X::X:X +set ipv6 next-hop peer-address +set local-preference (0-4294967295) +set metric <rtt|+rtt|-rtt> +set metric <+/-metric> +set metric (0-4294967295) +set origin <egp|igp|incomplete> +set originator-id A.B.C.D +set tag (1-65535) +set vpnv4 next-hop A.B.C.D +set weight (0-4294967295) +show bgp <ipv4|ipv6> <encap|multicast|unicast|vpn> statistics +show bgp <ipv4|ipv6> <unicast|multicast> update-groups +show bgp <ipv4|ipv6> <unicast|multicast> update-groups <advertise-queue|advertised-routes|packet-queue> +show bgp <ipv4|ipv6> <unicast|multicast> update-groups SUBGROUP-ID +show bgp <ipv4|ipv6> <unicast|multicast> update-groups SUBGROUP-ID <advertise-queue|advertised-routes|packet-queue> +show bgp BGP_INSTANCE_ALL_CMD summary [json] +show bgp BGP_INSTANCE_ALL_CMD update-groups +show bgp BGP_INSTANCE_ALL_CMD [json] +show bgp BGP_INSTANCE_CMD <ipv4|ipv6> <unicast|multicast> community +show bgp BGP_INSTANCE_CMD <ipv4|ipv6> <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> +show bgp BGP_INSTANCE_CMD <ipv4|ipv6> <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp BGP_INSTANCE_CMD <ipv4|ipv6> <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp BGP_INSTANCE_CMD <ipv4|ipv6> <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp BGP_INSTANCE_CMD <ipv4|ipv6> <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> <advertised-routes|received-routes> [json] +show bgp BGP_INSTANCE_CMD <ipv4|ipv6> <unicast|multicast|vpn|encap> statistics +show bgp BGP_INSTANCE_CMD X:X::X:X <bestpath|multipath> [json] +show bgp BGP_INSTANCE_CMD X:X::X:X [json] +show bgp BGP_INSTANCE_CMD X:X::X:X/M <bestpath|multipath> [json] +show bgp BGP_INSTANCE_CMD X:X::X:X/M longer-prefixes +show bgp BGP_INSTANCE_CMD X:X::X:X/M [json] +show bgp BGP_INSTANCE_CMD community-list <(1-500)|WORD> +show bgp BGP_INSTANCE_CMD filter-list WORD +show bgp BGP_INSTANCE_CMD ipv6 <unicast|multicast> summary [json] +show bgp BGP_INSTANCE_CMD ipv6 X:X::X:X <bestpath|multipath> [json] +show bgp BGP_INSTANCE_CMD ipv6 X:X::X:X [json] +show bgp BGP_INSTANCE_CMD ipv6 X:X::X:X/M <bestpath|multipath> [json] +show bgp BGP_INSTANCE_CMD ipv6 X:X::X:X/M longer-prefixes +show bgp BGP_INSTANCE_CMD ipv6 X:X::X:X/M [json] +show bgp BGP_INSTANCE_CMD ipv6 community-list <(1-500)|WORD> +show bgp BGP_INSTANCE_CMD ipv6 filter-list WORD +show bgp BGP_INSTANCE_CMD ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show bgp BGP_INSTANCE_CMD ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> dampened-routes [json] +show bgp BGP_INSTANCE_CMD ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> flap-statistics [json] +show bgp BGP_INSTANCE_CMD ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json] +show bgp BGP_INSTANCE_CMD ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json] +show bgp BGP_INSTANCE_CMD ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show bgp BGP_INSTANCE_CMD ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show bgp BGP_INSTANCE_CMD ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> [json] +show bgp BGP_INSTANCE_CMD ipv6 neighbors [json] +show bgp BGP_INSTANCE_CMD ipv6 prefix-list WORD +show bgp BGP_INSTANCE_CMD ipv6 route-map WORD +show bgp BGP_INSTANCE_CMD ipv6 summary [json] +show bgp BGP_INSTANCE_CMD ipv6 [json] +show bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> dampened-routes [json] +show bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> flap-statistics [json] +show bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json] +show bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> [json] +show bgp BGP_INSTANCE_CMD neighbors [json] +show bgp BGP_INSTANCE_CMD prefix-list WORD +show bgp BGP_INSTANCE_CMD route-map WORD +show bgp BGP_INSTANCE_CMD summary [json] +show bgp BGP_INSTANCE_CMD update-groups +show bgp BGP_INSTANCE_CMD update-groups <advertise-queue|advertised-routes|packet-queue> +show bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID +show bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID <advertise-queue|advertised-routes|packet-queue> +show bgp BGP_INSTANCE_CMD [json] +show bgp X:X::X:X <bestpath|multipath> [json] +show bgp X:X::X:X [json] +show bgp X:X::X:X/M <bestpath|multipath> [json] +show bgp X:X::X:X/M longer-prefixes +show bgp X:X::X:X/M [json] +show bgp community +show bgp community <AA:NN|local-AS|no-advertise|no-export> +show bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show bgp community <AA:NN|local-AS|no-advertise|no-export> exact-match +show bgp community-list <(1-500)|WORD> +show bgp community-list <(1-500)|WORD> exact-match +show bgp filter-list WORD +show bgp ipv4 <unicast|multicast> A.B.C.D <bestpath|multipath> [json] +show bgp ipv4 <unicast|multicast> A.B.C.D [json] +show bgp ipv4 <unicast|multicast> A.B.C.D/M <bestpath|multipath> [json] +show bgp ipv4 <unicast|multicast> A.B.C.D/M [json] +show bgp ipv4 <unicast|multicast> summary [json] +show bgp ipv4 <unicast|multicast> [json] +show bgp ipv4 encap +show bgp ipv4 encap neighbors A.B.C.D advertised-routes +show bgp ipv4 encap neighbors A.B.C.D routes +show bgp ipv4 encap rd ASN:nn_or_IP-address:nn +show bgp ipv4 encap rd ASN:nn_or_IP-address:nn neighbors <A.B.C.D|X:X::X:X> advertised-routes +show bgp ipv4 encap rd ASN:nn_or_IP-address:nn neighbors <A.B.C.D|X:X::X:X> routes +show bgp ipv4 encap rd ASN:nn_or_IP-address:nn tags +show bgp ipv4 encap tags +show bgp ipv6 <unicast|multicast> X:X::X:X <bestpath|multipath> [json] +show bgp ipv6 <unicast|multicast> X:X::X:X [json] +show bgp ipv6 <unicast|multicast> X:X::X:X/M <bestpath|multipath> [json] +show bgp ipv6 <unicast|multicast> X:X::X:X/M [json] +show bgp ipv6 <unicast|multicast> summary [json] +show bgp ipv6 <unicast|multicast> [json] +show bgp ipv6 X:X::X:X <bestpath|multipath> [json] +show bgp ipv6 X:X::X:X [json] +show bgp ipv6 X:X::X:X/M <bestpath|multipath> [json] +show bgp ipv6 X:X::X:X/M longer-prefixes +show bgp ipv6 X:X::X:X/M [json] +show bgp ipv6 community +show bgp ipv6 community <AA:NN|local-AS|no-advertise|no-export> +show bgp ipv6 community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp ipv6 community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp ipv6 community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show bgp ipv6 community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show bgp ipv6 community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show bgp ipv6 community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show bgp ipv6 community <AA:NN|local-AS|no-advertise|no-export> exact-match +show bgp ipv6 community-list <(1-500)|WORD> +show bgp ipv6 community-list <(1-500)|WORD> exact-match +show bgp ipv6 encap +show bgp ipv6 encap neighbors A.B.C.D advertised-routes +show bgp ipv6 encap neighbors A.B.C.D routes +show bgp ipv6 encap rd ASN:nn_or_IP-address:nn +show bgp ipv6 encap rd ASN:nn_or_IP-address:nn neighbors <A.B.C.D|X:X::X:X> advertised-routes +show bgp ipv6 encap rd ASN:nn_or_IP-address:nn neighbors <A.B.C.D|X:X::X:X> routes +show bgp ipv6 encap rd ASN:nn_or_IP-address:nn tags +show bgp ipv6 encap tags +show bgp ipv6 filter-list WORD +show bgp ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show bgp ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> dampened-routes [json] +show bgp ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> flap-statistics [json] +show bgp ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json] +show bgp ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json] +show bgp ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show bgp ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show bgp ipv6 neighbors <A.B.C.D|X:X::X:X|WORD> [json] +show bgp ipv6 neighbors [json] +show bgp ipv6 prefix-list WORD +show bgp ipv6 regexp LINE +show bgp ipv6 route-map WORD +show bgp ipv6 summary [json] +show bgp ipv6 [json] +show bgp memory +show bgp neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show bgp neighbors <A.B.C.D|X:X::X:X|WORD> dampened-routes [json] +show bgp neighbors <A.B.C.D|X:X::X:X|WORD> flap-statistics [json] +show bgp neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json] +show bgp neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show bgp neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show bgp neighbors <A.B.C.D|X:X::X:X|WORD> [json] +show bgp neighbors [json] +show bgp prefix-list WORD +show bgp regexp LINE +show bgp route-map WORD +show bgp summary [json] +show bgp update-groups +show bgp update-groups <advertise-queue|advertised-routes|packet-queue> +show bgp update-groups SUBGROUP-ID +show bgp update-groups SUBGROUP-ID <advertise-queue|advertised-routes|packet-queue> +show bgp view WORD ipv4 <unicast|multicast> summary [json] +show bgp views +show bgp vrfs [json] +show bgp [json] +show debugging bgp +show ip as-path-access-list +show ip as-path-access-list WORD +show ip bgp A.B.C.D <bestpath|multipath> [json] +show ip bgp A.B.C.D [json] +show ip bgp A.B.C.D/M <bestpath|multipath> [json] +show ip bgp A.B.C.D/M longer-prefixes +show ip bgp A.B.C.D/M [json] +show ip bgp BGP_INSTANCE_ALL_CMD neighbors [json] +show ip bgp BGP_INSTANCE_ALL_CMD nexthop +show ip bgp BGP_INSTANCE_ALL_CMD summary [json] +show ip bgp BGP_INSTANCE_ALL_CMD update-groups +show ip bgp BGP_INSTANCE_ALL_CMD [json] +show ip bgp BGP_INSTANCE_CMD A.B.C.D <bestpath|multipath> [json] +show ip bgp BGP_INSTANCE_CMD A.B.C.D [json] +show ip bgp BGP_INSTANCE_CMD A.B.C.D/M <bestpath|multipath> [json] +show ip bgp BGP_INSTANCE_CMD A.B.C.D/M longer-prefixes +show ip bgp BGP_INSTANCE_CMD A.B.C.D/M [json] +show ip bgp BGP_INSTANCE_CMD community-list <(1-500)|WORD> +show ip bgp BGP_INSTANCE_CMD filter-list WORD +show ip bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes route-map WORD [json] +show ip bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show ip bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json] +show ip bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> received-routes route-map WORD [json] +show ip bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show ip bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show ip bgp BGP_INSTANCE_CMD neighbors <A.B.C.D|X:X::X:X|WORD> [json] +show ip bgp BGP_INSTANCE_CMD neighbors [json] +show ip bgp BGP_INSTANCE_CMD nexthop +show ip bgp BGP_INSTANCE_CMD nexthop detail +show ip bgp BGP_INSTANCE_CMD peer-group +show ip bgp BGP_INSTANCE_CMD peer-group WORD +show ip bgp BGP_INSTANCE_CMD prefix-list WORD +show ip bgp BGP_INSTANCE_CMD route-map WORD +show ip bgp BGP_INSTANCE_CMD summary [json] +show ip bgp BGP_INSTANCE_CMD update-groups +show ip bgp BGP_INSTANCE_CMD update-groups <advertise-queue|advertised-routes|packet-queue> +show ip bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID +show ip bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID <advertise-queue|advertised-routes|packet-queue> +show ip bgp BGP_INSTANCE_CMD [json] +show ip bgp attribute-info +show ip bgp cidr-only +show ip bgp community +show ip bgp community <AA:NN|local-AS|no-advertise|no-export> +show ip bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ip bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ip bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ip bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ip bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ip bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ip bgp community <AA:NN|local-AS|no-advertise|no-export> exact-match +show ip bgp community-info +show ip bgp community-list <(1-500)|WORD> +show ip bgp community-list <(1-500)|WORD> exact-match +show ip bgp dampened-paths +show ip bgp dampening dampened-paths +show ip bgp dampening flap-statistics +show ip bgp dampening flap-statistics A.B.C.D +show ip bgp dampening flap-statistics A.B.C.D/M longer-prefixes +show ip bgp dampening flap-statistics cidr-only +show ip bgp dampening flap-statistics filter-list WORD +show ip bgp dampening flap-statistics prefix-list WORD +show ip bgp dampening flap-statistics regexp LINE +show ip bgp dampening flap-statistics route-map WORD +show ip bgp dampening parameters +show ip bgp filter-list WORD +show ip bgp flap-statistics +show ip bgp flap-statistics A.B.C.D +show ip bgp flap-statistics A.B.C.D/M +show ip bgp flap-statistics A.B.C.D/M longer-prefixes +show ip bgp flap-statistics cidr-only +show ip bgp flap-statistics filter-list WORD +show ip bgp flap-statistics prefix-list WORD +show ip bgp flap-statistics regexp LINE +show ip bgp flap-statistics route-map WORD +show ip bgp ipv4 <unicast|multicast> A.B.C.D [json] +show ip bgp ipv4 <unicast|multicast> A.B.C.D/M <bestpath|multipath> [json] +show ip bgp ipv4 <unicast|multicast> A.B.C.D/M longer-prefixes +show ip bgp ipv4 <unicast|multicast> A.B.C.D/M [json] +show ip bgp ipv4 <unicast|multicast> cidr-only +show ip bgp ipv4 <unicast|multicast> community +show ip bgp ipv4 <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> +show ip bgp ipv4 <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ip bgp ipv4 <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ip bgp ipv4 <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ip bgp ipv4 <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ip bgp ipv4 <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ip bgp ipv4 <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ip bgp ipv4 <unicast|multicast> community <AA:NN|local-AS|no-advertise|no-export> exact-match +show ip bgp ipv4 <unicast|multicast> community-list <(1-500)|WORD> +show ip bgp ipv4 <unicast|multicast> community-list <(1-500)|WORD> exact-match +show ip bgp ipv4 <unicast|multicast> filter-list WORD +show ip bgp ipv4 <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes route-map WORD [json] +show ip bgp ipv4 <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show ip bgp ipv4 <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json] +show ip bgp ipv4 <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json] +show ip bgp ipv4 <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> received-routes route-map WORD [json] +show ip bgp ipv4 <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show ip bgp ipv4 <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show ip bgp ipv4 <unicast|multicast> neighbors <A.B.C.D|X:X::X:X|WORD> [json] +show ip bgp ipv4 <unicast|multicast> neighbors [json] +show ip bgp ipv4 <unicast|multicast> paths +show ip bgp ipv4 <unicast|multicast> prefix-list WORD +show ip bgp ipv4 <unicast|multicast> regexp LINE +show ip bgp ipv4 <unicast|multicast> route-map WORD +show ip bgp ipv4 <unicast|multicast> summary [json] +show ip bgp ipv4 <unicast|multicast> [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes route-map WORD [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> dampened-routes [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> flap-statistics [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> received-routes route-map WORD [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show ip bgp neighbors <A.B.C.D|X:X::X:X|WORD> [json] +show ip bgp neighbors [json] +show ip bgp nexthop +show ip bgp nexthop detail +show ip bgp paths +show ip bgp peer-group +show ip bgp peer-group WORD +show ip bgp prefix-list WORD +show ip bgp regexp LINE +show ip bgp route-map WORD +show ip bgp summary [json] +show ip bgp update-groups +show ip bgp update-groups <advertise-queue|advertised-routes|packet-queue> +show ip bgp update-groups SUBGROUP-ID +show ip bgp update-groups SUBGROUP-ID <advertise-queue|advertised-routes|packet-queue> +show ip bgp view WORD ipv4 <unicast|multicast> summary [json] +show ip bgp vpnv4 all +show ip bgp vpnv4 all A.B.C.D [json] +show ip bgp vpnv4 all A.B.C.D/M [json] +show ip bgp vpnv4 all neighbors <A.B.C.D|X:X::X:X|WORD> prefix-counts [json] +show ip bgp vpnv4 all neighbors A.B.C.D advertised-routes [json] +show ip bgp vpnv4 all neighbors A.B.C.D routes [json] +show ip bgp vpnv4 all neighbors A.B.C.D [json] +show ip bgp vpnv4 all neighbors [json] +show ip bgp vpnv4 all summary [json] +show ip bgp vpnv4 all tags +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn A.B.C.D [json] +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn A.B.C.D/M [json] +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D advertised-routes [json] +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D routes [json] +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D [json] +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors [json] +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary [json] +show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn tags +show ip bgp [json] +show ip community-list +show ip community-list <(1-500)|WORD> +show ip extcommunity-list +show ip extcommunity-list <(1-500)|WORD> +show ipv6 bgp X:X::X:X [json] +show ipv6 bgp X:X::X:X/M longer-prefixes +show ipv6 bgp X:X::X:X/M [json] +show ipv6 bgp community +show ipv6 bgp community <AA:NN|local-AS|no-advertise|no-export> +show ipv6 bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ipv6 bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ipv6 bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ipv6 bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ipv6 bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ipv6 bgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ipv6 bgp community <AA:NN|local-AS|no-advertise|no-export> exact-match +show ipv6 bgp community-list WORD +show ipv6 bgp community-list WORD exact-match +show ipv6 bgp filter-list WORD +show ipv6 bgp neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show ipv6 bgp neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show ipv6 bgp neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show ipv6 bgp prefix-list WORD +show ipv6 bgp regexp LINE +show ipv6 bgp summary [json] +show ipv6 bgp [json] +show ipv6 mbgp X:X::X:X [json] +show ipv6 mbgp X:X::X:X/M longer-prefixes +show ipv6 mbgp X:X::X:X/M [json] +show ipv6 mbgp community +show ipv6 mbgp community <AA:NN|local-AS|no-advertise|no-export> +show ipv6 mbgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ipv6 mbgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ipv6 mbgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> +show ipv6 mbgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ipv6 mbgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ipv6 mbgp community <AA:NN|local-AS|no-advertise|no-export> <AA:NN|local-AS|no-advertise|no-export> exact-match +show ipv6 mbgp community <AA:NN|local-AS|no-advertise|no-export> exact-match +show ipv6 mbgp community-list WORD +show ipv6 mbgp community-list WORD exact-match +show ipv6 mbgp filter-list WORD +show ipv6 mbgp neighbors <A.B.C.D|X:X::X:X|WORD> advertised-routes [json] +show ipv6 mbgp neighbors <A.B.C.D|X:X::X:X|WORD> received-routes [json] +show ipv6 mbgp neighbors <A.B.C.D|X:X::X:X|WORD> routes [json] +show ipv6 mbgp prefix-list WORD +show ipv6 mbgp regexp LINE +show ipv6 mbgp summary [json] +show ipv6 mbgp [json] +table-map WORD +timers bgp (0-65535) (0-65535) +update-delay (0-3600) +update-delay (0-3600) (1-3600) +write-quanta (1-10000) diff --git a/quagga_parser_to_network_docopt.py b/quagga_parser_to_network_docopt.py new file mode 100755 index 000000000..89a6fd798 --- /dev/null +++ b/quagga_parser_to_network_docopt.py @@ -0,0 +1,1327 @@ +#!/usr/bin/env python + +""" +The primary use case of this tool is to print a network-docopt compatible +docstring that covers all bgp and ospf commands in quagga. +""" + +import argparse +import logging +import os +import re +import sys +from pprint import pprint, pformat + +# All of the clear commands in bgp_clear_ignore will be covered by these clear commands: +# quagga clear bgp (<ipv4>|<ipv6>|<interface>|*) +# quagga clear bgp (<ipv4>|<ipv6>|<interface>|*) soft [in|out] +# quagga clear bgp prefix <ipv4/prefixlen> +bgp_clear_ignore = """ quagga clear bgp (<ipv4>|<ipv6>|<interface>) + quagga clear bgp (<ipv4>|<ipv6>|<interface>) in + quagga clear bgp (<ipv4>|<ipv6>|<interface>) in prefix-filter + quagga clear bgp (<ipv4>|<ipv6>|<interface>) out + quagga clear bgp (<ipv4>|<ipv6>|<interface>) soft + quagga clear bgp (<ipv4>|<ipv6>|<interface>) soft in + quagga clear bgp (<ipv4>|<ipv6>|<interface>) soft out + quagga clear bgp * + quagga clear bgp * in + quagga clear bgp * in prefix-filter + quagga clear bgp * out + quagga clear bgp * soft + quagga clear bgp * soft in + quagga clear bgp * soft out + quagga clear bgp <1-4294967295> + quagga clear bgp <1-4294967295> in + quagga clear bgp <1-4294967295> in prefix-filter + quagga clear bgp <1-4294967295> out + quagga clear bgp <1-4294967295> soft + quagga clear bgp <1-4294967295> soft in + quagga clear bgp <1-4294967295> soft out + quagga clear bgp BGP_INSTANCE_CMD * + quagga clear bgp BGP_INSTANCE_CMD * soft + quagga clear bgp BGP_INSTANCE_CMD * soft in + quagga clear bgp BGP_INSTANCE_CMD * soft out + quagga clear bgp external + quagga clear bgp external in + quagga clear bgp external in prefix-filter + quagga clear bgp external out + quagga clear bgp external soft + quagga clear bgp external soft in + quagga clear bgp external soft out + quagga clear bgp ipv6 (<ipv4>|<ipv6>|<interface>) + quagga clear bgp ipv6 (<ipv4>|<ipv6>|<interface>) in + quagga clear bgp ipv6 (<ipv4>|<ipv6>|<interface>) in prefix-filter + quagga clear bgp ipv6 (<ipv4>|<ipv6>|<interface>) out + quagga clear bgp ipv6 (<ipv4>|<ipv6>|<interface>) soft + quagga clear bgp ipv6 (<ipv4>|<ipv6>|<interface>) soft in + quagga clear bgp ipv6 (<ipv4>|<ipv6>|<interface>) soft out + quagga clear bgp ipv6 (unicast|multicast) prefix <ipv6/prefixlen> + quagga clear bgp ipv6 * + quagga clear bgp ipv6 * in + quagga clear bgp ipv6 * in prefix-filter + quagga clear bgp ipv6 * out + quagga clear bgp ipv6 * soft + quagga clear bgp ipv6 * soft in + quagga clear bgp ipv6 * soft out + quagga clear bgp ipv6 <1-4294967295> + quagga clear bgp ipv6 <1-4294967295> in + quagga clear bgp ipv6 <1-4294967295> in prefix-filter + quagga clear bgp ipv6 <1-4294967295> out + quagga clear bgp ipv6 <1-4294967295> soft + quagga clear bgp ipv6 <1-4294967295> soft in + quagga clear bgp ipv6 <1-4294967295> soft out + quagga clear bgp ipv6 external + quagga clear bgp ipv6 external WORD in + quagga clear bgp ipv6 external WORD out + quagga clear bgp ipv6 external in prefix-filter + quagga clear bgp ipv6 external soft + quagga clear bgp ipv6 external soft in + quagga clear bgp ipv6 external soft out + quagga clear bgp ipv6 peer-group WORD + quagga clear bgp ipv6 peer-group WORD in + quagga clear bgp ipv6 peer-group WORD in prefix-filter + quagga clear bgp ipv6 peer-group WORD out + quagga clear bgp ipv6 peer-group WORD soft + quagga clear bgp ipv6 peer-group WORD soft in + quagga clear bgp ipv6 peer-group WORD soft out + quagga clear bgp peer-group WORD + quagga clear bgp peer-group WORD in + quagga clear bgp peer-group WORD in prefix-filter + quagga clear bgp peer-group WORD out + quagga clear bgp peer-group WORD soft + quagga clear bgp peer-group WORD soft in + quagga clear bgp peer-group WORD soft out + quagga clear ip bgp (<ipv4>|<interface>) in + quagga clear ip bgp (<ipv4>|<interface>) in prefix-filter + quagga clear ip bgp (<ipv4>|<interface>) ipv4 (unicast|multicast) in + quagga clear ip bgp (<ipv4>|<interface>) ipv4 (unicast|multicast) in prefix-filter + quagga clear ip bgp (<ipv4>|<interface>) ipv4 (unicast|multicast) out + quagga clear ip bgp (<ipv4>|<interface>) ipv4 (unicast|multicast) soft + quagga clear ip bgp (<ipv4>|<interface>) ipv4 (unicast|multicast) soft in + quagga clear ip bgp (<ipv4>|<interface>) ipv4 (unicast|multicast) soft out + quagga clear ip bgp (<ipv4>|<interface>) out + quagga clear ip bgp (<ipv4>|<interface>) soft + quagga clear ip bgp (<ipv4>|<interface>) soft in + quagga clear ip bgp (<ipv4>|<interface>) soft out + quagga clear ip bgp (<ipv4>|<interface>) vpnv4 unicast in + quagga clear ip bgp (<ipv4>|<interface>) vpnv4 unicast out + quagga clear ip bgp (<ipv4>|<interface>) vpnv4 unicast soft + quagga clear ip bgp (<ipv4>|<interface>) vpnv4 unicast soft in + quagga clear ip bgp (<ipv4>|<interface>) vpnv4 unicast soft out + quagga clear ip bgp (<ipv4>|<ipv6>|<interface>) + quagga clear ip bgp * + quagga clear ip bgp * in + quagga clear ip bgp * in prefix-filter + quagga clear ip bgp * ipv4 (unicast|multicast) in + quagga clear ip bgp * ipv4 (unicast|multicast) in prefix-filter + quagga clear ip bgp * ipv4 (unicast|multicast) out + quagga clear ip bgp * ipv4 (unicast|multicast) soft + quagga clear ip bgp * ipv4 (unicast|multicast) soft in + quagga clear ip bgp * ipv4 (unicast|multicast) soft out + quagga clear ip bgp * out + quagga clear ip bgp * soft + quagga clear ip bgp * soft in + quagga clear ip bgp * soft out + quagga clear ip bgp * vpnv4 unicast in + quagga clear ip bgp * vpnv4 unicast out + quagga clear ip bgp * vpnv4 unicast soft + quagga clear ip bgp * vpnv4 unicast soft in + quagga clear ip bgp * vpnv4 unicast soft out + quagga clear ip bgp <1-4294967295> + quagga clear ip bgp <1-4294967295> in + quagga clear ip bgp <1-4294967295> in prefix-filter + quagga clear ip bgp <1-4294967295> ipv4 (unicast|multicast) in + quagga clear ip bgp <1-4294967295> ipv4 (unicast|multicast) in prefix-filter + quagga clear ip bgp <1-4294967295> ipv4 (unicast|multicast) out + quagga clear ip bgp <1-4294967295> ipv4 (unicast|multicast) soft + quagga clear ip bgp <1-4294967295> ipv4 (unicast|multicast) soft in + quagga clear ip bgp <1-4294967295> ipv4 (unicast|multicast) soft out + quagga clear ip bgp <1-4294967295> out + quagga clear ip bgp <1-4294967295> soft + quagga clear ip bgp <1-4294967295> soft in + quagga clear ip bgp <1-4294967295> soft out + quagga clear ip bgp <1-4294967295> vpnv4 unicast in + quagga clear ip bgp <1-4294967295> vpnv4 unicast out + quagga clear ip bgp <1-4294967295> vpnv4 unicast soft + quagga clear ip bgp <1-4294967295> vpnv4 unicast soft in + quagga clear ip bgp <1-4294967295> vpnv4 unicast soft out + quagga clear ip bgp BGP_INSTANCE_CMD * + quagga clear ip bgp BGP_INSTANCE_CMD * in prefix-filter + quagga clear ip bgp BGP_INSTANCE_CMD * ipv4 (unicast|multicast) in prefix-filter + quagga clear ip bgp BGP_INSTANCE_CMD * ipv4 (unicast|multicast) soft + quagga clear ip bgp BGP_INSTANCE_CMD * ipv4 (unicast|multicast) soft in + quagga clear ip bgp BGP_INSTANCE_CMD * ipv4 (unicast|multicast) soft out + quagga clear ip bgp BGP_INSTANCE_CMD * soft + quagga clear ip bgp BGP_INSTANCE_CMD * soft in + quagga clear ip bgp BGP_INSTANCE_CMD * soft out + quagga clear ip bgp dampening + quagga clear ip bgp dampening <ipv4/prefixlen> + quagga clear ip bgp dampening <ipv4> + quagga clear ip bgp dampening <ipv4> <ipv4> + quagga clear ip bgp external + quagga clear ip bgp external in + quagga clear ip bgp external in prefix-filter + quagga clear ip bgp external ipv4 (unicast|multicast) in + quagga clear ip bgp external ipv4 (unicast|multicast) in prefix-filter + quagga clear ip bgp external ipv4 (unicast|multicast) out + quagga clear ip bgp external ipv4 (unicast|multicast) soft + quagga clear ip bgp external ipv4 (unicast|multicast) soft in + quagga clear ip bgp external ipv4 (unicast|multicast) soft out + quagga clear ip bgp external out + quagga clear ip bgp external soft + quagga clear ip bgp external soft in + quagga clear ip bgp external soft out + quagga clear ip bgp peer-group WORD + quagga clear ip bgp peer-group WORD in + quagga clear ip bgp peer-group WORD in prefix-filter + quagga clear ip bgp peer-group WORD ipv4 (unicast|multicast) in + quagga clear ip bgp peer-group WORD ipv4 (unicast|multicast) in prefix-filter + quagga clear ip bgp peer-group WORD ipv4 (unicast|multicast) out + quagga clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft + quagga clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft in + quagga clear ip bgp peer-group WORD ipv4 (unicast|multicast) soft out + quagga clear ip bgp peer-group WORD out + quagga clear ip bgp peer-group WORD soft + quagga clear ip bgp peer-group WORD soft in + quagga clear ip bgp peer-group WORD soft out + quagga clear ip bgp prefix <ipv4/prefixlen>""".splitlines() + +# All of the debug commands in bgp_debug_ignore will be covered by these debug commands: +# quagga (add|del) debug bgp bestpath <ip/prefixlen> +# quagga (add|del) debug bgp keepalives (<ipv4>|<ipv6>|<interface>) +# quagga (add|del) debug bgp neighbor-events (<ipv4>|<ipv6>|<interface>) +# quagga (add|del) debug bgp nht +# quagga (add|del) debug bgp update-groups +# quagga (add|del) debug bgp updates prefix <ip/prefixlen> +# quagga (add|del) debug bgp zebra prefix <ip/prefixlen> +bgp_debug_ignore = """ quagga debug bgp as4 + quagga debug bgp as4 segment + quagga debug bgp bestpath (<ipv4/prefixlen>|<ipv6/prefixlen>) + quagga debug bgp keepalives + quagga debug bgp keepalives (<ipv4>|<ipv6>|<interface>) + quagga debug bgp neighbor-events + quagga debug bgp neighbor-events (<ipv4>|<ipv6>|<interface>) + quagga debug bgp nht + quagga debug bgp update-groups + quagga debug bgp updates + quagga debug bgp updates (in|out) + quagga debug bgp updates (in|out) (<ipv4>|<ipv6>|<interface>) + quagga debug bgp updates prefix (<ipv4/prefixlen>|<ipv6/prefixlen>) + quagga debug bgp zebra + quagga debug bgp zebra prefix (<ipv4/prefixlen>|<ipv6/prefixlen>)""".splitlines() + + +bgp_show_ignore = """ quagga show bgp (ipv4) (vpnv4) statistics + quagga show bgp (ipv4|ipv6) (unicast|multicast) statistics + quagga show bgp (ipv4|ipv6) (unicast|multicast) update-groups + quagga show bgp (ipv4|ipv6) (unicast|multicast) update-groups (advertise-queue|advertised-routes|packet-queue) + quagga show bgp (ipv4|ipv6) (unicast|multicast) update-groups SUBGROUP-ID + quagga show bgp (ipv4|ipv6) (unicast|multicast) update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue) + quagga show bgp <ipv6/prefixlen> (bestpath|multipath) [json] + quagga show bgp <ipv6/prefixlen> [json] + quagga show bgp <ipv6/prefixlen> longer-prefixes + quagga show bgp <ipv6> (bestpath|multipath) [json] + quagga show bgp <ipv6> [json] + quagga show bgp BGP_INSTANCE_CMD (ipv4) (vpnv4) statistics + quagga show bgp BGP_INSTANCE_CMD (ipv4|ipv6) (unicast|multicast) community + quagga show bgp BGP_INSTANCE_CMD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp BGP_INSTANCE_CMD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp BGP_INSTANCE_CMD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp BGP_INSTANCE_CMD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp BGP_INSTANCE_CMD (ipv4|ipv6) (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) (advertised-routes|received-routes) [json] + quagga show bgp BGP_INSTANCE_CMD (ipv4|ipv6) (unicast|multicast) statistics + quagga show bgp BGP_INSTANCE_CMD <ipv6/prefixlen> (bestpath|multipath) [json] + quagga show bgp BGP_INSTANCE_CMD <ipv6/prefixlen> [json] + quagga show bgp BGP_INSTANCE_CMD <ipv6/prefixlen> longer-prefixes + quagga show bgp BGP_INSTANCE_CMD <ipv6> (bestpath|multipath) [json] + quagga show bgp BGP_INSTANCE_CMD <ipv6> [json] + quagga show bgp BGP_INSTANCE_CMD [json] + quagga show bgp BGP_INSTANCE_CMD community-list (<1-500>|WORD) + quagga show bgp BGP_INSTANCE_CMD filter-list WORD + quagga show bgp BGP_INSTANCE_CMD ipv6 (unicast|multicast) summary [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 <ipv6/prefixlen> (bestpath|multipath) [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 <ipv6/prefixlen> [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 <ipv6/prefixlen> longer-prefixes + quagga show bgp BGP_INSTANCE_CMD ipv6 <ipv6> (bestpath|multipath) [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 <ipv6> [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 community-list (<1-500>|WORD) + quagga show bgp BGP_INSTANCE_CMD ipv6 filter-list WORD + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors (<ipv4>|<ipv6>|<interface>) [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors (<ipv4>|<ipv6>|<interface>) dampened-routes [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors (<ipv4>|<ipv6>|<interface>) flap-statistics [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors (<ipv4>|<ipv6>|<interface>) prefix-counts [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors (<ipv4>|<ipv6>|<interface>) received prefix-filter [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 neighbors [json] + quagga show bgp BGP_INSTANCE_CMD ipv6 prefix-list WORD + quagga show bgp BGP_INSTANCE_CMD ipv6 route-map WORD + quagga show bgp BGP_INSTANCE_CMD ipv6 summary [json] + quagga show bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) [json] + quagga show bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) dampened-routes [json] + quagga show bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) flap-statistics [json] + quagga show bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) received prefix-filter [json] + quagga show bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show bgp BGP_INSTANCE_CMD neighbors [json] + quagga show bgp BGP_INSTANCE_CMD prefix-list WORD + quagga show bgp BGP_INSTANCE_CMD route-map WORD + quagga show bgp BGP_INSTANCE_CMD summary [json] + quagga show bgp BGP_INSTANCE_CMD update-groups + quagga show bgp BGP_INSTANCE_CMD update-groups (advertise-queue|advertised-routes|packet-queue) + quagga show bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID + quagga show bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue) + quagga show bgp [json] + quagga show bgp community + quagga show bgp community (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show bgp community (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show bgp community-list (<1-500>|WORD) + quagga show bgp community-list (<1-500>|WORD) exact-match + quagga show bgp filter-list WORD + quagga show bgp ipv4 (unicast|multicast) <ipv4/prefixlen> (bestpath|multipath) [json] + quagga show bgp ipv4 (unicast|multicast) <ipv4/prefixlen> [json] + quagga show bgp ipv4 (unicast|multicast) <ipv4> (bestpath|multipath) [json] + quagga show bgp ipv4 (unicast|multicast) <ipv4> [json] + quagga show bgp ipv4 (unicast|multicast) [json] + quagga show bgp ipv4 (unicast|multicast) summary [json] + quagga show bgp ipv6 (unicast|multicast) <ipv6/prefixlen> (bestpath|multipath) [json] + quagga show bgp ipv6 (unicast|multicast) <ipv6/prefixlen> [json] + quagga show bgp ipv6 (unicast|multicast) <ipv6> (bestpath|multipath) [json] + quagga show bgp ipv6 (unicast|multicast) <ipv6> [json] + quagga show bgp ipv6 (unicast|multicast) [json] + quagga show bgp ipv6 (unicast|multicast) summary [json] + quagga show bgp ipv6 <ipv6/prefixlen> (bestpath|multipath) [json] + quagga show bgp ipv6 <ipv6/prefixlen> [json] + quagga show bgp ipv6 <ipv6/prefixlen> longer-prefixes + quagga show bgp ipv6 <ipv6> (bestpath|multipath) [json] + quagga show bgp ipv6 <ipv6> [json] + quagga show bgp ipv6 [json] + quagga show bgp ipv6 community + quagga show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show bgp ipv6 community (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show bgp ipv6 community-list (<1-500>|WORD) + quagga show bgp ipv6 community-list (<1-500>|WORD) exact-match + quagga show bgp ipv6 filter-list WORD + quagga show bgp ipv6 neighbors (<ipv4>|<ipv6>|<interface>) [json] + quagga show bgp ipv6 neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show bgp ipv6 neighbors (<ipv4>|<ipv6>|<interface>) dampened-routes [json] + quagga show bgp ipv6 neighbors (<ipv4>|<ipv6>|<interface>) flap-statistics [json] + quagga show bgp ipv6 neighbors (<ipv4>|<ipv6>|<interface>) prefix-counts [json] + quagga show bgp ipv6 neighbors (<ipv4>|<ipv6>|<interface>) received prefix-filter [json] + quagga show bgp ipv6 neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show bgp ipv6 neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show bgp ipv6 neighbors [json] + quagga show bgp ipv6 prefix-list WORD + quagga show bgp ipv6 regexp LINE + quagga show bgp ipv6 route-map WORD + quagga show bgp ipv6 summary [json] + quagga show bgp memory + quagga show bgp neighbors (<ipv4>|<ipv6>|<interface>) [json] + quagga show bgp neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show bgp neighbors (<ipv4>|<ipv6>|<interface>) dampened-routes [json] + quagga show bgp neighbors (<ipv4>|<ipv6>|<interface>) flap-statistics [json] + quagga show bgp neighbors (<ipv4>|<ipv6>|<interface>) received prefix-filter [json] + quagga show bgp neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show bgp neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show bgp neighbors [json] + quagga show bgp prefix-list WORD + quagga show bgp regexp LINE + quagga show bgp route-map WORD + quagga show bgp summary [json] + quagga show bgp update-groups + quagga show bgp update-groups (advertise-queue|advertised-routes|packet-queue) + quagga show bgp update-groups SUBGROUP-ID + quagga show bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue) + quagga show bgp view WORD ipv4 (unicast|multicast) summary [json] + quagga show bgp views + quagga show bgp vrfs [json] + quagga show debugging bgp + quagga show ip as-path-access-list + quagga show ip as-path-access-list WORD + quagga show ip bgp <ipv4/prefixlen> (bestpath|multipath) [json] + quagga show ip bgp <ipv4/prefixlen> [json] + quagga show ip bgp <ipv4/prefixlen> longer-prefixes + quagga show ip bgp <ipv4> (bestpath|multipath) [json] + quagga show ip bgp <ipv4> [json] + quagga show ip bgp BGP_INSTANCE_CMD <ipv4/prefixlen> (bestpath|multipath) [json] + quagga show ip bgp BGP_INSTANCE_CMD <ipv4/prefixlen> [json] + quagga show ip bgp BGP_INSTANCE_CMD <ipv4/prefixlen> longer-prefixes + quagga show ip bgp BGP_INSTANCE_CMD <ipv4> (bestpath|multipath) [json] + quagga show ip bgp BGP_INSTANCE_CMD <ipv4> [json] + quagga show ip bgp BGP_INSTANCE_CMD [json] + quagga show ip bgp BGP_INSTANCE_CMD community-list (<1-500>|WORD) + quagga show ip bgp BGP_INSTANCE_CMD filter-list WORD + quagga show ip bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) [json] + quagga show ip bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show ip bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes route-map WORD [json] + quagga show ip bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) prefix-counts [json] + quagga show ip bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show ip bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) received-routes route-map WORD [json] + quagga show ip bgp BGP_INSTANCE_CMD neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show ip bgp BGP_INSTANCE_CMD neighbors [json] + quagga show ip bgp BGP_INSTANCE_CMD nexthop + quagga show ip bgp BGP_INSTANCE_CMD nexthop detail + quagga show ip bgp BGP_INSTANCE_CMD peer-group + quagga show ip bgp BGP_INSTANCE_CMD peer-group WORD + quagga show ip bgp BGP_INSTANCE_CMD prefix-list WORD + quagga show ip bgp BGP_INSTANCE_CMD route-map WORD + quagga show ip bgp BGP_INSTANCE_CMD summary [json] + quagga show ip bgp BGP_INSTANCE_CMD update-groups + quagga show ip bgp BGP_INSTANCE_CMD update-groups (advertise-queue|advertised-routes|packet-queue) + quagga show ip bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID + quagga show ip bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue) + quagga show ip bgp [json] + quagga show ip bgp attribute-info + quagga show ip bgp cidr-only + quagga show ip bgp community + quagga show ip bgp community (AA:NN|local-AS|no-advertise|no-export) + quagga show ip bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ip bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ip bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ip bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ip bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ip bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ip bgp community (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ip bgp community-info + quagga show ip bgp community-list (<1-500>|WORD) + quagga show ip bgp community-list (<1-500>|WORD) exact-match + quagga show ip bgp dampened-paths + quagga show ip bgp filter-list WORD + quagga show ip bgp flap-statistics + quagga show ip bgp flap-statistics <ipv4/prefixlen> + quagga show ip bgp flap-statistics <ipv4/prefixlen> longer-prefixes + quagga show ip bgp flap-statistics <ipv4> + quagga show ip bgp flap-statistics cidr-only + quagga show ip bgp flap-statistics filter-list WORD + quagga show ip bgp flap-statistics prefix-list WORD + quagga show ip bgp flap-statistics regexp LINE + quagga show ip bgp flap-statistics route-map WORD + quagga show ip bgp ipv4 (unicast|multicast) <ipv4/prefixlen> (bestpath|multipath) [json] + quagga show ip bgp ipv4 (unicast|multicast) <ipv4/prefixlen> [json] + quagga show ip bgp ipv4 (unicast|multicast) <ipv4/prefixlen> longer-prefixes + quagga show ip bgp ipv4 (unicast|multicast) <ipv4> [json] + quagga show ip bgp ipv4 (unicast|multicast) [json] + quagga show ip bgp ipv4 (unicast|multicast) cidr-only + quagga show ip bgp ipv4 (unicast|multicast) community + quagga show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) + quagga show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ip bgp ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ip bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD) + quagga show ip bgp ipv4 (unicast|multicast) community-list (<1-500>|WORD) exact-match + quagga show ip bgp ipv4 (unicast|multicast) filter-list WORD + quagga show ip bgp ipv4 (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) [json] + quagga show ip bgp ipv4 (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show ip bgp ipv4 (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes route-map WORD [json] + quagga show ip bgp ipv4 (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) prefix-counts [json] + quagga show ip bgp ipv4 (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) received prefix-filter [json] + quagga show ip bgp ipv4 (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show ip bgp ipv4 (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) received-routes route-map WORD [json] + quagga show ip bgp ipv4 (unicast|multicast) neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show ip bgp ipv4 (unicast|multicast) neighbors [json] + quagga show ip bgp ipv4 (unicast|multicast) paths + quagga show ip bgp ipv4 (unicast|multicast) prefix-list WORD + quagga show ip bgp ipv4 (unicast|multicast) regexp LINE + quagga show ip bgp ipv4 (unicast|multicast) route-map WORD + quagga show ip bgp ipv4 (unicast|multicast) summary [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes route-map WORD [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) dampened-routes [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) flap-statistics [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) prefix-counts [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) received prefix-filter [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) received-routes route-map WORD [json] + quagga show ip bgp neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show ip bgp neighbors [json] + quagga show ip bgp nexthop + quagga show ip bgp nexthop detail + quagga show ip bgp paths + quagga show ip bgp peer-group + quagga show ip bgp peer-group WORD + quagga show ip bgp prefix-list WORD + quagga show ip bgp regexp LINE + quagga show ip bgp route-map WORD + quagga show ip bgp summary [json] + quagga show ip bgp update-groups + quagga show ip bgp update-groups (advertise-queue|advertised-routes|packet-queue) + quagga show ip bgp update-groups SUBGROUP-ID + quagga show ip bgp update-groups SUBGROUP-ID (advertise-queue|advertised-routes|packet-queue) + quagga show ip bgp view WORD ipv4 (unicast|multicast) summary [json] + quagga show ip bgp vpnv4 all + quagga show ip bgp vpnv4 all <ipv4/prefixlen> [json] + quagga show ip bgp vpnv4 all <ipv4> [json] + quagga show ip bgp vpnv4 all neighbors (<ipv4>|<ipv6>|<interface>) prefix-counts [json] + quagga show ip bgp vpnv4 all neighbors <ipv4> [json] + quagga show ip bgp vpnv4 all neighbors <ipv4> advertised-routes [json] + quagga show ip bgp vpnv4 all neighbors <ipv4> routes [json] + quagga show ip bgp vpnv4 all neighbors [json] + quagga show ip bgp vpnv4 all summary [json] + quagga show ip bgp vpnv4 all tags + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn <ipv4/prefixlen> [json] + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn <ipv4> [json] + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors <ipv4> [json] + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors <ipv4> advertised-routes [json] + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors <ipv4> routes [json] + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors [json] + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn summary [json] + quagga show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn tags + quagga show ip community-list + quagga show ip community-list (<1-500>|WORD) + quagga show ip extcommunity-list + quagga show ip extcommunity-list (<1-500>|WORD) + quagga show ipv6 bgp <ipv6/prefixlen> [json] + quagga show ipv6 bgp <ipv6/prefixlen> longer-prefixes + quagga show ipv6 bgp <ipv6> [json] + quagga show ipv6 bgp [json] + quagga show ipv6 bgp community + quagga show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) + quagga show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ipv6 bgp community (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ipv6 bgp community-list WORD + quagga show ipv6 bgp community-list WORD exact-match + quagga show ipv6 bgp filter-list WORD + quagga show ipv6 bgp neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show ipv6 bgp neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show ipv6 bgp neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show ipv6 bgp prefix-list WORD + quagga show ipv6 bgp regexp LINE + quagga show ipv6 bgp summary [json] + quagga show ipv6 mbgp <ipv6/prefixlen> [json] + quagga show ipv6 mbgp <ipv6/prefixlen> longer-prefixes + quagga show ipv6 mbgp <ipv6> [json] + quagga show ipv6 mbgp [json] + quagga show ipv6 mbgp community + quagga show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) + quagga show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) + quagga show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ipv6 mbgp community (AA:NN|local-AS|no-advertise|no-export) exact-match + quagga show ipv6 mbgp community-list WORD + quagga show ipv6 mbgp community-list WORD exact-match + quagga show ipv6 mbgp filter-list WORD + quagga show ipv6 mbgp neighbors (<ipv4>|<ipv6>|<interface>) advertised-routes [json] + quagga show ipv6 mbgp neighbors (<ipv4>|<ipv6>|<interface>) received-routes [json] + quagga show ipv6 mbgp neighbors (<ipv4>|<ipv6>|<interface>) routes [json] + quagga show ipv6 mbgp prefix-list WORD + quagga show ipv6 mbgp regexp LINE + quagga show ipv6 mbgp summary [json]""".splitlines() + +bgp_config_ignore = """ quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) activate + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) addpath-tx-all-paths + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) addpath-tx-bestpath-per-AS + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) allowas-in + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) allowas-in <1-10> + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) as-override + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged (as-path|next-hop|med) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged as-path (next-hop|med) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged as-path med next-hop + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged as-path next-hop med + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged med (as-path|next-hop) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged med as-path next-hop + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged med next-hop as-path + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged next-hop (as-path|med) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged next-hop as-path med + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) attribute-unchanged next-hop med as-path + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) capability orf prefix-list (both|send|receive) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) default-originate + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) default-originate route-map WORD + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) distribute-list (<1-199>|<1300-2699>|WORD) (in|out) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) filter-list WORD (in|out) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) maximum-prefix <1-4294967295> + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) maximum-prefix <1-4294967295> <1-100> + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) maximum-prefix <1-4294967295> <1-100> restart <1-65535> + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) maximum-prefix <1-4294967295> <1-100> warning-only + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) maximum-prefix <1-4294967295> restart <1-65535> + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) maximum-prefix <1-4294967295> warning-only + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) next-hop-self + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) next-hop-self force + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) peer-group WORD + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) prefix-list WORD (in|out) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) remove-private-AS + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) remove-private-AS all + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) remove-private-AS all replace-AS + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) remove-private-AS replace-AS + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) route-map WORD (in|out) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) route-reflector-client + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) route-server-client + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) send-community + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) send-community (both|extended|standard) + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) soft-reconfiguration inbound + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ipv4>|<ipv6>|<interface>) unsuppress-map WORD + quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] table-map WORD + quagga (add|del) bgp [ipv4|ipv6] unicast maximum-paths <1-255> + quagga (add|del) bgp [ipv4|ipv6] unicast maximum-paths ibgp <1-255> + quagga (add|del) bgp [ipv4|ipv6] unicast maximum-paths ibgp <1-255> equal-cluster-length + quagga (add|del) bgp always-compare-med + quagga (add|del) bgp bestpath as-path confed + quagga (add|del) bgp bestpath as-path ignore + quagga (add|del) bgp bestpath as-path multipath-relax [as-set|no-as-set] + quagga (add|del) bgp bestpath compare-routerid + quagga (add|del) bgp bestpath med (confed|missing-as-worst) + quagga (add|del) bgp bestpath med confed missing-as-worst + quagga (add|del) bgp bestpath med missing-as-worst confed + quagga (add|del) bgp client-to-client reflection + quagga (add|del) bgp cluster-id <1-4294967295> + quagga (add|del) bgp cluster-id <ipv4> + quagga (add|del) bgp confederation identifier <1-4294967295> + quagga (add|del) bgp confederation peers . <1-4294967295> + quagga (add|del) bgp default ipv4-unicast + quagga (add|del) bgp default local-preference <0-4294967295> + quagga (add|del) bgp default show-hostname + quagga (add|del) bgp default subgroup-pkt-queue-max <20-100> + quagga (add|del) bgp deterministic-med + quagga (add|del) bgp disable-ebgp-connected-route-check + quagga (add|del) bgp enforce-first-as + quagga (add|del) bgp fast-external-failover + quagga (add|del) bgp graceful-restart + quagga (add|del) bgp graceful-restart stalepath-time <1-3600> + quagga (add|del) bgp listen limit <1-5000> + quagga (add|del) bgp listen range (<ipv4/prefixlen>|<ipv6/prefixlen>) peer-group WORD + quagga (add|del) bgp log-neighbor-changes + quagga (add|del) bgp max-med administrative + quagga (add|del) bgp max-med administrative <0-4294967294> + quagga (add|del) bgp max-med on-startup <5-86400> + quagga (add|del) bgp max-med on-startup <5-86400> <0-4294967294> + quagga (add|del) bgp network import-check + quagga (add|del) bgp route-map delay-timer <0-600> + quagga (add|del) bgp route-reflector allow-outbound-policy + quagga (add|del) bgp router-id <ipv4> + quagga (add|del) bgp coalesce-time <0-4294967295> + quagga (add|del) bgp distance <1-255> <ipv4/prefixlen> + quagga (add|del) bgp distance <1-255> <ipv4/prefixlen> WORD + quagga (add|del) bgp distance bgp <1-255> <1-255> <1-255> + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4/prefixlen> + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4/prefixlen> as-set + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4/prefixlen> as-set summary-only + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4/prefixlen> summary-only + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4/prefixlen> summary-only as-set + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4> <ipv4> + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4> <ipv4> as-set + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4> <ipv4> as-set summary-only + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4> <ipv4> summary-only + quagga (add|del) bgp ipv4 [unicast|multicast] aggregate-address <ipv4> <ipv4> summary-only as-set + quagga (add|del) bgp ipv4 [unicast|multicast] network <ipv4/prefixlen> + quagga (add|del) bgp ipv4 [unicast|multicast] network <ipv4/prefixlen> route-map WORD + quagga (add|del) bgp ipv4 [unicast|multicast] network <ipv4> + quagga (add|del) bgp ipv4 [unicast|multicast] network <ipv4> prefixlen <ipv4> + quagga (add|del) bgp ipv4 [unicast|multicast] network <ipv4> prefixlen <ipv4> route-map WORD + quagga (add|del) bgp ipv4 [unicast|multicast] network <ipv4> route-map WORD + quagga (add|del) bgp ipv4 unicast bgp dampening + quagga (add|del) bgp ipv4 unicast bgp dampening <1-45> + quagga (add|del) bgp ipv4 unicast bgp dampening <1-45> <1-20000> <1-20000> <1-255> + quagga (add|del) bgp ipv4 unicast redistribute (kernel|connected|static|rip|ospf|isis) + quagga (add|del) bgp ipv4 unicast redistribute (kernel|connected|static|rip|ospf|isis) metric <0-4294967295> + quagga (add|del) bgp ipv4 unicast redistribute (kernel|connected|static|rip|ospf|isis) metric <0-4294967295> route-map WORD + quagga (add|del) bgp ipv4 unicast redistribute (kernel|connected|static|rip|ospf|isis) route-map WORD + quagga (add|del) bgp ipv4 unicast redistribute (kernel|connected|static|rip|ospf|isis) route-map WORD metric <0-4294967295> + quagga (add|del) bgp ipv4 unicast redistribute (ospf|table) <1-65535> + quagga (add|del) bgp ipv4 unicast redistribute (ospf|table) <1-65535> metric <0-4294967295> + quagga (add|del) bgp ipv4 unicast redistribute (ospf|table) <1-65535> metric <0-4294967295> route-map WORD + quagga (add|del) bgp ipv4 unicast redistribute (ospf|table) <1-65535> route-map WORD + quagga (add|del) bgp ipv4 unicast redistribute (ospf|table) <1-65535> route-map WORD metric <0-4294967295> + quagga (add|del) bgp ipv6 [unicast|multicast] network <ipv6/prefixlen> + quagga (add|del) bgp ipv6 bgp aggregate-address <ipv6/prefixlen> + quagga (add|del) bgp ipv6 bgp aggregate-address <ipv6/prefixlen> summary-only + quagga (add|del) bgp ipv6 bgp network <ipv6/prefixlen> + quagga (add|del) bgp ipv6 unicast aggregate-address <ipv6/prefixlen> + quagga (add|del) bgp ipv6 unicast aggregate-address <ipv6/prefixlen> summary-only + quagga (add|del) bgp ipv6 unicast neighbor (<ipv4>|<ipv6>|<interface>) nexthop-local unchanged + quagga (add|del) bgp ipv6 unicast network <ipv6/prefixlen> route-map WORD + quagga (add|del) bgp ipv6 unicast redistribute (kernel|connected|static|ripng|ospf6|isis) + quagga (add|del) bgp ipv6 unicast redistribute (kernel|connected|static|ripng|ospf6|isis) metric <0-4294967295> + quagga (add|del) bgp ipv6 unicast redistribute (kernel|connected|static|ripng|ospf6|isis) metric <0-4294967295> route-map WORD + quagga (add|del) bgp ipv6 unicast redistribute (kernel|connected|static|ripng|ospf6|isis) route-map WORD + quagga (add|del) bgp ipv6 unicast redistribute (kernel|connected|static|ripng|ospf6|isis) route-map WORD metric <0-4294967295> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>) interface WORD + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>) port <0-65535> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>) strict-capability-match + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) advertisement-interval <0-600> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) bfd + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) bfd <2-255> BFD_CMD_MIN_RX_RANGE <50-60000> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) capability dynamic + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) capability extended-nexthop + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) description LINE + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) disable-connected-check + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) dont-capability-negotiate + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) ebgp-multihop + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) ebgp-multihop <1-255> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) enforce-multihop + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) local-as <1-4294967295> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) local-as <1-4294967295> no-prepend + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) local-as <1-4294967295> no-prepend replace-as + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) override-capability + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) passive + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) password LINE + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) remote-as (<1-4294967295>|external|internal) + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) shutdown + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) solo + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) timers <0-65535> <0-65535> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) timers connect <1-65535> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) ttl-security hops <1-254> + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) update-source (<ipv4>|<ipv6>|<interface>) + quagga (add|del) bgp neighbor (<ipv4>|<ipv6>|<interface>) weight <0-65535> + quagga (add|del) bgp neighbor WORD interface + quagga (add|del) bgp neighbor WORD interface peer-group WORD + quagga (add|del) bgp neighbor WORD interface v6only + quagga (add|del) bgp neighbor WORD interface v6only peer-group WORD + quagga (add|del) bgp neighbor WORD peer-group + quagga (add|del) bgp network <ipv4/prefixlen> backdoor + quagga (add|del) bgp network <ipv4> backdoor + quagga (add|del) bgp network <ipv4> prefixlen <ipv4> backdoor + quagga (add|del) bgp timers bgp <0-65535> <0-65535> + quagga (add|del) bgp update-delay <0-3600> + quagga (add|del) bgp update-delay <0-3600> <1-3600> + quagga (add|del) bgp write-quanta <1-10000>""".splitlines() + +ospf_clear_ignore = [" quagga clear ip ospf interface [IFNAME]", ] + +ospf_debug_ignore = """ quagga debug ospf <1-65535> event + quagga debug ospf <1-65535> ism + quagga debug ospf <1-65535> ism (status|events|timers) + quagga debug ospf <1-65535> lsa + quagga debug ospf <1-65535> lsa (generate|flooding|install|refresh) + quagga debug ospf <1-65535> nsm + quagga debug ospf <1-65535> nsm (status|events|timers) + quagga debug ospf <1-65535> nssa + quagga debug ospf <1-65535> packet (hello|dd|ls-request|ls-update|ls-ack|all) + quagga debug ospf <1-65535> packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) (detail|) + quagga debug ospf <1-65535> packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv|detail) + quagga debug ospf <1-65535> zebra + quagga debug ospf <1-65535> zebra (interface|redistribute) + quagga debug ospf event + quagga debug ospf ism + quagga debug ospf ism (status|events|timers) + quagga debug ospf lsa + quagga debug ospf lsa (generate|flooding|install|refresh) + quagga debug ospf nsm + quagga debug ospf nsm (status|events|timers) + quagga debug ospf nssa + quagga debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) + quagga debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) (detail|) + quagga debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv|detail) + quagga debug ospf zebra + quagga debug ospf zebra (interface|redistribute)""".splitlines() + +ospf_show_ignore = """ quagga show debugging ospf + quagga show debugging ospf <1-65535> + quagga show ip ospf <1-65535> [json] + quagga show ip ospf <1-65535> border-routers + quagga show ip ospf <1-65535> database + quagga show ip ospf <1-65535> database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) (self-originate|) + quagga show ip ospf <1-65535> database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) <ipv4> + quagga show ip ospf <1-65535> database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) <ipv4> (self-originate|) + quagga show ip ospf <1-65535> database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) <ipv4> adv-router <ipv4> + quagga show ip ospf <1-65535> database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) adv-router <ipv4> + quagga show ip ospf <1-65535> database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as|max-age|self-originate) + quagga show ip ospf <1-65535> interface [INTERFACE] [json] + quagga show ip ospf <1-65535> neighbor <ipv4> [json] + quagga show ip ospf <1-65535> neighbor IFNAME [json] + quagga show ip ospf <1-65535> neighbor IFNAME detail [json] + quagga show ip ospf <1-65535> neighbor [json] + quagga show ip ospf <1-65535> neighbor all [json] + quagga show ip ospf <1-65535> neighbor detail [json] + quagga show ip ospf <1-65535> neighbor detail all [json] + quagga show ip ospf <1-65535> route + quagga show ip ospf [json] + quagga show ip ospf border-routers + quagga show ip ospf database + quagga show ip ospf database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) (self-originate|) + quagga show ip ospf database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) <ipv4> + quagga show ip ospf database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) <ipv4> (self-originate|) + quagga show ip ospf database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) <ipv4> adv-router <ipv4> + quagga show ip ospf database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as) adv-router <ipv4> + quagga show ip ospf database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as|max-age|self-originate) + quagga show ip ospf interface [INTERFACE] [json] + quagga show ip ospf neighbor <ipv4> [json] + quagga show ip ospf neighbor IFNAME [json] + quagga show ip ospf neighbor IFNAME detail [json] + quagga show ip ospf neighbor [json] + quagga show ip ospf neighbor all [json] + quagga show ip ospf neighbor detail [json] + quagga show ip ospf neighbor detail all [json] + quagga show ip ospf route + quagga show mpls-te interface [INTERFACE] + quagga show mpls-te router""".splitlines() + +ospf_config_ignore = """ quagga (add|del) <interface> ip ospf <1-65535> area (<ipv4>|<0-4294967295>) + quagga (add|del) <interface> ip ospf area (<ipv4>|<0-4294967295>) + quagga (add|del) <interface> ip ospf authentication + quagga (add|del) <interface> ip ospf authentication (null|message-digest) + quagga (add|del) <interface> ip ospf authentication (null|message-digest) <ipv4> + quagga (add|del) <interface> ip ospf authentication <ipv4> + quagga (add|del) <interface> ip ospf authentication-key AUTH_KEY + quagga (add|del) <interface> ip ospf authentication-key AUTH_KEY <ipv4> + quagga (add|del) <interface> ip ospf bfd + quagga (add|del) <interface> ip ospf bfd <2-255> BFD_CMD_MIN_RX_RANGE <50-60000> + quagga (add|del) <interface> ip ospf cost <1-65535> + quagga (add|del) <interface> ip ospf cost <1-65535> <ipv4> + quagga (add|del) <interface> ip ospf dead-interval <1-65535> + quagga (add|del) <interface> ip ospf dead-interval <1-65535> <ipv4> + quagga (add|del) <interface> ip ospf dead-interval minimal hello-multiplier <1-10> + quagga (add|del) <interface> ip ospf dead-interval minimal hello-multiplier <1-10> <ipv4> + quagga (add|del) <interface> ip ospf hello-interval <1-65535> + quagga (add|del) <interface> ip ospf hello-interval <1-65535> <ipv4> + quagga (add|del) <interface> ip ospf message-digest-key <1-255> md5 KEY + quagga (add|del) <interface> ip ospf message-digest-key <1-255> md5 KEY <ipv4> + quagga (add|del) <interface> ip ospf mtu-ignore + quagga (add|del) <interface> ip ospf mtu-ignore <ipv4> + quagga (add|del) <interface> ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point) + quagga (add|del) <interface> ip ospf priority <0-255> + quagga (add|del) <interface> ip ospf priority <0-255> <ipv4> + quagga (add|del) <interface> ip ospf retransmit-interval <3-65535> + quagga (add|del) <interface> ip ospf retransmit-interval <3-65535> <ipv4> + quagga (add|del) <interface> ip ospf transmit-delay <1-65535> + quagga (add|del) <interface> ip ospf transmit-delay <1-65535> <ipv4> + quagga (add|del) <interface> mpls-te link max-bw BANDWIDTH + quagga (add|del) <interface> mpls-te link max-rsv-bw BANDWIDTH + quagga (add|del) <interface> mpls-te link metric <0-4294967295> + quagga (add|del) <interface> mpls-te link rsc-clsclr BITPATTERN + quagga (add|del) <interface> mpls-te link unrsv-bw <0-7> BANDWIDTH + quagga (add|del) ospf abr-type (cisco|ibm|shortcut|standard) + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) authentication + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) authentication message-digest + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) default-cost <0-16777215> + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) export-list NAME + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) filter-list prefix WORD (in|out) + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) import-list NAME + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) nssa + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) nssa (translate-candidate|translate-never|translate-always) + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) nssa (translate-candidate|translate-never|translate-always) no-summary + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) nssa no-summary + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) range <ipv4/prefixlen> + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) range <ipv4/prefixlen> advertise + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) range <ipv4/prefixlen> advertise cost <0-16777215> + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) range <ipv4/prefixlen> cost <0-16777215> + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) range <ipv4/prefixlen> not-advertise + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) range <ipv4/prefixlen> substitute <ipv4/prefixlen> + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) shortcut (default|enable|disable) + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) stub + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) stub no-summary + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) virtual-link <ipv4> + quagga (add|del) ospf area (<ipv4>|<0-4294967295>) virtual-link <ipv4> + quagga (add|del) ospf auto-cost reference-bandwidth <1-4294967> + quagga (add|del) ospf capability opaque + quagga (add|del) ospf compatible rfc1583 + quagga (add|del) ospf default-information originate + quagga (add|del) ospf default-metric <0-16777214> + quagga (add|del) ospf distance <1-255> + quagga (add|del) ospf distance <1-255> <ipv4/prefixlen> + quagga (add|del) ospf distance <1-255> <ipv4/prefixlen> WORD + quagga (add|del) ospf distance ospf + quagga (add|del) ospf distribute-list WORD out QUAGGA_REDIST_STR_OSPFD + quagga (add|del) ospf log-adjacency-changes + quagga (add|del) ospf log-adjacency-changes detail + quagga (add|del) ospf max-metric router-lsa administrative + quagga (add|del) ospf max-metric router-lsa on-shutdown <5-100> + quagga (add|del) ospf max-metric router-lsa on-startup <5-86400> + quagga (add|del) ospf mpls-te + quagga (add|del) ospf mpls-te on + quagga (add|del) ospf mpls-te router-address <ipv4> + quagga (add|del) ospf neighbor <ipv4> + quagga (add|del) ospf neighbor <ipv4> poll-interval <1-65535> + quagga (add|del) ospf neighbor <ipv4> poll-interval <1-65535> priority <0-255> + quagga (add|del) ospf neighbor <ipv4> priority <0-255> + quagga (add|del) ospf neighbor <ipv4> priority <0-255> poll-interval <1-65535> + quagga (add|del) ospf network <ipv4/prefixlen> area (<ipv4>|<0-4294967295>) + quagga (add|del) ospf opaque-lsa + quagga (add|del) ospf passive-interface IFNAME + quagga (add|del) ospf passive-interface IFNAME <ipv4> + quagga (add|del) ospf passive-interface default + quagga (add|del) ospf redistribute (ospf|table) <1-65535> + quagga (add|del) ospf redistribute QUAGGA_REDIST_STR_OSPFD + quagga (add|del) ospf rfc1583compatibility + quagga (add|del) ospf router-id <ipv4> + quagga (add|del) ospf timers lsa arrival <0-1000> + quagga (add|del) ospf timers lsa min-arrival <0-600000> + quagga (add|del) ospf timers throttle lsa all <0-5000> + quagga (add|del) ospf timers throttle spf <0-600000> <0-600000> <0-600000> + quagga (add|del) ospf write-multiplier <1-100> + quagga (add|del) ospf write-multiplier <1-100>""".splitlines() + +def replace_constants(line): + line = line.replace('NO_NEIGHBOR_CMD2', 'no neighbor (A.B.C.D|X:X::X:X|WORD) ') + line = line.replace('NEIGHBOR_CMD2', 'neighbor (A.B.C.D|X:X::X:X|WORD) ') + line = line.replace('NO_NEIGHBOR_CMD', 'no neighbor (A.B.C.D|X:X::X:X) ') + line = line.replace('NEIGHBOR_CMD', 'neighbor (A.B.C.D|X:X::X:X) ') + line = line.replace('CMD_AS_RANGE', '<1-4294967295>') + line = line.replace('LISTEN_RANGE_CMD', 'bgp listen range (A.B.C.D/M|X:X::X:X/M) ') + line = line.replace('DYNAMIC_NEIGHBOR_LIMIT_RANGE', '<1-5000>') + line = line.replace('QUAGGA_IP_REDIST_STR_BGPD', '(kernel|connected|static|rip|ospf|isis)') + line = line.replace('QUAGGA_IP6_REDIST_STR_BGPD', '(kernel|connected|static|ripng|ospf6|isis)') + line = line.replace('QUAGGA_IP6_REDIST_STR_ZEBRA', '(kernel|connected|static|ripng|ospf6|isis|bgp)') + line = line.replace('QUAGGA_IP_REDIST_STR_ZEBRA', '(kernel|connected|static|rip|ospf|isis|bgp)') + line = line.replace('OSPF_LSA_TYPES_CMD_STR', 'asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as') + line = line.replace('CMD_RANGE_STR(1, MULTIPATH_NUM)', '<1-255>') + line = line.replace('CMD_RANGE_STR(1, MAXTTL)', '<1-255>') + line = line.replace('BFD_CMD_DETECT_MULT_RANGE', '<2-255>') + line = line.replace('BFD_CMD_MIN_TX_RANGE', '<50-60000>') + line = line.replace('BGP_UPDATE_SOURCE_REQ_STR', '(A.B.C.D|X:X::X:X|WORD)') + line = line.replace('BGP_UPDATE_SOURCE_OPT_STR', '{A.B.C.D|X:X::X:X|WORD}') + line = line.replace('.LINE', 'LINE') + line = line.replace('.AA:NN', 'AA:NN') + # line = line.replace('', '') + return line + + +ignore = {} +ignore['bgpd'] = [] +ignore['bgpd'].append('address-family ipv4') +ignore['bgpd'].append('address-family ipv4 (unicast|multicast)') +ignore['bgpd'].append('address-family ipv6') +ignore['bgpd'].append('address-family ipv6 (unicast|multicast)') +ignore['bgpd'].append('address-family vpnv4') +ignore['bgpd'].append('address-family vpnv4 unicast') +ignore['bgpd'].append('exit-address-family') + +ignore['ospfd'] = [] + + +class Command(object): + + def __init__(self, defun, text, line_number): + self.defun = defun + self.text = text + self.line_number = line_number + self.context = [] + self.docstring = None + + def __str__(self): + return "%s - %s" % (self.context, self.text) + + def set_docstring(self): + ds = self.text + + if self.text in ignore['bgpd']: + return None + + # For these two WORD means an interface name + ds = ds.replace('A.B.C.D|X:X::X:X|WORD', '<ipv4>|<ipv6>|<interface>') + ds = ds.replace('A.B.C.D|WORD', '<ipv4>|<interface>') + + ds = ds.replace('A.B.C.D/M', '<ipv4/prefixlen>') + ds = ds.replace('A.B.C.D', '<ipv4>') + ds = ds.replace('X:X::X:X/M', '<ipv6/prefixlen>') + ds = ds.replace('X:X::X:X', '<ipv6>') + ds = ds.replace('{json}', '[json]') + ds = ds.replace('{', '[') + ds = ds.replace('}', ']') + ds = ds.replace(' PATH ', ' <text> ') + + afis = [] + safis = [] + + if 'BGP_IPV4_NODE' in self.context: + afis.append('ipv4') + safis.append('unicast') + + if 'BGP_IPV4M_NODE' in self.context: + afis.append('ipv4') + safis.append('multicast') + + if 'BGP_IPV6_NODE' in self.context: + afis.append('ipv6') + safis.append('unicast') + + if 'BGP_IPV6M_NODE' in self.context: + afis.append('ipv6') + safis.append('multicast') + + afis = list(set(afis)) + safis = list(set(safis)) + + # clear, debug, show, etc + if 'ENABLE_NODE' in self.context: + pass + + # config command so need to add (add|del) and maybe afi/safi + else: + if afis: + if len(afis) > 1: + afi_string = "[%s]" % '|'.join(afis) + else: + afi_string = afis[0] + + if len(safis) > 1: + safi_string = "[%s]" % '|'.join(safis) + else: + safi_string = safis[0] + + ds = "(add|del) bgp %s %s " % (afi_string, safi_string) + ds + + elif 'BGP_NODE' in self.context: + if ds.startswith('bgp'): + ds = "(add|del) " + ds + else: + ds = "(add|del) bgp " + ds + + elif 'INTERFACE_NODE' in self.context: + ds = "(add|del) <interface> " + ds + + elif 'OSPF_NODE' in self.context: + if ds.startswith('ospf'): + ds = "(add|del) " + ds + else: + ds = "(add|del) ospf " + ds + + # Ignore the route-map commands, ip community-list, etc for now + else: + ds = None + + if ds: + ds = ds.rstrip() + self.docstring = ' quagga ' + ds + + +if __name__ == '__main__': + + parser = argparse.ArgumentParser(description='Parse the quagga parser') + parser.add_argument('directory', help='quagga directory') + parser.add_argument('daemon', help='bgpd, ospfd, etc') + parser.add_argument('--print-quagga', action='store_true', help='print the raw quagga commands') + parser.add_argument('--print-docstring', action='store_true', help='print a docstring for network-docopt') + parser.add_argument('--print-context', action='store_true', help='print quagga commands with their context') + args = parser.parse_args() + + logging.basicConfig(level=logging.INFO, + format='%(asctime)s %(levelname)7s: %(message)s') + log = logging.getLogger(__name__) + + # Color the errors and warnings in red + logging.addLevelName(logging.ERROR, "\033[91m %s\033[0m" % logging.getLevelName(logging.ERROR)) + logging.addLevelName(logging.WARNING, "\033[91m%s\033[0m" % logging.getLevelName(logging.WARNING)) + + bgpd = os.path.join(args.directory, 'bgpd') + isisd = os.path.join(args.directory, 'isisd') + ospfd = os.path.join(args.directory, 'ospfd') + ospf6d = os.path.join(args.directory, 'ospf6d') + ripd = os.path.join(args.directory, 'ripd') + ripngd = os.path.join(args.directory, 'ripngd') + zebra = os.path.join(args.directory, 'zebra') + parser_files = [] + + for (directory, foo, files) in sorted(os.walk(args.directory)): + + # We do not care about crunching files in these directories + if (directory.endswith('vtysh') or + directory.endswith('quagga-0.99.23.1/') or + directory.endswith('lib') or + directory.endswith('isisd') or + directory.endswith('ripd') or + directory.endswith('ripngd') or + directory.endswith('m4') or + directory.endswith('tests')): + continue + + if args.daemon not in directory: + continue + + for x in sorted(files): + if x.endswith('.c'): + filename = os.path.join(directory, x) + parser_files.append(filename) + + commands = {} + defun_to_context = {} + + for filename in parser_files: + + with open(filename, 'r') as fh: + state = 'LIMBO' + line_number = 1 + + for line in fh.readlines(): + + if state == 'LIMBO': + if (line.startswith('DEFUN ') or line.startswith('ALIAS ')): + state = 'DEFUN_LINE_1' + + elif 'install_element' in line: + # install_element (BGP_NODE, &neighbor_bfd_cmd); + re_line = re.search('install_element\s*\(\s*(\S+)\s*, \&(\S+)\)', line) + + if re_line: + context = re_line.group(1) + defun = re_line.group(2) + + if defun not in defun_to_context: + defun_to_context[defun] = [] + defun_to_context[defun].append(context) + else: + log.warning("regex failed on '%s'" % line.strip()) + + elif state == 'DEFUN_LINE_1': + state = 'DEFUN_LINE_2' + # remove spaces and trailing comma + defun = line.strip()[0:-1] + + elif state == 'DEFUN_LINE_2': + if 'ifdef HAVE_IPV6' in line: + pass + else: + state = 'LIMBO' + + # remove the leading and trailing spaces + # remove the leading and trailing " + # remove the trailing , + line = line.strip() + line = replace_constants(line) + + if line.endswith(','): + line = line.rstrip().lstrip()[:-1] + + if line.startswith('"'): + line = line.rstrip().lstrip()[1:] + + if line.endswith('"'): + line = line.rstrip().lstrip()[:-1] + + line = line.replace(' " ', ' ') + line = line.replace(' "', ' ') + line = line.replace('" ', ' ') + line = line.replace('( ', '(') + line = line.replace(' )', ')') + + line = line.replace('| ', '|') + line = line.replace(' |', '|') + + # compress multiple whitespaces + while ' ' in line: + line = line.replace(' ', ' ') + + commands[line] = Command(defun, line, line_number) + defun = None + line_number += 1 + + # Fill in the context for each Command based on its defun + for cmd in commands.itervalues(): + cmd.context = defun_to_context.get(cmd.defun) + if cmd.context is None: + log.error("%s: could not find defun for %s" % (cmd, cmd.defun)) + continue + cmd.set_docstring() + + normal = [] + expert = [] + + if args.print_docstring: + if args.daemon == 'bgpd': + normal.append(' quagga show bgp [ipv4|ipv6] [unicast|multicast] summary [json]') + normal.append(' quagga show bgp [ipv4|ipv6] [unicast|multicast] [<ip>|<ip/prefixlen>] [bestpath|multipath] [json]') + normal.append(' quagga show bgp neighbor [<ip>|<interface>]') + normal.append(' quagga clear bgp (<ip>|<interface>|*)') + normal.append(' quagga clear bgp (<ip>|<interface>|*) soft [in|out]') + normal.append(' quagga clear bgp prefix <ip/prefixlen>') + normal.append(' quagga (add|del) debug bgp bestpath <ip/prefixlen>') + normal.append(' quagga (add|del) debug bgp keepalives (<ip><interface>)') + normal.append(' quagga (add|del) debug bgp neighbor-events (<ip>|<interface>)') + expert.append(' quagga (add|del) debug bgp nht') + expert.append(' quagga (add|del) debug bgp update-groups') + normal.append(' quagga (add|del) debug bgp updates prefix <ip/prefixlen>') + normal.append(' quagga (add|del) debug bgp zebra prefix <ip/prefixlen>') + + bgp_bgp = ['always-compare-med', + 'bestpath', + 'client-to-client reflection', + 'cluster-id', + 'confederation peers', + 'default ipv4-unicast', + 'default local-preference', + 'default show-hostname', + 'default subgroup-pkt-queue-max', + 'deterministic-med', + 'disable-ebgp-connected-route-check', + 'enforce-first-as', + 'fast-external-failover', + 'graceful-restart', + 'listen', + 'log-neighbor-changes', + 'max-med', + 'network import-check', + 'route-map delay-timer', + 'route-reflector allow-outbound-policy', + 'router-id'] + + # ====== + # global + # ====== + normal.append(' quagga (add|del) bgp always-compare-med') + expert.append(' quagga (add|del) bgp bestpath as-path (confed|ignore)') + normal.append(' quagga (add|del) bgp bestpath as-path multipath-relax [as-set|no-as-set]') + expert.append(' quagga (add|del) bgp bestpath med (confed|missing-as-worst)') + expert.append(' quagga (add|del) bgp client-to-client reflection') + expert.append(' quagga (add|del) bgp cluster-id (<ipv4>|<1-4294967295>)') + expert.append(' quagga (add|del) bgp confederation peers <1-4294967295>') + expert.append(' quagga (add|del) bgp default ipv4-unicast') + expert.append(' quagga (add|del) bgp default local-preference <0-4294967295>') + expert.append(' quagga (add|del) bgp default show-hostname') + expert.append(' quagga (add|del) bgp default subgroup-pkt-queue-max <20-100>') + expert.append(' quagga (add|del) bgp deterministic-med') + expert.append(' quagga (add|del) bgp disable-ebgp-connected-route-check') + expert.append(' quagga (add|del) bgp enforce-first-as') + expert.append(' quagga (add|del) bgp fast-external-failover') + expert.append(' quagga (add|del) bgp graceful-restart') + expert.append(' quagga (add|del) bgp listen limit <1-5000>') + expert.append(' quagga (add|del) bgp listen range (<ipv4/prefixlen>|<ipv6/prefixlen>) peer-group <text>') + expert.append(' quagga (add|del) bgp log-neighbor-changes') + expert.append(' quagga (add|del) bgp max-med administrative <0-4294967294>') + expert.append(' quagga (add|del) bgp max-med on-startup <5-86400> [<0-4294967294>]') + expert.append(' quagga (add|del) bgp network import-check') + expert.append(' quagga (add|del) bgp route-map delay-timer <0-600>') + expert.append(' quagga (add|del) bgp route-reflector allow-outbound-policy') + normal.append(' quagga (add|del) bgp router-id <ipv4>') + expert.append(' quagga (add|del) bgp coalesce-time <0-4294967295>') + expert.append(' quagga (add|del) bgp distance <1-255> <ipv4/prefixlen> <text>') + expert.append(' quagga (add|del) bgp distance bgp <1-255> <1-255> <1-255>') + expert.append(' quagga (add|del) bgp timers bgp <0-65535> <0-65535>') + expert.append(' quagga (add|del) bgp update-delay <0-3600> [<1-3600>]') + expert.append(' quagga (add|del) bgp write-quanta <1-10000>') + + # ==================== + # peer global afi/safi + # ==================== + normal.append(' quagga (add|del) bgp neighbor <interface> interface') + normal.append(' quagga (add|del) bgp neighbor <interface> interface peer-group <text>') + expert.append(' quagga (add|del) bgp neighbor <interface> interface v6only') + expert.append(' quagga (add|del) bgp neighbor <interface> interface v6only peer-group <text>') + normal.append(' quagga (add|del) bgp neighbor <interface> peer-group') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) advertisement-interval <0-600>') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) bfd') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) capability dynamic') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) capability extended-nexthop') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) description <text>') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) disable-connected-check') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) dont-capability-negotiate') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) ebgp-multihop [<1-255>]') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) enforce-multihop') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) local-as <1-4294967295> [no-prepend] [replace-as]') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) override-capability') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) passive') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) password <text>') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) port <0-65535>') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) remote-as (<1-4294967295>|external|internal)') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) shutdown') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) solo') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) strict-capability-match') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) timers <0-65535> <0-65535>') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) timers connect <1-65535>') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) ttl-security hops <1-254>') + normal.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) update-source (<ipv4>|<ipv6>|<interface>)') + expert.append(' quagga (add|del) bgp neighbor (<ip>|<interface>) weight <0-65535>') + + # ================= + # peer per afi/safi + # ================= + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) addpath-tx-all-paths') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) addpath-tx-bestpath-per-AS') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) allowas-in [<1-10>]') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) as-override') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) attribute-unchanged [as-path] [next-hop] [med]') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) capability orf prefix-list (both|send|receive)') + normal.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) default-originate [route-map <text>]') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) distribute-list (<1-199>|<1300-2699>|<text>) (in|out)') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) filter-list <text> (in|out)') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) maximum-prefix <1-4294967295>') + normal.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) next-hop-self [force]') + normal.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) peer-group <text>') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) prefix-list <text> (in|out)') + normal.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) remove-private-AS [all] [replace-AS]') + normal.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) route-map <text> (in|out)') + normal.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) route-reflector-client') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) route-server-client') + normal.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) send-community [both|extended|standard]') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) soft-reconfiguration inbound') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] neighbor (<ip>|<interface>) unsuppress-map <text>') + expert.append(' quagga (add|del) bgp ipv6 unicast neighbor (<ip>|<interface>) nexthop-local unchanged') + + # ============ + # per afi/safi + # ============ + normal.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] maximum-paths [ibgp] <1-255> [equal-cluster-length]') + normal.append(' quagga (add|del) bgp (ipv4|ipv6) [unicast|multicast] aggregate-address <ipv4/prefixlen> [as-set] [summary-only]') + normal.append(' quagga (add|del) bgp (ipv4|ipv6) [unicast|multicast] network (<ipv4/prefixlen>|<ipv6/prefixlen>)') + expert.append(' quagga (add|del) bgp (ipv4|ipv6) [unicast|multicast] network (<ipv4/prefixlen>|<ipv6/prefixlen>) route-map <text>') + expert.append(' quagga (add|del) bgp (ipv4|ipv6) [unicast|multicast] bgp dampening <1-45> <1-20000> <1-20000> <1-255>') + normal.append(' quagga (add|del) bgp (ipv4|ipv6) [unicast|multicast] redistribute (kernel|connected|static|rip|ospf|isis) [metric <0-4294967295>] [route-map <text>]') + expert.append(' quagga (add|del) bgp [ipv4|ipv6] [unicast|multicast] table-map <text>') + + if args.daemon == 'ospfd': + normal.append(' quagga clear ip ospf interface [<interface>]') + normal.append(' quagga (add|del) debug ospf [<1-65535>] ism [status|events|timers]') + normal.append(' quagga (add|del) debug ospf [<1-65535>] lsa [generate|flooding|install|refresh]') + normal.append(' quagga (add|del) debug ospf [<1-65535>] nsm [status|events|timers]') + expert.append(' quagga (add|del) debug ospf [<1-65535>] nssa') + normal.append(' quagga (add|del) debug ospf [<1-65535>] packet [hello|dd|ls-request|ls-update|ls-ack|all] [send|recv|detail]') + normal.append(' quagga (add|del) debug ospf [<1-65535>] zebra [interface|redistribute]') + normal.append(' quagga show ip ospf [<1-65535>]') + expert.append(' quagga show ip ospf [<1-65535>] border-routers') + expert.append(' quagga show ip ospf [<1-65535>] database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as|max-age|self-originate) [self-originate]') + expert.append(' quagga show ip ospf [<1-65535>] database (asbr-summary|external|network|router|summary|nssa-external|opaque-link|opaque-area|opaque-as|max-age|self-originate) adv-router <ipv4>') + normal.append(' quagga show ip ospf [<1-65535>] interface [<interface>] [json]') + normal.append(' quagga show ip ospf [<1-65535>] neighbor (all|<interface>|<ipv4>) [detail] [json]') + normal.append(' quagga show ip ospf [<1-65535>] route') + + normal.append(' quagga (add|del) <interface> ip ospf [<1-65535>] area (<ipv4>|<0-4294967295>)') + normal.append(' quagga (add|del) <interface> ip ospf dead-interval <1-65535>') + normal.append(' quagga (add|del) <interface> ip ospf hello-interval <1-65535>') + normal.append(' quagga (add|del) <interface> ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)') + normal.append(' quagga (add|del) ospf network <ipv4/prefixlen> area (<ipv4>|<0-4294967295>)') + normal.append(' quagga (add|del) ospf passive-interface IFNAME') + normal.append(' quagga (add|del) ospf router-id <ipv4>') + normal.append(' quagga (add|del) ospf timers throttle spf <0-600000> <0-600000> <0-600000>') + + + + ignore_list = bgp_clear_ignore + bgp_debug_ignore + bgp_show_ignore + bgp_config_ignore + ignore_list += ospf_clear_ignore + ospf_debug_ignore + ospf_show_ignore + ospf_config_ignore + + for cmd in commands.itervalues(): + if not cmd.text.startswith('no ') and cmd.context: + if cmd.docstring: + if cmd.docstring not in ignore_list: + normal.append(cmd.docstring) + + elif args.print_quagga: + for cmd in commands.itervalues(): + if not cmd.text.startswith('no ') and cmd.context: + normal.append(cmd.text) + + elif args.print_context: + for cmd in commands.itervalues(): + if not cmd.text.startswith('no ') and cmd.context: + normal.append("%s - %s" % (cmd.context, cmd.text)) + else: + raise Exception("No print option specified") + + normal = sorted(normal) + print '\n'.join(map(str, normal)) |