Skip to contentSkip to conversation

src: Add ct id support

PATCH New Brett Mastbergen 1 participant 1 message Apr 23, 2019 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 src: Add ct id support

The 'id' key returns the id of the connection entry

---
 include/linux/netfilter/nf_tables.h | 2 ++
 src/expr/ct.c                       | 1 +
 2 files changed, 3 insertions(+)
include/linux/netfilter/nf_tables.h +2 -0
index fd38cdc..6da0bf5 100644
@@ -978,6 +978,7 @@ enum nft_osf_attributes {
  * @NFT_CT_SRC_IP6: conntrack layer 3 protocol source (IPv6 address)
  * @NFT_CT_DST_IP6: conntrack layer 3 protocol destination (IPv6 address)
  * @NFT_CT_TIMEOUT: connection tracking timeout policy assigned to conntrack
+ * @NFT_CT_ID: conntrack id
  */
 enum nft_ct_keys {
 	NFT_CT_STATE,
@@ -1004,6 +1005,7 @@ enum nft_ct_keys {
 	NFT_CT_SRC_IP6,
 	NFT_CT_DST_IP6,
 	NFT_CT_TIMEOUT,
+	NFT_CT_ID,
 	__NFT_CT_MAX
 };
 #define NFT_CT_MAX		(__NFT_CT_MAX - 1)
src/expr/ct.c +1 -0
index b9ca2dc..124de9d 100644
@@ -172,6 +172,7 @@ static const char *ctkey2str_array[NFT_CT_MAX + 1] = {
 	[NFT_CT_DST_IP]		= "dst_ip",
 	[NFT_CT_SRC_IP6]	= "src_ip6",
 	[NFT_CT_DST_IP6]	= "dst_ip6",
+	[NFT_CT_ID]		= "id",
 };
 
 static const char *ctkey2str(uint32_t ctkey)
Signature · 1 line
2.11.0