From 945b418c525c2fda573d1c31e0ab49700caa7aed Mon Sep 17 00:00:00 2001 From: Jayden Nyamiaka Date: Tue, 27 Aug 2024 02:31:11 -0700 Subject: [PATCH] Add netfilter bitwise operation constants for nftables support. PiperOrigin-RevId: 667902660 --- pkg/abi/linux/nf_tables.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/abi/linux/nf_tables.go b/pkg/abi/linux/nf_tables.go index e2e234f00..36f4e568e 100644 --- a/pkg/abi/linux/nf_tables.go +++ b/pkg/abi/linux/nf_tables.go @@ -119,3 +119,12 @@ const ( const ( NFT_PAYLOAD_L4CSUM_PSEUDOHDR = (1 << 0) // use pseudoheader for L4 checksum ) + +// Nf table bitwise operators. +// Used by the nft bitwise operation to perform bitwise math over register data. +// These correspond to enum values in include/uapi/linux/netfilter/nf_tables.h. +const ( + NFT_BITWISE_BOOL = iota // mask-and-xor operation for NOT, AND, OR, & XOR + NFT_BITWISE_LSHIFT // left-shift operation + NFT_BITWISE_RSHIFT // right-shift operation +)