]> git.ipfire.org Git - thirdparty/nftables.git/commit
datatype: add define for maximum number of bits and mask of datatype id
authorPatrick McHardy <kaber@trash.net>
Sat, 13 Dec 2014 07:50:35 +0000 (07:50 +0000)
committerPatrick McHardy <kaber@trash.net>
Tue, 16 Dec 2014 17:20:54 +0000 (18:20 +0100)
commit51425ecaa06296c467fded2ad5bf1b23f8a90cdd
treeb4bd61c545c9ac9be7a57b051e5c597e7dbbbf41
parent0b915d6dc50e9e5aeb3e41db9d20dc96d9edee3f
datatype: add define for maximum number of bits and mask of datatype id

The id of concat datatypes is composed of the ids of the individual
datatypes. Add a define for the number of bits for each datatype id
and a mask.

The number of bits is chosen as 6, allowing for 63 datatypes, or twice
as much as we currently have. This allows for concatenations of 5
types using 32 bits.

The value is statically chosen instead of basing it on the current
numbers of datatypes since we don't want the maximum concatenation
size to vary between versions, also new versions are supposed to be
able to propery parse a ruleset generated by an older version.

Signed-off-by: Patrick McHardy <kaber@trash.net>
include/datatype.h
src/datatype.c
src/evaluate.c