]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: prefix/order - move check_inverse to xtables.c
authorJan Engelhardt <jengelh@medozas.de>
Fri, 30 Jan 2009 03:55:38 +0000 (04:55 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 30 Jan 2009 04:38:33 +0000 (05:38 +0100)
This also adds a warning that intrapositional negation support
is deprecated.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
64 files changed:
extensions/libip6t_HL.c
extensions/libip6t_LOG.c
extensions/libip6t_REJECT.c
extensions/libip6t_ah.c
extensions/libip6t_dst.c
extensions/libip6t_frag.c
extensions/libip6t_hbh.c
extensions/libip6t_hl.c
extensions/libip6t_icmp6.c
extensions/libip6t_ipv6header.c
extensions/libip6t_mh.c
extensions/libip6t_policy.c
extensions/libip6t_rt.c
extensions/libipt_DNAT.c
extensions/libipt_LOG.c
extensions/libipt_MASQUERADE.c
extensions/libipt_NETMAP.c
extensions/libipt_REDIRECT.c
extensions/libipt_REJECT.c
extensions/libipt_SAME.c
extensions/libipt_SET.c
extensions/libipt_SNAT.c
extensions/libipt_TTL.c
extensions/libipt_ULOG.c
extensions/libipt_addrtype.c
extensions/libipt_ah.c
extensions/libipt_ecn.c
extensions/libipt_icmp.c
extensions/libipt_policy.c
extensions/libipt_realm.c
extensions/libipt_set.c
extensions/libipt_ttl.c
extensions/libxt_NFLOG.c
extensions/libxt_comment.c
extensions/libxt_connbytes.c
extensions/libxt_connlimit.c
extensions/libxt_connmark.c
extensions/libxt_conntrack.c
extensions/libxt_dccp.c
extensions/libxt_dscp.c
extensions/libxt_esp.c
extensions/libxt_hashlimit.c
extensions/libxt_helper.c
extensions/libxt_iprange.c
extensions/libxt_length.c
extensions/libxt_limit.c
extensions/libxt_mac.c
extensions/libxt_mark.c
extensions/libxt_multiport.c
extensions/libxt_physdev.c
extensions/libxt_pkttype.c
extensions/libxt_quota.c
extensions/libxt_rateest.c
extensions/libxt_recent.c
extensions/libxt_sctp.c
extensions/libxt_state.c
extensions/libxt_string.c
extensions/libxt_tcp.c
extensions/libxt_tcpmss.c
extensions/libxt_udp.c
include/xtables.h.in
ip6tables.c
iptables.c
xtables.c

index 4aed4fd89529de7c430d34b28f87c972a11c1741..0a9871396f5bb29bd8fff8c1274449f1cb56d614 100644 (file)
@@ -40,7 +40,7 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags,
                exit_error(PARAMETER_PROBLEM, 
                                "HL: You must specify a value");
 
-       if (check_inverse(optarg, &invert, NULL, 0))
+       if (xtables_check_inverse(optarg, &invert, NULL, 0))
                exit_error(PARAMETER_PROBLEM,
                                "HL: unexpected `!'");
        
index a8ac1359fd83e6db2a15542353eb8b6f1587e598..79877350ffe25971fe46fcace73217dde52813e8 100644 (file)
@@ -112,7 +112,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-level twice");
 
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-level");
 
@@ -125,7 +125,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-prefix twice");
 
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-prefix");
 
index 0e2120210f389540b89bba5d18b9bf21e810e89a..1c2be686dcc29467b94df3241544bcf595d978be 100644 (file)
@@ -85,7 +85,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch(c) {
        case '1':
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --reject-with");
                for (i = 0; i < limit; i++) {
index 63d157346306a8769336c9b46348ea24c87627c5..83ed4514a77da72f863e1f9825072464607df2aa 100644 (file)
@@ -86,7 +86,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_AH_SPI)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--ahspi' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_ah_spis(argv[optind-1], ahinfo->spis);
                if (invert)
                        ahinfo->invflags |= IP6T_AH_INV_SPI;
@@ -96,7 +96,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_AH_LEN)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--ahlen' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                ahinfo->hdrlen = parse_ah_spi(argv[optind-1], "length");
                if (invert)
                        ahinfo->invflags |= IP6T_AH_INV_LEN;
index 43562c17b4506a04cd5a4b0c42a6c5ada815d8da..e19abc4b39bad7f735547359932430270dad3378 100644 (file)
@@ -125,7 +125,7 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_OPTS_LEN)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--dst-len' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                optinfo->hdrlen = parse_opts_num(argv[optind-1], "length");
                if (invert)
                        optinfo->invflags |= IP6T_OPTS_INV_LEN;
@@ -136,7 +136,7 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_OPTS_OPTS)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--dst-opts' allowed");
-                check_inverse(optarg, &invert, &optind, 0);
+                xtables_check_inverse(optarg, &invert, &optind, 0);
                 if (invert)
                         exit_error(PARAMETER_PROBLEM,
                                " '!' not allowed with `--dst-opts'");
index 7c22429e72c62a4da38e93278d853f3a02c60fed..b55ef26fad8fa4ab5bd3789cf1da1cd0b4cac145 100644 (file)
@@ -94,7 +94,7 @@ static int frag_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_FRAG_IDS)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--fragid' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_frag_ids(argv[optind-1], fraginfo->ids);
                if (invert)
                        fraginfo->invflags |= IP6T_FRAG_INV_IDS;
@@ -105,7 +105,7 @@ static int frag_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_FRAG_LEN)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--fraglen' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                fraginfo->hdrlen = parse_frag_id(argv[optind-1], "length");
                if (invert)
                        fraginfo->invflags |= IP6T_FRAG_INV_LEN;
index 6c7458d8f63b20a83400eaef14b50684b46620ea..3354eae41faca339b39fa2c8071fec6df58b0a04 100644 (file)
@@ -120,7 +120,7 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_OPTS_LEN)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--hbh-len' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                optinfo->hdrlen = parse_opts_num(argv[optind-1], "length");
                if (invert)
                        optinfo->invflags |= IP6T_OPTS_INV_LEN;
@@ -131,7 +131,7 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_OPTS_OPTS)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--hbh-opts' allowed");
-                check_inverse(optarg, &invert, &optind, 0);
+                xtables_check_inverse(optarg, &invert, &optind, 0);
                 if (invert)
                         exit_error(PARAMETER_PROBLEM,
                                " '!' not allowed with `--hbh-opts'");
index 77275812880949fef62e523318521ffc599fea22..286f43247c4f14b94e9c6b1884f2b8c026174c21 100644 (file)
@@ -30,7 +30,7 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags,
        struct ip6t_hl_info *info = (struct ip6t_hl_info *) (*match)->data;
        u_int8_t value;
 
-       check_inverse(optarg, &invert, &optind, 0);
+       xtables_check_inverse(optarg, &invert, &optind, 0);
        value = atoi(argv[optind-1]);
 
        if (*flags) 
index 401c2780736a7cfb3303110fd2336472c33afae3..5af9b02ef80f3360cade637ad1964297ded4da6e 100644 (file)
@@ -157,7 +157,7 @@ static int icmp6_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags == 1)
                        exit_error(PARAMETER_PROBLEM,
                                   "icmpv6 match: only use --icmpv6-type once!");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_icmpv6(argv[optind-1], &icmpv6info->type, 
                             icmpv6info->code);
                if (invert)
index ea8870a579ef5f41757b62d3b64bbd3c407b9a71..982e6a7b42537e1dca652dc9135276f0cdfc56c8 100644 (file)
@@ -192,7 +192,7 @@ ipv6header_parse(int c, char **argv, int invert, unsigned int *flags,
                                exit_error(PARAMETER_PROBLEM,
                                        "Only one `--header' allowed");
 
-                       check_inverse(optarg, &invert, &optind, 0);
+                       xtables_check_inverse(optarg, &invert, &optind, 0);
 
                        if (! (info->matchflags = parse_header(argv[optind-1])) )
                                exit_error(PARAMETER_PROBLEM, "ip6t_ipv6header: cannot parse header names");
index f8c4e2474534ac33e43b9d1d2136de9e2f8bf9f7..78fc804a7a1d1002ad31b851234f595279fa0ed2 100644 (file)
@@ -134,7 +134,7 @@ static int mh_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & MH_TYPES)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--mh-type' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_mh_types(argv[optind-1], mhinfo->types);
                if (invert)
                        mhinfo->invflags |= IP6T_MH_INV_TYPE;
index fa855c120488803e3f98e8ceae15d0800ba596ba..83ee48ec4b8a46e23a6f7552b1ade4fccd1731df 100644 (file)
@@ -160,7 +160,7 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
        unsigned int naddr = 0;
        int mode;
 
-       check_inverse(optarg, &invert, &optind, 0);
+       xtables_check_inverse(optarg, &invert, &optind, 0);
 
        switch (c) {
        case '1':
index 49d86fa36f658db00c54f5e3fa471bdbbe4d5467..64c98efce0a85cf86496f3a2bb3e2cbdd75e38fa 100644 (file)
@@ -158,7 +158,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_RT_TYP)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-type' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                rtinfo->rt_type = parse_rt_num(argv[optind-1], "type");
                if (invert)
                        rtinfo->invflags |= IP6T_RT_INV_TYP;
@@ -169,7 +169,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_RT_SGS)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-segsleft' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_rt_segsleft(argv[optind-1], rtinfo->segsleft);
                if (invert)
                        rtinfo->invflags |= IP6T_RT_INV_SGS;
@@ -180,7 +180,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IP6T_RT_LEN)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-len' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                rtinfo->hdrlen = parse_rt_num(argv[optind-1], "length");
                if (invert)
                        rtinfo->invflags |= IP6T_RT_INV_LEN;
@@ -204,7 +204,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
                if ( !(*flags & IP6T_RT_TYP) || (rtinfo->rt_type != 0) || (rtinfo->invflags & IP6T_RT_INV_TYP) )
                        exit_error(PARAMETER_PROBLEM,
                                   "`--rt-type 0' required before `--rt-0-addrs'");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        exit_error(PARAMETER_PROBLEM,
                                   " '!' not allowed with `--rt-0-addrs'");
index 0d355a0dfe28fe2f422c56f4baab3eca8f20bdd0..371ec79a88e80af71dbfb1cc8a2d250f81497cad 100644 (file)
@@ -152,7 +152,7 @@ static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-destination");
 
index 23790a0d97a830bdf2d82f48f542e1dc1cbcbc95..bc7e8a4e21e62d28144dc41bcb0d49a4a4eb4f83 100644 (file)
@@ -112,7 +112,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-level twice");
 
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-level");
 
@@ -125,7 +125,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-prefix twice");
 
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-prefix");
 
index 1f932949f0e44616d1d669a7247278fb60c93786..0ee155c24d3aa274fb87207106757b598c41316d 100644 (file)
@@ -90,7 +90,7 @@ static int MASQUERADE_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Need TCP, UDP, SCTP or DCCP with port specification");
 
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-ports");
 
index f6c8bfdf3baf314ddbfcdbbb144719e536aec087..9949c99bc0bfa7f9f247b54ff9cee0ff9aaabbfe 100644 (file)
@@ -118,7 +118,7 @@ static int NETMAP_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --%s", NETMAP_opts[0].name);
 
index 1ef2b2ece17a43e43a83a574fc9340e8fa4f57e9..c6afbdccad86666e45714ee9b46710a116c3d7eb 100644 (file)
@@ -97,7 +97,7 @@ static int REDIRECT_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Need TCP, UDP, SCTP or DCCP with port specification");
 
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-ports");
 
index ef404e67b46e6c3a40146a47c3a77570f24a77af..db94306e19fbaab9676f106a4bd06634b53071d3 100644 (file)
@@ -99,7 +99,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch(c) {
        case '1':
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --reject-with");
                for (i = 0; i < limit; i++) {
index 6882242e8030ec216d50e3ea511c42afe2ea0394..007ebc35849e1375743bfeda845b1a5103984d80 100644 (file)
@@ -93,7 +93,7 @@ static int SAME_parse(int c, char **argv, int invert, unsigned int *flags,
                                   "Too many ranges specified, maximum "
                                   "is %i ranges.\n",
                                   IPT_SAME_MAX_RANGE);
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to");
 
index 7ec0c31cf596fd090212d71d4b7e5178e5aaca13..45967be2c3a739a90b3083a4b65aa7c55c02d014 100644 (file)
@@ -57,7 +57,7 @@ parse_target(char **argv, int invert, unsigned int *flags,
                exit_error(PARAMETER_PROBLEM,
                           "--%s can be specified only once", what);
 
-       if (check_inverse(optarg, &invert, NULL, 0))
+       if (xtables_check_inverse(optarg, &invert, NULL, 0))
                exit_error(PARAMETER_PROBLEM,
                           "Unexpected `!' after --%s", what);
 
index 0780aa1a1825e9a84810874ff9603697a71f8552..96ef56e44653dd02d7b74f08f8befd97e942b89b 100644 (file)
@@ -152,7 +152,7 @@ static int SNAT_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-source");
 
index 6036161d31f6c9512adc6b0f6f96ec3f662dd5eb..15d23ba2b7d9c6db61c7cfc7bcf4ff370647100a 100644 (file)
@@ -40,7 +40,7 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags,
                exit_error(PARAMETER_PROBLEM, 
                                "TTL: You must specify a value");
 
-       if (check_inverse(optarg, &invert, NULL, 0))
+       if (xtables_check_inverse(optarg, &invert, NULL, 0))
                exit_error(PARAMETER_PROBLEM,
                                "TTL: unexpected `!'");
        
index 6e346d81618e68ee835272ac23478b17f4b09fad..89d09409e72cd067783fb9d024bbeacf01da19b7 100644 (file)
@@ -77,7 +77,7 @@ static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --ulog-nlgroup twice");
 
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --ulog-nlgroup");
                group_d = atoi(optarg);
@@ -95,7 +95,7 @@ static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --ulog-prefix twice");
 
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --ulog-prefix");
 
index dc43a3f57e54a1d26f27eacc3ea93f3a2ce15864..446cf0f39b711ff83a7aaa577d63f46b85be627b 100644 (file)
@@ -107,7 +107,7 @@ addrtype_parse_v0(int c, char **argv, int invert, unsigned int *flags,
                if (*flags&IPT_ADDRTYPE_OPT_SRCTYPE)
                        exit_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify src-type twice");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_types(argv[optind-1], &info->source);
                if (invert)
                        info->invert_source = 1;
@@ -117,7 +117,7 @@ addrtype_parse_v0(int c, char **argv, int invert, unsigned int *flags,
                if (*flags&IPT_ADDRTYPE_OPT_DSTTYPE)
                        exit_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify dst-type twice");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_types(argv[optind-1], &info->dest);
                if (invert)
                        info->invert_dest = 1;
@@ -142,7 +142,7 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IPT_ADDRTYPE_OPT_SRCTYPE)
                        exit_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify src-type twice");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_types(argv[optind-1], &info->source);
                if (invert)
                        info->flags |= IPT_ADDRTYPE_INVERT_SOURCE;
@@ -152,7 +152,7 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IPT_ADDRTYPE_OPT_DSTTYPE)
                        exit_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify dst-type twice");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_types(argv[optind-1], &info->dest);
                if (invert)
                        info->flags |= IPT_ADDRTYPE_INVERT_DEST;
index 10998d8bcd586d36a025472b46a5b7980fbbb094..31977dd681e79711b971b75e3f463b5e5a3a2590 100644 (file)
@@ -82,7 +82,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & AH_SPI)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--ahspi' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_ah_spis(argv[optind-1], ahinfo->spis);
                if (invert)
                        ahinfo->invflags |= IPT_AH_INV_SPI;
index c2276e96787e834e774662c1b2cab2febffcb840..3b9da71a5a6d2d18b6c016fa4d6f46dd90e3dc84 100644 (file)
@@ -44,7 +44,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IPT_ECN_OP_MATCH_CWR)
                        exit_error(PARAMETER_PROBLEM,
                                   "ECN match: can only use parameter ONCE!");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                einfo->operation |= IPT_ECN_OP_MATCH_CWR;
                if (invert)
                        einfo->invert |= IPT_ECN_OP_MATCH_CWR;
@@ -55,7 +55,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IPT_ECN_OP_MATCH_ECE)
                        exit_error(PARAMETER_PROBLEM,
                                   "ECN match: can only use parameter ONCE!");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                einfo->operation |= IPT_ECN_OP_MATCH_ECE;
                if (invert)
                        einfo->invert |= IPT_ECN_OP_MATCH_ECE;
@@ -66,7 +66,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IPT_ECN_OP_MATCH_IP)
                        exit_error(PARAMETER_PROBLEM,
                                   "ECN match: can only use parameter ONCE!");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        einfo->invert |= IPT_ECN_OP_MATCH_IP;
                *flags |= IPT_ECN_OP_MATCH_IP;
index de4c3387f4fe4d81c3aeffe605708c4328666675..0fd132be364d8a58ca85c20c0e599b09fe3fd4dc 100644 (file)
@@ -182,7 +182,7 @@ static int icmp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags == 1)
                        exit_error(PARAMETER_PROBLEM,
                                   "icmp match: only use --icmp-type once!");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_icmp(argv[optind-1], &icmpinfo->type, 
                           icmpinfo->code);
                if (invert)
index c9ce850c2b4e8f7b9dffa40e78be55cbc1986840..742eeba92c636d635ce6b18c11b82a6a649f5438 100644 (file)
@@ -128,7 +128,7 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
        unsigned int naddr = 0;
        int mode;
 
-       check_inverse(optarg, &invert, &optind, 0);
+       xtables_check_inverse(optarg, &invert, &optind, 0);
 
        switch (c) {
        case '1':
index 22cbe276cac814f69800f5f10404a58959dc1d00..e602dad1f1e2a5a2be56c75b17d5a0d3299e555d 100644 (file)
@@ -157,7 +157,7 @@ static int realm_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
                char *end;
        case '1':
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                end = optarg = argv[optind-1];
                realminfo->id = strtoul(optarg, &end, 0);
                if (end != optarg && (*end == '/' || *end == '\0')) {
index 9bdb007d24a4e5b9df50b69baea3dc6b0b69c963..5b9e1fdc4e3cb88b2b395e759eed1cf796ab5a30 100644 (file)
@@ -58,7 +58,7 @@ static int set_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "--set can be specified only once");
 
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        info->flags[0] |= IPSET_MATCH_INV;
 
index 1fa7bd31fbb704ce0acb63b14b5da26b4c9bd760..3387e9247862749bfa6ea08ba10c8e690c4282b9 100644 (file)
@@ -29,7 +29,7 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags,
        struct ipt_ttl_info *info = (struct ipt_ttl_info *) (*match)->data;
        unsigned int value;
 
-       check_inverse(optarg, &invert, &optind, 0);
+       xtables_check_inverse(optarg, &invert, &optind, 0);
 
        switch (c) {
                case '2':
index bedfbe905137b889f0fc669006e3793f22fe5876..6d8c9dc63dfb0777f3f4b904c0bd71c90d87c140 100644 (file)
@@ -51,7 +51,7 @@ static int NFLOG_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & NFLOG_GROUP)
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --nflog-group twice");
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --nflog-group");
 
@@ -65,7 +65,7 @@ static int NFLOG_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & NFLOG_PREFIX)
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --nflog-prefix twice");
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --nflog-prefix");
 
index a7f96d4f00ca92e37b33ba7207f65f4d8af4b62a..9bad125615c011761d5e6f1a582b4101dd6c75ff 100644 (file)
@@ -46,7 +46,7 @@ comment_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                if (invert) {
                        exit_error(PARAMETER_PROBLEM,
                                        "Sorry, you can't have an inverted comment");
index b77ba38b1edb403cec89ad21fa2e39d9cee56484..5fc0f2a6773b49502e3d49982255eeea126339b9 100644 (file)
@@ -52,7 +52,7 @@ connbytes_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               if (check_inverse(optarg, &invert, &optind, 0))
+               if (xtables_check_inverse(optarg, &invert, &optind, 0))
                        optind++;
 
                parse_range(argv[optind-1], sinfo);
index 117222a7efa03244e70b0fcdb5945cbda79e98ba..f43eada10d37b33625455843248852abe73dcba8 100644 (file)
@@ -63,7 +63,7 @@ static int connlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                "--connlimit-above may be given only once");
                *flags |= 0x1;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                info->limit   = strtoul(argv[optind-1], NULL, 0);
                info->inverse = invert;
                break;
index 0f47a8f48c3fc76bd715b981c087e498920b33a6..d5ca4e0b8d66a2edaf99b888a23363c71825f8c0 100644 (file)
@@ -82,7 +82,7 @@ connmark_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
                char *end;
        case '1':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                markinfo->mark = strtoul(optarg, &end, 0);
                markinfo->mask = 0xffffffffUL;
index 958f842ff4f429f54eaff0eb9a862bc80be64d19..914b253b9ddbe3801d525d9bb2dd1dd07133d437 100644 (file)
@@ -297,7 +297,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                parse_states(argv[optind-1], sinfo);
                if (invert) {
@@ -307,7 +307,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '2':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if(invert)
                        sinfo->invflags |= XT_CONNTRACK_PROTO;
@@ -328,7 +328,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '3':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if (invert)
                        sinfo->invflags |= XT_CONNTRACK_ORIGSRC;
@@ -348,7 +348,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '4':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if (invert)
                        sinfo->invflags |= XT_CONNTRACK_ORIGDST;
@@ -368,7 +368,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '5':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if (invert)
                        sinfo->invflags |= XT_CONNTRACK_REPLSRC;
@@ -388,7 +388,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '6':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if (invert)
                        sinfo->invflags |= XT_CONNTRACK_REPLDST;
@@ -408,7 +408,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '7':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                parse_statuses(argv[optind-1], sinfo);
                if (invert) {
@@ -418,7 +418,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '8':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                parse_expires(argv[optind-1], sinfo);
                if (invert) {
index 9be065829156c1aadc34abbbc68d227aa633f802..dbf6223ce72680db4ff7f038197920d75f858461 100644 (file)
@@ -141,7 +141,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
                einfo->flags |= XT_DCCP_SRC_PORTS;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_dccp_ports(argv[optind-1], einfo->spts);
                if (invert)
                        einfo->invflags |= XT_DCCP_SRC_PORTS;
@@ -153,7 +153,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
                einfo->flags |= XT_DCCP_DEST_PORTS;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_dccp_ports(argv[optind-1], einfo->dpts);
                if (invert)
                        einfo->invflags |= XT_DCCP_DEST_PORTS;
@@ -165,7 +165,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--dccp-types' allowed");
                einfo->flags |= XT_DCCP_TYPE;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                einfo->typemask = parse_dccp_types(argv[optind-1]);
                if (invert)
                        einfo->invflags |= XT_DCCP_TYPE;
@@ -177,7 +177,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--dccp-option' allowed");
                einfo->flags |= XT_DCCP_OPTION;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                einfo->option = parse_dccp_option(argv[optind-1]);
                if (invert)
                        einfo->invflags |= XT_DCCP_OPTION;
index fce14c26c22979053468f92014e65294a90ba2a6..e57c26739d2ed8b4d7acf29454b82741b7b9bf9b 100644 (file)
@@ -82,7 +82,7 @@ dscp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags)
                        exit_error(PARAMETER_PROBLEM,
                                   "DSCP match: Only use --dscp ONCE!");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_dscp(argv[optind-1], dinfo);
                if (invert)
                        dinfo->invert = 1;
@@ -93,7 +93,7 @@ dscp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags)
                        exit_error(PARAMETER_PROBLEM,
                                        "DSCP match: Only use --dscp-class ONCE!");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_class(argv[optind - 1], dinfo);
                if (invert)
                        dinfo->invert = 1;
index 34df876d6c14c7cf4c1a81fa6362a45dbfefa662..2cc6b60f53f1f2d28876d059d27d121215f90b7a 100644 (file)
@@ -88,7 +88,7 @@ esp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & ESP_SPI)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--espspi' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_esp_spis(argv[optind-1], espinfo->spis);
                if (invert)
                        espinfo->invflags |= XT_ESP_INV_SPI;
index f63db64e26f51ea652b530a66fe9aa7b6413f4c5..b05e8c8cce88953d20ac3659fbeff9cbce4d45a7 100644 (file)
@@ -219,7 +219,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        case '%':
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit",
                          *flags & PARAM_LIMIT);
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!parse_rate(optarg, &r->cfg.avg))
                        exit_error(PARAMETER_PROBLEM,
                                   "bad rate `%s'", optarg);
@@ -229,7 +229,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        case '$':
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-burst",
                          *flags & PARAM_BURST);
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, 10000))
                        exit_error(PARAMETER_PROBLEM,
                                   "bad --hashlimit-burst `%s'", optarg);
@@ -239,7 +239,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        case '&':
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-htable-size",
                          *flags & PARAM_SIZE);
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
                        exit_error(PARAMETER_PROBLEM,
                                "bad --hashlimit-htable-size: `%s'", optarg);
@@ -249,7 +249,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        case '*':
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-htable-max",
                          *flags & PARAM_MAX);
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
                        exit_error(PARAMETER_PROBLEM,
                                "bad --hashlimit-htable-max: `%s'", optarg);
@@ -260,7 +260,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit",
                          "--hashlimit-htable-gcinterval",
                          *flags & PARAM_GCINTERVAL);
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
                        exit_error(PARAMETER_PROBLEM,
                                "bad --hashlimit-htable-gcinterval: `%s'", 
@@ -272,7 +272,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        case ')':
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit",
                          "--hashlimit-htable-expire", *flags & PARAM_EXPIRE);
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
                        exit_error(PARAMETER_PROBLEM,
                                "bad --hashlimit-htable-expire: `%s'", optarg);
@@ -283,7 +283,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        case '_':
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-mode",
                          *flags & PARAM_MODE);
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (parse_mode(&r->cfg.mode, optarg) < 0)
                        exit_error(PARAMETER_PROBLEM, 
                                   "bad --hashlimit-mode: `%s'\n", optarg);
@@ -292,7 +292,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        case '"':
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-name",
                          *flags & PARAM_NAME);
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (strlen(optarg) == 0)
                        exit_error(PARAMETER_PROBLEM, "Zero-length name?");
                strncpy(r->name, optarg, sizeof(r->name));
index 23025cd4818f88250ba80341fae9c28282930cdc..569ad69eca63b94aed67b0ebb8a0cce10c1c93cc 100644 (file)
@@ -31,7 +31,7 @@ helper_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags)
                        exit_error(PARAMETER_PROBLEM,
                                        "helper match: Only use --helper ONCE!");
-               check_inverse(optarg, &invert, &invert, 0);
+               xtables_check_inverse(optarg, &invert, &invert, 0);
                strncpy(info->name, optarg, 29);
                info->name[29] = '\0';
                if (invert)
index de079cbfdcab553525644755d5759c66f1291f54..df6be14fce7e3e07f4b48ad10c8b4875b5538bb7 100644 (file)
@@ -70,7 +70,7 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
                *flags |= IPRANGE_SRC;
 
                info->flags |= IPRANGE_SRC;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        info->flags |= IPRANGE_SRC_INV;
                parse_iprange(optarg, &info->src);
@@ -84,7 +84,7 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
                *flags |= IPRANGE_DST;
 
                info->flags |= IPRANGE_DST;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        info->flags |= IPRANGE_DST_INV;
 
index d039904bffb69fce4069515e0e6cbd07abf948d7..cf944e2d8c510ee38cb4d275d514c2309abf33c7 100644 (file)
@@ -70,7 +70,7 @@ length_parse(int c, char **argv, int invert, unsigned int *flags,
                                exit_error(PARAMETER_PROBLEM,
                                           "length: `--length' may only be "
                                           "specified once");
-                       check_inverse(optarg, &invert, &optind, 0);
+                       xtables_check_inverse(optarg, &invert, &optind, 0);
                        parse_lengths(argv[optind-1], info);
                        if (invert)
                                info->invert = 1;
index 1df9114e03b2e147f76e36580e7749e26b89ca1a..7edfa3dba4ca4f16830e7591df9617df28f9624d 100644 (file)
@@ -94,14 +94,14 @@ limit_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch(c) {
        case '%':
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!parse_rate(optarg, &r->avg))
                        exit_error(PARAMETER_PROBLEM,
                                   "bad rate `%s'", optarg);
                break;
 
        case '$':
-               if (check_inverse(argv[optind-1], &invert, &optind, 0)) break;
+               if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, 10000))
                        exit_error(PARAMETER_PROBLEM,
                                   "bad --limit-burst `%s'", optarg);
index f4128c0180ac45d9505af83644ce47f0f7fcc9e2..b516d80f005b077b9fd0ce83409dca306f968bcc 100644 (file)
@@ -57,7 +57,7 @@ mac_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_mac(argv[optind-1], macinfo);
                if (invert)
                        macinfo->invert = 1;
index 08bc9d95872f7d32d1fa9f1aa8b87fb44dba29c5..1143ba98c969996cf8071924e90b9715ebf5b974 100644 (file)
@@ -62,7 +62,7 @@ mark_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
                char *end;
        case '1':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                markinfo->mark = strtoul(optarg, &end, 0);
                if (*end == '/') {
                        markinfo->mask = strtoul(end+1, &end, 0);
index a7db2a8329b23cdef2f31e40d11d98962929f2c0..d0e830dfbdff753e9e59c79554f2185651b28a3e 100644 (file)
@@ -161,7 +161,7 @@ __multiport_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                proto = check_proto(pnum, invflags);
                multiinfo->count = parse_multi_ports(argv[optind-1],
                                                     multiinfo->ports, proto);
@@ -169,7 +169,7 @@ __multiport_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '2':
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                proto = check_proto(pnum, invflags);
                multiinfo->count = parse_multi_ports(argv[optind-1],
                                                     multiinfo->ports, proto);
@@ -177,7 +177,7 @@ __multiport_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case '3':
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                proto = check_proto(pnum, invflags);
                multiinfo->count = parse_multi_ports(argv[optind-1],
                                                     multiinfo->ports, proto);
@@ -228,21 +228,21 @@ __multiport_parse_v1(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                proto = check_proto(pnum, invflags);
                parse_multi_ports_v1(argv[optind-1], multiinfo, proto);
                multiinfo->flags = XT_MULTIPORT_SOURCE;
                break;
 
        case '2':
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                proto = check_proto(pnum, invflags);
                parse_multi_ports_v1(argv[optind-1], multiinfo, proto);
                multiinfo->flags = XT_MULTIPORT_DESTINATION;
                break;
 
        case '3':
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                proto = check_proto(pnum, invflags);
                parse_multi_ports_v1(argv[optind-1], multiinfo, proto);
                multiinfo->flags = XT_MULTIPORT_EITHER;
index 6152cb374a226ee27cbf58aa0edbd8dc911036bf..4275a1a423c30ea77364adbb5f7dc00ca2088a13 100644 (file)
@@ -43,7 +43,7 @@ physdev_parse(int c, char **argv, int invert, unsigned int *flags,
        case '1':
                if (*flags & XT_PHYSDEV_OP_IN)
                        goto multiple_use;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                xtables_parse_interface(argv[optind-1], info->physindev,
                                (unsigned char *)info->in_mask);
                if (invert)
@@ -55,7 +55,7 @@ physdev_parse(int c, char **argv, int invert, unsigned int *flags,
        case '2':
                if (*flags & XT_PHYSDEV_OP_OUT)
                        goto multiple_use;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                xtables_parse_interface(argv[optind-1], info->physoutdev,
                                (unsigned char *)info->out_mask);
                if (invert)
@@ -67,7 +67,7 @@ physdev_parse(int c, char **argv, int invert, unsigned int *flags,
        case '3':
                if (*flags & XT_PHYSDEV_OP_ISIN)
                        goto multiple_use;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                info->bitmask |= XT_PHYSDEV_OP_ISIN;
                if (invert)
                        info->invert |= XT_PHYSDEV_OP_ISIN;
@@ -77,7 +77,7 @@ physdev_parse(int c, char **argv, int invert, unsigned int *flags,
        case '4':
                if (*flags & XT_PHYSDEV_OP_ISOUT)
                        goto multiple_use;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                info->bitmask |= XT_PHYSDEV_OP_ISOUT;
                if (invert)
                        info->invert |= XT_PHYSDEV_OP_ISOUT;
@@ -87,7 +87,7 @@ physdev_parse(int c, char **argv, int invert, unsigned int *flags,
        case '5':
                if (*flags & XT_PHYSDEV_OP_BRIDGED)
                        goto multiple_use;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        info->invert |= XT_PHYSDEV_OP_BRIDGED;
                *flags |= XT_PHYSDEV_OP_BRIDGED;
index ab2e2259097f909682ff4e6f86ef6b90bb8dfc3e..8caba91e5945ca47177d863159ad5d7641d60776 100644 (file)
@@ -91,7 +91,7 @@ static int pkttype_parse(int c, char **argv, int invert, unsigned int *flags,
        switch(c)
        {
                case '1':
-                       check_inverse(optarg, &invert, &optind, 0);
+                       xtables_check_inverse(optarg, &invert, &optind, 0);
                        parse_pkttype(argv[optind-1], info);
                        if(invert)
                                info->invert=1;
index 90da1cd439c284d12ef99b5709cb83c07e24faca..8c91fb8e1a1e8ce6655f7205d76bd096c118d824 100644 (file)
@@ -60,7 +60,7 @@ quota_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               if (check_inverse(optarg, &invert, NULL, 0))
+               if (xtables_check_inverse(optarg, &invert, NULL, 0))
                        exit_error(PARAMETER_PROBLEM, "quota: unexpected '!'");
                if (!parse_quota(optarg, &info->quota))
                        exit_error(PARAMETER_PROBLEM,
index 285b7ba3a24cbb7f18fbb344825384e4af339833..8a8836bfd97cd9c36000955b8bb449f24b63d620 100644 (file)
@@ -118,7 +118,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case OPT_RATEEST1:
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        exit_error(PARAMETER_PROBLEM,
                                   "rateest: rateest can't be inverted");
@@ -132,7 +132,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST2:
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        exit_error(PARAMETER_PROBLEM,
                                   "rateest: rateest can't be inverted");
@@ -147,7 +147,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_BPS1:
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        exit_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-bps can't be inverted");
@@ -171,7 +171,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_PPS1:
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        exit_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-pps can't be inverted");
@@ -196,7 +196,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_BPS2:
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        exit_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-bps can't be inverted");
@@ -220,7 +220,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_PPS2:
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        exit_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-pps can't be inverted");
@@ -245,7 +245,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_DELTA:
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
                        exit_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-delta can't be inverted");
@@ -259,7 +259,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_EQ:
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
 
                if (*flags & (1 << c))
                        exit_error(PARAMETER_PROBLEM,
@@ -272,7 +272,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_LT:
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
 
                if (*flags & (1 << c))
                        exit_error(PARAMETER_PROBLEM,
@@ -285,7 +285,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
 
        case OPT_RATEEST_GT:
-               check_inverse(argv[optind-1], &invert, &optind, 0);
+               xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
 
                if (*flags & (1 << c))
                        exit_error(PARAMETER_PROBLEM,
index 1ae90133703bdddc5d43275e31bcd05eaf841d13..1646705f3170bbb6ca4df414492fd876fcca95a6 100644 (file)
@@ -73,7 +73,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
                                exit_error(PARAMETER_PROBLEM,
                                        "recent: only one of `--set', `--rcheck' "
                                        "`--update' or `--remove' may be set");
-                       check_inverse(optarg, &invert, &optind, 0);
+                       xtables_check_inverse(optarg, &invert, &optind, 0);
                        info->check_set |= XT_RECENT_SET;
                        if (invert) info->invert = 1;
                        *flags |= XT_RECENT_SET;
@@ -84,7 +84,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
                                exit_error(PARAMETER_PROBLEM,
                                        "recent: only one of `--set', `--rcheck' "
                                        "`--update' or `--remove' may be set");
-                       check_inverse(optarg, &invert, &optind, 0);
+                       xtables_check_inverse(optarg, &invert, &optind, 0);
                        info->check_set |= XT_RECENT_CHECK;
                        if(invert) info->invert = 1;
                        *flags |= XT_RECENT_CHECK;
@@ -95,7 +95,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
                                exit_error(PARAMETER_PROBLEM,
                                        "recent: only one of `--set', `--rcheck' "
                                        "`--update' or `--remove' may be set");
-                       check_inverse(optarg, &invert, &optind, 0);
+                       xtables_check_inverse(optarg, &invert, &optind, 0);
                        info->check_set |= XT_RECENT_UPDATE;
                        if (invert) info->invert = 1;
                        *flags |= XT_RECENT_UPDATE;
@@ -106,7 +106,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
                                exit_error(PARAMETER_PROBLEM,
                                        "recent: only one of `--set', `--rcheck' "
                                        "`--update' or `--remove' may be set");
-                       check_inverse(optarg, &invert, &optind, 0);
+                       xtables_check_inverse(optarg, &invert, &optind, 0);
                        info->check_set |= XT_RECENT_REMOVE;
                        if (invert) info->invert = 1;
                        *flags |= XT_RECENT_REMOVE;
index 6348a2f95de0ac8979d1971daeeef76a2054ea3d..2ee486106c9929e69d85eb61f0ae1b5dbf502761 100644 (file)
@@ -270,7 +270,7 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
                einfo->flags |= XT_SCTP_SRC_PORTS;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_sctp_ports(argv[optind-1], einfo->spts);
                if (invert)
                        einfo->invflags |= XT_SCTP_SRC_PORTS;
@@ -282,7 +282,7 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
                einfo->flags |= XT_SCTP_DEST_PORTS;
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_sctp_ports(argv[optind-1], einfo->dpts);
                if (invert)
                        einfo->invflags |= XT_SCTP_DEST_PORTS;
@@ -293,7 +293,7 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & XT_SCTP_CHUNK_TYPES)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--chunk-types' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if (!argv[optind] 
                    || argv[optind][0] == '-' || argv[optind][0] == '!')
index 66af518a2a8fe77a183b0b2e111d2bdfb7dcebc2..51822303f9b1dca29e720b97224874281823d3ee 100644 (file)
@@ -71,7 +71,7 @@ state_parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                state_parse_states(argv[optind-1], sinfo);
                if (invert)
index 0408c230ed9081c320158199a0128ee3be4cf3d5..6bd27c0b4dd19f97f3c70b66b67b2ec40e05d179 100644 (file)
@@ -199,7 +199,7 @@ string_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & STRING)
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple --string");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_string(argv[optind-1], stringinfo);
                if (invert) {
                        if (revision == 0)
@@ -216,7 +216,7 @@ string_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple --hex-string");
 
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_hex_string(argv[optind-1], stringinfo);  /* sets length */
                if (invert) {
                        if (revision == 0)
index bb667478d328b8889bf71c947acba8d478db7587..069bb7fa59572d37d473da348bed0427ac0066c3 100644 (file)
@@ -150,7 +150,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & TCP_SRC_PORTS)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_tcp_ports(argv[optind-1], tcpinfo->spts);
                if (invert)
                        tcpinfo->invflags |= XT_TCP_INV_SRCPT;
@@ -161,7 +161,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & TCP_DST_PORTS)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_tcp_ports(argv[optind-1], tcpinfo->dpts);
                if (invert)
                        tcpinfo->invflags |= XT_TCP_INV_DSTPT;
@@ -182,7 +182,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one of `--syn' or `--tcp-flags' "
                                   " allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if (!argv[optind]
                    || argv[optind][0] == '-' || argv[optind][0] == '!')
@@ -199,7 +199,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & TCP_OPTION)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--tcp-option' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_tcp_option(argv[optind-1], &tcpinfo->option);
                if (invert)
                        tcpinfo->invflags |= XT_TCP_INV_OPTION;
index d30aa24902d94b895c5c7e93c7fbf320cf36583e..5c013a773a9da6b5b5a45a863e69405cf2917441 100644 (file)
@@ -65,7 +65,7 @@ tcpmss_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--mss' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_tcp_mssvalues(argv[optind-1],
                                    &mssinfo->mss_min, &mssinfo->mss_max);
                if (invert)
index 401284118e3660fe70060216e178c290653dea0f..8f57f4ec701fcf9f3147ffef63174e7952413cfd 100644 (file)
@@ -72,7 +72,7 @@ udp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & UDP_SRC_PORTS)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_udp_ports(argv[optind-1], udpinfo->spts);
                if (invert)
                        udpinfo->invflags |= XT_UDP_INV_SRCPT;
@@ -83,7 +83,7 @@ udp_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & UDP_DST_PORTS)
                        exit_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
-               check_inverse(optarg, &invert, &optind, 0);
+               xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_udp_ports(argv[optind-1], udpinfo->dpts);
                if (invert)
                        udpinfo->invflags |= XT_UDP_INV_DSTPT;
index c3c960b10f55aeb90b0b22f54d3ff9b521cf705d..c1bf6d591b5566ffe8f68a9ed770266fccafd958 100644 (file)
@@ -202,7 +202,8 @@ xtables_parse_interface(const char *arg, char *vianame, unsigned char *mask);
 /* this is a special 64bit data type that is 8-byte aligned */
 #define aligned_u64 u_int64_t __attribute__((aligned(8)))
 
-int check_inverse(const char option[], int *invert, int *my_optind, int argc);
+int xtables_check_inverse(const char option[], int *invert,
+       int *my_optind, int argc);
 void exit_error(enum xtables_exittype, const char *, ...)
        __attribute__((noreturn, format(printf,2,3)));
 extern void xtables_param_act(unsigned int, const char *, ...);
index 48a6bec4f987edfa37d49e0ccdd71604f0541f41..903e005531d62fa10ced8b140932c4eca14b8aa1 100644 (file)
@@ -450,26 +450,6 @@ add_command(unsigned int *cmd, const int newcmd, const int othercmds,
        *cmd |= newcmd;
 }
 
-int
-check_inverse(const char option[], int *invert, int *my_optind, int argc)
-{
-       if (option && strcmp(option, "!") == 0) {
-               if (*invert)
-                       exit_error(PARAMETER_PROBLEM,
-                                  "Multiple `!' flags not allowed");
-               *invert = TRUE;
-               if (my_optind != NULL) {
-                       ++*my_optind;
-                       if (argc && *my_optind > argc)
-                               exit_error(PARAMETER_PROBLEM,
-                                          "no argument following `!'");
-               }
-
-               return TRUE;
-       }
-       return FALSE;
-}
-
 /*
  *     All functions starting with "parse" should succeed, otherwise
  *     the program fails.
@@ -1618,7 +1598,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                         * Option selection
                         */
                case 'p':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_PROTOCOL, &fw.ipv6.invflags,
                                   invert);
 
@@ -1644,14 +1624,14 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                        break;
 
                case 's':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_SOURCE, &fw.ipv6.invflags,
                                   invert);
                        shostnetworkmask = argv[optind-1];
                        break;
 
                case 'd':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_DESTINATION, &fw.ipv6.invflags,
                                   invert);
                        dhostnetworkmask = argv[optind-1];
@@ -1697,7 +1677,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
 
 
                case 'i':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_VIANAMEIN, &fw.ipv6.invflags,
                                   invert);
                        xtables_parse_interface(argv[optind-1],
@@ -1706,7 +1686,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                        break;
 
                case 'o':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_VIANAMEOUT, &fw.ipv6.invflags,
                                   invert);
                        xtables_parse_interface(argv[optind-1],
index 925464c067076f510784b4376754c65087229b14..ea765b0b51f582779f397e6a5de458d95c1bdc7c 100644 (file)
@@ -452,26 +452,6 @@ add_command(unsigned int *cmd, const int newcmd, const int othercmds,
        *cmd |= newcmd;
 }
 
-int
-check_inverse(const char option[], int *invert, int *my_optind, int argc)
-{
-       if (option && strcmp(option, "!") == 0) {
-               if (*invert)
-                       exit_error(PARAMETER_PROBLEM,
-                                  "Multiple `!' flags not allowed");
-               *invert = TRUE;
-               if (my_optind != NULL) {
-                       ++*my_optind;
-                       if (argc && *my_optind > argc)
-                               exit_error(PARAMETER_PROBLEM,
-                                          "no argument following `!'");
-               }
-
-               return TRUE;
-       }
-       return FALSE;
-}
-
 /*
  *     All functions starting with "parse" should succeed, otherwise
  *     the program fails.
@@ -1631,7 +1611,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                         * Option selection
                         */
                case 'p':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_PROTOCOL, &fw.ip.invflags,
                                   invert);
 
@@ -1649,14 +1629,14 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                        break;
 
                case 's':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_SOURCE, &fw.ip.invflags,
                                   invert);
                        shostnetworkmask = argv[optind-1];
                        break;
 
                case 'd':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_DESTINATION, &fw.ip.invflags,
                                   invert);
                        dhostnetworkmask = argv[optind-1];
@@ -1702,7 +1682,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
 
 
                case 'i':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_VIANAMEIN, &fw.ip.invflags,
                                   invert);
                        xtables_parse_interface(argv[optind-1],
@@ -1711,7 +1691,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                        break;
 
                case 'o':
-                       check_inverse(optarg, &invert, &optind, argc);
+                       xtables_check_inverse(optarg, &invert, &optind, argc);
                        set_option(&options, OPT_VIANAMEOUT, &fw.ip.invflags,
                                   invert);
                        xtables_parse_interface(argv[optind-1],
index 8a79c5b184aa1951a524f8d8e28fd945c4a24bd9..19e746c3cf01bbb1faab432fe7a867070f101c84 100644 (file)
--- a/xtables.c
+++ b/xtables.c
@@ -1257,3 +1257,31 @@ void xtables_save_string(const char *value)
                printf("\" ");
        }
 }
+
+/**
+ * Check for option-intrapositional negation.
+ * Do not use in new code.
+ */
+int xtables_check_inverse(const char option[], int *invert,
+                         int *my_optind, int argc)
+{
+       if (option && strcmp(option, "!") == 0) {
+               fprintf(stderr, "Using intrapositioned negation "
+                       "(`--option ! this`) is deprecated in favor of "
+                       "extrapositioned (`! --option this`).\n");
+
+               if (*invert)
+                       exit_error(PARAMETER_PROBLEM,
+                                  "Multiple `!' flags not allowed");
+               *invert = true;
+               if (my_optind != NULL) {
+                       ++*my_optind;
+                       if (argc && *my_optind > argc)
+                               exit_error(PARAMETER_PROBLEM,
+                                          "no argument following `!'");
+               }
+
+               return true;
+       }
+       return false;
+}