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 ------------------- 6 files changed, 117 deletions(-) (limited to 'extensions') 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 -- cgit v1.2.3