DEFUN_HIDDEN (neighbor_bfd_type,
neighbor_bfd_type_cmd,
- NEIGHBOR_CMD2 "bfd " BFD_CMD_TYPE,
+ "neighbor <A.B.C.D|X:X::X:X|WORD> bfd (multihop|singlehop)",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Enables BFD support\n"
DEFUN_HIDDEN (no_neighbor_bfd_type,
no_neighbor_bfd_type_cmd,
- NO_NEIGHBOR_CMD2 "bfd " BFD_CMD_TYPE,
+ "no neighbor <A.B.C.D|X:X::X:X|WORD> bfd (multihop|singlehop)",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
return CMD_SUCCESS;
}
-#define BGP_UPDATE_SOURCE_STR "A.B.C.D|X:X::X:X|WORD"
-#define BGP_UPDATE_SOURCE_REQ_STR "(" BGP_UPDATE_SOURCE_STR ")"
-#define BGP_UPDATE_SOURCE_OPT_STR "{" BGP_UPDATE_SOURCE_STR "}"
#define BGP_UPDATE_SOURCE_HELP_STR \
"IPv4 address\n" \
"IPv6 address\n" \
struct bgp;
-#define CMD_AS_RANGE "<1-4294967295>"
-#define DYNAMIC_NEIGHBOR_LIMIT_RANGE "<1-5000>"
-#define BGP_INSTANCE_CMD "(view|vrf) WORD"
#define BGP_INSTANCE_HELP_STR "BGP view\nBGP VRF\nView/VRF name\n"
-#define BGP_INSTANCE_ALL_CMD "(view|vrf) all"
#define BGP_INSTANCE_ALL_HELP_STR "BGP view\nBGP VRF\nAll Views/VRFs\n"
extern void bgp_vty_init (void);
#include "lib/json.h"
-#define BFD_CMD_DETECT_MULT_RANGE "<2-255> "
-#define BFD_CMD_MIN_RX_RANGE "<50-60000> "
-#define BFD_CMD_MIN_TX_RANGE "<50-60000>"
-#define BFD_CMD_TYPE "(multihop|singlehop)"
-
#define BFD_DEF_MIN_RX 300
#define BFD_MIN_MIN_RX 50
#define BFD_MAX_MIN_RX 60000
DEFUN (config_logmsg,
config_logmsg_cmd,
- "logmsg "LOG_LEVELS" MESSAGE...",
+ "logmsg <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging> MESSAGE...",
"Send a message to enabled logging destinations\n"
LOG_LEVEL_DESC
"The message to send\n")
DEFUN (config_log_stdout,
config_log_stdout_cmd,
- "log stdout ["LOG_LEVELS"]",
+ "log stdout [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
"Logging control\n"
"Set stdout logging level\n"
LOG_LEVEL_DESC)
DEFUN (no_config_log_stdout,
no_config_log_stdout_cmd,
- "no log stdout ["LOG_LEVELS"]",
+ "no log stdout [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
NO_STR
"Logging control\n"
"Cancel logging to stdout\n"
DEFUN (config_log_monitor,
config_log_monitor_cmd,
- "log monitor ["LOG_LEVELS"]",
+ "log monitor [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
"Logging control\n"
"Set terminal line (monitor) logging level\n"
LOG_LEVEL_DESC)
DEFUN (no_config_log_monitor,
no_config_log_monitor_cmd,
- "no log monitor ["LOG_LEVELS"]",
+ "no log monitor [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
NO_STR
"Logging control\n"
"Disable terminal line (monitor) logging\n"
DEFUN_DEPRECATED (config_log_syslog_facility,
config_log_syslog_facility_cmd,
- "log syslog facility "LOG_FACILITIES,
+ "log syslog facility (kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7)",
"Logging control\n"
"Logging goes to syslog\n"
"(Deprecated) Facility parameter for syslog messages\n"
DEFUN_DEPRECATED (config_log_trap,
config_log_trap_cmd,
- "log trap " LOG_LEVELS,
+ "log trap <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
"Logging control\n"
"(Deprecated) Set logging level and default for all destinations\n"
LOG_LEVEL_DESC)
DEFUN_DEPRECATED (no_config_log_trap,
no_config_log_trap_cmd,
- "no log trap [" LOG_LEVELS "]",
+ "no log trap [emergencies|alerts|critical|errors|warnings|notifications|informational|debugging]",
NO_STR
"Logging control\n"
"Permit all logging information\n"
*/
#define CMD_CREATE_STR(s) CMD_CREATE_STR_HELPER(s)
#define CMD_CREATE_STR_HELPER(s) #s
-#define CMD_RANGE_STR(a,s) "<" CMD_CREATE_STR(a) "-" CMD_CREATE_STR(s) ">"
/* Common descriptions. */
#define SHOW_STR "Show running system information\n"
/* IPv4 only machine should not accept IPv6 address for peer's IP
address. So we replace VTY command string like below. */
#ifdef HAVE_IPV6
-#define NEIGHBOR_CMD "neighbor <A.B.C.D|X:X::X:X> "
-#define NO_NEIGHBOR_CMD "no neighbor <A.B.C.D|X:X::X:X> "
#define NEIGHBOR_ADDR_STR "Neighbor address\nIPv6 address\n"
-#define NEIGHBOR_CMD2 "neighbor <A.B.C.D|X:X::X:X|WORD> "
-#define NO_NEIGHBOR_CMD2 "no neighbor <A.B.C.D|X:X::X:X|WORD> "
#define NEIGHBOR_ADDR_STR2 "Neighbor address\nNeighbor IPv6 address\nInterface name or neighbor tag\n"
#define NEIGHBOR_ADDR_STR3 "Neighbor address\nIPv6 address\nInterface name\n"
#else
-#define NEIGHBOR_CMD "neighbor A.B.C.D "
-#define NO_NEIGHBOR_CMD "no neighbor A.B.C.D "
#define NEIGHBOR_ADDR_STR "Neighbor address\n"
-#define NEIGHBOR_CMD2 "neighbor <A.B.C.D|WORD> "
-#define NO_NEIGHBOR_CMD2 "no neighbor <A.B.C.D|WORD> "
#define NEIGHBOR_ADDR_STR2 "Neighbor address\nNeighbor tag\n"
#endif /* HAVE_IPV6 */
/* Dynamic neighbor (listen range) configuration */
#ifdef HAVE_IPV6
-#define LISTEN_RANGE_CMD "bgp listen range <A.B.C.D/M|X:X::X:X/M> "
#define LISTEN_RANGE_ADDR_STR "Neighbor address\nNeighbor IPv6 address\n"
#else
-#define LISTEN_RANGE_CMD "bgp listen range A.B.C.D/M "
#define LISTEN_RANGE_ADDR_STR "Neighbor address\n"
#endif /* HAVE_IPV6 */
DEFUN (interface,
interface_cmd,
- "interface IFNAME ["VRF_CMD_STR"]",
+ "interface IFNAME [vrf NAME]",
"Select an interface to configure\n"
"Interface's name\n"
VRF_CMD_HELP_STR)
DEFUN_NOSH (no_interface,
no_interface_cmd,
- "no interface IFNAME [VRF_CMD_STR]",
+ "no interface IFNAME [vrf NAME]",
NO_STR
"Delete a pseudo interface's configuration\n"
"Interface's name\n"
/* For debug purpose. */
DEFUN (show_address,
show_address_cmd,
- "show address [VRF_CMD_STR]",
+ "show address [vrf NAME]",
SHOW_STR
"address\n"
VRF_CMD_HELP_STR)
/* Defines for use in command construction: */
-#define LOG_LEVELS "(emergencies|alerts|critical|errors|warnings|notifications|informational|debugging)"
-
#define LOG_LEVEL_DESC \
"System is unusable\n" \
"Immediate action needed\n" \
"Informational messages\n" \
"Debugging messages\n"
-#define LOG_FACILITIES "(kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7)"
-
#define LOG_FACILITY_DESC \
"Kernel\n" \
"User process\n" \
/*
* The command strings
*/
-
-#define VRF_CMD_STR "vrf NAME"
#define VRF_CMD_HELP_STR "Specify the VRF\nThe VRF name\n"
-
-#define VRF_ALL_CMD_STR "vrf all"
#define VRF_ALL_CMD_HELP_STR "Specify the VRF\nAll VRFs\n"
/*
#define OSPF_LSA_TYPE_OPAQUE_AS_DESC "Link AS Opaque-LSA\n"
#define OSPF_LSA_TYPE_OPAQUE_CMD_STR "|opaque-link|opaque-area|opaque-as"
-#define OSPF_LSA_TYPES_CMD_STR \
- "asbr-summary|external|network|router|summary" \
- OSPF_LSA_TYPE_NSSA_CMD_STR \
- OSPF_LSA_TYPE_OPAQUE_CMD_STR
-
#define OSPF_LSA_TYPES_DESC \
"ASBR summary link states\n" \
"External link states\n" \
#define MROUTE_STR "IP multicast routing table\n"
#define RIB_STR "IP unicast routing table\n"
-#define PIM_CMD_NO "no"
-#define PIM_CMD_IP_MULTICAST_ROUTING "ip multicast-routing"
-#define PIM_CMD_IP_IGMP_QUERY_INTERVAL "ip igmp query-interval"
-#define PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME "ip igmp query-max-response-time"
-#define PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC "ip igmp query-max-response-time-dsec"
-
void pim_cmd_init(void);
#endif /* PIM_CMD_H */
char buffer[32];
if (PIM_MROUTE_IS_ENABLED) {
- vty_out(vty, "%s%s", PIM_CMD_IP_MULTICAST_ROUTING, VTY_NEWLINE);
+ vty_out(vty, "ip multicast-routing%s", VTY_NEWLINE);
++writes;
}
if (qpim_rp.rpf_addr.s_addr != INADDR_NONE) {
/* IF ip igmp query-interval */
if (pim_ifp->igmp_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL)
{
- vty_out(vty, " %s %d%s",
- PIM_CMD_IP_IGMP_QUERY_INTERVAL,
+ vty_out(vty, " ip igmp query-interval %d%s",
pim_ifp->igmp_default_query_interval,
VTY_NEWLINE);
++writes;
/* IF ip igmp query-max-response-time */
if (pim_ifp->igmp_query_max_response_time_dsec != IGMP_QUERY_MAX_RESPONSE_TIME_DSEC)
{
- vty_out(vty, " %s %d%s",
- PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC,
+ vty_out(vty, " ip igmp query-max-response-time-dsec %d%s",
pim_ifp->igmp_query_max_response_time_dsec,
VTY_NEWLINE);
++writes;
line = line.replace('" QUAGGA_REDIST_STR_OSPF6D "', '<kernel|connected|static|ripng|isis|bgp|table>')
line = line.replace('" QUAGGA_REDIST_STR_ISISD "', '<kernel|connected|static|rip|ripng|ospf|ospf6|bgp|pim|table>')
line = line.replace('" LOG_FACILITIES "', '<kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>')
- line = line.replace('" LOG_LEVELS "', ' (emergencies|alerts|critical|errors|warnings|notifications|informational|debugging)')
+ line = line.replace('" LOG_LEVELS "', ' <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>')
# endswith
line = line.replace('" CMD_AS_RANGE,', ' (1-4294967295)",')
line = line.replace('" QUAGGA_REDIST_STR_OSPF6D,', ' <kernel|connected|static|ripng|isis|bgp|table>",')
line = line.replace('" QUAGGA_REDIST_STR_ISISD,', ' <kernel|connected|static|rip|ripng|ospf|ospf6|bgp|pim|table>",')
line = line.replace('" LOG_FACILITIES,', ' <kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>",')
- line = line.replace('" LOG_LEVELS,', ' (emergencies|alerts|critical|errors|warnings|notifications|informational|debugging)",')
+ line = line.replace('" LOG_LEVELS,', ' <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",')
# startswith
line = line.replace('LISTEN_RANGE_CMD "', '"bgp listen range <A.B.C.D/M|X:X::X:X/M> ')
line = line.replace('PIM_CMD_IP_IGMP_QUERY_INTERVAL "', '"ip igmp query-interval ')
line = line.replace('PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME "', '"ip igmp query-max-response-time ')
line = line.replace('PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC "', '"ip igmp query-max-response-time-dsec ')
- line = line.replace('LOG_LEVELS "', '"(emergencies|alerts|critical|errors|warnings|notifications|informational|debugging) ')
+ line = line.replace('LOG_LEVELS "', '"<emergencies|alerts|critical|errors|warnings|notifications|informational|debugging> ')
# solo
line = line.replace('NO_NEIGHBOR_CMD2,', '"no neighbor <A.B.C.D|X:X::X:X|WORD>",')
DEFUNSH (VTYSH_BGPD,
router_bgp,
router_bgp_cmd,
- "router bgp " CMD_AS_RANGE,
+ "router bgp (1-4294967295)",
ROUTER_STR
BGP_STR
AS_STR)
ALIAS_SH (VTYSH_BGPD,
router_bgp,
router_bgp_view_cmd,
- "router bgp " CMD_AS_RANGE " (view|vrf) WORD",
+ "router bgp (1-4294967295) (view|vrf) WORD",
ROUTER_STR
BGP_STR
AS_STR
ALIAS_SH (VTYSH_ZEBRA,
vtysh_interface,
vtysh_interface_vrf_cmd,
- "interface IFNAME " VRF_CMD_STR,
+ "interface IFNAME vrf NAME",
"Select an interface to configure\n"
"Interface's name\n"
VRF_CMD_HELP_STR)
DEFSH (VTYSH_ZEBRA,
vtysh_no_interface_vrf_cmd,
- "no interface IFNAME " VRF_CMD_STR,
+ "no interface IFNAME vrf NAME",
NO_STR
"Delete a pseudo interface's configuration\n"
"Interface's name\n"
DEFUNSH (VTYSH_ALL,
vtysh_log_stdout_level,
vtysh_log_stdout_level_cmd,
- "log stdout "LOG_LEVELS,
+ "log stdout <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
"Logging control\n"
"Set stdout logging level\n"
LOG_LEVEL_DESC)
DEFUNSH (VTYSH_ALL,
vtysh_log_file_level,
vtysh_log_file_level_cmd,
- "log file FILENAME "LOG_LEVELS,
+ "log file FILENAME <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
"Logging control\n"
"Logging to file\n"
"Logging filename\n"
DEFUNSH (VTYSH_ALL,
vtysh_log_monitor_level,
vtysh_log_monitor_level_cmd,
- "log monitor "LOG_LEVELS,
+ "log monitor <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
"Logging control\n"
"Set terminal line (monitor) logging level\n"
LOG_LEVEL_DESC)
DEFUNSH (VTYSH_ALL,
vtysh_log_syslog_level,
vtysh_log_syslog_level_cmd,
- "log syslog "LOG_LEVELS,
+ "log syslog <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
"Logging control\n"
"Set syslog logging level\n"
LOG_LEVEL_DESC)
DEFUNSH (VTYSH_ALL,
vtysh_log_facility,
vtysh_log_facility_cmd,
- "log facility "LOG_FACILITIES,
+ "log facility <kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>",
"Logging control\n"
"Facility parameter for syslog messages\n"
LOG_FACILITY_DESC)
DEFUNSH_DEPRECATED (VTYSH_ALL,
vtysh_log_trap,
vtysh_log_trap_cmd,
- "log trap "LOG_LEVELS,
+ "log trap <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>",
"Logging control\n"
"(Deprecated) Set logging level and default for all destinations\n"
LOG_LEVEL_DESC)