1 /* Virtual terminal interface shell.
2 * Copyright (C) 2000 Kunihiro Ishiguro
4 * This file is part of GNU Zebra.
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the Free
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 #include <sys/resource.h>
30 #include <readline/readline.h>
31 #include <readline/history.h>
41 #include "vtysh/vtysh.h"
43 #include "bgpd/bgp_vty.h"
48 DEFINE_MTYPE_STATIC(MVTYSH
, VTYSH_CMD
, "Vtysh cmd copy")
53 /* VTY shell pager name. */
54 char *vtysh_pager_name
= NULL
;
56 /* VTY shell client structure. */
62 char path
[MAXPATHLEN
];
63 struct vtysh_client
*next
;
66 struct vtysh_client vtysh_client
[] =
68 { .fd
= -1, .name
= "zebra", .flag
= VTYSH_ZEBRA
, .next
= NULL
},
69 { .fd
= -1, .name
= "ripd", .flag
= VTYSH_RIPD
, .next
= NULL
},
70 { .fd
= -1, .name
= "ripngd", .flag
= VTYSH_RIPNGD
, .next
= NULL
},
71 { .fd
= -1, .name
= "ospfd", .flag
= VTYSH_OSPFD
, .next
= NULL
},
72 { .fd
= -1, .name
= "ospf6d", .flag
= VTYSH_OSPF6D
, .next
= NULL
},
73 { .fd
= -1, .name
= "ldpd", .flag
= VTYSH_LDPD
, .next
= NULL
},
74 { .fd
= -1, .name
= "bgpd", .flag
= VTYSH_BGPD
, .next
= NULL
},
75 { .fd
= -1, .name
= "isisd", .flag
= VTYSH_ISISD
, .next
= NULL
},
76 { .fd
= -1, .name
= "pimd", .flag
= VTYSH_PIMD
, .next
= NULL
},
77 { .fd
= -1, .name
= "nhrpd", .flag
= VTYSH_NHRPD
, .next
= NULL
},
78 { .fd
= -1, .name
= "eigrpd", .flag
= VTYSH_EIGRPD
, .next
= NULL
},
79 { .fd
= -1, .name
= "watchfrr", .flag
= VTYSH_WATCHFRR
, .next
= NULL
},
82 enum vtysh_write_integrated vtysh_write_integrated
= WRITE_INTEGRATED_UNSPECIFIED
;
85 vclient_close (struct vtysh_client
*vclient
)
90 "Warning: closing connection to %s because of an I/O error!\n",
97 /* Return true if str begins with prefix, else return false */
99 begins_with(const char *str
, const char *prefix
)
103 size_t lenstr
= strlen(str
);
104 size_t lenprefix
= strlen(prefix
);
105 if (lenprefix
> lenstr
)
107 return strncmp(str
, prefix
, lenprefix
) == 0;
110 /* NB: multiplexed function:
111 * if fp == NULL, this calls vtysh_config_parse_line
112 * if fp != NULL, this prints lines to fp
115 vtysh_client_run (struct vtysh_client
*vclient
, const char *line
, FILE *fp
)
119 char *buf
= stackbuf
;
120 size_t bufsz
= sizeof(stackbuf
);
121 char *bufvalid
, *end
= NULL
;
122 char terminator
[3] = {0, 0, 0};
127 ret
= write (vclient
->fd
, line
, strlen (line
) + 1);
134 ssize_t nread
= read (vclient
->fd
, bufvalid
, buf
+ bufsz
- bufvalid
);
136 if (nread
< 0 && (errno
== EINTR
|| errno
== EAGAIN
))
141 fprintf (stderr
, "vtysh: error reading from %s: %s (%d)",
142 vclient
->name
, safe_strerror(errno
), errno
);
148 end
= memmem (buf
, bufvalid
- buf
, terminator
, sizeof(terminator
));
149 if (end
+ sizeof(terminator
) + 1 > bufvalid
)
150 /* found \0\0\0 but return code hasn't been read yet */
153 ret
= end
[sizeof(terminator
)];
155 while (bufvalid
> buf
&& (end
> buf
|| !end
))
157 size_t textlen
= (end
? end
: bufvalid
) - buf
;
158 char *eol
= memchr (buf
, '\n', textlen
);
163 /* no line break, end of input, no text left before end
164 * => don't insert an empty line at the end */
167 /* no line break, end of input, but some text left */
170 /* continue reading */
173 /* eol is at a line end now, either \n => \0 or \0\0\0 */
174 assert(eol
&& eol
<= bufvalid
);
182 vtysh_config_parse_line (buf
);
188 memmove (buf
, eol
, bufvalid
- eol
);
189 bufvalid
-= eol
- buf
;
194 if (bufvalid
== buf
+ bufsz
)
200 new = XMALLOC (MTYPE_TMP
, bufsz
);
201 memcpy (new, stackbuf
, sizeof(stackbuf
));
204 new = XREALLOC (MTYPE_TMP
, buf
, bufsz
);
206 bufvalid
= bufvalid
- buf
+ new;
208 /* if end != NULL, we won't be reading more data... */
209 assert (end
== NULL
);
216 vclient_close (vclient
);
220 XFREE (MTYPE_TMP
, buf
);
225 vtysh_client_run_all (struct vtysh_client
*head_client
, const char *line
,
226 int continue_on_err
, FILE *fp
)
228 struct vtysh_client
*client
;
229 int rc
, rc_all
= CMD_SUCCESS
;
231 for (client
= head_client
; client
; client
= client
->next
)
233 rc
= vtysh_client_run(client
, line
, fp
);
234 if (rc
!= CMD_SUCCESS
)
236 if (!continue_on_err
)
245 vtysh_client_execute (struct vtysh_client
*head_client
, const char *line
,
248 return vtysh_client_run_all (head_client
, line
, 0, fp
);
252 vtysh_client_config (struct vtysh_client
*head_client
, char *line
)
254 vtysh_client_run_all (head_client
, line
, 1, NULL
);
258 vtysh_pager_init (void)
262 pager_defined
= getenv ("VTYSH_PAGER");
265 vtysh_pager_name
= strdup (pager_defined
);
267 vtysh_pager_name
= strdup ("more");
270 /* Command execution over the vty interface. */
272 vtysh_execute_func (const char *line
, int pager
)
277 const struct cmd_element
*cmd
;
281 int saved_ret
, saved_node
;
283 /* Split readline string up into the vector. */
284 vline
= cmd_make_strvec (line
);
289 saved_ret
= ret
= cmd_execute_command (vline
, vty
, &cmd
, 1);
290 saved_node
= vty
->node
;
292 /* If command doesn't succeeded in current node, try to walk up in node tree.
293 * Changing vty->node is enough to try it just out without actual walkup in
295 while (ret
!= CMD_SUCCESS
&& ret
!= CMD_SUCCESS_DAEMON
&& ret
!= CMD_WARNING
296 && vty
->node
> CONFIG_NODE
)
298 vty
->node
= node_parent(vty
->node
);
299 ret
= cmd_execute_command (vline
, vty
, &cmd
, 1);
303 vty
->node
= saved_node
;
305 /* If command succeeded in any other node than current (tried > 0) we have
306 * to move into node in the vtysh where it succeeded. */
307 if (ret
== CMD_SUCCESS
|| ret
== CMD_SUCCESS_DAEMON
|| ret
== CMD_WARNING
)
309 if ((saved_node
== BGP_VPNV4_NODE
|| saved_node
== BGP_VPNV6_NODE
310 || saved_node
== BGP_ENCAP_NODE
|| saved_node
== BGP_ENCAPV6_NODE
311 || saved_node
== BGP_IPV4_NODE
312 || saved_node
== BGP_IPV6_NODE
|| saved_node
== BGP_IPV4M_NODE
313 || saved_node
== BGP_IPV4L_NODE
|| saved_node
== BGP_IPV6L_NODE
314 || saved_node
== BGP_IPV6M_NODE
|| saved_node
== BGP_EVPN_NODE
)
317 vtysh_execute("exit-address-family");
319 else if (saved_node
== BGP_VRF_POLICY_NODE
&& (tried
== 1))
321 vtysh_execute("exit-vrf-policy");
323 else if ((saved_node
== BGP_VNC_DEFAULTS_NODE
324 || saved_node
== BGP_VNC_NVE_GROUP_NODE
325 || saved_node
== BGP_VNC_L2_GROUP_NODE
) && (tried
== 1))
327 vtysh_execute("exit-vnc");
329 else if ((saved_node
== KEYCHAIN_KEY_NODE
) && (tried
== 1))
331 vtysh_execute("exit");
335 vtysh_execute ("end");
336 vtysh_execute ("configure terminal");
339 /* If command didn't succeed in any node, continue with return value from
346 cmd_free_strvec (vline
);
352 if (vty
->type
== VTY_FILE
)
353 fprintf (stdout
,"Warning...\n");
355 case CMD_ERR_AMBIGUOUS
:
356 fprintf (stdout
,"%% Ambiguous command.\n");
358 case CMD_ERR_NO_MATCH
:
359 fprintf (stdout
,"%% Unknown command.\n");
361 case CMD_ERR_INCOMPLETE
:
362 fprintf (stdout
,"%% Command incomplete.\n");
364 case CMD_SUCCESS_DAEMON
:
366 /* FIXME: Don't open pager for exit commands. popen() causes problems
367 * if exited from vtysh at all. This hack shouldn't cause any problem
368 * but is really ugly. */
369 if (pager
&& vtysh_pager_name
&& (strncmp(line
, "exit", 4) != 0))
371 fp
= popen (vtysh_pager_name
, "w");
374 perror ("popen failed for pager");
383 if (! strcmp(cmd
->string
,"configure terminal"))
385 for (i
= 0; i
< array_size(vtysh_client
); i
++)
387 cmd_stat
= vtysh_client_execute(&vtysh_client
[i
], line
, fp
);
388 if (cmd_stat
== CMD_WARNING
)
395 vline
= cmd_make_strvec (line
);
399 if (pager
&& vtysh_pager_name
&& fp
&& closepager
)
401 if (pclose (fp
) == -1)
403 perror ("pclose failed for pager");
410 ret
= cmd_execute_command (vline
, vty
, &cmd
, 1);
411 cmd_free_strvec (vline
);
412 if (ret
!= CMD_SUCCESS_DAEMON
)
418 (*cmd
->func
) (cmd
, vty
, 0, NULL
);
423 cmd_stat
= CMD_SUCCESS
;
424 for (i
= 0; i
< array_size(vtysh_client
); i
++)
426 if (cmd
->daemon
& vtysh_client
[i
].flag
)
428 cmd_stat
= vtysh_client_execute(&vtysh_client
[i
], line
, fp
);
429 if (cmd_stat
!= CMD_SUCCESS
)
433 if (cmd_stat
!= CMD_SUCCESS
)
437 (*cmd
->func
) (cmd
, vty
, 0, NULL
);
440 if (pager
&& vtysh_pager_name
&& fp
&& closepager
)
442 if (pclose (fp
) == -1)
444 perror ("pclose failed for pager");
452 vtysh_execute_no_pager (const char *line
)
454 return vtysh_execute_func (line
, 0);
458 vtysh_execute (const char *line
)
460 return vtysh_execute_func (line
, 1);
475 while (end
>= s
&& isspace(*end
))
479 while (*s
&& isspace(*s
))
486 vtysh_mark_file (const char *filename
)
493 const struct cmd_element
*cmd
;
494 int saved_ret
, prev_node
;
496 char *vty_buf_copy
= NULL
;
497 char *vty_buf_trimmed
= NULL
;
499 if (strncmp("-", filename
, 1) == 0)
502 confp
= fopen (filename
, "r");
506 fprintf (stderr
, "%% Can't open config file %s due to '%s'.\n",
507 filename
, safe_strerror (errno
));
508 return (CMD_ERR_NO_FILE
);
512 vty
->fd
= 0; /* stdout */
513 vty
->type
= VTY_TERM
;
514 vty
->node
= CONFIG_NODE
;
516 vtysh_execute_no_pager ("enable");
517 vtysh_execute_no_pager ("configure terminal");
518 vty_buf_copy
= XCALLOC (MTYPE_VTYSH_CMD
, VTY_BUFSIZ
);
520 while (fgets (vty
->buf
, VTY_BUFSIZ
, confp
))
524 strcpy(vty_buf_copy
, vty
->buf
);
525 vty_buf_trimmed
= trim(vty_buf_copy
);
527 if (vty_buf_trimmed
[0] == '!' || vty_buf_trimmed
[0] == '#')
529 fprintf(stdout
, "%s", vty
->buf
);
533 /* Split readline string up into the vector. */
534 vline
= cmd_make_strvec (vty
->buf
);
538 fprintf(stdout
, "%s", vty
->buf
);
542 /* Ignore the "end" lines, we will generate these where appropriate */
543 if (strlen(vty_buf_trimmed
) == 3 && strncmp("end", vty_buf_trimmed
, 3) == 0)
548 prev_node
= vty
->node
;
549 saved_ret
= ret
= cmd_execute_command_strict (vline
, vty
, &cmd
);
551 /* If command doesn't succeeded in current node, try to walk up in node tree.
552 * Changing vty->node is enough to try it just out without actual walkup in
554 while (ret
!= CMD_SUCCESS
&& ret
!= CMD_SUCCESS_DAEMON
&& ret
!= CMD_WARNING
555 && vty
->node
> CONFIG_NODE
)
557 vty
->node
= node_parent(vty
->node
);
558 ret
= cmd_execute_command_strict (vline
, vty
, &cmd
);
562 /* If command succeeded in any other node than current (tried > 0) we have
563 * to move into node in the vtysh where it succeeded. */
564 if (ret
== CMD_SUCCESS
|| ret
== CMD_SUCCESS_DAEMON
|| ret
== CMD_WARNING
)
566 if ((prev_node
== BGP_VPNV4_NODE
|| prev_node
== BGP_IPV4_NODE
567 || prev_node
== BGP_IPV6_NODE
|| prev_node
== BGP_IPV4M_NODE
568 || prev_node
== BGP_IPV6M_NODE
|| prev_node
== BGP_VPNV6_NODE
569 || prev_node
== BGP_EVPN_NODE
)
572 fprintf(stdout
, "exit-address-family\n");
574 else if ((prev_node
== KEYCHAIN_KEY_NODE
) && (tried
== 1))
576 fprintf(stdout
, "exit\n");
580 fprintf(stdout
, "end\n");
583 /* If command didn't succeed in any node, continue with return value from
588 vty
->node
= prev_node
;
591 cmd_free_strvec (vline
);
595 if (vty
->type
== VTY_FILE
)
596 fprintf (stderr
,"line %d: Warning...: %s\n", lineno
, vty
->buf
);
599 XFREE(MTYPE_VTYSH_CMD
, vty_buf_copy
);
601 case CMD_ERR_AMBIGUOUS
:
602 fprintf (stderr
,"line %d: %% Ambiguous command: %s\n", lineno
, vty
->buf
);
605 XFREE(MTYPE_VTYSH_CMD
, vty_buf_copy
);
606 return CMD_ERR_AMBIGUOUS
;
607 case CMD_ERR_NO_MATCH
:
608 fprintf (stderr
,"line %d: %% Unknown command: %s\n", lineno
, vty
->buf
);
611 XFREE(MTYPE_VTYSH_CMD
, vty_buf_copy
);
612 return CMD_ERR_NO_MATCH
;
613 case CMD_ERR_INCOMPLETE
:
614 fprintf (stderr
,"line %d: %% Command incomplete: %s\n", lineno
, vty
->buf
);
617 XFREE(MTYPE_VTYSH_CMD
, vty_buf_copy
);
618 return CMD_ERR_INCOMPLETE
;
620 fprintf(stdout
, "%s", vty
->buf
);
622 case CMD_SUCCESS_DAEMON
:
625 int cmd_stat
= CMD_SUCCESS
;
627 fprintf(stdout
, "%s", vty
->buf
);
628 for (i
= 0; i
< array_size(vtysh_client
); i
++)
630 if (cmd
->daemon
& vtysh_client
[i
].flag
)
632 cmd_stat
= vtysh_client_execute (&vtysh_client
[i
],
634 if (cmd_stat
!= CMD_SUCCESS
)
638 if (cmd_stat
!= CMD_SUCCESS
)
642 (*cmd
->func
) (cmd
, vty
, 0, NULL
);
646 /* This is the end */
647 fprintf(stdout
, "end\n");
649 XFREE(MTYPE_VTYSH_CMD
, vty_buf_copy
);
657 /* Configration make from file. */
659 vtysh_config_from_file (struct vty
*vty
, FILE *fp
)
662 const struct cmd_element
*cmd
;
664 int retcode
= CMD_SUCCESS
;
666 while (fgets (vty
->buf
, VTY_BUFSIZ
, fp
))
670 ret
= command_config_read_one_line (vty
, &cmd
, 1);
675 if (vty
->type
== VTY_FILE
)
676 fprintf (stderr
,"line %d: Warning[%d]...: %s\n", lineno
, vty
->node
, vty
->buf
);
677 retcode
= CMD_WARNING
; /* once we have an error, we remember & return that */
679 case CMD_ERR_AMBIGUOUS
:
680 fprintf (stderr
,"line %d: %% Ambiguous command[%d]: %s\n", lineno
, vty
->node
, vty
->buf
);
681 retcode
= CMD_ERR_AMBIGUOUS
; /* once we have an error, we remember & return that */
683 case CMD_ERR_NO_MATCH
:
684 fprintf (stderr
,"line %d: %% Unknown command[%d]: %s", lineno
, vty
->node
, vty
->buf
);
685 retcode
= CMD_ERR_NO_MATCH
; /* once we have an error, we remember & return that */
687 case CMD_ERR_INCOMPLETE
:
688 fprintf (stderr
,"line %d: %% Command incomplete[%d]: %s\n", lineno
, vty
->node
, vty
->buf
);
689 retcode
= CMD_ERR_INCOMPLETE
; /* once we have an error, we remember & return that */
691 case CMD_SUCCESS_DAEMON
:
694 int cmd_stat
= CMD_SUCCESS
;
696 for (i
= 0; i
< array_size(vtysh_client
); i
++)
698 if (cmd
->daemon
& vtysh_client
[i
].flag
)
700 cmd_stat
= vtysh_client_execute (&vtysh_client
[i
],
703 * CMD_WARNING - Can mean that the command was
704 * parsed successfully but it was already entered
705 * in a few spots. As such if we receive a
706 * CMD_WARNING from a daemon we shouldn't stop
707 * talking to the other daemons for the particular
710 if (cmd_stat
!= CMD_SUCCESS
&& cmd_stat
!= CMD_WARNING
)
712 fprintf (stderr
, "line %d: Failure to communicate[%d] to %s, line: %s\n",
713 lineno
, cmd_stat
, vtysh_client
[i
].name
, vty
->buf
);
718 if (cmd_stat
!= CMD_SUCCESS
)
722 (*cmd
->func
) (cmd
, vty
, 0, NULL
);
730 /* We don't care about the point of the cursor when '?' is typed. */
732 vtysh_rl_describe (void)
739 struct cmd_token
*token
;
741 vline
= cmd_make_strvec (rl_line_buffer
);
743 /* In case of '> ?'. */
746 vline
= vector_init (1);
747 vector_set (vline
, NULL
);
750 if (rl_end
&& isspace ((int) rl_line_buffer
[rl_end
- 1]))
751 vector_set (vline
, NULL
);
753 describe
= cmd_describe_command (vline
, vty
, &ret
);
755 fprintf (stdout
,"\n");
757 /* Ambiguous and no match error. */
760 case CMD_ERR_AMBIGUOUS
:
761 cmd_free_strvec (vline
);
762 fprintf (stdout
,"%% Ambiguous command.\n");
766 case CMD_ERR_NO_MATCH
:
767 cmd_free_strvec (vline
);
768 fprintf (stdout
,"%% There is no matched command.\n");
774 /* Get width of command string. */
776 for (i
= 0; i
< vector_active (describe
); i
++)
777 if ((token
= vector_slot (describe
, i
)) != NULL
)
779 if (token
->text
[0] == '\0')
782 int len
= strlen (token
->text
);
788 for (i
= 0; i
< vector_active (describe
); i
++)
789 if ((token
= vector_slot (describe
, i
)) != NULL
)
792 fprintf (stdout
," %-s\n",
795 fprintf (stdout
," %-*s %s\n",
801 cmd_free_strvec (vline
);
802 vector_free (describe
);
809 /* Result of cmd_complete_command() call will be stored here
810 * and used in new_completion() in order to put the space in
811 * correct places only. */
815 command_generator (const char *text
, int state
)
818 static char **matched
= NULL
;
819 static int index
= 0;
826 if (vty
->node
== AUTH_NODE
|| vty
->node
== AUTH_ENABLE_NODE
)
829 vline
= cmd_make_strvec (rl_line_buffer
);
833 if (rl_end
&& isspace ((int) rl_line_buffer
[rl_end
- 1]))
834 vector_set (vline
, NULL
);
836 matched
= cmd_complete_command (vline
, vty
, &complete_status
);
837 cmd_free_strvec (vline
);
840 if (matched
&& matched
[index
])
841 return matched
[index
++];
843 XFREE (MTYPE_TMP
, matched
);
850 new_completion (char *text
, int start
, int end
)
854 matches
= rl_completion_matches (text
, command_generator
);
859 if (complete_status
!= CMD_COMPLETE_FULL_MATCH
)
860 /* only append a space on full match */
861 rl_completion_append_character
= '\0';
867 /* Vty node structures. */
868 static struct cmd_node bgp_node
=
871 "%s(config-router)# ",
874 static struct cmd_node rip_node
=
877 "%s(config-router)# ",
880 static struct cmd_node isis_node
=
883 "%s(config-router)# ",
886 static struct cmd_node interface_node
=
892 static struct cmd_node ns_node
=
895 "%s(config-logical-router)# ",
898 static struct cmd_node vrf_node
=
904 static struct cmd_node rmap_node
=
907 "%s(config-route-map)# "
910 static struct cmd_node zebra_node
=
913 "%s(config-router)# "
916 static struct cmd_node bgp_vpnv4_node
=
919 "%s(config-router-af)# "
922 static struct cmd_node bgp_vpnv6_node
=
925 "%s(config-router-af)# "
928 static struct cmd_node bgp_encap_node
=
931 "%s(config-router-af)# "
934 static struct cmd_node bgp_encapv6_node
=
937 "%s(config-router-af)# "
940 static struct cmd_node bgp_ipv4_node
=
943 "%s(config-router-af)# "
946 static struct cmd_node bgp_ipv4m_node
=
949 "%s(config-router-af)# "
952 static struct cmd_node bgp_ipv4l_node
=
955 "%s(config-router-af)# "
958 static struct cmd_node bgp_ipv6_node
=
961 "%s(config-router-af)# "
964 static struct cmd_node bgp_ipv6m_node
=
967 "%s(config-router-af)# "
970 static struct cmd_node bgp_evpn_node
=
973 "%s(config-router-af)# "
976 static struct cmd_node bgp_ipv6l_node
=
979 "%s(config-router-af)# "
982 static struct cmd_node bgp_vnc_defaults_node
=
984 BGP_VNC_DEFAULTS_NODE
,
985 "%s(config-router-vnc-defaults)# "
988 static struct cmd_node bgp_vnc_nve_group_node
=
990 BGP_VNC_NVE_GROUP_NODE
,
991 "%s(config-router-vnc-nve-group)# "
994 static struct cmd_node bgp_vrf_policy_node
= {
996 "%s(config-router-vrf-policy)# "
999 static struct cmd_node bgp_vnc_l2_group_node
=
1001 BGP_VNC_L2_GROUP_NODE
,
1002 "%s(config-router-vnc-l2-group)# "
1005 static struct cmd_node ospf_node
=
1008 "%s(config-router)# "
1011 static struct cmd_node eigrp_node
=
1014 "%s(config-router)# "
1017 static struct cmd_node ripng_node
=
1020 "%s(config-router)# "
1023 static struct cmd_node ospf6_node
=
1026 "%s(config-ospf6)# "
1029 static struct cmd_node ldp_node
=
1035 static struct cmd_node ldp_ipv4_node
=
1038 "%s(config-ldp-af)# "
1041 static struct cmd_node ldp_ipv6_node
=
1044 "%s(config-ldp-af)# "
1047 static struct cmd_node ldp_ipv4_iface_node
=
1049 LDP_IPV4_IFACE_NODE
,
1050 "%s(config-ldp-af-if)# "
1053 static struct cmd_node ldp_ipv6_iface_node
=
1055 LDP_IPV6_IFACE_NODE
,
1056 "%s(config-ldp-af-if)# "
1059 static struct cmd_node ldp_l2vpn_node
=
1062 "%s(config-l2vpn)# "
1065 static struct cmd_node ldp_pseudowire_node
=
1067 LDP_PSEUDOWIRE_NODE
,
1068 "%s(config-l2vpn-pw)# "
1071 static struct cmd_node keychain_node
=
1074 "%s(config-keychain)# "
1077 static struct cmd_node keychain_key_node
=
1080 "%s(config-keychain-key)# "
1083 struct cmd_node link_params_node
=
1086 "%s(config-link-params)# ",
1089 /* Defined in lib/vty.c */
1090 extern struct cmd_node vty_node
;
1092 /* When '^Z' is received from vty, move down to the enable mode. */
1100 /* Nothing to do. */
1103 vty
->node
= ENABLE_NODE
;
1109 DEFUNSH (VTYSH_REALLYALL
,
1113 "End current mode and change to enable mode\n")
1115 return vtysh_end ();
1118 DEFUNSH (VTYSH_BGPD
,
1121 "router bgp [(1-4294967295) [<view|vrf> WORD]]",
1125 "BGP view\nBGP VRF\n"
1128 vty
->node
= BGP_NODE
;
1132 DEFUNSH (VTYSH_BGPD
,
1133 address_family_vpnv4
,
1134 address_family_vpnv4_cmd
,
1135 "address-family vpnv4 [unicast]",
1136 "Enter Address Family command mode\n"
1138 "Address Family modifier\n")
1140 vty
->node
= BGP_VPNV4_NODE
;
1144 DEFUNSH (VTYSH_BGPD
,
1145 address_family_vpnv6
,
1146 address_family_vpnv6_cmd
,
1147 "address-family vpnv6 [unicast]",
1148 "Enter Address Family command mode\n"
1150 "Address Family modifier\n")
1152 vty
->node
= BGP_VPNV6_NODE
;
1156 DEFUNSH (VTYSH_BGPD
,
1157 address_family_encapv4
,
1158 address_family_encapv4_cmd
,
1159 "address-family <encap|encapv4>",
1160 "Enter Address Family command mode\n"
1164 vty
->node
= BGP_ENCAP_NODE
;
1168 DEFUNSH (VTYSH_BGPD
,
1169 address_family_encapv6
,
1170 address_family_encapv6_cmd
,
1171 "address-family encapv6",
1172 "Enter Address Family command mode\n"
1175 vty
->node
= BGP_ENCAPV6_NODE
;
1179 DEFUNSH (VTYSH_BGPD
,
1180 address_family_ipv4
,
1181 address_family_ipv4_cmd
,
1182 "address-family ipv4 [<unicast|multicast|vpn|encap|labeled-unicast>]",
1183 "Enter Address Family command mode\n"
1185 "Address Family modifier\n"
1186 "Address Family modifier\n"
1187 "Address Family modifier\n"
1188 "Address Family modifier\n"
1189 "Address Family modifier\n")
1193 if (argv_find (argv
, argc
, "multicast", &idx
))
1194 vty
->node
= BGP_IPV4M_NODE
;
1196 else if (argv_find (argv
, argc
, "encap", &idx
))
1197 vty
->node
= BGP_ENCAP_NODE
;
1199 else if (argv_find (argv
, argc
, "vpn", &idx
))
1200 vty
->node
= BGP_VPNV4_NODE
;
1202 else if (argv_find (argv
, argc
, "labeled-unicast", &idx
))
1203 vty
->node
= BGP_IPV4L_NODE
;
1206 vty
->node
= BGP_IPV4_NODE
;
1211 DEFUNSH (VTYSH_BGPD
,
1212 address_family_ipv6
,
1213 address_family_ipv6_cmd
,
1214 "address-family ipv6 [<unicast|multicast|vpn|encap|labeled-unicast>]",
1215 "Enter Address Family command mode\n"
1217 "Address Family modifier\n"
1218 "Address Family modifier\n"
1219 "Address Family modifier\n"
1220 "Address Family modifier\n"
1221 "Address Family modifier\n")
1225 if (argv_find (argv
, argc
, "multicast", &idx
))
1226 vty
->node
= BGP_IPV6M_NODE
;
1228 else if (argv_find (argv
, argc
, "encap", &idx
))
1229 vty
->node
= BGP_ENCAPV6_NODE
;
1231 else if (argv_find (argv
, argc
, "vpn", &idx
))
1232 vty
->node
= BGP_VPNV6_NODE
;
1234 else if (argv_find (argv
, argc
, "labeled-unicast", &idx
))
1235 vty
->node
= BGP_IPV6L_NODE
;
1238 vty
->node
= BGP_IPV6_NODE
;
1243 DEFUNSH (VTYSH_BGPD
,
1244 address_family_evpn
,
1245 address_family_evpn_cmd
,
1246 "address-family <l2vpn evpn>",
1247 "Enter Address Family command mode\n"
1248 "EVPN Address family\n"
1249 "Layer2 VPN Address family\n"
1250 "Ethernet Virtual Private Network Subsequent Address Family\n")
1252 vty
->node
= BGP_EVPN_NODE
;
1256 #if defined (ENABLE_BGP_VNC)
1257 DEFUNSH (VTYSH_BGPD
,
1261 "VNC/RFP related configuration\n"
1262 "Configure default NVE group\n")
1264 vty
->node
= BGP_VNC_DEFAULTS_NODE
;
1268 DEFUNSH (VTYSH_BGPD
,
1271 "vnc nve-group NAME",
1272 "VNC/RFP related configuration\n"
1273 "Configure a NVE group\n"
1276 vty
->node
= BGP_VNC_NVE_GROUP_NODE
;
1280 DEFUNSH (VTYSH_BGPD
,
1284 "Configure a VRF policy group\n"
1287 vty
->node
= BGP_VRF_POLICY_NODE
;
1291 DEFUNSH (VTYSH_BGPD
,
1294 "vnc l2-group NAME",
1295 "VNC/RFP related configuration\n"
1296 "Configure a L2 group\n"
1299 vty
->node
= BGP_VNC_L2_GROUP_NODE
;
1304 DEFUNSH (VTYSH_RIPD
,
1308 "Authentication key management\n"
1309 "Key-chain management\n"
1312 vty
->node
= KEYCHAIN_NODE
;
1316 DEFUNSH (VTYSH_RIPD
,
1319 "key (0-2147483647)",
1321 "Key identifier number\n")
1323 vty
->node
= KEYCHAIN_KEY_NODE
;
1327 DEFUNSH (VTYSH_RIPD
,
1334 vty
->node
= RIP_NODE
;
1338 DEFUNSH (VTYSH_RIPNGD
,
1345 vty
->node
= RIPNG_NODE
;
1349 DEFUNSH (VTYSH_OSPFD
,
1352 "router ospf [(1-65535)]",
1353 "Enable a routing process\n"
1354 "Start OSPF configuration\n"
1357 vty
->node
= OSPF_NODE
;
1361 DEFUNSH (VTYSH_EIGRPD
,
1364 "router eigrp (1-65535)",
1365 "Enable a routing process\n"
1366 "Start EIGRP configuration\n"
1367 "AS number to use\n")
1369 vty
->node
= EIGRP_NODE
;
1373 DEFUNSH (VTYSH_OSPF6D
,
1380 vty
->node
= OSPF6_NODE
;
1384 #if defined (HAVE_LDPD)
1385 DEFUNSH (VTYSH_LDPD
,
1389 "Global MPLS configuration subcommands\n"
1390 "Label Distribution Protocol\n")
1392 vty
->node
= LDP_NODE
;
1396 DEFUNSH (VTYSH_LDPD
,
1397 ldp_address_family_ipv4
,
1398 ldp_address_family_ipv4_cmd
,
1399 "address-family ipv4",
1400 "Configure Address Family and its parameters\n"
1403 vty
->node
= LDP_IPV4_NODE
;
1407 DEFUNSH (VTYSH_LDPD
,
1408 ldp_address_family_ipv6
,
1409 ldp_address_family_ipv6_cmd
,
1410 "address-family ipv6",
1411 "Configure Address Family and its parameters\n"
1414 vty
->node
= LDP_IPV6_NODE
;
1418 DEFUNSH (VTYSH_LDPD
,
1419 ldp_interface_ifname
,
1420 ldp_interface_ifname_cmd
,
1422 "Enable LDP on an interface and enter interface submode\n"
1423 "Interface's name\n")
1428 vty
->node
= LDP_IPV4_IFACE_NODE
;
1431 vty
->node
= LDP_IPV6_IFACE_NODE
;
1440 DEFUNSH (VTYSH_LDPD
,
1441 ldp_l2vpn_word_type_vpls
,
1442 ldp_l2vpn_word_type_vpls_cmd
,
1443 "l2vpn WORD type vpls",
1444 "Configure l2vpn commands\n"
1447 "Virtual Private LAN Service\n")
1449 vty
->node
= LDP_L2VPN_NODE
;
1453 DEFUNSH (VTYSH_LDPD
,
1454 ldp_member_pseudowire_ifname
,
1455 ldp_member_pseudowire_ifname_cmd
,
1456 "member pseudowire IFNAME",
1457 "L2VPN member configuration\n"
1458 "Pseudowire interface\n"
1459 "Interface's name\n")
1461 vty
->node
= LDP_PSEUDOWIRE_NODE
;
1466 DEFUNSH (VTYSH_ISISD
,
1472 "ISO Routing area tag")
1474 vty
->node
= ISIS_NODE
;
1478 DEFUNSH (VTYSH_RMAP
,
1480 vtysh_route_map_cmd
,
1481 "route-map WORD <deny|permit> (1-65535)",
1482 "Create route-map or enter route-map command mode\n"
1484 "Route map denies set operations\n"
1485 "Route map permits set operations\n"
1486 "Sequence to insert to/delete from existing route-map entry\n")
1488 vty
->node
= RMAP_NODE
;
1496 "Configure a terminal line\n"
1497 "Virtual terminal\n")
1499 vty
->node
= VTY_NODE
;
1503 DEFUNSH (VTYSH_REALLYALL
,
1507 "Turn on privileged mode command\n")
1509 vty
->node
= ENABLE_NODE
;
1513 DEFUNSH (VTYSH_REALLYALL
,
1517 "Turn off privileged mode command\n")
1519 if (vty
->node
== ENABLE_NODE
)
1520 vty
->node
= VIEW_NODE
;
1524 DEFUNSH (VTYSH_REALLYALL
,
1525 vtysh_config_terminal
,
1526 vtysh_config_terminal_cmd
,
1527 "configure terminal",
1528 "Configuration from vty interface\n"
1529 "Configuration terminal\n")
1531 vty
->node
= CONFIG_NODE
;
1536 vtysh_exit (struct vty
*vty
)
1545 vty
->node
= ENABLE_NODE
;
1547 case INTERFACE_NODE
:
1558 case LDP_L2VPN_NODE
:
1564 vtysh_execute("end");
1565 vtysh_execute("configure terminal");
1566 vty
->node
= CONFIG_NODE
;
1568 case BGP_VPNV4_NODE
:
1569 case BGP_VPNV6_NODE
:
1570 case BGP_ENCAP_NODE
:
1571 case BGP_ENCAPV6_NODE
:
1573 case BGP_IPV4M_NODE
:
1574 case BGP_IPV4L_NODE
:
1576 case BGP_IPV6M_NODE
:
1577 case BGP_IPV6L_NODE
:
1578 case BGP_VRF_POLICY_NODE
:
1580 case BGP_VNC_DEFAULTS_NODE
:
1581 case BGP_VNC_NVE_GROUP_NODE
:
1582 case BGP_VNC_L2_GROUP_NODE
:
1583 vty
->node
= BGP_NODE
;
1587 vty
->node
= LDP_NODE
;
1589 case LDP_IPV4_IFACE_NODE
:
1590 vty
->node
= LDP_IPV4_NODE
;
1592 case LDP_IPV6_IFACE_NODE
:
1593 vty
->node
= LDP_IPV6_NODE
;
1595 case LDP_PSEUDOWIRE_NODE
:
1596 vty
->node
= LDP_L2VPN_NODE
;
1598 case KEYCHAIN_KEY_NODE
:
1599 vty
->node
= KEYCHAIN_NODE
;
1601 case LINK_PARAMS_NODE
:
1602 vty
->node
= INTERFACE_NODE
;
1610 DEFUNSH (VTYSH_REALLYALL
,
1614 "Exit current mode and down to previous mode\n")
1616 return vtysh_exit (vty
);
1623 "Exit current mode and down to previous mode\n")
1625 return vtysh_exit_all (self
, vty
, argc
, argv
);
1628 DEFUNSH (VTYSH_BGPD
,
1629 exit_address_family
,
1630 exit_address_family_cmd
,
1631 "exit-address-family",
1632 "Exit from Address Family configuration mode\n")
1634 if (vty
->node
== BGP_IPV4_NODE
1635 || vty
->node
== BGP_IPV4M_NODE
1636 || vty
->node
== BGP_IPV4L_NODE
1637 || vty
->node
== BGP_VPNV4_NODE
1638 || vty
->node
== BGP_VPNV6_NODE
1639 || vty
->node
== BGP_ENCAP_NODE
1640 || vty
->node
== BGP_ENCAPV6_NODE
1641 || vty
->node
== BGP_IPV6_NODE
1642 || vty
->node
== BGP_IPV6L_NODE
1643 || vty
->node
== BGP_IPV6M_NODE
)
1644 vty
->node
= BGP_NODE
;
1648 DEFUNSH (VTYSH_BGPD
,
1650 exit_vnc_config_cmd
,
1652 "Exit from VNC configuration mode\n")
1654 if (vty
->node
== BGP_VNC_DEFAULTS_NODE
1655 || vty
->node
== BGP_VNC_NVE_GROUP_NODE
1656 || vty
->node
== BGP_VNC_L2_GROUP_NODE
)
1657 vty
->node
= BGP_NODE
;
1661 DEFUNSH (VTYSH_BGPD
,
1663 exit_vrf_policy_cmd
,
1665 "Exit from VRF configuration mode\n")
1667 if (vty
->node
== BGP_VRF_POLICY_NODE
)
1668 vty
->node
= BGP_NODE
;
1672 DEFUNSH (VTYSH_RIPD
,
1674 vtysh_exit_ripd_cmd
,
1676 "Exit current mode and down to previous mode\n")
1678 return vtysh_exit (vty
);
1681 DEFUNSH (VTYSH_RIPD
,
1683 vtysh_quit_ripd_cmd
,
1685 "Exit current mode and down to previous mode\n")
1687 return vtysh_exit_ripd (self
, vty
, argc
, argv
);
1690 DEFUNSH (VTYSH_RIPNGD
,
1692 vtysh_exit_ripngd_cmd
,
1694 "Exit current mode and down to previous mode\n")
1696 return vtysh_exit (vty
);
1699 DEFUNSH (VTYSH_RIPNGD
,
1701 vtysh_quit_ripngd_cmd
,
1703 "Exit current mode and down to previous mode\n")
1705 return vtysh_exit_ripngd (self
, vty
, argc
, argv
);
1708 DEFUNSH (VTYSH_RMAP
,
1710 vtysh_exit_rmap_cmd
,
1712 "Exit current mode and down to previous mode\n")
1714 return vtysh_exit (vty
);
1717 DEFUNSH (VTYSH_RMAP
,
1719 vtysh_quit_rmap_cmd
,
1721 "Exit current mode and down to previous mode\n")
1723 return vtysh_exit_rmap (self
, vty
, argc
, argv
);
1726 DEFUNSH (VTYSH_BGPD
,
1728 vtysh_exit_bgpd_cmd
,
1730 "Exit current mode and down to previous mode\n")
1732 return vtysh_exit (vty
);
1735 DEFUNSH (VTYSH_BGPD
,
1737 vtysh_quit_bgpd_cmd
,
1739 "Exit current mode and down to previous mode\n")
1741 return vtysh_exit_bgpd (self
, vty
, argc
, argv
);
1744 DEFUNSH (VTYSH_OSPFD
,
1746 vtysh_exit_ospfd_cmd
,
1748 "Exit current mode and down to previous mode\n")
1750 return vtysh_exit (vty
);
1753 DEFUNSH (VTYSH_OSPFD
,
1755 vtysh_quit_ospfd_cmd
,
1757 "Exit current mode and down to previous mode\n")
1759 return vtysh_exit_ospfd (self
, vty
, argc
, argv
);
1762 DEFUNSH (VTYSH_EIGRPD
,
1764 vtysh_exit_eigrpd_cmd
,
1766 "Exit current mode and down to previous mode\n")
1768 return vtysh_exit (vty
);
1771 DEFUNSH (VTYSH_EIGRPD
,
1773 vtysh_quit_eigrpd_cmd
,
1775 "Exit current mode and down to previous mode\n")
1777 return vtysh_exit (vty
);
1780 DEFUNSH (VTYSH_OSPF6D
,
1782 vtysh_exit_ospf6d_cmd
,
1784 "Exit current mode and down to previous mode\n")
1786 return vtysh_exit (vty
);
1789 DEFUNSH (VTYSH_OSPF6D
,
1791 vtysh_quit_ospf6d_cmd
,
1793 "Exit current mode and down to previous mode\n")
1795 return vtysh_exit_ospf6d (self
, vty
, argc
, argv
);
1798 #if defined (HAVE_LDPD)
1799 DEFUNSH (VTYSH_LDPD
,
1801 vtysh_exit_ldpd_cmd
,
1803 "Exit current mode and down to previous mode\n")
1805 return vtysh_exit (vty
);
1808 ALIAS (vtysh_exit_ldpd
,
1809 vtysh_quit_ldpd_cmd
,
1811 "Exit current mode and down to previous mode\n")
1814 DEFUNSH (VTYSH_ISISD
,
1816 vtysh_exit_isisd_cmd
,
1818 "Exit current mode and down to previous mode\n")
1820 return vtysh_exit (vty
);
1823 DEFUNSH (VTYSH_ISISD
,
1825 vtysh_quit_isisd_cmd
,
1827 "Exit current mode and down to previous mode\n")
1829 return vtysh_exit_isisd (self
, vty
, argc
, argv
);
1833 vtysh_exit_line_vty
,
1834 vtysh_exit_line_vty_cmd
,
1836 "Exit current mode and down to previous mode\n")
1838 return vtysh_exit (vty
);
1842 vtysh_quit_line_vty
,
1843 vtysh_quit_line_vty_cmd
,
1845 "Exit current mode and down to previous mode\n")
1847 return vtysh_exit_line_vty (self
, vty
, argc
, argv
);
1850 DEFUNSH (VTYSH_INTERFACE
,
1852 vtysh_interface_cmd
,
1853 "interface IFNAME [vrf NAME]",
1854 "Select an interface to configure\n"
1855 "Interface's name\n"
1858 vty
->node
= INTERFACE_NODE
;
1862 /* TODO Implement "no interface command in isisd. */
1863 DEFSH (VTYSH_ZEBRA
|VTYSH_RIPD
|VTYSH_RIPNGD
|VTYSH_OSPFD
|VTYSH_OSPF6D
|VTYSH_EIGRPD
,
1864 vtysh_no_interface_cmd
,
1865 "no interface IFNAME",
1867 "Delete a pseudo interface's configuration\n"
1868 "Interface's name\n")
1871 vtysh_no_interface_vrf_cmd
,
1872 "no interface IFNAME vrf NAME",
1874 "Delete a pseudo interface's configuration\n"
1875 "Interface's name\n"
1881 "logical-router (1-65535) ns NAME",
1882 "Enable a logical-router\n"
1883 "Specify the logical-router indentifier\n"
1885 "The file name in " NS_RUN_DIR
", or a full pathname\n")
1887 vty
->node
= NS_NODE
;
1895 "Select a VRF to configure\n"
1898 vty
->node
= VRF_NODE
;
1906 "Delete a pseudo vrf's configuration\n"
1913 "Exit current mode and down to previous mode\n")
1915 return vtysh_exit (vty
);
1922 "Exit current mode and down to previous mode\n")
1924 return vtysh_exit_ns(self
, vty
, argc
, argv
);
1931 "Exit current mode and down to previous mode\n")
1933 return vtysh_exit (vty
);
1940 "Exit current mode and down to previous mode\n")
1942 return vtysh_exit_vrf (self
, vty
, argc
, argv
);
1945 /* TODO Implement interface description commands in ripngd, ospf6d
1947 DEFSH (VTYSH_ZEBRA
|VTYSH_RIPD
|VTYSH_OSPFD
|VTYSH_EIGRPD
,
1948 vtysh_interface_desc_cmd
,
1949 "description LINE...",
1950 "Interface specific description\n"
1951 "Characters describing this interface\n")
1953 DEFSH (VTYSH_ZEBRA
|VTYSH_RIPD
|VTYSH_OSPFD
|VTYSH_EIGRPD
,
1954 vtysh_no_interface_desc_cmd
,
1957 "Interface specific description\n")
1959 DEFUNSH (VTYSH_INTERFACE
,
1960 vtysh_exit_interface
,
1961 vtysh_exit_interface_cmd
,
1963 "Exit current mode and down to previous mode\n")
1965 return vtysh_exit (vty
);
1968 DEFUNSH (VTYSH_INTERFACE
,
1969 vtysh_quit_interface
,
1970 vtysh_quit_interface_cmd
,
1972 "Exit current mode and down to previous mode\n")
1974 return vtysh_exit_interface (self
, vty
, argc
, argv
);
1977 DEFUN (vtysh_show_thread
,
1978 vtysh_show_thread_cmd
,
1979 "show thread cpu [FILTER]",
1981 "Thread information\n"
1982 "Thread CPU usage\n"
1983 "Display filter (rwtexb)\n")
1987 int ret
= CMD_SUCCESS
;
1990 sprintf(line
, "show thread cpu %s\n", (argc
== 4) ? argv
[idx_filter
]->arg
: "");
1991 for (i
= 0; i
< array_size(vtysh_client
); i
++)
1992 if ( vtysh_client
[i
].fd
>= 0 )
1994 fprintf (stdout
, "Thread statistics for %s:\n",
1995 vtysh_client
[i
].name
);
1996 ret
= vtysh_client_execute (&vtysh_client
[i
], line
, stdout
);
1997 fprintf (stdout
,"\n");
2002 DEFUN (vtysh_show_work_queues
,
2003 vtysh_show_work_queues_cmd
,
2006 "Work Queue information\n")
2009 int ret
= CMD_SUCCESS
;
2010 char line
[] = "show work-queues\n";
2012 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2013 if ( vtysh_client
[i
].fd
>= 0 )
2015 fprintf (stdout
, "Work queue statistics for %s:\n",
2016 vtysh_client
[i
].name
);
2017 ret
= vtysh_client_execute (&vtysh_client
[i
], line
, stdout
);
2018 fprintf (stdout
,"\n");
2024 DEFUN (vtysh_show_work_queues_daemon
,
2025 vtysh_show_work_queues_daemon_cmd
,
2026 "show work-queues <zebra|ripd|ripngd|ospfd|ospf6d|bgpd|isisd>",
2028 "Work Queue information\n"
2029 "For the zebra daemon\n"
2030 "For the rip daemon\n"
2031 "For the ripng daemon\n"
2032 "For the ospf daemon\n"
2033 "For the ospfv6 daemon\n"
2034 "For the bgp daemon\n"
2035 "For the isis daemon\n")
2037 int idx_protocol
= 2;
2039 int ret
= CMD_SUCCESS
;
2041 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2043 if (strmatch(vtysh_client
[i
].name
, argv
[idx_protocol
]->text
))
2047 ret
= vtysh_client_execute(&vtysh_client
[i
], "show work-queues\n", stdout
);
2052 DEFUNSH (VTYSH_ZEBRA
,
2054 vtysh_link_params_cmd
,
2059 vty
->node
= LINK_PARAMS_NODE
;
2063 DEFUNSH (VTYSH_ZEBRA
,
2065 exit_link_params_cmd
,
2067 "Exit from Link Params configuration node\n")
2069 if (vty
->node
== LINK_PARAMS_NODE
)
2070 vty
->node
= INTERFACE_NODE
;
2075 show_per_daemon (const char *line
, const char *headline
)
2078 int ret
= CMD_SUCCESS
;
2080 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2081 if ( vtysh_client
[i
].fd
>= 0 )
2083 fprintf (stdout
, headline
,
2084 vtysh_client
[i
].name
);
2085 ret
= vtysh_client_execute (&vtysh_client
[i
], line
, stdout
);
2086 fprintf (stdout
,"\n");
2093 DEFUN (vtysh_show_memory
,
2094 vtysh_show_memory_cmd
,
2097 "Memory statistics\n")
2099 return show_per_daemon ("show memory\n", "Memory statistics for %s:\n");
2102 DEFUN (vtysh_show_modules
,
2103 vtysh_show_modules_cmd
,
2108 return show_per_daemon ("show modules\n", "Module information for %s:\n");
2111 /* Logging commands. */
2112 DEFUN (vtysh_show_logging
,
2113 vtysh_show_logging_cmd
,
2116 "Show current logging configuration\n")
2119 int ret
= CMD_SUCCESS
;
2120 char line
[] = "show logging\n";
2122 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2123 if ( vtysh_client
[i
].fd
>= 0 )
2125 fprintf (stdout
,"Logging configuration for %s:\n",
2126 vtysh_client
[i
].name
);
2127 ret
= vtysh_client_execute (&vtysh_client
[i
], line
, stdout
);
2128 fprintf (stdout
,"\n");
2136 vtysh_log_stdout_cmd
,
2139 "Set stdout logging level\n")
2145 vtysh_log_stdout_level
,
2146 vtysh_log_stdout_level_cmd
,
2147 "log stdout <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
2149 "Set stdout logging level\n"
2156 no_vtysh_log_stdout
,
2157 no_vtysh_log_stdout_cmd
,
2158 "no log stdout [LEVEL]",
2161 "Cancel logging to stdout\n"
2170 "log file FILENAME",
2173 "Logging filename\n")
2179 vtysh_log_file_level
,
2180 vtysh_log_file_level_cmd
,
2181 "log file FILENAME <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
2184 "Logging filename\n"
2192 no_vtysh_log_file_cmd
,
2193 "no log file [FILENAME [LEVEL]]",
2196 "Cancel logging to file\n"
2197 "Logging file name\n"
2205 vtysh_log_monitor_cmd
,
2206 "log monitor [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
2208 "Set terminal line (monitor) logging level\n"
2215 no_vtysh_log_monitor
,
2216 no_vtysh_log_monitor_cmd
,
2217 "no log monitor [LEVEL]",
2220 "Disable terminal line (monitor) logging\n"
2228 vtysh_log_syslog_cmd
,
2229 "log syslog [<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>]",
2231 "Set syslog logging level\n"
2238 no_vtysh_log_syslog
,
2239 no_vtysh_log_syslog_cmd
,
2240 "no log syslog [LEVEL]",
2243 "Cancel logging to syslog\n"
2251 vtysh_log_facility_cmd
,
2252 "log facility <kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>",
2254 "Facility parameter for syslog messages\n"
2262 no_vtysh_log_facility
,
2263 no_vtysh_log_facility_cmd
,
2264 "no log facility [FACILITY]",
2267 "Reset syslog facility to default (daemon)\n"
2268 "Syslog facility\n")
2274 DEFUNSH_DEPRECATED (VTYSH_ALL
,
2277 "log trap <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
2279 "(Deprecated) Set logging level and default for all destinations\n"
2286 DEFUNSH_DEPRECATED (VTYSH_ALL
,
2288 no_vtysh_log_trap_cmd
,
2289 "no log trap [LEVEL]",
2292 "Permit all logging information\n"
2299 vtysh_log_record_priority
,
2300 vtysh_log_record_priority_cmd
,
2301 "log record-priority",
2303 "Log the priority of the message within the message\n")
2309 no_vtysh_log_record_priority
,
2310 no_vtysh_log_record_priority_cmd
,
2311 "no log record-priority",
2314 "Do not log the priority of the message within the message\n")
2320 vtysh_log_timestamp_precision
,
2321 vtysh_log_timestamp_precision_cmd
,
2322 "log timestamp precision (0-6)",
2324 "Timestamp configuration\n"
2325 "Set the timestamp precision\n"
2326 "Number of subsecond digits\n")
2332 no_vtysh_log_timestamp_precision
,
2333 no_vtysh_log_timestamp_precision_cmd
,
2334 "no log timestamp precision",
2337 "Timestamp configuration\n"
2338 "Reset the timestamp precision to the default value of 0\n")
2344 vtysh_service_password_encrypt
,
2345 vtysh_service_password_encrypt_cmd
,
2346 "service password-encryption",
2347 "Set up miscellaneous service\n"
2348 "Enable encrypted passwords\n")
2354 no_vtysh_service_password_encrypt
,
2355 no_vtysh_service_password_encrypt_cmd
,
2356 "no service password-encryption",
2358 "Set up miscellaneous service\n"
2359 "Enable encrypted passwords\n")
2365 vtysh_config_password
,
2367 "password (8-8) WORD",
2368 "Assign the terminal connection password\n"
2369 "Specifies a HIDDEN password will follow\n"
2371 "The HIDDEN line password string\n")
2377 vtysh_password_text
,
2378 vtysh_password_text_cmd
,
2380 "Assign the terminal connection password\n"
2381 "The UNENCRYPTED (cleartext) line password\n")
2387 vtysh_config_enable_password
,
2388 vtysh_enable_password_cmd
,
2389 "enable password (8-8) WORD",
2390 "Modify enable password parameters\n"
2391 "Assign the privileged level password\n"
2392 "Specifies a HIDDEN password will follow\n"
2393 "The HIDDEN 'enable' password string\n")
2399 vtysh_enable_password_text
,
2400 vtysh_enable_password_text_cmd
,
2401 "enable password LINE",
2402 "Modify enable password parameters\n"
2403 "Assign the privileged level password\n"
2404 "The UNENCRYPTED (cleartext) 'enable' password\n")
2410 no_vtysh_config_enable_password
,
2411 no_vtysh_enable_password_cmd
,
2412 "no enable password",
2414 "Modify enable password parameters\n"
2415 "Assign the privileged level password\n")
2420 DEFUN (vtysh_write_terminal
,
2421 vtysh_write_terminal_cmd
,
2422 "write terminal [<zebra|ripd|ripngd|ospfd|ospf6d|ldpd|bgpd|isisd|pimd>]",
2423 "Write running configuration to memory, network, or terminal\n"
2424 "Write to terminal\n"
2425 "For the zebra daemon\n"
2426 "For the rip daemon\n"
2427 "For the ripng daemon\n"
2428 "For the ospf daemon\n"
2429 "For the ospfv6 daemon\n"
2430 "For the ldpd daemon\n"
2431 "For the bgp daemon\n"
2432 "For the isis daemon\n"
2433 "For the pim daemon\n")
2436 char line
[] = "write terminal\n";
2439 if (vtysh_pager_name
)
2441 fp
= popen (vtysh_pager_name
, "w");
2451 vty_out (vty
, "Building configuration...%s", VTY_NEWLINE
);
2452 vty_out (vty
, "%sCurrent configuration:%s", VTY_NEWLINE
,
2454 vty_out (vty
, "!%s", VTY_NEWLINE
);
2456 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2457 if ((argc
< 3 ) || (strmatch (vtysh_client
[i
].name
, argv
[2]->text
)))
2458 vtysh_client_config (&vtysh_client
[i
], line
);
2460 /* Integrate vtysh specific configuration. */
2461 vtysh_config_write ();
2463 vtysh_config_dump (fp
);
2465 if (vtysh_pager_name
&& fp
)
2468 if (pclose (fp
) == -1)
2476 vty_out (vty
, "end%s", VTY_NEWLINE
);
2480 DEFUN (vtysh_show_running_config
,
2481 vtysh_show_running_config_cmd
,
2482 "show running-config [<zebra|ripd|ripngd|ospfd|ospf6d|ldpd|bgpd|isisd|pimd>]",
2484 "Current operating configuration\n"
2485 "For the zebra daemon\n"
2486 "For the rip daemon\n"
2487 "For the ripng daemon\n"
2488 "For the ospf daemon\n"
2489 "For the ospfv6 daemon\n"
2490 "For the ldp daemon\n"
2491 "For the bgp daemon\n"
2492 "For the isis daemon\n"
2493 "For the pim daemon\n")
2495 return vtysh_write_terminal (self
, vty
, argc
, argv
);
2498 DEFUN (vtysh_integrated_config
,
2499 vtysh_integrated_config_cmd
,
2500 "service integrated-vtysh-config",
2501 "Set up miscellaneous service\n"
2502 "Write configuration into integrated file\n")
2504 vtysh_write_integrated
= WRITE_INTEGRATED_YES
;
2508 DEFUN (no_vtysh_integrated_config
,
2509 no_vtysh_integrated_config_cmd
,
2510 "no service integrated-vtysh-config",
2512 "Set up miscellaneous service\n"
2513 "Write configuration into integrated file\n")
2515 vtysh_write_integrated
= WRITE_INTEGRATED_NO
;
2520 backup_config_file (const char *fbackup
)
2522 char *integrate_sav
= NULL
;
2524 integrate_sav
= malloc (strlen (fbackup
) +
2525 strlen (CONF_BACKUP_EXT
) + 1);
2526 strcpy (integrate_sav
, fbackup
);
2527 strcat (integrate_sav
, CONF_BACKUP_EXT
);
2529 /* Move current configuration file to backup config file. */
2530 unlink (integrate_sav
);
2531 rename (fbackup
, integrate_sav
);
2532 free (integrate_sav
);
2536 vtysh_write_config_integrated(void)
2539 char line
[] = "write terminal\n";
2542 struct passwd
*pwentry
;
2543 struct group
*grentry
;
2549 fprintf (stdout
,"Building Configuration...\n");
2551 backup_config_file(quagga_config
);
2552 fp
= fopen (quagga_config
, "w");
2555 fprintf (stdout
,"%% Error: failed to open configuration file %s: %s\n",
2556 quagga_config
, safe_strerror(errno
));
2561 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2562 vtysh_client_config (&vtysh_client
[i
], line
);
2564 vtysh_config_write ();
2565 vtysh_config_dump (fp
);
2567 if (fchmod (fd
, CONFIGFILE_MASK
) != 0)
2569 printf ("%% Warning: can't chmod configuration file %s: %s\n",
2570 quagga_config
, safe_strerror(errno
));
2574 pwentry
= getpwnam (FRR_USER
);
2576 uid
= pwentry
->pw_uid
;
2579 printf ("%% Warning: could not look up user \"%s\"\n", FRR_USER
);
2583 grentry
= getgrnam (FRR_GROUP
);
2585 gid
= grentry
->gr_gid
;
2588 printf ("%% Warning: could not look up group \"%s\"\n", FRR_GROUP
);
2592 if (!fstat (fd
, &st
))
2594 if (st
.st_uid
== uid
)
2596 if (st
.st_gid
== gid
)
2598 if ((uid
!= (uid_t
)-1 || gid
!= (gid_t
)-1) && fchown (fd
, uid
, gid
))
2600 printf ("%% Warning: can't chown configuration file %s: %s\n",
2601 quagga_config
, safe_strerror(errno
));
2607 printf ("%% Warning: stat() failed on %s: %s\n",
2608 quagga_config
, safe_strerror(errno
));
2614 printf ("Integrated configuration saved to %s\n", quagga_config
);
2622 static bool want_config_integrated(void)
2626 switch (vtysh_write_integrated
)
2628 case WRITE_INTEGRATED_UNSPECIFIED
:
2629 if (stat(quagga_config
, &s
) && errno
== ENOENT
)
2632 case WRITE_INTEGRATED_NO
:
2634 case WRITE_INTEGRATED_YES
:
2640 DEFUN (vtysh_write_memory
,
2641 vtysh_write_memory_cmd
,
2642 "write [<memory|file>]",
2643 "Write running configuration to memory, network, or terminal\n"
2644 "Write configuration to the file (same as write file)\n"
2645 "Write configuration to the file (same as write memory)\n")
2647 int ret
= CMD_SUCCESS
;
2648 char line
[] = "write memory\n";
2651 fprintf (stdout
, "Note: this version of vtysh never writes vtysh.conf\n");
2653 /* If integrated frr.conf explicitely set. */
2654 if (want_config_integrated())
2657 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2658 if (vtysh_client
[i
].flag
== VTYSH_WATCHFRR
)
2660 if (i
< array_size(vtysh_client
) && vtysh_client
[i
].fd
!= -1)
2661 ret
= vtysh_client_execute (&vtysh_client
[i
], "write integrated", stdout
);
2663 if (ret
!= CMD_SUCCESS
)
2665 printf("\nWarning: attempting direct configuration write without "
2666 "watchfrr.\nFile permissions and ownership may be "
2667 "incorrect, or write may fail.\n\n");
2668 ret
= vtysh_write_config_integrated();
2673 fprintf (stdout
,"Building Configuration...\n");
2675 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2676 ret
= vtysh_client_execute (&vtysh_client
[i
], line
, stdout
);
2681 DEFUN (vtysh_copy_running_config
,
2682 vtysh_copy_running_config_cmd
,
2683 "copy running-config startup-config",
2684 "Copy from one file to another\n"
2685 "Copy from current system configuration\n"
2686 "Copy to startup configuration\n")
2688 return vtysh_write_memory (self
, vty
, argc
, argv
);
2691 DEFUN (vtysh_terminal_length
,
2692 vtysh_terminal_length_cmd
,
2693 "terminal length (0-512)",
2694 "Set terminal line parameters\n"
2695 "Set number of lines on a screen\n"
2696 "Number of lines on screen (0 for no pausing)\n")
2700 char *endptr
= NULL
;
2701 char default_pager
[10];
2703 lines
= strtol (argv
[idx_number
]->arg
, &endptr
, 10);
2704 if (lines
< 0 || lines
> 512 || *endptr
!= '\0')
2706 vty_out (vty
, "length is malformed%s", VTY_NEWLINE
);
2710 if (vtysh_pager_name
)
2712 free (vtysh_pager_name
);
2713 vtysh_pager_name
= NULL
;
2718 snprintf(default_pager
, 10, "more -%i", lines
);
2719 vtysh_pager_name
= strdup (default_pager
);
2725 DEFUN (vtysh_terminal_no_length
,
2726 vtysh_terminal_no_length_cmd
,
2727 "terminal no length",
2728 "Set terminal line parameters\n"
2730 "Set number of lines on a screen\n")
2732 if (vtysh_pager_name
)
2734 free (vtysh_pager_name
);
2735 vtysh_pager_name
= NULL
;
2742 DEFUN (vtysh_show_daemons
,
2743 vtysh_show_daemons_cmd
,
2746 "Show list of running daemons\n")
2750 for (i
= 0; i
< array_size(vtysh_client
); i
++)
2751 if ( vtysh_client
[i
].fd
>= 0 )
2752 vty_out(vty
, " %s", vtysh_client
[i
].name
);
2753 vty_out(vty
, "%s", VTY_NEWLINE
);
2758 /* Execute command in child process. */
2760 execute_command (const char *command
, int argc
, struct cmd_token
*arg1
,
2771 /* Failure of fork(). */
2772 fprintf (stderr
, "Can't fork: %s\n", safe_strerror (errno
));
2777 /* This is child process. */
2781 execlp (command
, command
, (const char *)NULL
);
2784 execlp (command
, command
, arg1
, (const char *)NULL
);
2787 execlp (command
, command
, arg1
, arg2
, (const char *)NULL
);
2791 /* When execlp suceed, this part is not executed. */
2792 fprintf (stderr
, "Can't execute %s: %s\n", command
, safe_strerror (errno
));
2797 /* This is parent. */
2799 wait4 (pid
, &status
, 0, NULL
);
2807 "Send echo messages\n"
2808 "Ping destination address or hostname\n")
2810 execute_command ("ping", 1, argv
[0], NULL
);
2817 "Send echo messages\n"
2819 "Ping destination address or hostname\n")
2821 DEFUN (vtysh_traceroute
,
2822 vtysh_traceroute_cmd
,
2824 "Trace route to destination\n"
2825 "Trace route to destination address or hostname\n")
2827 execute_command ("traceroute", 1, argv
[0], NULL
);
2831 ALIAS (vtysh_traceroute
,
2832 vtysh_traceroute_ip_cmd
,
2833 "traceroute ip WORD",
2834 "Trace route to destination\n"
2836 "Trace route to destination address or hostname\n")
2841 "Send echo messages\n"
2843 "Ping destination address or hostname\n")
2845 execute_command ("ping6", 1, argv
[0], NULL
);
2849 DEFUN (vtysh_traceroute6
,
2850 vtysh_traceroute6_cmd
,
2851 "traceroute ipv6 WORD",
2852 "Trace route to destination\n"
2854 "Trace route to destination address or hostname\n")
2856 execute_command ("traceroute6", 1, argv
[0], NULL
);
2860 #if defined(HAVE_SHELL_ACCESS)
2861 DEFUN (vtysh_telnet
,
2864 "Open a telnet connection\n"
2865 "IP address or hostname of a remote system\n")
2867 execute_command ("telnet", 1, argv
[0], NULL
);
2871 DEFUN (vtysh_telnet_port
,
2872 vtysh_telnet_port_cmd
,
2874 "Open a telnet connection\n"
2875 "IP address or hostname of a remote system\n"
2876 "TCP Port number\n")
2878 execute_command ("telnet", 2, argv
[0], argv
[1]);
2885 "Open an ssh connection\n"
2888 execute_command ("ssh", 1, argv
[0], NULL
);
2892 DEFUN (vtysh_start_shell
,
2893 vtysh_start_shell_cmd
,
2895 "Start UNIX shell\n")
2897 execute_command ("sh", 0, NULL
, NULL
);
2901 DEFUN (vtysh_start_bash
,
2902 vtysh_start_bash_cmd
,
2904 "Start UNIX shell\n"
2907 execute_command ("bash", 0, NULL
, NULL
);
2911 DEFUN (vtysh_start_zsh
,
2912 vtysh_start_zsh_cmd
,
2914 "Start UNIX shell\n"
2917 execute_command ("zsh", 0, NULL
, NULL
);
2924 "list [permutations]",
2925 "Print command list\n"
2926 "Print all possible command permutations\n")
2928 return cmd_list_cmds (vty
, argc
== 2);
2932 vtysh_install_default (enum node_type node
)
2934 install_element (node
, &config_list_cmd
);
2937 /* Making connection to protocol daemon. */
2939 vtysh_connect (struct vtysh_client
*vclient
)
2943 struct sockaddr_un addr
;
2947 if (!vclient
->path
[0])
2948 snprintf(vclient
->path
, sizeof(vclient
->path
), "%s/%s.vty",
2949 vty_sock_path
, vclient
->name
);
2950 path
= vclient
->path
;
2952 /* Stat socket to see if we have permission to access it. */
2953 ret
= stat (path
, &s_stat
);
2954 if (ret
< 0 && errno
!= ENOENT
)
2956 fprintf (stderr
, "vtysh_connect(%s): stat = %s\n",
2957 path
, safe_strerror(errno
));
2963 if (! S_ISSOCK(s_stat
.st_mode
))
2965 fprintf (stderr
, "vtysh_connect(%s): Not a socket\n",
2972 sock
= socket (AF_UNIX
, SOCK_STREAM
, 0);
2976 fprintf(stderr
, "vtysh_connect(%s): socket = %s\n", path
,
2977 safe_strerror(errno
));
2982 memset (&addr
, 0, sizeof (struct sockaddr_un
));
2983 addr
.sun_family
= AF_UNIX
;
2984 strlcpy (addr
.sun_path
, path
, sizeof (addr
.sun_path
));
2985 #ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
2986 len
= addr
.sun_len
= SUN_LEN(&addr
);
2988 len
= sizeof (addr
.sun_family
) + strlen (addr
.sun_path
);
2989 #endif /* HAVE_STRUCT_SOCKADDR_UN_SUN_LEN */
2991 ret
= connect (sock
, (struct sockaddr
*) &addr
, len
);
2995 fprintf(stderr
, "vtysh_connect(%s): connect = %s\n", path
,
2996 safe_strerror(errno
));
3006 /* Return true if str ends with suffix, else return false */
3008 ends_with(const char *str
, const char *suffix
)
3010 if (!str
|| !suffix
)
3012 size_t lenstr
= strlen(str
);
3013 size_t lensuffix
= strlen(suffix
);
3014 if (lensuffix
> lenstr
)
3016 return strncmp(str
+ lenstr
- lensuffix
, suffix
, lensuffix
) == 0;
3020 vtysh_client_sorted_insert (struct vtysh_client
*head_client
,
3021 struct vtysh_client
*client
)
3023 struct vtysh_client
*prev_node
, *current_node
;
3025 prev_node
= head_client
;
3026 current_node
= head_client
->next
;
3027 while (current_node
)
3029 if (strcmp(current_node
->path
, client
->path
) > 0)
3032 prev_node
= current_node
;
3033 current_node
= current_node
->next
;
3035 client
->next
= current_node
;
3036 prev_node
->next
= client
;
3039 #define MAXIMUM_INSTANCES 10
3042 vtysh_update_all_insances(struct vtysh_client
* head_client
)
3044 struct vtysh_client
*client
;
3046 struct dirent
*file
;
3049 if (head_client
->flag
!= VTYSH_OSPFD
) return;
3051 /* ls vty_sock_dir and look for all files ending in .vty */
3052 dir
= opendir(vty_sock_path
);
3055 while ((file
= readdir(dir
)) != NULL
)
3057 if (begins_with(file
->d_name
, "ospfd-") && ends_with(file
->d_name
, ".vty"))
3059 if (n
== MAXIMUM_INSTANCES
)
3062 "Parsing %s, client limit(%d) reached!\n",
3066 client
= (struct vtysh_client
*) malloc(sizeof(struct vtysh_client
));
3068 client
->name
= "ospfd";
3069 client
->flag
= VTYSH_OSPFD
;
3070 snprintf(client
->path
, sizeof(client
->path
), "%s/%s",
3071 vty_sock_path
, file
->d_name
);
3072 client
->next
= NULL
;
3073 vtysh_client_sorted_insert(head_client
, client
);
3082 vtysh_connect_all_instances (struct vtysh_client
*head_client
)
3084 struct vtysh_client
*client
;
3087 vtysh_update_all_insances(head_client
);
3089 client
= head_client
->next
;
3092 if (vtysh_connect(client
) == 0)
3094 client
= client
->next
;
3101 vtysh_connect_all(const char *daemon_name
)
3107 for (i
= 0; i
< array_size(vtysh_client
); i
++)
3109 if (!daemon_name
|| !strcmp(daemon_name
, vtysh_client
[i
].name
))
3112 if (vtysh_connect(&vtysh_client
[i
]) == 0)
3115 rc
+= vtysh_connect_all_instances(&vtysh_client
[i
]);
3119 fprintf(stderr
, "Error: no daemons match name %s!\n", daemon_name
);
3123 /* To disable readline's filename completion. */
3125 vtysh_completion_entry_function (const char *ignore
, int invoking_key
)
3131 vtysh_readline_init (void)
3133 /* readline related settings. */
3135 rl_bind_key ('?', (rl_command_func_t
*) vtysh_rl_describe
);
3136 rl_completion_entry_function
= vtysh_completion_entry_function
;
3137 rl_attempted_completion_function
= (rl_completion_func_t
*)new_completion
;
3143 static struct utsname names
;
3144 static char buf
[100];
3145 const char*hostname
;
3146 extern struct host host
;
3148 hostname
= host
.name
;
3152 if (!names
.nodename
[0])
3154 hostname
= names
.nodename
;
3157 snprintf (buf
, sizeof buf
, cmd_prompt (vty
->node
), hostname
);
3163 vtysh_init_vty (void)
3165 /* Make vty structure. */
3167 vty
->type
= VTY_SHELL
;
3168 vty
->node
= VIEW_NODE
;
3170 /* Initialize commands. */
3173 /* Install nodes. */
3174 install_node (&bgp_node
, NULL
);
3175 install_node (&rip_node
, NULL
);
3176 install_node (&interface_node
, NULL
);
3177 install_node (&link_params_node
, NULL
);
3178 install_node (&ns_node
, NULL
);
3179 install_node (&vrf_node
, NULL
);
3180 install_node (&rmap_node
, NULL
);
3181 install_node (&zebra_node
, NULL
);
3182 install_node (&bgp_vpnv4_node
, NULL
);
3183 install_node (&bgp_vpnv6_node
, NULL
);
3184 install_node (&bgp_encap_node
, NULL
);
3185 install_node (&bgp_encapv6_node
, NULL
);
3186 install_node (&bgp_ipv4_node
, NULL
);
3187 install_node (&bgp_ipv4m_node
, NULL
);
3188 install_node (&bgp_ipv4l_node
, NULL
);
3189 install_node (&bgp_ipv6_node
, NULL
);
3190 install_node (&bgp_ipv6m_node
, NULL
);
3191 install_node (&bgp_ipv6l_node
, NULL
);
3192 install_node (&bgp_vrf_policy_node
, NULL
);
3193 install_node (&bgp_evpn_node
, NULL
);
3194 install_node (&bgp_vnc_defaults_node
, NULL
);
3195 install_node (&bgp_vnc_nve_group_node
, NULL
);
3196 install_node (&bgp_vnc_l2_group_node
, NULL
);
3197 install_node (&ospf_node
, NULL
);
3198 install_node (&eigrp_node
, NULL
);
3199 install_node (&ripng_node
, NULL
);
3200 install_node (&ospf6_node
, NULL
);
3201 install_node (&ldp_node
, NULL
);
3202 install_node (&ldp_ipv4_node
, NULL
);
3203 install_node (&ldp_ipv6_node
, NULL
);
3204 install_node (&ldp_ipv4_iface_node
, NULL
);
3205 install_node (&ldp_ipv6_iface_node
, NULL
);
3206 install_node (&ldp_l2vpn_node
, NULL
);
3207 install_node (&ldp_pseudowire_node
, NULL
);
3208 install_node (&keychain_node
, NULL
);
3209 install_node (&keychain_key_node
, NULL
);
3210 install_node (&isis_node
, NULL
);
3211 install_node (&vty_node
, NULL
);
3213 vtysh_install_default (VIEW_NODE
);
3214 vtysh_install_default (CONFIG_NODE
);
3215 vtysh_install_default (BGP_NODE
);
3216 vtysh_install_default (RIP_NODE
);
3217 vtysh_install_default (INTERFACE_NODE
);
3218 vtysh_install_default (LINK_PARAMS_NODE
);
3219 vtysh_install_default (NS_NODE
);
3220 vtysh_install_default (VRF_NODE
);
3221 vtysh_install_default (RMAP_NODE
);
3222 vtysh_install_default (ZEBRA_NODE
);
3223 vtysh_install_default (BGP_VPNV4_NODE
);
3224 vtysh_install_default (BGP_VPNV6_NODE
);
3225 vtysh_install_default (BGP_ENCAP_NODE
);
3226 vtysh_install_default (BGP_ENCAPV6_NODE
);
3227 vtysh_install_default (BGP_IPV4_NODE
);
3228 vtysh_install_default (BGP_IPV4M_NODE
);
3229 vtysh_install_default (BGP_IPV4L_NODE
);
3230 vtysh_install_default (BGP_IPV6_NODE
);
3231 vtysh_install_default (BGP_IPV6M_NODE
);
3232 vtysh_install_default (BGP_EVPN_NODE
);
3233 vtysh_install_default (BGP_IPV6L_NODE
);
3235 vtysh_install_default (BGP_VRF_POLICY_NODE
);
3236 vtysh_install_default (BGP_VNC_DEFAULTS_NODE
);
3237 vtysh_install_default (BGP_VNC_NVE_GROUP_NODE
);
3238 vtysh_install_default (BGP_VNC_L2_GROUP_NODE
);
3240 vtysh_install_default (OSPF_NODE
);
3241 vtysh_install_default (EIGRP_NODE
);
3242 vtysh_install_default (RIPNG_NODE
);
3243 vtysh_install_default (OSPF6_NODE
);
3244 vtysh_install_default (LDP_NODE
);
3245 vtysh_install_default (LDP_IPV4_NODE
);
3246 vtysh_install_default (LDP_IPV6_NODE
);
3247 vtysh_install_default (LDP_IPV4_IFACE_NODE
);
3248 vtysh_install_default (LDP_IPV6_IFACE_NODE
);
3249 vtysh_install_default (LDP_L2VPN_NODE
);
3250 vtysh_install_default (LDP_PSEUDOWIRE_NODE
);
3251 vtysh_install_default (ISIS_NODE
);
3252 vtysh_install_default (KEYCHAIN_NODE
);
3253 vtysh_install_default (KEYCHAIN_KEY_NODE
);
3254 vtysh_install_default (VTY_NODE
);
3256 install_element (VIEW_NODE
, &vtysh_enable_cmd
);
3257 install_element (ENABLE_NODE
, &vtysh_config_terminal_cmd
);
3258 install_element (ENABLE_NODE
, &vtysh_disable_cmd
);
3260 /* "exit" command. */
3261 install_element (VIEW_NODE
, &vtysh_exit_all_cmd
);
3262 install_element (CONFIG_NODE
, &vtysh_exit_all_cmd
);
3263 install_element (VIEW_NODE
, &vtysh_quit_all_cmd
);
3264 install_element (CONFIG_NODE
, &vtysh_quit_all_cmd
);
3265 install_element (RIP_NODE
, &vtysh_exit_ripd_cmd
);
3266 install_element (RIP_NODE
, &vtysh_quit_ripd_cmd
);
3267 install_element (RIPNG_NODE
, &vtysh_exit_ripngd_cmd
);
3268 install_element (RIPNG_NODE
, &vtysh_quit_ripngd_cmd
);
3269 install_element (OSPF_NODE
, &vtysh_exit_ospfd_cmd
);
3270 install_element (OSPF_NODE
, &vtysh_quit_ospfd_cmd
);
3271 install_element (EIGRP_NODE
, &vtysh_exit_eigrpd_cmd
);
3272 install_element (EIGRP_NODE
, &vtysh_quit_eigrpd_cmd
);
3273 install_element (OSPF6_NODE
, &vtysh_exit_ospf6d_cmd
);
3274 install_element (OSPF6_NODE
, &vtysh_quit_ospf6d_cmd
);
3275 #if defined (HAVE_LDPD)
3276 install_element (LDP_NODE
, &vtysh_exit_ldpd_cmd
);
3277 install_element (LDP_NODE
, &vtysh_quit_ldpd_cmd
);
3278 install_element (LDP_IPV4_NODE
, &vtysh_exit_ldpd_cmd
);
3279 install_element (LDP_IPV4_NODE
, &vtysh_quit_ldpd_cmd
);
3280 install_element (LDP_IPV6_NODE
, &vtysh_exit_ldpd_cmd
);
3281 install_element (LDP_IPV6_NODE
, &vtysh_quit_ldpd_cmd
);
3282 install_element (LDP_IPV4_IFACE_NODE
, &vtysh_exit_ldpd_cmd
);
3283 install_element (LDP_IPV4_IFACE_NODE
, &vtysh_quit_ldpd_cmd
);
3284 install_element (LDP_IPV6_IFACE_NODE
, &vtysh_exit_ldpd_cmd
);
3285 install_element (LDP_IPV6_IFACE_NODE
, &vtysh_quit_ldpd_cmd
);
3286 install_element (LDP_L2VPN_NODE
, &vtysh_exit_ldpd_cmd
);
3287 install_element (LDP_L2VPN_NODE
, &vtysh_quit_ldpd_cmd
);
3288 install_element (LDP_PSEUDOWIRE_NODE
, &vtysh_exit_ldpd_cmd
);
3289 install_element (LDP_PSEUDOWIRE_NODE
, &vtysh_quit_ldpd_cmd
);
3291 install_element (BGP_NODE
, &vtysh_exit_bgpd_cmd
);
3292 install_element (BGP_NODE
, &vtysh_quit_bgpd_cmd
);
3293 install_element (BGP_VPNV4_NODE
, &vtysh_exit_bgpd_cmd
);
3294 install_element (BGP_VPNV4_NODE
, &vtysh_quit_bgpd_cmd
);
3295 install_element (BGP_VPNV6_NODE
, &vtysh_exit_bgpd_cmd
);
3296 install_element (BGP_VPNV6_NODE
, &vtysh_quit_bgpd_cmd
);
3297 install_element (BGP_ENCAP_NODE
, &vtysh_exit_bgpd_cmd
);
3298 install_element (BGP_ENCAP_NODE
, &vtysh_quit_bgpd_cmd
);
3299 install_element (BGP_ENCAPV6_NODE
, &vtysh_exit_bgpd_cmd
);
3300 install_element (BGP_ENCAPV6_NODE
, &vtysh_quit_bgpd_cmd
);
3301 install_element (BGP_IPV4_NODE
, &vtysh_exit_bgpd_cmd
);
3302 install_element (BGP_IPV4_NODE
, &vtysh_quit_bgpd_cmd
);
3303 install_element (BGP_IPV4M_NODE
, &vtysh_exit_bgpd_cmd
);
3304 install_element (BGP_IPV4M_NODE
, &vtysh_quit_bgpd_cmd
);
3305 install_element (BGP_IPV4L_NODE
, &vtysh_exit_bgpd_cmd
);
3306 install_element (BGP_IPV4L_NODE
, &vtysh_quit_bgpd_cmd
);
3307 install_element (BGP_IPV6_NODE
, &vtysh_exit_bgpd_cmd
);
3308 install_element (BGP_IPV6_NODE
, &vtysh_quit_bgpd_cmd
);
3309 install_element (BGP_IPV6M_NODE
, &vtysh_exit_bgpd_cmd
);
3310 install_element (BGP_IPV6M_NODE
, &vtysh_quit_bgpd_cmd
);
3311 install_element (BGP_EVPN_NODE
, &vtysh_quit_bgpd_cmd
);
3312 install_element (BGP_IPV6L_NODE
, &vtysh_exit_bgpd_cmd
);
3313 install_element (BGP_IPV6L_NODE
, &vtysh_quit_bgpd_cmd
);
3314 #if defined (ENABLE_BGP_VNC)
3315 install_element (BGP_VRF_POLICY_NODE
, &vtysh_exit_bgpd_cmd
);
3316 install_element (BGP_VRF_POLICY_NODE
, &vtysh_quit_bgpd_cmd
);
3317 install_element (BGP_VNC_DEFAULTS_NODE
, &vtysh_exit_bgpd_cmd
);
3318 install_element (BGP_VNC_DEFAULTS_NODE
, &vtysh_quit_bgpd_cmd
);
3319 install_element (BGP_VNC_NVE_GROUP_NODE
, &vtysh_exit_bgpd_cmd
);
3320 install_element (BGP_VNC_NVE_GROUP_NODE
, &vtysh_quit_bgpd_cmd
);
3321 install_element (BGP_VNC_L2_GROUP_NODE
, &vtysh_exit_bgpd_cmd
);
3322 install_element (BGP_VNC_L2_GROUP_NODE
, &vtysh_quit_bgpd_cmd
);
3324 install_element (ISIS_NODE
, &vtysh_exit_isisd_cmd
);
3325 install_element (ISIS_NODE
, &vtysh_quit_isisd_cmd
);
3326 install_element (KEYCHAIN_NODE
, &vtysh_exit_ripd_cmd
);
3327 install_element (KEYCHAIN_NODE
, &vtysh_quit_ripd_cmd
);
3328 install_element (KEYCHAIN_KEY_NODE
, &vtysh_exit_ripd_cmd
);
3329 install_element (KEYCHAIN_KEY_NODE
, &vtysh_quit_ripd_cmd
);
3330 install_element (RMAP_NODE
, &vtysh_exit_rmap_cmd
);
3331 install_element (RMAP_NODE
, &vtysh_quit_rmap_cmd
);
3332 install_element (VTY_NODE
, &vtysh_exit_line_vty_cmd
);
3333 install_element (VTY_NODE
, &vtysh_quit_line_vty_cmd
);
3335 /* "end" command. */
3336 install_element (CONFIG_NODE
, &vtysh_end_all_cmd
);
3337 install_element (ENABLE_NODE
, &vtysh_end_all_cmd
);
3338 install_element (RIP_NODE
, &vtysh_end_all_cmd
);
3339 install_element (RIPNG_NODE
, &vtysh_end_all_cmd
);
3340 install_element (OSPF_NODE
, &vtysh_end_all_cmd
);
3341 install_element (EIGRP_NODE
, &vtysh_end_all_cmd
);
3342 install_element (OSPF6_NODE
, &vtysh_end_all_cmd
);
3343 install_element (LDP_NODE
, &vtysh_end_all_cmd
);
3344 install_element (LDP_IPV4_NODE
, &vtysh_end_all_cmd
);
3345 install_element (LDP_IPV6_NODE
, &vtysh_end_all_cmd
);
3346 install_element (LDP_IPV4_IFACE_NODE
, &vtysh_end_all_cmd
);
3347 install_element (LDP_IPV6_IFACE_NODE
, &vtysh_end_all_cmd
);
3348 install_element (LDP_L2VPN_NODE
, &vtysh_end_all_cmd
);
3349 install_element (LDP_PSEUDOWIRE_NODE
, &vtysh_end_all_cmd
);
3350 install_element (BGP_NODE
, &vtysh_end_all_cmd
);
3351 install_element (BGP_IPV4_NODE
, &vtysh_end_all_cmd
);
3352 install_element (BGP_IPV4M_NODE
, &vtysh_end_all_cmd
);
3353 install_element (BGP_IPV4L_NODE
, &vtysh_end_all_cmd
);
3354 install_element (BGP_VPNV4_NODE
, &vtysh_end_all_cmd
);
3355 install_element (BGP_VPNV6_NODE
, &vtysh_end_all_cmd
);
3356 install_element (BGP_ENCAP_NODE
, &vtysh_end_all_cmd
);
3357 install_element (BGP_ENCAPV6_NODE
, &vtysh_end_all_cmd
);
3358 install_element (BGP_IPV6_NODE
, &vtysh_end_all_cmd
);
3359 install_element (BGP_IPV6M_NODE
, &vtysh_end_all_cmd
);
3360 install_element (BGP_IPV6L_NODE
, &vtysh_end_all_cmd
);
3361 install_element (BGP_VRF_POLICY_NODE
, &vtysh_end_all_cmd
);
3362 install_element (BGP_EVPN_NODE
, &vtysh_end_all_cmd
);
3363 install_element (BGP_VNC_DEFAULTS_NODE
, &vtysh_end_all_cmd
);
3364 install_element (BGP_VNC_NVE_GROUP_NODE
, &vtysh_end_all_cmd
);
3365 install_element (BGP_VNC_L2_GROUP_NODE
, &vtysh_end_all_cmd
);
3366 install_element (ISIS_NODE
, &vtysh_end_all_cmd
);
3367 install_element (KEYCHAIN_NODE
, &vtysh_end_all_cmd
);
3368 install_element (KEYCHAIN_KEY_NODE
, &vtysh_end_all_cmd
);
3369 install_element (RMAP_NODE
, &vtysh_end_all_cmd
);
3370 install_element (VTY_NODE
, &vtysh_end_all_cmd
);
3372 install_element (INTERFACE_NODE
, &vtysh_interface_desc_cmd
);
3373 install_element (INTERFACE_NODE
, &vtysh_no_interface_desc_cmd
);
3374 install_element (INTERFACE_NODE
, &vtysh_end_all_cmd
);
3375 install_element (INTERFACE_NODE
, &vtysh_exit_interface_cmd
);
3376 install_element (LINK_PARAMS_NODE
, &exit_link_params_cmd
);
3377 install_element (LINK_PARAMS_NODE
, &vtysh_end_all_cmd
);
3378 install_element (LINK_PARAMS_NODE
, &vtysh_exit_interface_cmd
);
3379 install_element (INTERFACE_NODE
, &vtysh_quit_interface_cmd
);
3381 install_element (NS_NODE
, &vtysh_end_all_cmd
);
3383 install_element (CONFIG_NODE
, &vtysh_ns_cmd
);
3384 install_element (NS_NODE
, &vtysh_exit_ns_cmd
);
3385 install_element (NS_NODE
, &vtysh_quit_ns_cmd
);
3387 install_element (VRF_NODE
, &vtysh_end_all_cmd
);
3388 install_element (VRF_NODE
, &vtysh_exit_vrf_cmd
);
3389 install_element (VRF_NODE
, &vtysh_quit_vrf_cmd
);
3391 install_element (CONFIG_NODE
, &router_eigrp_cmd
);
3392 install_element (CONFIG_NODE
, &router_rip_cmd
);
3393 install_element (CONFIG_NODE
, &router_ripng_cmd
);
3394 install_element (CONFIG_NODE
, &router_ospf_cmd
);
3395 install_element (CONFIG_NODE
, &router_ospf6_cmd
);
3396 #if defined (HAVE_LDPD)
3397 install_element (CONFIG_NODE
, &ldp_mpls_ldp_cmd
);
3398 install_element (LDP_NODE
, &ldp_address_family_ipv4_cmd
);
3399 install_element (LDP_NODE
, &ldp_address_family_ipv6_cmd
);
3400 install_element (LDP_IPV4_NODE
, &ldp_interface_ifname_cmd
);
3401 install_element (LDP_IPV6_NODE
, &ldp_interface_ifname_cmd
);
3402 install_element (CONFIG_NODE
, &ldp_l2vpn_word_type_vpls_cmd
);
3403 install_element (LDP_L2VPN_NODE
, &ldp_member_pseudowire_ifname_cmd
);
3405 install_element (CONFIG_NODE
, &router_isis_cmd
);
3406 install_element (CONFIG_NODE
, &router_bgp_cmd
);
3407 install_element (BGP_NODE
, &address_family_vpnv4_cmd
);
3408 install_element (BGP_NODE
, &address_family_vpnv6_cmd
);
3409 install_element (BGP_NODE
, &address_family_encapv4_cmd
);
3410 install_element (BGP_NODE
, &address_family_encapv6_cmd
);
3411 #if defined(ENABLE_BGP_VNC)
3412 install_element (BGP_NODE
, &vnc_vrf_policy_cmd
);
3413 install_element (BGP_NODE
, &vnc_defaults_cmd
);
3414 install_element (BGP_NODE
, &vnc_nve_group_cmd
);
3415 install_element (BGP_NODE
, &vnc_l2_group_cmd
);
3417 install_element (BGP_NODE
, &address_family_ipv4_cmd
);
3418 install_element (BGP_NODE
, &address_family_ipv6_cmd
);
3419 install_element (BGP_NODE
, &address_family_evpn_cmd
);
3420 install_element (BGP_VPNV4_NODE
, &exit_address_family_cmd
);
3421 install_element (BGP_VPNV6_NODE
, &exit_address_family_cmd
);
3422 install_element (BGP_ENCAP_NODE
, &exit_address_family_cmd
);
3423 install_element (BGP_ENCAPV6_NODE
, &exit_address_family_cmd
);
3424 install_element (BGP_IPV4_NODE
, &exit_address_family_cmd
);
3425 install_element (BGP_IPV4M_NODE
, &exit_address_family_cmd
);
3426 install_element (BGP_IPV4L_NODE
, &exit_address_family_cmd
);
3427 install_element (BGP_IPV6_NODE
, &exit_address_family_cmd
);
3428 install_element (BGP_IPV6M_NODE
, &exit_address_family_cmd
);
3429 install_element (BGP_EVPN_NODE
, &exit_address_family_cmd
);
3430 install_element (BGP_IPV6L_NODE
, &exit_address_family_cmd
);
3432 install_element (BGP_VRF_POLICY_NODE
, &exit_vrf_policy_cmd
);
3433 install_element (BGP_VNC_DEFAULTS_NODE
, &exit_vnc_config_cmd
);
3434 install_element (BGP_VNC_NVE_GROUP_NODE
, &exit_vnc_config_cmd
);
3435 install_element (BGP_VNC_L2_GROUP_NODE
, &exit_vnc_config_cmd
);
3437 install_element (CONFIG_NODE
, &key_chain_cmd
);
3438 install_element (CONFIG_NODE
, &vtysh_route_map_cmd
);
3439 install_element (CONFIG_NODE
, &vtysh_line_vty_cmd
);
3440 install_element (KEYCHAIN_NODE
, &key_cmd
);
3441 install_element (KEYCHAIN_NODE
, &key_chain_cmd
);
3442 install_element (KEYCHAIN_KEY_NODE
, &key_chain_cmd
);
3443 install_element (CONFIG_NODE
, &vtysh_interface_cmd
);
3444 install_element (CONFIG_NODE
, &vtysh_no_interface_cmd
);
3445 install_element (CONFIG_NODE
, &vtysh_no_interface_vrf_cmd
);
3446 install_element (INTERFACE_NODE
, &vtysh_link_params_cmd
);
3447 install_element (ENABLE_NODE
, &vtysh_show_running_config_cmd
);
3448 install_element (ENABLE_NODE
, &vtysh_copy_running_config_cmd
);
3450 install_element (CONFIG_NODE
, &vtysh_vrf_cmd
);
3451 install_element (CONFIG_NODE
, &vtysh_no_vrf_cmd
);
3453 /* "write terminal" command. */
3454 install_element (ENABLE_NODE
, &vtysh_write_terminal_cmd
);
3456 install_element (CONFIG_NODE
, &vtysh_integrated_config_cmd
);
3457 install_element (CONFIG_NODE
, &no_vtysh_integrated_config_cmd
);
3459 /* "write memory" command. */
3460 install_element (ENABLE_NODE
, &vtysh_write_memory_cmd
);
3462 install_element (VIEW_NODE
, &vtysh_terminal_length_cmd
);
3463 install_element (VIEW_NODE
, &vtysh_terminal_no_length_cmd
);
3464 install_element (VIEW_NODE
, &vtysh_show_daemons_cmd
);
3466 install_element (VIEW_NODE
, &vtysh_ping_cmd
);
3467 install_element (VIEW_NODE
, &vtysh_ping_ip_cmd
);
3468 install_element (VIEW_NODE
, &vtysh_traceroute_cmd
);
3469 install_element (VIEW_NODE
, &vtysh_traceroute_ip_cmd
);
3470 install_element (VIEW_NODE
, &vtysh_ping6_cmd
);
3471 install_element (VIEW_NODE
, &vtysh_traceroute6_cmd
);
3472 #if defined(HAVE_SHELL_ACCESS)
3473 install_element (VIEW_NODE
, &vtysh_telnet_cmd
);
3474 install_element (VIEW_NODE
, &vtysh_telnet_port_cmd
);
3475 install_element (VIEW_NODE
, &vtysh_ssh_cmd
);
3477 #if defined(HAVE_SHELL_ACCESS)
3478 install_element (ENABLE_NODE
, &vtysh_start_shell_cmd
);
3479 install_element (ENABLE_NODE
, &vtysh_start_bash_cmd
);
3480 install_element (ENABLE_NODE
, &vtysh_start_zsh_cmd
);
3483 install_element (VIEW_NODE
, &vtysh_show_memory_cmd
);
3484 install_element (VIEW_NODE
, &vtysh_show_modules_cmd
);
3486 install_element (VIEW_NODE
, &vtysh_show_work_queues_cmd
);
3487 install_element (VIEW_NODE
, &vtysh_show_work_queues_daemon_cmd
);
3489 install_element (VIEW_NODE
, &vtysh_show_thread_cmd
);
3492 install_element (VIEW_NODE
, &vtysh_show_logging_cmd
);
3493 install_element (CONFIG_NODE
, &vtysh_log_stdout_cmd
);
3494 install_element (CONFIG_NODE
, &vtysh_log_stdout_level_cmd
);
3495 install_element (CONFIG_NODE
, &no_vtysh_log_stdout_cmd
);
3496 install_element (CONFIG_NODE
, &vtysh_log_file_cmd
);
3497 install_element (CONFIG_NODE
, &vtysh_log_file_level_cmd
);
3498 install_element (CONFIG_NODE
, &no_vtysh_log_file_cmd
);
3499 install_element (CONFIG_NODE
, &vtysh_log_monitor_cmd
);
3500 install_element (CONFIG_NODE
, &no_vtysh_log_monitor_cmd
);
3501 install_element (CONFIG_NODE
, &vtysh_log_syslog_cmd
);
3502 install_element (CONFIG_NODE
, &no_vtysh_log_syslog_cmd
);
3503 install_element (CONFIG_NODE
, &vtysh_log_trap_cmd
);
3504 install_element (CONFIG_NODE
, &no_vtysh_log_trap_cmd
);
3505 install_element (CONFIG_NODE
, &vtysh_log_facility_cmd
);
3506 install_element (CONFIG_NODE
, &no_vtysh_log_facility_cmd
);
3507 install_element (CONFIG_NODE
, &vtysh_log_record_priority_cmd
);
3508 install_element (CONFIG_NODE
, &no_vtysh_log_record_priority_cmd
);
3509 install_element (CONFIG_NODE
, &vtysh_log_timestamp_precision_cmd
);
3510 install_element (CONFIG_NODE
, &no_vtysh_log_timestamp_precision_cmd
);
3512 install_element (CONFIG_NODE
, &vtysh_service_password_encrypt_cmd
);
3513 install_element (CONFIG_NODE
, &no_vtysh_service_password_encrypt_cmd
);
3515 install_element (CONFIG_NODE
, &vtysh_password_cmd
);
3516 install_element (CONFIG_NODE
, &vtysh_password_text_cmd
);
3517 install_element (CONFIG_NODE
, &vtysh_enable_password_cmd
);
3518 install_element (CONFIG_NODE
, &vtysh_enable_password_text_cmd
);
3519 install_element (CONFIG_NODE
, &no_vtysh_enable_password_cmd
);