xref: /linux/fs/lockd/netlink.c (revision 4f9786035f9e519db41375818e1d0b5f20da2f10)
1*9a28ac17SJeff Layton // SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2*9a28ac17SJeff Layton /* Do not edit directly, auto-generated from: */
3*9a28ac17SJeff Layton /*	Documentation/netlink/specs/lockd.yaml */
4*9a28ac17SJeff Layton /* YNL-GEN kernel source */
5*9a28ac17SJeff Layton 
6*9a28ac17SJeff Layton #include <net/netlink.h>
7*9a28ac17SJeff Layton #include <net/genetlink.h>
8*9a28ac17SJeff Layton 
9*9a28ac17SJeff Layton #include "netlink.h"
10*9a28ac17SJeff Layton 
11*9a28ac17SJeff Layton #include <uapi/linux/lockd_netlink.h>
12*9a28ac17SJeff Layton 
13*9a28ac17SJeff Layton /* LOCKD_CMD_SERVER_SET - do */
14*9a28ac17SJeff Layton static const struct nla_policy lockd_server_set_nl_policy[LOCKD_A_SERVER_UDP_PORT + 1] = {
15*9a28ac17SJeff Layton 	[LOCKD_A_SERVER_GRACETIME] = { .type = NLA_U32, },
16*9a28ac17SJeff Layton 	[LOCKD_A_SERVER_TCP_PORT] = { .type = NLA_U16, },
17*9a28ac17SJeff Layton 	[LOCKD_A_SERVER_UDP_PORT] = { .type = NLA_U16, },
18*9a28ac17SJeff Layton };
19*9a28ac17SJeff Layton 
20*9a28ac17SJeff Layton /* Ops table for lockd */
21*9a28ac17SJeff Layton static const struct genl_split_ops lockd_nl_ops[] = {
22*9a28ac17SJeff Layton 	{
23*9a28ac17SJeff Layton 		.cmd		= LOCKD_CMD_SERVER_SET,
24*9a28ac17SJeff Layton 		.doit		= lockd_nl_server_set_doit,
25*9a28ac17SJeff Layton 		.policy		= lockd_server_set_nl_policy,
26*9a28ac17SJeff Layton 		.maxattr	= LOCKD_A_SERVER_UDP_PORT,
27*9a28ac17SJeff Layton 		.flags		= GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
28*9a28ac17SJeff Layton 	},
29*9a28ac17SJeff Layton 	{
30*9a28ac17SJeff Layton 		.cmd	= LOCKD_CMD_SERVER_GET,
31*9a28ac17SJeff Layton 		.doit	= lockd_nl_server_get_doit,
32*9a28ac17SJeff Layton 		.flags	= GENL_CMD_CAP_DO,
33*9a28ac17SJeff Layton 	},
34*9a28ac17SJeff Layton };
35*9a28ac17SJeff Layton 
36*9a28ac17SJeff Layton struct genl_family lockd_nl_family __ro_after_init = {
37*9a28ac17SJeff Layton 	.name		= LOCKD_FAMILY_NAME,
38*9a28ac17SJeff Layton 	.version	= LOCKD_FAMILY_VERSION,
39*9a28ac17SJeff Layton 	.netnsok	= true,
40*9a28ac17SJeff Layton 	.parallel_ops	= true,
41*9a28ac17SJeff Layton 	.module		= THIS_MODULE,
42*9a28ac17SJeff Layton 	.split_ops	= lockd_nl_ops,
43*9a28ac17SJeff Layton 	.n_split_ops	= ARRAY_SIZE(lockd_nl_ops),
44*9a28ac17SJeff Layton };
45