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