linux/net/netfilter/nft_counter.c

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

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/seqlock.h>
#include <linux/netlink.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nf_tables.h>
#include <net/netfilter/nf_tables.h>
#include <net/netfilter/nf_tables_core.h>
#include <net/netfilter/nf_tables_offload.h>

struct nft_counter {};

struct nft_counter_percpu_priv {};

static DEFINE_PER_CPU(seqcount_t, nft_counter_seq);

static inline void nft_counter_do_eval(struct nft_counter_percpu_priv *priv,
				       struct nft_regs *regs,
				       const struct nft_pktinfo *pkt)
{}

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

static int nft_counter_do_init(const struct nlattr * const tb[],
			       struct nft_counter_percpu_priv *priv)
{}

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

static void nft_counter_do_destroy(struct nft_counter_percpu_priv *priv)
{}

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

static void nft_counter_reset(struct nft_counter_percpu_priv *priv,
			      struct nft_counter *total)
{}

static void nft_counter_fetch(struct nft_counter_percpu_priv *priv,
			      struct nft_counter *total)
{}

static int nft_counter_do_dump(struct sk_buff *skb,
			       struct nft_counter_percpu_priv *priv,
			       bool reset)
{}

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

static const struct nla_policy nft_counter_policy[NFTA_COUNTER_MAX + 1] =;

struct nft_object_type nft_counter_obj_type;
static const struct nft_object_ops nft_counter_obj_ops =;

struct nft_object_type nft_counter_obj_type __read_mostly =;

void nft_counter_eval(const struct nft_expr *expr, struct nft_regs *regs,
		      const struct nft_pktinfo *pkt)
{}

static int nft_counter_dump(struct sk_buff *skb,
			    const struct nft_expr *expr, bool reset)
{}

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

static void nft_counter_destroy(const struct nft_ctx *ctx,
				const struct nft_expr *expr)
{}

static int nft_counter_clone(struct nft_expr *dst, const struct nft_expr *src, gfp_t gfp)
{}

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

static void nft_counter_offload_stats(struct nft_expr *expr,
				      const struct flow_stats *stats)
{}

void nft_counter_init_seqcount(void)
{}

struct nft_expr_type nft_counter_type;
static const struct nft_expr_ops nft_counter_ops =;

struct nft_expr_type nft_counter_type __read_mostly =;