xref: /linux/drivers/net/team/team_nl.c (revision 8f7aa3d3c7323f4ca2768a9e74ebbe359c4f8f88)
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 /* To regenerate run: tools/net/ynl/ynl-regen.sh */
6 
7 #include <net/netlink.h>
8 #include <net/genetlink.h>
9 
10 #include "team_nl.h"
11 
12 #include <uapi/linux/if_team.h>
13 
14 /* Common nested types */
15 const struct nla_policy team_attr_option_nl_policy[TEAM_ATTR_OPTION_ARRAY_INDEX + 1] = {
16 	[TEAM_ATTR_OPTION_NAME] = { .type = NLA_STRING, .len = TEAM_STRING_MAX_LEN, },
17 	[TEAM_ATTR_OPTION_CHANGED] = { .type = NLA_FLAG, },
18 	[TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8, },
19 	[TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY, },
20 	[TEAM_ATTR_OPTION_REMOVED] = { .type = NLA_FLAG, },
21 	[TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32, },
22 	[TEAM_ATTR_OPTION_ARRAY_INDEX] = { .type = NLA_U32, },
23 };
24 
25 const struct nla_policy team_item_option_nl_policy[TEAM_ATTR_ITEM_OPTION + 1] = {
26 	[TEAM_ATTR_ITEM_OPTION] = NLA_POLICY_NESTED(team_attr_option_nl_policy),
27 };
28 
29 /* Global operation policy for team */
30 const struct nla_policy team_nl_policy[TEAM_ATTR_LIST_OPTION + 1] = {
31 	[TEAM_ATTR_TEAM_IFINDEX] = { .type = NLA_U32, },
32 	[TEAM_ATTR_LIST_OPTION] = NLA_POLICY_NESTED(team_item_option_nl_policy),
33 };
34 
35 /* Ops table for team */
36 const struct genl_small_ops team_nl_ops[4] = {
37 	{
38 		.cmd		= TEAM_CMD_NOOP,
39 		.validate	= GENL_DONT_VALIDATE_STRICT,
40 		.doit		= team_nl_noop_doit,
41 	},
42 	{
43 		.cmd		= TEAM_CMD_OPTIONS_SET,
44 		.validate	= GENL_DONT_VALIDATE_STRICT,
45 		.doit		= team_nl_options_set_doit,
46 		.flags		= GENL_ADMIN_PERM,
47 	},
48 	{
49 		.cmd		= TEAM_CMD_OPTIONS_GET,
50 		.validate	= GENL_DONT_VALIDATE_STRICT,
51 		.doit		= team_nl_options_get_doit,
52 		.flags		= GENL_ADMIN_PERM,
53 	},
54 	{
55 		.cmd		= TEAM_CMD_PORT_LIST_GET,
56 		.validate	= GENL_DONT_VALIDATE_STRICT,
57 		.doit		= team_nl_port_list_get_doit,
58 		.flags		= GENL_ADMIN_PERM,
59 	},
60 };
61