xref: /linux/Documentation/netlink/specs/rt_rule.yaml (revision 0ad9617c78acbc71373fb341a6f75d4012b01d69)
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
3name: rt-rule
4protocol: netlink-raw
5protonum: 0
6
7doc:
8  FIB rule management over rtnetlink.
9
10definitions:
11  -
12    name: rtgenmsg
13    type: struct
14    members:
15      -
16        name: family
17        type: u8
18      -
19        name: pad
20        type: pad
21        len: 3
22  -
23    name: fib-rule-hdr
24    type: struct
25    members:
26      -
27        name: family
28        type: u8
29      -
30        name: dst-len
31        type: u8
32      -
33        name: src-len
34        type: u8
35      -
36        name: tos
37        type: u8
38      -
39        name: table
40        type: u8
41      -
42        name: res1
43        type: pad
44        len: 1
45      -
46        name: res2
47        type: pad
48        len: 1
49      -
50        name: action
51        type: u8
52        enum: fr-act
53      -
54        name: flags
55        type: u32
56  -
57    name: fr-act
58    type: enum
59    entries:
60      - unspec
61      - to-tbl
62      - goto
63      - nop
64      - res3
65      - res4
66      - blackhole
67      - unreachable
68      - prohibit
69  -
70    name: fib-rule-port-range
71    type: struct
72    members:
73      -
74        name: start
75        type: u16
76      -
77        name: end
78        type: u16
79  -
80    name: fib-rule-uid-range
81    type: struct
82    members:
83      -
84        name: start
85        type: u32
86      -
87        name: end
88        type: u32
89
90attribute-sets:
91  -
92    name: fib-rule-attrs
93    attributes:
94      -
95        name: dst
96        type: u32
97      -
98        name: src
99        type: u32
100      -
101        name: iifname
102        type: string
103      -
104        name: goto
105        type: u32
106      -
107        name: unused2
108        type: pad
109      -
110        name: priority
111        type: u32
112      -
113        name: unused3
114        type: pad
115      -
116        name: unused4
117        type: pad
118      -
119        name: unused5
120        type: pad
121      -
122        name: fwmark
123        type: u32
124        display-hint: hex
125      -
126        name: flow
127        type: u32
128      -
129        name: tun-id
130        type: u64
131      -
132        name: suppress-ifgroup
133        type: u32
134      -
135        name: suppress-prefixlen
136        type: u32
137        display-hint: hex
138      -
139        name: table
140        type: u32
141      -
142        name: fwmask
143        type: u32
144        display-hint: hex
145      -
146        name: oifname
147        type: string
148      -
149        name: pad
150        type: pad
151      -
152        name: l3mdev
153        type: u8
154      -
155        name: uid-range
156        type: binary
157        struct: fib-rule-uid-range
158      -
159        name: protocol
160        type: u8
161      -
162        name: ip-proto
163        type: u8
164      -
165        name: sport-range
166        type: binary
167        struct: fib-rule-port-range
168      -
169        name: dport-range
170        type: binary
171        struct: fib-rule-port-range
172      -
173        name: dscp
174        type: u8
175      -
176        name: flowlabel
177        type: u32
178        byte-order: big-endian
179        display-hint: hex
180      -
181        name: flowlabel-mask
182        type: u32
183        byte-order: big-endian
184        display-hint: hex
185
186operations:
187  enum-model: directional
188  fixed-header: fib-rule-hdr
189  list:
190    -
191      name: newrule
192      doc: Add new FIB rule
193      attribute-set: fib-rule-attrs
194      do:
195        request:
196          value: 32
197          attributes: &fib-rule-all
198            - iifname
199            - oifname
200            - priority
201            - fwmark
202            - flow
203            - tun-id
204            - fwmask
205            - table
206            - suppress-prefixlen
207            - suppress-ifgroup
208            - goto
209            - l3mdev
210            - uid-range
211            - protocol
212            - ip-proto
213            - sport-range
214            - dport-range
215            - dscp
216            - flowlabel
217            - flowlabel-mask
218    -
219      name: newrule-ntf
220      doc: Notify a rule creation
221      value: 32
222      notify: newrule
223    -
224      name: delrule
225      doc: Remove an existing FIB rule
226      attribute-set: fib-rule-attrs
227      do:
228        request:
229          value: 33
230          attributes: *fib-rule-all
231    -
232      name: delrule-ntf
233      doc: Notify a rule deletion
234      value: 33
235      notify: delrule
236    -
237      name: getrule
238      doc: Dump all FIB rules
239      attribute-set: fib-rule-attrs
240      dump:
241        request:
242          value: 34
243        reply:
244          value: 32
245          attributes: *fib-rule-all
246
247mcast-groups:
248  list:
249    -
250      name: rtnlgrp-ipv4-rule
251      value: 8
252    -
253      name: rtnlgrp-ipv6-rule
254      value: 19
255