[netfilter-cvslog] r6893 - in trunk/iptables: extensions include/linux/netfilter_ipv4 include/linux/netfilter_ipv6

yasuyuki at netfilter.org yasuyuki at netfilter.org
Thu Jun 28 18:41:50 CEST 2007


Author: yasuyuki at netfilter.org
Date: 2007-06-28 18:41:50 +0200 (Thu, 28 Jun 2007)
New Revision: 6893

Modified:
   trunk/iptables/extensions/libip6t_MARK.c
   trunk/iptables/extensions/libip6t_mark.c
   trunk/iptables/extensions/libipt_MARK.c
   trunk/iptables/extensions/libipt_ULOG.c
   trunk/iptables/extensions/libipt_conntrack.c
   trunk/iptables/extensions/libipt_mark.c
   trunk/iptables/include/linux/netfilter_ipv4/ipt_CONNMARK.h
   trunk/iptables/include/linux/netfilter_ipv4/ipt_MARK.h
   trunk/iptables/include/linux/netfilter_ipv4/ipt_ULOG.h
   trunk/iptables/include/linux/netfilter_ipv4/ipt_connmark.h
   trunk/iptables/include/linux/netfilter_ipv4/ipt_conntrack.h
   trunk/iptables/include/linux/netfilter_ipv4/ipt_limit.h
   trunk/iptables/include/linux/netfilter_ipv4/ipt_mark.h
   trunk/iptables/include/linux/netfilter_ipv6/ip6t_MARK.h
   trunk/iptables/include/linux/netfilter_ipv6/ip6t_limit.h
   trunk/iptables/include/linux/netfilter_ipv6/ip6t_mark.h
Log:
Removes some KERNEL_64_USERSPACE_32 because linux 2.6 has compat layer



Modified: trunk/iptables/extensions/libip6t_MARK.c
===================================================================
--- trunk/iptables/extensions/libip6t_MARK.c	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/extensions/libip6t_MARK.c	2007-06-28 16:41:50 UTC (rev 6893)
@@ -43,13 +43,8 @@
 
 	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 @@
 		           "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

Modified: trunk/iptables/extensions/libip6t_mark.c
===================================================================
--- trunk/iptables/extensions/libip6t_mark.c	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/extensions/libip6t_mark.c	2007-06-28 16:41:50 UTC (rev 6893)
@@ -39,19 +39,11 @@
 		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,17 +57,7 @@
 	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)
 {
 	if(mask != 0xffffffff)
@@ -83,7 +65,6 @@
 	else
 		printf("0x%lx ", mark);
 }
-#endif
 
 /* Final check; must have specified --mark. */
 static void

Modified: trunk/iptables/extensions/libipt_MARK.c
===================================================================
--- trunk/iptables/extensions/libipt_MARK.c	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/extensions/libipt_MARK.c	2007-06-28 16:41:50 UTC (rev 6893)
@@ -47,13 +47,8 @@
 
 	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 @@
 		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 @@
 	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

Modified: trunk/iptables/extensions/libipt_ULOG.c
===================================================================
--- trunk/iptables/extensions/libipt_ULOG.c	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/extensions/libipt_ULOG.c	2007-06-28 16:41:50 UTC (rev 6893)
@@ -128,11 +128,7 @@
 		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 @@
 		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 @@
 		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 @@
 	    = (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 = {

Modified: trunk/iptables/extensions/libipt_conntrack.c
===================================================================
--- trunk/iptables/extensions/libipt_conntrack.c	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/extensions/libipt_conntrack.c	2007-06-28 16:41:50 UTC (rev 6893)
@@ -127,18 +127,6 @@
 		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 @@
 	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 @@
 	
 	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 @@
         	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
 	}
 }
 

Modified: trunk/iptables/extensions/libipt_mark.c
===================================================================
--- trunk/iptables/extensions/libipt_mark.c	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/extensions/libipt_mark.c	2007-06-28 16:41:50 UTC (rev 6893)
@@ -39,19 +39,11 @@
 		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,17 +57,7 @@
 	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)
 {
 	if(mask != 0xffffffff)
@@ -83,7 +65,6 @@
 	else
 		printf("0x%lx ", mark);
 }
-#endif
 
 /* Final check; must have specified --mark. */
 static void

Modified: trunk/iptables/include/linux/netfilter_ipv4/ipt_CONNMARK.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv4/ipt_CONNMARK.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv4/ipt_CONNMARK.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -17,13 +17,8 @@
 };
 
 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;
 };
 

Modified: trunk/iptables/include/linux/netfilter_ipv4/ipt_MARK.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv4/ipt_MARK.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv4/ipt_MARK.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -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 @@
 };
 
 struct ipt_mark_target_info_v1 {
-#ifdef KERNEL_64_USERSPACE_32
-	unsigned long long mark;
-#else
 	unsigned long mark;
-#endif
 	u_int8_t mode;
 };
 

Modified: trunk/iptables/include/linux/netfilter_ipv4/ipt_ULOG.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv4/ipt_ULOG.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv4/ipt_ULOG.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -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];
 };
 

Modified: trunk/iptables/include/linux/netfilter_ipv4/ipt_connmark.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv4/ipt_connmark.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv4/ipt_connmark.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -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;
 };
 

Modified: trunk/iptables/include/linux/netfilter_ipv4/ipt_conntrack.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv4/ipt_conntrack.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv4/ipt_conntrack.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -67,11 +67,7 @@
 	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;

Modified: trunk/iptables/include/linux/netfilter_ipv4/ipt_limit.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv4/ipt_limit.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv4/ipt_limit.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -10,15 +10,10 @@
 	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;

Modified: trunk/iptables/include/linux/netfilter_ipv4/ipt_mark.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv4/ipt_mark.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv4/ipt_mark.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -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;
 };
 

Modified: trunk/iptables/include/linux/netfilter_ipv6/ip6t_MARK.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv6/ip6t_MARK.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv6/ip6t_MARK.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -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*/

Modified: trunk/iptables/include/linux/netfilter_ipv6/ip6t_limit.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv6/ip6t_limit.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv6/ip6t_limit.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -10,15 +10,11 @@
 	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;
 };

Modified: trunk/iptables/include/linux/netfilter_ipv6/ip6t_mark.h
===================================================================
--- trunk/iptables/include/linux/netfilter_ipv6/ip6t_mark.h	2007-06-27 18:24:00 UTC (rev 6892)
+++ trunk/iptables/include/linux/netfilter_ipv6/ip6t_mark.h	2007-06-28 16:41:50 UTC (rev 6893)
@@ -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*/




More information about the netfilter-cvslog mailing list