#include <linux/module.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/sockios.h>
#include <linux/net.h>
#include <linux/skbuff.h>
#include <linux/uaccess.h>
#include <net/sock.h>
#include <linux/init.h>
#include <linux/sched/signal.h>
#include <net/netlink.h>
#include <net/netns/generic.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nfnetlink.h>
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_ALIAS_NET_PF_PROTO(…);
MODULE_DESCRIPTION(…) …;
#define nfnl_dereference_protected(id) …
#define NFNL_MAX_ATTR_COUNT …
static unsigned int nfnetlink_pernet_id __read_mostly;
#ifdef CONFIG_NF_CONNTRACK_EVENTS
static DEFINE_SPINLOCK(nfnl_grp_active_lock);
#endif
struct nfnl_net { … };
static struct { … } table[NFNL_SUBSYS_COUNT];
static struct lock_class_key nfnl_lockdep_keys[NFNL_SUBSYS_COUNT];
static const char *const nfnl_lockdep_names[NFNL_SUBSYS_COUNT] = …;
static const int nfnl_group2type[NFNLGRP_MAX+1] = …;
static struct nfnl_net *nfnl_pernet(struct net *net)
{ … }
void nfnl_lock(__u8 subsys_id)
{ … }
EXPORT_SYMBOL_GPL(…);
void nfnl_unlock(__u8 subsys_id)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_PROVE_LOCKING
bool lockdep_nfnl_is_held(u8 subsys_id)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n)
{ … }
EXPORT_SYMBOL_GPL(…);
int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n)
{ … }
EXPORT_SYMBOL_GPL(…);
static inline const struct nfnetlink_subsystem *nfnetlink_get_subsys(u16 type)
{ … }
static inline const struct nfnl_callback *
nfnetlink_find_client(u16 type, const struct nfnetlink_subsystem *ss)
{ … }
int nfnetlink_has_listeners(struct net *net, unsigned int group)
{ … }
EXPORT_SYMBOL_GPL(…);
int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid,
unsigned int group, int echo, gfp_t flags)
{ … }
EXPORT_SYMBOL_GPL(…);
int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error)
{ … }
EXPORT_SYMBOL_GPL(…);
int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid)
{ … }
EXPORT_SYMBOL_GPL(…);
void nfnetlink_broadcast(struct net *net, struct sk_buff *skb, __u32 portid,
__u32 group, gfp_t allocation)
{ … }
EXPORT_SYMBOL_GPL(…);
static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{ … }
struct nfnl_err { … };
static int nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err,
const struct netlink_ext_ack *extack)
{ … }
static void nfnl_err_del(struct nfnl_err *nfnl_err)
{ … }
static void nfnl_err_reset(struct list_head *err_list)
{ … }
static void nfnl_err_deliver(struct list_head *err_list, struct sk_buff *skb)
{ … }
enum { … };
static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
u16 subsys_id, u32 genid)
{ … }
static const struct nla_policy nfnl_batch_policy[NFNL_BATCH_MAX + 1] = …;
static void nfnetlink_rcv_skb_batch(struct sk_buff *skb, struct nlmsghdr *nlh)
{ … }
static void nfnetlink_rcv(struct sk_buff *skb)
{ … }
static void nfnetlink_bind_event(struct net *net, unsigned int group)
{ … }
static int nfnetlink_bind(struct net *net, int group)
{ … }
static void nfnetlink_unbind(struct net *net, int group)
{ … }
static int __net_init nfnetlink_net_init(struct net *net)
{ … }
static void __net_exit nfnetlink_net_exit_batch(struct list_head *net_exit_list)
{ … }
static struct pernet_operations nfnetlink_net_ops = …;
static int __init nfnetlink_init(void)
{ … }
static void __exit nfnetlink_exit(void)
{ … }
module_init(…) …;
module_exit(nfnetlink_exit);