linux/net/netfilter/nft_limit.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/spinlock.h>
#include <linux/netlink.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nf_tables.h>
#include <net/netfilter/nf_tables.h>

struct nft_limit {};

struct nft_limit_priv {};

static inline bool nft_limit_eval(struct nft_limit_priv *priv, u64 cost)
{}

/* Use same default as in iptables. */
#define NFT_LIMIT_PKT_BURST_DEFAULT

static int nft_limit_init(struct nft_limit_priv *priv,
			  const struct nlattr * const tb[], bool pkts)
{}

static int nft_limit_dump(struct sk_buff *skb, const struct nft_limit_priv *priv,
			  enum nft_limit_type type)
{}

static void nft_limit_destroy(const struct nft_ctx *ctx,
			      const struct nft_limit_priv *priv)
{}

static int nft_limit_clone(struct nft_limit_priv *priv_dst,
			   const struct nft_limit_priv *priv_src, gfp_t gfp)
{}

struct nft_limit_priv_pkts {};

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

static const struct nla_policy nft_limit_policy[NFTA_LIMIT_MAX + 1] =;

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

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

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

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

static struct nft_expr_type nft_limit_type;
static const struct nft_expr_ops nft_limit_pkts_ops =;

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

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

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

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

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

static const struct nft_expr_ops nft_limit_bytes_ops =;

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

static struct nft_expr_type nft_limit_type __read_mostly =;

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

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

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

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

static struct nft_object_type nft_limit_obj_type;
static const struct nft_object_ops nft_limit_obj_pkts_ops =;

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

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

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

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

static struct nft_object_type nft_limit_obj_type;
static const struct nft_object_ops nft_limit_obj_bytes_ops =;

static const struct nft_object_ops *
nft_limit_obj_select_ops(const struct nft_ctx *ctx,
			 const struct nlattr * const tb[])
{}

static struct nft_object_type nft_limit_obj_type __read_mostly =;

static int __init nft_limit_module_init(void)
{}

static void __exit nft_limit_module_exit(void)
{}

module_init();
module_exit(nft_limit_module_exit);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_ALIAS_NFT_EXPR();
MODULE_ALIAS_NFT_OBJ();
MODULE_DESCRIPTION();