netlink.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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/lockd.yaml */
  4. /* YNL-GEN kernel source */
  5. /* To regenerate run: tools/net/ynl/ynl-regen.sh */
  6. #include <net/netlink.h>
  7. #include <net/genetlink.h>
  8. #include "netlink.h"
  9. #include <uapi/linux/lockd_netlink.h>
  10. /* LOCKD_CMD_SERVER_SET - do */
  11. static const struct nla_policy lockd_server_set_nl_policy[LOCKD_A_SERVER_UDP_PORT + 1] = {
  12. [LOCKD_A_SERVER_GRACETIME] = { .type = NLA_U32, },
  13. [LOCKD_A_SERVER_TCP_PORT] = { .type = NLA_U16, },
  14. [LOCKD_A_SERVER_UDP_PORT] = { .type = NLA_U16, },
  15. };
  16. /* Ops table for lockd */
  17. static const struct genl_split_ops lockd_nl_ops[] = {
  18. {
  19. .cmd = LOCKD_CMD_SERVER_SET,
  20. .doit = lockd_nl_server_set_doit,
  21. .policy = lockd_server_set_nl_policy,
  22. .maxattr = LOCKD_A_SERVER_UDP_PORT,
  23. .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
  24. },
  25. {
  26. .cmd = LOCKD_CMD_SERVER_GET,
  27. .doit = lockd_nl_server_get_doit,
  28. .flags = GENL_CMD_CAP_DO,
  29. },
  30. };
  31. struct genl_family lockd_nl_family __ro_after_init = {
  32. .name = LOCKD_FAMILY_NAME,
  33. .version = LOCKD_FAMILY_VERSION,
  34. .netnsok = true,
  35. .parallel_ops = true,
  36. .module = THIS_MODULE,
  37. .split_ops = lockd_nl_ops,
  38. .n_split_ops = ARRAY_SIZE(lockd_nl_ops),
  39. };