linux/net/netfilter/ipset/ip_set_hash_ipmac.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2016 Tomasz Chilinski <[email protected]>
 */

/* Kernel module implementing an IP set type: the hash:ip,mac type */

#include <linux/jhash.h>
#include <linux/module.h>
#include <linux/ip.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/errno.h>
#include <linux/random.h>
#include <linux/if_ether.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/netlink.h>
#include <net/tcp.h>

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

#define IPSET_TYPE_REV_MIN
#define IPSET_TYPE_REV_MAX

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

/* Type specific function prefix */
#define HTYPE

/* IPv4 variant */

/* Member elements */
struct hash_ipmac4_elem {};

/* Common functions */

static bool
hash_ipmac4_data_equal(const struct hash_ipmac4_elem *e1,
		       const struct hash_ipmac4_elem *e2,
		       u32 *multi)
{}

static bool
hash_ipmac4_data_list(struct sk_buff *skb, const struct hash_ipmac4_elem *e)
{}

static void
hash_ipmac4_data_next(struct hash_ipmac4_elem *next,
		      const struct hash_ipmac4_elem *e)
{}

#define MTYPE
#define PF
#define HOST_MASK
#define HKEY_DATALEN
#include "ip_set_hash_gen.h"

static int
hash_ipmac4_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
hash_ipmac4_uadt(struct ip_set *set, struct nlattr *tb[],
		 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried)
{}

/* IPv6 variant */

/* Member elements */
struct hash_ipmac6_elem {};

/* Common functions */

static bool
hash_ipmac6_data_equal(const struct hash_ipmac6_elem *e1,
		       const struct hash_ipmac6_elem *e2,
		       u32 *multi)
{}

static bool
hash_ipmac6_data_list(struct sk_buff *skb, const struct hash_ipmac6_elem *e)
{}

static void
hash_ipmac6_data_next(struct hash_ipmac6_elem *next,
		      const struct hash_ipmac6_elem *e)
{}

#undef MTYPE
#undef PF
#undef HOST_MASK
#undef HKEY_DATALEN

#define MTYPE
#define PF
#define HOST_MASK
#define HKEY_DATALEN
#define IP_SET_EMIT_CREATE
#include "ip_set_hash_gen.h"

static int
hash_ipmac6_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
hash_ipmac6_uadt(struct ip_set *set, struct nlattr *tb[],
		 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried)
{}

static struct ip_set_type hash_ipmac_type __read_mostly =;

static int __init
hash_ipmac_init(void)
{}

static void __exit
hash_ipmac_fini(void)
{}

module_init();
module_exit(hash_ipmac_fini);