]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: prefix exit_error to xtables_error
authorJan Engelhardt <jengelh@medozas.de>
Sat, 21 Feb 2009 02:29:44 +0000 (03:29 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Sat, 21 Feb 2009 02:29:44 +0000 (03:29 +0100)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
90 files changed:
extensions/dscp_helper.c
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_CLUSTERIP.c
extensions/libipt_DNAT.c
extensions/libipt_ECN.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_set.h
extensions/libipt_ttl.c
extensions/libxt_CLASSIFY.c
extensions/libxt_CONNMARK.c
extensions/libxt_CONNSECMARK.c
extensions/libxt_DSCP.c
extensions/libxt_MARK.c
extensions/libxt_NFLOG.c
extensions/libxt_NFQUEUE.c
extensions/libxt_RATEEST.c
extensions/libxt_SECMARK.c
extensions/libxt_TCPMSS.c
extensions/libxt_TCPOPTSTRIP.c
extensions/libxt_TOS.c
extensions/libxt_TPROXY.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_owner.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_statistic.c
extensions/libxt_string.c
extensions/libxt_tcp.c
extensions/libxt_tcpmss.c
extensions/libxt_time.c
extensions/libxt_tos.c
extensions/libxt_u32.c
extensions/libxt_udp.c
extensions/tos_values.c
include/xtables.h.in
ip6tables-restore.c
ip6tables-save.c
ip6tables.c
iptables-restore.c
iptables-save.c
iptables-xml.c
iptables.c

index 217df0997e4aff8a22466dc54ba0653eb2b28fd5..8fa0f4a08bf72cc603a1633176995a7561ba4112 100644 (file)
@@ -57,7 +57,7 @@ class_to_dscp(const char *name)
                        return ds_classes[i].dscp;
        }
 
-       exit_error(PARAMETER_PROBLEM,
+       xtables_error(PARAMETER_PROBLEM,
                        "Invalid DSCP value `%s'\n", name);
 }
 
@@ -74,7 +74,7 @@ dscp_to_name(unsigned int dscp)
        }
 
 
-       exit_error(PARAMETER_PROBLEM,
+       xtables_error(PARAMETER_PROBLEM,
                        "Invalid DSCP value `%d'\n", dscp);
 }
 #endif
index 0a9871396f5bb29bd8fff8c1274449f1cb56d614..ee117f14f29ea24170c2afb6e33ae2d37836ad98 100644 (file)
@@ -32,20 +32,20 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags,
        unsigned int value;
 
        if (*flags & IP6T_HL_USED) {
-               exit_error(PARAMETER_PROBLEM, 
+               xtables_error(PARAMETER_PROBLEM,
                                "Can't specify HL option twice");
        }
 
        if (!optarg) 
-               exit_error(PARAMETER_PROBLEM, 
+               xtables_error(PARAMETER_PROBLEM,
                                "HL: You must specify a value");
 
        if (xtables_check_inverse(optarg, &invert, NULL, 0))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                                "HL: unexpected `!'");
        
        if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX))
-               exit_error(PARAMETER_PROBLEM,   
+               xtables_error(PARAMETER_PROBLEM,
                           "HL: Expected value between 0 and 255");
 
        switch (c) {
@@ -56,7 +56,7 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags,
 
                case '2':
                        if (value == 0) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "HL: decreasing by 0?");
                        }
 
@@ -65,7 +65,7 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags,
 
                case '3':
                        if (value == 0) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "HL: increasing by 0?");
                        }
 
@@ -86,7 +86,7 @@ static int HL_parse(int c, char **argv, int invert, unsigned int *flags,
 static void HL_check(unsigned int flags)
 {
        if (!(flags & IP6T_HL_USED))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                                "HL: You must specify an action");
 }
 
index 79877350ffe25971fe46fcace73217dde52813e8..c6bf2a79122d85a5daa1da17ec622d59ace930eb 100644 (file)
@@ -79,7 +79,7 @@ parse_level(const char *level)
                        if (strncasecmp(level, ip6t_log_names[i].name,
                                        strlen(level)) == 0) {
                                if (set++)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "log-level `%s' ambiguous",
                                                   level);
                                lev = ip6t_log_names[i].level;
@@ -87,7 +87,7 @@ parse_level(const char *level)
                }
 
                if (!set)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "log-level `%s' unknown", level);
        }
 
@@ -109,11 +109,11 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '!':
                if (*flags & IP6T_LOG_OPT_LEVEL)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-level twice");
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-level");
 
                loginfo->level = parse_level(optarg);
@@ -122,24 +122,24 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '#':
                if (*flags & IP6T_LOG_OPT_PREFIX)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-prefix twice");
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-prefix");
 
                if (strlen(optarg) > sizeof(loginfo->prefix) - 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Maximum prefix length %u for --log-prefix",
                                   (unsigned int)sizeof(loginfo->prefix) - 1);
 
                if (strlen(optarg) == 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "No prefix specified for --log-prefix");
 
                if (strlen(optarg) != strlen(strtok(optarg, "\n")))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Newlines not allowed in --log-prefix");
 
                strcpy(loginfo->prefix, optarg);
@@ -148,7 +148,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '1':
                if (*flags & IP6T_LOG_OPT_TCPSEQ)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-tcp-sequence "
                                   "twice");
 
@@ -158,7 +158,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags & IP6T_LOG_OPT_TCPOPT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-tcp-options twice");
 
                loginfo->logflags |= IP6T_LOG_TCPOPT;
@@ -167,7 +167,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '3':
                if (*flags & IP6T_LOG_OPT_IPOPT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-ip-options twice");
 
                loginfo->logflags |= IP6T_LOG_IPOPT;
@@ -176,7 +176,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '4':
                if (*flags & IP6T_LOG_OPT_UID)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-uid twice");
 
                loginfo->logflags |= IP6T_LOG_UID;
index 1c2be686dcc29467b94df3241544bcf595d978be..94013ecab9e59b89d0338699a35bc09522787c81 100644 (file)
@@ -86,7 +86,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
        switch(c) {
        case '1':
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --reject-with");
                for (i = 0; i < limit; i++) {
                        if ((strncasecmp(reject_table[i].name, optarg, strlen(optarg)) == 0)
@@ -95,7 +95,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
                                return 1;
                        }
                }
-               exit_error(PARAMETER_PROBLEM, "unknown reject type `%s'",optarg);
+               xtables_error(PARAMETER_PROBLEM, "unknown reject type \"%s\"", optarg);
        default:
                /* Fall through */
                break;
index 83ed4514a77da72f863e1f9825072464607df2aa..19b7ad46dd3c86a29fe7b7fca10b85c86e50405a 100644 (file)
@@ -33,16 +33,16 @@ parse_ah_spi(const char *spistr, const char *typestr)
        spi = strtoul(spistr, &ep, 0);
 
        if ( spistr == ep )
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "AH no valid digits in %s `%s'", typestr, spistr);
 
        if ( spi == ULONG_MAX  && errno == ERANGE )
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "%s `%s' specified too big: would overflow",
                           typestr, spistr);
 
        if ( *spistr != '\0'  && *ep != '\0' )
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "AH error parsing %s `%s'", typestr, spistr);
 
        return spi;
@@ -84,7 +84,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & IP6T_AH_SPI)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--ahspi' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_ah_spis(argv[optind-1], ahinfo->spis);
@@ -94,7 +94,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '2':
                if (*flags & IP6T_AH_LEN)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--ahlen' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                ahinfo->hdrlen = parse_ah_spi(argv[optind-1], "length");
@@ -104,7 +104,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '3':
                if (*flags & IP6T_AH_RES)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--ahres' allowed");
                ahinfo->hdrres = 1;
                *flags |= IP6T_AH_RES;
index e19abc4b39bad7f735547359932430270dad3378..a47e3a35ed14fcc16e3a7b78ea05f61aeadbb5ec 100644 (file)
@@ -37,16 +37,16 @@ parse_opts_num(const char *idstr, const char *typestr)
        id = strtoul(idstr, &ep, 0);
 
        if ( idstr == ep ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "dst: no valid digits in %s `%s'", typestr, idstr);
        }
        if ( id == ULONG_MAX  && errno == ERANGE ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "%s `%s' specified too big: would overflow",
                           typestr, idstr);
        }
        if ( *idstr != '\0'  && *ep != '\0' ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "dst: error parsing %s `%s'", typestr, idstr);
        }
        return id;
@@ -60,7 +60,7 @@ parse_options(const char *optsstr, u_int16_t *opts)
        
        buffer = strdup(optsstr);
         if (!buffer)
-               exit_error(OTHER_PROBLEM, "strdup failed");
+               xtables_error(OTHER_PROBLEM, "strdup failed");
                        
         for (cp = buffer, i = 0; cp && i < IP6T_OPTS_OPTSNR; cp = next, i++)
         {
@@ -73,7 +73,7 @@ parse_options(const char *optsstr, u_int16_t *opts)
 
                 if (range) {
                         if (i == IP6T_OPTS_OPTSNR-1)
-                                exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                            "too many ports specified");
                         *range++ = '\0';
                 }
@@ -81,7 +81,7 @@ parse_options(const char *optsstr, u_int16_t *opts)
                opts[i] = (parse_opts_num(cp, "opt") & 0xFF) << 8;
                 if (range) {
                        if (opts[i] == 0)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "PAD0 hasn't got length");
                        opts[i] |= parse_opts_num(range, "length") & 0xFF;
                 } else
@@ -94,7 +94,7 @@ parse_options(const char *optsstr, u_int16_t *opts)
        }
 
         if (cp)
-               exit_error(PARAMETER_PROBLEM, "too many addresses specified");
+               xtables_error(PARAMETER_PROBLEM, "too many addresses specified");
 
        free(buffer);
 
@@ -123,7 +123,7 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & IP6T_OPTS_LEN)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--dst-len' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                optinfo->hdrlen = parse_opts_num(argv[optind-1], "length");
@@ -134,11 +134,11 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '2':
                if (*flags & IP6T_OPTS_OPTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--dst-opts' allowed");
                 xtables_check_inverse(optarg, &invert, &optind, 0);
                 if (invert)
-                        exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                " '!' not allowed with `--dst-opts'");
                optinfo->optsnr = parse_options(argv[optind-1], optinfo->opts);
                optinfo->flags |= IP6T_OPTS_OPTS;
@@ -146,10 +146,10 @@ static int dst_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '3':
                if (*flags & IP6T_OPTS_NSTRICT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--dst-not-strict' allowed");
                if ( !(*flags & IP6T_OPTS_OPTS) )
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "`--dst-opts ...' required before "
                                   "`--dst-not-strict'");
                optinfo->flags |= IP6T_OPTS_NSTRICT;
index b55ef26fad8fa4ab5bd3789cf1da1cd0b4cac145..905b494b0de4b0054b8e1a8b799059a806ba3595 100644 (file)
@@ -39,16 +39,16 @@ parse_frag_id(const char *idstr, const char *typestr)
        id = strtoul(idstr, &ep, 0);
 
        if ( idstr == ep ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "FRAG no valid digits in %s `%s'", typestr, idstr);
        }
        if ( id == ULONG_MAX  && errno == ERANGE ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "%s `%s' specified too big: would overflow",
                           typestr, idstr);
        }       
        if ( *idstr != '\0'  && *ep != '\0' ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "FRAG error parsing %s `%s'", typestr, idstr);
        }
        return id;
@@ -92,7 +92,7 @@ static int frag_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & IP6T_FRAG_IDS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--fragid' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_frag_ids(argv[optind-1], fraginfo->ids);
@@ -103,7 +103,7 @@ static int frag_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '2':
                if (*flags & IP6T_FRAG_LEN)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--fraglen' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                fraginfo->hdrlen = parse_frag_id(argv[optind-1], "length");
@@ -114,28 +114,28 @@ static int frag_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '3':
                if (*flags & IP6T_FRAG_RES)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--fragres' allowed");
                fraginfo->flags |= IP6T_FRAG_RES;
                *flags |= IP6T_FRAG_RES;
                break;
        case '4':
                if (*flags & IP6T_FRAG_FST)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--fragfirst' allowed");
                fraginfo->flags |= IP6T_FRAG_FST;
                *flags |= IP6T_FRAG_FST;
                break;
        case '5':
                if (*flags & (IP6T_FRAG_MF|IP6T_FRAG_NMF)) 
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                           "Only one `--fragmore' or `--fraglast' allowed");
                fraginfo->flags |= IP6T_FRAG_MF;
                *flags |= IP6T_FRAG_MF;
                break;
        case '6':
                if (*flags & (IP6T_FRAG_MF|IP6T_FRAG_NMF)) 
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                           "Only one `--fragmore' or `--fraglast' allowed");
                fraginfo->flags |= IP6T_FRAG_NMF;
                *flags |= IP6T_FRAG_NMF;
index 3354eae41faca339b39fa2c8071fec6df58b0a04..e08d84a2490437191922a40b771e61457e8e30ad 100644 (file)
@@ -40,16 +40,16 @@ parse_opts_num(const char *idstr, const char *typestr)
        id =  strtoul(idstr,&ep,0) ;
 
        if ( idstr == ep ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "hbh: no valid digits in %s `%s'", typestr, idstr);
        }
        if ( id == ULONG_MAX  && errno == ERANGE ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "%s `%s' specified too big: would overflow",
                           typestr, idstr);
        }       
        if ( *idstr != '\0'  && *ep != '\0' ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "hbh: error parsing %s `%s'", typestr, idstr);
        }
        return id;
@@ -62,7 +62,7 @@ parse_options(const char *optsstr, u_int16_t *opts)
         unsigned int i;
        
        buffer = strdup(optsstr);
-        if (!buffer) exit_error(OTHER_PROBLEM, "strdup failed");
+       if (!buffer) xtables_error(OTHER_PROBLEM, "strdup failed");
                        
         for (cp=buffer, i=0; cp && i<IP6T_OPTS_OPTSNR; cp=next,i++)
         {
@@ -71,14 +71,14 @@ parse_options(const char *optsstr, u_int16_t *opts)
                 range = strchr(cp, ':');
                 if (range) {
                         if (i == IP6T_OPTS_OPTSNR-1)
-                                exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                            "too many ports specified");
                         *range++ = '\0';
                 }
                opts[i] = (parse_opts_num(cp, "opt") & 0xFF) << 8;
                 if (range) {
                        if (opts[i] == 0)
-                               exit_error(PARAMETER_PROBLEM, "PAD0 hasn't got length");
+                               xtables_error(PARAMETER_PROBLEM, "PAD0 has not got length");
                        opts[i] |= parse_opts_num(range, "length") & 0xFF;
                 } else {
                         opts[i] |= (0x00FF);
@@ -89,7 +89,7 @@ parse_options(const char *optsstr, u_int16_t *opts)
                printf("opts opt: %04X\n", opts[i]);
 #endif
        }
-        if (cp) exit_error(PARAMETER_PROBLEM, "too many addresses specified");
+       if (cp) xtables_error(PARAMETER_PROBLEM, "too many addresses specified");
 
        free(buffer);
 
@@ -118,7 +118,7 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & IP6T_OPTS_LEN)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--hbh-len' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                optinfo->hdrlen = parse_opts_num(argv[optind-1], "length");
@@ -129,11 +129,11 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '2':
                if (*flags & IP6T_OPTS_OPTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--hbh-opts' allowed");
                 xtables_check_inverse(optarg, &invert, &optind, 0);
                 if (invert)
-                        exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                " '!' not allowed with `--hbh-opts'");
                optinfo->optsnr = parse_options(argv[optind-1], optinfo->opts);
                optinfo->flags |= IP6T_OPTS_OPTS;
@@ -141,10 +141,10 @@ static int hbh_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '3':
                if (*flags & IP6T_OPTS_NSTRICT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--hbh-not-strict' allowed");
                if ( !(*flags & IP6T_OPTS_OPTS) )
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "`--hbh-opts ...' required before `--hbh-not-strict'");
                optinfo->flags |= IP6T_OPTS_NSTRICT;
                *flags |= IP6T_OPTS_NSTRICT;
index 286f43247c4f14b94e9c6b1884f2b8c026174c21..2280e03eb606cbd29ce4c354fed9aca59da066a7 100644 (file)
@@ -34,11 +34,11 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags,
        value = atoi(argv[optind-1]);
 
        if (*flags) 
-               exit_error(PARAMETER_PROBLEM, 
+               xtables_error(PARAMETER_PROBLEM,
                                "Can't specify HL option twice");
 
        if (!optarg)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                                "hl: You must specify a value");
        switch (c) {
                case '2':
@@ -54,7 +54,7 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags,
                        break;
                case '3':
                        if (invert) 
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                                "hl: unexpected `!'");
 
                        info->mode = IP6T_HL_LT;
@@ -64,7 +64,7 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags,
                        break;
                case '4':
                        if (invert)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                                "hl: unexpected `!'");
 
                        info->mode = IP6T_HL_GT;
@@ -82,7 +82,7 @@ static int hl_parse(int c, char **argv, int invert, unsigned int *flags,
 static void hl_check(unsigned int flags)
 {
        if (!flags) 
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                        "HL match: You must specify one of "
                        "`--hl-eq', `--hl-lt', `--hl-gt'");
 }
index 5af9b02ef80f3360cade637ad1964297ded4da6e..69171d1a0e37d940e2862a14d65054c5caa7dd68 100644 (file)
@@ -98,7 +98,7 @@ parse_icmpv6(const char *icmpv6type, u_int8_t *type, u_int8_t code[])
                if (strncasecmp(icmpv6_codes[i].name, icmpv6type, strlen(icmpv6type))
                    == 0) {
                        if (match != limit)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Ambiguous ICMPv6 type `%s':"
                                           " `%s' or `%s'?",
                                           icmpv6type,
@@ -124,12 +124,12 @@ parse_icmpv6(const char *icmpv6type, u_int8_t *type, u_int8_t code[])
                        *slash = '\0';
 
                if (!xtables_strtoui(buffer, NULL, &number, 0, UINT8_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid ICMPv6 type `%s'\n", buffer);
                *type = number;
                if (slash) {
                        if (!xtables_strtoui(slash+1, NULL, &number, 0, UINT8_MAX))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Invalid ICMPv6 code `%s'\n",
                                           slash+1);
                        code[0] = code[1] = number;
@@ -155,7 +155,7 @@ static int icmp6_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags == 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "icmpv6 match: only use --icmpv6-type once!");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_icmpv6(argv[optind-1], &icmpv6info->type, 
@@ -240,7 +240,7 @@ static void icmp6_save(const void *ip, const struct xt_entry_match *match)
 static void icmp6_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "icmpv6 match: You must specify `--icmpv6-type'");
 }
 
index 982e6a7b42537e1dca652dc9135276f0cdfc56c8..296bd5f32c9753f57af54c116ecccde483e4005d 100644 (file)
@@ -105,7 +105,7 @@ name_to_proto(const char *s)
                }
 
                if (i == sizeof(chain_protos)/sizeof(struct pprot))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "unknown header `%s' specified",
                                s);
         }
@@ -127,7 +127,7 @@ add_proto_to_mask(int proto){
        }
 
        if (i == sizeof(chain_flags)/sizeof(struct numflag))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                "unknown header `%d' specified",
                proto);
        
@@ -189,13 +189,13 @@ ipv6header_parse(int c, char **argv, int invert, unsigned int *flags,
                case '1' : 
                        /* Parse the provided header names */
                        if (*flags & IPV6_HDR_HEADER)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "Only one `--header' allowed");
 
                        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");
+                               xtables_error(PARAMETER_PROBLEM, "ip6t_ipv6header: cannot parse header names");
 
                        if (invert) 
                                info->invflags |= 0xFF;
@@ -204,7 +204,7 @@ ipv6header_parse(int c, char **argv, int invert, unsigned int *flags,
                case '2' : 
                        /* Soft-mode requested? */
                        if (*flags & IPV6_HDR_SOFT)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "Only one `--soft' allowed");
 
                        info->modeflag |= 0xFF;
@@ -219,7 +219,7 @@ ipv6header_parse(int c, char **argv, int invert, unsigned int *flags,
 
 static void ipv6header_check(unsigned int flags)
 {
-       if (!flags) exit_error(PARAMETER_PROBLEM, "ip6t_ipv6header: no options specified");
+       if (!flags) xtables_error(PARAMETER_PROBLEM, "ip6t_ipv6header: no options specified");
 }
 
 static void
index 78fc804a7a1d1002ad31b851234f595279fa0ed2..f476c93e87ecc4e6bcb929dceac3ed05db1ed49d 100644 (file)
@@ -94,7 +94,7 @@ static unsigned int name_to_type(const char *name)
                unsigned int number;
 
                if (!xtables_strtoui(name, NULL, &number, 0, UINT8_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid MH type `%s'\n", name);
                return number;
        }
@@ -116,7 +116,7 @@ static void parse_mh_types(const char *mhtype, u_int8_t *types)
                types[1] = cp[0] ? name_to_type(cp) : 0xFF;
 
                if (types[0] > types[1])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid MH type range (min > max)");
        }
        free(buffer);
@@ -132,7 +132,7 @@ static int mh_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & MH_TYPES)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--mh-type' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_mh_types(argv[optind-1], mhinfo->types);
index 7ea72cd9ed9e31b3d72ac1ede8736748e114c1e5..70f320faf4a890267be89e7e6edad8406674c1ad 100644 (file)
@@ -130,7 +130,7 @@ static int parse_direction(char *s)
                return IP6T_POLICY_MATCH_IN;
        if (strcmp(s, "out") == 0)
                return IP6T_POLICY_MATCH_OUT;
-       exit_error(PARAMETER_PROBLEM, "policy_match: invalid dir `%s'", s);
+       xtables_error(PARAMETER_PROBLEM, "policy_match: invalid dir \"%s\"", s);
 }
 
 static int parse_policy(char *s)
@@ -139,7 +139,7 @@ static int parse_policy(char *s)
                return IP6T_POLICY_MATCH_NONE;
        if (strcmp(s, "ipsec") == 0)
                return 0;
-       exit_error(PARAMETER_PROBLEM, "policy match: invalid policy `%s'", s);
+       xtables_error(PARAMETER_PROBLEM, "policy match: invalid policy \"%s\"", s);
 }
 
 static int parse_mode(char *s)
@@ -148,7 +148,7 @@ static int parse_mode(char *s)
                return IP6T_POLICY_MODE_TRANSPORT;
        if (strcmp(s, "tunnel") == 0)
                return IP6T_POLICY_MODE_TUNNEL;
-       exit_error(PARAMETER_PROBLEM, "policy match: invalid mode `%s'", s);
+       xtables_error(PARAMETER_PROBLEM, "policy match: invalid mode \"%s\"", s);
 }
 
 static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
@@ -165,35 +165,35 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (info->flags & (IP6T_POLICY_MATCH_IN|IP6T_POLICY_MATCH_OUT))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --dir option");
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: can't invert --dir option");
 
                info->flags |= parse_direction(argv[optind-1]);
                break;
        case '2':
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: can't invert --policy option");
 
                info->flags |= parse_policy(argv[optind-1]);
                break;
        case '3':
                if (info->flags & IP6T_POLICY_MATCH_STRICT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --strict option");
 
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: can't invert --strict option");
 
                info->flags |= IP6T_POLICY_MATCH_STRICT;
                break;
        case '4':
                if (e->match.reqid)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --reqid option");
 
                e->match.reqid = 1;
@@ -202,7 +202,7 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '5':
                if (e->match.spi)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --spi option");
 
                e->match.spi = 1;
@@ -211,12 +211,12 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '6':
                if (e->match.saddr)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --tunnel-src option");
 
                xtables_ip6parse_any(argv[optind-1], &addr, &mask, &naddr);
                if (naddr > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: name resolves to multiple IPs");
 
                e->match.saddr = 1;
@@ -226,12 +226,12 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                 break;
        case '7':
                if (e->match.daddr)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --tunnel-dst option");
 
                xtables_ip6parse_any(argv[optind-1], &addr, &mask, &naddr);
                if (naddr > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: name resolves to multiple IPs");
 
                e->match.daddr = 1;
@@ -241,20 +241,20 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '8':
                if (e->match.proto)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --proto option");
 
                e->proto = xtables_parse_protocol(argv[optind-1]);
                if (e->proto != IPPROTO_AH && e->proto != IPPROTO_ESP &&
                    e->proto != IPPROTO_COMP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: protocol must ah/esp/ipcomp");
                e->match.proto = 1;
                e->invert.proto = invert;
                break;
        case '9':
                if (e->match.mode)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --mode option");
 
                mode = parse_mode(argv[optind-1]);
@@ -264,11 +264,11 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case 'a':
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: can't invert --next option");
 
                if (++info->len == IP6T_POLICY_MAX_ELEM)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: maximum policy depth reached");
                break;
        default:
@@ -286,26 +286,26 @@ static void policy_check(unsigned int flags)
        int i;
 
        if (info == NULL)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "policy match: no parameters given");
 
        if (!(info->flags & (IP6T_POLICY_MATCH_IN|IP6T_POLICY_MATCH_OUT)))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "policy match: neither --in nor --out specified");
 
        if (info->flags & IP6T_POLICY_MATCH_NONE) {
                if (info->flags & IP6T_POLICY_MATCH_STRICT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: policy none but --strict given");
 
                if (info->len != 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: policy none but policy given");
        } else
                info->len++;    /* increase len by 1, no --next after last element */
 
        if (!(info->flags & IP6T_POLICY_MATCH_STRICT) && info->len > 1)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "policy match: multiple elements but no --strict");
 
        for (i = 0; i < info->len; i++) {
@@ -314,13 +314,13 @@ static void policy_check(unsigned int flags)
                 if (info->flags & IP6T_POLICY_MATCH_STRICT &&
                    !(e->match.reqid || e->match.spi || e->match.saddr ||
                       e->match.daddr || e->match.proto || e->match.mode))
-                        exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                    "policy match: empty policy element");
 
                if ((e->match.saddr || e->match.daddr)
                    && ((e->mode == IP6T_POLICY_MODE_TUNNEL && e->invert.mode) ||
                        (e->mode == IP6T_POLICY_MODE_TRANSPORT && !e->invert.mode)))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: --tunnel-src/--tunnel-dst "
                                   "is only valid in tunnel mode");
        }
index 64c98efce0a85cf86496f3a2bb3e2cbdd75e38fa..c9bf9945444fcc148c9f783e7b1f18be1037d074 100644 (file)
@@ -46,16 +46,16 @@ parse_rt_num(const char *idstr, const char *typestr)
        id =  strtoul(idstr,&ep,0) ;
 
        if ( idstr == ep ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "RT no valid digits in %s `%s'", typestr, idstr);
        }
        if ( id == ULONG_MAX  && errno == ERANGE ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "%s `%s' specified too big: would overflow",
                           typestr, idstr);
        }       
        if ( *idstr != '\0'  && *ep != '\0' ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "RT error parsing %s `%s'", typestr, idstr);
        }
        return id;
@@ -98,7 +98,7 @@ numeric_to_addr(const char *num)
 #ifdef DEBUG
        fprintf(stderr, "\nnumeric2addr: %d\n", err);
 #endif
-        exit_error(PARAMETER_PROBLEM, "bad address: %s", num);
+       xtables_error(PARAMETER_PROBLEM, "bad address: %s", num);
 
        return (struct in6_addr *)NULL;
 }
@@ -111,7 +111,7 @@ parse_addresses(const char *addrstr, struct in6_addr *addrp)
         unsigned int i;
        
        buffer = strdup(addrstr);
-        if (!buffer) exit_error(OTHER_PROBLEM, "strdup failed");
+       if (!buffer) xtables_error(OTHER_PROBLEM, "strdup failed");
                        
         for (cp=buffer, i=0; cp && i<IP6T_RT_HOPS; cp=next,i++)
         {
@@ -124,7 +124,7 @@ parse_addresses(const char *addrstr, struct in6_addr *addrp)
                printf("addr [%d]: %s\n", i, addr_to_numeric(&(addrp[i])));
 #endif
        }
-        if (cp) exit_error(PARAMETER_PROBLEM, "too many addresses specified");
+       if (cp) xtables_error(PARAMETER_PROBLEM, "too many addresses specified");
 
        free(buffer);
 
@@ -156,7 +156,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & IP6T_RT_TYP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-type' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                rtinfo->rt_type = parse_rt_num(argv[optind-1], "type");
@@ -167,7 +167,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '2':
                if (*flags & IP6T_RT_SGS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-segsleft' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_rt_segsleft(argv[optind-1], rtinfo->segsleft);
@@ -178,7 +178,7 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '3':
                if (*flags & IP6T_RT_LEN)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-len' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                rtinfo->hdrlen = parse_rt_num(argv[optind-1], "length");
@@ -189,24 +189,24 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '4':
                if (*flags & IP6T_RT_RES)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-0-res' allowed");
                if ( !(*flags & IP6T_RT_TYP) || (rtinfo->rt_type != 0) || (rtinfo->invflags & IP6T_RT_INV_TYP) )
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "`--rt-type 0' required before `--rt-0-res'");
                rtinfo->flags |= IP6T_RT_RES;
                *flags |= IP6T_RT_RES;
                break;
        case '5':
                if (*flags & IP6T_RT_FST)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-0-addrs' allowed");
                if ( !(*flags & IP6T_RT_TYP) || (rtinfo->rt_type != 0) || (rtinfo->invflags & IP6T_RT_INV_TYP) )
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "`--rt-type 0' required before `--rt-0-addrs'");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   " '!' not allowed with `--rt-0-addrs'");
                rtinfo->addrnr = parse_addresses(argv[optind-1], rtinfo->addrs);
                rtinfo->flags |= IP6T_RT_FST;
@@ -214,10 +214,10 @@ static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '6':
                if (*flags & IP6T_RT_FST_NSTRICT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--rt-0-not-strict' allowed");
                if ( !(*flags & IP6T_RT_FST) )
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "`--rt-0-addr ...' required before `--rt-0-not-strict'");
                rtinfo->flags |= IP6T_RT_FST_NSTRICT;
                *flags |= IP6T_RT_FST_NSTRICT;
index 38909ea436e5ccb6eeafcd90678869283649b0df..2bb2292a56e5c9a8037287c74f292dd063bfe7e1 100644 (file)
@@ -57,7 +57,7 @@ parse_mac(const char *mac, char *macbuf)
        unsigned int i = 0;
 
        if (strlen(mac) != ETH_ALEN*3-1)
-               exit_error(PARAMETER_PROBLEM, "Bad mac address `%s'", mac);
+               xtables_error(PARAMETER_PROBLEM, "Bad mac address \"%s\"", mac);
 
        for (i = 0; i < ETH_ALEN; i++) {
                long number;
@@ -70,7 +70,7 @@ parse_mac(const char *mac, char *macbuf)
                    && number <= 255)
                        macbuf[i] = number;
                else
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Bad mac address `%s'", mac);
        }
 }
@@ -86,14 +86,14 @@ static int CLUSTERIP_parse(int c, char **argv, int invert, unsigned int *flags,
        case '1':
                cipinfo->flags |= CLUSTERIP_FLAG_NEW;
                if (*flags & PARAM_NEW)
-                       exit_error(PARAMETER_PROBLEM, "Can only specify `--new' once\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify \"--new\" once\n");
                *flags |= PARAM_NEW;
                break;
        case '2':
                if (!(*flags & PARAM_NEW))
-                       exit_error(PARAMETER_PROBLEM, "Can only specify hashmode combined with `--new'\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify hashmode combined with \"--new\"\n");
                if (*flags & PARAM_HMODE)
-                       exit_error(PARAMETER_PROBLEM, "Can only specify hashmode once\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify hashmode once\n");
                if (!strcmp(optarg, "sourceip"))
                        cipinfo->hash_mode = CLUSTERIP_HASHMODE_SIP;
                else if (!strcmp(optarg, "sourceip-sourceport"))
@@ -101,48 +101,48 @@ static int CLUSTERIP_parse(int c, char **argv, int invert, unsigned int *flags,
                else if (!strcmp(optarg, "sourceip-sourceport-destport"))
                        cipinfo->hash_mode = CLUSTERIP_HASHMODE_SIP_SPT_DPT;
                else
-                       exit_error(PARAMETER_PROBLEM, "Unknown hashmode `%s'\n",
+                       xtables_error(PARAMETER_PROBLEM, "Unknown hashmode \"%s\"\n",
                                   optarg);
                *flags |= PARAM_HMODE;
                break;
        case '3':
                if (!(*flags & PARAM_NEW))
-                       exit_error(PARAMETER_PROBLEM, "Can only specify MAC combined with `--new'\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify MAC combined with \"--new\"\n");
                if (*flags & PARAM_MAC)
-                       exit_error(PARAMETER_PROBLEM, "Can only specify MAC once\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify MAC once\n");
                parse_mac(optarg, (char *)cipinfo->clustermac);
                if (!(cipinfo->clustermac[0] & 0x01))
-                       exit_error(PARAMETER_PROBLEM, "MAC has to be a multicast ethernet address\n");
+                       xtables_error(PARAMETER_PROBLEM, "MAC has to be a multicast ethernet address\n");
                *flags |= PARAM_MAC;
                break;
        case '4':
                if (!(*flags & PARAM_NEW))
-                       exit_error(PARAMETER_PROBLEM, "Can only specify node number combined with `--new'\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify node number combined with \"--new\"\n");
                if (*flags & PARAM_TOTALNODE)
-                       exit_error(PARAMETER_PROBLEM, "Can only specify total node number once\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify total node number once\n");
                if (!xtables_strtoui(optarg, NULL, &num, 1, CLUSTERIP_MAX_NODES))
-                       exit_error(PARAMETER_PROBLEM, "Unable to parse `%s'\n", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Unable to parse \"%s\"\n", optarg);
                cipinfo->num_total_nodes = num;
                *flags |= PARAM_TOTALNODE;
                break;
        case '5':
                if (!(*flags & PARAM_NEW))
-                       exit_error(PARAMETER_PROBLEM, "Can only specify node number combined with `--new'\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify node number combined with \"--new\"\n");
                if (*flags & PARAM_LOCALNODE)
-                       exit_error(PARAMETER_PROBLEM, "Can only specify local node number once\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify local node number once\n");
                if (!xtables_strtoui(optarg, NULL, &num, 1, CLUSTERIP_MAX_NODES))
-                       exit_error(PARAMETER_PROBLEM, "Unable to parse `%s'\n", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Unable to parse \"%s\"\n", optarg);
                cipinfo->num_local_nodes = 1;
                cipinfo->local_nodes[0] = num;
                *flags |= PARAM_LOCALNODE;
                break;
        case '6':
                if (!(*flags & PARAM_NEW))
-                       exit_error(PARAMETER_PROBLEM, "Can only specify hash init value combined with `--new'\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can only specify hash init value combined with \"--new\"\n");
                if (*flags & PARAM_HASHINIT)
-                       exit_error(PARAMETER_PROBLEM, "Can specify hash init value only once\n");
+                       xtables_error(PARAMETER_PROBLEM, "Can specify hash init value only once\n");
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT_MAX))
-                       exit_error(PARAMETER_PROBLEM, "Unable to parse `%s'\n", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Unable to parse \"%s\"\n", optarg);
                cipinfo->hash_initval = num;
                *flags |= PARAM_HASHINIT;
                break;
@@ -162,7 +162,7 @@ static void CLUSTERIP_check(unsigned int flags)
                == (PARAM_NEW|PARAM_HMODE|PARAM_MAC|PARAM_TOTALNODE|PARAM_LOCALNODE))
                return;
 
-       exit_error(PARAMETER_PROBLEM, "CLUSTERIP target: Invalid parameter combination\n");
+       xtables_error(PARAMETER_PROBLEM, "CLUSTERIP target: Invalid parameter combination\n");
 }
 
 static char *hashmode2str(enum clusterip_hashmode mode)
index 371ec79a88e80af71dbfb1cc8a2d250f81497cad..a3e14622cf44d92201d69c1158efbaa2c203724b 100644 (file)
@@ -45,7 +45,7 @@ append_range(struct ipt_natinfo *info, const struct ip_nat_range *range)
 
        info = realloc(info, size);
        if (!info)
-               exit_error(OTHER_PROBLEM, "Out of memory\n");
+               xtables_error(OTHER_PROBLEM, "Out of memory\n");
 
        info->t.u.target_size = size;
        info->mr.range[info->mr.rangesize] = *range;
@@ -69,19 +69,19 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info)
                int port;
 
                if (!portok)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Need TCP, UDP, SCTP or DCCP with port specification");
 
                range.flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
 
                port = atoi(colon+1);
                if (port <= 0 || port > 65535)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Port `%s' not valid\n", colon+1);
 
                error = strchr(colon+1, ':');
                if (error)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid port:port syntax - use dash\n");
 
                dash = strchr(colon, '-');
@@ -94,11 +94,11 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info)
 
                        maxport = atoi(dash + 1);
                        if (maxport <= 0 || maxport > 65535)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Port `%s' not valid\n", dash+1);
                        if (maxport < port)
                                /* People are stupid. */
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Port range `%s' funky\n", colon+1);
                        range.min.tcp.port = htons(port);
                        range.max.tcp.port = htons(maxport);
@@ -119,13 +119,13 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info)
 
        ip = xtables_numeric_to_ipaddr(arg);
        if (!ip)
-               exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n",
+               xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n",
                           arg);
        range.min_ip = ip->s_addr;
        if (dash) {
                ip = xtables_numeric_to_ipaddr(dash+1);
                if (!ip)
-                       exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n",
+                       xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n",
                                   dash+1);
                range.max_ip = ip->s_addr;
        } else
@@ -153,14 +153,14 @@ static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-destination");
 
                if (*flags) {
                        if (!kernel_version)
                                get_kernel_version();
                        if (kernel_version > LINUX_VERSION(2, 6, 10))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Multiple --to-destination not supported");
                }
                *target = parse_to(optarg, portok, info);
@@ -185,7 +185,7 @@ static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags,
 static void DNAT_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "You must specify --to-destination");
 }
 
index c4e8e34fbc42de55e35b72b76c33d9f63a0de805..b107d16e77507c8b75044b12cb67d473a121437a 100644 (file)
@@ -50,7 +50,7 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case 'F':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "ECN target: Only use --ecn-tcp-remove ONCE!");
                einfo->operation = IPT_ECN_OP_SET_ECE | IPT_ECN_OP_SET_CWR;
                einfo->proto.tcp.ece = 0;
@@ -59,10 +59,10 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case 'G':
                if (*flags & IPT_ECN_OP_SET_CWR)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "ECN target: Only use --ecn-tcp-cwr ONCE!");
                if (!xtables_strtoui(optarg, NULL, &result, 0, 1))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "ECN target: Value out of range");
                einfo->operation |= IPT_ECN_OP_SET_CWR;
                einfo->proto.tcp.cwr = result;
@@ -70,10 +70,10 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case 'H':
                if (*flags & IPT_ECN_OP_SET_ECE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "ECN target: Only use --ecn-tcp-ece ONCE!");
                if (!xtables_strtoui(optarg, NULL, &result, 0, 1))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "ECN target: Value out of range");
                einfo->operation |= IPT_ECN_OP_SET_ECE;
                einfo->proto.tcp.ece = result;
@@ -81,10 +81,10 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '9':
                if (*flags & IPT_ECN_OP_SET_IP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "ECN target: Only use --ecn-ip-ect ONCE!");
                if (!xtables_strtoui(optarg, NULL, &result, 0, 3))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "ECN target: Value out of range");
                einfo->operation |= IPT_ECN_OP_SET_IP;
                einfo->ip_ect = result;
@@ -100,7 +100,7 @@ static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
 static void ECN_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "ECN target: Parameter --ecn-tcp-remove is required");
 }
 
index bc7e8a4e21e62d28144dc41bcb0d49a4a4eb4f83..4da412c14908b15ef79298fb55d99e7585754705 100644 (file)
@@ -79,7 +79,7 @@ parse_level(const char *level)
                        if (strncasecmp(level, ipt_log_names[i].name,
                                        strlen(level)) == 0) {
                                if (set++)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "log-level `%s' ambiguous",
                                                   level);
                                lev = ipt_log_names[i].level;
@@ -87,7 +87,7 @@ parse_level(const char *level)
                }
 
                if (!set)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "log-level `%s' unknown", level);
        }
 
@@ -109,11 +109,11 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '!':
                if (*flags & IPT_LOG_OPT_LEVEL)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-level twice");
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-level");
 
                loginfo->level = parse_level(optarg);
@@ -122,24 +122,24 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '#':
                if (*flags & IPT_LOG_OPT_PREFIX)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-prefix twice");
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-prefix");
 
                if (strlen(optarg) > sizeof(loginfo->prefix) - 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Maximum prefix length %u for --log-prefix",
                                   (unsigned int)sizeof(loginfo->prefix) - 1);
 
                if (strlen(optarg) == 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "No prefix specified for --log-prefix");
 
                if (strlen(optarg) != strlen(strtok(optarg, "\n")))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Newlines not allowed in --log-prefix");
 
                strcpy(loginfo->prefix, optarg);
@@ -148,7 +148,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '1':
                if (*flags & IPT_LOG_OPT_TCPSEQ)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-tcp-sequence "
                                   "twice");
 
@@ -158,7 +158,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags & IPT_LOG_OPT_TCPOPT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-tcp-options twice");
 
                loginfo->logflags |= IPT_LOG_TCPOPT;
@@ -167,7 +167,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '3':
                if (*flags & IPT_LOG_OPT_IPOPT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-ip-options twice");
 
                loginfo->logflags |= IPT_LOG_IPOPT;
@@ -176,7 +176,7 @@ static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '4':
                if (*flags & IPT_LOG_OPT_UID)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-uid twice");
 
                loginfo->logflags |= IPT_LOG_UID;
index 0ee155c24d3aa274fb87207106757b598c41316d..0180bf6b0bcbb05d773525cf621d983e980d4c7e 100644 (file)
@@ -44,7 +44,7 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
 
        port = atoi(arg);
        if (port <= 0 || port > 65535)
-               exit_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", arg);
+               xtables_error(PARAMETER_PROBLEM, "Port \"%s\" not valid\n", arg);
 
        dash = strchr(arg, '-');
        if (!dash) {
@@ -56,11 +56,11 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
 
                maxport = atoi(dash + 1);
                if (maxport == 0 || maxport > 65535)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Port `%s' not valid\n", dash+1);
                if (maxport < port)
                        /* People are stupid.  Present reader excepted. */
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Port range `%s' funky\n", arg);
                mr->range[0].min.tcp.port = htons(port);
                mr->range[0].max.tcp.port = htons(maxport);
@@ -87,11 +87,11 @@ static int MASQUERADE_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (!portok)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Need TCP, UDP, SCTP or DCCP with port specification");
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-ports");
 
                parse_ports(optarg, mr);
index 9949c99bc0bfa7f9f247b54ff9cee0ff9aaabbfe..b1d79ce22359adf23a3b66f26fd109cfe19b89bd 100644 (file)
@@ -77,26 +77,26 @@ parse_to(char *arg, struct ip_nat_range *range)
 
        ip = xtables_numeric_to_ipaddr(arg);
        if (!ip)
-               exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n",
+               xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n",
                           arg);
        range->min_ip = ip->s_addr;
        if (slash) {
                if (strchr(slash+1, '.')) {
                        ip = xtables_numeric_to_ipmask(slash+1);
                        if (!ip)
-                               exit_error(PARAMETER_PROBLEM, "Bad netmask `%s'\n",
+                               xtables_error(PARAMETER_PROBLEM, "Bad netmask \"%s\"\n",
                                           slash+1);
                        netmask = ip->s_addr;
                }
                else {
                        if (!xtables_strtoui(slash+1, NULL, &bits, 0, 32))
-                               exit_error(PARAMETER_PROBLEM, "Bad netmask `%s'\n",
+                               xtables_error(PARAMETER_PROBLEM, "Bad netmask \"%s\"\n",
                                           slash+1);
                        netmask = bits2netmask(bits);
                }
                /* Don't allow /0 (/1 is probably insane, too) */
                if (netmask == 0)
-                       exit_error(PARAMETER_PROBLEM, "Netmask needed\n");
+                       xtables_error(PARAMETER_PROBLEM, "Netmask needed\n");
        }
        else
                netmask = ~0;
@@ -104,7 +104,7 @@ parse_to(char *arg, struct ip_nat_range *range)
        if (range->min_ip & ~netmask) {
                if (slash)
                        *slash = '/';
-               exit_error(PARAMETER_PROBLEM, "Bad network address `%s'\n",
+               xtables_error(PARAMETER_PROBLEM, "Bad network address \"%s\"\n",
                           arg);
        }
        range->max_ip = range->min_ip | ~netmask;
@@ -119,7 +119,7 @@ static int NETMAP_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --%s", NETMAP_opts[0].name);
 
                parse_to(optarg, &mr->range[0]);
@@ -134,7 +134,7 @@ static int NETMAP_parse(int c, char **argv, int invert, unsigned int *flags,
 static void NETMAP_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           MODULENAME" needs --%s", NETMAP_opts[0].name);
 }
 
index c6afbdccad86666e45714ee9b46710a116c3d7eb..8fcb46a9477aa5743b6ae9e6175e67a791e8879d 100644 (file)
@@ -44,14 +44,14 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
        mr->range[0].flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
 
        if (strchr(arg, '.'))
-               exit_error(PARAMETER_PROBLEM, "IP address not permitted\n");
+               xtables_error(PARAMETER_PROBLEM, "IP address not permitted\n");
 
        port = atoi(arg);
        if (port == 0)
                port = xtables_service_to_port(arg, NULL);
 
        if (port == 0 || port > 65535)
-               exit_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", arg);
+               xtables_error(PARAMETER_PROBLEM, "Port \"%s\" not valid\n", arg);
 
        dash = strchr(arg, '-');
        if (!dash) {
@@ -63,11 +63,11 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
 
                maxport = atoi(dash + 1);
                if (maxport == 0 || maxport > 65535)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Port `%s' not valid\n", dash+1);
                if (maxport < port)
                        /* People are stupid. */
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Port range `%s' funky\n", arg);
                mr->range[0].min.tcp.port = htons(port);
                mr->range[0].max.tcp.port = htons(maxport);
@@ -94,11 +94,11 @@ static int REDIRECT_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (!portok)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Need TCP, UDP, SCTP or DCCP with port specification");
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-ports");
 
                parse_ports(optarg, mr);
index db94306e19fbaab9676f106a4bd06634b53071d3..98d8dcbade84c4e5d3af6edb7b3b45e1d298ff23 100644 (file)
@@ -100,7 +100,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
        switch(c) {
        case '1':
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --reject-with");
                for (i = 0; i < limit; i++) {
                        if ((strncasecmp(reject_table[i].name, optarg, strlen(optarg)) == 0)
@@ -114,7 +114,7 @@ static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
                    || strncasecmp("echoreply", optarg, strlen(optarg)) == 0)
                        fprintf(stderr, "--reject-with echo-reply no longer"
                                " supported\n");
-               exit_error(PARAMETER_PROBLEM, "unknown reject type `%s'",optarg);
+               xtables_error(PARAMETER_PROBLEM, "unknown reject type \"%s\"", optarg);
        default:
                /* Fall through */
                break;
index 007ebc35849e1375743bfeda845b1a5103984d80..444a5208b590cd962115b46a8f855a0a5cb2b711 100644 (file)
@@ -58,20 +58,20 @@ parse_to(char *arg, struct ip_nat_range *range)
 
        ip = xtables_numeric_to_ipaddr(arg);
        if (!ip)
-               exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n",
+               xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n",
                           arg);
        range->min_ip = ip->s_addr;
 
        if (dash) {
                ip = xtables_numeric_to_ipaddr(dash+1);
                if (!ip)
-                       exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n",
+                       xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n",
                                   dash+1);
        }
        range->max_ip = ip->s_addr;
        if (dash)
                if (range->min_ip > range->max_ip)
-                       exit_error(PARAMETER_PROBLEM, "Bad IP range `%s-%s'\n", 
+                       xtables_error(PARAMETER_PROBLEM, "Bad IP range \"%s-%s\"\n",
                                   arg, dash+1);
 }
 
@@ -89,12 +89,12 @@ static int SAME_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (mr->rangesize == IPT_SAME_MAX_RANGE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Too many ranges specified, maximum "
                                   "is %i ranges.\n",
                                   IPT_SAME_MAX_RANGE);
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to");
 
                parse_to(optarg, &mr->range[mr->rangesize]);
@@ -108,7 +108,7 @@ static int SAME_parse(int c, char **argv, int invert, unsigned int *flags,
                
        case '2':
                if (*flags & IPT_SAME_OPT_NODST)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --nodst twice");
                
                mr->info |= IPT_SAME_NODST;
@@ -131,7 +131,7 @@ static int SAME_parse(int c, char **argv, int invert, unsigned int *flags,
 static void SAME_check(unsigned int flags)
 {
        if (!(flags & IPT_SAME_OPT_TO))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "SAME needs --to");
 }
 
index 45967be2c3a739a90b3083a4b65aa7c55c02d014..e9bdab481a0d141b2f21e25fc3143f93531d5ce4 100644 (file)
@@ -54,20 +54,20 @@ parse_target(char **argv, int invert, unsigned int *flags,
              struct ipt_set_info *info, const char *what)
 {
        if (info->flags[0])
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "--%s can be specified only once", what);
 
        if (xtables_check_inverse(optarg, &invert, NULL, 0))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Unexpected `!' after --%s", what);
 
        if (!argv[optind]
            || argv[optind][0] == '-' || argv[optind][0] == '!')
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "--%s requires two args.", what);
 
        if (strlen(argv[optind-1]) > IP_SET_MAXNAMELEN - 1)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "setname `%s' too long, max %d characters.",
                           argv[optind-1], IP_SET_MAXNAMELEN - 1);
 
@@ -103,7 +103,7 @@ static int SET_parse(int c, char **argv, int invert, unsigned int *flags,
 static void SET_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "You must specify either `--add-set' or `--del-set'");
 }
 
index 96ef56e44653dd02d7b74f08f8befd97e942b89b..fda03ea49bfc2b709986fcdfb510758c686ad297 100644 (file)
@@ -45,7 +45,7 @@ append_range(struct ipt_natinfo *info, const struct ip_nat_range *range)
 
        info = realloc(info, size);
        if (!info)
-               exit_error(OTHER_PROBLEM, "Out of memory\n");
+               xtables_error(OTHER_PROBLEM, "Out of memory\n");
 
        info->t.u.target_size = size;
        info->mr.range[info->mr.rangesize] = *range;
@@ -69,19 +69,19 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info)
                int port;
 
                if (!portok)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Need TCP, UDP, SCTP or DCCP with port specification");
 
                range.flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
 
                port = atoi(colon+1);
                if (port <= 0 || port > 65535)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Port `%s' not valid\n", colon+1);
 
                error = strchr(colon+1, ':');
                if (error)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid port:port syntax - use dash\n");
 
                dash = strchr(colon, '-');
@@ -94,11 +94,11 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info)
 
                        maxport = atoi(dash + 1);
                        if (maxport <= 0 || maxport > 65535)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Port `%s' not valid\n", dash+1);
                        if (maxport < port)
                                /* People are stupid. */
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Port range `%s' funky\n", colon+1);
                        range.min.tcp.port = htons(port);
                        range.max.tcp.port = htons(maxport);
@@ -119,13 +119,13 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info)
 
        ip = xtables_numeric_to_ipaddr(arg);
        if (!ip)
-               exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n",
+               xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n",
                           arg);
        range.min_ip = ip->s_addr;
        if (dash) {
                ip = xtables_numeric_to_ipaddr(dash+1);
                if (!ip)
-                       exit_error(PARAMETER_PROBLEM, "Bad IP address `%s'\n",
+                       xtables_error(PARAMETER_PROBLEM, "Bad IP address \"%s\"\n",
                                   dash+1);
                range.max_ip = ip->s_addr;
        } else
@@ -153,14 +153,14 @@ static int SNAT_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --to-source");
 
                if (*flags & IPT_SNAT_OPT_SOURCE) {
                        if (!kernel_version)
                                get_kernel_version();
                        if (kernel_version > LINUX_VERSION(2, 6, 10))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Multiple --to-source not supported");
                }
                *target = parse_to(optarg, portok, info);
@@ -186,7 +186,7 @@ static int SNAT_parse(int c, char **argv, int invert, unsigned int *flags,
 static void SNAT_check(unsigned int flags)
 {
        if (!(flags & IPT_SNAT_OPT_SOURCE))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "You must specify --to-source");
 }
 
index 15d23ba2b7d9c6db61c7cfc7bcf4ff370647100a..2501877791127c809a550f5fa34d1202c7dd36c4 100644 (file)
@@ -32,20 +32,20 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags,
        unsigned int value;
 
        if (*flags & IPT_TTL_USED) {
-               exit_error(PARAMETER_PROBLEM, 
+               xtables_error(PARAMETER_PROBLEM,
                                "Can't specify TTL option twice");
        }
 
        if (!optarg) 
-               exit_error(PARAMETER_PROBLEM, 
+               xtables_error(PARAMETER_PROBLEM,
                                "TTL: You must specify a value");
 
        if (xtables_check_inverse(optarg, &invert, NULL, 0))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                                "TTL: unexpected `!'");
        
        if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "TTL: Expected value between 0 and 255");
 
        switch (c) {
@@ -56,7 +56,7 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags,
 
                case '2':
                        if (value == 0) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "TTL: decreasing by 0?");
                        }
 
@@ -65,7 +65,7 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags,
 
                case '3':
                        if (value == 0) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "TTL: increasing by 0?");
                        }
 
@@ -86,7 +86,7 @@ static int TTL_parse(int c, char **argv, int invert, unsigned int *flags,
 static void TTL_check(unsigned int flags)
 {
        if (!(flags & IPT_TTL_USED))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                                "TTL: You must specify an action");
 }
 
index 89d09409e72cd067783fb9d024bbeacf01da19b7..9633a87b6e51415ee8f20ce55c786497eb87789d 100644 (file)
@@ -74,15 +74,15 @@ static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '!':
                if (*flags & IPT_LOG_OPT_NLGROUP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --ulog-nlgroup twice");
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --ulog-nlgroup");
                group_d = atoi(optarg);
                if (group_d > 32 || group_d < 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "--ulog-nlgroup has to be between 1 and 32");
 
                loginfo->nl_group = (1 << (group_d - 1));
@@ -92,24 +92,24 @@ static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '#':
                if (*flags & IPT_LOG_OPT_PREFIX)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --ulog-prefix twice");
 
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --ulog-prefix");
 
                if (strlen(optarg) > sizeof(loginfo->prefix) - 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Maximum prefix length %u for --ulog-prefix",
                                   (unsigned int)sizeof(loginfo->prefix) - 1);
 
                if (strlen(optarg) == 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "No prefix specified for --ulog-prefix");
 
                if (strlen(optarg) != strlen(strtok(optarg, "\n")))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Newlines not allowed in --ulog-prefix");
 
                strcpy(loginfo->prefix, optarg);
@@ -117,23 +117,23 @@ static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case 'A':
                if (*flags & IPT_LOG_OPT_CPRANGE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --ulog-cprange twice");
                if (atoi(optarg) < 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Negative copy range?");
                loginfo->copy_range = atoi(optarg);
                *flags |= IPT_LOG_OPT_CPRANGE;
                break;
        case 'B':
                if (*flags & IPT_LOG_OPT_QTHRESHOLD)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --ulog-qthreshold twice");
                if (atoi(optarg) < 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Negative or zero queue threshold ?");
                if (atoi(optarg) > ULOG_MAX_QLEN)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Maximum queue length exceeded");
                loginfo->qthreshold = atoi(optarg);
                *flags |= IPT_LOG_OPT_QTHRESHOLD;
index 446cf0f39b711ff83a7aaa577d63f46b85be627b..22b35d48553be0c55a9f23f334f36d024ca9b6b4 100644 (file)
@@ -81,13 +81,13 @@ static void parse_types(const char *arg, u_int16_t *mask)
 
        while ((comma = strchr(arg, ',')) != NULL) {
                if (comma == arg || !parse_type(arg, comma-arg, mask))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "addrtype: bad type `%s'", arg);
                arg = comma + 1;
        }
 
        if (strlen(arg) == 0 || !parse_type(arg, strlen(arg), mask))
-               exit_error(PARAMETER_PROBLEM, "addrtype: bad type `%s'", arg);
+               xtables_error(PARAMETER_PROBLEM, "addrtype: bad type \"%s\"", arg);
 }
        
 #define IPT_ADDRTYPE_OPT_SRCTYPE       0x1
@@ -105,7 +105,7 @@ addrtype_parse_v0(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags&IPT_ADDRTYPE_OPT_SRCTYPE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify src-type twice");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_types(argv[optind-1], &info->source);
@@ -115,7 +115,7 @@ addrtype_parse_v0(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '2':
                if (*flags&IPT_ADDRTYPE_OPT_DSTTYPE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify dst-type twice");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_types(argv[optind-1], &info->dest);
@@ -140,7 +140,7 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & IPT_ADDRTYPE_OPT_SRCTYPE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify src-type twice");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_types(argv[optind-1], &info->source);
@@ -150,7 +150,7 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '2':
                if (*flags & IPT_ADDRTYPE_OPT_DSTTYPE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify dst-type twice");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_types(argv[optind-1], &info->dest);
@@ -160,14 +160,14 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '3':
                if (*flags & IPT_ADDRTYPE_OPT_LIMIT_IFACE_IN)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify limit-iface-in twice");
                info->flags |= IPT_ADDRTYPE_LIMIT_IFACE_IN;
                *flags |= IPT_ADDRTYPE_OPT_LIMIT_IFACE_IN;
                break;
        case '4':
                if (*flags & IPT_ADDRTYPE_OPT_LIMIT_IFACE_OUT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "addrtype: can't specify limit-iface-out twice");
                info->flags |= IPT_ADDRTYPE_LIMIT_IFACE_OUT;
                *flags |= IPT_ADDRTYPE_OPT_LIMIT_IFACE_OUT;
@@ -182,18 +182,18 @@ addrtype_parse_v1(int c, char **argv, int invert, unsigned int *flags,
 static void addrtype_check_v0(unsigned int flags)
 {
        if (!(flags & (IPT_ADDRTYPE_OPT_SRCTYPE|IPT_ADDRTYPE_OPT_DSTTYPE)))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "addrtype: you must specify --src-type or --dst-type");
 }
 
 static void addrtype_check_v1(unsigned int flags)
 {
        if (!(flags & (IPT_ADDRTYPE_OPT_SRCTYPE|IPT_ADDRTYPE_OPT_DSTTYPE)))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "addrtype: you must specify --src-type or --dst-type");
        if (flags & IPT_ADDRTYPE_OPT_LIMIT_IFACE_IN &&
            flags & IPT_ADDRTYPE_OPT_LIMIT_IFACE_OUT)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "addrtype: you can't specify both --limit-iface-in "
                           "and --limit-iface-out");
 }
index 31977dd681e79711b971b75e3f463b5e5a3a2590..d049b4232159a0fb6c732bb25d2ac43af3ab8778 100644 (file)
@@ -30,15 +30,15 @@ parse_ah_spi(const char *spistr)
        spi =  strtoul(spistr,&ep,0) ;
 
        if ( spistr == ep ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "AH no valid digits in spi `%s'", spistr);
        }
        if ( spi == ULONG_MAX  && errno == ERANGE ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "spi `%s' specified too big: would overflow", spistr);
        }       
        if ( *spistr != '\0'  && *ep != '\0' ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "AH error parsing spi `%s'", spistr);
        }
        return spi;
@@ -80,7 +80,7 @@ static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & AH_SPI)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--ahspi' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_ah_spis(argv[optind-1], ahinfo->spis);
index 3b9da71a5a6d2d18b6c016fa4d6f46dd90e3dc84..0f8849df0ae1619f7d0a6b222c99210c5d086068 100644 (file)
@@ -42,7 +42,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case 'F':
                if (*flags & IPT_ECN_OP_MATCH_CWR)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "ECN match: can only use parameter ONCE!");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                einfo->operation |= IPT_ECN_OP_MATCH_CWR;
@@ -53,7 +53,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case 'G':
                if (*flags & IPT_ECN_OP_MATCH_ECE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "ECN match: can only use parameter ONCE!");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                einfo->operation |= IPT_ECN_OP_MATCH_ECE;
@@ -64,7 +64,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case 'H':
                if (*flags & IPT_ECN_OP_MATCH_IP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "ECN match: can only use parameter ONCE!");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
@@ -72,7 +72,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
                *flags |= IPT_ECN_OP_MATCH_IP;
                einfo->operation |= IPT_ECN_OP_MATCH_IP;
                if (!xtables_strtoui(optarg, NULL, &result, 0, 3))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "ECN match: Value out of range");
                einfo->ip_ect = result;
                break;
@@ -86,7 +86,7 @@ static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
 static void ecn_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "ECN match: some option required");
 }
 
index 0fd132be364d8a58ca85c20c0e599b09fe3fd4dc..7dac0b72b74ede9d5ea9d0c817a3e4f99eda58f2 100644 (file)
@@ -122,7 +122,7 @@ parse_icmp(const char *icmptype, u_int8_t *type, u_int8_t code[])
                if (strncasecmp(icmp_codes[i].name, icmptype, strlen(icmptype))
                    == 0) {
                        if (match != limit)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Ambiguous ICMP type `%s':"
                                           " `%s' or `%s'?",
                                           icmptype,
@@ -148,12 +148,12 @@ parse_icmp(const char *icmptype, u_int8_t *type, u_int8_t code[])
                        *slash = '\0';
 
                if (!xtables_strtoui(buffer, NULL, &number, 0, UINT8_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid ICMP type `%s'\n", buffer);
                *type = number;
                if (slash) {
                        if (!xtables_strtoui(slash+1, NULL, &number, 0, UINT8_MAX))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Invalid ICMP code `%s'\n",
                                           slash+1);
                        code[0] = code[1] = number;
@@ -180,7 +180,7 @@ static int icmp_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags == 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "icmp match: only use --icmp-type once!");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_icmp(argv[optind-1], &icmpinfo->type, 
index a538927f99707046bde4975965288f60a9ffeeb2..964c19a404552dd2377c7ace3ef1cff5ad639a29 100644 (file)
@@ -98,7 +98,7 @@ static int parse_direction(char *s)
                return IPT_POLICY_MATCH_IN;
        if (strcmp(s, "out") == 0)
                return IPT_POLICY_MATCH_OUT;
-       exit_error(PARAMETER_PROBLEM, "policy_match: invalid dir `%s'", s);
+       xtables_error(PARAMETER_PROBLEM, "policy_match: invalid dir \"%s\"", s);
 }
 
 static int parse_policy(char *s)
@@ -107,7 +107,7 @@ static int parse_policy(char *s)
                return IPT_POLICY_MATCH_NONE;
        if (strcmp(s, "ipsec") == 0)
                return 0;
-       exit_error(PARAMETER_PROBLEM, "policy match: invalid policy `%s'", s);
+       xtables_error(PARAMETER_PROBLEM, "policy match: invalid policy \"%s\"", s);
 }
 
 static int parse_mode(char *s)
@@ -116,7 +116,7 @@ static int parse_mode(char *s)
                return IPT_POLICY_MODE_TRANSPORT;
        if (strcmp(s, "tunnel") == 0)
                return IPT_POLICY_MODE_TUNNEL;
-       exit_error(PARAMETER_PROBLEM, "policy match: invalid mode `%s'", s);
+       xtables_error(PARAMETER_PROBLEM, "policy match: invalid mode \"%s\"", s);
 }
 
 static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
@@ -133,35 +133,35 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (info->flags & (IPT_POLICY_MATCH_IN|IPT_POLICY_MATCH_OUT))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --dir option");
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: can't invert --dir option");
 
                info->flags |= parse_direction(argv[optind-1]);
                break;
        case '2':
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: can't invert --policy option");
 
                info->flags |= parse_policy(argv[optind-1]);
                break;
        case '3':
                if (info->flags & IPT_POLICY_MATCH_STRICT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --strict option");
 
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: can't invert --strict option");
 
                info->flags |= IPT_POLICY_MATCH_STRICT;
                break;
        case '4':
                if (e->match.reqid)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --reqid option");
 
                e->match.reqid = 1;
@@ -170,7 +170,7 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '5':
                if (e->match.spi)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --spi option");
 
                e->match.spi = 1;
@@ -179,12 +179,12 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '6':
                if (e->match.saddr)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --tunnel-src option");
 
                xtables_ipparse_any(argv[optind-1], &addr, &mask, &naddr);
                if (naddr > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: name resolves to multiple IPs");
 
                e->match.saddr = 1;
@@ -194,12 +194,12 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                 break;
        case '7':
                if (e->match.daddr)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --tunnel-dst option");
 
                xtables_ipparse_any(argv[optind-1], &addr, &mask, &naddr);
                if (naddr > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: name resolves to multiple IPs");
 
                e->match.daddr = 1;
@@ -209,20 +209,20 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case '8':
                if (e->match.proto)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --proto option");
 
                e->proto = xtables_parse_protocol(argv[optind-1]);
                if (e->proto != IPPROTO_AH && e->proto != IPPROTO_ESP &&
                    e->proto != IPPROTO_COMP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: protocol must ah/esp/ipcomp");
                e->match.proto = 1;
                e->invert.proto = invert;
                break;
        case '9':
                if (e->match.mode)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: double --mode option");
 
                mode = parse_mode(argv[optind-1]);
@@ -232,11 +232,11 @@ static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case 'a':
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: can't invert --next option");
 
                if (++info->len == IPT_POLICY_MAX_ELEM)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: maximum policy depth reached");
                break;
        default:
@@ -254,26 +254,26 @@ static void policy_check(unsigned int flags)
        int i;
 
        if (info == NULL)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "policy match: no parameters given");
 
        if (!(info->flags & (IPT_POLICY_MATCH_IN|IPT_POLICY_MATCH_OUT)))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "policy match: neither --in nor --out specified");
 
        if (info->flags & IPT_POLICY_MATCH_NONE) {
                if (info->flags & IPT_POLICY_MATCH_STRICT)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: policy none but --strict given");
 
                if (info->len != 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: policy none but policy given");
        } else
                info->len++;    /* increase len by 1, no --next after last element */
 
        if (!(info->flags & IPT_POLICY_MATCH_STRICT) && info->len > 1)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "policy match: multiple elements but no --strict");
 
        for (i = 0; i < info->len; i++) {
@@ -282,13 +282,13 @@ static void policy_check(unsigned int flags)
                if (info->flags & IPT_POLICY_MATCH_STRICT &&
                    !(e->match.reqid || e->match.spi || e->match.saddr ||
                      e->match.daddr || e->match.proto || e->match.mode))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: empty policy element");
 
                if ((e->match.saddr || e->match.daddr)
                    && ((e->mode == IPT_POLICY_MODE_TUNNEL && e->invert.mode) ||
                        (e->mode == IPT_POLICY_MODE_TRANSPORT && !e->invert.mode)))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "policy match: --tunnel-src/--tunnel-dst "
                                   "is only valid in tunnel mode");
        }
index e602dad1f1e2a5a2be56c75b17d5a0d3299e555d..3dd63d3eb33f0f0e4e236788824fb7d607d4a04b 100644 (file)
@@ -166,12 +166,12 @@ static int realm_parse(int c, char **argv, int invert, unsigned int *flags,
                        else
                                realminfo->mask = 0xffffffff;
                        if (*end != '\0' || end == optarg)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Bad realm value `%s'", optarg);
                } else {
                        id = realm_name2id(optarg);
                        if (id == -1)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Realm `%s' not found", optarg);
                        realminfo->id = id;
                        realminfo->mask = 0xffffffff;
@@ -230,7 +230,7 @@ static void realm_save(const void *ip, const struct xt_entry_match *match)
 static void realm_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "realm match: You must specify `--realm'");
 }
 
index 5b9e1fdc4e3cb88b2b395e759eed1cf796ab5a30..845b2b0e64ddae07b6d4192a05bbb74e4cfce08c 100644 (file)
@@ -55,7 +55,7 @@ static int set_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':               /* --set <set> <flag>[,<flag> */
                if (info->flags[0])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "--set can be specified only once");
 
                xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -65,11 +65,11 @@ static int set_parse(int c, char **argv, int invert, unsigned int *flags,
                if (!argv[optind]
                    || argv[optind][0] == '-'
                    || argv[optind][0] == '!')
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "--set requires two args.");
 
                if (strlen(argv[optind-1]) > IP_SET_MAXNAMELEN - 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "setname `%s' too long, max %d characters.",
                                   argv[optind-1], IP_SET_MAXNAMELEN - 1);
 
@@ -91,7 +91,7 @@ static int set_parse(int c, char **argv, int invert, unsigned int *flags,
 static void set_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "You must specify `--set' with proper arguments");
        DEBUGP("final check OK\n");
 }
index 3e70d7be98dcea5fd4bba8cce24e9b8f64c2d3be..f521e05f612b6669aeb7d3e5b97ac55f5cbe72b2 100644 (file)
@@ -25,12 +25,12 @@ parse_bindings(const char *opt_arg, struct ipt_set_info *info)
                else if (strncmp(ptr, "dst", 3) == 0)
                        info->flags[i++] |= IPSET_DST;
                else
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "You must spefify (the comma separated list of) 'src' or 'dst'.");
        }
 
        if (tmp)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Can't follow bindings deeper than %i.", 
                           IP_SET_MAX_BINDINGS - 1);
 
@@ -42,7 +42,7 @@ static int get_set_getsockopt(void *data, socklen_t * size)
        int sockfd = -1;
        sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
        if (sockfd < 0)
-               exit_error(OTHER_PROBLEM,
+               xtables_error(OTHER_PROBLEM,
                           "Can't open socket to ipset.\n");
        /* Send! */
        return getsockopt(sockfd, SOL_IP, SO_IP_SET, data, size);
@@ -60,16 +60,16 @@ static void get_set_byname(const char *setname, struct ipt_set_info *info)
        req.set.name[IP_SET_MAXNAMELEN - 1] = '\0';
        res = get_set_getsockopt(&req, &size);
        if (res != 0)
-               exit_error(OTHER_PROBLEM,
+               xtables_error(OTHER_PROBLEM,
                           "Problem when communicating with ipset, errno=%d.\n",
                           errno);
        if (size != sizeof(struct ip_set_req_get_set))
-               exit_error(OTHER_PROBLEM,
+               xtables_error(OTHER_PROBLEM,
                           "Incorrect return size from kernel during ipset lookup, "
                           "(want %zu, got %zu)\n",
                           sizeof(struct ip_set_req_get_set), (size_t)size);
        if (req.set.index == IP_SET_INVALID_ID)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Set %s doesn't exist.\n", setname);
 
        info->index = req.set.index;
@@ -86,16 +86,16 @@ static void get_set_byid(char * setname, ip_set_id_t idx)
        req.set.index = idx;
        res = get_set_getsockopt(&req, &size);
        if (res != 0)
-               exit_error(OTHER_PROBLEM,
+               xtables_error(OTHER_PROBLEM,
                           "Problem when communicating with ipset, errno=%d.\n",
                           errno);
        if (size != sizeof(struct ip_set_req_get_set))
-               exit_error(OTHER_PROBLEM,
+               xtables_error(OTHER_PROBLEM,
                           "Incorrect return size from kernel during ipset lookup, "
                           "(want %zu, got %zu)\n",
                           sizeof(struct ip_set_req_get_set), (size_t)size);
        if (req.set.name[0] == '\0')
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Set id %i in kernel doesn't exist.\n", idx);
 
        strncpy(setname, req.set.name, IP_SET_MAXNAMELEN);
index 3387e9247862749bfa6ea08ba10c8e690c4282b9..67f0b1ad9a79cf6b6e53e8e2540661f8166f72ec 100644 (file)
@@ -34,7 +34,7 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
                case '2':
                        if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "ttl: Expected value between 0 and 255");
 
                        if (invert)
@@ -47,11 +47,11 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags,
                        break;
                case '3':
                        if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "ttl: Expected value between 0 and 255");
 
                        if (invert) 
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                                "ttl: unexpected `!'");
 
                        info->mode = IPT_TTL_LT;
@@ -59,11 +59,11 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags,
                        break;
                case '4':
                        if (!xtables_strtoui(optarg, NULL, &value, 0, UINT8_MAX))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "ttl: Expected value between 0 and 255");
 
                        if (invert)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                                "ttl: unexpected `!'");
 
                        info->mode = IPT_TTL_GT;
@@ -75,7 +75,7 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags,
        }
 
        if (*flags) 
-               exit_error(PARAMETER_PROBLEM, 
+               xtables_error(PARAMETER_PROBLEM,
                                "Can't specify TTL option twice");
        *flags = 1;
 
@@ -85,7 +85,7 @@ static int ttl_parse(int c, char **argv, int invert, unsigned int *flags,
 static void ttl_check(unsigned int flags)
 {
        if (!flags) 
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                        "TTL match: You must specify one of "
                        "`--ttl-eq', `--ttl-lt', `--ttl-gt");
 }
index 113f680740d6c27cd7775148efb2dd3c405e29db..119922d0e43032eba6655370057fa1bc712faf37 100644 (file)
@@ -45,10 +45,10 @@ CLASSIFY_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (CLASSIFY_string_to_priority(optarg, &clinfo->priority))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Bad class value `%s'", optarg);
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "CLASSIFY: Can't specify --set-class twice");
                *flags = 1;
                break;
@@ -64,7 +64,7 @@ static void
 CLASSIFY_final_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "CLASSIFY: Parameter --set-class is required");
 }
 
index e426e4f1fa2d12ae6afdd034dcbd42c49d00436c..6e42898f9cad4b3eaee67a900ad330ef8181490a 100644 (file)
@@ -111,34 +111,34 @@ CONNMARK_parse(int c, char **argv, int invert, unsigned int *flags,
                    markinfo->mask = strtoul(end+1, &end, 0);
 
                if (*end != '\0' || end == optarg)
-                       exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg);
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "CONNMARK target: Can't specify --set-mark twice");
                *flags = 1;
                break;
        case '2':
                markinfo->mode = XT_CONNMARK_SAVE;
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "CONNMARK target: Can't specify --save-mark twice");
                *flags = 1;
                break;
        case '3':
                markinfo->mode = XT_CONNMARK_RESTORE;
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "CONNMARK target: Can't specify --restore-mark twice");
                *flags = 1;
                break;
        case '4':
                if (!*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "CONNMARK target: Can't specify --mask without a operation");
                markinfo->mask = strtoul(optarg, &end, 0);
 
                if (*end != '\0' || end == optarg)
-                       exit_error(PARAMETER_PROBLEM, "Bad MASK value `%s'", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad MASK value \"%s\"", optarg);
                break;
        default:
                return 0;
@@ -218,7 +218,7 @@ static int connmark_tg_parse(int c, char **argv, int invert,
 
        case 'n': /* --nfmask */
                if (!(*flags & F_SR_MARK))
-                       exit_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark "
+                       xtables_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark "
                                   "or --restore-mark is required for "
                                   "--nfmask");
                if (!xtables_strtoui(optarg, NULL, &value, 0, UINT32_MAX))
@@ -228,7 +228,7 @@ static int connmark_tg_parse(int c, char **argv, int invert,
 
        case 'c': /* --ctmask */
                if (!(*flags & F_SR_MARK))
-                       exit_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark "
+                       xtables_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark "
                                   "or --restore-mark is required for "
                                   "--ctmask");
                if (!xtables_strtoui(optarg, NULL, &value, 0, UINT32_MAX))
@@ -238,7 +238,7 @@ static int connmark_tg_parse(int c, char **argv, int invert,
 
        case 'm': /* --mask */
                if (!(*flags & F_SR_MARK))
-                       exit_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark "
+                       xtables_error(PARAMETER_PROBLEM, "CONNMARK: --save-mark "
                                   "or --restore-mark is required for "
                                   "--mask");
                if (!xtables_strtoui(optarg, NULL, &value, 0, UINT32_MAX))
@@ -253,7 +253,7 @@ static int connmark_tg_parse(int c, char **argv, int invert,
 static void connmark_tg_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "CONNMARK target: No operation specified");
 }
 
index 05dbf70df53acd5498a30262d43837e8de08e9e5..1515f6f0e131c0b77db9a8a48d63e9ecccd67d5b 100644 (file)
@@ -38,7 +38,7 @@ CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & CONNSECMARK_SAVE)
-                       exit_error(PARAMETER_PROBLEM, PFX
+                       xtables_error(PARAMETER_PROBLEM, PFX
                                   "Can't specify --save twice");
                info->mode = CONNSECMARK_SAVE;
                *flags |= CONNSECMARK_SAVE;
@@ -46,7 +46,7 @@ CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags & CONNSECMARK_RESTORE)
-                       exit_error(PARAMETER_PROBLEM, PFX
+                       xtables_error(PARAMETER_PROBLEM, PFX
                                   "Can't specify --restore twice");
                info->mode = CONNSECMARK_RESTORE;
                *flags |= CONNSECMARK_RESTORE;
@@ -62,10 +62,10 @@ CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
 static void CONNSECMARK_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM, PFX "parameter required");
+               xtables_error(PARAMETER_PROBLEM, PFX "parameter required");
 
        if (flags == (CONNSECMARK_SAVE|CONNSECMARK_RESTORE))
-               exit_error(PARAMETER_PROBLEM, PFX "only one flag of --save "
+               xtables_error(PARAMETER_PROBLEM, PFX "only one flag of --save "
                           "or --restore is allowed");
 }
 
@@ -81,7 +81,7 @@ static void print_connsecmark(struct xt_connsecmark_target_info *info)
                break;
                
        default:
-               exit_error(OTHER_PROBLEM, PFX "invalid mode %hhu\n", info->mode);
+               xtables_error(OTHER_PROBLEM, PFX "invalid mode %hhu\n", info->mode);
        }
 }
 
index aac8f9b002e3dcb79ea81245f1713f6d0b95841a..ddb9c9973bcb5337f6d7c288d84c5696a469f2d4 100644 (file)
@@ -49,11 +49,11 @@ parse_dscp(const char *s, struct xt_DSCP_info *dinfo)
        unsigned int dscp;
        
        if (!xtables_strtoui(s, NULL, &dscp, 0, UINT8_MAX))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid dscp `%s'\n", s);
 
        if (dscp > XT_DSCP_MAX)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "DSCP `%d` out of range\n", dscp);
 
        dinfo->dscp = dscp;
@@ -79,14 +79,14 @@ static int DSCP_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case 'F':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "DSCP target: Only use --set-dscp ONCE!");
                parse_dscp(optarg, dinfo);
                *flags = 1;
                break;
        case 'G':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "DSCP target: Only use --set-dscp-class ONCE!");
                parse_class(optarg, dinfo);
                *flags = 1;
@@ -102,7 +102,7 @@ static int DSCP_parse(int c, char **argv, int invert, unsigned int *flags,
 static void DSCP_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "DSCP target: Parameter --set-dscp is required");
 }
 
index 8f04e8e7f332aba6762186b33b3c87ad56e1e765..ec2fe96aeb46260b8be59ce838cabc11f22dd4ca 100644 (file)
@@ -63,18 +63,18 @@ MARK_parse_v0(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (!xtables_strtoui(optarg, NULL, &mark, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg);
                markinfo->mark = mark;
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "MARK target: Can't specify --set-mark twice");
                *flags = 1;
                break;
        case '2':
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "MARK target: kernel too old for --and-mark");
        case '3':
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "MARK target: kernel too old for --or-mark");
        default:
                return 0;
@@ -86,7 +86,7 @@ MARK_parse_v0(int c, char **argv, int invert, unsigned int *flags,
 static void MARK_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "MARK target: Parameter --set/and/or-mark"
                           " is required");
 }
@@ -114,10 +114,10 @@ MARK_parse_v1(int c, char **argv, int invert, unsigned int *flags,
        }
 
        if (!xtables_strtoui(optarg, NULL, &mark, 0, UINT32_MAX))
-               exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
+               xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg);
        markinfo->mark = mark;
        if (*flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "MARK target: Can't specify --set-mark twice");
 
        *flags = 1;
@@ -188,7 +188,7 @@ static int mark_tg_parse(int c, char **argv, int invert, unsigned int *flags,
 static void mark_tg_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM, "MARK: One of the --set-xmark, "
+               xtables_error(PARAMETER_PROBLEM, "MARK: One of the --set-xmark, "
                           "--{and,or,xor,set}-mark options is required");
 }
 
index 6d8c9dc63dfb0777f3f4b904c0bd71c90d87c140..007c7b4e2133ff9c613ffc7a1bf9182d99be6c19 100644 (file)
@@ -49,56 +49,56 @@ static int NFLOG_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case NFLOG_GROUP:
                if (*flags & NFLOG_GROUP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --nflog-group twice");
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --nflog-group");
 
                n = atoi(optarg);
                if (n < 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "--nflog-group can not be negative");
                info->group = n;
                break;
        case NFLOG_PREFIX:
                if (*flags & NFLOG_PREFIX)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --nflog-prefix twice");
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --nflog-prefix");
 
                length = strlen(optarg);
                if (length == 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "No prefix specified for --nflog-prefix");
                if (length >= sizeof(info->prefix))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "--nflog-prefix too long, max %Zu characters",
                                   sizeof(info->prefix) - 1);
                if (length != strlen(strtok(optarg, "\n")))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Newlines are not allowed in --nflog-prefix");
                strcpy(info->prefix, optarg);
                break;
        case NFLOG_RANGE:
                if (*flags & NFLOG_RANGE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --nflog-range twice");
                n = atoi(optarg);
                if (n < 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid --nflog-range, must be >= 0");
                info->len = n;
                break;
        case NFLOG_THRESHOLD:
                if (*flags & NFLOG_THRESHOLD)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify --nflog-threshold twice");
                n = atoi(optarg);
                if (n < 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid --nflog-threshold, must be >= 1");
                info->threshold = n;
                break;
index 1c0c23d87d6526642ff1a1a7fad2dc007c59b1bd..3ca2239fb1f3fc269344a07275150cdd4db43335 100644 (file)
@@ -34,7 +34,7 @@ parse_num(const char *s, struct xt_NFQ_info *tinfo)
        unsigned int num;
        
        if (!xtables_strtoui(s, NULL, &num, 0, UINT16_MAX))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid queue number `%s'\n", s);
 
        tinfo->queuenum = num & 0xffff;
@@ -50,7 +50,7 @@ NFQUEUE_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case 'F':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM, "NFQUEUE target: "
+                       xtables_error(PARAMETER_PROBLEM, "NFQUEUE target: "
                                   "Only use --queue-num ONCE!");
                parse_num(optarg, tinfo);
                break;
index cf1284f054e1d7bc9d51b610c3acbac5bf328473..d4fd6dd03f41f62cda0f6d7d965845f9a17a9be1 100644 (file)
@@ -99,7 +99,7 @@ RATEEST_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case RATEEST_OPT_NAME:
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "RATEEST: can't specify --rateest-name twice");
                *flags |= 1 << c;
 
@@ -108,24 +108,24 @@ RATEEST_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case RATEEST_OPT_INTERVAL:
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "RATEEST: can't specify --rateest-interval twice");
                *flags |= 1 << c;
 
                if (RATEEST_get_time(&interval, optarg) < 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "RATEEST: bad interval value `%s'", optarg);
 
                break;
 
        case RATEEST_OPT_EWMALOG:
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "RATEEST: can't specify --rateest-ewmalog twice");
                *flags |= 1 << c;
 
                if (RATEEST_get_time(&ewma_log, optarg) < 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "RATEEST: bad ewmalog value `%s'", optarg);
 
                break;
@@ -143,11 +143,11 @@ RATEEST_final_check(unsigned int flags)
        struct xt_rateest_target_info *info = RATEEST_info;
 
        if (!(flags & (1 << RATEEST_OPT_NAME)))
-               exit_error(PARAMETER_PROBLEM, "RATEEST: no name specified");
+               xtables_error(PARAMETER_PROBLEM, "RATEEST: no name specified");
        if (!(flags & (1 << RATEEST_OPT_INTERVAL)))
-               exit_error(PARAMETER_PROBLEM, "RATEEST: no interval specified");
+               xtables_error(PARAMETER_PROBLEM, "RATEEST: no interval specified");
        if (!(flags & (1 << RATEEST_OPT_EWMALOG)))
-               exit_error(PARAMETER_PROBLEM, "RATEEST: no ewmalog specified");
+               xtables_error(PARAMETER_PROBLEM, "RATEEST: no ewmalog specified");
 
        for (info->interval = 0; info->interval <= 5; info->interval++) {
                if (interval <= (1 << info->interval) * (TIME_UNITS_PER_SEC / 4))
@@ -155,7 +155,7 @@ RATEEST_final_check(unsigned int flags)
        }
 
        if (info->interval > 5)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "RATEEST: interval value is too large");
        info->interval -= 2;
 
@@ -167,7 +167,7 @@ RATEEST_final_check(unsigned int flags)
        info->ewma_log--;
 
        if (info->ewma_log == 0 || info->ewma_log >= 31)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "RATEEST: ewmalog value is out of range");
 }
 
index c62fb44f5be6ed02a60e11b5351ab55c24c63e83..9db2327c885717c2291fc66104d628794105d77a 100644 (file)
@@ -35,12 +35,12 @@ static int SECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & SECMARK_MODE_SEL)
-                       exit_error(PARAMETER_PROBLEM, PFX
+                       xtables_error(PARAMETER_PROBLEM, PFX
                                   "Can't specify --selctx twice");
                info->mode = SECMARK_MODE_SEL;
 
                if (strlen(optarg) > SECMARK_SELCTX_MAX-1)
-                       exit_error(PARAMETER_PROBLEM, PFX
+                       xtables_error(PARAMETER_PROBLEM, PFX
                                   "Maximum length %u exceeded by --selctx"
                                   " parameter (%zu)",
                                   SECMARK_SELCTX_MAX-1, strlen(optarg));
@@ -58,7 +58,7 @@ static int SECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
 static void SECMARK_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM, PFX "parameter required");
+               xtables_error(PARAMETER_PROBLEM, PFX "parameter required");
 }
 
 static void print_secmark(struct xt_secmark_target_info *info)
@@ -69,7 +69,7 @@ static void print_secmark(struct xt_secmark_target_info *info)
                break;
        
        default:
-               exit_error(OTHER_PROBLEM, PFX "invalid mode %hhu\n", info->mode);
+               xtables_error(OTHER_PROBLEM, PFX "invalid mode %hhu\n", info->mode);
        }
 }
 
index 33fc71cd9703cc9790d5275cc41f2e64f4f2f9cb..ac9e2d0d054eced2169750cf5ff36e61d7c8a12d 100644 (file)
@@ -53,11 +53,11 @@ static int __TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '1':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "TCPMSS target: Only one option may be specified");
                if (!xtables_strtoui(optarg, NULL, &mssval,
                    0, UINT16_MAX - hdrsize))
-                       exit_error(PARAMETER_PROBLEM, "Bad TCPMSS value `%s'", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad TCPMSS value \"%s\"", optarg);
                
                mssinfo->mss = mssval;
                *flags = 1;
@@ -65,7 +65,7 @@ static int __TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "TCPMSS target: Only one option may be specified");
                mssinfo->mss = XT_TCPMSS_CLAMP_PMTU;
                *flags = 1;
@@ -93,7 +93,7 @@ static int TCPMSS_parse6(int c, char **argv, int invert, unsigned int *flags,
 static void TCPMSS_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "TCPMSS target: At least one parameter is required");
 }
 
index c053a8b158b0593c86ca64cc0858061a56f8d6dd..cf946fc7b2ea41b27947b5cee340b6580781e5b9 100644 (file)
@@ -84,15 +84,15 @@ static void parse_list(struct xt_tcpoptstrip_target_info *info, char *arg)
 
                if (option == 0 &&
                    !xtables_strtoui(arg, NULL, &option, 0, UINT8_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Bad TCP option value \"%s\"", arg);
 
                if (option < 2)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Option value may not be 0 or 1");
 
                if (tcpoptstrip_test_bit(info->strip_bmap, option))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Option \"%s\" already specified", arg);
 
                tcpoptstrip_set_bit(info->strip_bmap, option);
@@ -111,7 +111,7 @@ static int tcpoptstrip_tg_parse(int c, char **argv, int invert,
        switch (c) {
        case 's':
                if (*flags & FLAG_STRIP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "You can specify --strip-options only once");
                parse_list(info, optarg);
                *flags |= FLAG_STRIP;
@@ -124,7 +124,7 @@ static int tcpoptstrip_tg_parse(int c, char **argv, int invert,
 static void tcpoptstrip_tg_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "TCPOPTSTRIP: --strip-options parameter required");
 }
 
index 7b1f7f831c88bbd570e47faff5650096f6b260b4..c08f53bd7e7a97420d1590cc9c96e946a9d01047 100644 (file)
@@ -87,7 +87,7 @@ static int tos_tg_parse_v0(int c, char **argv, int invert, unsigned int *flags,
                if (!tos_parse_symbolic(optarg, &tvm, 0xFF))
                        xtables_param_act(XTF_BAD_VALUE, "TOS", "--set-tos", optarg);
                if (tvm.mask != 0xFF)
-                       exit_error(PARAMETER_PROBLEM, "tos match: Your kernel "
+                       xtables_error(PARAMETER_PROBLEM, "tos match: Your kernel "
                                   "is too old to support anything besides "
                                   "/0xFF as a mask.");
                info->tos = tvm.value;
@@ -153,7 +153,7 @@ static int tos_tg_parse(int c, char **argv, int invert, unsigned int *flags,
 static void tos_tg_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "TOS: The --set-tos parameter is required");
 }
 
index 54ae96d2f6a68f6cd40041ce34ab4291a0bceadc..d410c52b643ca344692ae0a8cab9404d83fbc71c 100644 (file)
@@ -105,7 +105,7 @@ static int tproxy_tg_parse(int c, char **argv, int invert, unsigned int *flags,
 static void tproxy_tg_check(unsigned int flags)
 {
        if (!(flags & PARAM_ONPORT))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "TPROXY target: Parameter --on-port is required");
 }
 
index 9bad125615c011761d5e6f1a582b4101dd6c75ff..0ff0144d29ec4bfa92072845f8778aa8ddd989a2 100644 (file)
@@ -32,7 +32,7 @@ parse_comment(const char *s, struct xt_comment_info *info)
        int slen = strlen(s);
 
        if (slen >= XT_MAX_COMMENT_LEN) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                        "COMMENT must be shorter than %i characters", XT_MAX_COMMENT_LEN);
        }
        strcpy((char *)info->comment, s);
@@ -48,7 +48,7 @@ comment_parse(int c, char **argv, int invert, unsigned int *flags,
        case '1':
                xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
                if (invert) {
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                        "Sorry, you can't have an inverted comment");
                }
                parse_comment(argv[optind-1], commentinfo);
@@ -64,7 +64,7 @@ comment_parse(int c, char **argv, int invert, unsigned int *flags,
 static void comment_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "COMMENT match: You must specify `--comment'");
 }
 
index 5fc0f2a6773b49502e3d49982255eeea126339b9..9f6af1cfbfe9824b92dfa4dfcdf1eaee52b1ff49 100644 (file)
@@ -31,14 +31,14 @@ parse_range(const char *arg, struct xt_connbytes_info *si)
 
        si->count.from = strtoul(arg,&colon,10);
        if (*colon != ':') 
-               exit_error(PARAMETER_PROBLEM, "Bad range `%s'", arg);
+               xtables_error(PARAMETER_PROBLEM, "Bad range \"%s\"", arg);
        si->count.to = strtoul(colon+1,&p,10);
        if (p == colon+1) {
                /* second number omited */
                si->count.to = 0xffffffff;
        }
        if (si->count.from > si->count.to)
-               exit_error(PARAMETER_PROBLEM, "%llu should be less than %llu",
+               xtables_error(PARAMETER_PROBLEM, "%llu should be less than %llu",
                           (unsigned long long)si->count.from,
                           (unsigned long long)si->count.to);
 }
@@ -71,7 +71,7 @@ connbytes_parse(int c, char **argv, int invert, unsigned int *flags,
                else if (!strcmp(optarg, "both"))
                        sinfo->direction = XT_CONNBYTES_DIR_BOTH;
                else
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unknown --connbytes-dir `%s'", optarg);
 
                *flags |= 2;
@@ -84,7 +84,7 @@ connbytes_parse(int c, char **argv, int invert, unsigned int *flags,
                else if (!strcmp(optarg, "avgpkt"))
                        sinfo->what = XT_CONNBYTES_AVGPKT;
                else
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unknown --connbytes-mode `%s'", optarg);
                *flags |= 4;
                break;
@@ -98,7 +98,7 @@ connbytes_parse(int c, char **argv, int invert, unsigned int *flags,
 static void connbytes_check(unsigned int flags)
 {
        if (flags != 7)
-               exit_error(PARAMETER_PROBLEM, "You must specify `--connbytes'"
+               xtables_error(PARAMETER_PROBLEM, "You must specify `--connbytes'"
                           "`--connbytes-dir' and `--connbytes-mode'");
 }
 
index f43eada10d37b33625455843248852abe73dcba8..f001a2e4947470366563bea79708ae8e1d401f82 100644 (file)
@@ -60,7 +60,7 @@ static int connlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case 'A':
                if (*flags & 0x1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "--connlimit-above may be given only once");
                *flags |= 0x1;
                xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -69,20 +69,20 @@ static int connlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                break;
        case 'M':
                if (*flags & 0x2)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "--connlimit-mask may be given only once");
 
                *flags |= 0x2;
                i = strtoul(argv[optind-1], &err, 0);
                if (family == NFPROTO_IPV6) {
                        if (i > 128 || *err != '\0')
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "--connlimit-mask must be between "
                                        "0 and 128");
                        prefix_to_netmask(info->v6_mask, i);
                } else {
                        if (i > 32 || *err != '\0')
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "--connlimit-mask must be between "
                                        "0 and 32");
                        if (i == 0)
@@ -117,7 +117,7 @@ static int connlimit_parse6(int c, char **argv, int invert,
 static void connlimit_check(unsigned int flags)
 {
        if (!(flags & 0x1))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                        "You must specify \"--connlimit-above\"");
 }
 
index d5ca4e0b8d66a2edaf99b888a23363c71825f8c0..2dca5a50a55298f033da54b11fe617b42f8eede8 100644 (file)
@@ -91,7 +91,7 @@ connmark_parse(int c, char **argv, int invert, unsigned int *flags,
                        markinfo->mask = strtoul(end+1, &end, 0);
 
                if (*end != '\0' || end == optarg)
-                       exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg);
                if (invert)
                        markinfo->invert = 1;
                *flags = 1;
@@ -114,7 +114,7 @@ static void print_mark(unsigned int mark, unsigned int mask)
 static void connmark_mt_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "connmark: The --mark option is required");
 }
 
index 45783f4d1bfd4cf0d572dbe8bccefc510a8b470d..a3fcafcc4ae6cdb59f04cc7c4f9bc110b0441390 100644 (file)
@@ -103,15 +103,15 @@ parse_states(const char *arg, struct xt_conntrack_info *sinfo)
 
        while ((comma = strchr(arg, ',')) != NULL) {
                if (comma == arg || !parse_state(arg, comma-arg, sinfo))
-                       exit_error(PARAMETER_PROBLEM, "Bad ctstate `%s'", arg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg);
                arg = comma+1;
        }
        if (!*arg)
-               exit_error(PARAMETER_PROBLEM, "`--ctstate' requires a list of "
+               xtables_error(PARAMETER_PROBLEM, "\"--ctstate\" requires a list of "
                                              "states with no spaces, e.g. "
                                              "ESTABLISHED,RELATED");
        if (strlen(arg) == 0 || !parse_state(arg, strlen(arg), sinfo))
-               exit_error(PARAMETER_PROBLEM, "Bad ctstate `%s'", arg);
+               xtables_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg);
 }
 
 static bool
@@ -144,13 +144,13 @@ conntrack_ps_states(struct xt_conntrack_mtinfo1 *info, const char *arg)
 
        while ((comma = strchr(arg, ',')) != NULL) {
                if (comma == arg || !conntrack_ps_state(info, arg, comma - arg))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Bad ctstate \"%s\"", arg);
                arg = comma + 1;
        }
 
        if (strlen(arg) == 0 || !conntrack_ps_state(info, arg, strlen(arg)))
-               exit_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg);
+               xtables_error(PARAMETER_PROBLEM, "Bad ctstate \"%s\"", arg);
 }
 
 static int
@@ -180,12 +180,12 @@ parse_statuses(const char *arg, struct xt_conntrack_info *sinfo)
 
        while ((comma = strchr(arg, ',')) != NULL) {
                if (comma == arg || !parse_status(arg, comma-arg, sinfo))
-                       exit_error(PARAMETER_PROBLEM, "Bad ctstatus `%s'", arg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg);
                arg = comma+1;
        }
 
        if (strlen(arg) == 0 || !parse_status(arg, strlen(arg), sinfo))
-               exit_error(PARAMETER_PROBLEM, "Bad ctstatus `%s'", arg);
+               xtables_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg);
 }
 
 static bool
@@ -214,13 +214,13 @@ conntrack_ps_statuses(struct xt_conntrack_mtinfo1 *info, const char *arg)
 
        while ((comma = strchr(arg, ',')) != NULL) {
                if (comma == arg || !conntrack_ps_status(info, arg, comma - arg))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Bad ctstatus \"%s\"", arg);
                arg = comma + 1;
        }
 
        if (strlen(arg) == 0 || !conntrack_ps_status(info, arg, strlen(arg)))
-               exit_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg);
+               xtables_error(PARAMETER_PROBLEM, "Bad ctstatus \"%s\"", arg);
 }
 
 static unsigned long
@@ -229,7 +229,7 @@ parse_expire(const char *s)
        unsigned int len;
 
        if (!xtables_strtoui(s, NULL, &len, 0, UINT32_MAX))
-               exit_error(PARAMETER_PROBLEM, "expire value invalid: `%s'\n", s);
+               xtables_error(PARAMETER_PROBLEM, "expire value invalid: \"%s\"\n", s);
        else
                return len;
 }
@@ -257,7 +257,7 @@ parse_expires(const char *s, struct xt_conntrack_info *sinfo)
        free(buffer);
 
        if (sinfo->expires_min > sinfo->expires_max)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "expire min. range value `%lu' greater than max. "
                           "range value `%lu'", sinfo->expires_min, sinfo->expires_max);
 }
@@ -278,7 +278,7 @@ conntrack_ps_expires(struct xt_conntrack_mtinfo1 *info, const char *s)
                xtables_param_act(XTF_BAD_VALUE, "conntrack", "--expires", s);
 
        if (min > max)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "expire min. range value \"%u\" greater than max. "
                           "range value \"%u\"", min, max);
 
@@ -322,7 +322,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
 
                if (sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum == 0
                    && (sinfo->invflags & XT_INV_PROTO))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rule would never match protocol");
 
                sinfo->flags |= XT_CONNTRACK_PROTO;
@@ -338,7 +338,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                                        &sinfo->sipmsk[IP_CT_DIR_ORIGINAL],
                                        &naddrs);
                if(naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "multiple IP addresses not allowed");
 
                if(naddrs == 1) {
@@ -358,7 +358,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                                        &sinfo->dipmsk[IP_CT_DIR_ORIGINAL],
                                        &naddrs);
                if(naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "multiple IP addresses not allowed");
 
                if(naddrs == 1) {
@@ -378,7 +378,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                                        &sinfo->sipmsk[IP_CT_DIR_REPLY],
                                        &naddrs);
                if(naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "multiple IP addresses not allowed");
 
                if(naddrs == 1) {
@@ -398,7 +398,7 @@ static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
                                        &sinfo->dipmsk[IP_CT_DIR_REPLY],
                                        &naddrs);
                if(naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "multiple IP addresses not allowed");
 
                if(naddrs == 1) {
@@ -459,7 +459,7 @@ conntrack_mt_parse(int c, char **argv, int invert, unsigned int *flags,
                info->l4proto = xtables_parse_protocol(optarg);
 
                if (info->l4proto == 0 && (info->invert_flags & XT_INV_PROTO))
-                       exit_error(PARAMETER_PROBLEM, "conntrack: rule would "
+                       xtables_error(PARAMETER_PROBLEM, "conntrack: rule would "
                                   "never match protocol");
 
                info->match_flags |= XT_CONNTRACK_PROTO;
@@ -555,7 +555,7 @@ conntrack_mt4_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_ipparse_any(optarg, &addr, &info->origsrc_mask.in,
                                        &naddrs);
                if (naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "multiple IP addresses not allowed");
                if (naddrs == 1)
                        memcpy(&info->origsrc_addr.in, addr, sizeof(*addr));
@@ -568,7 +568,7 @@ conntrack_mt4_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_ipparse_any(optarg, &addr, &info->origdst_mask.in,
                                        &naddrs);
                if (naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "multiple IP addresses not allowed");
                if (naddrs == 1)
                        memcpy(&info->origdst_addr.in, addr, sizeof(*addr));
@@ -581,7 +581,7 @@ conntrack_mt4_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_ipparse_any(optarg, &addr, &info->replsrc_mask.in,
                                        &naddrs);
                if (naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "multiple IP addresses not allowed");
                if (naddrs == 1)
                        memcpy(&info->replsrc_addr.in, addr, sizeof(*addr));
@@ -594,7 +594,7 @@ conntrack_mt4_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_ipparse_any(optarg, &addr, &info->repldst_mask.in,
                                        &naddrs);
                if (naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "multiple IP addresses not allowed");
                if (naddrs == 1)
                        memcpy(&info->repldst_addr.in, addr, sizeof(*addr));
@@ -625,7 +625,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_ip6parse_any(optarg, &addr,
                                         &info->origsrc_mask.in6, &naddrs);
                if (naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "multiple IP addresses not allowed");
                if (naddrs == 1)
                        memcpy(&info->origsrc_addr.in6, addr, sizeof(*addr));
@@ -638,7 +638,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_ip6parse_any(optarg, &addr,
                                         &info->origdst_mask.in6, &naddrs);
                if (naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "multiple IP addresses not allowed");
                if (naddrs == 1)
                        memcpy(&info->origdst_addr.in, addr, sizeof(*addr));
@@ -651,7 +651,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_ip6parse_any(optarg, &addr,
                                         &info->replsrc_mask.in6, &naddrs);
                if (naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "multiple IP addresses not allowed");
                if (naddrs == 1)
                        memcpy(&info->replsrc_addr.in, addr, sizeof(*addr));
@@ -664,7 +664,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_ip6parse_any(optarg, &addr,
                                         &info->repldst_mask.in6, &naddrs);
                if (naddrs > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "multiple IP addresses not allowed");
                if (naddrs == 1)
                        memcpy(&info->repldst_addr.in, addr, sizeof(*addr));
@@ -685,7 +685,7 @@ conntrack_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
 static void conntrack_mt_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM, "conntrack: At least one option "
+               xtables_error(PARAMETER_PROBLEM, "conntrack: At least one option "
                           "is required");
 }
 
index dbf6223ce72680db4ff7f038197920d75f858461..413624e1fb84ad62da479e59e92c40a5c0cc4133 100644 (file)
@@ -72,7 +72,7 @@ parse_dccp_ports(const char *portstring,
                ports[1] = cp[0] ? xtables_parse_port(cp, "dccp") : 0xFFFF;
 
                if (ports[0] > ports[1])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "invalid portrange (min > max)");
        }
        free(buffer);
@@ -109,7 +109,7 @@ parse_dccp_types(const char *typestring)
                        }
                }
                if (i == sizeof(dccp_pkt_types)/sizeof(char *))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unknown DCCP type `%s'", ptr);
        }
 
@@ -122,7 +122,7 @@ static u_int8_t parse_dccp_option(char *optstring)
        unsigned int ret;
 
        if (!xtables_strtoui(optstring, NULL, &ret, 1, UINT8_MAX))
-               exit_error(PARAMETER_PROBLEM, "Bad DCCP option `%s'",
+               xtables_error(PARAMETER_PROBLEM, "Bad DCCP option \"%s\"",
                           optstring);
 
        return ret;
@@ -138,7 +138,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & XT_DCCP_SRC_PORTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
                einfo->flags |= XT_DCCP_SRC_PORTS;
                xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -150,7 +150,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags & XT_DCCP_DEST_PORTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
                einfo->flags |= XT_DCCP_DEST_PORTS;
                xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -162,7 +162,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '3':
                if (*flags & XT_DCCP_TYPE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--dccp-types' allowed");
                einfo->flags |= XT_DCCP_TYPE;
                xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -174,7 +174,7 @@ dccp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '4':
                if (*flags & XT_DCCP_OPTION)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--dccp-option' allowed");
                einfo->flags |= XT_DCCP_OPTION;
                xtables_check_inverse(optarg, &invert, &optind, 0);
index e57c26739d2ed8b4d7acf29454b82741b7b9bf9b..62fa6af5a7f294bb19cdb8b6b42876f100a414e1 100644 (file)
@@ -49,11 +49,11 @@ parse_dscp(const char *s, struct xt_dscp_info *dinfo)
        unsigned int dscp;
        
        if (!xtables_strtoui(s, NULL, &dscp, 0, UINT8_MAX))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid dscp `%s'\n", s);
 
        if (dscp > XT_DSCP_MAX)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "DSCP `%d` out of range\n", dscp);
 
        dinfo->dscp = dscp;
@@ -80,7 +80,7 @@ dscp_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case 'F':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "DSCP match: Only use --dscp ONCE!");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_dscp(argv[optind-1], dinfo);
@@ -91,7 +91,7 @@ dscp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case 'G':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                        "DSCP match: Only use --dscp-class ONCE!");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_class(argv[optind - 1], dinfo);
@@ -110,7 +110,7 @@ dscp_parse(int c, char **argv, int invert, unsigned int *flags,
 static void dscp_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "DSCP match: Parameter --dscp is required");
 }
 
index 2cc6b60f53f1f2d28876d059d27d121215f90b7a..5769edb56f55af8bcad0b05df40da761cfecfee5 100644 (file)
@@ -32,15 +32,15 @@ parse_esp_spi(const char *spistr)
        spi =  strtoul(spistr,&ep,0) ;
 
        if ( spistr == ep ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "ESP no valid digits in spi `%s'", spistr);
        }
        if ( spi == ULONG_MAX  && errno == ERANGE ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "spi `%s' specified too big: would overflow", spistr);
        }       
        if ( *spistr != '\0'  && *ep != '\0' ) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "ESP error parsing spi `%s'", spistr);
        }
        return spi;
@@ -62,7 +62,7 @@ parse_esp_spis(const char *spistring, u_int32_t *spis)
                spis[0] = buffer[0] ? parse_esp_spi(buffer) : 0;
                spis[1] = cp[0] ? parse_esp_spi(cp) : 0xFFFFFFFF;
                if (spis[0] > spis[1])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid ESP spi range: %s", spistring);
        }
        free(buffer);
@@ -86,7 +86,7 @@ esp_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & ESP_SPI)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--espspi' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_esp_spis(argv[optind-1], espinfo->spis);
index b05e8c8cce88953d20ac3659fbeff9cbce4d45a7..5377b6d8cb598c1057768890c3a5d178aa8d3e48 100644 (file)
@@ -124,7 +124,7 @@ int parse_rate(const char *rate, u_int32_t *val)
        /* This would get mapped to infinite (1/day is minimum they
            can specify, so we're ok at that end). */
        if (r / mult > XT_HASHLIMIT_SCALE)
-               exit_error(PARAMETER_PROBLEM, "Rate too fast `%s'\n", rate);
+               xtables_error(PARAMETER_PROBLEM, "Rate too fast \"%s\"\n", rate);
 
        *val = XT_HASHLIMIT_SCALE * mult / r;
        return 1;
@@ -221,7 +221,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                          *flags & PARAM_LIMIT);
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!parse_rate(optarg, &r->cfg.avg))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "bad rate `%s'", optarg);
                *flags |= PARAM_LIMIT;
                break;
@@ -231,7 +231,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                          *flags & PARAM_BURST);
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, 10000))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "bad --hashlimit-burst `%s'", optarg);
                r->cfg.burst = num;
                *flags |= PARAM_BURST;
@@ -241,7 +241,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                          *flags & PARAM_SIZE);
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "bad --hashlimit-htable-size: `%s'", optarg);
                r->cfg.size = num;
                *flags |= PARAM_SIZE;
@@ -251,7 +251,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                          *flags & PARAM_MAX);
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "bad --hashlimit-htable-max: `%s'", optarg);
                r->cfg.max = num;
                *flags |= PARAM_MAX;
@@ -262,7 +262,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                          *flags & PARAM_GCINTERVAL);
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "bad --hashlimit-htable-gcinterval: `%s'", 
                                optarg);
                /* FIXME: not HZ dependent!! */
@@ -274,7 +274,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                          "--hashlimit-htable-expire", *flags & PARAM_EXPIRE);
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "bad --hashlimit-htable-expire: `%s'", optarg);
                /* FIXME: not HZ dependent */
                r->cfg.expire = num;
@@ -285,7 +285,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                          *flags & PARAM_MODE);
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (parse_mode(&r->cfg.mode, optarg) < 0)
-                       exit_error(PARAMETER_PROBLEM, 
+                       xtables_error(PARAMETER_PROBLEM,
                                   "bad --hashlimit-mode: `%s'\n", optarg);
                *flags |= PARAM_MODE;
                break;
@@ -294,7 +294,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
                          *flags & PARAM_NAME);
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (strlen(optarg) == 0)
-                       exit_error(PARAMETER_PROBLEM, "Zero-length name?");
+                       xtables_error(PARAMETER_PROBLEM, "Zero-length name?");
                strncpy(r->name, optarg, sizeof(r->name));
                *flags |= PARAM_NAME;
                break;
@@ -303,7 +303,7 @@ hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
        }
 
        if (invert)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "hashlimit does not support invert");
 
        return 1;
@@ -404,7 +404,7 @@ hashlimit_mt_parse(struct xt_hashlimit_mtinfo1 *info, unsigned int *flags,
                xtables_param_act(XTF_ONLY_ONCE, "hashlimit", "--hashlimit-name",
                          *flags & PARAM_NAME);
                if (strlen(optarg) == 0)
-                       exit_error(PARAMETER_PROBLEM, "Zero-length name?");
+                       xtables_error(PARAMETER_PROBLEM, "Zero-length name?");
                strncpy(info->name, optarg, sizeof(info->name));
                info->name[sizeof(info->name)-1] = '\0';
                *flags |= PARAM_NAME;
@@ -452,23 +452,23 @@ hashlimit_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
 static void hashlimit_check(unsigned int flags)
 {
        if (!(flags & PARAM_LIMIT))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                                "You have to specify --hashlimit");
        if (!(flags & PARAM_MODE))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                                "You have to specify --hashlimit-mode");
        if (!(flags & PARAM_NAME))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                                "You have to specify --hashlimit-name");
 }
 
 static void hashlimit_mt_check(unsigned int flags)
 {
        if (!(flags & PARAM_LIMIT))
-               exit_error(PARAMETER_PROBLEM, "You have to specify "
+               xtables_error(PARAMETER_PROBLEM, "You have to specify "
                           "--hashlimit-upto or --hashlimit-above");
        if (!(flags & PARAM_NAME))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "You have to specify --hashlimit-name");
 }
 
index 569ad69eca63b94aed67b0ebb8a0cce10c1c93cc..8378be75623e57ede7e6bf50ccb5419dd30654c4 100644 (file)
@@ -29,7 +29,7 @@ helper_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                        "helper match: Only use --helper ONCE!");
                xtables_check_inverse(optarg, &invert, &invert, 0);
                strncpy(info->name, optarg, 29);
@@ -48,7 +48,7 @@ helper_parse(int c, char **argv, int invert, unsigned int *flags,
 static void helper_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "helper match: You must specify `--helper'");
 }
 
index df6be14fce7e3e07f4b48ad10c8b4875b5538bb7..bc5b2aeb2bd660e89929c3132d6a724a88464736 100644 (file)
@@ -42,14 +42,14 @@ parse_iprange(char *arg, struct ipt_iprange *range)
 
        ip = xtables_numeric_to_ipaddr(arg);
        if (!ip)
-               exit_error(PARAMETER_PROBLEM, "iprange match: Bad IP address `%s'\n",
+               xtables_error(PARAMETER_PROBLEM, "iprange match: Bad IP address \"%s\"\n",
                           arg);
        range->min_ip = ip->s_addr;
 
        if (dash != NULL) {
                ip = xtables_numeric_to_ipaddr(dash+1);
                if (!ip)
-                       exit_error(PARAMETER_PROBLEM, "iprange match: Bad IP address `%s'\n",
+                       xtables_error(PARAMETER_PROBLEM, "iprange match: Bad IP address \"%s\"\n",
                                   dash+1);
                range->max_ip = ip->s_addr;
        } else {
@@ -65,7 +65,7 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & IPRANGE_SRC)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "iprange match: Only use --src-range ONCE!");
                *flags |= IPRANGE_SRC;
 
@@ -79,7 +79,7 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags & IPRANGE_DST)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "iprange match: Only use --dst-range ONCE!");
                *flags |= IPRANGE_DST;
 
@@ -201,7 +201,7 @@ iprange_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
 static void iprange_mt_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "iprange match: You must specify `--src-range' or `--dst-range'");
 }
 
index cf944e2d8c510ee38cb4d275d514c2309abf33c7..7bb31a8379492ee38316329a7a0e14a3d023f20f 100644 (file)
@@ -27,7 +27,7 @@ parse_length(const char *s)
        unsigned int len;
        
        if (!xtables_strtoui(s, NULL, &len, 0, UINT32_MAX))
-               exit_error(PARAMETER_PROBLEM, "length invalid: `%s'\n", s);
+               xtables_error(PARAMETER_PROBLEM, "length invalid: \"%s\"\n", s);
        else
                return len;
 }
@@ -52,7 +52,7 @@ parse_lengths(const char *s, struct xt_length_info *info)
        free(buffer);
        
        if (info->min > info->max)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "length min. range value `%u' greater than max. "
                           "range value `%u'", info->min, info->max);
        
@@ -67,7 +67,7 @@ length_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
                case '1':
                        if (*flags)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "length: `--length' may only be "
                                           "specified once");
                        xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -86,7 +86,7 @@ length_parse(int c, char **argv, int invert, unsigned int *flags,
 static void length_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "length: You must specify `--length'");
 }
 
index 7edfa3dba4ca4f16830e7591df9617df28f9624d..f785d2dfaf0fa021055f64436b68d9abf22f4bbe 100644 (file)
@@ -64,7 +64,7 @@ int parse_rate(const char *rate, u_int32_t *val)
        /* This would get mapped to infinite (1/day is minimum they
            can specify, so we're ok at that end). */
        if (r / mult > XT_LIMIT_SCALE)
-               exit_error(PARAMETER_PROBLEM, "Rate too fast `%s'\n", rate);
+               xtables_error(PARAMETER_PROBLEM, "Rate too fast \"%s\"\n", rate);
 
        *val = XT_LIMIT_SCALE * mult / r;
        return 1;
@@ -81,7 +81,7 @@ static void limit_init(struct xt_entry_match *m)
 
 /* FIXME: handle overflow:
        if (r->avg*r->burst/r->burst != r->avg)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Sorry: burst too large for that avg rate.\n");
 */
 
@@ -96,14 +96,14 @@ limit_parse(int c, char **argv, int invert, unsigned int *flags,
        case '%':
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!parse_rate(optarg, &r->avg))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "bad rate `%s'", optarg);
                break;
 
        case '$':
                if (xtables_check_inverse(argv[optind-1], &invert, &optind, 0)) break;
                if (!xtables_strtoui(optarg, NULL, &num, 0, 10000))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "bad --limit-burst `%s'", optarg);
                r->burst = num;
                break;
@@ -113,7 +113,7 @@ limit_parse(int c, char **argv, int invert, unsigned int *flags,
        }
 
        if (invert)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "limit does not support invert");
 
        return 1;
index b516d80f005b077b9fd0ce83409dca306f968bcc..a57e341024823667562673a7d0d8819511aefdbf 100644 (file)
@@ -31,7 +31,7 @@ parse_mac(const char *mac, struct xt_mac_info *info)
        unsigned int i = 0;
 
        if (strlen(mac) != ETH_ALEN*3-1)
-               exit_error(PARAMETER_PROBLEM, "Bad mac address `%s'", mac);
+               xtables_error(PARAMETER_PROBLEM, "Bad mac address \"%s\"", mac);
 
        for (i = 0; i < ETH_ALEN; i++) {
                long number;
@@ -44,7 +44,7 @@ parse_mac(const char *mac, struct xt_mac_info *info)
                    && number <= 255)
                        info->srcaddr[i] = number;
                else
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Bad mac address `%s'", mac);
        }
 }
@@ -84,7 +84,7 @@ static void print_mac(const unsigned char macaddress[ETH_ALEN])
 static void mac_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "You must specify `--mac-source'");
 }
 
index 1143ba98c969996cf8071924e90b9715ebf5b974..ceca9952e0d00ca6d5e69f332104f3b1decccf48 100644 (file)
@@ -69,7 +69,7 @@ mark_parse(int c, char **argv, int invert, unsigned int *flags,
                } else
                        markinfo->mask = 0xffffffff;
                if (*end != '\0' || end == optarg)
-                       exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad MARK value \"%s\"", optarg);
                if (invert)
                        markinfo->invert = 1;
                *flags = 1;
@@ -92,7 +92,7 @@ static void print_mark(unsigned int mark, unsigned int mask)
 static void mark_mt_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "mark match: The --mark option is required");
 }
 
index d0e830dfbdff753e9e59c79554f2185651b28a3e..81414417a0ba02393f882a5ae93c8341fda0f839 100644 (file)
@@ -75,7 +75,7 @@ parse_multi_ports(const char *portstring, u_int16_t *ports, const char *proto)
        unsigned int i;
 
        buffer = strdup(portstring);
-       if (!buffer) exit_error(OTHER_PROBLEM, "strdup failed");
+       if (!buffer) xtables_error(OTHER_PROBLEM, "strdup failed");
 
        for (cp=buffer, i=0; cp && i<XT_MULTI_PORTS; cp=next,i++)
        {
@@ -83,7 +83,7 @@ parse_multi_ports(const char *portstring, u_int16_t *ports, const char *proto)
                if (next) *next++='\0';
                ports[i] = xtables_parse_port(cp, proto);
        }
-       if (cp) exit_error(PARAMETER_PROBLEM, "too many ports specified");
+       if (cp) xtables_error(PARAMETER_PROBLEM, "too many ports specified");
        free(buffer);
        return i;
 }
@@ -98,7 +98,7 @@ parse_multi_ports_v1(const char *portstring,
        u_int16_t m;
 
        buffer = strdup(portstring);
-       if (!buffer) exit_error(OTHER_PROBLEM, "strdup failed");
+       if (!buffer) xtables_error(OTHER_PROBLEM, "strdup failed");
 
        for (i=0; i<XT_MULTI_PORTS; i++)
                multiinfo->pflags[i] = 0;
@@ -109,7 +109,7 @@ parse_multi_ports_v1(const char *portstring,
                range = strchr(cp, ':');
                if (range) {
                        if (i == XT_MULTI_PORTS-1)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "too many ports specified");
                        *range++ = '\0';
                }
@@ -118,13 +118,13 @@ parse_multi_ports_v1(const char *portstring,
                        multiinfo->pflags[i] = 1;
                        multiinfo->ports[++i] = xtables_parse_port(range, proto);
                        if (multiinfo->ports[i-1] >= multiinfo->ports[i])
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "invalid portrange specified");
                        m <<= 1;
                }
        }
        multiinfo->count = i;
-       if (cp) exit_error(PARAMETER_PROBLEM, "too many ports specified");
+       if (cp) xtables_error(PARAMETER_PROBLEM, "too many ports specified");
        free(buffer);
 }
 
@@ -134,17 +134,17 @@ check_proto(u_int16_t pnum, u_int8_t invflags)
        char *proto;
 
        if (invflags & XT_INV_PROTO)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "multiport only works with TCP, UDP, UDPLITE, SCTP and DCCP");
 
        if ((proto = proto_to_name(pnum)) != NULL)
                return proto;
        else if (!pnum)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "multiport needs `-p tcp', `-p udp', `-p udplite', "
                           "`-p sctp' or `-p dccp'");
        else
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "multiport only works with TCP, UDP, UDPLITE, SCTP and DCCP");
 }
 
@@ -189,11 +189,11 @@ __multiport_parse(int c, char **argv, int invert, unsigned int *flags,
        }
 
        if (invert)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "multiport does not support invert");
 
        if (*flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "multiport can only have one option");
        *flags = 1;
        return 1;
@@ -256,7 +256,7 @@ __multiport_parse_v1(int c, char **argv, int invert, unsigned int *flags,
                multiinfo->invert = 1;
 
        if (*flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "multiport can only have one option");
        *flags = 1;
        return 1;
@@ -284,7 +284,7 @@ multiport_parse6_v1(int c, char **argv, int invert, unsigned int *flags,
 static void multiport_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM, "multiport expection an option");
+               xtables_error(PARAMETER_PROBLEM, "multiport expection an option");
 }
 
 static char *
index bf26f35cfbe8c15b83a082239488c38a1f17d891..d27b3ae5768634857d7084f536002607bf0edfe5 100644 (file)
@@ -163,7 +163,7 @@ owner_mt_parse_v0(int c, char **argv, int invert, unsigned int *flags,
        case 'c':
                xtables_param_act(XTF_ONLY_ONCE, "owner", "--cmd-owner", *flags & FLAG_COMM);
                if (strlen(optarg) > sizeof(info->comm))
-                       exit_error(PARAMETER_PROBLEM, "owner match: command "
+                       xtables_error(PARAMETER_PROBLEM, "owner match: command "
                                   "\"%s\" too long, max. %zu characters",
                                   optarg, sizeof(info->comm));
 
@@ -316,7 +316,7 @@ static int owner_mt_parse(int c, char **argv, int invert, unsigned int *flags,
 static void owner_mt_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM, "owner: At least one of "
+               xtables_error(PARAMETER_PROBLEM, "owner: At least one of "
                           "--uid-owner, --gid-owner or --socket-exists "
                           "is required");
 }
index 4275a1a423c30ea77364adbb5f7dc00ca2088a13..c87779bb2630191024afabfb4020f7db9bfc5300 100644 (file)
@@ -100,7 +100,7 @@ physdev_parse(int c, char **argv, int invert, unsigned int *flags,
 
        return 1;
 multiple_use:
-       exit_error(PARAMETER_PROBLEM,
+       xtables_error(PARAMETER_PROBLEM,
           "multiple use of the same physdev option is not allowed");
 
 }
@@ -108,7 +108,7 @@ multiple_use:
 static void physdev_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM, "PHYSDEV: no physdev option specified");
+               xtables_error(PARAMETER_PROBLEM, "PHYSDEV: no physdev option specified");
 }
 
 static void
index 8caba91e5945ca47177d863159ad5d7641d60776..0fa933feaef601f785397cdd848e4d733c17563e 100644 (file)
@@ -80,7 +80,7 @@ static void parse_pkttype(const char *pkttype, struct xt_pkttype_info *info)
                }
        }
        
-       exit_error(PARAMETER_PROBLEM, "Bad packet type '%s'", pkttype);
+       xtables_error(PARAMETER_PROBLEM, "Bad packet type '%s'", pkttype);
 }
 
 static int pkttype_parse(int c, char **argv, int invert, unsigned int *flags,
@@ -108,7 +108,7 @@ static int pkttype_parse(int c, char **argv, int invert, unsigned int *flags,
 static void pkttype_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM, "You must specify `--pkt-type'");
+               xtables_error(PARAMETER_PROBLEM, "You must specify \"--pkt-type\"");
 }
 
 static void print_pkttype(struct xt_pkttype_info *info)
index 8c91fb8e1a1e8ce6655f7205d76bd096c118d824..2657b2a776482da0042e11a33d0f4b527d6d3f6d 100644 (file)
@@ -47,7 +47,7 @@ parse_quota(const char *s, u_int64_t * quota)
 #endif
 
        if (*quota == UINT64_MAX)
-               exit_error(PARAMETER_PROBLEM, "quota invalid: '%s'\n", s);
+               xtables_error(PARAMETER_PROBLEM, "quota invalid: '%s'\n", s);
        else
                return 1;
 }
@@ -61,9 +61,9 @@ quota_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (xtables_check_inverse(optarg, &invert, NULL, 0))
-                       exit_error(PARAMETER_PROBLEM, "quota: unexpected '!'");
+                       xtables_error(PARAMETER_PROBLEM, "quota: unexpected '!'");
                if (!parse_quota(optarg, &info->quota))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "bad quota: '%s'", optarg);
                break;
 
index 8a8836bfd97cd9c36000955b8bb449f24b63d620..3cff07d0c459972b071f4820ea4da1ff6939319b 100644 (file)
@@ -120,11 +120,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
        case OPT_RATEEST1:
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest can't be inverted");
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify --rateest1 twice");
                *flags |= 1 << c;
 
@@ -134,11 +134,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
        case OPT_RATEEST2:
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest can't be inverted");
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify --rateest2 twice");
                *flags |= 1 << c;
 
@@ -149,11 +149,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
        case OPT_RATEEST_BPS1:
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-bps can't be inverted");
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify --rateest-bps1 twice");
                *flags |= 1 << c;
 
@@ -164,7 +164,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                        break;
 
                if (rateest_get_rate(&info->bps1, argv[optind]) < 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: could not parse rate `%s'",
                                   argv[optind]);
                optind++;
@@ -173,11 +173,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
        case OPT_RATEEST_PPS1:
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-pps can't be inverted");
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify --rateest-pps1 twice");
                *flags |= 1 << c;
 
@@ -188,7 +188,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                        break;
 
                if (!xtables_strtoui(argv[optind], NULL, &val, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: could not parse pps `%s'",
                                   argv[optind]);
                info->pps1 = val;
@@ -198,11 +198,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
        case OPT_RATEEST_BPS2:
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-bps can't be inverted");
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify --rateest-bps2 twice");
                *flags |= 1 << c;
 
@@ -213,7 +213,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                        break;
 
                if (rateest_get_rate(&info->bps2, argv[optind]) < 0)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: could not parse rate `%s'",
                                   argv[optind]);
                optind++;
@@ -222,11 +222,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
        case OPT_RATEEST_PPS2:
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-pps can't be inverted");
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify --rateest-pps2 twice");
                *flags |= 1 << c;
 
@@ -237,7 +237,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                        break;
 
                if (!xtables_strtoui(argv[optind], NULL, &val, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: could not parse pps `%s'",
                                   argv[optind]);
                info->pps2 = val;
@@ -247,11 +247,11 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
        case OPT_RATEEST_DELTA:
                xtables_check_inverse(optarg, &invert, &optind, 0);
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: rateest-delta can't be inverted");
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify --rateest-delta twice");
                *flags |= 1 << c;
 
@@ -262,7 +262,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify lt/gt/eq twice");
                *flags |= 1 << c;
 
@@ -275,7 +275,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify lt/gt/eq twice");
                *flags |= 1 << c;
 
@@ -288,7 +288,7 @@ rateest_parse(int c, char **argv, int invert, unsigned int *flags,
                xtables_check_inverse(argv[optind-1], &invert, &optind, 0);
 
                if (*flags & (1 << c))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "rateest: can't specify lt/gt/eq twice");
                *flags |= 1 << c;
 
@@ -310,7 +310,7 @@ rateest_final_check(unsigned int flags)
        struct xt_rateest_match_info *info = rateest_info;
 
        if (info == NULL)
-               exit_error(PARAMETER_PROBLEM, "rateest match: "
+               xtables_error(PARAMETER_PROBLEM, "rateest match: "
                           "you need to specify some flags");
        if (!(info->flags & XT_RATEEST_MATCH_REL))
                info->flags |= XT_RATEEST_MATCH_ABS;
index 1646705f3170bbb6ca4df414492fd876fcca95a6..47c35ff7791d95a155806d6586464732b5e4c4f2 100644 (file)
@@ -70,7 +70,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
                case 201:
                        if (*flags & RECENT_CMDS)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "recent: only one of `--set', `--rcheck' "
                                        "`--update' or `--remove' may be set");
                        xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -81,7 +81,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
 
                case 202:
                        if (*flags & RECENT_CMDS)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "recent: only one of `--set', `--rcheck' "
                                        "`--update' or `--remove' may be set");
                        xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -92,7 +92,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
 
                case 203:
                        if (*flags & RECENT_CMDS)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "recent: only one of `--set', `--rcheck' "
                                        "`--update' or `--remove' may be set");
                        xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -103,7 +103,7 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
 
                case 206:
                        if (*flags & RECENT_CMDS)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "recent: only one of `--set', `--rcheck' "
                                        "`--update' or `--remove' may be set");
                        xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -148,12 +148,12 @@ static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
 static void recent_check(unsigned int flags)
 {
        if (!(flags & RECENT_CMDS))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                        "recent: you must specify one of `--set', `--rcheck' "
                        "`--update' or `--remove'");
        if ((flags & XT_RECENT_TTL) &&
            (flags & (XT_RECENT_SET | XT_RECENT_REMOVE)))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "recent: --rttl may only be used with --rcheck or "
                           "--update");
 }
index 2ee486106c9929e69d85eb61f0ae1b5dbf502761..b889406b5b88fbd0713eb36d0a1270ea699ce662 100644 (file)
@@ -95,7 +95,7 @@ parse_sctp_ports(const char *portstring,
                ports[1] = cp[0] ? xtables_parse_port(cp, "sctp") : 0xFFFF;
 
                if (ports[0] > ports[1])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "invalid portrange (min > max)");
        }
        free(buffer);
@@ -151,7 +151,7 @@ save_chunk_flag_info(struct xt_sctp_flag_info *flag_info,
        }
        
        if (*flag_count == XT_NUM_SCTP_FLAGS) {
-               exit_error (PARAMETER_PROBLEM,
+               xtables_error (PARAMETER_PROBLEM,
                        "Number of chunk types with flags exceeds currently allowed limit."
                        "Increasing this limit involves changing IPT_NUM_SCTP_FLAGS and"
                        "recompiling both the kernel space and user space modules\n");
@@ -208,7 +208,7 @@ parse_sctp_chunk(struct xt_sctp_info *einfo,
                        }
                }
                if (!found)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unknown sctp chunk `%s'", ptr);
 
                if (chunk_flags) {
@@ -226,7 +226,7 @@ parse_sctp_chunk(struct xt_sctp_info *einfo,
                                                &(einfo->flag_count), i, bit, 
                                                isupper(chunk_flags[j]));
                                } else {
-                                       exit_error(PARAMETER_PROBLEM, 
+                                       xtables_error(PARAMETER_PROBLEM,
                                                "Invalid flags for chunk type %d\n", i);
                                }
                        }
@@ -249,7 +249,7 @@ parse_sctp_chunks(struct xt_sctp_info *einfo,
        } else  if (!strcasecmp(match_type, "ONLY")) {
                einfo->chunk_match_type = SCTP_CHUNK_MATCH_ONLY;
        } else {
-               exit_error (PARAMETER_PROBLEM, 
+               xtables_error (PARAMETER_PROBLEM,
                        "Match type has to be one of \"ALL\", \"ANY\" or \"ONLY\"");
        }
 
@@ -267,7 +267,7 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & XT_SCTP_SRC_PORTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
                einfo->flags |= XT_SCTP_SRC_PORTS;
                xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -279,7 +279,7 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags & XT_SCTP_DEST_PORTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
                einfo->flags |= XT_SCTP_DEST_PORTS;
                xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -291,13 +291,13 @@ sctp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '3':
                if (*flags & XT_SCTP_CHUNK_TYPES)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--chunk-types' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if (!argv[optind] 
                    || argv[optind][0] == '-' || argv[optind][0] == '!')
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "--chunk-types requires two args");
 
                einfo->flags |= XT_SCTP_CHUNK_TYPES;
index 51822303f9b1dca29e720b97224874281823d3ee..0f2644392a6cc55e3113227e994bf3167fb453f8 100644 (file)
@@ -51,15 +51,15 @@ state_parse_states(const char *arg, struct xt_state_info *sinfo)
 
        while ((comma = strchr(arg, ',')) != NULL) {
                if (comma == arg || !state_parse_state(arg, comma-arg, sinfo))
-                       exit_error(PARAMETER_PROBLEM, "Bad state `%s'", arg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad state \"%s\"", arg);
                arg = comma+1;
        }
        if (!*arg)
-               exit_error(PARAMETER_PROBLEM, "`--state' requires a list of "
+               xtables_error(PARAMETER_PROBLEM, "\"--state\" requires a list of "
                                              "states with no spaces, e.g. "
                                              "ESTABLISHED,RELATED");
        if (strlen(arg) == 0 || !state_parse_state(arg, strlen(arg), sinfo))
-               exit_error(PARAMETER_PROBLEM, "Bad state `%s'", arg);
+               xtables_error(PARAMETER_PROBLEM, "Bad state \"%s\"", arg);
 }
 
 static int
@@ -89,7 +89,7 @@ state_parse(int c, char **argv, int invert, unsigned int *flags,
 static void state_final_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM, "You must specify `--state'");
+               xtables_error(PARAMETER_PROBLEM, "You must specify \"--state\"");
 }
 
 static void state_print_state(unsigned int statemask)
index 574f8f7d6d4647516bca536cc60e3c1f32e5e2cd..fa044adf066cfe26ef8833c10b8f182f5edef897 100644 (file)
@@ -49,42 +49,42 @@ statistic_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & 0x1)
-                       exit_error(PARAMETER_PROBLEM, "double --mode");
+                       xtables_error(PARAMETER_PROBLEM, "double --mode");
                if (!strcmp(optarg, "random"))
                        info->mode = XT_STATISTIC_MODE_RANDOM;
                else if (!strcmp(optarg, "nth"))
                        info->mode = XT_STATISTIC_MODE_NTH;
                else
-                       exit_error(PARAMETER_PROBLEM, "Bad mode `%s'", optarg);
+                       xtables_error(PARAMETER_PROBLEM, "Bad mode \"%s\"", optarg);
                *flags |= 0x1;
                break;
        case '2':
                if (*flags & 0x2)
-                       exit_error(PARAMETER_PROBLEM, "double --probability");
+                       xtables_error(PARAMETER_PROBLEM, "double --probability");
                prob = atof(optarg);
                if (prob < 0 || prob > 1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "--probability must be between 0 and 1");
                info->u.random.probability = 0x80000000 * prob;
                *flags |= 0x2;
                break;
        case '3':
                if (*flags & 0x4)
-                       exit_error(PARAMETER_PROBLEM, "double --every");
+                       xtables_error(PARAMETER_PROBLEM, "double --every");
                if (!xtables_strtoui(optarg, NULL, &val, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "cannot parse --every `%s'", optarg);
                info->u.nth.every = val;
                if (info->u.nth.every == 0)
-                       exit_error(PARAMETER_PROBLEM, "--every cannot be 0");
+                       xtables_error(PARAMETER_PROBLEM, "--every cannot be 0");
                info->u.nth.every--;
                *flags |= 0x4;
                break;
        case '4':
                if (*flags & 0x8)
-                       exit_error(PARAMETER_PROBLEM, "double --packet");
+                       xtables_error(PARAMETER_PROBLEM, "double --packet");
                if (!xtables_strtoui(optarg, NULL, &val, 0, UINT32_MAX))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "cannot parse --packet `%s'", optarg);
                info->u.nth.packet = val;
                *flags |= 0x8;
@@ -98,25 +98,25 @@ statistic_parse(int c, char **argv, int invert, unsigned int *flags,
 static void statistic_check(unsigned int flags)
 {
        if (!(flags & 0x1))
-               exit_error(PARAMETER_PROBLEM, "no mode specified");
+               xtables_error(PARAMETER_PROBLEM, "no mode specified");
        if ((flags & 0x2) && (flags & (0x4 | 0x8)))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "both nth and random parameters given");
        if (flags & 0x2 && global_info->mode != XT_STATISTIC_MODE_RANDOM)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "--probability can only be used in random mode");
        if (flags & 0x4 && global_info->mode != XT_STATISTIC_MODE_NTH)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "--every can only be used in nth mode");
        if (flags & 0x8 && global_info->mode != XT_STATISTIC_MODE_NTH)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "--packet can only be used in nth mode");
        if ((flags & 0x8) && !(flags & 0x4))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "--packet can only be used with --every");
        /* at this point, info->u.nth.every have been decreased. */
        if (global_info->u.nth.packet > global_info->u.nth.every)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                          "the --packet p must be 0 <= p <= n-1");
 
 
index aa52fa8d3196d46145403ccaf8f7b21cc95eb244..5ea529e4bc5beb3a63c9e8b0f02abb904f0ff7d0 100644 (file)
@@ -69,7 +69,7 @@ parse_string(const char *s, struct xt_string_info *info)
                info->patlen = strlen(s);
                return;
        }
-       exit_error(PARAMETER_PROBLEM, "STRING too long `%s'", s);
+       xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s);
 }
 
 static void
@@ -79,7 +79,7 @@ parse_algo(const char *s, struct xt_string_info *info)
                strncpy(info->algo, s, XT_STRING_MAX_ALGO_NAME_SIZE);
                return;
        }
-       exit_error(PARAMETER_PROBLEM, "ALGO too long `%s'", s);
+       xtables_error(PARAMETER_PROBLEM, "ALGO too long \"%s\"", s);
 }
 
 static void
@@ -92,7 +92,7 @@ parse_hex_string(const char *s, struct xt_string_info *info)
        slen = strlen(s);
 
        if (slen == 0) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                        "STRING must contain at least one char");
        }
 
@@ -100,7 +100,7 @@ parse_hex_string(const char *s, struct xt_string_info *info)
                if (s[i] == '\\' && !hex_f) {
                        literal_f = 1;
                } else if (s[i] == '\\') {
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                "Cannot include literals in hex data");
                } else if (s[i] == '|') {
                        if (hex_f)
@@ -119,7 +119,7 @@ parse_hex_string(const char *s, struct xt_string_info *info)
 
                if (literal_f) {
                        if (i+1 >= slen) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "Bad literal placement at end of string");
                        }
                        info->pattern[sindex] = s[i+1];
@@ -127,22 +127,22 @@ parse_hex_string(const char *s, struct xt_string_info *info)
                        literal_f = 0;
                } else if (hex_f) {
                        if (i+1 >= slen) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "Odd number of hex digits");
                        }
                        if (i+2 >= slen) {
                                /* must end with a "|" */
-                               exit_error(PARAMETER_PROBLEM, "Invalid hex block");
+                               xtables_error(PARAMETER_PROBLEM, "Invalid hex block");
                        }
                        if (! isxdigit(s[i])) /* check for valid hex char */
-                               exit_error(PARAMETER_PROBLEM, "Invalid hex char `%c'", s[i]);
+                               xtables_error(PARAMETER_PROBLEM, "Invalid hex char '%c'", s[i]);
                        if (! isxdigit(s[i+1])) /* check for valid hex char */
-                               exit_error(PARAMETER_PROBLEM, "Invalid hex char `%c'", s[i+1]);
+                               xtables_error(PARAMETER_PROBLEM, "Invalid hex char '%c'", s[i+1]);
                        hextmp[0] = s[i];
                        hextmp[1] = s[i+1];
                        hextmp[2] = '\0';
                        if (! sscanf(hextmp, "%x", &schar))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "Invalid hex char `%c'", s[i]);
                        info->pattern[sindex] = (char) schar;
                        if (s[i+2] == ' ')
@@ -154,7 +154,7 @@ parse_hex_string(const char *s, struct xt_string_info *info)
                        i++;
                }
                if (sindex > XT_STRING_MAX_PATTERN_SIZE)
-                       exit_error(PARAMETER_PROBLEM, "STRING too long `%s'", s);
+                       xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s);
                sindex++;
        }
        info->patlen = sindex;
@@ -177,28 +177,28 @@ string_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & FROM)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple --from");
                stringinfo->from_offset = atoi(optarg);
                *flags |= FROM;
                break;
        case '2':
                if (*flags & TO)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple --to");
                stringinfo->to_offset = atoi(optarg);
                *flags |= TO;
                break;
        case '3':
                if (*flags & ALGO)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple --algo");
                parse_algo(optarg, stringinfo);
                *flags |= ALGO;
                break;
        case '4':
                if (*flags & STRING)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple --string");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_string(argv[optind-1], stringinfo);
@@ -215,7 +215,7 @@ string_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '5':
                if (*flags & STRING)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can't specify multiple --hex-string");
 
                xtables_check_inverse(optarg, &invert, &optind, 0);
@@ -231,7 +231,7 @@ string_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '6':
                if (revision == 0)
-                       exit_error(VERSION_PROBLEM,
+                       xtables_error(VERSION_PROBLEM,
                                   "Kernel doesn't support --icase");
 
                stringinfo->u.v1.flags |= XT_STRING_FLAG_IGNORECASE;
@@ -247,11 +247,11 @@ string_parse(int c, char **argv, int invert, unsigned int *flags,
 static void string_check(unsigned int flags)
 {
        if (!(flags & STRING))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "STRING match: You must specify `--string' or "
                           "`--hex-string'");
        if (!(flags & ALGO))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "STRING match: You must specify `--algo'");
 }
 
index 069bb7fa59572d37d473da348bed0427ac0066c3..d2ad53b3d0a23c5b795ddd87cadf26dc9418c4ea 100644 (file)
@@ -53,7 +53,7 @@ parse_tcp_ports(const char *portstring, u_int16_t *ports)
                ports[1] = cp[0] ? xtables_parse_port(cp, "tcp") : 0xFFFF;
 
                if (ports[0] > ports[1])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "invalid portrange (min > max)");
        }
        free(buffer);
@@ -95,7 +95,7 @@ parse_tcp_flag(const char *flags)
                        }
                }
                if (i == sizeof(tcp_flag_names)/sizeof(struct tcp_flag_names))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unknown TCP flag `%s'", ptr);
                }
 
@@ -122,7 +122,7 @@ parse_tcp_option(const char *option, u_int8_t *result)
        unsigned int ret;
 
        if (!xtables_strtoui(option, NULL, &ret, 1, UINT8_MAX))
-               exit_error(PARAMETER_PROBLEM, "Bad TCP option `%s'", option);
+               xtables_error(PARAMETER_PROBLEM, "Bad TCP option \"%s\"", option);
 
        *result = ret;
 }
@@ -148,7 +148,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & TCP_SRC_PORTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_tcp_ports(argv[optind-1], tcpinfo->spts);
@@ -159,7 +159,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags & TCP_DST_PORTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_tcp_ports(argv[optind-1], tcpinfo->dpts);
@@ -170,7 +170,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '3':
                if (*flags & TCP_FLAGS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one of `--syn' or `--tcp-flags' "
                                   " allowed");
                parse_tcp_flags(tcpinfo, "SYN,RST,ACK,FIN", "SYN", invert);
@@ -179,14 +179,14 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '4':
                if (*flags & TCP_FLAGS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one of `--syn' or `--tcp-flags' "
                                   " allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
 
                if (!argv[optind]
                    || argv[optind][0] == '-' || argv[optind][0] == '!')
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "--tcp-flags requires two args.");
 
                parse_tcp_flags(tcpinfo, argv[optind-1], argv[optind],
@@ -197,7 +197,7 @@ tcp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '5':
                if (*flags & TCP_OPTION)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--tcp-option' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_tcp_option(argv[optind-1], &tcpinfo->option);
index 5c013a773a9da6b5b5a45a863e69405cf2917441..43a4a0d8829e6e61a228cca58df136509a88eaf9 100644 (file)
@@ -29,7 +29,7 @@ parse_tcp_mssvalue(const char *mssvalue)
        if (!xtables_strtoui(mssvalue, NULL, &mssvaluenum, 0, UINT16_MAX))
                return mssvaluenum;
 
-       exit_error(PARAMETER_PROBLEM,
+       xtables_error(PARAMETER_PROBLEM,
                   "Invalid mss `%s' specified", mssvalue);
 }
 
@@ -63,7 +63,7 @@ tcpmss_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--mss' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_tcp_mssvalues(argv[optind-1],
@@ -81,7 +81,7 @@ tcpmss_parse(int c, char **argv, int invert, unsigned int *flags,
 static void tcpmss_check(unsigned int flags)
 {
        if (!flags)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "tcpmss match: You must specify `--mss'");
 }
 
index 41aa5c7769f3a3c26649d35c795e3b3f1cee21ed..eb8b671b81586bfeafbfb962d0ef00d3c60e389a 100644 (file)
@@ -142,10 +142,10 @@ static time_t time_parse_date(const char *s, bool end)
        if (ret >= 0)
                return ret;
        perror("mktime");
-       exit_error(OTHER_PROBLEM, "mktime returned an error");
+       xtables_error(OTHER_PROBLEM, "mktime returned an error");
 
  out:
-       exit_error(PARAMETER_PROBLEM, "Invalid date \"%s\" specified. Should "
+       xtables_error(PARAMETER_PROBLEM, "Invalid date \"%s\" specified. Should "
                   "be YYYY[-MM[-DD[Thh[:mm[:ss]]]]]", os);
        return -1;
 }
@@ -175,7 +175,7 @@ static unsigned int time_parse_minutes(const char *s)
        return 60 * 60 * hour + 60 * minute + second;
 
  out:
-       exit_error(PARAMETER_PROBLEM, "invalid time \"%s\" specified, "
+       xtables_error(PARAMETER_PROBLEM, "invalid time \"%s\" specified, "
                   "should be hh:mm[:ss] format and within the boundaries", s);
        return -1;
 }
@@ -207,7 +207,7 @@ static uint32_t time_parse_monthdays(const char *arg)
        while (my_strseg(day, sizeof(day), &arg, ',') != NULL) {
                i = strtoul(day, &err, 0);
                if ((*err != ',' && *err != '\0') || i > 31)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "%s is not a valid day for --monthdays", day);
                ret |= 1 << i;
        }
@@ -225,7 +225,7 @@ static unsigned int time_parse_weekdays(const char *arg)
                i = strtoul(day, &err, 0);
                if (*err == '\0') {
                        if (i == 0)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "No, the week does NOT begin with Sunday.");
                        ret |= 1 << i;
                        continue;
@@ -239,7 +239,7 @@ static unsigned int time_parse_weekdays(const char *arg)
                        }
 
                if (!valid)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "%s is not a valid day specifier", day);
        }
 
@@ -254,54 +254,54 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case 'D': /* --datestart */
                if (*flags & F_DATE_START)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Cannot specify --datestart twice");
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected \"!\" with --datestart");
                info->date_start = time_parse_date(optarg, false);
                *flags |= F_DATE_START;
                return 1;
        case 'E': /* --datestop */
                if (*flags & F_DATE_STOP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Cannot specify --datestop more than once");
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "unexpected \"!\" with --datestop");
                info->date_stop = time_parse_date(optarg, true);
                *flags |= F_DATE_STOP;
                return 1;
        case 'X': /* --timestart */
                if (*flags & F_TIME_START)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Cannot specify --timestart more than once");
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected \"!\" with --timestart");
                info->daytime_start = time_parse_minutes(optarg);
                *flags |= F_TIME_START;
                return 1;
        case 'Y': /* --timestop */
                if (*flags & F_TIME_STOP)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Cannot specify --timestop more than once");
                if (invert)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Unexpected \"!\" with --timestop");
                info->daytime_stop = time_parse_minutes(optarg);
                *flags |= F_TIME_STOP;
                return 1;
        case 'l': /* --localtz */
                if (*flags & F_TIMEZONE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can only specify exactly one of --localtz or --utc");
                info->flags |= XT_TIME_LOCAL_TZ;
                *flags |= F_TIMEZONE;
                return 1;
        case 'm': /* --monthdays */
                if (*flags & F_MONTHDAYS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Cannot specify --monthdays more than once");
                info->monthdays_match = time_parse_monthdays(optarg);
                if (invert)
@@ -310,7 +310,7 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags,
                return 1;
        case 'w': /* --weekdays */
                if (*flags & F_WEEKDAYS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Cannot specify --weekdays more than once");
                info->weekdays_match = time_parse_weekdays(optarg);
                if (invert)
@@ -319,7 +319,7 @@ static int time_parse(int c, char **argv, int invert, unsigned int *flags,
                return 1;
        case 'u': /* --utc */
                if (*flags & F_TIMEZONE)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Can only specify exactly one of --localtz or --utc");
                info->flags &= ~XT_TIME_LOCAL_TZ;
                *flags |= F_TIMEZONE;
index a61184004fce25e82324bdb35d10f52748b2370c..b810ea6d7a34f725a15f6c9e812a9966a21a1b36 100644 (file)
@@ -54,7 +54,7 @@ static int tos_mt_parse_v0(int c, char **argv, int invert, unsigned int *flags,
                if (!tos_parse_symbolic(optarg, &tvm, 0xFF))
                        xtables_param_act(XTF_BAD_VALUE, "tos", "--tos", optarg);
                if (tvm.mask != 0xFF)
-                       exit_error(PARAMETER_PROBLEM, "tos: Your kernel is "
+                       xtables_error(PARAMETER_PROBLEM, "tos: Your kernel is "
                                   "too old to support anything besides /0xFF "
                                   "as a mask.");
                info->tos = tvm.value;
@@ -90,7 +90,7 @@ static int tos_mt_parse(int c, char **argv, int invert, unsigned int *flags,
 static void tos_mt_check(unsigned int flags)
 {
        if (flags == 0)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "tos: --tos parameter required");
 }
 
index f0bb61a3701253bb32abeb34f5125d7c213aff82..c2aeb271363f79f973aeab591846c7e1c8c2825b 100644 (file)
@@ -92,10 +92,10 @@ static u_int32_t parse_number(char **s, int pos)
        errno  = 0;
        number = strtoul(*s, &end, 0);
        if (end == *s)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "u32: at char %d: expected number", pos);
        if (errno != 0)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "u32: at char %d: error reading number", pos);
        *s = end;
        return number;
@@ -129,10 +129,10 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
                if (*arg == '\0') {
                        /* end of argument found */
                        if (state == 0)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "u32: abrupt end of input after location specifier");
                        if (valind == 0)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "u32: test ended with no value specified");
 
                        ct->nnums    = locind;
@@ -140,7 +140,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
                        data->ntests = ++testind;
 
                        if (testind > XT_U32_MAXSIZE)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "u32: at char %u: too many \"&&\"s",
                                           (unsigned int)(arg - start));
                        return 1;
@@ -153,7 +153,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
                         */
                        if (*arg == '=') {
                                if (locind == 0) {
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "u32: at char %u: "
                                                   "location spec missing",
                                                   (unsigned int)(arg - start));
@@ -168,18 +168,18 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
                                                ct->location[locind].nextop = XT_U32_AND;
                                        } else if (*arg == '<') {
                                                if (*++arg != '<')
-                                                       exit_error(PARAMETER_PROBLEM,
+                                                       xtables_error(PARAMETER_PROBLEM,
                                                                   "u32: at char %u: a second '<' was expected", (unsigned int)(arg - start));
                                                ct->location[locind].nextop = XT_U32_LEFTSH;
                                        } else if (*arg == '>') {
                                                if (*++arg != '>')
-                                                       exit_error(PARAMETER_PROBLEM,
+                                                       xtables_error(PARAMETER_PROBLEM,
                                                                   "u32: at char %u: a second '>' was expected", (unsigned int)(arg - start));
                                                ct->location[locind].nextop = XT_U32_RIGHTSH;
                                        } else if (*arg == '@') {
                                                ct->location[locind].nextop = XT_U32_AT;
                                        } else {
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                        "u32: at char %u: operator expected", (unsigned int)(arg - start));
                                        }
                                        ++arg;
@@ -188,7 +188,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
                                ct->location[locind].number =
                                        parse_number(&arg, arg - start);
                                if (++locind > XT_U32_MAXSIZE)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "u32: at char %u: too many operators", (unsigned int)(arg - start));
                        }
                } else {
@@ -199,17 +199,17 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
                         */
                        if (*arg == '&') {
                                if (*++arg != '&')
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "u32: at char %u: a second '&' was expected", (unsigned int)(arg - start));
                                if (valind == 0) {
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "u32: at char %u: value spec missing", (unsigned int)(arg - start));
                                } else {
                                        ct->nnums   = locind;
                                        ct->nvalues = valind;
                                        ct = &data->tests[++testind];
                                        if (testind > XT_U32_MAXSIZE)
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                           "u32: at char %u: too many \"&&\"s", (unsigned int)(arg - start));
                                        ++arg;
                                        state  = 0;
@@ -219,7 +219,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
                        } else { /* read value range */
                                if (valind > 0) { /* need , before number */
                                        if (*arg != ',')
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                           "u32: at char %u: expected \",\" or \"&&\"", (unsigned int)(arg - start));
                                        ++arg;
                                }
@@ -239,7 +239,7 @@ static int u32_parse(int c, char **argv, int invert, unsigned int *flags,
                                }
 
                                if (++valind > XT_U32_MAXSIZE)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "u32: at char %u: too many \",\"s", (unsigned int)(arg - start));
                        }
                }
index 8f57f4ec701fcf9f3147ffef63174e7952413cfd..4b4e84fbcd7f3c3788f1e32f3577166f453ca66e 100644 (file)
@@ -45,7 +45,7 @@ parse_udp_ports(const char *portstring, u_int16_t *ports)
                ports[1] = cp[0] ? xtables_parse_port(cp, "udp") : 0xFFFF;
 
                if (ports[0] > ports[1])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "invalid portrange (min > max)");
        }
        free(buffer);
@@ -70,7 +70,7 @@ udp_parse(int c, char **argv, int invert, unsigned int *flags,
        switch (c) {
        case '1':
                if (*flags & UDP_SRC_PORTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--source-port' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_udp_ports(argv[optind-1], udpinfo->spts);
@@ -81,7 +81,7 @@ udp_parse(int c, char **argv, int invert, unsigned int *flags,
 
        case '2':
                if (*flags & UDP_DST_PORTS)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Only one `--destination-port' allowed");
                xtables_check_inverse(optarg, &invert, &optind, 0);
                parse_udp_ports(argv[optind-1], udpinfo->dpts);
index 81f6de1c0b851c526fff5532da0b9a6e46db85cd..2676d81ed2eb172db6c3eb3e3ab1d730aa34bc1e 100644 (file)
@@ -42,13 +42,13 @@ static bool tos_parse_numeric(const char *str, struct tos_value_mask *tvm,
                const char *p = end + 1;
 
                if (!xtables_strtoui(p, &end, &value, 0, max))
-                       exit_error(PARAMETER_PROBLEM, "Illegal value: \"%s\"",
+                       xtables_error(PARAMETER_PROBLEM, "Illegal value: \"%s\"",
                                   str);
                tvm->mask = value;
        }
 
        if (*end != '\0')
-               exit_error(PARAMETER_PROBLEM, "Illegal value: \"%s\"", str);
+               xtables_error(PARAMETER_PROBLEM, "Illegal value: \"%s\"", str);
        return true;
 }
 
@@ -70,7 +70,7 @@ static bool tos_parse_symbolic(const char *str, struct tos_value_mask *tvm,
                        return true;
                }
 
-       exit_error(PARAMETER_PROBLEM, "Symbolic name \"%s\" is unknown", str);
+       xtables_error(PARAMETER_PROBLEM, "Symbolic name \"%s\" is unknown", str);
        return false;
 }
 
index c4d2b92230ea0fe5aeb17fc141240dba6212dc11..3f556c1c9a147c2b87496bdaf7437b0f922a2d33 100644 (file)
@@ -234,7 +234,7 @@ xtables_parse_interface(const char *arg, char *vianame, unsigned char *mask);
 int xtables_check_inverse(const char option[], int *invert,
        int *my_optind, int argc);
 extern struct xtables_globals *xt_params;
-#define exit_error xt_params->exit_err
+#define xtables_error (xt_params->exit_err)
 
 extern void xtables_param_act(unsigned int, const char *, ...);
 
index 9b8596ed0ec87c60fe9362bd10d80586f0114cc6..324dd1f1870a74574808504441899f1c68556577 100644 (file)
@@ -70,7 +70,7 @@ static struct ip6tc_handle *create_handle(const char *tablename)
        }
 
        if (!handle) {
-               exit_error(PARAMETER_PROBLEM, "%s: unable to initialize "
+               xtables_error(PARAMETER_PROBLEM, "%s: unable to initialize "
                        "table '%s'\n", ip6tables_globals.program_name,
                        tablename);
                exit(1);
@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
                        table = strtok(buffer+1, " \t\n");
                        DEBUGP("line %u, table '%s'\n", line, table);
                        if (!table) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "%s: line %u table name invalid\n",
                                        ip6tables_globals.program_name,
                                        line);
@@ -246,7 +246,7 @@ int main(int argc, char *argv[])
                        chain = strtok(buffer+1, " \t\n");
                        DEBUGP("line %u, chain '%s'\n", line, chain);
                        if (!chain) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "%s: line %u chain name invalid\n",
                                           ip6tables_globals.program_name,
                                           line);
@@ -257,14 +257,14 @@ int main(int argc, char *argv[])
                                if (noflush && ip6tc_is_chain(chain, handle)) {
                                        DEBUGP("Flushing existing user defined chain '%s'\n", chain);
                                        if (!ip6tc_flush_entries(chain, handle))
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                           "error flushing chain "
                                                           "'%s':%s\n", chain,
                                                           strerror(errno));
                                } else {
                                        DEBUGP("Creating new chain '%s'\n", chain);
                                        if (!ip6tc_create_chain(chain, handle))
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                           "error creating chain "
                                                           "'%s':%s\n", chain,
                                                           strerror(errno));
@@ -274,7 +274,7 @@ int main(int argc, char *argv[])
                        policy = strtok(NULL, " \t\n");
                        DEBUGP("line %u, policy '%s'\n", line, policy);
                        if (!policy) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "%s: line %u policy invalid\n",
                                           ip6tables_globals.program_name,
                                           line);
@@ -289,7 +289,7 @@ int main(int argc, char *argv[])
                                        ctrs = strtok(NULL, " \t\n");
 
                                        if (!ctrs || !parse_counters(ctrs, &count))
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                          "invalid policy counters "
                                                          "for chain '%s'\n", chain);
 
@@ -303,7 +303,7 @@ int main(int argc, char *argv[])
 
                                if (!ip6tc_set_policy(chain, policy, &count,
                                                     handle))
-                                       exit_error(OTHER_PROBLEM,
+                                       xtables_error(OTHER_PROBLEM,
                                                "Can't set policy `%s'"
                                                " on `%s' line %u: %s\n",
                                                chain, policy, line,
@@ -331,19 +331,19 @@ int main(int argc, char *argv[])
                                /* we have counters in our input */
                                ptr = strchr(buffer, ']');
                                if (!ptr)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need ]\n",
                                                   line);
 
                                pcnt = strtok(buffer+1, ":");
                                if (!pcnt)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need :\n",
                                                   line);
 
                                bcnt = strtok(NULL, "]");
                                if (!bcnt)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need ]\n",
                                                   line);
 
@@ -410,7 +410,7 @@ int main(int argc, char *argv[])
                                        /* check if table name specified */
                                        if (!strncmp(param_buffer, "-t", 2)
                                             || !strncmp(param_buffer, "--table", 8)) {
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                   "Line %u seems to have a "
                                                   "-t table option.\n", line);
                                                exit(1);
@@ -423,7 +423,7 @@ int main(int argc, char *argv[])
                                        param_buffer[param_len++] = *curchar;
 
                                        if (param_len >= sizeof(param_buffer))
-                                               exit_error(PARAMETER_PROBLEM, 
+                                               xtables_error(PARAMETER_PROBLEM,
                                                   "Parameter too long!");
                                }
                        }
index 874542d5a3646b9e9c3c03c890ec9f783bf3c16d..55010c44ecd7562943ee0d2c5b11b9e434bae766 100644 (file)
@@ -42,13 +42,13 @@ static int for_each_table(int (*func)(const char *tablename))
 
        procfile = fopen("/proc/net/ip6_tables_names", "r");
        if (!procfile)
-               exit_error(OTHER_PROBLEM,
+               xtables_error(OTHER_PROBLEM,
                           "Unable to open /proc/net/ip6_tables_names: %s\n",
                           strerror(errno));
 
        while (fgets(tablename, sizeof(tablename), procfile)) {
                if (tablename[strlen(tablename) - 1] != '\n')
-                       exit_error(OTHER_PROBLEM, 
+                       xtables_error(OTHER_PROBLEM,
                                   "Badly formed tablename `%s'\n",
                                   tablename);
                tablename[strlen(tablename) - 1] = '\0';
@@ -69,7 +69,7 @@ static int do_output(const char *tablename)
 
        h = ip6tc_init(tablename);
        if (!h)
-               exit_error(OTHER_PROBLEM, "Can't initialize: %s\n",
+               xtables_error(OTHER_PROBLEM, "Cannot initialize: %s\n",
                           ip6tc_strerror(errno));
 
        if (!show_binary) {
@@ -115,7 +115,7 @@ static int do_output(const char *tablename)
                printf("# Completed on %s", ctime(&now));
        } else {
                /* Binary, huh?  OK. */
-               exit_error(OTHER_PROBLEM, "Binary NYI\n");
+               xtables_error(OTHER_PROBLEM, "Binary NYI\n");
        }
 
        ip6tc_free(h);
index 7847ebcc583171669f38f4a780177399c835d5cc..87663ef32dd13f7db0a709ffbdf188377e0483d3 100644 (file)
@@ -361,7 +361,7 @@ generic_opt_check(int command, int options)
 
                        if (!(options & (1<<i))) {
                                if (commands_v_options[j][i] == '+')
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "You need to supply the `-%c' "
                                                   "option for this command\n",
                                                   optflags[i]);
@@ -373,7 +373,7 @@ generic_opt_check(int command, int options)
                        }
                }
                if (legal == -1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Illegal option `-%c' with this command\n",
                                   optflags[i]);
        }
@@ -402,9 +402,9 @@ add_command(unsigned int *cmd, const int newcmd, const int othercmds,
            int invert)
 {
        if (invert)
-               exit_error(PARAMETER_PROBLEM, "unexpected ! flag");
+               xtables_error(PARAMETER_PROBLEM, "unexpected '!' flag");
        if (*cmd & (~othercmds))
-               exit_error(PARAMETER_PROBLEM, "Can't use -%c with -%c\n",
+               xtables_error(PARAMETER_PROBLEM, "Cannot use -%c with -%c\n",
                           cmd2char(newcmd), cmd2char(*cmd & (~othercmds)));
        *cmd |= newcmd;
 }
@@ -452,7 +452,7 @@ parse_rulenumber(const char *rule)
        unsigned int rulenum;
 
        if (!xtables_strtoui(rule, NULL, &rulenum, 1, INT_MAX))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid rule number `%s'", rule);
 
        return rulenum;
@@ -464,17 +464,17 @@ parse_target(const char *targetname)
        const char *ptr;
 
        if (strlen(targetname) < 1)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid target name (too short)");
 
        if (strlen(targetname)+1 > sizeof(ip6t_chainlabel))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid target name `%s' (%u chars max)",
                           targetname, (unsigned int)sizeof(ip6t_chainlabel)-1);
 
        for (ptr = targetname; *ptr; ptr++)
                if (isspace(*ptr))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid target name `%s'", targetname);
        return targetname;
 }
@@ -484,7 +484,7 @@ set_option(unsigned int *options, unsigned int option, u_int8_t *invflg,
           int invert)
 {
        if (*options & option)
-               exit_error(PARAMETER_PROBLEM, "multiple -%c flags not allowed",
+               xtables_error(PARAMETER_PROBLEM, "multiple -%c flags not allowed",
                           opt2char(option));
        *options |= option;
 
@@ -493,7 +493,7 @@ set_option(unsigned int *options, unsigned int option, u_int8_t *invflg,
                for (i = 0; 1 << i != option; i++);
 
                if (!inverse_for_options[i])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "cannot have ! before -%c",
                                   opt2char(option));
                *invflg |= inverse_for_options[i];
@@ -1362,7 +1362,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                            && argv[optind][0] != '!')
                                rulenum = parse_rulenumber(argv[optind++]);
                        else
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "-%c requires a rule number",
                                           cmd2char(CMD_REPLACE));
                        break;
@@ -1421,11 +1421,11 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
 
                case 'N':
                        if (optarg && (*optarg == '-' || *optarg == '!'))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "chain name not allowed to start "
                                           "with `%c'\n", *optarg);
                        if (xtables_find_target(optarg, XTF_TRY_LOAD))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "chain name may not clash "
                                           "with target name\n");
                        add_command(&command, CMD_NEW_CHAIN, CMD_NONE,
@@ -1450,7 +1450,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                            && argv[optind][0] != '!')
                                newname = argv[optind++];
                        else
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "-%c requires old-chain-name and "
                                           "new-chain-name",
                                            cmd2char(CMD_RENAME_CHAIN));
@@ -1464,7 +1464,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                            && argv[optind][0] != '!')
                                policy = argv[optind++];
                        else
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "-%c requires a chain and a policy",
                                           cmd2char(CMD_SET_POLICY));
                        break;
@@ -1498,7 +1498,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
 
                        if (fw.ipv6.proto == 0
                            && (fw.ipv6.invflags & IP6T_INV_PROTO))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "rule would never match protocol");
 
                        if (is_exthdr(fw.ipv6.proto)
@@ -1556,7 +1556,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                                                     target->extra_opts,
                                                     &target->option_offset);
                                if (opts == NULL)
-                                       exit_error(OTHER_PROBLEM,
+                                       xtables_error(OTHER_PROBLEM,
                                                   "can't alloc memory!");
                        }
                        break;
@@ -1591,7 +1591,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                        size_t size;
 
                        if (invert)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "unexpected ! flag before --match");
 
                        m = xtables_find_match(optarg, XTF_LOAD_MUST_SUCCEED,
@@ -1617,7 +1617,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
 
                case 't':
                        if (invert)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "unexpected ! flag before --table");
                        *table = optarg;
                        break;
@@ -1656,18 +1656,18 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                            && argv[optind][0] != '!')
                                bcnt = argv[optind++];
                        if (!bcnt)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "-%c requires packet and byte counter",
                                        opt2char(OPT_COUNTERS));
 
                        if (sscanf(pcnt, "%llu", &cnt) != 1)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "-%c packet counter not numeric",
                                        opt2char(OPT_COUNTERS));
                        fw.counters.pcnt = cnt;
 
                        if (sscanf(bcnt, "%llu", &cnt) != 1)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "-%c byte counter not numeric",
                                        opt2char(OPT_COUNTERS));
                        fw.counters.bcnt = cnt;
@@ -1676,7 +1676,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                case 1: /* non option */
                        if (optarg[0] == '!' && optarg[1] == '\0') {
                                if (invert)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "multiple consecutive ! not"
                                                   " allowed");
                                invert = TRUE;
@@ -1763,21 +1763,21 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                                if (!m) {
                                        if (c == '?') {
                                                if (optopt) {
-                                                       exit_error(
+                                                       xtables_error(
                                                           PARAMETER_PROBLEM,
                                                           "option `%s' "
                                                           "requires an "
                                                           "argument",
                                                           argv[optind-1]);
                                                } else {
-                                                       exit_error(
+                                                       xtables_error(
                                                           PARAMETER_PROBLEM,
                                                           "unknown option "
                                                           "`%s'",
                                                           argv[optind-1]);
                                                }
                                        }
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Unknown arg `%s'", optarg);
                                }
                        }
@@ -1795,12 +1795,12 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
        /* Fix me: must put inverse options checking here --MN */
 
        if (optind < argc)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "unknown arguments found on commandline");
        if (!command)
-               exit_error(PARAMETER_PROBLEM, "no command specified");
+               xtables_error(PARAMETER_PROBLEM, "no command specified");
        if (invert)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "nothing appropriate following !");
 
        if (command & (CMD_REPLACE | CMD_INSERT | CMD_DELETE | CMD_APPEND)) {
@@ -1820,17 +1820,17 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
 
        if ((nsaddrs > 1 || ndaddrs > 1) &&
            (fw.ipv6.invflags & (IP6T_INV_SRCIP | IP6T_INV_DSTIP)))
-               exit_error(PARAMETER_PROBLEM, "! not allowed with multiple"
+               xtables_error(PARAMETER_PROBLEM, "! not allowed with multiple"
                           " source or destination IP addresses");
 
        if (command == CMD_REPLACE && (nsaddrs != 1 || ndaddrs != 1))
-               exit_error(PARAMETER_PROBLEM, "Replacement rule does not "
+               xtables_error(PARAMETER_PROBLEM, "Replacement rule does not "
                           "specify a unique address");
 
        generic_opt_check(command, options);
 
        if (chain && strlen(chain) > IP6T_FUNCTION_MAXNAMELEN)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "chain name `%s' too long (must be under %i chars)",
                           chain, IP6T_FUNCTION_MAXNAMELEN);
 
@@ -1843,7 +1843,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                *handle = ip6tc_init(*table);
 
        if (!*handle)
-               exit_error(VERSION_PROBLEM,
+               xtables_error(VERSION_PROBLEM,
                        "can't initialize ip6tables table `%s': %s",
                        *table, ip6tc_strerror(errno));
 
@@ -1855,7 +1855,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                    || strcmp(chain, "INPUT") == 0) {
                        /* -o not valid with incoming packets. */
                        if (options & OPT_VIANAMEOUT)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Can't use -%c with %s\n",
                                           opt2char(OPT_VIANAMEOUT),
                                           chain);
@@ -1865,7 +1865,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                    || strcmp(chain, "OUTPUT") == 0) {
                        /* -i not valid with outgoing packets */
                        if (options & OPT_VIANAMEIN)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Can't use -%c with %s\n",
                                           opt2char(OPT_VIANAMEIN),
                                           chain);
@@ -1908,7 +1908,7 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
                         * chain. */
 #ifdef IP6T_F_GOTO
                        if (fw.ipv6.flags & IP6T_F_GOTO)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                                "goto '%s' is not a chain\n", jumpto);
 #endif
                        xtables_find_target(jumpto, XTF_LOAD_MUST_SUCCEED);
index c8eb2e30f11c633d191303ce823b3884fb7ecbe1..f1c5e3ea3aaf5e0c6bf88bb70d84c556616ceb48 100644 (file)
@@ -71,7 +71,7 @@ static struct iptc_handle *create_handle(const char *tablename)
        }
 
        if (!handle) {
-               exit_error(PARAMETER_PROBLEM, "%s: unable to initialize "
+               xtables_error(PARAMETER_PROBLEM, "%s: unable to initialize "
                        "table '%s'\n", prog_name, tablename);
                exit(1);
        }
@@ -217,7 +217,7 @@ main(int argc, char *argv[])
                        table = strtok(buffer+1, " \t\n");
                        DEBUGP("line %u, table '%s'\n", line, table);
                        if (!table) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "%s: line %u table name invalid\n",
                                        prog_name, line);
                                exit(1);
@@ -253,7 +253,7 @@ main(int argc, char *argv[])
                        chain = strtok(buffer+1, " \t\n");
                        DEBUGP("line %u, chain '%s'\n", line, chain);
                        if (!chain) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "%s: line %u chain name invalid\n",
                                           prog_name, line);
                                exit(1);
@@ -263,14 +263,14 @@ main(int argc, char *argv[])
                                if (noflush && iptc_is_chain(chain, handle)) {
                                        DEBUGP("Flushing existing user defined chain '%s'\n", chain);
                                        if (!iptc_flush_entries(chain, handle))
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                           "error flushing chain "
                                                           "'%s':%s\n", chain,
                                                           strerror(errno));
                                } else {
                                        DEBUGP("Creating new chain '%s'\n", chain);
                                        if (!iptc_create_chain(chain, handle))
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                           "error creating chain "
                                                           "'%s':%s\n", chain,
                                                           strerror(errno));
@@ -280,7 +280,7 @@ main(int argc, char *argv[])
                        policy = strtok(NULL, " \t\n");
                        DEBUGP("line %u, policy '%s'\n", line, policy);
                        if (!policy) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "%s: line %u policy invalid\n",
                                           prog_name, line);
                                exit(1);
@@ -294,7 +294,7 @@ main(int argc, char *argv[])
                                        ctrs = strtok(NULL, " \t\n");
 
                                        if (!ctrs || !parse_counters(ctrs, &count))
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                           "invalid policy counters "
                                                           "for chain '%s'\n", chain);
 
@@ -308,7 +308,7 @@ main(int argc, char *argv[])
 
                                if (!iptc_set_policy(chain, policy, &count,
                                                     handle))
-                                       exit_error(OTHER_PROBLEM,
+                                       xtables_error(OTHER_PROBLEM,
                                                "Can't set policy `%s'"
                                                " on `%s' line %u: %s\n",
                                                chain, policy, line,
@@ -336,19 +336,19 @@ main(int argc, char *argv[])
                                /* we have counters in our input */
                                ptr = strchr(buffer, ']');
                                if (!ptr)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need ]\n",
                                                   line);
 
                                pcnt = strtok(buffer+1, ":");
                                if (!pcnt)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need :\n",
                                                   line);
 
                                bcnt = strtok(NULL, "]");
                                if (!bcnt)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need ]\n",
                                                   line);
 
@@ -415,7 +415,7 @@ main(int argc, char *argv[])
                                        /* check if table name specified */
                                        if (!strncmp(param_buffer, "-t", 2)
                                            || !strncmp(param_buffer, "--table", 8)) {
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                   "Line %u seems to have a "
                                                   "-t table option.\n", line);
                                                exit(1);
@@ -428,7 +428,7 @@ main(int argc, char *argv[])
                                        param_buffer[param_len++] = *curchar;
 
                                        if (param_len >= sizeof(param_buffer))
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                   "Parameter too long!");
                                }
                        }
index e2734356e596eef740485d3f0ab87ab68c63fd65..55cfe6a1472d96657104a0ae1b52cc22efed137c 100644 (file)
@@ -40,13 +40,13 @@ static int for_each_table(int (*func)(const char *tablename))
 
        procfile = fopen("/proc/net/ip_tables_names", "r");
        if (!procfile)
-               exit_error(OTHER_PROBLEM,
+               xtables_error(OTHER_PROBLEM,
                           "Unable to open /proc/net/ip_tables_names: %s\n",
                           strerror(errno));
 
        while (fgets(tablename, sizeof(tablename), procfile)) {
                if (tablename[strlen(tablename) - 1] != '\n')
-                       exit_error(OTHER_PROBLEM, 
+                       xtables_error(OTHER_PROBLEM,
                                   "Badly formed tablename `%s'\n",
                                   tablename);
                tablename[strlen(tablename) - 1] = '\0';
@@ -67,7 +67,7 @@ static int do_output(const char *tablename)
 
        h = iptc_init(tablename);
        if (!h)
-               exit_error(OTHER_PROBLEM, "Can't initialize: %s\n",
+               xtables_error(OTHER_PROBLEM, "Cannot initialize: %s\n",
                           iptc_strerror(errno));
 
        if (!show_binary) {
@@ -113,7 +113,7 @@ static int do_output(const char *tablename)
                printf("# Completed on %s", ctime(&now));
        } else {
                /* Binary, huh?  OK. */
-               exit_error(OTHER_PROBLEM, "Binary NYI\n");
+               xtables_error(OTHER_PROBLEM, "Binary NYI\n");
        }
 
        iptc_free(h);
index f1837ed0febd67add4a90cabeb84b8461c3a7d46..543715b4aec3737933f98563e020f3848e5fec7f 100644 (file)
@@ -296,7 +296,7 @@ static void
 saveChain(char *chain, char *policy, struct ipt_counters *ctr)
 {
        if (nextChain >= maxChains) {
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "%s: line %u chain name invalid\n",
                           prog_name, line);
                exit(1);
@@ -697,7 +697,7 @@ main(int argc, char *argv[])
                        table = strtok(buffer + 1, " \t\n");
                        DEBUGP("line %u, table '%s'\n", line, table);
                        if (!table) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "%s: line %u table name invalid\n",
                                           prog_name, line);
                                exit(1);
@@ -714,7 +714,7 @@ main(int argc, char *argv[])
                        chain = strtok(buffer + 1, " \t\n");
                        DEBUGP("line %u, chain '%s'\n", line, chain);
                        if (!chain) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "%s: line %u chain name invalid\n",
                                           prog_name, line);
                                exit(1);
@@ -725,7 +725,7 @@ main(int argc, char *argv[])
                        policy = strtok(NULL, " \t\n");
                        DEBUGP("line %u, policy '%s'\n", line, policy);
                        if (!policy) {
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "%s: line %u policy invalid\n",
                                           prog_name, line);
                                exit(1);
@@ -755,19 +755,19 @@ main(int argc, char *argv[])
                                /* we have counters in our input */
                                ptr = strchr(buffer, ']');
                                if (!ptr)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need ]\n",
                                                   line);
 
                                pcnt = strtok(buffer + 1, ":");
                                if (!pcnt)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need :\n",
                                                   line);
 
                                bcnt = strtok(NULL, "]");
                                if (!bcnt)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Bad line %u: need ]\n",
                                                   line);
 
@@ -827,7 +827,7 @@ main(int argc, char *argv[])
                                        if (!strncmp(param_buffer, "-t", 3)
                                            || !strncmp(param_buffer,
                                                        "--table", 8)) {
-                                               exit_error(PARAMETER_PROBLEM,
+                                               xtables_error(PARAMETER_PROBLEM,
                                                           "Line %u seems to have a "
                                                           "-t table option.\n",
                                                           line);
index 8448c18a9c097e62d7623ad86b1aa8a3a351997d..bd177c73eca337443fc940db5cbb5a48eea115f1 100644 (file)
@@ -375,7 +375,7 @@ generic_opt_check(int command, int options)
 
                        if (!(options & (1<<i))) {
                                if (commands_v_options[j][i] == '+')
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "You need to supply the `-%c' "
                                                   "option for this command\n",
                                                   optflags[i]);
@@ -387,7 +387,7 @@ generic_opt_check(int command, int options)
                        }
                }
                if (legal == -1)
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Illegal option `-%c' with this command\n",
                                   optflags[i]);
        }
@@ -416,9 +416,9 @@ add_command(unsigned int *cmd, const int newcmd, const int othercmds,
            int invert)
 {
        if (invert)
-               exit_error(PARAMETER_PROBLEM, "unexpected ! flag");
+               xtables_error(PARAMETER_PROBLEM, "unexpected ! flag");
        if (*cmd & (~othercmds))
-               exit_error(PARAMETER_PROBLEM, "Can't use -%c with -%c\n",
+               xtables_error(PARAMETER_PROBLEM, "Cannot use -%c with -%c\n",
                           cmd2char(newcmd), cmd2char(*cmd & (~othercmds)));
        *cmd |= newcmd;
 }
@@ -457,7 +457,7 @@ parse_rulenumber(const char *rule)
        unsigned int rulenum;
 
        if (!xtables_strtoui(rule, NULL, &rulenum, 1, INT_MAX))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid rule number `%s'", rule);
 
        return rulenum;
@@ -469,17 +469,17 @@ parse_target(const char *targetname)
        const char *ptr;
 
        if (strlen(targetname) < 1)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid target name (too short)");
 
        if (strlen(targetname)+1 > sizeof(ipt_chainlabel))
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "Invalid target name `%s' (%u chars max)",
                           targetname, (unsigned int)sizeof(ipt_chainlabel)-1);
 
        for (ptr = targetname; *ptr; ptr++)
                if (isspace(*ptr))
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "Invalid target name `%s'", targetname);
        return targetname;
 }
@@ -489,7 +489,7 @@ set_option(unsigned int *options, unsigned int option, u_int8_t *invflg,
           int invert)
 {
        if (*options & option)
-               exit_error(PARAMETER_PROBLEM, "multiple -%c flags not allowed",
+               xtables_error(PARAMETER_PROBLEM, "multiple -%c flags not allowed",
                           opt2char(option));
        *options |= option;
 
@@ -498,7 +498,7 @@ set_option(unsigned int *options, unsigned int option, u_int8_t *invflg,
                for (i = 0; 1 << i != option; i++);
 
                if (!inverse_for_options[i])
-                       exit_error(PARAMETER_PROBLEM,
+                       xtables_error(PARAMETER_PROBLEM,
                                   "cannot have ! before -%c",
                                   opt2char(option));
                *invflg |= inverse_for_options[i];
@@ -1385,7 +1385,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                            && argv[optind][0] != '!')
                                rulenum = parse_rulenumber(argv[optind++]);
                        else
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "-%c requires a rule number",
                                           cmd2char(CMD_REPLACE));
                        break;
@@ -1444,11 +1444,11 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
 
                case 'N':
                        if (optarg && (*optarg == '-' || *optarg == '!'))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "chain name not allowed to start "
                                           "with `%c'\n", *optarg);
                        if (xtables_find_target(optarg, XTF_TRY_LOAD))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "chain name may not clash "
                                           "with target name\n");
                        add_command(&command, CMD_NEW_CHAIN, CMD_NONE,
@@ -1473,7 +1473,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                            && argv[optind][0] != '!')
                                newname = argv[optind++];
                        else
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "-%c requires old-chain-name and "
                                           "new-chain-name",
                                            cmd2char(CMD_RENAME_CHAIN));
@@ -1487,7 +1487,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                            && argv[optind][0] != '!')
                                policy = argv[optind++];
                        else
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "-%c requires a chain and a policy",
                                           cmd2char(CMD_SET_POLICY));
                        break;
@@ -1520,7 +1520,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
 
                        if (fw.ip.proto == 0
                            && (fw.ip.invflags & IPT_INV_PROTO))
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "rule would never match protocol");
                        break;
 
@@ -1571,7 +1571,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                                                     target->extra_opts,
                                                     &target->option_offset);
                                if (opts == NULL)
-                                       exit_error(OTHER_PROBLEM,
+                                       xtables_error(OTHER_PROBLEM,
                                                   "can't alloc memory!");
                        }
                        break;
@@ -1612,7 +1612,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                        size_t size;
 
                        if (invert)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "unexpected ! flag before --match");
 
                        m = xtables_find_match(optarg, XTF_LOAD_MUST_SUCCEED,
@@ -1631,7 +1631,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                                                     m->extra_opts,
                                                     &m->option_offset);
                                if (opts == NULL)
-                                       exit_error(OTHER_PROBLEM,
+                                       xtables_error(OTHER_PROBLEM,
                                                   "can't alloc memory!");
                        }
                }
@@ -1644,7 +1644,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
 
                case 't':
                        if (invert)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "unexpected ! flag before --table");
                        *table = optarg;
                        break;
@@ -1683,18 +1683,18 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                            && argv[optind][0] != '!')
                                bcnt = argv[optind++];
                        if (!bcnt)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "-%c requires packet and byte counter",
                                        opt2char(OPT_COUNTERS));
 
                        if (sscanf(pcnt, "%llu", &cnt) != 1)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "-%c packet counter not numeric",
                                        opt2char(OPT_COUNTERS));
                        fw.counters.pcnt = cnt;
 
                        if (sscanf(bcnt, "%llu", &cnt) != 1)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                        "-%c byte counter not numeric",
                                        opt2char(OPT_COUNTERS));
                        fw.counters.bcnt = cnt;
@@ -1704,7 +1704,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                case 1: /* non option */
                        if (optarg[0] == '!' && optarg[1] == '\0') {
                                if (invert)
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "multiple consecutive ! not"
                                                   " allowed");
                                invert = TRUE;
@@ -1785,7 +1785,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                                                             m->extra_opts,
                                                             &m->option_offset);
                                        if (opts == NULL)
-                                               exit_error(OTHER_PROBLEM,
+                                               xtables_error(OTHER_PROBLEM,
                                                        "can't alloc memory!");
 
                                        optind--;
@@ -1794,21 +1794,21 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                                if (!m) {
                                        if (c == '?') {
                                                if (optopt) {
-                                                       exit_error(
+                                                       xtables_error(
                                                           PARAMETER_PROBLEM,
                                                           "option `%s' "
                                                           "requires an "
                                                           "argument",
                                                           argv[optind-1]);
                                                } else {
-                                                       exit_error(
+                                                       xtables_error(
                                                           PARAMETER_PROBLEM,
                                                           "unknown option "
                                                           "`%s'",
                                                           argv[optind-1]);
                                                }
                                        }
-                                       exit_error(PARAMETER_PROBLEM,
+                                       xtables_error(PARAMETER_PROBLEM,
                                                   "Unknown arg `%s'", optarg);
                                }
                        }
@@ -1834,12 +1834,12 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
        /* Fix me: must put inverse options checking here --MN */
 
        if (optind < argc)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "unknown arguments found on commandline");
        if (!command)
-               exit_error(PARAMETER_PROBLEM, "no command specified");
+               xtables_error(PARAMETER_PROBLEM, "no command specified");
        if (invert)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "nothing appropriate following !");
 
        if (command & (CMD_REPLACE | CMD_INSERT | CMD_DELETE | CMD_APPEND)) {
@@ -1859,17 +1859,17 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
 
        if ((nsaddrs > 1 || ndaddrs > 1) &&
            (fw.ip.invflags & (IPT_INV_SRCIP | IPT_INV_DSTIP)))
-               exit_error(PARAMETER_PROBLEM, "! not allowed with multiple"
+               xtables_error(PARAMETER_PROBLEM, "! not allowed with multiple"
                           " source or destination IP addresses");
 
        if (command == CMD_REPLACE && (nsaddrs != 1 || ndaddrs != 1))
-               exit_error(PARAMETER_PROBLEM, "Replacement rule does not "
+               xtables_error(PARAMETER_PROBLEM, "Replacement rule does not "
                           "specify a unique address");
 
        generic_opt_check(command, options);
 
        if (chain && strlen(chain) > IPT_FUNCTION_MAXNAMELEN)
-               exit_error(PARAMETER_PROBLEM,
+               xtables_error(PARAMETER_PROBLEM,
                           "chain name `%s' too long (must be under %i chars)",
                           chain, IPT_FUNCTION_MAXNAMELEN);
 
@@ -1882,7 +1882,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                *handle = iptc_init(*table);
 
        if (!*handle)
-               exit_error(VERSION_PROBLEM,
+               xtables_error(VERSION_PROBLEM,
                           "can't initialize iptables table `%s': %s",
                           *table, iptc_strerror(errno));
 
@@ -1894,7 +1894,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                    || strcmp(chain, "INPUT") == 0) {
                        /* -o not valid with incoming packets. */
                        if (options & OPT_VIANAMEOUT)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Can't use -%c with %s\n",
                                           opt2char(OPT_VIANAMEOUT),
                                           chain);
@@ -1904,7 +1904,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                    || strcmp(chain, "OUTPUT") == 0) {
                        /* -i not valid with outgoing packets */
                        if (options & OPT_VIANAMEIN)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "Can't use -%c with %s\n",
                                           opt2char(OPT_VIANAMEIN),
                                           chain);
@@ -1950,7 +1950,7 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
                         * chain. */
 #ifdef IPT_F_GOTO
                        if (fw.ip.flags & IPT_F_GOTO)
-                               exit_error(PARAMETER_PROBLEM,
+                               xtables_error(PARAMETER_PROBLEM,
                                           "goto '%s' is not a chain\n", jumpto);
 #endif
                        xtables_find_target(jumpto, XTF_LOAD_MUST_SUCCEED);