From f366a276220bc8cb2b4b15914be1cce376afccaa Mon Sep 17 00:00:00 2001 From: Jayden Nyamiaka Date: Fri, 13 Sep 2024 11:10:16 -0700 Subject: [PATCH] Add protocol family constants to netfilter uapi. Added for use in nftables to match families to their defined constants. Should have already been defined but it was just realized that families had their own preset constants. The actual values are needed for nftables implementation of meta operations. PiperOrigin-RevId: 674364348 --- pkg/abi/linux/netfilter.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/abi/linux/netfilter.go b/pkg/abi/linux/netfilter.go index 0ac5d67df..d5ddf1199 100644 --- a/pkg/abi/linux/netfilter.go +++ b/pkg/abi/linux/netfilter.go @@ -33,6 +33,18 @@ const ( NF_INET_NUMHOOKS = 5 ) +// Protocol families (address families). These correspond to values in +// include/uapi/linux/netfilter.h. +const ( + NFPROTO_UNSPEC = 0 + NFPROTO_INET = 1 + NFPROTO_IPV4 = 2 + NFPROTO_ARP = 3 + NFPROTO_NETDEV = 5 + NFPROTO_BRIDGE = 7 + NFPROTO_IPV6 = 10 +) + // Verdicts that can be returned by targets. These correspond to values in // include/uapi/linux/netfilter.h const (