"Specify packets to forward\n"
"A regular-expression to match the BGP AS paths\n")
{
- /* CHECK ME argc referenced below */
int idx_word = 3;
int idx_permit_deny = 4;
enum as_filter_type type;
}
/* Check AS path regex. */
- regstr = argv_concat(argv, argc, 2);
+ regstr = argv_concat(argv, argc, idx_permit_deny);
regex = bgp_regcomp (regstr);
if (!regex)
"Specify packets to forward\n"
"A regular-expression to match the BGP AS paths\n")
{
- /* CHECK ME argc referenced below */
int idx_word = 4;
int idx_permit_deny = 5;
enum as_filter_type type;
}
/* Compile AS path. */
- regstr = argv_concat(argv, argc, 2);
+ regstr = argv_concat(argv, argc, idx_permit_deny);
regex = bgp_regcomp (regstr);
if (!regex)
"Use the peer's AS-number\n"
"Number of times to insert")
{
- /* CHECK ME argc referenced below */
+ int idx_asn = 3;
int ret;
char *str;
- str = argv_concat (argv, argc, 0);
+ str = argv_concat (argv, argc, idx_asn);
ret = bgp_route_set_add (vty, vty->index, "as-path prepend", str);
XFREE (MTYPE_TMP, str);
"Prepend to the as-path\n"
"AS number\n")
{
- /* CHECK ME argc referenced below */
+ int idx_asn = 4;
int ret;
char *str;
- str = argv_concat (argv, argc, 0);
+ str = argv_concat (argv, argc, idx_asn);
ret = bgp_route_set_delete (vty, vty->index, "as-path prepend", str);
XFREE (MTYPE_TMP, str);
return ret;
"Exclude from the as-path\n"
"AS number\n")
{
- /* CHECK ME argc referenced below */
+ int idx_asn = 3;
int ret;
char *str;
- str = argv_concat (argv, argc, 0);
+ str = argv_concat (argv, argc, idx_asn);
ret = bgp_route_set_add (vty, vty->index, "as-path exclude", str);
XFREE (MTYPE_TMP, str);
return ret;
"Exclude from the as-path\n"
"AS number\n")
{
- /* CHECK ME argc referenced below */
+ int idx_asn = 4;
int ret;
char *str;
- str = argv_concat (argv, argc, 0);
+ str = argv_concat (argv, argc, idx_asn);
ret = bgp_route_set_delete (vty, vty->index, "as-path exclude", str);
XFREE (MTYPE_TMP, str);
return ret;
"BGP community attribute\n"
COMMUNITY_VAL_STR)
{
- /* CHECK ME argc referenced below */
+ int idx_aa_nn = 2;
int i;
int first = 0;
int additive = 0;
b = buffer_new (1024);
- for (i = 0; i < argc; i++)
+ for (i = idx_aa_nn; i < argc; i++)
{
if (strncmp (argv[i]->arg, "additive", strlen (argv[i]->arg)) == 0)
{
"Route Target extended community\n"
"VPN extended community\n")
{
- /* CHECK ME argc referenced below */
+ int idx_asn_nn = 3;
int ret;
char *str;
- str = argv_concat (argv, argc, 0);
+ str = argv_concat (argv, argc, idx_asn_nn);
ret = bgp_route_set_add (vty, vty->index, "extcommunity rt", str);
XFREE (MTYPE_TMP, str);
"Site-of-Origin extended community\n"
"VPN extended community\n")
{
- /* CHECK ME argc referenced below */
+ int idx_asn_nn = 3;
int ret;
char *str;
- str = argv_concat (argv, argc, 0);
+ str = argv_concat (argv, argc, idx_asn_nn);
ret = bgp_route_set_add (vty, vty->index, "extcommunity soo", str);
XFREE (MTYPE_TMP, str);
return ret;
"Peer ASs in BGP confederation\n"
AS_STR)
{
- /* CHECK ME argc referenced below */
+ int idx_asn = 3;
struct bgp *bgp;
as_t as;
int i;
bgp = vty->index;
- for (i = 0; i < argc; i++)
+ for (i = idx_asn; i < argc; i++)
{
VTY_GET_INTEGER_RANGE ("AS", as, argv[i]->arg, 1, BGP_AS4_MAX);
"Peer ASs in BGP confederation\n"
AS_STR)
{
- /* CHECK ME argc referenced below */
+ int idx_asn = 4;
struct bgp *bgp;
as_t as;
int i;
bgp = vty->index;
- for (i = 0; i < argc; i++)
+ for (i = idx_asn; i < argc; i++)
{
VTY_GET_INTEGER_RANGE ("AS", as, argv[i]->arg, 1, BGP_AS4_MAX);
"Neighbor specific description\n"
"Up to 80 characters describing this neighbor\n")
{
- /* CHECK ME argc referenced below */
int idx_peer = 1;
+ int idx_line = 3;
struct peer *peer;
char *str;
if (! peer)
return CMD_WARNING;
- if (argc == 1)
- return CMD_SUCCESS;
-
- str = argv_concat(argv, argc, 1);
+ str = argv_concat(argv, argc, idx_line);
peer_description_set (peer, str);
"quit",
"Exit current mode and down to previous mode\n")
{
- /* CHECK ME argc referenced below */
return config_exit (self, vty, argc, argv);
}
"Write configuration currently in memory\n"
"Write configuration to terminal\n")
{
- /* CHECK ME argc referenced below */
int idx_type = 1;
unsigned int i;
int fd;
SHOW_STR
"running configuration (same as write terminal/memory)\n")
{
- /* CHECK ME argc referenced below */
return config_write (self, vty, argc, argv);
}
"Copy running config to... \n"
"Copy running config to startup config (same as write file)\n")
{
- /* CHECK ME argc referenced below */
return config_write (self, vty, argc, argv);
}
/** -- **/
"Specifies a HIDDEN password will follow\n"
"The password string\n")
{
- /* CHECK ME argc referenced below */
int idx_8 = 1;
int idx_word = 2;
if (argc == 3) // '8' was specified
"dummy string \n"
"The HIDDEN 'enable' password string\n")
{
- /* CHECK ME argc referenced below */
int idx_8 = 2;
int idx_word = 3;
+
/* Crypt type is specified. */
if (argc == 4)
{
{
char *message;
- vty_out (vty, "%s%s", ((message = argv_concat (argv, argc, 0)) ? message : ""),
+ vty_out (vty, "%s%s", ((message = argv_concat (argv, argc, 1)) ? message : ""),
VTY_NEWLINE);
if (message)
XFREE(MTYPE_TMP, message);
LOG_LEVEL_DESC
"The message to send\n")
{
- /* CHECK ME argc referenced below */
int idx_log_level = 1;
+ int idx_message = 2;
int level;
char *message;
if ((level = level_match(argv[idx_log_level]->arg)) == ZLOG_DISABLED)
return CMD_ERR_NO_MATCH;
- zlog(NULL, level, "%s", ((message = argv_concat(argv, argc, 1)) ? message : ""));
+ zlog(NULL, level, "%s", ((message = argv_concat(argv, argc, idx_message)) ? message : ""));
if (message)
XFREE(MTYPE_TMP, message);
return CMD_SUCCESS;
"Set stdout logging level\n"
LOG_LEVEL_DESC)
{
- /* CHECK ME argc referenced below */
int idx_log_level = 2;
- if (argc == 2)
+
+ if (argc == idx_log_level)
{
zlog_set_level (NULL, ZLOG_DEST_STDOUT, zlog_default->default_lvl);
return CMD_SUCCESS;
"Set terminal line (monitor) logging level\n"
LOG_LEVEL_DESC)
{
- /* CHECK ME argc referenced below */
int idx_log_level = 2;
- if (argc == 2)
+
+ if (argc == idx_log_level)
{
zlog_set_level (NULL, ZLOG_DEST_MONITOR, zlog_default->default_lvl);
return CMD_SUCCESS;
"Logging filename\n"
LOG_LEVEL_DESC)
{
- /* CHECK ME argc referenced below */
int idx_filename = 2;
int idx_log_levels = 3;
if (argc == 4)
"Set syslog logging level\n"
LOG_LEVEL_DESC)
{
- /* CHECK ME argc referenced below */
int idx_log_levels = 2;
if (argc == 3)
{
"Access list entry comment\n"
"Comment up to 100 characters\n")
{
- /* CHECK ME argc referenced below */
int idx_acl = 1;
+ int idx_remark = 3;
struct access_list *access;
access = access_list_get (AFI_IP, argv[idx_acl]->arg);
XFREE (MTYPE_TMP, access->remark);
access->remark = NULL;
}
- access->remark = argv_concat(argv, argc, 1);
+ access->remark = argv_concat(argv, argc, idx_remark);
return CMD_SUCCESS;
}
"Access list entry comment\n"
"Comment up to 100 characters\n")
{
- /* CHECK ME argc referenced below */
return no_access_list_remark (self, vty, argc, argv);
}
"Access list entry comment\n"
"Comment up to 100 characters\n")
{
- /* CHECK ME argc referenced below */
int idx_word = 2;
+ int idx_line = 4;
struct access_list *access;
access = access_list_get (AFI_IP6, argv[idx_word]->arg);
XFREE (MTYPE_TMP, access->remark);
access->remark = NULL;
}
- access->remark = argv_concat(argv, argc, 1);
+ access->remark = argv_concat(argv, argc, idx_line);
return CMD_SUCCESS;
}
"Access list entry comment\n"
"Comment up to 100 characters\n")
{
- /* CHECK ME argc referenced below */
return no_ipv6_access_list_remark (self, vty, argc, argv);
}
GRAMMAR_STR
"command to pass to new parser\n")
{
- /* CHECK ME argc referenced below */
+ int idx_command = 2;
// make a string from tokenized command line
- char *command = argv_concat (argv, argc, 0);
+ char *command = argv_concat (argv, argc, idx_command);
// create cmd_element for parser
struct cmd_element *cmd = XCALLOC (MTYPE_CMD_TOKENS, sizeof (struct cmd_element));
"attempt to complete input on DFA\n"
"command to complete")
{
- /* CHECK ME argc referenced below */
- char *cmdstr = argv_concat (argv, argc, 0);
+ int idx_command = 2;
+ char *cmdstr = argv_concat (argv, argc, idx_command);
vector command = cmd_make_strvec (cmdstr);
// generate completions of user input
"attempt to match input on DFA\n"
"command to match")
{
- /* CHECK ME argc referenced below */
+ int idx_command = 2;
if (argv[0][0] == '#')
return CMD_SUCCESS;
- char *cmdstr = argv_concat(argv, argc, 0);
+ char *cmdstr = argv_concat(argv, argc, idx_command);
vector command = cmd_make_strvec (cmdstr);
struct list *argvv = NULL;
"Interface specific description\n"
"Characters describing this interface\n")
{
- /* CHECK ME argc referenced below */
+ int idx_line = 1;
struct interface *ifp;
- if (argc == 1)
- return CMD_SUCCESS;
-
ifp = vty->index;
if (ifp->desc)
XFREE (MTYPE_TMP, ifp->desc);
- ifp->desc = argv_concat(argv, argc, 1);
+ ifp->desc = argv_concat(argv, argc, idx_line);
return CMD_SUCCESS;
}
vrf_id_t vrf_id = VRF_DEFAULT;
if (argc > 2)
- VRF_GET_ID (vrf_id, argv[idx_vrf_cmd_str]->arg);
+ VRF_GET_ID (vrf_id, argv[idx_vrf]->arg);
for (ALL_LIST_ELEMENTS_RO (vrf_iflist (vrf_id), node, ifp))
{
"Prefix-list specific description\n"
"Up to 80 characters describing this prefix-list\n")
{
- /* CHECK ME argc referenced below */
int idx_word = 2;
+ int idx_line = 4;
struct prefix_list *plist;
plist = prefix_list_get (AFI_IP, 0, argv[idx_word]->arg);
XFREE (MTYPE_TMP, plist->desc);
plist->desc = NULL;
}
- plist->desc = argv_concat(argv, argc, 1);
+ plist->desc = argv_concat(argv, argc, idx_line);
return CMD_SUCCESS;
}
"Prefix-list specific description\n"
"Up to 80 characters describing this prefix-list\n")
{
- /* CHECK ME argc referenced below */
return no_ip_prefix_list_description (self, vty, argc, argv);
}
"Prefix-list specific description\n"
"Up to 80 characters describing this prefix-list\n")
{
- /* CHECK ME argc referenced below */
int idx_word = 2;
+ int iddx_line = 4;
struct prefix_list *plist;
plist = prefix_list_get (AFI_IP6, 0, argv[idx_word]->arg);
XFREE (MTYPE_TMP, plist->desc);
plist->desc = NULL;
}
- plist->desc = argv_concat(argv, argc, 1);
+ plist->desc = argv_concat(argv, argc, iddx_line);
return CMD_SUCCESS;
}
"Prefix-list specific description\n"
"Up to 80 characters describing this prefix-list\n")
{
- /* CHECK ME argc referenced below */
return no_ipv6_prefix_list_description_comment (self, vty, argc, argv);
}
"Continue on a different entry within the route-map\n"
"Route-map entry sequence number\n")
{
- /* CHECK ME argc referenced below */
return rmap_onmatch_goto (self, vty, argc, argv);
}
"Continue on a different entry within the route-map\n"
"Route-map entry sequence number\n")
{
- /* CHECK ME argc referenced below */
return no_rmap_onmatch_goto (self, vty, argc, argv);
}
"Route-map comment\n"
"Comment describing this route-map rule\n")
{
- /* CHECK ME argc referenced below */
+ int idx_line = 1;
struct route_map_index *index;
index = vty->index;
{
if (index->description)
XFREE (MTYPE_TMP, index->description);
- index->description = argv_concat (argv, argc, 1);
+ index->description = argv_concat (argv, argc, idx_line);
}
return CMD_SUCCESS;
}
"Set terminal line parameters\n"
"Copy debug output to the current terminal line\n")
{
- /* CHECK ME argc referenced below */
return terminal_no_monitor (self, vty, argc, argv);
}
"Detail Information\n"
"Detail Information\n")
{
- /* CHECK ME argc referenced below */
int inst = (argv[2]->type == RANGE_TKN) ? 1 : 0;
int detail = strmatch (argv[argc - 1]->text, "detail");
int send = strmatch (argv[argc - (1+detail)]->text, "send");
"Detail Information\n"
"Detail Information\n")
{
- /* CHECK ME argc referenced below */
int inst = (argv[3]->type == RANGE_TKN) ? 1 : 0;
int detail = strmatch (argv[argc - 1]->text, "detail");
int send = strmatch (argv[argc - (1+detail)]->text, "send");
"ISM Event Information\n"
"ISM TImer Information\n")
{
- /* CHECK ME argc referenced below */
int inst = (argv[2]->type == RANGE_TKN);
char *dbgparam = (argc == 4 + inst) ? argv[argc - 1]->text : NULL;
"ISM Event Information\n"
"ISM TImer Information\n")
{
- /* CHECK ME argc referenced below */
int inst = (argv[3]->type == RANGE_TKN);
char *dbgparam = (argc == 5 + inst) ? argv[argc - 1]->text : NULL;
"Enable the Router Information functionality with Area flooding scope\n"
"OSPF area ID in IP format")
{
- /* CHECK ME argc referenced below */
int idx_ipv4 = 2;
char *area = (argc == 3) ? argv[idx_ipv4]->arg : NULL;
"IP access-list number (expanded range)\n"
"IP access-list name\n")
{
- /* CHECK ME argc referenced below */
char *al = (argc == 5) ? argv[4]->arg : NULL;
return ospf_route_match_delete (vty, vty->index, "ip next-hop", al);
}
"Match entries of prefix-lists\n"
"IP prefix-list name\n")
{
- /* CHECK ME argc referenced below */
char *pl = (argc == 6) ? argv[5]->arg : NULL;
return ospf_route_match_delete (vty, vty->index, "ip next-hop prefix-list", pl);
}
"IP access-list number (expanded range)\n"
"IP access-list name\n")
{
- /* CHECK ME argc referenced below */
char *al = (argc == 5) ? argv[4]->arg : NULL;
return ospf_route_match_delete (vty, vty->index, "ip address", al);
}
"Match entries of prefix-lists\n"
"IP prefix-list name\n")
{
- /* CHECK ME argc referenced below */
char *pl = (argc == 6) ? argv[5]->arg : NULL;
return ospf_route_match_delete (vty, vty->index, "ip address prefix-list", pl);
}
"Match first hop interface of route\n"
"Interface name\n")
{
- /* CHECK ME argc referenced below */
char *iface = (argc == 4) ? argv[3]->arg : NULL;
return ospf_route_match_delete (vty, vty->index, "interface", iface);
}
"Match tag of route\n"
"Tag value\n")
{
- /* CHECK ME argc referenced below */
char *tag = (argc == 4) ? argv[3]->arg : NULL;
return ospf_route_match_delete (vty, vty->index, "tag", tag);
}
"Metric value for destination routing protocol\n"
"Metric value\n")
{
- /* CHECK ME argc referenced below */
char *mval = (argc == 4) ? argv[3]->arg : NULL;
return ospf_route_set_delete (vty, vty->index, "metric", mval);
}
"OSPF[6] external type 1 metric\n"
"OSPF[6] external type 2 metric\n")
{
- /* CHECK ME argc referenced below */
char *ext = (argc == 4) ? argv[3]->text : NULL;
return ospf_route_set_delete (vty, vty->index, "metric-type", ext);
}
"Tag value for routing protocol\n"
"Tag value\n")
{
- /* CHECK ME argc referenced below */
char *tag = (argc == 4) ? argv[3]->arg : NULL;
return ospf_route_set_delete (vty, vty->index, "tag", tag);
}
"Record type\n"
"Sources\n")
{
- /* CHECK ME argc referenced below */
int idx_number = 4;
int idx_ipv4 = 5;
int idx_number_2 = 6;
+ int idx_line = 7;
char buf[1000];
char *igmp_msg;
struct ip *ip_hdr;
/* Scan LINE sources */
sources = (struct in_addr *) (group_record + IGMP_V3_GROUP_RECORD_SOURCE_OFFSET);
src_addr = sources;
- for (argi = 3; argi < argc; ++argi,++src_addr) {
+ for (argi = idx_line; argi < argc; ++argi,++src_addr) {
src_str = argv[argi]->arg;
result = inet_pton(AF_INET, src_str, src_addr);
if (result <= 0) {
"Neighbor address\n"
"Packet dump\n")
{
- /* CHECK ME argc referenced below */
int idx_interface = 4;
int idx_ipv4 = 5;
+ int idx_line = 6;
uint8_t buf[1000];
uint8_t *pim_msg;
struct ip *ip_hdr;
pim_msg_size = 0;
/* Scan LINE dump into buffer */
- for (argi = 2; argi < argc; ++argi) {
+ for (argi = idx_line; argi < argc; ++argi) {
const char *str = argv[argi]->arg;
int str_len = strlen(str);
int str_last = str_len - 1;
"Neighbor LAN prune delay T-bit\n"
"Neighbor secondary addresses\n")
{
- /* CHECK ME argc referenced below */
int idx_interface = 4;
int idx_ipv4 = 5;
int idx_number = 6;
int idx_number_4 = 9;
int idx_number_5 = 10;
int idx_number_6 = 11;
+ int idx_line = 12;
uint8_t buf[1000];
uint8_t *pim_msg;
struct ip *ip_hdr;
pim_msg = buf + ip_hlen;
/* Scan LINE addresses */
- for (argi = 8; argi < argc; ++argi) {
+ for (argi = idx_line; argi < argc; ++argi) {
const char *sec_str = argv[argi]->arg;
struct in_addr sec_addr;
result = inet_pton(AF_INET, sec_str, &sec_addr);
"Do not use prefix for autoconfiguration\n"
"Do not use prefix for onlink determination\n")
{
- /* CHECK ME argc referenced below */
/* prelude */
char *prefix = argv[3]->arg;
int lifetimes = (argc > 4) && (argv[4]->type == RANGE_TKN || strmatch (argv[4]->text, "infinite"));
VRF_CMD_HELP_STR)
{
int idx_vrf = 4;
- int idx_json = 5;
u_char uj = use_json(argc, argv);
return do_show_ip_route (vty, argv[idx_vrf]->arg, SAFI_UNICAST, uj);
VRF_CMD_HELP_STR
"Output JSON\n")
{
- /* CHECK ME argc referenced below */
struct route_table *table;
struct route_node *rn;
struct rib *rib;
VRF_CMD_HELP_STR
QUAGGA_IP6_REDIST_HELP_STR_ZEBRA)
{
- /* CHECK ME argc referenced below */
int type;
struct route_table *table;
struct route_node *rn;
"route-map for filtering\n"
"route-map name\n")
{
- /* CHECK ME argc referenced below */
u_int32_t table_id = 0;
VTY_GET_INTEGER("table", table_id, argv[2]->arg);