genl.c 1.8 KB

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