Re: [RFC IPTABLES 3/4]: add xt_RATEEST target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Engelhardt wrote:
On Nov 25 2007 18:11, Patrick McHardy wrote:

+static void
+RATEEST_final_check(unsigned int flags)
+{
+	...
+	for (info->interval = 0; info->interval <= 5; info->interval++) {
+		if (interval <= (1 << info->interval) * (TIME_UNITS_PER_SEC / 4))
+			break;
+	}

-{}

For multiple statements they're fine.

+static void
+__RATEEST_print(const struct xt_entry_target *target, const char *prefix)
+{
+	struct xt_rateest_target_info *info = (void *)target->data;
+	unsigned int interval;
+	unsigned int ewma_log;

Ouchie - that throws a warning with -Wshadow (which is what I'm trying to slip
in later).

Will rename.

+
+	interval = (TIME_UNITS_PER_SEC << (info->interval + 2)) / 4;
+	ewma_log = interval * (1 << (info->ewma_log));

ewma_log = interval << info->ewma_log;

OK.


+	printf("%sname %s ", prefix, info->name);
+	printf("%sinterval ", prefix);
+	RATEEST_print_time(interval);
+	printf("%sewmalog ", prefix);
+	RATEEST_print_time(ewma_log);
+}
+


-LDLIBS       = -ldl
+LDLIBS       = -ldl -lm

I have not seen the function that requires -lm, which was it?

log():

+		if (interval / (-log(w)) > ewma_log)
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux