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