Jan Engelhardt wrote:
On Dec 17 2007 14:04, Patrick McHardy wrote:
I'd prefer:
--set-tos: set exact value, no mask
--or-tos: set single bits
--xor-tos: flip single bits
--and-tos: mask single bits
Ok, I'll add these. However, since they get transformed to xmark
internally, they would normally be displayed as
--set-tos value/mask (iptables-save, iptables -nL)
TOS set value/mask (iptables -L)
Is that ok, or should I figure out some math to transform it back to
--{or,xor,and}-tos for the human-readable (iptables -L) case?
That would be better. The mark patch I pointer you to some
time ago did this:
+print_mark(unsigned long mark, unsigned long mask, int numeric)
{
- printf("0x%lx ", mark);
+ if (mask == 0)
+ printf("set 0x%lx ", mark);
+ else if (mark == ~mask)
+ printf("or 0x%lx ", mark);
+ else if ((mark & mask) == 0)
+ printf("set 0x%lx/0x%lx ", mark, ~mask);
+ else {
+ if (mask != ~0UL)
+ printf("and 0x%lx ", mask);
+ if (mark)
+ printf("xor 0x%lx ", mark);
+ }
}
which I guess would also work for tos.
-
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