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/nfsd.yaml */ 4 /* YNL-GEN kernel source */ 5 6 #include <net/netlink.h> 7 #include <net/genetlink.h> 8 9 #include "netlink.h" 10 11 #include <uapi/linux/nfsd_netlink.h> 12 13 /* Common nested types */ 14 const struct nla_policy nfsd_sock_nl_policy[NFSD_A_SOCK_TRANSPORT_NAME + 1] = { 15 [NFSD_A_SOCK_ADDR] = { .type = NLA_BINARY, }, 16 [NFSD_A_SOCK_TRANSPORT_NAME] = { .type = NLA_NUL_STRING, }, 17 }; 18 19 const struct nla_policy nfsd_version_nl_policy[NFSD_A_VERSION_ENABLED + 1] = { 20 [NFSD_A_VERSION_MAJOR] = { .type = NLA_U32, }, 21 [NFSD_A_VERSION_MINOR] = { .type = NLA_U32, }, 22 [NFSD_A_VERSION_ENABLED] = { .type = NLA_FLAG, }, 23 }; 24 25 /* NFSD_CMD_THREADS_SET - do */ 26 static const struct nla_policy nfsd_threads_set_nl_policy[NFSD_A_SERVER_SCOPE + 1] = { 27 [NFSD_A_SERVER_THREADS] = { .type = NLA_U32, }, 28 [NFSD_A_SERVER_GRACETIME] = { .type = NLA_U32, }, 29 [NFSD_A_SERVER_LEASETIME] = { .type = NLA_U32, }, 30 [NFSD_A_SERVER_SCOPE] = { .type = NLA_NUL_STRING, }, 31 }; 32 33 /* NFSD_CMD_VERSION_SET - do */ 34 static const struct nla_policy nfsd_version_set_nl_policy[NFSD_A_SERVER_PROTO_VERSION + 1] = { 35 [NFSD_A_SERVER_PROTO_VERSION] = NLA_POLICY_NESTED(nfsd_version_nl_policy), 36 }; 37 38 /* NFSD_CMD_LISTENER_SET - do */ 39 static const struct nla_policy nfsd_listener_set_nl_policy[NFSD_A_SERVER_SOCK_ADDR + 1] = { 40 [NFSD_A_SERVER_SOCK_ADDR] = NLA_POLICY_NESTED(nfsd_sock_nl_policy), 41 }; 42 43 /* Ops table for nfsd */ 44 static const struct genl_split_ops nfsd_nl_ops[] = { 45 { 46 .cmd = NFSD_CMD_RPC_STATUS_GET, 47 .dumpit = nfsd_nl_rpc_status_get_dumpit, 48 .flags = GENL_CMD_CAP_DUMP, 49 }, 50 { 51 .cmd = NFSD_CMD_THREADS_SET, 52 .doit = nfsd_nl_threads_set_doit, 53 .policy = nfsd_threads_set_nl_policy, 54 .maxattr = NFSD_A_SERVER_SCOPE, 55 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 56 }, 57 { 58 .cmd = NFSD_CMD_THREADS_GET, 59 .doit = nfsd_nl_threads_get_doit, 60 .flags = GENL_CMD_CAP_DO, 61 }, 62 { 63 .cmd = NFSD_CMD_VERSION_SET, 64 .doit = nfsd_nl_version_set_doit, 65 .policy = nfsd_version_set_nl_policy, 66 .maxattr = NFSD_A_SERVER_PROTO_VERSION, 67 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 68 }, 69 { 70 .cmd = NFSD_CMD_VERSION_GET, 71 .doit = nfsd_nl_version_get_doit, 72 .flags = GENL_CMD_CAP_DO, 73 }, 74 { 75 .cmd = NFSD_CMD_LISTENER_SET, 76 .doit = nfsd_nl_listener_set_doit, 77 .policy = nfsd_listener_set_nl_policy, 78 .maxattr = NFSD_A_SERVER_SOCK_ADDR, 79 .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO, 80 }, 81 { 82 .cmd = NFSD_CMD_LISTENER_GET, 83 .doit = nfsd_nl_listener_get_doit, 84 .flags = GENL_CMD_CAP_DO, 85 }, 86 }; 87 88 struct genl_family nfsd_nl_family __ro_after_init = { 89 .name = NFSD_FAMILY_NAME, 90 .version = NFSD_FAMILY_VERSION, 91 .netnsok = true, 92 .parallel_ops = true, 93 .module = THIS_MODULE, 94 .split_ops = nfsd_nl_ops, 95 .n_split_ops = ARRAY_SIZE(nfsd_nl_ops), 96 }; 97