# Copyright 2020 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

include <linux/net.h>
include <uapi/linux/netlink.h>
include <uapi/linux/netfilter.h>
include <uapi/linux/netfilter/nfnetlink.h>
include <uapi/linux/netfilter/nf_tables_compat.h>

type msghdr_nft_compat[CMD] msghdr_netlink[netlink_msg_netfilter_t[NFNL_SUBSYS_NFT_COMPAT, CMD, nfnl_compat_policy_get]]

sendmsg$NFNL_MSG_COMPAT_GET(fd sock_nl_netfilter, msg ptr[in, msghdr_nft_compat[NFNL_MSG_COMPAT_GET]], f flags[send_flags])

nfnl_compat_policy_get [
# TODO: we need a list of all targets and matches here (or it's not too important here).
	NFTA_COMPAT_NAME	nlattr[NFTA_COMPAT_NAME, string]
	NFTA_COMPAT_REV		nlnetw[NFTA_COMPAT_REV, int32be[0:5]]
	NFTA_COMPAT_TYPE	nlnetw[NFTA_COMPAT_TYPE, int32be[0:1]]
] [varlen]
