xtables_error(PARAMETER_PROBLEM,
"Only one `--ahspi' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_ah_spis(argv[optind-1], ahinfo->spis);
+ parse_ah_spis(optarg, ahinfo->spis);
if (invert)
ahinfo->invflags |= IP6T_AH_INV_SPI;
*flags |= IP6T_AH_SPI;
xtables_error(PARAMETER_PROBLEM,
"Only one `--ahlen' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- ahinfo->hdrlen = parse_ah_spi(argv[optind-1], "length");
+ ahinfo->hdrlen = parse_ah_spi(optarg, "length");
if (invert)
ahinfo->invflags |= IP6T_AH_INV_LEN;
*flags |= IP6T_AH_LEN;
xtables_error(PARAMETER_PROBLEM,
"Only one `--dst-len' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- optinfo->hdrlen = parse_opts_num(argv[optind-1], "length");
+ optinfo->hdrlen = parse_opts_num(optarg, "length");
if (invert)
optinfo->invflags |= IP6T_OPTS_INV_LEN;
optinfo->flags |= IP6T_OPTS_LEN;
if (invert)
xtables_error(PARAMETER_PROBLEM,
" '!' not allowed with `--dst-opts'");
- optinfo->optsnr = parse_options(argv[optind-1], optinfo->opts);
+ optinfo->optsnr = parse_options(optarg, optinfo->opts);
optinfo->flags |= IP6T_OPTS_OPTS;
*flags |= IP6T_OPTS_OPTS;
break;
xtables_error(PARAMETER_PROBLEM,
"Only one `--fragid' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_frag_ids(argv[optind-1], fraginfo->ids);
+ parse_frag_ids(optarg, fraginfo->ids);
if (invert)
fraginfo->invflags |= IP6T_FRAG_INV_IDS;
fraginfo->flags |= IP6T_FRAG_IDS;
xtables_error(PARAMETER_PROBLEM,
"Only one `--fraglen' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- fraginfo->hdrlen = parse_frag_id(argv[optind-1], "length");
+ fraginfo->hdrlen = parse_frag_id(optarg, "length");
if (invert)
fraginfo->invflags |= IP6T_FRAG_INV_LEN;
fraginfo->flags |= IP6T_FRAG_LEN;
xtables_error(PARAMETER_PROBLEM,
"Only one `--hbh-len' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- optinfo->hdrlen = parse_opts_num(argv[optind-1], "length");
+ optinfo->hdrlen = parse_opts_num(optarg, "length");
if (invert)
optinfo->invflags |= IP6T_OPTS_INV_LEN;
optinfo->flags |= IP6T_OPTS_LEN;
if (invert)
xtables_error(PARAMETER_PROBLEM,
" '!' not allowed with `--hbh-opts'");
- optinfo->optsnr = parse_options(argv[optind-1], optinfo->opts);
+ optinfo->optsnr = parse_options(optarg, optinfo->opts);
optinfo->flags |= IP6T_OPTS_OPTS;
*flags |= IP6T_OPTS_OPTS;
break;
u_int8_t value;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- value = atoi(argv[optind-1]);
+ value = atoi(optarg);
if (*flags)
xtables_error(PARAMETER_PROBLEM,
xtables_error(PARAMETER_PROBLEM,
"icmpv6 match: only use --icmpv6-type once!");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_icmpv6(argv[optind-1], &icmpv6info->type,
+ parse_icmpv6(optarg, &icmpv6info->type,
icmpv6info->code);
if (invert)
icmpv6info->invflags |= IP6T_ICMP_INV;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- if (! (info->matchflags = parse_header(argv[optind-1])) )
+ if (! (info->matchflags = parse_header(optarg)) )
xtables_error(PARAMETER_PROBLEM, "ip6t_ipv6header: cannot parse header names");
if (invert)
xtables_error(PARAMETER_PROBLEM,
"Only one `--mh-type' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_mh_types(argv[optind-1], mhinfo->types);
+ parse_mh_types(optarg, mhinfo->types);
if (invert)
mhinfo->invflags |= IP6T_MH_INV_TYPE;
*flags |= MH_TYPES;
xtables_error(PARAMETER_PROBLEM,
"Only one `--rt-type' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- rtinfo->rt_type = parse_rt_num(argv[optind-1], "type");
+ rtinfo->rt_type = parse_rt_num(optarg, "type");
if (invert)
rtinfo->invflags |= IP6T_RT_INV_TYP;
rtinfo->flags |= IP6T_RT_TYP;
xtables_error(PARAMETER_PROBLEM,
"Only one `--rt-segsleft' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_rt_segsleft(argv[optind-1], rtinfo->segsleft);
+ parse_rt_segsleft(optarg, rtinfo->segsleft);
if (invert)
rtinfo->invflags |= IP6T_RT_INV_SGS;
rtinfo->flags |= IP6T_RT_SGS;
xtables_error(PARAMETER_PROBLEM,
"Only one `--rt-len' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- rtinfo->hdrlen = parse_rt_num(argv[optind-1], "length");
+ rtinfo->hdrlen = parse_rt_num(optarg, "length");
if (invert)
rtinfo->invflags |= IP6T_RT_INV_LEN;
rtinfo->flags |= IP6T_RT_LEN;
if (invert)
xtables_error(PARAMETER_PROBLEM,
" '!' not allowed with `--rt-0-addrs'");
- rtinfo->addrnr = parse_addresses(argv[optind-1], rtinfo->addrs);
+ rtinfo->addrnr = parse_addresses(optarg, rtinfo->addrs);
rtinfo->flags |= IP6T_RT_FST;
*flags |= IP6T_RT_FST;
break;
xtables_error(PARAMETER_PROBLEM,
"--%s requires two args.", what);
- if (strlen(argv[optind-1]) > IP_SET_MAXNAMELEN - 1)
+ if (strlen(optarg) > IP_SET_MAXNAMELEN - 1)
xtables_error(PARAMETER_PROBLEM,
"setname `%s' too long, max %d characters.",
- argv[optind-1], IP_SET_MAXNAMELEN - 1);
+ optarg, IP_SET_MAXNAMELEN - 1);
- get_set_byname(argv[optind - 1], info);
+ get_set_byname(optarg, info);
parse_bindings(argv[optind], info);
optind++;
xtables_error(PARAMETER_PROBLEM,
"addrtype: can't specify src-type twice");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_types(argv[optind-1], &info->source);
+ parse_types(optarg, &info->source);
if (invert)
info->invert_source = 1;
*flags |= IPT_ADDRTYPE_OPT_SRCTYPE;
xtables_error(PARAMETER_PROBLEM,
"addrtype: can't specify dst-type twice");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_types(argv[optind-1], &info->dest);
+ parse_types(optarg, &info->dest);
if (invert)
info->invert_dest = 1;
*flags |= IPT_ADDRTYPE_OPT_DSTTYPE;
xtables_error(PARAMETER_PROBLEM,
"addrtype: can't specify src-type twice");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_types(argv[optind-1], &info->source);
+ parse_types(optarg, &info->source);
if (invert)
info->flags |= IPT_ADDRTYPE_INVERT_SOURCE;
*flags |= IPT_ADDRTYPE_OPT_SRCTYPE;
xtables_error(PARAMETER_PROBLEM,
"addrtype: can't specify dst-type twice");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_types(argv[optind-1], &info->dest);
+ parse_types(optarg, &info->dest);
if (invert)
info->flags |= IPT_ADDRTYPE_INVERT_DEST;
*flags |= IPT_ADDRTYPE_OPT_DSTTYPE;
xtables_error(PARAMETER_PROBLEM,
"Only one `--ahspi' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_ah_spis(argv[optind-1], ahinfo->spis);
+ parse_ah_spis(optarg, ahinfo->spis);
if (invert)
ahinfo->invflags |= IPT_AH_INV_SPI;
*flags |= AH_SPI;
xtables_error(PARAMETER_PROBLEM,
"icmp match: only use --icmp-type once!");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_icmp(argv[optind-1], &icmpinfo->type,
+ parse_icmp(optarg, &icmpinfo->type,
icmpinfo->code);
if (invert)
icmpinfo->invflags |= IPT_ICMP_INV;
switch (c) {
char *end;
case '1':
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
- end = optarg = argv[optind-1];
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
+ end = optarg = optarg;
realminfo->id = strtoul(optarg, &end, 0);
if (end != optarg && (*end == '/' || *end == '\0')) {
if (*end == '/')
xtables_error(PARAMETER_PROBLEM,
"--match-set requires two args.");
- if (strlen(argv[optind-1]) > IP_SET_MAXNAMELEN - 1)
+ if (strlen(optarg) > IP_SET_MAXNAMELEN - 1)
xtables_error(PARAMETER_PROBLEM,
"setname `%s' too long, max %d characters.",
- argv[optind-1], IP_SET_MAXNAMELEN - 1);
+ optarg, IP_SET_MAXNAMELEN - 1);
- get_set_byname(argv[optind - 1], info);
+ get_set_byname(optarg, info);
parse_bindings(argv[optind], info);
DEBUGP("parse: set index %u\n", info->index);
optind++;
switch (c) {
case '1':
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
if (invert) {
xtables_error(PARAMETER_PROBLEM,
"Sorry, you can't have an inverted comment");
}
- parse_comment(argv[optind-1], commentinfo);
+ parse_comment(optarg, commentinfo);
*flags = 1;
break;
if (xtables_check_inverse(optarg, &invert, &optind, 0, argv))
optind++;
- parse_range(argv[optind-1], sinfo);
+ parse_range(optarg, sinfo);
if (invert) {
i = sinfo->count.from;
sinfo->count.from = sinfo->count.to;
"--connlimit-above may be given only once");
*flags |= 0x1;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- info->limit = strtoul(argv[optind-1], NULL, 0);
+ info->limit = strtoul(optarg, NULL, 0);
info->inverse = invert;
break;
case 'M':
"--connlimit-mask may be given only once");
*flags |= 0x2;
- i = strtoul(argv[optind-1], &err, 0);
+ i = strtoul(optarg, &err, 0);
if (family == NFPROTO_IPV6) {
if (i > 128 || *err != '\0')
xtables_error(PARAMETER_PROBLEM,
case '1':
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_states(argv[optind-1], sinfo);
+ parse_states(optarg, sinfo);
if (invert) {
sinfo->invflags |= XT_CONNTRACK_STATE;
}
sinfo->invflags |= XT_CONNTRACK_PROTO;
/* Canonicalize into lower case */
- for (protocol = argv[optind-1]; *protocol; protocol++)
+ for (protocol = optarg; *protocol; protocol++)
*protocol = tolower(*protocol);
- protocol = argv[optind-1];
+ protocol = optarg;
sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum =
xtables_parse_protocol(protocol);
if (invert)
sinfo->invflags |= XT_CONNTRACK_ORIGSRC;
- xtables_ipparse_any(argv[optind-1], &addrs,
+ xtables_ipparse_any(optarg, &addrs,
&sinfo->sipmsk[IP_CT_DIR_ORIGINAL],
&naddrs);
if(naddrs > 1)
if (invert)
sinfo->invflags |= XT_CONNTRACK_ORIGDST;
- xtables_ipparse_any(argv[optind-1], &addrs,
+ xtables_ipparse_any(optarg, &addrs,
&sinfo->dipmsk[IP_CT_DIR_ORIGINAL],
&naddrs);
if(naddrs > 1)
if (invert)
sinfo->invflags |= XT_CONNTRACK_REPLSRC;
- xtables_ipparse_any(argv[optind-1], &addrs,
+ xtables_ipparse_any(optarg, &addrs,
&sinfo->sipmsk[IP_CT_DIR_REPLY],
&naddrs);
if(naddrs > 1)
if (invert)
sinfo->invflags |= XT_CONNTRACK_REPLDST;
- xtables_ipparse_any(argv[optind-1], &addrs,
+ xtables_ipparse_any(optarg, &addrs,
&sinfo->dipmsk[IP_CT_DIR_REPLY],
&naddrs);
if(naddrs > 1)
case '7':
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_statuses(argv[optind-1], sinfo);
+ parse_statuses(optarg, sinfo);
if (invert) {
sinfo->invflags |= XT_CONNTRACK_STATUS;
}
case '8':
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_expires(argv[optind-1], sinfo);
+ parse_expires(optarg, sinfo);
if (invert) {
sinfo->invflags |= XT_CONNTRACK_EXPIRES;
}
"Only one `--source-port' allowed");
einfo->flags |= XT_DCCP_SRC_PORTS;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_dccp_ports(argv[optind-1], einfo->spts);
+ parse_dccp_ports(optarg, einfo->spts);
if (invert)
einfo->invflags |= XT_DCCP_SRC_PORTS;
*flags |= XT_DCCP_SRC_PORTS;
"Only one `--destination-port' allowed");
einfo->flags |= XT_DCCP_DEST_PORTS;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_dccp_ports(argv[optind-1], einfo->dpts);
+ parse_dccp_ports(optarg, einfo->dpts);
if (invert)
einfo->invflags |= XT_DCCP_DEST_PORTS;
*flags |= XT_DCCP_DEST_PORTS;
"Only one `--dccp-types' allowed");
einfo->flags |= XT_DCCP_TYPE;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- einfo->typemask = parse_dccp_types(argv[optind-1]);
+ einfo->typemask = parse_dccp_types(optarg);
if (invert)
einfo->invflags |= XT_DCCP_TYPE;
*flags |= XT_DCCP_TYPE;
"Only one `--dccp-option' allowed");
einfo->flags |= XT_DCCP_OPTION;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- einfo->option = parse_dccp_option(argv[optind-1]);
+ einfo->option = parse_dccp_option(optarg);
if (invert)
einfo->invflags |= XT_DCCP_OPTION;
*flags |= XT_DCCP_OPTION;
xtables_error(PARAMETER_PROBLEM,
"DSCP match: Only use --dscp ONCE!");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_dscp(argv[optind-1], dinfo);
+ parse_dscp(optarg, dinfo);
if (invert)
dinfo->invert = 1;
*flags = 1;
xtables_error(PARAMETER_PROBLEM,
"DSCP match: Only use --dscp-class ONCE!");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_class(argv[optind - 1], dinfo);
+ parse_class(optarg, dinfo);
if (invert)
dinfo->invert = 1;
*flags = 1;
xtables_error(PARAMETER_PROBLEM,
"Only one `--espspi' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_esp_spis(argv[optind-1], espinfo->spis);
+ parse_esp_spis(optarg, espinfo->spis);
if (invert)
espinfo->invflags |= XT_ESP_INV_SPI;
*flags |= ESP_SPI;
case '%':
xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit",
*flags & PARAM_LIMIT);
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (!parse_rate(optarg, &r->cfg.avg))
xtables_error(PARAMETER_PROBLEM,
"bad rate `%s'", optarg);
case '$':
xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-burst",
*flags & PARAM_BURST);
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (!xtables_strtoui(optarg, NULL, &num, 0, 10000))
xtables_error(PARAMETER_PROBLEM,
"bad --hashlimit-burst `%s'", optarg);
case '&':
xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-htable-size",
*flags & PARAM_SIZE);
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
xtables_error(PARAMETER_PROBLEM,
"bad --hashlimit-htable-size: `%s'", optarg);
case '*':
xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-htable-max",
*flags & PARAM_MAX);
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
xtables_error(PARAMETER_PROBLEM,
"bad --hashlimit-htable-max: `%s'", optarg);
xtables_param_act(XTF_ONLY_ONCE, "hashlimit",
"--hashlimit-htable-gcinterval",
*flags & PARAM_GCINTERVAL);
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
xtables_error(PARAMETER_PROBLEM,
"bad --hashlimit-htable-gcinterval: `%s'",
case ')':
xtables_param_act(XTF_ONLY_ONCE, "hashlimit",
"--hashlimit-htable-expire", *flags & PARAM_EXPIRE);
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
xtables_error(PARAMETER_PROBLEM,
"bad --hashlimit-htable-expire: `%s'", optarg);
case '_':
xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-mode",
*flags & PARAM_MODE);
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (parse_mode(&r->cfg.mode, optarg) < 0)
xtables_error(PARAMETER_PROBLEM,
"bad --hashlimit-mode: `%s'\n", optarg);
case '"':
xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-name",
*flags & PARAM_NAME);
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (strlen(optarg) == 0)
xtables_error(PARAMETER_PROBLEM, "Zero-length name?");
strncpy(r->name, optarg, sizeof(r->name));
"length: `--length' may only be "
"specified once");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_lengths(argv[optind-1], info);
+ parse_lengths(optarg, info);
if (invert)
info->invert = 1;
*flags = 1;
switch(c) {
case '%':
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (!parse_rate(optarg, &r->avg))
xtables_error(PARAMETER_PROBLEM,
"bad rate `%s'", optarg);
break;
case '$':
- if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv)) break;
+ if (xtables_check_inverse(optarg, &invert, &optind, 0, argv)) break;
if (!xtables_strtoui(optarg, NULL, &num, 0, 10000))
xtables_error(PARAMETER_PROBLEM,
"bad --limit-burst `%s'", optarg);
switch (c) {
case '1':
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_mac(argv[optind-1], macinfo);
+ parse_mac(optarg, macinfo);
if (invert)
macinfo->invert = 1;
*flags = 1;
switch (c) {
case '1':
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
proto = check_proto(pnum, invflags);
- multiinfo->count = parse_multi_ports(argv[optind-1],
+ multiinfo->count = parse_multi_ports(optarg,
multiinfo->ports, proto);
multiinfo->flags = XT_MULTIPORT_SOURCE;
break;
case '2':
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
proto = check_proto(pnum, invflags);
- multiinfo->count = parse_multi_ports(argv[optind-1],
+ multiinfo->count = parse_multi_ports(optarg,
multiinfo->ports, proto);
multiinfo->flags = XT_MULTIPORT_DESTINATION;
break;
case '3':
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
proto = check_proto(pnum, invflags);
- multiinfo->count = parse_multi_ports(argv[optind-1],
+ multiinfo->count = parse_multi_ports(optarg,
multiinfo->ports, proto);
multiinfo->flags = XT_MULTIPORT_EITHER;
break;
switch (c) {
case '1':
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
proto = check_proto(pnum, invflags);
- parse_multi_ports_v1(argv[optind-1], multiinfo, proto);
+ parse_multi_ports_v1(optarg, multiinfo, proto);
multiinfo->flags = XT_MULTIPORT_SOURCE;
break;
case '2':
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
proto = check_proto(pnum, invflags);
- parse_multi_ports_v1(argv[optind-1], multiinfo, proto);
+ parse_multi_ports_v1(optarg, multiinfo, proto);
multiinfo->flags = XT_MULTIPORT_DESTINATION;
break;
case '3':
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
proto = check_proto(pnum, invflags);
- parse_multi_ports_v1(argv[optind-1], multiinfo, proto);
+ parse_multi_ports_v1(optarg, multiinfo, proto);
multiinfo->flags = XT_MULTIPORT_EITHER;
break;
if (*flags & XT_PHYSDEV_OP_IN)
goto multiple_use;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- xtables_parse_interface(argv[optind-1], info->physindev,
+ xtables_parse_interface(optarg, info->physindev,
(unsigned char *)info->in_mask);
if (invert)
info->invert |= XT_PHYSDEV_OP_IN;
if (*flags & XT_PHYSDEV_OP_OUT)
goto multiple_use;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- xtables_parse_interface(argv[optind-1], info->physoutdev,
+ xtables_parse_interface(optarg, info->physoutdev,
(unsigned char *)info->out_mask);
if (invert)
info->invert |= XT_PHYSDEV_OP_OUT;
{
case '1':
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_pkttype(argv[optind-1], info);
+ parse_pkttype(optarg, info);
if(invert)
info->invert=1;
*flags=1;
break;
case OPT_RATEEST_EQ:
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
if (*flags & (1 << c))
xtables_error(PARAMETER_PROBLEM,
break;
case OPT_RATEEST_LT:
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
if (*flags & (1 << c))
xtables_error(PARAMETER_PROBLEM,
break;
case OPT_RATEEST_GT:
- xtables_check_inverse(argv[optind-1], &invert, &optind, 0, argv);
+ xtables_check_inverse(optarg, &invert, &optind, 0, argv);
if (*flags & (1 << c))
xtables_error(PARAMETER_PROBLEM,
"Only one `--source-port' allowed");
einfo->flags |= XT_SCTP_SRC_PORTS;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_sctp_ports(argv[optind-1], einfo->spts);
+ parse_sctp_ports(optarg, einfo->spts);
if (invert)
einfo->invflags |= XT_SCTP_SRC_PORTS;
*flags |= XT_SCTP_SRC_PORTS;
"Only one `--destination-port' allowed");
einfo->flags |= XT_SCTP_DEST_PORTS;
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_sctp_ports(argv[optind-1], einfo->dpts);
+ parse_sctp_ports(optarg, einfo->dpts);
if (invert)
einfo->invflags |= XT_SCTP_DEST_PORTS;
*flags |= XT_SCTP_DEST_PORTS;
"--chunk-types requires two args");
einfo->flags |= XT_SCTP_CHUNK_TYPES;
- parse_sctp_chunks(einfo, argv[optind-1], argv[optind]);
+ parse_sctp_chunks(einfo, optarg, argv[optind]);
if (invert)
einfo->invflags |= XT_SCTP_CHUNK_TYPES;
optind++;
case '1':
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- state_parse_states(argv[optind-1], sinfo);
+ state_parse_states(optarg, sinfo);
if (invert)
sinfo->statemask = ~sinfo->statemask;
*flags = 1;
xtables_error(PARAMETER_PROBLEM,
"Can't specify multiple --string");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_string(argv[optind-1], stringinfo);
+ parse_string(optarg, stringinfo);
if (invert) {
if (revision == 0)
stringinfo->u.v0.invert = 1;
"Can't specify multiple --hex-string");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_hex_string(argv[optind-1], stringinfo); /* sets length */
+ parse_hex_string(optarg, stringinfo); /* sets length */
if (invert) {
if (revision == 0)
stringinfo->u.v0.invert = 1;
xtables_error(PARAMETER_PROBLEM,
"Only one `--source-port' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_tcp_ports(argv[optind-1], tcpinfo->spts);
+ parse_tcp_ports(optarg, tcpinfo->spts);
if (invert)
tcpinfo->invflags |= XT_TCP_INV_SRCPT;
*flags |= TCP_SRC_PORTS;
xtables_error(PARAMETER_PROBLEM,
"Only one `--destination-port' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_tcp_ports(argv[optind-1], tcpinfo->dpts);
+ parse_tcp_ports(optarg, tcpinfo->dpts);
if (invert)
tcpinfo->invflags |= XT_TCP_INV_DSTPT;
*flags |= TCP_DST_PORTS;
xtables_error(PARAMETER_PROBLEM,
"--tcp-flags requires two args.");
- parse_tcp_flags(tcpinfo, argv[optind-1], argv[optind],
+ parse_tcp_flags(tcpinfo, optarg, argv[optind],
invert);
optind++;
*flags |= TCP_FLAGS;
xtables_error(PARAMETER_PROBLEM,
"Only one `--tcp-option' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_tcp_option(argv[optind-1], &tcpinfo->option);
+ parse_tcp_option(optarg, &tcpinfo->option);
if (invert)
tcpinfo->invflags |= XT_TCP_INV_OPTION;
*flags |= TCP_OPTION;
xtables_error(PARAMETER_PROBLEM,
"Only one `--mss' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_tcp_mssvalues(argv[optind-1],
+ parse_tcp_mssvalues(optarg,
&mssinfo->mss_min, &mssinfo->mss_max);
if (invert)
mssinfo->invert = 1;
struct xt_u32 *data = (void *)(*match)->data;
unsigned int testind = 0, locind = 0, valind = 0;
struct xt_u32_test *ct = &data->tests[testind]; /* current test */
- char *arg = argv[optind-1]; /* the argument string */
+ char *arg = optarg; /* the argument string */
char *start = arg;
int state = 0;
xtables_error(PARAMETER_PROBLEM,
"Only one `--source-port' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_udp_ports(argv[optind-1], udpinfo->spts);
+ parse_udp_ports(optarg, udpinfo->spts);
if (invert)
udpinfo->invflags |= XT_UDP_INV_SRCPT;
*flags |= UDP_SRC_PORTS;
xtables_error(PARAMETER_PROBLEM,
"Only one `--destination-port' allowed");
xtables_check_inverse(optarg, &invert, &optind, 0, argv);
- parse_udp_ports(argv[optind-1], udpinfo->dpts);
+ parse_udp_ports(optarg, udpinfo->dpts);
if (invert)
udpinfo->invflags |= XT_UDP_INV_DSTPT;
*flags |= UDP_DST_PORTS;
invert);
/* Canonicalize into lower case */
- for (protocol = argv[optind-1]; *protocol; protocol++)
+ for (protocol = optarg; *protocol; protocol++)
*protocol = tolower(*protocol);
- protocol = argv[optind-1];
+ protocol = optarg;
fw.ipv6.proto = xtables_parse_protocol(protocol);
fw.ipv6.flags |= IP6T_F_PROTO;
xtables_check_inverse(optarg, &invert, &optind, argc, argv);
set_option(&options, OPT_SOURCE, &fw.ipv6.invflags,
invert);
- shostnetworkmask = argv[optind-1];
+ shostnetworkmask = optarg;
break;
case 'd':
xtables_check_inverse(optarg, &invert, &optind, argc, argv);
set_option(&options, OPT_DESTINATION, &fw.ipv6.invflags,
invert);
- dhostnetworkmask = argv[optind-1];
+ dhostnetworkmask = optarg;
break;
#ifdef IP6T_F_GOTO
xtables_check_inverse(optarg, &invert, &optind, argc, argv);
set_option(&options, OPT_VIANAMEIN, &fw.ipv6.invflags,
invert);
- xtables_parse_interface(argv[optind-1],
+ xtables_parse_interface(optarg,
fw.ipv6.iniface,
fw.ipv6.iniface_mask);
break;
xtables_check_inverse(optarg, &invert, &optind, argc, argv);
set_option(&options, OPT_VIANAMEOUT, &fw.ipv6.invflags,
invert);
- xtables_parse_interface(argv[optind-1],
+ xtables_parse_interface(optarg,
fw.ipv6.outiface,
fw.ipv6.outiface_mask);
break;
invert);
/* Canonicalize into lower case */
- for (protocol = argv[optind-1]; *protocol; protocol++)
+ for (protocol = optarg; *protocol; protocol++)
*protocol = tolower(*protocol);
- protocol = argv[optind-1];
+ protocol = optarg;
fw.ip.proto = xtables_parse_protocol(protocol);
if (fw.ip.proto == 0
xtables_check_inverse(optarg, &invert, &optind, argc, argv);
set_option(&options, OPT_SOURCE, &fw.ip.invflags,
invert);
- shostnetworkmask = argv[optind-1];
+ shostnetworkmask = optarg;
break;
case 'd':
xtables_check_inverse(optarg, &invert, &optind, argc, argv);
set_option(&options, OPT_DESTINATION, &fw.ip.invflags,
invert);
- dhostnetworkmask = argv[optind-1];
+ dhostnetworkmask = optarg;
break;
#ifdef IPT_F_GOTO
xtables_check_inverse(optarg, &invert, &optind, argc, argv);
set_option(&options, OPT_VIANAMEIN, &fw.ip.invflags,
invert);
- xtables_parse_interface(argv[optind-1],
+ xtables_parse_interface(optarg,
fw.ip.iniface,
fw.ip.iniface_mask);
break;
xtables_check_inverse(optarg, &invert, &optind, argc, argv);
set_option(&options, OPT_VIANAMEOUT, &fw.ip.invflags,
invert);
- xtables_parse_interface(argv[optind-1],
+ xtables_parse_interface(optarg,
fw.ip.outiface,
fw.ip.outiface_mask);
break;