xref: /linux/Documentation/netlink/specs/mptcp_pm.yaml (revision 8a5f956a9fb7d74fff681145082acfad5afa6bb8)
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2---
3name: mptcp_pm
4protocol: genetlink-legacy
5doc: Multipath TCP.
6
7c-family-name: mptcp-pm-name
8c-version-name: mptcp-pm-ver
9max-by-define: true
10kernel-policy: per-op
11cmd-cnt-name: --mptcp-pm-cmd-after-last
12
13definitions:
14  -
15    type: enum
16    name: event-type
17    enum-name: mptcp-event-type
18    name-prefix: mptcp-event-
19    entries:
20      -
21        name: unspec
22        doc: unused event
23      -
24        name: created
25        doc: >-
26          A new MPTCP connection has been created. It is the good time to
27          allocate memory and send ADD_ADDR if needed. Depending on the
28          traffic-patterns it can take a long time until the
29          MPTCP_EVENT_ESTABLISHED is sent.
30          Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
31          dport, [server-side], [flags].
32      -
33        name: established
34        doc: >-
35          A MPTCP connection is established (can start new subflows).
36          Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
37          dport, [server-side], [flags].
38      -
39        name: closed
40        doc: >-
41          A MPTCP connection has stopped.
42          Attribute: token.
43      -
44        name: announced
45        value: 6
46        doc: >-
47          A new address has been announced by the peer.
48          Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
49      -
50        name: removed
51        doc: >-
52          An address has been lost by the peer.
53          Attributes: token, rem_id.
54      -
55        name: sub-established
56        value: 10
57        doc: >-
58          A new subflow has been established. 'error' should not be set.
59          Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
60          daddr6, sport, dport, backup, if-idx [, error].
61      -
62        name: sub-closed
63        doc: >-
64          A subflow has been closed. An error (copy of sk_err) could be set if
65          an error has been detected for this subflow.
66          Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
67          daddr6, sport, dport, backup, if-idx [, error].
68      -
69        name: sub-priority
70        value: 13
71        doc: >-
72          The priority of a subflow has changed. 'error' should not be set.
73          Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
74          daddr6, sport, dport, backup, if-idx [, error].
75      -
76        name: listener-created
77        value: 15
78        doc: >-
79          A new PM listener is created.
80          Attributes: family, sport, saddr4 | saddr6.
81      -
82        name: listener-closed
83        doc: >-
84          A PM listener is closed.
85          Attributes: family, sport, saddr4 | saddr6.
86
87attribute-sets:
88  -
89    name: address
90    name-prefix: mptcp-pm-addr-attr-
91    attributes:
92      -
93        name: unspec
94        type: unused
95        value: 0
96      -
97        name: family
98        type: u16
99      -
100        name: id
101        type: u8
102      -
103        name: addr4
104        type: u32
105        byte-order: big-endian
106      -
107        name: addr6
108        type: binary
109        checks:
110          exact-len: 16
111      -
112        name: port
113        type: u16
114      -
115        name: flags
116        type: u32
117      -
118        name: if-idx
119        type: s32
120  -
121    name: subflow-attribute
122    name-prefix: mptcp-subflow-attr-
123    attributes:
124      -
125        name: unspec
126        type: unused
127        value: 0
128      -
129        name: token-rem
130        type: u32
131      -
132        name: token-loc
133        type: u32
134      -
135        name: relwrite-seq
136        type: u32
137      -
138        name: map-seq
139        type: u64
140      -
141        name: map-sfseq
142        type: u32
143      -
144        name: ssn-offset
145        type: u32
146      -
147        name: map-datalen
148        type: u16
149      -
150        name: flags
151        type: u32
152      -
153        name: id-rem
154        type: u8
155      -
156        name: id-loc
157        type: u8
158      -
159        name: pad
160        type: pad
161  -
162    name: endpoint
163    name-prefix: mptcp-pm-endpoint-
164    attributes:
165      -
166        name: addr
167        type: nest
168        nested-attributes: address
169  -
170    name: attr
171    name-prefix: mptcp-pm-attr-
172    attr-cnt-name: --mptcp-attr-after-last
173    attributes:
174      -
175        name: unspec
176        type: unused
177        value: 0
178      -
179        name: addr
180        type: nest
181        nested-attributes: address
182      -
183        name: rcv-add-addrs
184        type: u32
185      -
186        name: subflows
187        type: u32
188      -
189        name: token
190        type: u32
191      -
192        name: loc-id
193        type: u8
194      -
195        name: addr-remote
196        type: nest
197        nested-attributes: address
198  -
199    name: event-attr
200    enum-name: mptcp-event-attr
201    name-prefix: mptcp-attr-
202    attributes:
203      -
204        name: unspec
205        type: unused
206        value: 0
207      -
208        name: token
209        type: u32
210      -
211        name: family
212        type: u16
213      -
214        name: loc-id
215        type: u8
216      -
217        name: rem-id
218        type: u8
219      -
220        name: saddr4
221        type: u32
222        byte-order: big-endian
223      -
224        name: saddr6
225        type: binary
226        checks:
227          min-len: 16
228      -
229        name: daddr4
230        type: u32
231        byte-order: big-endian
232      -
233        name: daddr6
234        type: binary
235        checks:
236          min-len: 16
237      -
238        name: sport
239        type: u16
240        byte-order: big-endian
241      -
242        name: dport
243        type: u16
244        byte-order: big-endian
245      -
246        name: backup
247        type: u8
248      -
249        name: error
250        type: u8
251      -
252        name: flags
253        type: u16
254      -
255        name: timeout
256        type: u32
257      -
258        name: if-idx
259        type: s32
260      -
261        name: reset-reason
262        type: u32
263      -
264        name: reset-flags
265        type: u32
266      -
267        name: server-side
268        type: u8
269        doc: "Deprecated: use 'flags'"
270
271operations:
272  list:
273    -
274      name: unspec
275      doc: unused
276      value: 0
277    -
278      name: add-addr
279      doc: Add endpoint
280      attribute-set: endpoint
281      dont-validate: [strict]
282      flags: [uns-admin-perm]
283      do: &add-addr-attrs
284        request:
285          attributes:
286            - addr
287    -
288      name: del-addr
289      doc: Delete endpoint
290      attribute-set: endpoint
291      dont-validate: [strict]
292      flags: [uns-admin-perm]
293      do: *add-addr-attrs
294    -
295      name: get-addr
296      doc: Get endpoint information
297      attribute-set: attr
298      dont-validate: [strict]
299      do: &get-addr-attrs
300        request:
301          attributes:
302            - addr
303            - token
304        reply:
305          attributes:
306            - addr
307      dump:
308        reply:
309          attributes:
310            - addr
311    -
312      name: flush-addrs
313      doc: Flush addresses
314      attribute-set: endpoint
315      dont-validate: [strict]
316      flags: [uns-admin-perm]
317      do: *add-addr-attrs
318    -
319      name: set-limits
320      doc: Set protocol limits
321      attribute-set: attr
322      dont-validate: [strict]
323      flags: [uns-admin-perm]
324      do: &mptcp-limits
325        request:
326          attributes:
327            - rcv-add-addrs
328            - subflows
329    -
330      name: get-limits
331      doc: Get protocol limits
332      attribute-set: attr
333      dont-validate: [strict]
334      do: &mptcp-get-limits
335        request:
336          attributes:
337            - rcv-add-addrs
338            - subflows
339        reply:
340          attributes:
341            - rcv-add-addrs
342            - subflows
343    -
344      name: set-flags
345      doc: Change endpoint flags
346      attribute-set: attr
347      dont-validate: [strict]
348      flags: [uns-admin-perm]
349      do: &mptcp-set-flags
350        request:
351          attributes:
352            - addr
353            - token
354            - addr-remote
355    -
356      name: announce
357      doc: Announce new address
358      attribute-set: attr
359      dont-validate: [strict]
360      flags: [uns-admin-perm]
361      do: &announce-add
362        request:
363          attributes:
364            - addr
365            - token
366    -
367      name: remove
368      doc: Announce removal
369      attribute-set: attr
370      dont-validate: [strict]
371      flags: [uns-admin-perm]
372      do:
373        request:
374          attributes:
375            - token
376            - loc-id
377    -
378      name: subflow-create
379      doc: Create subflow
380      attribute-set: attr
381      dont-validate: [strict]
382      flags: [uns-admin-perm]
383      do: &sf-create
384        request:
385          attributes:
386            - addr
387            - token
388            - addr-remote
389    -
390      name: subflow-destroy
391      doc: Destroy subflow
392      attribute-set: attr
393      dont-validate: [strict]
394      flags: [uns-admin-perm]
395      do: *sf-create
396