#include <linux/jhash.h>
#include <linux/netfilter.h>
#include <linux/rcupdate.h>
#include <linux/rhashtable.h>
#include <linux/vmalloc.h>
#include <net/genetlink.h>
#include <net/netns/generic.h>
#include <uapi/linux/genetlink.h>
#include "ila.h"
struct ila_xlat_params { … };
struct ila_map { … };
#define MAX_LOCKS …
#define LOCKS_PER_CPU …
static int alloc_ila_locks(struct ila_net *ilan)
{ … }
static u32 hashrnd __read_mostly;
static __always_inline void __ila_hash_secret_init(void)
{ … }
static inline u32 ila_locator_hash(struct ila_locator loc)
{ … }
static inline spinlock_t *ila_get_lock(struct ila_net *ilan,
struct ila_locator loc)
{ … }
static inline int ila_cmp_wildcards(struct ila_map *ila,
struct ila_addr *iaddr, int ifindex)
{ … }
static inline int ila_cmp_params(struct ila_map *ila,
struct ila_xlat_params *xp)
{ … }
static int ila_cmpfn(struct rhashtable_compare_arg *arg,
const void *obj)
{ … }
static inline int ila_order(struct ila_map *ila)
{ … }
static const struct rhashtable_params rht_params = …;
static int parse_nl_config(struct genl_info *info,
struct ila_xlat_params *xp)
{ … }
static inline struct ila_map *ila_lookup_wildcards(struct ila_addr *iaddr,
int ifindex,
struct ila_net *ilan)
{ … }
static inline struct ila_map *ila_lookup_by_params(struct ila_xlat_params *xp,
struct ila_net *ilan)
{ … }
static inline void ila_release(struct ila_map *ila)
{ … }
static void ila_free_node(struct ila_map *ila)
{ … }
static void ila_free_cb(void *ptr, void *arg)
{ … }
static int ila_xlat_addr(struct sk_buff *skb, bool sir2ila);
static unsigned int
ila_nf_input(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
{ … }
static const struct nf_hook_ops ila_nf_hook_ops[] = …;
static int ila_add_mapping(struct net *net, struct ila_xlat_params *xp)
{ … }
static int ila_del_mapping(struct net *net, struct ila_xlat_params *xp)
{ … }
int ila_xlat_nl_cmd_add_mapping(struct sk_buff *skb, struct genl_info *info)
{ … }
int ila_xlat_nl_cmd_del_mapping(struct sk_buff *skb, struct genl_info *info)
{ … }
static inline spinlock_t *lock_from_ila_map(struct ila_net *ilan,
struct ila_map *ila)
{ … }
int ila_xlat_nl_cmd_flush(struct sk_buff *skb, struct genl_info *info)
{ … }
static int ila_fill_info(struct ila_map *ila, struct sk_buff *msg)
{ … }
static int ila_dump_info(struct ila_map *ila,
u32 portid, u32 seq, u32 flags,
struct sk_buff *skb, u8 cmd)
{ … }
int ila_xlat_nl_cmd_get_mapping(struct sk_buff *skb, struct genl_info *info)
{ … }
struct ila_dump_iter { … };
int ila_xlat_nl_dump_start(struct netlink_callback *cb)
{ … }
int ila_xlat_nl_dump_done(struct netlink_callback *cb)
{ … }
int ila_xlat_nl_dump(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
int ila_xlat_init_net(struct net *net)
{ … }
void ila_xlat_pre_exit_net(struct net *net)
{ … }
void ila_xlat_exit_net(struct net *net)
{ … }
static int ila_xlat_addr(struct sk_buff *skb, bool sir2ila)
{ … }