linux/net/hsr/hsr_netlink.c

// SPDX-License-Identifier: GPL-2.0
/* Copyright 2011-2014 Autronica Fire and Security AS
 *
 * Author(s):
 *	2011-2014 Arvid Brodin, [email protected]
 *
 * Routines for handling Netlink messages for HSR and PRP.
 */

#include "hsr_netlink.h"
#include <linux/kernel.h>
#include <net/rtnetlink.h>
#include <net/genetlink.h>
#include "hsr_main.h"
#include "hsr_device.h"
#include "hsr_framereg.h"

static const struct nla_policy hsr_policy[IFLA_HSR_MAX + 1] =;

/* Here, it seems a netdevice has already been allocated for us, and the
 * hsr_dev_setup routine has been executed. Nice!
 */
static int hsr_newlink(struct net *src_net, struct net_device *dev,
		       struct nlattr *tb[], struct nlattr *data[],
		       struct netlink_ext_ack *extack)
{}

static void hsr_dellink(struct net_device *dev, struct list_head *head)
{}

static int hsr_fill_info(struct sk_buff *skb, const struct net_device *dev)
{}

static struct rtnl_link_ops hsr_link_ops __read_mostly =;

/* attribute policy */
static const struct nla_policy hsr_genl_policy[HSR_A_MAX + 1] =;

static struct genl_family hsr_genl_family;

static const struct genl_multicast_group hsr_mcgrps[] =;

/* This is called if for some node with MAC address addr, we only get frames
 * over one of the slave interfaces. This would indicate an open network ring
 * (i.e. a link has failed somewhere).
 */
void hsr_nl_ringerror(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN],
		      struct hsr_port *port)
{}

/* This is called when we haven't heard from the node with MAC address addr for
 * some time (just before the node is removed from the node table/list).
 */
void hsr_nl_nodedown(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN])
{}

/* HSR_C_GET_NODE_STATUS lets userspace query the internal HSR node table
 * about the status of a specific node in the network, defined by its MAC
 * address.
 *
 * Input: hsr ifindex, node mac address
 * Output: hsr ifindex, node mac address (copied from request),
 *	   age of latest frame from node over slave 1, slave 2 [ms]
 */
static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
{}

/* Get a list of MacAddressA of all nodes known to this node (including self).
 */
static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info)
{}

static const struct genl_small_ops hsr_ops[] =;

static struct genl_family hsr_genl_family __ro_after_init =;

int __init hsr_netlink_init(void)
{}

void __exit hsr_netlink_exit(void)
{}

MODULE_ALIAS_RTNL_LINK();