team.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
  2. ---
  3. name: team
  4. protocol: genetlink-legacy
  5. doc: |
  6. Network team device driver.
  7. c-family-name: team-genl-name
  8. c-version-name: team-genl-version
  9. kernel-policy: global
  10. uapi-header: linux/if_team.h
  11. definitions:
  12. -
  13. name: string-max-len
  14. type: const
  15. value: 32
  16. -
  17. name: genl-change-event-mc-grp-name
  18. type: const
  19. value: change_event
  20. attribute-sets:
  21. -
  22. name: team
  23. doc: |
  24. The team nested layout of get/set msg looks like::
  25. [TEAM_ATTR_LIST_OPTION]
  26. [TEAM_ATTR_ITEM_OPTION]
  27. [TEAM_ATTR_OPTION_*], ...
  28. [TEAM_ATTR_ITEM_OPTION]
  29. [TEAM_ATTR_OPTION_*], ...
  30. ...
  31. [TEAM_ATTR_LIST_PORT]
  32. [TEAM_ATTR_ITEM_PORT]
  33. [TEAM_ATTR_PORT_*], ...
  34. [TEAM_ATTR_ITEM_PORT]
  35. [TEAM_ATTR_PORT_*], ...
  36. ...
  37. name-prefix: team-attr-
  38. attributes:
  39. -
  40. name: unspec
  41. type: unused
  42. value: 0
  43. -
  44. name: team-ifindex
  45. type: u32
  46. -
  47. name: list-option
  48. type: nest
  49. nested-attributes: item-option
  50. -
  51. name: list-port
  52. type: nest
  53. nested-attributes: item-port
  54. -
  55. name: item-option
  56. name-prefix: team-attr-item-
  57. attr-cnt-name: __team-attr-item-option-max
  58. attr-max-name: team-attr-item-option-max
  59. attributes:
  60. -
  61. name: option-unspec
  62. type: unused
  63. value: 0
  64. -
  65. name: option
  66. type: nest
  67. nested-attributes: attr-option
  68. -
  69. name: attr-option
  70. name-prefix: team-attr-option-
  71. attributes:
  72. -
  73. name: unspec
  74. type: unused
  75. value: 0
  76. -
  77. name: name
  78. type: string
  79. checks:
  80. max-len: string-max-len
  81. unterminated-ok: true
  82. -
  83. name: changed
  84. type: flag
  85. -
  86. name: type
  87. type: u8
  88. -
  89. name: data
  90. type: binary
  91. -
  92. name: removed
  93. type: flag
  94. -
  95. name: port-ifindex
  96. type: u32
  97. doc: for per-port options
  98. -
  99. name: array-index
  100. type: u32
  101. doc: for array options
  102. -
  103. name: item-port
  104. name-prefix: team-attr-item-
  105. attr-cnt-name: __team-attr-item-port-max
  106. attr-max-name: team-attr-item-port-max
  107. attributes:
  108. -
  109. name: port-unspec
  110. type: unused
  111. value: 0
  112. -
  113. name: port
  114. type: nest
  115. nested-attributes: attr-port
  116. -
  117. name: attr-port
  118. name-prefix: team-attr-port-
  119. attributes:
  120. -
  121. name: unspec
  122. type: unused
  123. value: 0
  124. -
  125. name: ifindex
  126. type: u32
  127. -
  128. name: changed
  129. type: flag
  130. -
  131. name: linkup
  132. type: flag
  133. -
  134. name: speed
  135. type: u32
  136. -
  137. name: duplex
  138. type: u8
  139. -
  140. name: removed
  141. type: flag
  142. operations:
  143. list:
  144. -
  145. name: noop
  146. doc: No operation
  147. value: 0
  148. attribute-set: team
  149. dont-validate: [strict]
  150. do:
  151. # Actually it only reply the team netlink family
  152. reply:
  153. attributes:
  154. - team-ifindex
  155. -
  156. name: options-set
  157. doc: Set team options
  158. attribute-set: team
  159. dont-validate: [strict]
  160. flags: [admin-perm]
  161. do:
  162. request: &option_attrs
  163. attributes:
  164. - team-ifindex
  165. - list-option
  166. reply: *option_attrs
  167. -
  168. name: options-get
  169. doc: Get team options info
  170. attribute-set: team
  171. dont-validate: [strict]
  172. flags: [admin-perm]
  173. do:
  174. request:
  175. attributes:
  176. - team-ifindex
  177. reply: *option_attrs
  178. -
  179. name: port-list-get
  180. doc: Get team ports info
  181. attribute-set: team
  182. dont-validate: [strict]
  183. flags: [admin-perm]
  184. do:
  185. request:
  186. attributes:
  187. - team-ifindex
  188. reply: &port_attrs
  189. attributes:
  190. - team-ifindex
  191. - list-port