]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Removes some KERNEL_64_USERSPACE_32 because linux 2.6 has compat layer
authorYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Thu, 28 Jun 2007 16:41:50 +0000 (16:41 +0000)
committerYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Thu, 28 Jun 2007 16:41:50 +0000 (16:41 +0000)
16 files changed:
extensions/libip6t_MARK.c
extensions/libip6t_mark.c
extensions/libipt_MARK.c
extensions/libipt_ULOG.c
extensions/libipt_conntrack.c
extensions/libipt_mark.c
include/linux/netfilter_ipv4/ipt_CONNMARK.h
include/linux/netfilter_ipv4/ipt_MARK.h
include/linux/netfilter_ipv4/ipt_ULOG.h
include/linux/netfilter_ipv4/ipt_connmark.h
include/linux/netfilter_ipv4/ipt_conntrack.h
include/linux/netfilter_ipv4/ipt_limit.h
include/linux/netfilter_ipv4/ipt_mark.h
include/linux/netfilter_ipv6/ip6t_MARK.h
include/linux/netfilter_ipv6/ip6t_limit.h
include/linux/netfilter_ipv6/ip6t_mark.h

index a7f1a9d49fc90cbe16b71a474b547f7ae8073623..0b043fb13e6d0e9e07518259a25286a86f85d896 100644 (file)
@@ -43,13 +43,8 @@ parse(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-#ifdef KERNEL_64_USERSPACE_32
-               if (string_to_number_ll(optarg, 0, 0, 
-                                    &markinfo->mark))
-#else
                if (string_to_number_l(optarg, 0, 0, 
                                     &markinfo->mark))
-#endif
                        exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
                if (*flags)
                        exit_error(PARAMETER_PROBLEM,
@@ -72,19 +67,11 @@ final_check(unsigned int flags)
                           "MARK target: Parameter --set-mark is required");
 }
 
-#ifdef KERNEL_64_USERSPACE_32
-static void
-print_mark(unsigned long long mark)
-{
-       printf("0x%llx ", mark);
-}
-#else
 static void
 print_mark(unsigned long mark)
 {
        printf("0x%lx ", mark);
 }
-#endif
 
 /* Prints out the targinfo. */
 static void
index b831cfe47596f145265df2439ce29919fc1c62c3..9c7f1371c8edecdc71987477f1c3912a3108aee6 100644 (file)
@@ -39,19 +39,11 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                char *end;
        case '1':
                check_inverse(optarg, &invert, &optind, 0);
-#ifdef KERNEL_64_USERSPACE_32
-               markinfo->mark = strtoull(optarg, &end, 0);
-               if (*end == '/') {
-                       markinfo->mask = strtoull(end+1, &end, 0);
-               } else
-                       markinfo->mask = 0xffffffffffffffffULL;
-#else
                markinfo->mark = strtoul(optarg, &end, 0);
                if (*end == '/') {
                        markinfo->mask = strtoul(end+1, &end, 0);
                } else
                        markinfo->mask = 0xffffffff;
-#endif
                if (*end != '\0' || end == optarg)
                        exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
                if (invert)
@@ -65,16 +57,6 @@ parse(int c, char **argv, int invert, unsigned int *flags,
        return 1;
 }
 
-#ifdef KERNEL_64_USERSPACE_32
-static void
-print_mark(unsigned long long mark, unsigned long long mask, int numeric)
-{
-       if(mask != 0xffffffffffffffffULL)
-               printf("0x%llx/0x%llx ", mark, mask);
-       else
-               printf("0x%llx ", mark);
-}
-#else
 static void
 print_mark(unsigned long mark, unsigned long mask, int numeric)
 {
@@ -83,7 +65,6 @@ print_mark(unsigned long mark, unsigned long mask, int numeric)
        else
                printf("0x%lx ", mark);
 }
-#endif
 
 /* Final check; must have specified --mark. */
 static void
index 457f6ad393886bc5aed7f1afc4957ec95b88a863..b8413522e9fcb12d80fd06464301d63729d57aff 100644 (file)
@@ -47,13 +47,8 @@ parse_v0(int c, char **argv, int invert, unsigned int *flags,
 
        switch (c) {
        case '1':
-#ifdef KERNEL_64_USERSPACE_32
-               if (string_to_number_ll(optarg, 0, 0, 
-                                    &markinfo->mark))
-#else
                if (string_to_number_l(optarg, 0, 0, 
                                     &markinfo->mark))
-#endif
                        exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
                if (*flags)
                        exit_error(PARAMETER_PROBLEM,
@@ -106,11 +101,7 @@ parse_v1(int c, char **argv, int invert, unsigned int *flags,
                return 0;
        }
 
-#ifdef KERNEL_64_USERSPACE_32
-       if (string_to_number_ll(optarg, 0, 0,  &markinfo->mark))
-#else
        if (string_to_number_l(optarg, 0, 0, &markinfo->mark))
-#endif
                exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
 
        if (*flags)
@@ -121,19 +112,11 @@ parse_v1(int c, char **argv, int invert, unsigned int *flags,
        return 1;
 }
 
-#ifdef KERNEL_64_USERSPACE_32
-static void
-print_mark(unsigned long long mark)
-{
-       printf("0x%llx ", mark);
-}
-#else
 static void
 print_mark(unsigned long mark)
 {
        printf("0x%lx ", mark);
 }
-#endif
 
 /* Prints out the targinfo. */
 static void
index a73b685fcde32ce75f0c6425e3a46cd71ad31c17..f783f9671bcc9e4e02b5b7f018951fc76aaa0986 100644 (file)
@@ -128,11 +128,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags,
                if (atoi(optarg) < 0)
                        exit_error(PARAMETER_PROBLEM,
                                   "Negative copy range?");
-#ifdef KERNEL_64_USERSPACE_32
-               loginfo->copy_range = (unsigned long long)atoll(optarg);
-#else
                loginfo->copy_range = atoi(optarg);
-#endif
                *flags |= IPT_LOG_OPT_CPRANGE;
                break;
        case 'B':
@@ -145,11 +141,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags,
                if (atoi(optarg) > ULOG_MAX_QLEN)
                        exit_error(PARAMETER_PROBLEM,
                                   "Maximum queue length exceeded");
-#ifdef KERNEL_64_USERSPACE_32
-               loginfo->qthreshold = (unsigned long long)atoll(optarg);
-#else
                loginfo->qthreshold = atoi(optarg);
-#endif
                *flags |= IPT_LOG_OPT_QTHRESHOLD;
                break;
        default:
@@ -177,19 +169,11 @@ static void save(const struct ipt_ip *ip,
                printf("--ulog-nlgroup ");
                print_groups(loginfo->nl_group);
        }
-#ifdef KERNEL_64_USERSPACE_32
-       if (loginfo->copy_range)
-               printf("--ulog-cprange %llu ", loginfo->copy_range);
-
-       if (loginfo->qthreshold != ULOG_DEFAULT_QTHRESHOLD)
-               printf("--ulog-qthreshold %llu ", loginfo->qthreshold);
-#else
        if (loginfo->copy_range)
                printf("--ulog-cprange %u ", (unsigned int)loginfo->copy_range);
 
        if (loginfo->qthreshold != ULOG_DEFAULT_QTHRESHOLD)
                printf("--ulog-qthreshold %u ", (unsigned int)loginfo->qthreshold);
-#endif
 }
 
 /* Prints out the targinfo. */
@@ -201,19 +185,11 @@ print(const struct ipt_ip *ip,
            = (const struct ipt_ulog_info *) target->data;
 
        printf("ULOG ");
-#ifdef KERNEL_64_USERSPACE_32
-       printf("copy_range %llu nlgroup ", loginfo->copy_range);
-#else
        printf("copy_range %u nlgroup ", (unsigned int)loginfo->copy_range);
-#endif
        print_groups(loginfo->nl_group);
        if (strcmp(loginfo->prefix, "") != 0)
                printf("prefix `%s' ", loginfo->prefix);
-#ifdef KERNEL_64_USERSPACE_32
-       printf("queue_threshold %llu ", loginfo->qthreshold);
-#else
        printf("queue_threshold %u ", (unsigned int)loginfo->qthreshold);
-#endif
 }
 
 static struct iptables_target ulog = {
index 2b62a8cd67ce94c0f7ce68ab5a013e671cb6d5cb..7914d395c28c24a07cf8004d68905e7729c41292 100644 (file)
@@ -127,18 +127,6 @@ parse_statuses(const char *arg, struct ipt_conntrack_info *sinfo)
                exit_error(PARAMETER_PROBLEM, "Bad ctstatus `%s'", arg);
 }
 
-#ifdef KERNEL_64_USERSPACE_32
-static unsigned long long
-parse_expire(const char *s)
-{
-       unsigned long long len;
-       
-       if (string_to_number_ll(s, 0, 0, &len) == -1)
-               exit_error(PARAMETER_PROBLEM, "expire value invalid: `%s'\n", s);
-       else
-               return len;
-}
-#else
 static unsigned long
 parse_expire(const char *s)
 {
@@ -149,7 +137,6 @@ parse_expire(const char *s)
        else
                return len;
 }
-#endif
 
 /* If a single value is provided, min and max are both set to the value */
 static void
@@ -172,13 +159,8 @@ parse_expires(const char *s, struct ipt_conntrack_info *sinfo)
        
        if (sinfo->expires_min > sinfo->expires_max)
                exit_error(PARAMETER_PROBLEM,
-#ifdef KERNEL_64_USERSPACE_32
-                          "expire min. range value `%llu' greater than max. "
-                          "range value `%llu'", sinfo->expires_min, sinfo->expires_max);
-#else
                           "expire min. range value `%lu' greater than max. "
                           "range value `%lu'", sinfo->expires_min, sinfo->expires_max);
-#endif
 }
 
 /* Function which parses command options; returns true if it
@@ -500,17 +482,10 @@ matchinfo_print(const struct ipt_ip *ip, const struct ipt_entry_match *match, in
                if (sinfo->invflags & IPT_CONNTRACK_EXPIRES)
                        printf("! ");
 
-#ifdef KERNEL_64_USERSPACE_32
-               if (sinfo->expires_max == sinfo->expires_min)
-                       printf("%llu ", sinfo->expires_min);
-               else
-                       printf("%llu:%llu ", sinfo->expires_min, sinfo->expires_max);
-#else
                if (sinfo->expires_max == sinfo->expires_min)
                        printf("%lu ", sinfo->expires_min);
                else
                        printf("%lu:%lu ", sinfo->expires_min, sinfo->expires_max);
-#endif
        }
 }
 
index 1922768e0e2cdd5ab1deca2d652174013d6ced7e..10dfad5e4cd14e6f1eb692fcf6c4dfbb745940f4 100644 (file)
@@ -39,19 +39,11 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                char *end;
        case '1':
                check_inverse(optarg, &invert, &optind, 0);
-#ifdef KERNEL_64_USERSPACE_32
-               markinfo->mark = strtoull(optarg, &end, 0);
-               if (*end == '/') {
-                       markinfo->mask = strtoull(end+1, &end, 0);
-               } else
-                       markinfo->mask = 0xffffffffffffffffULL;
-#else
                markinfo->mark = strtoul(optarg, &end, 0);
                if (*end == '/') {
                        markinfo->mask = strtoul(end+1, &end, 0);
                } else
                        markinfo->mask = 0xffffffff;
-#endif
                if (*end != '\0' || end == optarg)
                        exit_error(PARAMETER_PROBLEM, "Bad MARK value `%s'", optarg);
                if (invert)
@@ -65,16 +57,6 @@ parse(int c, char **argv, int invert, unsigned int *flags,
        return 1;
 }
 
-#ifdef KERNEL_64_USERSPACE_32
-static void
-print_mark(unsigned long long mark, unsigned long long mask, int numeric)
-{
-       if(mask != 0xffffffffffffffffULL)
-               printf("0x%llx/0x%llx ", mark, mask);
-       else
-               printf("0x%llx ", mark);
-}
-#else
 static void
 print_mark(unsigned long mark, unsigned long mask, int numeric)
 {
@@ -83,7 +65,6 @@ print_mark(unsigned long mark, unsigned long mask, int numeric)
        else
                printf("0x%lx ", mark);
 }
-#endif
 
 /* Final check; must have specified --mark. */
 static void
index 0148539be73e7ca77e0dcdddbf4bf73526f62852..d3c02536fc4c471063f56930673cc24a94ede8cb 100644 (file)
@@ -17,13 +17,8 @@ enum {
 };
 
 struct ipt_connmark_target_info {
-#ifdef KERNEL_64_USERSPACE_32
-       unsigned long long mark;
-       unsigned long long mask;
-#else
        unsigned long mark;
        unsigned long mask;
-#endif
        u_int8_t mode;
 };
 
index 3694e488c477a5dd06264969f7a0ec26558a0bec..1b6502fb1349f09f0b7791babbc756669dc2d385 100644 (file)
@@ -2,11 +2,7 @@
 #define _IPT_MARK_H_target
 
 struct ipt_mark_target_info {
-#ifdef KERNEL_64_USERSPACE_32
-       unsigned long long mark;
-#else
        unsigned long mark;
-#endif
 };
 
 enum {
@@ -16,11 +12,7 @@ enum {
 };
 
 struct ipt_mark_target_info_v1 {
-#ifdef KERNEL_64_USERSPACE_32
-       unsigned long long mark;
-#else
        unsigned long mark;
-#endif
        u_int8_t mode;
 };
 
index f267ab8e4ae9143cec0a417c1959e4088e23bab3..417aad280bccd61082a5584774c56479c1c3588f 100644 (file)
 /* private data structure for each rule with a ULOG target */
 struct ipt_ulog_info {
        unsigned int nl_group;
-#ifdef KERNEL_64_USERSPACE_32
-       unsigned long long copy_range;
-       unsigned long long qthreshold;
-#else
        size_t copy_range;
        size_t qthreshold;
-#endif
        char prefix[ULOG_PREFIX_LEN];
 };
 
index 151e2687080cc985329cd76df3747fb4523104a4..46573270d9aa23781d0d2dd4a2bbf3688149b24b 100644 (file)
  */
 
 struct ipt_connmark_info {
-#ifdef KERNEL_64_USERSPACE_32
-       unsigned long long mark, mask;
-#else
        unsigned long mark, mask;
-#endif
        u_int8_t invert;
 };
 
index c8661b88b0be1b7048d9ab3ba1dd440523114aac..54a9985140783c5ada553a15fed7735317d249cc 100644 (file)
@@ -67,11 +67,7 @@ struct ipt_conntrack_info
        struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX];
        struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX];
 
-#ifdef KERNEL_64_USERSPACE_32
-       unsigned long long expires_min, expires_max;
-#else
        unsigned long expires_min, expires_max;
-#endif
 
        /* Flags word */
        u_int8_t flags;
index e2fb1660d147aae65f07641383ba0de0d68b69a1..f46d4b4e44952e77184b2215ea7c3ba4e826fd94 100644 (file)
@@ -10,15 +10,10 @@ struct ipt_rateinfo {
        u_int32_t avg;    /* Average secs between packets * scale */
        u_int32_t burst;  /* Period multiplier for upper limit. */
 
-#ifdef KERNEL_64_USERSPACE_32
-       u_int64_t prev;
-       u_int64_t placeholder;
-#else
        /* Used internally by the kernel */
        unsigned long prev;
        /* Ugly, ugly fucker. */
        struct ipt_rateinfo *master;
-#endif
 
        u_int32_t credit;
        u_int32_t credit_cap, cost;
index b9e79fd2c46284fe38966629339407a66f18826f..f3952b563d4cbceb53f2da2c8192cc9e433943f6 100644 (file)
@@ -2,11 +2,7 @@
 #define _IPT_MARK_H
 
 struct ipt_mark_info {
-#ifdef KERNEL_64_USERSPACE_32
-    unsigned long long mark, mask;
-#else
     unsigned long mark, mask;
-#endif
     u_int8_t invert;
 };
 
index 06949b82f70a7f39be75526bdad903e4e9cc6a4d..7ade8d8f52468c5725249b296ab55a62d89f1cae 100644 (file)
@@ -2,11 +2,7 @@
 #define _IP6T_MARK_H_target
 
 struct ip6t_mark_target_info {
-#ifdef KERNEL_64_USERSPACE_32
-       unsigned long long mark;
-#else
        unsigned long mark;
-#endif
 };
 
 #endif /*_IPT_MARK_H_target*/
index cd3e834736849e41a536fbd17beda97f02f33ef5..6e17a677982a265b857d57d49f919e0e1d6f6b8b 100644 (file)
@@ -10,15 +10,11 @@ struct ip6t_rateinfo {
        u_int32_t avg;    /* Average secs between packets * scale */
        u_int32_t burst;  /* Period multiplier for upper limit. */
 
-#ifdef KERNEL_64_USERSPACE_32
-       u_int64_t prev;
-       u_int64_t placeholder;
-#else
        /* Used internally by the kernel */
        unsigned long prev;
        /* Ugly, ugly fucker. */
        struct ip6t_rateinfo *master;
-#endif
+
        u_int32_t credit;
        u_int32_t credit_cap, cost;
 };
index 7ede185e6d0995f4715e08837a37434fd2217b76..917c2435dc3c520974a0a050f446a9a0417f81b1 100644 (file)
@@ -2,12 +2,8 @@
 #define _IP6T_MARK_H
 
 struct ip6t_mark_info {
-#ifdef KERNEL_64_USERSPACE_32
-    unsigned long long mark, mask;
-#else
-    unsigned long mark, mask;
-#endif
-    u_int8_t invert;
+       unsigned long mark, mask;
+       u_int8_t invert;
 };
 
 #endif /*_IPT_MARK_H*/