if_team.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * include/linux/if_team.h - Network team device driver header
  3. * Copyright (c) 2011 Jiri Pirko <jpirko@redhat.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. */
  10. #ifndef _UAPI_LINUX_IF_TEAM_H_
  11. #define _UAPI_LINUX_IF_TEAM_H_
  12. #define TEAM_STRING_MAX_LEN 32
  13. /**********************************
  14. * NETLINK_GENERIC netlink family.
  15. **********************************/
  16. enum {
  17. TEAM_CMD_NOOP,
  18. TEAM_CMD_OPTIONS_SET,
  19. TEAM_CMD_OPTIONS_GET,
  20. TEAM_CMD_PORT_LIST_GET,
  21. __TEAM_CMD_MAX,
  22. TEAM_CMD_MAX = (__TEAM_CMD_MAX - 1),
  23. };
  24. enum {
  25. TEAM_ATTR_UNSPEC,
  26. TEAM_ATTR_TEAM_IFINDEX, /* u32 */
  27. TEAM_ATTR_LIST_OPTION, /* nest */
  28. TEAM_ATTR_LIST_PORT, /* nest */
  29. __TEAM_ATTR_MAX,
  30. TEAM_ATTR_MAX = __TEAM_ATTR_MAX - 1,
  31. };
  32. /* Nested layout of get/set msg:
  33. *
  34. * [TEAM_ATTR_LIST_OPTION]
  35. * [TEAM_ATTR_ITEM_OPTION]
  36. * [TEAM_ATTR_OPTION_*], ...
  37. * [TEAM_ATTR_ITEM_OPTION]
  38. * [TEAM_ATTR_OPTION_*], ...
  39. * ...
  40. * [TEAM_ATTR_LIST_PORT]
  41. * [TEAM_ATTR_ITEM_PORT]
  42. * [TEAM_ATTR_PORT_*], ...
  43. * [TEAM_ATTR_ITEM_PORT]
  44. * [TEAM_ATTR_PORT_*], ...
  45. * ...
  46. */
  47. enum {
  48. TEAM_ATTR_ITEM_OPTION_UNSPEC,
  49. TEAM_ATTR_ITEM_OPTION, /* nest */
  50. __TEAM_ATTR_ITEM_OPTION_MAX,
  51. TEAM_ATTR_ITEM_OPTION_MAX = __TEAM_ATTR_ITEM_OPTION_MAX - 1,
  52. };
  53. enum {
  54. TEAM_ATTR_OPTION_UNSPEC,
  55. TEAM_ATTR_OPTION_NAME, /* string */
  56. TEAM_ATTR_OPTION_CHANGED, /* flag */
  57. TEAM_ATTR_OPTION_TYPE, /* u8 */
  58. TEAM_ATTR_OPTION_DATA, /* dynamic */
  59. TEAM_ATTR_OPTION_REMOVED, /* flag */
  60. TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
  61. TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */
  62. __TEAM_ATTR_OPTION_MAX,
  63. TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,
  64. };
  65. enum {
  66. TEAM_ATTR_ITEM_PORT_UNSPEC,
  67. TEAM_ATTR_ITEM_PORT, /* nest */
  68. __TEAM_ATTR_ITEM_PORT_MAX,
  69. TEAM_ATTR_ITEM_PORT_MAX = __TEAM_ATTR_ITEM_PORT_MAX - 1,
  70. };
  71. enum {
  72. TEAM_ATTR_PORT_UNSPEC,
  73. TEAM_ATTR_PORT_IFINDEX, /* u32 */
  74. TEAM_ATTR_PORT_CHANGED, /* flag */
  75. TEAM_ATTR_PORT_LINKUP, /* flag */
  76. TEAM_ATTR_PORT_SPEED, /* u32 */
  77. TEAM_ATTR_PORT_DUPLEX, /* u8 */
  78. TEAM_ATTR_PORT_REMOVED, /* flag */
  79. __TEAM_ATTR_PORT_MAX,
  80. TEAM_ATTR_PORT_MAX = __TEAM_ATTR_PORT_MAX - 1,
  81. };
  82. /*
  83. * NETLINK_GENERIC related info
  84. */
  85. #define TEAM_GENL_NAME "team"
  86. #define TEAM_GENL_VERSION 0x1
  87. #define TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME "change_event"
  88. #endif /* _UAPI_LINUX_IF_TEAM_H_ */