linux/net/netfilter/xt_recent.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2006 Patrick McHardy <[email protected]>
 * Copyright © CC Computer Consultants GmbH, 2007 - 2008
 *
 * This is a replacement of the old ipt_recent module, which carried the
 * following copyright notice:
 *
 * Author: Stephen Frost <[email protected]>
 * Copyright 2002-2003, Stephen Frost, 2.5.x port by [email protected]
 */
#define pr_fmt(fmt)
#include <linux/init.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/list.h>
#include <linux/random.h>
#include <linux/jhash.h>
#include <linux/bitops.h>
#include <linux/skbuff.h>
#include <linux/inet.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>

#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_recent.h>

MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();
MODULE_ALIAS();

static unsigned int ip_list_tot __read_mostly =;
static unsigned int ip_list_hash_size __read_mostly;
static unsigned int ip_list_perms __read_mostly =;
static unsigned int ip_list_uid __read_mostly;
static unsigned int ip_list_gid __read_mostly;
module_param(ip_list_tot, uint, 0400);
module_param(ip_list_hash_size, uint, 0400);
module_param(ip_list_perms, uint, 0400);
module_param(ip_list_uid, uint, 0644);
module_param(ip_list_gid, uint, 0644);
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();

/* retained for backwards compatibility */
static unsigned int ip_pkt_list_tot __read_mostly;
module_param(ip_pkt_list_tot, uint, 0400);
MODULE_PARM_DESC();

#define XT_RECENT_MAX_NSTAMPS

struct recent_entry {};

struct recent_table {};

struct recent_net {};

static unsigned int recent_net_id __read_mostly;

static inline struct recent_net *recent_pernet(struct net *net)
{}

static DEFINE_SPINLOCK(recent_lock);
static DEFINE_MUTEX(recent_mutex);

#ifdef CONFIG_PROC_FS
static const struct proc_ops recent_mt_proc_ops;
#endif

static u_int32_t hash_rnd __read_mostly;

static inline unsigned int recent_entry_hash4(const union nf_inet_addr *addr)
{}

static inline unsigned int recent_entry_hash6(const union nf_inet_addr *addr)
{}

static struct recent_entry *
recent_entry_lookup(const struct recent_table *table,
		    const union nf_inet_addr *addrp, u_int16_t family,
		    u_int8_t ttl)
{}

static void recent_entry_remove(struct recent_table *t, struct recent_entry *e)
{}

/*
 * Drop entries with timestamps older then 'time'.
 */
static void recent_entry_reap(struct recent_table *t, unsigned long time,
			      struct recent_entry *working, bool update)
{}

static struct recent_entry *
recent_entry_init(struct recent_table *t, const union nf_inet_addr *addr,
		  u_int16_t family, u_int8_t ttl)
{}

static void recent_entry_update(struct recent_table *t, struct recent_entry *e)
{}

static struct recent_table *recent_table_lookup(struct recent_net *recent_net,
						const char *name)
{}

static void recent_table_flush(struct recent_table *t)
{}

static bool
recent_mt(const struct sk_buff *skb, struct xt_action_param *par)
{}

static void recent_table_free(void *addr)
{}

static int recent_mt_check(const struct xt_mtchk_param *par,
			   const struct xt_recent_mtinfo_v1 *info)
{}

static int recent_mt_check_v0(const struct xt_mtchk_param *par)
{}

static int recent_mt_check_v1(const struct xt_mtchk_param *par)
{}

static void recent_mt_destroy(const struct xt_mtdtor_param *par)
{}

#ifdef CONFIG_PROC_FS
struct recent_iter_state {};

static void *recent_seq_start(struct seq_file *seq, loff_t *pos)
	__acquires(recent_lock)
{}

static void *recent_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static void recent_seq_stop(struct seq_file *s, void *v)
	__releases(recent_lock)
{}

static int recent_seq_show(struct seq_file *seq, void *v)
{}

static const struct seq_operations recent_seq_ops =;

static int recent_seq_open(struct inode *inode, struct file *file)
{}

static ssize_t
recent_mt_proc_write(struct file *file, const char __user *input,
		     size_t size, loff_t *loff)
{}

static const struct proc_ops recent_mt_proc_ops =;

static int __net_init recent_proc_net_init(struct net *net)
{}

static void __net_exit recent_proc_net_exit(struct net *net)
{}
#else
static inline int recent_proc_net_init(struct net *net)
{
	return 0;
}

static inline void recent_proc_net_exit(struct net *net)
{
}
#endif /* CONFIG_PROC_FS */

static int __net_init recent_net_init(struct net *net)
{}

static void __net_exit recent_net_exit(struct net *net)
{}

static struct pernet_operations recent_net_ops =;

static struct xt_match recent_mt_reg[] __read_mostly =;

static int __init recent_mt_init(void)
{}

static void __exit recent_mt_exit(void)
{}

module_init();
module_exit(recent_mt_exit);