xref: /linux/Documentation/netlink/specs/rt_neigh.yaml (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
3name: rt-neigh
4protocol: netlink-raw
5protonum: 0
6
7doc:
8  IP neighbour management over rtnetlink.
9
10definitions:
11  -
12    name: ndmsg
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: ifindex
24        type: s32
25      -
26        name: state
27        type: u16
28        enum: nud-state
29      -
30        name: flags
31        type: u8
32        enum: ntf-flags
33      -
34        name: type
35        type: u8
36        enum: rtm-type
37  -
38    name: ndtmsg
39    type: struct
40    members:
41      -
42        name: family
43        type: u8
44      -
45        name: pad
46        type: pad
47        len: 3
48  -
49    name: nud-state
50    type: flags
51    entries:
52      - incomplete
53      - reachable
54      - stale
55      - delay
56      - probe
57      - failed
58      - noarp
59      - permanent
60  -
61    name: ntf-flags
62    type: flags
63    entries:
64      - use
65      - self
66      - master
67      - proxy
68      - ext-learned
69      - offloaded
70      - sticky
71      - router
72  -
73    name: ntf-ext-flags
74    type: flags
75    entries:
76      - managed
77      - locked
78  -
79    name: rtm-type
80    type: enum
81    entries:
82      - unspec
83      - unicast
84      - local
85      - broadcast
86      - anycast
87      - multicast
88      - blackhole
89      - unreachable
90      - prohibit
91      - throw
92      - nat
93      - xresolve
94  -
95    name: nda-cacheinfo
96    type: struct
97    members:
98      -
99        name: confirmed
100        type: u32
101      -
102        name: used
103        type: u32
104      -
105        name: updated
106        type: u32
107      -
108        name: refcnt
109        type: u32
110  -
111    name: ndt-config
112    type: struct
113    members:
114      -
115        name: key-len
116        type: u16
117      -
118        name: entry-size
119        type: u16
120      -
121        name: entries
122        type: u32
123      -
124        name: last-flush
125        type: u32
126      -
127        name: last-rand
128        type: u32
129      -
130        name: hash-rnd
131        type: u32
132      -
133        name: hash-mask
134        type: u32
135      -
136        name: hash-chain-gc
137        type: u32
138      -
139        name: proxy-qlen
140        type: u32
141  -
142    name: ndt-stats
143    type: struct
144    members:
145      -
146        name: allocs
147        type: u64
148      -
149        name: destroys
150        type: u64
151      -
152        name: hash-grows
153        type: u64
154      -
155        name: res-failed
156        type: u64
157      -
158        name: lookups
159        type: u64
160      -
161        name: hits
162        type: u64
163      -
164        name: rcv-probes-mcast
165        type: u64
166      -
167        name: rcv-probes-ucast
168        type: u64
169      -
170        name: periodic-gc-runs
171        type: u64
172      -
173        name: forced-gc-runs
174        type: u64
175      -
176        name: table-fulls
177        type: u64
178
179attribute-sets:
180  -
181    name: neighbour-attrs
182    attributes:
183      -
184        name: unspec
185        type: binary
186        value: 0
187      -
188        name: dst
189        type: binary
190        display-hint: ipv4
191      -
192        name: lladr
193        type: binary
194        display-hint: mac
195      -
196        name: cacheinfo
197        type: binary
198        struct: nda-cacheinfo
199      -
200        name: probes
201        type: u32
202      -
203        name: vlan
204        type: u16
205      -
206        name: port
207        type: u16
208      -
209        name: vni
210        type: u32
211      -
212        name: ifindex
213        type: u32
214      -
215        name: master
216        type: u32
217      -
218        name: link-netnsid
219        type: s32
220      -
221        name: src-vni
222        type: u32
223      -
224        name: protocol
225        type: u8
226      -
227        name: nh-id
228        type: u32
229      -
230        name: fdb-ext-attrs
231        type: binary
232      -
233        name: flags-ext
234        type: u32
235        enum: ntf-ext-flags
236      -
237        name: ndm-state-mask
238        type: u16
239      -
240        name: ndm-flags-mask
241        type: u8
242  -
243    name: ndt-attrs
244    attributes:
245      -
246        name: name
247        type: string
248      -
249        name: thresh1
250        type: u32
251      -
252        name: thresh2
253        type: u32
254      -
255        name: thresh3
256        type: u32
257      -
258        name: config
259        type: binary
260        struct: ndt-config
261      -
262        name: parms
263        type: nest
264        nested-attributes: ndtpa-attrs
265      -
266        name: stats
267        type: binary
268        struct: ndt-stats
269      -
270        name: gc-interval
271        type: u64
272      -
273        name: pad
274        type: pad
275  -
276    name: ndtpa-attrs
277    attributes:
278      -
279        name: ifindex
280        type: u32
281      -
282        name: refcnt
283        type: u32
284      -
285        name: reachable-time
286        type: u64
287      -
288        name: base-reachable-time
289        type: u64
290      -
291        name: retrans-time
292        type: u64
293      -
294        name: gc-staletime
295        type: u64
296      -
297        name: delay-probe-time
298        type: u64
299      -
300        name: queue-len
301        type: u32
302      -
303        name: app-probes
304        type: u32
305      -
306        name: ucast-probes
307        type: u32
308      -
309        name: mcast-probes
310        type: u32
311      -
312        name: anycast-delay
313        type: u64
314      -
315        name: proxy-delay
316        type: u64
317      -
318        name: proxy-qlen
319        type: u32
320      -
321        name: locktime
322        type: u64
323      -
324        name: queue-lenbytes
325        type: u32
326      -
327        name: mcast-reprobes
328        type: u32
329      -
330        name: pad
331        type: pad
332      -
333        name: interval-probe-time-ms
334        type: u64
335
336operations:
337  enum-model: directional
338  list:
339    -
340      name: newneigh
341      doc: Add new neighbour entry
342      fixed-header: ndmsg
343      attribute-set: neighbour-attrs
344      do:
345        request:
346          value: 28
347          attributes: &neighbour-all
348            - dst
349            - lladdr
350            - probes
351            - vlan
352            - port
353            - vni
354            - ifindex
355            - master
356            - protocol
357            - nh-id
358            - flags-ext
359            - fdb-ext-attrs
360    -
361      name: delneigh
362      doc: Remove an existing neighbour entry
363      fixed-header: ndmsg
364      attribute-set: neighbour-attrs
365      do:
366        request:
367          value: 29
368          attributes:
369            - dst
370            - ifindex
371    -
372      name: delneigh-ntf
373      doc: Notify a neighbour deletion
374      value: 29
375      notify: delneigh
376      fixed-header: ndmsg
377    -
378      name: getneigh
379      doc: Get or dump neighbour entries
380      fixed-header: ndmsg
381      attribute-set: neighbour-attrs
382      do:
383        request:
384          value: 30
385          attributes:
386            - dst
387        reply:
388          value: 28
389          attributes: *neighbour-all
390      dump:
391        request:
392          attributes:
393            - ifindex
394            - master
395        reply:
396          attributes: *neighbour-all
397    -
398      name: newneigh-ntf
399      doc: Notify a neighbour creation
400      value: 28
401      notify: getneigh
402      fixed-header: ndmsg
403    -
404      name: getneightbl
405      doc: Get or dump neighbour tables
406      fixed-header: ndtmsg
407      attribute-set: ndt-attrs
408      dump:
409        request:
410          value: 66
411        reply:
412          value: 64
413          attributes:
414            - name
415            - thresh1
416            - thresh2
417            - thresh3
418            - config
419            - parms
420            - stats
421            - gc-interval
422    -
423      name: setneightbl
424      doc: Set neighbour tables
425      fixed-header: ndtmsg
426      attribute-set: ndt-attrs
427      do:
428        request:
429          value: 67
430          attributes:
431            - name
432            - thresh1
433            - thresh2
434            - thresh3
435            - parms
436            - gc-interval
437
438mcast-groups:
439  list:
440    -
441      name: rtnlgrp-neigh
442      value: 3
443