#include <getopt.h>
#include <iptables.h>
#include <linux/netfilter_ipv4/ip_tables.h>
-#include <linux/netfilter_ipv4/ipt_ULOG.h>
-
-#define ULOG_DEFAULT_NLGROUP 1
-#define ULOG_DEFAULT_QTHRESHOLD 1
+/* For 64bit kernel / 32bit userspace */
+#include "../include/linux/netfilter_ipv4/ipt_ULOG.h"
void print_groups(unsigned int gmask)
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':
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;
}
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 %d ", loginfo->copy_range);
if (loginfo->qthreshold != ULOG_DEFAULT_QTHRESHOLD)
printf("--ulog-qthreshold %d ", loginfo->qthreshold);
+#endif
}
/* Prints out the targinfo. */
= (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 %d nlgroup ", 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 %d ", loginfo->qthreshold);
+#endif
}
static
-/* Header file for IP tables userspace logging, Version 1.8
+/* Header file for IP tables userspace logging, Version 1.8
*
* (C) 2000-2002 by Harald Welte <laforge@gnumonks.org>
*
#define NETLINK_NFLOG 5
#endif
+#define ULOG_DEFAULT_NLGROUP 1
+#define ULOG_DEFAULT_QTHRESHOLD 1
+
#define ULOG_MAC_LEN 80
#define ULOG_PREFIX_LEN 32
/* 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];
};