linux/include/net/tc_act/tc_ct.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NET_TC_CT_H
#define __NET_TC_CT_H

#include <net/act_api.h>
#include <uapi/linux/tc_act/tc_ct.h>

#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#include <net/netfilter/nf_nat.h>
#include <net/netfilter/nf_conntrack_labels.h>

struct tcf_ct_params {};

struct tcf_ct {};

#define to_ct(a)
#define to_ct_params(a)

static inline uint16_t tcf_ct_zone(const struct tc_action *a)
{}

static inline int tcf_ct_action(const struct tc_action *a)
{}

static inline struct nf_flowtable *tcf_ct_ft(const struct tc_action *a)
{}

static inline struct nf_conntrack_helper *tcf_ct_helper(const struct tc_action *a)
{}

#else
static inline uint16_t tcf_ct_zone(const struct tc_action *a) { return 0; }
static inline int tcf_ct_action(const struct tc_action *a) { return 0; }
static inline struct nf_flowtable *tcf_ct_ft(const struct tc_action *a)
{
	return NULL;
}
static inline struct nf_conntrack_helper *tcf_ct_helper(const struct tc_action *a)
{
	return NULL;
}
#endif /* CONFIG_NF_CONNTRACK */

#if IS_ENABLED(CONFIG_NET_ACT_CT)
static inline void
tcf_ct_flow_table_restore_skb(struct sk_buff *skb, unsigned long cookie)
{}
#else
static inline void
tcf_ct_flow_table_restore_skb(struct sk_buff *skb, unsigned long cookie) { }
#endif

static inline bool is_tcf_ct(const struct tc_action *a)
{}

#endif /* __NET_TC_CT_H */