]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
include: add new bitwise boolean attributes to nf_tables.h
authorJeremy Sowden <jeremy@azazel.net>
Wed, 13 Nov 2024 21:25:47 +0000 (22:25 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 19 Nov 2024 15:05:41 +0000 (16:05 +0100)
The kernel now has native support for AND, OR and XOR bitwise
operations.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter/nf_tables.h

index 9e9079321380ab7a302338d590309a0b6982c060..49c944e78463f3039c59848af4b1599125956485 100644 (file)
@@ -564,16 +564,26 @@ enum nft_immediate_attributes {
 /**
  * enum nft_bitwise_ops - nf_tables bitwise operations
  *
- * @NFT_BITWISE_BOOL: mask-and-xor operation used to implement NOT, AND, OR and
- *                    XOR boolean operations
+ * @NFT_BITWISE_MASK_XOR: mask-and-xor operation used to implement NOT, AND, OR
+ *                        and XOR boolean operations
  * @NFT_BITWISE_LSHIFT: left-shift operation
  * @NFT_BITWISE_RSHIFT: right-shift operation
+ * @NFT_BITWISE_AND: and operation
+ * @NFT_BITWISE_OR: or operation
+ * @NFT_BITWISE_XOR: xor operation
  */
 enum nft_bitwise_ops {
-       NFT_BITWISE_BOOL,
+       NFT_BITWISE_MASK_XOR,
        NFT_BITWISE_LSHIFT,
        NFT_BITWISE_RSHIFT,
+       NFT_BITWISE_AND,
+       NFT_BITWISE_OR,
+       NFT_BITWISE_XOR,
 };
+/*
+ * Old name for NFT_BITWISE_MASK_XOR.  Retained for backwards-compatibility.
+ */
+#define NFT_BITWISE_BOOL NFT_BITWISE_MASK_XOR
 
 /**
  * enum nft_bitwise_attributes - nf_tables bitwise expression netlink attributes
@@ -586,6 +596,7 @@ enum nft_bitwise_ops {
  * @NFTA_BITWISE_OP: type of operation (NLA_U32: nft_bitwise_ops)
  * @NFTA_BITWISE_DATA: argument for non-boolean operations
  *                     (NLA_NESTED: nft_data_attributes)
+ * @NFTA_BITWISE_SREG2: second source register (NLA_U32: nft_registers)
  *
  * The bitwise expression supports boolean and shift operations.  It implements
  * the boolean operations by performing the following operation:
@@ -609,6 +620,7 @@ enum nft_bitwise_attributes {
        NFTA_BITWISE_XOR,
        NFTA_BITWISE_OP,
        NFTA_BITWISE_DATA,
+       NFTA_BITWISE_SREG2,
        __NFTA_BITWISE_MAX
 };
 #define NFTA_BITWISE_MAX       (__NFTA_BITWISE_MAX - 1)