linux/net/netfilter/nft_meta.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2008-2009 Patrick McHardy <[email protected]>
 * Copyright (c) 2014 Intel Corporation
 * Author: Tomasz Bursztyka <[email protected]>
 *
 * Development of this code funded by Astaro AG (http://www.astaro.com/)
 */

#include <linux/kernel.h>
#include <linux/netlink.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nf_tables.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/random.h>
#include <linux/smp.h>
#include <linux/static_key.h>
#include <net/dst.h>
#include <net/ip.h>
#include <net/sock.h>
#include <net/tcp_states.h> /* for TCP_TIME_WAIT */
#include <net/netfilter/nf_tables.h>
#include <net/netfilter/nf_tables_core.h>
#include <net/netfilter/nft_meta.h>
#include <net/netfilter/nf_tables_offload.h>

#include <uapi/linux/netfilter_bridge.h> /* NF_BR_PRE_ROUTING */

#define NFT_META_SECS_PER_MINUTE
#define NFT_META_SECS_PER_HOUR
#define NFT_META_SECS_PER_DAY
#define NFT_META_DAYS_PER_WEEK

static u8 nft_meta_weekday(void)
{}

static u32 nft_meta_hour(time64_t secs)
{}

static noinline_for_stack void
nft_meta_get_eval_time(enum nft_meta_keys key,
		       u32 *dest)
{}

static noinline bool
nft_meta_get_eval_pkttype_lo(const struct nft_pktinfo *pkt,
			     u32 *dest)
{}

static noinline bool
nft_meta_get_eval_skugid(enum nft_meta_keys key,
			 u32 *dest,
			 const struct nft_pktinfo *pkt)
{}

#ifdef CONFIG_CGROUP_NET_CLASSID
static noinline bool
nft_meta_get_eval_cgroup(u32 *dest, const struct nft_pktinfo *pkt)
{}
#endif

static noinline bool nft_meta_get_eval_kind(enum nft_meta_keys key,
					    u32 *dest,
					    const struct nft_pktinfo *pkt)
{}

static void nft_meta_store_ifindex(u32 *dest, const struct net_device *dev)
{}

static void nft_meta_store_ifname(u32 *dest, const struct net_device *dev)
{}

static bool nft_meta_store_iftype(u32 *dest, const struct net_device *dev)
{}

static bool nft_meta_store_ifgroup(u32 *dest, const struct net_device *dev)
{}

static bool nft_meta_get_eval_ifname(enum nft_meta_keys key, u32 *dest,
				     const struct nft_pktinfo *pkt)
{}

#ifdef CONFIG_IP_ROUTE_CLASSID
static noinline bool
nft_meta_get_eval_rtclassid(const struct sk_buff *skb, u32 *dest)
{}
#endif

static noinline u32 nft_meta_get_eval_sdif(const struct nft_pktinfo *pkt)
{}

static noinline void
nft_meta_get_eval_sdifname(u32 *dest, const struct nft_pktinfo *pkt)
{}

void nft_meta_get_eval(const struct nft_expr *expr,
		       struct nft_regs *regs,
		       const struct nft_pktinfo *pkt)
{}
EXPORT_SYMBOL_GPL();

void nft_meta_set_eval(const struct nft_expr *expr,
		       struct nft_regs *regs,
		       const struct nft_pktinfo *pkt)
{}
EXPORT_SYMBOL_GPL();

const struct nla_policy nft_meta_policy[NFTA_META_MAX + 1] =;
EXPORT_SYMBOL_GPL();

int nft_meta_get_init(const struct nft_ctx *ctx,
		      const struct nft_expr *expr,
		      const struct nlattr * const tb[])
{}
EXPORT_SYMBOL_GPL();

static int nft_meta_get_validate_sdif(const struct nft_ctx *ctx)
{}

static int nft_meta_get_validate_xfrm(const struct nft_ctx *ctx)
{}

static int nft_meta_get_validate(const struct nft_ctx *ctx,
				 const struct nft_expr *expr,
				 const struct nft_data **data)
{}

int nft_meta_set_validate(const struct nft_ctx *ctx,
			  const struct nft_expr *expr,
			  const struct nft_data **data)
{}
EXPORT_SYMBOL_GPL();

int nft_meta_set_init(const struct nft_ctx *ctx,
		      const struct nft_expr *expr,
		      const struct nlattr * const tb[])
{}
EXPORT_SYMBOL_GPL();

int nft_meta_get_dump(struct sk_buff *skb,
		      const struct nft_expr *expr, bool reset)
{}
EXPORT_SYMBOL_GPL();

int nft_meta_set_dump(struct sk_buff *skb,
		      const struct nft_expr *expr, bool reset)
{}
EXPORT_SYMBOL_GPL();

void nft_meta_set_destroy(const struct nft_ctx *ctx,
			  const struct nft_expr *expr)
{}
EXPORT_SYMBOL_GPL();

static int nft_meta_get_offload(struct nft_offload_ctx *ctx,
				struct nft_flow_rule *flow,
				const struct nft_expr *expr)
{}

bool nft_meta_get_reduce(struct nft_regs_track *track,
			 const struct nft_expr *expr)
{}
EXPORT_SYMBOL_GPL();

static const struct nft_expr_ops nft_meta_get_ops =;

static bool nft_meta_set_reduce(struct nft_regs_track *track,
				const struct nft_expr *expr)
{}

static const struct nft_expr_ops nft_meta_set_ops =;

static const struct nft_expr_ops *
nft_meta_select_ops(const struct nft_ctx *ctx,
		    const struct nlattr * const tb[])
{}

static int nft_meta_inner_init(const struct nft_ctx *ctx,
			       const struct nft_expr *expr,
			       const struct nlattr * const tb[])
{}

void nft_meta_inner_eval(const struct nft_expr *expr,
			 struct nft_regs *regs,
			 const struct nft_pktinfo *pkt,
			 struct nft_inner_tun_ctx *tun_ctx)
{}
EXPORT_SYMBOL_GPL();

static const struct nft_expr_ops nft_meta_inner_ops =;

struct nft_expr_type nft_meta_type __read_mostly =;

#ifdef CONFIG_NETWORK_SECMARK
struct nft_secmark {};

static const struct nla_policy nft_secmark_policy[NFTA_SECMARK_MAX + 1] =;

static int nft_secmark_compute_secid(struct nft_secmark *priv)
{}

static void nft_secmark_obj_eval(struct nft_object *obj, struct nft_regs *regs,
				 const struct nft_pktinfo *pkt)
{}

static int nft_secmark_obj_init(const struct nft_ctx *ctx,
				const struct nlattr * const tb[],
				struct nft_object *obj)
{}

static int nft_secmark_obj_dump(struct sk_buff *skb, struct nft_object *obj,
				bool reset)
{}

static void nft_secmark_obj_destroy(const struct nft_ctx *ctx, struct nft_object *obj)
{}

static const struct nft_object_ops nft_secmark_obj_ops =;
struct nft_object_type nft_secmark_obj_type __read_mostly =;
#endif /* CONFIG_NETWORK_SECMARK */