xref: /linux/Documentation/netlink/specs/mptcp_pm.yaml (revision 03f76ddff5b04a808ae16c06418460151e2fdd4b)
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
270operations:
271  list:
272    -
273      name: unspec
274      doc: unused
275      value: 0
276    -
277      name: add-addr
278      doc: Add endpoint
279      attribute-set: endpoint
280      dont-validate: [strict]
281      flags: [uns-admin-perm]
282      do: &add-addr-attrs
283        request:
284          attributes:
285            - addr
286    -
287      name: del-addr
288      doc: Delete endpoint
289      attribute-set: endpoint
290      dont-validate: [strict]
291      flags: [uns-admin-perm]
292      do: *add-addr-attrs
293    -
294      name: get-addr
295      doc: Get endpoint information
296      attribute-set: attr
297      dont-validate: [strict]
298      do: &get-addr-attrs
299        request:
300          attributes:
301            - addr
302            - token
303        reply:
304          attributes:
305            - addr
306      dump:
307        reply:
308          attributes:
309            - addr
310    -
311      name: flush-addrs
312      doc: Flush addresses
313      attribute-set: endpoint
314      dont-validate: [strict]
315      flags: [uns-admin-perm]
316      do: *add-addr-attrs
317    -
318      name: set-limits
319      doc: Set protocol limits
320      attribute-set: attr
321      dont-validate: [strict]
322      flags: [uns-admin-perm]
323      do: &mptcp-limits
324        request:
325          attributes:
326            - rcv-add-addrs
327            - subflows
328    -
329      name: get-limits
330      doc: Get protocol limits
331      attribute-set: attr
332      dont-validate: [strict]
333      do: &mptcp-get-limits
334        request:
335          attributes:
336            - rcv-add-addrs
337            - subflows
338        reply:
339          attributes:
340            - rcv-add-addrs
341            - subflows
342    -
343      name: set-flags
344      doc: Change endpoint flags
345      attribute-set: attr
346      dont-validate: [strict]
347      flags: [uns-admin-perm]
348      do: &mptcp-set-flags
349        request:
350          attributes:
351            - addr
352            - token
353            - addr-remote
354    -
355      name: announce
356      doc: Announce new address
357      attribute-set: attr
358      dont-validate: [strict]
359      flags: [uns-admin-perm]
360      do: &announce-add
361        request:
362          attributes:
363            - addr
364            - token
365    -
366      name: remove
367      doc: Announce removal
368      attribute-set: attr
369      dont-validate: [strict]
370      flags: [uns-admin-perm]
371      do:
372        request:
373          attributes:
374            - token
375            - loc-id
376    -
377      name: subflow-create
378      doc: Create subflow
379      attribute-set: attr
380      dont-validate: [strict]
381      flags: [uns-admin-perm]
382      do: &sf-create
383        request:
384          attributes:
385            - addr
386            - token
387            - addr-remote
388    -
389      name: subflow-destroy
390      doc: Destroy subflow
391      attribute-set: attr
392      dont-validate: [strict]
393      flags: [uns-admin-perm]
394      do: *sf-create
395