#include <linux/module.h>
#include <linux/ip.h>
#include <linux/skbuff.h>
#include <linux/errno.h>
#include <linux/netlink.h>
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <net/netlink.h>
#include <linux/netfilter/ipset/ip_set.h>
#include <linux/netfilter/ipset/ip_set_bitmap.h>
#include <linux/netfilter/ipset/ip_set_getport.h>
#define IPSET_TYPE_REV_MIN …
#define IPSET_TYPE_REV_MAX …
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
IP_SET_MODULE_DESC(…) …;
MODULE_ALIAS(…) …;
#define MTYPE …
struct bitmap_port { … };
struct bitmap_port_adt_elem { … };
static u16
port_to_id(const struct bitmap_port *m, u16 port)
{ … }
static int
bitmap_port_do_test(const struct bitmap_port_adt_elem *e,
const struct bitmap_port *map, size_t dsize)
{ … }
static int
bitmap_port_gc_test(u16 id, const struct bitmap_port *map, size_t dsize)
{ … }
static int
bitmap_port_do_add(const struct bitmap_port_adt_elem *e,
struct bitmap_port *map, u32 flags, size_t dsize)
{ … }
static int
bitmap_port_do_del(const struct bitmap_port_adt_elem *e,
struct bitmap_port *map)
{ … }
static int
bitmap_port_do_list(struct sk_buff *skb, const struct bitmap_port *map, u32 id,
size_t dsize)
{ … }
static int
bitmap_port_do_head(struct sk_buff *skb, const struct bitmap_port *map)
{ … }
static bool
ip_set_get_ip_port(const struct sk_buff *skb, u8 pf, bool src, __be16 *port)
{ … }
static int
bitmap_port_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_port_uadt(struct ip_set *set, struct nlattr *tb[],
enum ipset_adt adt, u32 *lineno, u32 flags, bool retried)
{ … }
static bool
bitmap_port_same_set(const struct ip_set *a, const struct ip_set *b)
{ … }
struct bitmap_port_elem { … };
#include "ip_set_bitmap_gen.h"
static bool
init_map_port(struct ip_set *set, struct bitmap_port *map,
u16 first_port, u16 last_port)
{ … }
static int
bitmap_port_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
u32 flags)
{ … }
static struct ip_set_type bitmap_port_type = …;
static int __init
bitmap_port_init(void)
{ … }
static void __exit
bitmap_port_fini(void)
{ … }
module_init(…) …;
module_exit(bitmap_port_fini);