Re: [ULOGD PATCH 2/5] New MARK filtering module.

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

 



Eric Leblond wrote:
+static struct config_keyset libulog_kset = {
+	.num_ces = 2,
+	.ces = {
+		{
+			.key 	 = "mark",
+			.type 	 = CONFIG_TYPE_INT,
+			.options = CONFIG_OPT_NONE,
+			.u.value = 0,
+		},
+		{
+			.key 	 = "mask",
+			.type 	 = CONFIG_TYPE_INT,
+			.options = CONFIG_OPT_NONE,
+			.u.value = 0xffffffff,
+		},
+
+	}
+};
+	
+#define mark_ce(x)	(x->ces[0])
+#define mask_ce(x)	(x->ces[1])


This magic value stuff is an error-prone mess in my opinion.
Could we for future modules agree to always do something like
this:

enum foo_keys {
	FOO_MARK,
	FOO_MASK,
	...
};

struct config_keyset foo_kset = {
...
	.ces = {
		[FOO_MARK] = {
			...
		},
	},
};

Or maybe resolve them at runtime using the key string in
performance uncritical paths?

--
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