xref: /linux/drivers/net/team/team_nl.c (revision 621cde16e49b3ecf7d59a8106a20aaebfb4a59a9)
1 // SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2 /* Do not edit directly, auto-generated from: */
3 /*	Documentation/netlink/specs/team.yaml */
4 /* YNL-GEN kernel source */
5 
6 #include <net/netlink.h>
7 #include <net/genetlink.h>
8 
9 #include "team_nl.h"
10 
11 #include <uapi/linux/if_team.h>
12 
13 /* Common nested types */
14 const struct nla_policy team_attr_option_nl_policy[TEAM_ATTR_OPTION_ARRAY_INDEX + 1] = {
15 	[TEAM_ATTR_OPTION_NAME] = { .type = NLA_STRING, .len = TEAM_STRING_MAX_LEN, },
16 	[TEAM_ATTR_OPTION_CHANGED] = { .type = NLA_FLAG, },
17 	[TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8, },
18 	[TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY, },
19 	[TEAM_ATTR_OPTION_REMOVED] = { .type = NLA_FLAG, },
20 	[TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32, },
21 	[TEAM_ATTR_OPTION_ARRAY_INDEX] = { .type = NLA_U32, },
22 };
23 
24 const struct nla_policy team_item_option_nl_policy[TEAM_ATTR_ITEM_OPTION + 1] = {
25 	[TEAM_ATTR_ITEM_OPTION] = NLA_POLICY_NESTED(team_attr_option_nl_policy),
26 };
27 
28 /* Global operation policy for team */
29 const struct nla_policy team_nl_policy[TEAM_ATTR_LIST_OPTION + 1] = {
30 	[TEAM_ATTR_TEAM_IFINDEX] = { .type = NLA_U32, },
31 	[TEAM_ATTR_LIST_OPTION] = NLA_POLICY_NESTED(team_item_option_nl_policy),
32 };
33 
34 /* Ops table for team */
35 const struct genl_small_ops team_nl_ops[4] = {
36 	{
37 		.cmd		= TEAM_CMD_NOOP,
38 		.validate	= GENL_DONT_VALIDATE_STRICT,
39 		.doit		= team_nl_noop_doit,
40 	},
41 	{
42 		.cmd		= TEAM_CMD_OPTIONS_SET,
43 		.validate	= GENL_DONT_VALIDATE_STRICT,
44 		.doit		= team_nl_options_set_doit,
45 		.flags		= GENL_ADMIN_PERM,
46 	},
47 	{
48 		.cmd		= TEAM_CMD_OPTIONS_GET,
49 		.validate	= GENL_DONT_VALIDATE_STRICT,
50 		.doit		= team_nl_options_get_doit,
51 		.flags		= GENL_ADMIN_PERM,
52 	},
53 	{
54 		.cmd		= TEAM_CMD_PORT_LIST_GET,
55 		.validate	= GENL_DONT_VALIDATE_STRICT,
56 		.doit		= team_nl_port_list_get_doit,
57 		.flags		= GENL_ADMIN_PERM,
58 	},
59 };
60