From: Quentin Young Date: Wed, 10 Aug 2016 18:31:15 +0000 (+0000) Subject: lib: Add completion string convenience functions X-Git-Tag: frr-3.0-branchpoint~129^2~249 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ca90e051043f819fe974cd110e15cf38edd63f2e;p=matthieu%2Ffrr.git lib: Add completion string convenience functions And set END_GN default text to , and scrub a coupld of extraneous files Signed-off-by: Quentin Young --- diff --git a/feed.x b/feed.x deleted file mode 100755 index cbff1944bf..0000000000 --- a/feed.x +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/expect - -# takes a list of command format strings -# and feeds them to the test grammar -# parser - -set f [open [lindex $argv 0]] -set cmds [split [read $f] "\n"] -close $f - -spawn vtysh - -foreach command $cmds { - expect { - "dell-s6000-16#" { - send "grammar parse $command\r" - } - "Grammar error" { - send_user "$command" - send "exit\r" - exit - } - } -} - -interact diff --git a/lib/command_match.c b/lib/command_match.c index 285a776a7c..d5efa39686 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -52,6 +52,9 @@ disambiguate_nodes (struct graph_node *, struct graph_node *, char *); static struct list * disambiguate (struct list *, struct list *, vector, unsigned int); +int +compare_completions (const void *, const void *); + /* token matcher prototypes */ static enum match_type match_token (struct graph_node *, char *); @@ -291,7 +294,7 @@ match_command_complete (struct graph_node *start, vector vline, struct list **co */ matcher_rv = - idx + 1 == vector_active(vline) && next->count ? + idx == vector_active(vline) && next->count ? MATCHER_OK : MATCHER_NO_MATCH; @@ -301,6 +304,54 @@ match_command_complete (struct graph_node *start, vector vline, struct list **co return matcher_rv; } +/** + * Compare two completions. Tightly coupled to vector. + * + * @param[in] fst pointer to first item pointer in vector->index + * @param[in] snd pointer to second item poitner in vector->index + * @return integer compare code as determined by strcmp + */ +int +compare_completions (const void *fst, const void *snd) +{ + const char *first = *((char **) fst); + const char *secnd = *((char **) snd); + return strcmp (first, secnd); +} + +enum matcher_rv +match_command_complete_str (struct graph_node *start, + vector vline, + vector completions) +{ + struct list *comps; + enum matcher_rv rv = match_command_complete (start, vline, &comps); + + // quick n' dirty deduplication fn here, prolly like O(n^n) + struct listnode *ln; + struct graph_node *gn; + unsigned int i; + for (ALL_LIST_ELEMENTS_RO(comps,ln,gn)) + { + // linear search for node text in completions vector + int exists = 0; + for (i = 0; i < vector_active (completions) && !exists; i++) + exists = !strcmp (gn->text, vector_slot (completions, i)); + + if (!exists) + vector_set (completions, XSTRDUP(MTYPE_TMP, gn->text)); + } + + // sort completions + qsort (completions->index, + vector_active (completions), + sizeof (void *), + &compare_completions); + + list_delete (comps); + return rv; +} + /** * Adds all children that are reachable by one parser hop to the given list. * NUL_GN, SELECTOR_GN, and OPTION_GN nodes are treated as transparent. diff --git a/lib/command_match.h b/lib/command_match.h index 6804a0777a..e8a408495e 100644 --- a/lib/command_match.h +++ b/lib/command_match.h @@ -85,7 +85,7 @@ match_command (struct graph_node *start, * * @param[in] start the start node of the DFA to match against * @param[in] vline vectorized input string - * @param[in] completions pointer to possible completions + * @param[in] completions pointer to list of possible next nodes * @return matcher status */ enum matcher_rv @@ -93,4 +93,18 @@ match_command_complete (struct graph_node *start, vector vline, struct list **completions); + +/** + * Compiles possible completions for a given line of user input. + * + * @param[in] start the start node of the DFA to match against + * @param[in] vline vectorized input string + * @param[in] completions vector to fill with string completions + * @return matcher status + */ +enum matcher_rv +match_command_complete_str (struct graph_node *start, + vector vline, + vector completions); + #endif /* _ZEBRA_COMMAND_MATCH_H */ diff --git a/lib/command_parse.y b/lib/command_parse.y index 56c58fdaed..df90f64edb 100644 --- a/lib/command_parse.y +++ b/lib/command_parse.y @@ -433,6 +433,7 @@ terminate_graph (struct graph_node *startnode, { struct graph_node *end = new_node (END_GN); end->element = element; + end->text = XSTRDUP(MTYPE_CMD_TOKENS, ""); if (node_exists (finalnode, end)) yyerror (element, startnode, "Duplicate command."); else diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c index 6473fc12e3..899d0469ab 100644 --- a/lib/grammar_sandbox.c +++ b/lib/grammar_sandbox.c @@ -91,31 +91,22 @@ DEFUN (grammar_test_complete, char *cmdstr = argv_concat (argv, argc, 0); vector command = cmd_make_strvec (cmdstr); - struct list *completions; - enum matcher_rv result = match_command_complete (nodegraph, command, &completions); + vector completions = vector_init (VECTOR_MIN_SIZE); + enum matcher_rv result = + match_command_complete_str (nodegraph, command, completions); // print completions or relevant error message - if (completions) + if (!MATCHER_ERROR(result)) { - struct listnode *ln; - struct graph_node *gn; - for (ALL_LIST_ELEMENTS_RO(completions,ln,gn)) - { - if (gn->type == END_GN) - zlog_info (" (%p)", gn->element->func); - else - zlog_info ("%-30s%s", gn->text, gn->doc); - } - list_delete (completions); + for (unsigned int i = 0; i < vector_active (completions); i++) + zlog_info ((char *) vector_slot (completions, i)); } else - { - assert(MATCHER_ERROR(result)); - zlog_info ("%% No match for \"%s\"", cmdstr); - } + zlog_info ("%% No match for \"%s\"", cmdstr); // free resources cmd_free_strvec (command); + cmd_free_strvec (completions); free (cmdstr); return CMD_SUCCESS; diff --git a/opt.txt b/opt.txt deleted file mode 100644 index a63e0b85f2..0000000000 --- a/opt.txt +++ /dev/null @@ -1,905 +0,0 @@ -address-family encap -address-family encapv4 -address-family encapv6 -address-family ipv4 -address-family ipv4 -address-family ipv6 -address-family ipv6 -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 -bgp bestpath compare-routerid -bgp bestpath med -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 -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 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 -clear bgp in -clear bgp in prefix-filter -clear bgp out -clear bgp soft -clear bgp soft in -clear bgp 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 -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 * -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 -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 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 -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 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 in -clear ip bgp in prefix-filter -clear ip bgp ipv4 in -clear ip bgp ipv4 in prefix-filter -clear ip bgp ipv4 out -clear ip bgp ipv4 soft -clear ip bgp ipv4 soft in -clear ip bgp ipv4 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 -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 in -clear ip bgp * ipv4 in prefix-filter -clear ip bgp * ipv4 out -clear ip bgp * ipv4 soft -clear ip bgp * ipv4 soft in -clear ip bgp * ipv4 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 in -clear ip bgp (1-4294967295) ipv4 in prefix-filter -clear ip bgp (1-4294967295) ipv4 out -clear ip bgp (1-4294967295) ipv4 soft -clear ip bgp (1-4294967295) ipv4 soft in -clear ip bgp (1-4294967295) ipv4 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 in -clear ip bgp BGP_INSTANCE_CMD ipv4 in -clear ip bgp BGP_INSTANCE_CMD ipv4 out -clear ip bgp BGP_INSTANCE_CMD ipv4 soft -clear ip bgp BGP_INSTANCE_CMD ipv4 soft in -clear ip bgp BGP_INSTANCE_CMD ipv4 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 -clear ip bgp BGP_INSTANCE_CMD * -clear ip bgp BGP_INSTANCE_CMD * in -clear ip bgp BGP_INSTANCE_CMD * ipv4 in -clear ip bgp BGP_INSTANCE_CMD * ipv4 out -clear ip bgp BGP_INSTANCE_CMD * ipv4 soft -clear ip bgp BGP_INSTANCE_CMD * ipv4 soft in -clear ip bgp BGP_INSTANCE_CMD * ipv4 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 in -clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 out -clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 soft -clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 soft in -clear ip bgp BGP_INSTANCE_CMD (1-4294967295) ipv4 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 in -clear ip bgp BGP_INSTANCE_CMD external ipv4 out -clear ip bgp BGP_INSTANCE_CMD external ipv4 soft -clear ip bgp BGP_INSTANCE_CMD external ipv4 soft in -clear ip bgp BGP_INSTANCE_CMD external ipv4 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 in -clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 out -clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 soft -clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 soft in -clear ip bgp BGP_INSTANCE_CMD peer-group WORD ipv4 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 in -clear ip bgp external ipv4 in prefix-filter -clear ip bgp external ipv4 out -clear ip bgp external ipv4 soft -clear ip bgp external ipv4 soft in -clear ip bgp external ipv4 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 in -clear ip bgp peer-group WORD ipv4 in prefix-filter -clear ip bgp peer-group WORD ipv4 out -clear ip bgp peer-group WORD ipv4 soft -clear ip bgp peer-group WORD ipv4 soft in -clear ip bgp peer-group WORD ipv4 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 -debug bgp keepalives -debug bgp keepalives -debug bgp neighbor-events -debug bgp neighbor-events -debug bgp nht -debug bgp update-groups -debug bgp updates -debug bgp updates -debug bgp updates -debug bgp updates prefix -debug bgp zebra -debug bgp zebra prefix -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 PATH [INTERVAL] -exit-address-family -ip community-list (1-99) -ip community-list (1-99) AA:NN -ip community-list (100-500) LINE -ip community-list expanded WORD LINE -ip community-list standard WORD -ip community-list standard WORD AA:NN -ip extcommunity-list (1-99) -ip extcommunity-list (1-99) AA:NN -ip extcommunity-list (100-500) LINE -ip extcommunity-list expanded WORD LINE -ip extcommunity-list standard WORD -ip extcommunity-list standard WORD 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 -match peer -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 interface WORD -neighbor port (0-65535) -neighbor strict-capability-match -neighbor activate -neighbor addpath-tx-all-paths -neighbor addpath-tx-bestpath-per-AS -neighbor advertisement-interval (0-600) -neighbor allowas-in -neighbor allowas-in (1-10) -neighbor as-override -neighbor attribute-unchanged -neighbor attribute-unchanged -neighbor attribute-unchanged as-path -neighbor attribute-unchanged as-path med next-hop -neighbor attribute-unchanged as-path next-hop med -neighbor attribute-unchanged med -neighbor attribute-unchanged med as-path next-hop -neighbor attribute-unchanged med next-hop as-path -neighbor attribute-unchanged next-hop -neighbor attribute-unchanged next-hop as-path med -neighbor attribute-unchanged next-hop med as-path -neighbor bfd -neighbor bfd (2-255) BFD_CMD_MIN_RX_RANGE (50-60000) -neighbor capability dynamic -neighbor capability extended-nexthop -neighbor capability orf prefix-list -neighbor default-originate -neighbor default-originate route-map WORD -neighbor description LINE -neighbor disable-connected-check -neighbor distribute-list <(1-199)|(1300-2699)|WORD> -neighbor dont-capability-negotiate -neighbor ebgp-multihop -neighbor ebgp-multihop (1-255) -neighbor enforce-multihop -neighbor filter-list WORD -neighbor local-as (1-4294967295) -neighbor local-as (1-4294967295) no-prepend -neighbor local-as (1-4294967295) no-prepend replace-as -neighbor maximum-prefix (1-4294967295) -neighbor maximum-prefix (1-4294967295) (1-100) -neighbor maximum-prefix (1-4294967295) (1-100) restart (1-65535) -neighbor maximum-prefix (1-4294967295) (1-100) warning-only -neighbor maximum-prefix (1-4294967295) restart (1-65535) -neighbor maximum-prefix (1-4294967295) warning-only -neighbor next-hop-self -neighbor next-hop-self force -neighbor nexthop-local unchanged -neighbor override-capability -neighbor passive -neighbor password LINE -neighbor peer-group WORD -neighbor prefix-list WORD -neighbor remote-as <(1-4294967295)|external|internal> -neighbor remove-private-AS -neighbor remove-private-AS all -neighbor remove-private-AS all replace-AS -neighbor remove-private-AS replace-AS -neighbor route-map WORD -neighbor route-reflector-client -neighbor route-server-client -neighbor send-community -neighbor send-community -neighbor shutdown -neighbor soft-reconfiguration inbound -neighbor solo -neighbor timers (0-65535) (0-65535) -neighbor timers connect (1-65535) -neighbor ttl-security hops (1-254) -neighbor unsuppress-map WORD -neighbor update-source -neighbor 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 -redistribute metric (0-4294967295) -redistribute metric (0-4294967295) route-map WORD -redistribute route-map WORD -redistribute route-map WORD metric (0-4294967295) -redistribute -redistribute metric (0-4294967295) -redistribute metric (0-4294967295) route-map WORD -redistribute route-map WORD -redistribute route-map WORD metric (0-4294967295) -redistribute (1-65535) -redistribute (1-65535) metric (0-4294967295) -redistribute (1-65535) metric (0-4294967295) route-map WORD -redistribute (1-65535) route-map WORD -redistribute (1-65535) route-map WORD metric (0-4294967295) -router bgp -router bgp (1-4294967295) -router bgp (1-4294967295) 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 -set metric <+/-metric> -set metric (0-4294967295) -set origin -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 statistics -show bgp update-groups -show bgp update-groups -show bgp update-groups SUBGROUP-ID -show bgp update-groups SUBGROUP-ID -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 community -show bgp BGP_INSTANCE_CMD community -show bgp BGP_INSTANCE_CMD community -show bgp BGP_INSTANCE_CMD community -show bgp BGP_INSTANCE_CMD community -show bgp BGP_INSTANCE_CMD neighbors [json] -show bgp BGP_INSTANCE_CMD statistics -show bgp BGP_INSTANCE_CMD X:X::X:X [json] -show bgp BGP_INSTANCE_CMD X:X::X:X [json] -show bgp BGP_INSTANCE_CMD X:X::X:X/M [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 summary [json] -show bgp BGP_INSTANCE_CMD ipv6 X:X::X:X [json] -show bgp BGP_INSTANCE_CMD ipv6 X:X::X:X [json] -show bgp BGP_INSTANCE_CMD ipv6 X:X::X:X/M [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 advertised-routes [json] -show bgp BGP_INSTANCE_CMD ipv6 neighbors dampened-routes [json] -show bgp BGP_INSTANCE_CMD ipv6 neighbors flap-statistics [json] -show bgp BGP_INSTANCE_CMD ipv6 neighbors prefix-counts [json] -show bgp BGP_INSTANCE_CMD ipv6 neighbors received prefix-filter [json] -show bgp BGP_INSTANCE_CMD ipv6 neighbors received-routes [json] -show bgp BGP_INSTANCE_CMD ipv6 neighbors routes [json] -show bgp BGP_INSTANCE_CMD ipv6 neighbors [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 advertised-routes [json] -show bgp BGP_INSTANCE_CMD neighbors dampened-routes [json] -show bgp BGP_INSTANCE_CMD neighbors flap-statistics [json] -show bgp BGP_INSTANCE_CMD neighbors received prefix-filter [json] -show bgp BGP_INSTANCE_CMD neighbors received-routes [json] -show bgp BGP_INSTANCE_CMD neighbors routes [json] -show bgp BGP_INSTANCE_CMD neighbors [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 -show bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID -show bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID -show bgp BGP_INSTANCE_CMD [json] -show bgp X:X::X:X [json] -show bgp X:X::X:X [json] -show bgp X:X::X:X/M [json] -show bgp X:X::X:X/M longer-prefixes -show bgp X:X::X:X/M [json] -show bgp community -show bgp community -show bgp community -show bgp community -show bgp community -show bgp community exact-match -show bgp community exact-match -show bgp community exact-match -show bgp community 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 A.B.C.D [json] -show bgp ipv4 A.B.C.D [json] -show bgp ipv4 A.B.C.D/M [json] -show bgp ipv4 A.B.C.D/M [json] -show bgp ipv4 summary [json] -show bgp ipv4 [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 advertised-routes -show bgp ipv4 encap rd ASN:nn_or_IP-address:nn neighbors routes -show bgp ipv4 encap rd ASN:nn_or_IP-address:nn tags -show bgp ipv4 encap tags -show bgp ipv6 X:X::X:X [json] -show bgp ipv6 X:X::X:X [json] -show bgp ipv6 X:X::X:X/M [json] -show bgp ipv6 X:X::X:X/M [json] -show bgp ipv6 summary [json] -show bgp ipv6 [json] -show bgp ipv6 X:X::X:X [json] -show bgp ipv6 X:X::X:X [json] -show bgp ipv6 X:X::X:X/M [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 -show bgp ipv6 community -show bgp ipv6 community -show bgp ipv6 community -show bgp ipv6 community exact-match -show bgp ipv6 community exact-match -show bgp ipv6 community exact-match -show bgp ipv6 community 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 advertised-routes -show bgp ipv6 encap rd ASN:nn_or_IP-address:nn neighbors 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 advertised-routes [json] -show bgp ipv6 neighbors dampened-routes [json] -show bgp ipv6 neighbors flap-statistics [json] -show bgp ipv6 neighbors prefix-counts [json] -show bgp ipv6 neighbors received prefix-filter [json] -show bgp ipv6 neighbors received-routes [json] -show bgp ipv6 neighbors routes [json] -show bgp ipv6 neighbors [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 advertised-routes [json] -show bgp neighbors dampened-routes [json] -show bgp neighbors flap-statistics [json] -show bgp neighbors received prefix-filter [json] -show bgp neighbors received-routes [json] -show bgp neighbors routes [json] -show bgp neighbors [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 -show bgp update-groups SUBGROUP-ID -show bgp update-groups SUBGROUP-ID -show bgp view WORD ipv4 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 [json] -show ip bgp A.B.C.D [json] -show ip bgp A.B.C.D/M [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 [json] -show ip bgp BGP_INSTANCE_CMD A.B.C.D [json] -show ip bgp BGP_INSTANCE_CMD A.B.C.D/M [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 advertised-routes route-map WORD [json] -show ip bgp BGP_INSTANCE_CMD neighbors advertised-routes [json] -show ip bgp BGP_INSTANCE_CMD neighbors prefix-counts [json] -show ip bgp BGP_INSTANCE_CMD neighbors received-routes route-map WORD [json] -show ip bgp BGP_INSTANCE_CMD neighbors received-routes [json] -show ip bgp BGP_INSTANCE_CMD neighbors routes [json] -show ip bgp BGP_INSTANCE_CMD neighbors [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 -show ip bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID -show ip bgp BGP_INSTANCE_CMD update-groups SUBGROUP-ID -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 -show ip bgp community -show ip bgp community -show ip bgp community -show ip bgp community exact-match -show ip bgp community exact-match -show ip bgp community exact-match -show ip bgp community 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 A.B.C.D [json] -show ip bgp ipv4 A.B.C.D/M [json] -show ip bgp ipv4 A.B.C.D/M longer-prefixes -show ip bgp ipv4 A.B.C.D/M [json] -show ip bgp ipv4 cidr-only -show ip bgp ipv4 community -show ip bgp ipv4 community -show ip bgp ipv4 community -show ip bgp ipv4 community -show ip bgp ipv4 community -show ip bgp ipv4 community exact-match -show ip bgp ipv4 community exact-match -show ip bgp ipv4 community exact-match -show ip bgp ipv4 community exact-match -show ip bgp ipv4 community-list <(1-500)|WORD> -show ip bgp ipv4 community-list <(1-500)|WORD> exact-match -show ip bgp ipv4 filter-list WORD -show ip bgp ipv4 neighbors advertised-routes route-map WORD [json] -show ip bgp ipv4 neighbors advertised-routes [json] -show ip bgp ipv4 neighbors prefix-counts [json] -show ip bgp ipv4 neighbors received prefix-filter [json] -show ip bgp ipv4 neighbors received-routes route-map WORD [json] -show ip bgp ipv4 neighbors received-routes [json] -show ip bgp ipv4 neighbors routes [json] -show ip bgp ipv4 neighbors [json] -show ip bgp ipv4 neighbors [json] -show ip bgp ipv4 paths -show ip bgp ipv4 prefix-list WORD -show ip bgp ipv4 regexp LINE -show ip bgp ipv4 route-map WORD -show ip bgp ipv4 summary [json] -show ip bgp ipv4 [json] -show ip bgp neighbors advertised-routes route-map WORD [json] -show ip bgp neighbors advertised-routes [json] -show ip bgp neighbors dampened-routes [json] -show ip bgp neighbors flap-statistics [json] -show ip bgp neighbors prefix-counts [json] -show ip bgp neighbors received prefix-filter [json] -show ip bgp neighbors received-routes route-map WORD [json] -show ip bgp neighbors received-routes [json] -show ip bgp neighbors routes [json] -show ip bgp neighbors [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 -show ip bgp update-groups SUBGROUP-ID -show ip bgp update-groups SUBGROUP-ID -show ip bgp view WORD ipv4 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 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 -show ipv6 bgp community -show ipv6 bgp community -show ipv6 bgp community -show ipv6 bgp community exact-match -show ipv6 bgp community exact-match -show ipv6 bgp community exact-match -show ipv6 bgp community 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 advertised-routes [json] -show ipv6 bgp neighbors received-routes [json] -show ipv6 bgp neighbors 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 -show ipv6 mbgp community -show ipv6 mbgp community -show ipv6 mbgp community -show ipv6 mbgp community exact-match -show ipv6 mbgp community exact-match -show ipv6 mbgp community exact-match -show ipv6 mbgp community 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 advertised-routes [json] -show ipv6 mbgp neighbors received-routes [json] -show ipv6 mbgp neighbors 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)