#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <net/genetlink.h>
#include <net/ncsi.h>
#include <linux/skbuff.h>
#include <net/sock.h>
#include <uapi/linux/ncsi.h>
#include "internal.h"
#include "ncsi-pkt.h"
#include "ncsi-netlink.h"
static struct genl_family ncsi_genl_family;
static const struct nla_policy ncsi_genl_policy[NCSI_ATTR_MAX + 1] = …;
static struct ncsi_dev_priv *ndp_from_ifindex(struct net *net, u32 ifindex)
{ … }
static int ncsi_write_channel_info(struct sk_buff *skb,
struct ncsi_dev_priv *ndp,
struct ncsi_channel *nc)
{ … }
static int ncsi_write_package_info(struct sk_buff *skb,
struct ncsi_dev_priv *ndp, unsigned int id)
{ … }
static int ncsi_pkg_info_nl(struct sk_buff *msg, struct genl_info *info)
{ … }
static int ncsi_pkg_info_all_nl(struct sk_buff *skb,
struct netlink_callback *cb)
{ … }
static int ncsi_set_interface_nl(struct sk_buff *msg, struct genl_info *info)
{ … }
static int ncsi_clear_interface_nl(struct sk_buff *msg, struct genl_info *info)
{ … }
static int ncsi_send_cmd_nl(struct sk_buff *msg, struct genl_info *info)
{ … }
int ncsi_send_netlink_rsp(struct ncsi_request *nr,
struct ncsi_package *np,
struct ncsi_channel *nc)
{ … }
int ncsi_send_netlink_timeout(struct ncsi_request *nr,
struct ncsi_package *np,
struct ncsi_channel *nc)
{ … }
int ncsi_send_netlink_err(struct net_device *dev,
u32 snd_seq,
u32 snd_portid,
const struct nlmsghdr *nlhdr,
int err)
{ … }
static int ncsi_set_package_mask_nl(struct sk_buff *msg,
struct genl_info *info)
{ … }
static int ncsi_set_channel_mask_nl(struct sk_buff *msg,
struct genl_info *info)
{ … }
static const struct genl_small_ops ncsi_ops[] = …;
static struct genl_family ncsi_genl_family __ro_after_init = …;
static int __init ncsi_init_netlink(void)
{ … }
subsys_initcall(ncsi_init_netlink);