xref: /linux/Documentation/netlink/specs/rt-addr.yaml (revision 2d7eaeb05ae265bd64270376e6a2c0d80244771f)
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2---
3name: rt-addr
4protocol: netlink-raw
5uapi-header: linux/rtnetlink.h
6protonum: 0
7
8doc: >-
9  Address configuration over rtnetlink.
10
11definitions:
12  -
13    name: ifaddrmsg
14    type: struct
15    members:
16      -
17        name: ifa-family
18        type: u8
19      -
20        name: ifa-prefixlen
21        type: u8
22      -
23        name: ifa-flags
24        type: u8
25        enum: ifa-flags
26        enum-as-flags: true
27      -
28        name: ifa-scope
29        type: u8
30      -
31        name: ifa-index
32        type: u32
33  -
34    name: ifa-cacheinfo
35    type: struct
36    members:
37      -
38        name: ifa-prefered
39        type: u32
40      -
41        name: ifa-valid
42        type: u32
43      -
44        name: cstamp
45        type: u32
46      -
47        name: tstamp
48        type: u32
49
50  -
51    name: ifa-flags
52    type: flags
53    name-prefix: ifa-f-
54    enum-name:
55    entries:
56      -
57        name: secondary
58      -
59        name: nodad
60      -
61        name: optimistic
62      -
63        name: dadfailed
64      -
65        name: homeaddress
66      -
67        name: deprecated
68      -
69        name: tentative
70      -
71        name: permanent
72      -
73        name: managetempaddr
74      -
75        name: noprefixroute
76      -
77        name: mcautojoin
78      -
79        name: stable-privacy
80      -
81        name: global
82
83attribute-sets:
84  -
85    name: addr-attrs
86    name-prefix: ifa-
87    attributes:
88      -
89        name: address
90        type: binary
91        display-hint: ipv4-or-v6
92      -
93        name: local
94        type: binary
95        display-hint: ipv4-or-v6
96      -
97        name: label
98        type: string
99      -
100        name: broadcast
101        type: u32
102        byte-order: big-endian
103        display-hint: ipv4
104      -
105        name: anycast
106        type: binary
107      -
108        name: cacheinfo
109        type: binary
110        struct: ifa-cacheinfo
111      -
112        name: multicast
113        type: binary
114      -
115        name: flags
116        type: u32
117        enum: ifa-flags
118        enum-as-flags: true
119      -
120        name: rt-priority
121        type: u32
122      -
123        name: target-netnsid
124        type: s32
125      -
126        name: proto
127        type: u8
128      -
129        name: mc-users
130        type: u32
131
132
133operations:
134  fixed-header: ifaddrmsg
135  enum-model: directional
136  name-prefix: rtm-
137  list:
138    -
139      name: newaddr
140      doc: Add new address
141      attribute-set: addr-attrs
142      do:
143        request:
144          value: 20
145          attributes: &ifaddr-all
146            - address
147            - label
148            - local
149            - cacheinfo
150    -
151      name: deladdr
152      doc: Remove address
153      attribute-set: addr-attrs
154      do:
155        request:
156          value: 21
157          attributes:
158            - address
159            - local
160    -
161      name: getaddr
162      doc: Dump address information.
163      attribute-set: addr-attrs
164      dump:
165        request:
166          value: 22
167          attributes: []
168        reply:
169          value: 20
170          attributes: *ifaddr-all
171    -
172      name: getmulticast
173      doc: |
174        Get / dump multicast addresses. ifa-family must select the address
175        family: AF_INET or AF_INET6 for the IP multicast groups joined on
176        a device, AF_PACKET for the link-layer multicast addresses in the
177        device filter. Link-layer entries added explicitly, e.g. with
178        SIOCADDMULTI or "bridge fdb add ... self", rather than by a
179        protocol join are reported with the global flag set. For AF_PACKET
180        a non-zero ifa-index restricts the dump to that device and
181        ifa-prefixlen, ifa-flags and ifa-scope must be zero, AF_INET and
182        AF_INET6 apply this and target-netnsid with NETLINK_GET_STRICT_CHK
183        only.
184      attribute-set: addr-attrs
185      fixed-header: ifaddrmsg
186      do:
187        request:
188          value: 58
189          attributes: []
190        reply:
191          value: 58
192          attributes: &mcaddr-attrs
193            - multicast
194            - mc-users
195            - cacheinfo
196            - flags
197            - target-netnsid
198      dump:
199        request:
200          value: 58
201          attributes:
202            - target-netnsid
203        reply:
204          value: 58
205          attributes: *mcaddr-attrs
206
207mcast-groups:
208  list:
209    -
210      name: rtnlgrp-ipv4-ifaddr
211      value: 5
212    -
213      name: rtnlgrp-ipv6-ifaddr
214      value: 9
215