From f97dd13d1a9db2e3c990ff48a9fffd228ff70cfc Mon Sep 17 00:00:00 2001 From: Jayden Nyamiaka Date: Mon, 9 Sep 2024 14:19:05 -0700 Subject: [PATCH] Add netfilter route operation constants for nftables support. PiperOrigin-RevId: 672671935 --- pkg/abi/linux/nf_tables.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/abi/linux/nf_tables.go b/pkg/abi/linux/nf_tables.go index 663fc6e57..6d09fb187 100644 --- a/pkg/abi/linux/nf_tables.go +++ b/pkg/abi/linux/nf_tables.go @@ -136,3 +136,23 @@ const ( NFT_BITWISE_LSHIFT // left-shift operation NFT_BITWISE_RSHIFT // right-shift operation ) + +// Nf table route expression keys. +// Used by the nft route operation to determine the routing data to retrieve. +// These correspond to enum values in include/uapi/linux/netfilter/nf_tables.h. +const ( + // Traffic Class Identifier (Realm) associated with route + NFT_RT_CLASSID = iota + + // Routing nexthop for IPv4 (next IPv4 address to jump to) + NFT_RT_NEXTHOP4 + + // Routing nexthop for IPv6 (next IPv6 address to jump to) + NFT_RT_NEXTHOP6 + + // Maximum Segment Size for TCP connections (largest size for a single packet) + NFT_RT_TCPMSS + + // Bool for whether packet route involves a IPsec transform st xfrm is applied + NFT_RT_XFRM +)