Re: [RFC] TCPOPTSTRIP target (netfilter)

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

 





On Tue, 2 Oct 2007, Jan Engelhardt wrote:

+#ifndef _XT_TCPOPTSTRIP_H
+#define _XT_TCPOPTSTRIP_H
+
+#define OPTION_IS_SET(p, bit) (p)[(bit) >> 3] & 1 << ((bit) & 0x07)
+#define SET_OPTION(p, bit) (p)[(bit) >> 3] |= 1 << ((bit) & 0x07)

You should probably use <linux/bitmap.h>.

+struct xt_tcpoptstrip_info {
+	unsigned char tcpoptions[32];
+};

And u_int8_t. Better is uint32_t[8], because that is what the linux
bitops work with. (And, unfortunately, it's buggy so we end up
continuing to use own macros.)

But with uint32_t you have to remember about big/low-endianism & network/host byte order conversion and stuff. Not sure if that's really better.

Best regards,


				Krzysztof Olędzki

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

  Powered by Linux