genl.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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/handshake.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 "genl.h"
  9. #include <uapi/linux/handshake.h>
  10. /* HANDSHAKE_CMD_ACCEPT - do */
  11. static const struct nla_policy handshake_accept_nl_policy[HANDSHAKE_A_ACCEPT_HANDLER_CLASS + 1] = {
  12. [HANDSHAKE_A_ACCEPT_HANDLER_CLASS] = NLA_POLICY_MAX(NLA_U32, 2),
  13. };
  14. /* HANDSHAKE_CMD_DONE - do */
  15. static const struct nla_policy handshake_done_nl_policy[HANDSHAKE_A_DONE_REMOTE_AUTH + 1] = {
  16. [HANDSHAKE_A_DONE_STATUS] = { .type = NLA_U32, },
  17. [HANDSHAKE_A_DONE_SOCKFD] = { .type = NLA_S32, },
  18. [HANDSHAKE_A_DONE_REMOTE_AUTH] = { .type = NLA_U32, },
  19. };
  20. /* Ops table for handshake */
  21. static const struct genl_split_ops handshake_nl_ops[] = {
  22. {
  23. .cmd = HANDSHAKE_CMD_ACCEPT,
  24. .doit = handshake_nl_accept_doit,
  25. .policy = handshake_accept_nl_policy,
  26. .maxattr = HANDSHAKE_A_ACCEPT_HANDLER_CLASS,
  27. .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
  28. },
  29. {
  30. .cmd = HANDSHAKE_CMD_DONE,
  31. .doit = handshake_nl_done_doit,
  32. .policy = handshake_done_nl_policy,
  33. .maxattr = HANDSHAKE_A_DONE_REMOTE_AUTH,
  34. .flags = GENL_CMD_CAP_DO,
  35. },
  36. };
  37. static const struct genl_multicast_group handshake_nl_mcgrps[] = {
  38. [HANDSHAKE_NLGRP_NONE] = { "none", },
  39. [HANDSHAKE_NLGRP_TLSHD] = { "tlshd", },
  40. };
  41. struct genl_family handshake_nl_family __ro_after_init = {
  42. .name = HANDSHAKE_FAMILY_NAME,
  43. .version = HANDSHAKE_FAMILY_VERSION,
  44. .netnsok = true,
  45. .parallel_ops = true,
  46. .module = THIS_MODULE,
  47. .split_ops = handshake_nl_ops,
  48. .n_split_ops = ARRAY_SIZE(handshake_nl_ops),
  49. .mcgrps = handshake_nl_mcgrps,
  50. .n_mcgrps = ARRAY_SIZE(handshake_nl_mcgrps),
  51. };