Add a new bitwise netlink attribute, NFTA_BITWISE_OP, which is set to a value of a new enum, nft_bitwise_ops. It describes the type of operation an expression contains. Currently, it only has one value: NFT_BITWISE_BOOL. More values will be added later to implement shifts.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -484,6 +484,16 @@ enum nft_immediate_attributes { · 483 unmodified lines | ||
| 484 | 484 | }; |
| 485 | 485 | #define NFTA_IMMEDIATE_MAX (__NFTA_IMMEDIATE_MAX - 1) |
| 486 | 486 | |
| 487 | +/** | |
| 488 | + * enum nft_bitwise_ops - nf_tables bitwise operations | |
| 489 | + * | |
| 490 | + * @NFT_BITWISE_BOOL: mask-and-xor operation used to implement NOT, AND, OR and | |
| 491 | + * XOR boolean operations | |
| 492 | + */ | |
| 493 | +enum nft_bitwise_ops { | |
| 494 | + NFT_BITWISE_BOOL, | |
| 495 | +}; | |
| 496 | + | |
| 487 | 497 | /** |
| 488 | 498 | * enum nft_bitwise_attributes - nf_tables bitwise expression netlink attributes |
| 489 | 499 | * |
| @@ -492,6 +502,7 @@ enum nft_immediate_attributes { · 2 unmodified lines | ||
| 492 | 502 | * @NFTA_BITWISE_LEN: length of operands (NLA_U32) |
| 493 | 503 | * @NFTA_BITWISE_MASK: mask value (NLA_NESTED: nft_data_attributes) |
| 494 | 504 | * @NFTA_BITWISE_XOR: xor value (NLA_NESTED: nft_data_attributes) |
| 505 | + * @NFTA_BITWISE_OP: type of operation (NLA_U32: nft_bitwise_ops) | |
| 495 | 506 | * |
| 496 | 507 | * The bitwise expression performs the following operation: |
| 497 | 508 | * |
| @@ -512,6 +523,7 @@ enum nft_bitwise_attributes { · 14 unmodified lines | ||
| 512 | 523 | NFTA_BITWISE_LEN, |
| 513 | 524 | NFTA_BITWISE_MASK, |
| 514 | 525 | NFTA_BITWISE_XOR, |
| 526 | + NFTA_BITWISE_OP, | |
| 515 | 527 | __NFTA_BITWISE_MAX |
| 516 | 528 | }; |
| 517 | 529 | #define NFTA_BITWISE_MAX (__NFTA_BITWISE_MAX - 1) |