linux/net/netfilter/ipset/ip_set_bitmap_ip.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2000-2002 Joakim Axelsson <[email protected]>
 *                         Patrick Schaaf <[email protected]>
 * Copyright (C) 2003-2013 Jozsef Kadlecsik <[email protected]>
 */

/* Kernel module implementing an IP set type: the bitmap:ip type */

#include <linux/module.h>
#include <linux/ip.h>
#include <linux/skbuff.h>
#include <linux/errno.h>
#include <linux/bitops.h>
#include <linux/spinlock.h>
#include <linux/netlink.h>
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <net/netlink.h>
#include <net/tcp.h>

#include <linux/netfilter/ipset/pfxlen.h>
#include <linux/netfilter/ipset/ip_set.h>
#include <linux/netfilter/ipset/ip_set_bitmap.h>

#define IPSET_TYPE_REV_MIN
/*				1	   Counter support added */
/*				2	   Comment support added */
#define IPSET_TYPE_REV_MAX

MODULE_LICENSE();
MODULE_AUTHOR();
IP_SET_MODULE_DESC();
MODULE_ALIAS();

#define MTYPE
#define HOST_MASK

/* Type structure */
struct bitmap_ip {};

/* ADT structure for generic function args */
struct bitmap_ip_adt_elem {};

static u32
ip_to_id(const struct bitmap_ip *m, u32 ip)
{}

/* Common functions */

static int
bitmap_ip_do_test(const struct bitmap_ip_adt_elem *e,
		  struct bitmap_ip *map, size_t dsize)
{}

static int
bitmap_ip_gc_test(u16 id, const struct bitmap_ip *map, size_t dsize)
{}

static int
bitmap_ip_do_add(const struct bitmap_ip_adt_elem *e, struct bitmap_ip *map,
		 u32 flags, size_t dsize)
{}

static int
bitmap_ip_do_del(const struct bitmap_ip_adt_elem *e, struct bitmap_ip *map)
{}

static int
bitmap_ip_do_list(struct sk_buff *skb, const struct bitmap_ip *map, u32 id,
		  size_t dsize)
{}

static int
bitmap_ip_do_head(struct sk_buff *skb, const struct bitmap_ip *map)
{}

static int
bitmap_ip_kadt(struct ip_set *set, const struct sk_buff *skb,
	       const struct xt_action_param *par,
	       enum ipset_adt adt, struct ip_set_adt_opt *opt)
{}

static int
bitmap_ip_uadt(struct ip_set *set, struct nlattr *tb[],
	       enum ipset_adt adt, u32 *lineno, u32 flags, bool retried)
{}

static bool
bitmap_ip_same_set(const struct ip_set *a, const struct ip_set *b)
{}

/* Plain variant */

struct bitmap_ip_elem {};

#include "ip_set_bitmap_gen.h"

/* Create bitmap:ip type of sets */

static bool
init_map_ip(struct ip_set *set, struct bitmap_ip *map,
	    u32 first_ip, u32 last_ip,
	    u32 elements, u32 hosts, u8 netmask)
{}

static u32
range_to_mask(u32 from, u32 to, u8 *bits)
{}

static int
bitmap_ip_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
		 u32 flags)
{}

static struct ip_set_type bitmap_ip_type __read_mostly =;

static int __init
bitmap_ip_init(void)
{}

static void __exit
bitmap_ip_fini(void)
{}

module_init();
module_exit(bitmap_ip_fini);