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,
"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
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)
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)
{
else
printf("0x%lx ", mark);
}
-#endif
/* Final check; must have specified --mark. */
static void
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,
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)
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
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;
default:
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. */
= (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 = {
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)
{
else
return len;
}
-#endif
/* If a single value is provided, min and max are both set to the value */
static void
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
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
}
}
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)
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)
{
else
printf("0x%lx ", mark);
}
-#endif
/* Final check; must have specified --mark. */
static void
};
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;
};
#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 {
};
struct ipt_mark_target_info_v1 {
-#ifdef KERNEL_64_USERSPACE_32
- unsigned long long mark;
-#else
unsigned long mark;
-#endif
u_int8_t mode;
};
/* 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];
};
*/
struct ipt_connmark_info {
-#ifdef KERNEL_64_USERSPACE_32
- unsigned long long mark, mask;
-#else
unsigned long mark, mask;
-#endif
u_int8_t invert;
};
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;
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;
#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;
};
#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*/
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;
};
#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*/