ENUM NFT_CT_KEYS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 enum nft_ct_keys β€” the kernel API manual, bestie edition πŸ’…

okay so bestie, gather round, because this is the enum nft_ct_keys(9) page from the Kernel API Manual and it is lowkey the master list of conntrack keys that the nf_tables ct expression can grab for you ✨ every single one of these is a thing you can pull out of a connection tracking entry, and we are going to go through them all, no skips, no cap 🫢


✨ NAME ✨

enum nft_ct_keys β€” nf_tables ct expression keys πŸ‘‘


πŸ’– SYNOPSIS πŸ’–

enum nft_ct_keys {
    NFT_CT_STATE ,
    NFT_CT_DIRECTION ,
    NFT_CT_STATUS ,
    NFT_CT_MARK ,
    NFT_CT_SECMARK ,
    NFT_CT_EXPIRATION ,
    NFT_CT_HELPER ,
    NFT_CT_L3PROTOCOL ,
    NFT_CT_SRC ,
    NFT_CT_DST ,
    NFT_CT_PROTOCOL ,
    NFT_CT_PROTO_SRC ,
    NFT_CT_PROTO_DST ,
    NFT_CT_LABELS ,
    NFT_CT_PKTS ,
    NFT_CT_BYTES ,
    NFT_CT_AVGPKT ,
    NFT_CT_ZONE ,
    NFT_CT_EVENTMASK ,
    NFT_CT_SRC_IP ,
    NFT_CT_DST_IP ,
    NFT_CT_SRC_IP6 ,
    NFT_CT_DST_IP6 ,
    NFT_CT_ID ,
    __NFT_CT_MAX

};

like just look at that list, it's giving organized 🧚


πŸŽ€ Constants πŸŽ€

  • NFT_CT_STATE β€” the conntrack state, which is a bitmask of enum ip_conntrack_info ⭐
  • NFT_CT_DIRECTION β€” the conntrack direction (enum ip_conntrack_dir) 🧭
  • NFT_CT_STATUS β€” the conntrack status, a bitmask of enum ip_conntrack_status πŸ”₯
  • NFT_CT_MARK β€” the conntrack mark value 🏷️
  • NFT_CT_SECMARK β€” the conntrack secmark value πŸ”
  • NFT_CT_EXPIRATION β€” the relative conntrack expiration time, in ms ⏳
  • NFT_CT_HELPER β€” the connection tracking helper assigned to the conntrack 🧚
  • NFT_CT_L3PROTOCOL β€” the conntrack layer 3 protocol 🌐
  • NFT_CT_SRC β€” the conntrack layer 3 protocol source (an IPv4/IPv6 address) β€” heads up bestie, this one is deprecated ⚠️
  • NFT_CT_DST β€” the conntrack layer 3 protocol destination (an IPv4/IPv6 address) β€” also deprecated, yeah I know 😭
  • NFT_CT_PROTOCOL β€” the conntrack layer 4 protocol πŸ“¦
  • NFT_CT_PROTO_SRC β€” the conntrack layer 4 protocol source πŸš€
  • NFT_CT_PROTO_DST β€” the conntrack layer 4 protocol destination 🎯
  • NFT_CT_LABELS β€” conntrack labels 🏷️✨
  • NFT_CT_PKTS β€” conntrack packets πŸ“¨
  • NFT_CT_BYTES β€” conntrack bytes πŸ’Ύ
  • NFT_CT_AVGPKT β€” conntrack average bytes per packet πŸ“Š
  • NFT_CT_ZONE β€” conntrack zone πŸ—ΊοΈ
  • NFT_CT_EVENTMASK β€” the ctnetlink events to be generated for this conntrack πŸ“£
  • NFT_CT_SRC_IP β€” conntrack layer 3 protocol source (IPv4 address) 🌈
  • NFT_CT_DST_IP β€” conntrack layer 3 protocol destination (IPv4 address) 🌈
  • NFT_CT_SRC_IP6 β€” conntrack layer 3 protocol source (IPv6 address) 🌈
  • NFT_CT_DST_IP6 β€” conntrack layer 3 protocol destination (IPv6 address) 🌈
  • NFT_CT_ID β€” the conntrack id πŸ†”
  • __NFT_CT_MAX β€” -- undescribed -- πŸ’€ yeah, the docs literally just left it blank, iconic of them ngl

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/uapi/linux/netfilter/nf_tables.h enum, then the whole friend group πŸ‘―β€β™€οΈ: nft_registers(9), enum nft_verdicts(9), enum nf_tables_msg_types(9), enum nft_list_attributes(9), enum nft_hook_attributes(9), enum nft_table_flags(9), enum nft_table_attributes(9), enum nft_chain_attributes(9), enum nft_rule_attributes(9), enum nft_rule_compat_flags(9), enum nft_rule_compat_attributes(9), enum nft_set_flags(9), enum nft_set_policies(9), enum nft_set_desc_attributes(9), enum nft_set_field_attributes(9), enum nft_set_attributes(9), enum nft_set_elem_flags(9), enum nft_set_elem_attributes(9), enum nft_set_elem_list_attributes(9), enum nft_data_types(9), enum nft_data_attributes(9), enum nft_verdict_attributes(9), enum nft_expr_attributes(9), enum nft_immediate_attributes(9), enum nft_bitwise_ops(9), enum nft_bitwise_attributes(9), enum nft_byteorder_ops(9), enum nft_byteorder_attributes(9), enum nft_cmp_ops(9), enum nft_cmp_attributes(9), enum nft_range_ops(9), enum nft_range_attributes(9), enum nft_lookup_attributes(9), enum nft_dynset_attributes(9), enum nft_payload_bases(9), enum nft_payload_csum_types(9), enum nft_payload_attributes(9), enum nft_exthdr_op(9), enum nft_exthdr_attributes(9), enum nft_meta_keys(9), enum nft_rt_keys(9), enum nft_hash_types(9), enum nft_hash_attributes(9), enum nft_meta_attributes(9), enum nft_rt_attributes(9), enum nft_socket_attributes(9), enum nft_ct_attributes(9), enum nft_offload_attributes(9), enum nft_limit_attributes(9), enum nft_connlimit_attributes(9), enum nft_counter_attributes(9), enum nft_last_attributes(9), enum nft_log_attributes(9), enum nft_log_level(9), enum nft_queue_attributes(9), enum nft_quota_attributes(9), enum nft_secmark_attributes(9), enum nft_reject_types(9), enum nft_reject_inet_code(9), enum nft_reject_attributes(9), enum nft_nat_types(9), enum nft_nat_attributes(9), enum nft_tproxy_attributes(9), enum nft_masq_attributes(9), enum nft_redir_attributes(9), enum nft_dup_attributes(9), enum nft_fwd_attributes(9), enum nft_objref_attributes(9), enum nft_gen_attributes(9), enum nft_object_attributes(9), enum nft_flowtable_flags(9), enum nft_flowtable_attributes(9), enum nft_flowtable_hook_attributes(9), enum nft_osf_attributes(9), enum nft_synproxy_attributes(9), enum nft_devices_attributes(9), enum nft_trace_attributes(9), enum nft_ng_attributes(9). periodt. πŸ’œ


ngl bestie, just a lil reminder that NFT_CT_SRC and NFT_CT_DST are deprecated β€” reach for the _IP / _IP6 variants instead πŸ’…

and that's the whole page! this lil masterpiece lives in ./include/uapi/linux/netfilter, dated October 2026, and it's titled enum nft_ct_keys(9) πŸŽ€ go forth and conntrack, icon πŸ‘‘πŸ’–

πŸ“¦ where this page comes from