team_nl.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/team.yaml */
  4. /* YNL-GEN kernel source */
  5. #include <net/netlink.h>
  6. #include <net/genetlink.h>
  7. #include "team_nl.h"
  8. #include <uapi/linux/if_team.h>
  9. /* Common nested types */
  10. const struct nla_policy team_attr_option_nl_policy[TEAM_ATTR_OPTION_ARRAY_INDEX + 1] = {
  11. [TEAM_ATTR_OPTION_NAME] = { .type = NLA_STRING, .len = TEAM_STRING_MAX_LEN, },
  12. [TEAM_ATTR_OPTION_CHANGED] = { .type = NLA_FLAG, },
  13. [TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8, },
  14. [TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY, },
  15. [TEAM_ATTR_OPTION_REMOVED] = { .type = NLA_FLAG, },
  16. [TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32, },
  17. [TEAM_ATTR_OPTION_ARRAY_INDEX] = { .type = NLA_U32, },
  18. };
  19. const struct nla_policy team_item_option_nl_policy[TEAM_ATTR_ITEM_OPTION + 1] = {
  20. [TEAM_ATTR_ITEM_OPTION] = NLA_POLICY_NESTED(team_attr_option_nl_policy),
  21. };
  22. /* Global operation policy for team */
  23. const struct nla_policy team_nl_policy[TEAM_ATTR_LIST_OPTION + 1] = {
  24. [TEAM_ATTR_TEAM_IFINDEX] = { .type = NLA_U32, },
  25. [TEAM_ATTR_LIST_OPTION] = NLA_POLICY_NESTED(team_item_option_nl_policy),
  26. };
  27. /* Ops table for team */
  28. const struct genl_small_ops team_nl_ops[4] = {
  29. {
  30. .cmd = TEAM_CMD_NOOP,
  31. .validate = GENL_DONT_VALIDATE_STRICT,
  32. .doit = team_nl_noop_doit,
  33. },
  34. {
  35. .cmd = TEAM_CMD_OPTIONS_SET,
  36. .validate = GENL_DONT_VALIDATE_STRICT,
  37. .doit = team_nl_options_set_doit,
  38. .flags = GENL_ADMIN_PERM,
  39. },
  40. {
  41. .cmd = TEAM_CMD_OPTIONS_GET,
  42. .validate = GENL_DONT_VALIDATE_STRICT,
  43. .doit = team_nl_options_get_doit,
  44. .flags = GENL_ADMIN_PERM,
  45. },
  46. {
  47. .cmd = TEAM_CMD_PORT_LIST_GET,
  48. .validate = GENL_DONT_VALIDATE_STRICT,
  49. .doit = team_nl_port_list_get_doit,
  50. .flags = GENL_ADMIN_PERM,
  51. },
  52. };