Add missing docstrings and separating \n.
Also eat some low-hanging refactoring fruit.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
"no aggregate-address X:X::X:X/M [summary-only]",
NO_STR
"Configure BGP aggregate entries\n"
- "Aggregate prefix\n")
+ "Aggregate prefix\n"
+ "Filter more specific routes from updates\n")
{
int idx = 0;
argv_find (argv, argc, "X:X::X:X/M", &idx);
"no bgp dampening [(1-45) [(1-20000) (1-20000) (1-255)]]",
NO_STR
"BGP Specific commands\n"
- "Enable route-flap dampening\n")
+ "Enable route-flap dampening\n"
+ "Half-life time for the penalty\n"
+ "Value to start reusing a route\n"
+ "Value to start suppressing a route\n"
+ "Maximum duration to suppress a stable route\n")
{
struct bgp *bgp;
"BGP specific commands\n"
"Configure BGP Dynamic Neighbors\n"
"add a listening range for Dynamic Neighbors\n"
- LISTEN_RANGE_ADDR_STR)
+ NEIGHBOR_ADDR_STR
+ "Member of the peer-group\n"
+ "Peer-group name\n")
{
int idx_ipv4_ipv6_prefixlen = 3;
int idx_word = 5;
"Interface name or neighbor tag\n"
"Enable BGP on interface\n"
"Member of the peer-group\n"
- "peer-group name\n")
+ "Peer-group name\n")
{
int idx_word = 1;
int idx_peer_group_word = 4;
"Enable BGP on interface\n"
"Enable BGP with v6 link-local only\n"
"Member of the peer-group\n"
- "peer-group name\n")
+ "Peer-group name\n")
{
int idx_word = 1;
int idx_peer_group_word = 5;
"Configure BGP on interface\n"
"Enable BGP with v6 link-local only\n"
"Member of the peer-group\n"
- "peer-group name\n"
+ "Peer-group name\n"
+ "Specify remote AS\n"
AS_STR)
{
int idx_word = 2;
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Set a password\n")
+ "Set a password\n"
+ "The password\n")
{
int idx_peer = 2;
struct peer *peer;
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Member of the peer-group\n"
- "peer-group name\n")
+ "Peer-group name\n")
{
int idx_peer = 1;
int idx_word = 3;
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Member of the peer-group\n"
- "peer-group name\n")
+ "Peer-group name\n")
{
int idx_peer = 2;
int idx_word = 4;
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Remove private ASNs in outbound updates\n"
- "Apply to all AS numbers"
+ "Apply to all AS numbers\n"
"Replace private ASNs with our ASN in outbound updates\n")
{
int idx_peer = 1;
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Remove private ASNs in outbound updates\n"
- "Apply to all AS numbers")
+ "Apply to all AS numbers\n")
{
int idx_peer = 2;
return peer_af_flag_unset_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty),
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Remove private ASNs in outbound updates\n"
- "Apply to all AS numbers"
+ "Apply to all AS numbers\n"
"Replace private ASNs with our ASN in outbound updates\n")
{
int idx_peer = 2;
"no neighbor <A.B.C.D|X:X::X:X|WORD> interface WORD",
NO_STR
NEIGHBOR_STR
- NEIGHBOR_ADDR_STR
+ NEIGHBOR_ADDR_STR2
"Interface\n"
"Interface name\n")
{
"neighbor <A.B.C.D|X:X::X:X|WORD> maximum-prefix (1-4294967295) (1-100) restart (1-65535)",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Maximum number of prefix accept from this peer\n"
+ "Maximum number of prefixes to accept from this peer\n"
"maximum no. of prefix limit\n"
"Threshold value (%) at which to generate a warning msg\n"
"Restart bgp connection after limit is exceeded\n"
- "Restart interval in minutes")
+ "Restart interval in minutes\n")
{
int idx_peer = 1;
int idx_number = 3;
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Maximum number of prefix accept from this peer\n"
+ "Maximum number of prefixes to accept from this peer\n"
"maximum no. of prefix limit\n"
"Threshold value (%) at which to generate a warning msg\n"
"Restart bgp connection after limit is exceeded\n"
- "Restart interval in minutes"
+ "Restart interval in minutes\n"
"Only give warning message when limit is exceeded\n")
{
int idx_peer = 2;
"neighbor <A.B.C.D|X:X::X:X|WORD> ttl-security hops (1-254)",
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
+ "BGP ttl-security parameters\n"
"Specify the maximum number of hops to the BGP peer\n")
{
int idx_peer = 1;
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
+ "BGP ttl-security parameters\n"
"Specify the maximum number of hops to the BGP peer\n")
{
int idx_peer = 2;
BGP_STR
"Address Family\n"
"Address Family Modifier\n"
+ "Address Family Modifier\n"
"Clear bestpath and re-advertise\n"
"IPv6 prefix\n")
{
BGP_INSTANCE_HELP_STR
"Address Family\n"
"Address Family Modifier\n"
+ "Address Family Modifier\n"
"Clear bestpath and re-advertise\n"
"IPv6 prefix\n")
{
DEFUN (no_set_attached_bit,
no_set_attached_bit_cmd,
"no set-attached-bit",
+ NO_STR
"Reset attached bit\n")
{
VTY_DECLVAR_CONTEXT (isis_area, area);
DEFUN (max_lsp_lifetime,
max_lsp_lifetime_cmd,
- "max-lsp-lifetime (350-65535)",
- "Maximum LSP lifetime\n"
+ "max-lsp-lifetime [<level-1|level-2>] (350-65535)",
+ "Maximum LSP lifetime for Level 1 only\n"
+ "Maximum LSP lifetime for Level 2 only\n"
"LSP lifetime in seconds\n")
{
- int idx_number = 1;
- return area_max_lsp_lifetime_set(vty, IS_LEVEL_1_AND_2, atoi(argv[idx_number]->arg));
-}
+ int idx = 0;
+ unsigned int level = IS_LEVEL_1_AND_2;
+ if (argv_find (argv, argc, "level-1", &idx))
+ level = IS_LEVEL_1;
+ else if (argv_find (argv, argc, "level-2", &idx))
+ level = IS_LEVEL_2;
-DEFUN (no_max_lsp_lifetime,
- no_max_lsp_lifetime_cmd,
- "no max-lsp-lifetime [(350-65535)]",
- NO_STR
- "Maximum LSP lifetime\n"
- "LSP lifetime in seconds\n")
-{
- return area_max_lsp_lifetime_set(vty, IS_LEVEL_1_AND_2,
- DEFAULT_LSP_LIFETIME);
-}
-
+ argv_find (argv, argc, "(350-65535)", &idx);
+ int lifetime = atoi(argv[idx]->arg);
-DEFUN (max_lsp_lifetime_l1,
- max_lsp_lifetime_l1_cmd,
- "max-lsp-lifetime level-1 (350-65535)",
- "Maximum LSP lifetime for Level 1 only\n"
- "LSP lifetime for Level 1 only in seconds\n")
-{
- int idx_number = 2;
- return area_max_lsp_lifetime_set(vty, IS_LEVEL_1, atoi(argv[idx_number]->arg));
+ return area_max_lsp_lifetime_set(vty, level, lifetime);
}
-DEFUN (no_max_lsp_lifetime_l1,
- no_max_lsp_lifetime_l1_cmd,
- "no max-lsp-lifetime level-1 [(350-65535)]",
+DEFUN (no_max_lsp_lifetime,
+ no_max_lsp_lifetime_cmd,
+ "no max-lsp-lifetime [<level-1|level-2>] [(350-65535)]",
NO_STR
- "LSP lifetime for Level 1 only in seconds\n")
-{
- return area_max_lsp_lifetime_set(vty, IS_LEVEL_1, DEFAULT_LSP_LIFETIME);
-}
-
-
-DEFUN (max_lsp_lifetime_l2,
- max_lsp_lifetime_l2_cmd,
- "max-lsp-lifetime level-2 (350-65535)",
+ "Maximum LSP lifetime for Level 1 only\n"
"Maximum LSP lifetime for Level 2 only\n"
- "LSP lifetime for Level 2 only in seconds\n")
+ "LSP lifetime in seconds\n")
{
- int idx_number = 2;
- return area_max_lsp_lifetime_set(vty, IS_LEVEL_2, atoi(argv[idx_number]->arg));
-}
+ int idx = 0;
+ unsigned int level = IS_LEVEL_1_AND_2;
+ if (argv_find (argv, argc, "level-1", &idx))
+ level = IS_LEVEL_1;
+ else if (argv_find (argv, argc, "level-2", &idx))
+ level = IS_LEVEL_2;
-DEFUN (no_max_lsp_lifetime_l2,
- no_max_lsp_lifetime_l2_cmd,
- "no max-lsp-lifetime level-2 [(350-65535)]",
- NO_STR
- "LSP lifetime for Level 2 only in seconds\n")
-{
- return area_max_lsp_lifetime_set(vty, IS_LEVEL_2, DEFAULT_LSP_LIFETIME);
+ return area_max_lsp_lifetime_set(vty, level, DEFAULT_LSP_LIFETIME);
}
-
static int
area_lsp_refresh_interval_set(struct vty *vty, int level, uint16_t interval)
{
DEFUN (lsp_refresh_interval,
lsp_refresh_interval_cmd,
- "lsp-refresh-interval (1-65235)",
+ "lsp-refresh-interval [<level-1|level-2>] (1-65235)",
"LSP refresh interval\n"
+ "LSP refresh interval for Level 1 only\n"
+ "LSP refresh interval for Level 2 only\n"
"LSP refresh interval in seconds\n")
{
- int idx_number = 1;
- return area_lsp_refresh_interval_set(vty, IS_LEVEL_1_AND_2, atoi(argv[idx_number]->arg));
-}
+ int idx = 0;
+ unsigned int level = IS_LEVEL_1_AND_2;
+ unsigned int interval = 0;
+ if (argv_find (argv, argc, "level-1", &idx))
+ level = IS_LEVEL_1;
+ else if (argv_find (argv, argc, "level-2", &idx))
+ level = IS_LEVEL_2;
+
+ interval = atoi(argv[argc-1]->arg);
+ return area_lsp_refresh_interval_set(vty, level, interval);
+}
DEFUN (no_lsp_refresh_interval,
no_lsp_refresh_interval_cmd,
- "no lsp-refresh-interval [(1-65235)]",
+ "no lsp-refresh-interval [<level-1|level-2>] [(1-65235)]",
NO_STR
"LSP refresh interval\n"
- "LSP refresh interval in seconds\n")
-{
- return area_lsp_refresh_interval_set(vty, IS_LEVEL_1_AND_2,
- DEFAULT_MAX_LSP_GEN_INTERVAL);
-}
-
-
-DEFUN (lsp_refresh_interval_l1,
- lsp_refresh_interval_l1_cmd,
- "lsp-refresh-interval level-1 (1-65235)",
- "LSP refresh interval for Level 1 only\n"
- "LSP refresh interval for Level 1 only in seconds\n")
-{
- int idx_number = 2;
- return area_lsp_refresh_interval_set(vty, IS_LEVEL_1, atoi(argv[idx_number]->arg));
-}
-
-
-DEFUN (no_lsp_refresh_interval_l1,
- no_lsp_refresh_interval_l1_cmd,
- "no lsp-refresh-interval level-1 [(1-65235)]",
- NO_STR
"LSP refresh interval for Level 1 only\n"
- "LSP refresh interval for Level 1 only in seconds\n")
-{
- return area_lsp_refresh_interval_set(vty, IS_LEVEL_1,
- DEFAULT_MAX_LSP_GEN_INTERVAL);
-}
-
-
-DEFUN (lsp_refresh_interval_l2,
- lsp_refresh_interval_l2_cmd,
- "lsp-refresh-interval level-2 (1-65235)",
"LSP refresh interval for Level 2 only\n"
- "LSP refresh interval for Level 2 only in seconds\n")
+ "LSP refresh interval in seconds\n")
{
- int idx_number = 2;
- return area_lsp_refresh_interval_set(vty, IS_LEVEL_2, atoi(argv[idx_number]->arg));
-}
+ int idx = 0;
+ unsigned int level = IS_LEVEL_1_AND_2;
+ if (argv_find (argv, argc, "level-1", &idx))
+ level = IS_LEVEL_1;
+ else if (argv_find (argv, argc, "level-2", &idx))
+ level = IS_LEVEL_2;
-DEFUN (no_lsp_refresh_interval_l2,
- no_lsp_refresh_interval_l2_cmd,
- "no lsp-refresh-interval level-2 [(1-65235)]",
- NO_STR
- "LSP refresh interval for Level 2 only\n"
- "LSP refresh interval for Level 2 only in seconds\n")
-{
- return area_lsp_refresh_interval_set(vty, IS_LEVEL_2,
- DEFAULT_MAX_LSP_GEN_INTERVAL);
+ return area_lsp_refresh_interval_set(vty, level, DEFAULT_MAX_LSP_GEN_INTERVAL);
}
-
static int
area_passwd_set(struct vty *vty, int level,
int (*type_set)(struct isis_area *area, int level,
install_element (ISIS_NODE, &max_lsp_lifetime_cmd);
install_element (ISIS_NODE, &no_max_lsp_lifetime_cmd);
- install_element (ISIS_NODE, &max_lsp_lifetime_l1_cmd);
- install_element (ISIS_NODE, &no_max_lsp_lifetime_l1_cmd);
- install_element (ISIS_NODE, &max_lsp_lifetime_l2_cmd);
- install_element (ISIS_NODE, &no_max_lsp_lifetime_l2_cmd);
install_element (ISIS_NODE, &lsp_refresh_interval_cmd);
install_element (ISIS_NODE, &no_lsp_refresh_interval_cmd);
- install_element (ISIS_NODE, &lsp_refresh_interval_l1_cmd);
- install_element (ISIS_NODE, &no_lsp_refresh_interval_l1_cmd);
- install_element (ISIS_NODE, &lsp_refresh_interval_l2_cmd);
- install_element (ISIS_NODE, &no_lsp_refresh_interval_l2_cmd);
install_element (ISIS_NODE, &area_passwd_md5_cmd);
install_element (ISIS_NODE, &area_passwd_clear_cmd);
DEFUN (no_debug_isis_adj,
no_debug_isis_adj_cmd,
"no debug isis adj-packets",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS Adjacency related packets\n")
DEFUN (no_debug_isis_csum,
no_debug_isis_csum_cmd,
"no debug isis checksum-errors",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS LSP checksum errors\n")
DEFUN (no_debug_isis_lupd,
no_debug_isis_lupd_cmd,
"no debug isis local-updates",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS local update packets\n")
DEFUN (no_debug_isis_err,
no_debug_isis_err_cmd,
"no debug isis protocol-errors",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS LSP protocol errors\n")
DEFUN (no_debug_isis_snp,
no_debug_isis_snp_cmd,
"no debug isis snp-packets",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS CSNP/PSNP packets\n")
DEFUN (no_debug_isis_upd,
no_debug_isis_upd_cmd,
"no debug isis update-packets",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS Update related packets\n")
DEFUN (no_debug_isis_spfevents,
no_debug_isis_spfevents_cmd,
"no debug isis spf-events",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS Shortest Path First Events\n")
DEFUN (no_debug_isis_spfstats,
no_debug_isis_spfstats_cmd,
"no debug isis spf-statistics",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS SPF Timing and Statistic Data\n")
DEFUN (no_debug_isis_spftrigg,
no_debug_isis_spftrigg_cmd,
"no debug isis spf-triggers",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS SPF triggering events\n")
DEFUN (no_debug_isis_rtevents,
no_debug_isis_rtevents_cmd,
"no debug isis route-events",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS Route related events\n")
DEFUN (no_debug_isis_events,
no_debug_isis_events_cmd,
"no debug isis events",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS Events\n")
DEFUN (no_debug_isis_packet_dump,
no_debug_isis_packet_dump_cmd,
"no debug isis packet-dump",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS packet dump\n")
DEFUN (no_debug_isis_lsp_gen,
no_debug_isis_lsp_gen_cmd,
"no debug isis lsp-gen",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS generation of own LSPs\n")
DEFUN (no_debug_isis_lsp_sched,
no_debug_isis_lsp_sched_cmd,
"no debug isis lsp-sched",
+ NO_STR
UNDEBUG_STR
"IS-IS information\n"
"IS-IS scheduling of LSP generation\n")
#define IFNAME_STR "Interface name(e.g. ep0)\n"
#define IP6_STR "IPv6 Information\n"
#define OSPF6_STR "Open Shortest Path First (OSPF) for IPv6\n"
-#define OSPF6_ROUTER_STR "Enable a routing process\n"
#define OSPF6_INSTANCE_STR "(1-65535) Instance ID\n"
#define SECONDS_STR "(1-65535) Seconds\n"
#define ROUTE_STR "Routing Table\n"
#define NEIGHBOR_ADDR_STR2 "Neighbor address\nNeighbor tag\n"
#endif /* HAVE_IPV6 */
-/* Dynamic neighbor (listen range) configuration */
-#ifdef HAVE_IPV6
-#define LISTEN_RANGE_ADDR_STR "Neighbor address\nNeighbor IPv6 address\n"
-#else
-#define LISTEN_RANGE_ADDR_STR "Neighbor address\n"
-#endif /* HAVE_IPV6 */
-
/* Prototypes. */
extern void install_node (struct cmd_node *, int (*) (struct vty *));
extern void install_default (enum node_type);
DEBUG_STR
OSPF6_STR
"Debug Link State Advertisements (LSAs)\n"
- "Specify LS type as Hexadecimal\n"
- )
+ "Display Router LSAs\n"
+ "Display Network LSAs\n"
+ "Display Inter-Area-Prefix LSAs\n"
+ "Display As-External LSAs\n"
+ "Display Link LSAs\n"
+ "Display Intra-Area-Prefix LSAs\n"
+ "Display details of LSAs\n"
+ "Dump LSAs\n"
+ "Display LSA's internal information\n")
{
int idx_lsa = 4;
int idx_type = 5;
"debug ospf6 route <table|intra-area|inter-area|memory>",
DEBUG_STR
OSPF6_STR
+ "Debug routes\n"
"Debug route table calculation\n"
- "Debug detail\n"
"Debug intra-area route calculation\n"
"Debug inter-area route calculation\n"
"Debug route memory use\n"
NO_STR
DEBUG_STR
OSPF6_STR
+ "Debug routes\n"
"Debug route table calculation\n"
"Debug intra-area route calculation\n"
+ "Debug inter-area route calculation\n"
"Debug route memory use\n")
{
int idx_type = 4;
no_router_ospf6_cmd,
"no router ospf6",
NO_STR
- OSPF6_ROUTER_STR)
+ ROUTER_STR
+ OSPF6_STR)
{
- if (ospf6 == NULL)
- vty_out (vty, "OSPFv3 is not configured%s", VNL);
- else
- {
- ospf6_delete (ospf6);
- ospf6 = NULL;
- }
-
/* return to config node . */
vty->node = CONFIG_NODE;
vty->index = NULL;
SHOW_STR
IPV6_STR
OSPF6_STR
+ "Display Link state database\n"
"Display Self-originated LSAs\n"
"Display details of LSAs\n"
"Dump LSAs\n"
IP6_STR
OSPF6_STR
"Display routing table for ABR and ASBR\n"
- )
+ "Router ID\n"
+ "Show detailed output\n")
{
int idx_ipv4 = 4;
u_int32_t adv_router;
DEFUN (no_debug_ospf_ism,
no_debug_ospf_ism_cmd,
"no debug ospf [(1-65535)] ism [<status|events|timers>]",
+ NO_STR
DEBUG_STR
OSPF_STR
"Instance ID\n"
static int
no_debug_ospf_nsm_common (struct vty *vty, int arg_base, int argc, struct cmd_token **argv)
{
+ /* XXX qlyoung */
if (vty->node == CONFIG_NODE)
{
if (argc == arg_base + 0)
NO_STR
DEBUG_STR
OSPF_STR
- "OSPF Neighbor State Machine"
+ "OSPF Neighbor State Machine\n"
"NSM Status Information\n"
"NSM Event Information\n"
"NSM Timer Information\n")
DEBUG_STR
OSPF_STR
"Instance ID\n"
- "OSPF Neighbor State Machine"
+ "OSPF Neighbor State Machine\n"
"NSM Status Information\n"
"NSM Event Information\n"
"NSM Timer Information\n")
"Database summary\n"
OSPF_LSA_TYPES_DESC
"Advertising Router link states\n"
- "Advertising Router (as an IP address)\n")
+ "Advertising Router (as an IP address)\n"
+ "Self-originated link states\n")
{
struct ospf *ospf;
router_ospf6,
router_ospf6_cmd,
"router ospf6",
- OSPF6_ROUTER_STR
+ ROUTER_STR
OSPF6_STR)
{
vty->node = OSPF6_NODE;
"For the ripng daemon\n"
"For the ospf daemon\n"
"For the ospfv6 daemon\n"
- "For the ldpd daemon"
+ "For the ldpd daemon\n"
"For the bgp daemon\n"
"For the isis daemon\n"
"For the pim daemon\n")
DEFUN (debug_zebra_packet,
debug_zebra_packet_cmd,
- "debug zebra packet",
- DEBUG_STR
- "Zebra configuration\n"
- "Debug option set for zebra packet\n")
-{
- zebra_debug_packet = ZEBRA_DEBUG_PACKET;
- SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
- SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
- return CMD_SUCCESS;
-}
-
-DEFUN (debug_zebra_packet_direct,
- debug_zebra_packet_direct_cmd,
- "debug zebra packet <recv|send|detail>",
+ "debug zebra packet [<recv|send>] [detail]",
DEBUG_STR
"Zebra configuration\n"
"Debug option set for zebra packet\n"
"Debug option set for receive packet\n"
- "Debug option set for send packet\n")
+ "Debug option set for send packet\n"
+ "Debug option set for detailed info\n")
{
- int idx_recv_send = 3;
+ int idx = 0;
zebra_debug_packet = ZEBRA_DEBUG_PACKET;
- if (strncmp ("send", argv[idx_recv_send]->arg, strlen (argv[idx_recv_send]->arg)) == 0)
+
+ if (argv_find (argv, argc, "send", &idx))
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
- if (strncmp ("recv", argv[idx_recv_send]->arg, strlen (argv[idx_recv_send]->arg)) == 0)
+ idx = 0;
+ if (argv_find (argv, argc, "recv", &idx))
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
- if (strncmp ("detail", argv[idx_recv_send]->arg, strlen (argv[idx_recv_send]->arg)) == 0)
+ idx = 0;
+ if (argv_find (argv, argc, "detail", &idx))
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
- return CMD_SUCCESS;
-}
-DEFUN (debug_zebra_packet_detail,
- debug_zebra_packet_detail_cmd,
- "debug zebra packet <recv|send> detail",
- DEBUG_STR
- "Zebra configuration\n"
- "Debug option set for zebra packet\n"
- "Debug option set for receive packet\n"
- "Debug option set for send packet\n"
- "Debug option set detailed information\n")
-{
- int idx_recv_send = 3;
- zebra_debug_packet = ZEBRA_DEBUG_PACKET;
- if (strncmp ("send", argv[idx_recv_send]->arg, strlen (argv[idx_recv_send]->arg)) == 0)
+ if (!(zebra_debug_packet & ZEBRA_DEBUG_SEND & ZEBRA_DEBUG_RECV))
+ {
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
- if (strncmp ("recv", argv[idx_recv_send]->arg, strlen (argv[idx_recv_send]->arg)) == 0)
SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
- SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL);
+ }
return CMD_SUCCESS;
}
DEFUN (no_debug_zebra_packet,
no_debug_zebra_packet_cmd,
- "no debug zebra packet",
- NO_STR
- DEBUG_STR
- "Zebra configuration\n"
- "Debug option set for zebra packet\n")
-{
- zebra_debug_packet = 0;
- return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_zebra_packet_direct,
- no_debug_zebra_packet_direct_cmd,
- "no debug zebra packet <recv|send>",
+ "no debug zebra packet [<recv|send>]",
NO_STR
DEBUG_STR
"Zebra configuration\n"
"Debug option set for receive packet\n"
"Debug option set for send packet\n")
{
- int idx_recv_send = 4;
- if (strncmp ("send", argv[idx_recv_send]->arg, strlen (argv[idx_recv_send]->arg)) == 0)
+ int idx = 0;
+ if (argc == 4 || argv_find (argv, argc, "send", &idx))
UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND);
- if (strncmp ("recv", argv[idx_recv_send]->arg, strlen (argv[idx_recv_send]->arg)) == 0)
+ if (argc == 4 || argv_find (argv, argc, "recv", &idx))
UNSET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV);
return CMD_SUCCESS;
}
DEFUN (no_debug_zebra_kernel_msgdump,
no_debug_zebra_kernel_msgdump_cmd,
"no debug zebra kernel msgdump [<recv|send>]",
+ NO_STR
DEBUG_STR
"Zebra configuration\n"
"Debug option set for zebra between kernel interface\n"
"Dump raw netlink messages received\n"
"Dump raw netlink messages sent\n")
{
- int idx_recv_send = 5;
- if (!argv[1] || (argv[idx_recv_send]->arg && strncmp(argv[idx_recv_send]->arg, "recv", strlen(argv[idx_recv_send]->arg)) == 0))
+ int idx = 0;
+ if (argc == 5 || argv_find (argv, argc, "recv", &idx))
UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV);
- if (!argv[idx_recv_send]->arg || (argv[idx_recv_send]->arg && strncmp(argv[idx_recv_send]->arg, "send", strlen(argv[idx_recv_send]->arg)) == 0))
+ if (argc == 5 || argv_find (argv, argc, "send", &idx))
UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND);
+
return CMD_SUCCESS;
}
install_element (ENABLE_NODE, &debug_zebra_nht_cmd);
install_element (ENABLE_NODE, &debug_zebra_mpls_cmd);
install_element (ENABLE_NODE, &debug_zebra_packet_cmd);
- install_element (ENABLE_NODE, &debug_zebra_packet_direct_cmd);
- install_element (ENABLE_NODE, &debug_zebra_packet_detail_cmd);
install_element (ENABLE_NODE, &debug_zebra_kernel_cmd);
install_element (ENABLE_NODE, &debug_zebra_kernel_msgdump_cmd);
install_element (ENABLE_NODE, &debug_zebra_rib_cmd);
install_element (CONFIG_NODE, &debug_zebra_nht_cmd);
install_element (CONFIG_NODE, &debug_zebra_mpls_cmd);
install_element (CONFIG_NODE, &debug_zebra_packet_cmd);
- install_element (CONFIG_NODE, &debug_zebra_packet_direct_cmd);
- install_element (CONFIG_NODE, &debug_zebra_packet_detail_cmd);
install_element (CONFIG_NODE, &debug_zebra_kernel_cmd);
install_element (CONFIG_NODE, &debug_zebra_kernel_msgdump_cmd);
install_element (CONFIG_NODE, &debug_zebra_rib_cmd);
NO_STR
MATCH_STR
IP_STR
- "Match prefixlen of ip address of route\n"
+ "Match prefix length of ip address\n"
+ "Match prefix length of ip address\n"
"Prefix length\n")
{
char *plen = (argc == 6) ? argv[5]->arg : NULL;
match_source_protocol_cmd,
"match source-protocol <bgp|ospf|rip|ripng|isis|ospf6|connected|system|kernel|static>",
MATCH_STR
- "Match protocol via which the route was learnt\n")
+ "Match protocol via which the route was learnt\n"
+ "BGP protocol\n"
+ "OSPF protocol\n"
+ "RIP protocol\n"
+ "RIPNG protocol\n"
+ "ISIS protocol\n"
+ "OSPF6 protocol\n"
+ "Routes from directly connected peer\n"
+ "Routes from system configuration\n"
+ "Routes from kernel\n"
+ "Statically configured routes\n")
{
char *proto = argv[2]->text;
int i;
NO_STR
MATCH_STR
"No match protocol via which the route was learnt\n"
- )
+ "BGP protocol\n"
+ "OSPF protocol\n"
+ "RIP protocol\n"
+ "RIPNG protocol\n"
+ "ISIS protocol\n"
+ "OSPF6 protocol\n"
+ "Routes from directly connected peer\n"
+ "Routes from system configuration\n"
+ "Routes from kernel\n"
+ "Statically configured routes\n")
{
char *proto = (argc == 4) ? argv[3]->text : NULL;
return zebra_route_match_delete (vty, "source-protocol", proto, RMAP_EVENT_MATCH_DELETED);
"set src <A.B.C.D|X:X::X:X>",
SET_STR
"src address for route\n"
- "src address\n")
+ "IPv4 src address\n"
+ "IPv6 src address\n")
{
int idx_ip = 2;
union g_addr src;
DEFUN (zebra_route_map_timer,
zebra_route_map_timer_cmd,
"zebra route-map delay-timer (0-600)",
+ "Zebra information\n"
+ "Set route-map parameters\n"
"Time to wait before route-map updates are processed\n"
"0 means event-driven updates are disabled\n")
{
no_zebra_route_map_timer_cmd,
"no zebra route-map delay-timer [(0-600)]",
NO_STR
- "Time to wait before route-map updates are processed\n"
+ "Zebra information\n"
+ "Set route-map parameters\n"
"Reset delay-timer to default value, 30 secs\n"
"0 means event-driven updates are disabled\n")
-
{
zebra_route_map_set_delay_timer(ZEBRA_RMAP_DEFAULT_UPDATE_TIMER);