1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
3name: rt-route
4protocol: netlink-raw
5protonum: 0
6
7doc:
8  Route configuration over rtnetlink.
9
10definitions:
11  -
12    name: rtm-type
13    name-prefix: rtn-
14    type: enum
15    entries:
16      - unspec
17      - unicast
18      - local
19      - broadcast
20      - anycast
21      - multicast
22      - blackhole
23      - unreachable
24      - prohibit
25      - throw
26      - nat
27      - xresolve
28  -
29    name: rtmsg
30    type: struct
31    members:
32      -
33        name: rtm-family
34        type: u8
35      -
36        name: rtm-dst-len
37        type: u8
38      -
39        name: rtm-src-len
40        type: u8
41      -
42        name: rtm-tos
43        type: u8
44      -
45        name: rtm-table
46        type: u8
47      -
48        name: rtm-protocol
49        type: u8
50      -
51        name: rtm-scope
52        type: u8
53      -
54        name: rtm-type
55        type: u8
56        enum: rtm-type
57      -
58        name: rtm-flags
59        type: u32
60  -
61    name: rta-cacheinfo
62    type: struct
63    members:
64      -
65        name: rta-clntref
66        type: u32
67      -
68        name: rta-lastuse
69        type: u32
70      -
71        name: rta-expires
72        type: u32
73      -
74        name: rta-error
75        type: u32
76      -
77        name: rta-used
78        type: u32
79
80attribute-sets:
81  -
82    name: route-attrs
83    name-prefix: rta-
84    attributes:
85      -
86        name: dst
87        type: binary
88        display-hint: ipv4
89      -
90        name: src
91        type: binary
92        display-hint: ipv4
93      -
94        name: iif
95        type: u32
96      -
97        name: oif
98        type: u32
99      -
100        name: gateway
101        type: binary
102        display-hint: ipv4
103      -
104        name: priority
105        type: u32
106      -
107        name: prefsrc
108        type: binary
109        display-hint: ipv4
110      -
111        name: metrics
112        type: nest
113        nested-attributes: metrics
114      -
115        name: multipath
116        type: binary
117      -
118        name: protoinfo # not used
119        type: binary
120      -
121        name: flow
122        type: u32
123      -
124        name: cacheinfo
125        type: binary
126        struct: rta-cacheinfo
127      -
128        name: session # not used
129        type: binary
130      -
131        name: mp-algo # not used
132        type: binary
133      -
134        name: table
135        type: u32
136      -
137        name: mark
138        type: u32
139      -
140        name: mfc-stats
141        type: binary
142      -
143        name: via
144        type: binary
145      -
146        name: newdst
147        type: binary
148      -
149        name: pref
150        type: u8
151      -
152        name: encap-type
153        type: u16
154      -
155        name: encap
156        type: binary # tunnel specific nest
157      -
158        name: expires
159        type: u32
160      -
161        name: pad
162        type: binary
163      -
164        name: uid
165        type: u32
166      -
167        name: ttl-propagate
168        type: u8
169      -
170        name: ip-proto
171        type: u8
172      -
173        name: sport
174        type: u16
175      -
176        name: dport
177        type: u16
178      -
179        name: nh-id
180        type: u32
181      -
182        name: flowlabel
183        type: u32
184        byte-order: big-endian
185        display-hint: hex
186  -
187    name: metrics
188    name-prefix: rtax-
189    attributes:
190      -
191        name: unspec
192        type: unused
193        value: 0
194      -
195        name: lock
196        type: u32
197      -
198        name: mtu
199        type: u32
200      -
201        name: window
202        type: u32
203      -
204        name: rtt
205        type: u32
206      -
207        name: rttvar
208        type: u32
209      -
210        name: ssthresh
211        type: u32
212      -
213        name: cwnd
214        type: u32
215      -
216        name: advmss
217        type: u32
218      -
219        name: reordering
220        type: u32
221      -
222        name: hoplimit
223        type: u32
224      -
225        name: initcwnd
226        type: u32
227      -
228        name: features
229        type: u32
230      -
231        name: rto-min
232        type: u32
233      -
234        name: initrwnd
235        type: u32
236      -
237        name: quickack
238        type: u32
239      -
240        name: cc-algo
241        type: string
242      -
243        name: fastopen-no-cookie
244        type: u32
245
246operations:
247  enum-model: directional
248  list:
249    -
250      name: getroute
251      doc: Dump route information.
252      attribute-set: route-attrs
253      fixed-header: rtmsg
254      do:
255        request:
256          value: 26
257          attributes:
258            - rtm-family
259            - src
260            - rtm-src-len
261            - dst
262            - rtm-dst-len
263            - iif
264            - oif
265            - ip-proto
266            - sport
267            - dport
268            - mark
269            - uid
270            - flowlabel
271        reply:
272          value: 24
273          attributes: &all-route-attrs
274            - rtm-family
275            - rtm-dst-len
276            - rtm-src-len
277            - rtm-tos
278            - rtm-table
279            - rtm-protocol
280            - rtm-scope
281            - rtm-type
282            - rtm-flags
283            - dst
284            - src
285            - iif
286            - oif
287            - gateway
288            - priority
289            - prefsrc
290            - metrics
291            - multipath
292            - flow
293            - cacheinfo
294            - table
295            - mark
296            - mfc-stats
297            - via
298            - newdst
299            - pref
300            - encap-type
301            - encap
302            - expires
303            - pad
304            - uid
305            - ttl-propagate
306            - ip-proto
307            - sport
308            - dport
309            - nh-id
310            - flowlabel
311      dump:
312        request:
313          value: 26
314          attributes:
315            - rtm-family
316        reply:
317          value: 24
318          attributes: *all-route-attrs
319    -
320      name: newroute
321      doc: Create a new route
322      attribute-set: route-attrs
323      fixed-header: rtmsg
324      do:
325        request:
326          value: 24
327          attributes: *all-route-attrs
328    -
329      name: delroute
330      doc: Delete an existing route
331      attribute-set: route-attrs
332      fixed-header: rtmsg
333      do:
334        request:
335          value: 25
336          attributes: *all-route-attrs
337