*
* @NFNL_HOOK_TYPE_NFTABLES: nf_tables base chain
* @NFNL_HOOK_TYPE_BPF: bpf program
+ * @NFNL_HOOK_TYPE_NFT_FLOWTABLE: nf_tables flowtable
*/
enum nfnl_hook_chaintype {
NFNL_HOOK_TYPE_NFTABLES = 0x1,
NFNL_HOOK_TYPE_BPF,
+ NFNL_HOOK_TYPE_NFT_FLOWTABLE,
};
/**
const char *table;
const char *chain;
const char *devname;
+ const char *objtype;
int family;
int chain_family;
uint32_t num;
}
type = ntohl(mnl_attr_get_u32(nested[NFNLA_HOOK_INFO_TYPE]));
- if (type == NFNL_HOOK_TYPE_NFTABLES) {
+ if (type == NFNL_HOOK_TYPE_NFTABLES ||
+ type == NFNL_HOOK_TYPE_NFT_FLOWTABLE) {
struct nlattr *info[NFNLA_CHAIN_MAX + 1] = {};
const char *tablename, *chainname;
hook->chain = xstrdup(chainname);
}
hook->chain_family = mnl_attr_get_u8(info[NFNLA_CHAIN_FAMILY]);
+ if (type == NFNL_HOOK_TYPE_NFT_FLOWTABLE)
+ hook->objtype = "flowtable";
+ else
+ hook->objtype = "chain";
} else if (type == NFNL_HOOK_TYPE_BPF) {
struct nlattr *info[NFNLA_HOOK_BPF_MAX + 1] = {};
fprintf(fp, "\t\t+%010u", prio);
if (hook->table && hook->chain)
- fprintf(fp, " chain %s %s %s", family2str(hook->chain_family), hook->table, hook->chain);
+ fprintf(fp, " %s %s %s %s",
+ hook->objtype, family2str(hook->chain_family),
+ hook->table, hook->chain);
else if (hook->hookfn && hook->chain)
fprintf(fp, " %s %s", hook->hookfn, hook->chain);
else if (hook->hookfn) {