From fde395370ead306b770a3d4685e4bc1d6972266d Mon Sep 17 00:00:00 2001 From: Yasuyuki KOZAKAI Date: Thu, 28 Jun 2007 16:41:50 +0000 Subject: Removes some KERNEL_64_USERSPACE_32 because linux 2.6 has compat layer --- extensions/libip6t_MARK.c | 13 ------------- extensions/libip6t_mark.c | 19 ------------------- extensions/libipt_MARK.c | 17 ----------------- extensions/libipt_ULOG.c | 24 ------------------------ extensions/libipt_conntrack.c | 25 ------------------------- extensions/libipt_mark.c | 19 ------------------- include/linux/netfilter_ipv4/ipt_CONNMARK.h | 5 ----- include/linux/netfilter_ipv4/ipt_MARK.h | 8 -------- include/linux/netfilter_ipv4/ipt_ULOG.h | 5 ----- include/linux/netfilter_ipv4/ipt_connmark.h | 4 ---- include/linux/netfilter_ipv4/ipt_conntrack.h | 4 ---- include/linux/netfilter_ipv4/ipt_limit.h | 5 ----- include/linux/netfilter_ipv4/ipt_mark.h | 4 ---- include/linux/netfilter_ipv6/ip6t_MARK.h | 4 ---- include/linux/netfilter_ipv6/ip6t_limit.h | 6 +----- include/linux/netfilter_ipv6/ip6t_mark.h | 8 ++------ 16 files changed, 3 insertions(+), 167 deletions(-) diff --git a/extensions/libip6t_MARK.c b/extensions/libip6t_MARK.c index a7f1a9d4..0b043fb1 100644 --- a/extensions/libip6t_MARK.c +++ b/extensions/libip6t_MARK.c @@ -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 diff --git a/extensions/libip6t_mark.c b/extensions/libip6t_mark.c index b831cfe4..9c7f1371 100644 --- a/extensions/libip6t_mark.c +++ b/extensions/libip6t_mark.c @@ -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 diff --git a/extensions/libipt_MARK.c b/extensions/libipt_MARK.c index 457f6ad3..b8413522 100644 --- a/extensions/libipt_MARK.c +++ b/extensions/libipt_MARK.c @@ -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 diff --git a/extensions/libipt_ULOG.c b/extensions/libipt_ULOG.c index a73b685f..f783f967 100644 --- a/extensions/libipt_ULOG.c +++ b/extensions/libipt_ULOG.c @@ -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 = { diff --git a/extensions/libipt_conntrack.c b/extensions/libipt_conntrack.c index 2b62a8cd..7914d395 100644 --- a/extensions/libipt_conntrack.c +++ b/extensions/libipt_conntrack.c @@ -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 } } diff --git a/extensions/libipt_mark.c b/extensions/libipt_mark.c index 1922768e..10dfad5e 100644 --- a/extensions/libipt_mark.c +++ b/extensions/libipt_mark.c @@ -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 diff --git a/include/linux/netfilter_ipv4/ipt_CONNMARK.h b/include/linux/netfilter_ipv4/ipt_CONNMARK.h index 0148539b..d3c02536 100644 --- a/include/linux/netfilter_ipv4/ipt_CONNMARK.h +++ b/include/linux/netfilter_ipv4/ipt_CONNMARK.h @@ -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; }; diff --git a/include/linux/netfilter_ipv4/ipt_MARK.h b/include/linux/netfilter_ipv4/ipt_MARK.h index 3694e488..1b6502fb 100644 --- a/include/linux/netfilter_ipv4/ipt_MARK.h +++ b/include/linux/netfilter_ipv4/ipt_MARK.h @@ -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; }; diff --git a/include/linux/netfilter_ipv4/ipt_ULOG.h b/include/linux/netfilter_ipv4/ipt_ULOG.h index f267ab8e..417aad28 100644 --- a/include/linux/netfilter_ipv4/ipt_ULOG.h +++ b/include/linux/netfilter_ipv4/ipt_ULOG.h @@ -26,13 +26,8 @@ /* 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]; }; diff --git a/include/linux/netfilter_ipv4/ipt_connmark.h b/include/linux/netfilter_ipv4/ipt_connmark.h index 151e2687..46573270 100644 --- a/include/linux/netfilter_ipv4/ipt_connmark.h +++ b/include/linux/netfilter_ipv4/ipt_connmark.h @@ -11,11 +11,7 @@ */ struct ipt_connmark_info { -#ifdef KERNEL_64_USERSPACE_32 - unsigned long long mark, mask; -#else unsigned long mark, mask; -#endif u_int8_t invert; }; diff --git a/include/linux/netfilter_ipv4/ipt_conntrack.h b/include/linux/netfilter_ipv4/ipt_conntrack.h index c8661b88..54a99851 100644 --- a/include/linux/netfilter_ipv4/ipt_conntrack.h +++ b/include/linux/netfilter_ipv4/ipt_conntrack.h @@ -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; diff --git a/include/linux/netfilter_ipv4/ipt_limit.h b/include/linux/netfilter_ipv4/ipt_limit.h index e2fb1660..f46d4b4e 100644 --- a/include/linux/netfilter_ipv4/ipt_limit.h +++ b/include/linux/netfilter_ipv4/ipt_limit.h @@ -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; diff --git a/include/linux/netfilter_ipv4/ipt_mark.h b/include/linux/netfilter_ipv4/ipt_mark.h index b9e79fd2..f3952b56 100644 --- a/include/linux/netfilter_ipv4/ipt_mark.h +++ b/include/linux/netfilter_ipv4/ipt_mark.h @@ -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; }; diff --git a/include/linux/netfilter_ipv6/ip6t_MARK.h b/include/linux/netfilter_ipv6/ip6t_MARK.h index 06949b82..7ade8d8f 100644 --- a/include/linux/netfilter_ipv6/ip6t_MARK.h +++ b/include/linux/netfilter_ipv6/ip6t_MARK.h @@ -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*/ diff --git a/include/linux/netfilter_ipv6/ip6t_limit.h b/include/linux/netfilter_ipv6/ip6t_limit.h index cd3e8347..6e17a677 100644 --- a/include/linux/netfilter_ipv6/ip6t_limit.h +++ b/include/linux/netfilter_ipv6/ip6t_limit.h @@ -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; }; diff --git a/include/linux/netfilter_ipv6/ip6t_mark.h b/include/linux/netfilter_ipv6/ip6t_mark.h index 7ede185e..917c2435 100644 --- a/include/linux/netfilter_ipv6/ip6t_mark.h +++ b/include/linux/netfilter_ipv6/ip6t_mark.h @@ -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*/ -- cgit v1.2.3